Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ComputeShader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
teufelpa56439
ComputeShader
Commits
a1bac3b7
Commit
a1bac3b7
authored
Jan 2, 2018
by
Patrick Teufel
Browse files
Options
Downloads
Patches
Plain Diff
added performance measure
parent
95395d63
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ComputeShader/main.cpp
+12
-1
12 additions, 1 deletion
ComputeShader/main.cpp
with
12 additions
and
1 deletion
ComputeShader/main.cpp
+
12
−
1
View file @
a1bac3b7
...
@@ -45,8 +45,10 @@ void mainLoop() {
...
@@ -45,8 +45,10 @@ void mainLoop() {
const
int
samples
=
50
;
const
int
samples
=
50
;
float
time
[
samples
];
float
time
[
samples
];
int
index
=
0
;
int
index
=
0
;
UINT
i
=
0
;
double
startTime
=
glfwGetTime
();
while
(
!
glfwWindowShouldClose
(
window
)
&&
!
glfwGetKey
(
window
,
GLFW_KEY_ESCAPE
))
{
while
(
!
glfwWindowShouldClose
(
window
)
&&
!
glfwGetKey
(
window
,
GLFW_KEY_ESCAPE
)
&&
i
<
10000
)
{
GLUtils
::
checkForOpenGLError
(
__FILE__
,
__LINE__
);
GLUtils
::
checkForOpenGLError
(
__FILE__
,
__LINE__
);
scene
->
update
(
float
(
glfwGetTime
()));
scene
->
update
(
float
(
glfwGetTime
()));
scene
->
render
();
scene
->
render
();
...
@@ -69,6 +71,15 @@ void mainLoop() {
...
@@ -69,6 +71,15 @@ void mainLoop() {
strm
<<
" (fps: "
<<
fps
<<
")"
;
strm
<<
" (fps: "
<<
fps
<<
")"
;
glfwSetWindowTitle
(
window
,
strm
.
str
().
c_str
());
glfwSetWindowTitle
(
window
,
strm
.
str
().
c_str
());
}
}
i
++
;
}
stringstream
strm
;
strm
<<
title
;
strm
.
precision
(
4
);
strm
<<
" (duration: "
<<
glfwGetTime
()
-
startTime
<<
")"
;
glfwSetWindowTitle
(
window
,
strm
.
str
().
c_str
());
while
(
!
glfwWindowShouldClose
(
window
)
&&
!
glfwGetKey
(
window
,
GLFW_KEY_ESCAPE
))
{
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment