Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
libshadertoy
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HUYNH Danh
libshadertoy
Commits
75c17e4f
Commit
75c17e4f
authored
7 years ago
by
TAVERNIER Vincent
Browse files
Options
Downloads
Patches
Plain Diff
Remove binding changes from runtime measurement
parent
0e7d394a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/shadertoy/RenderContext.hpp
+8
-0
8 additions, 0 deletions
include/shadertoy/RenderContext.hpp
src/RenderContext.cpp
+11
-0
11 additions, 0 deletions
src/RenderContext.cpp
src/ToyBuffer.cpp
+1
-7
1 addition, 7 deletions
src/ToyBuffer.cpp
with
20 additions
and
7 deletions
include/shadertoy/RenderContext.hpp
+
8
−
0
View file @
75c17e4f
...
...
@@ -240,6 +240,14 @@ public:
*/
void
RenderScreenQuad
();
/**
* @brief Render a screen quad using the current context
*
* @param timerQuery Query object to use for measuring the runtime of the
* draw call.
*/
void
RenderScreenQuad
(
OpenGL
::
Query
&
timerQuery
);
/**
* @brief Binds the texture containing the shadertoy result as well as
* a program which renders this texture to the viewport. Useful
...
...
This diff is collapsed.
Click to expand it.
src/RenderContext.cpp
+
11
−
0
View file @
75c17e4f
...
...
@@ -382,6 +382,17 @@ void RenderContext::RenderScreenQuad()
glCall
(
glDrawElements
,
GL_TRIANGLES
,
3
*
2
,
GL_UNSIGNED_INT
,
nullptr
);
}
void
RenderContext
::
RenderScreenQuad
(
OpenGL
::
Query
&
timerQuery
)
{
screenQuadCorners
.
Bind
(
GL_ARRAY_BUFFER
);
timerQuery
.
Begin
(
GL_TIME_ELAPSED
);
glCall
(
glDrawElements
,
GL_TRIANGLES
,
3
*
2
,
GL_UNSIGNED_INT
,
nullptr
);
timerQuery
.
End
(
GL_TIME_ELAPSED
);
}
void
RenderContext
::
BindResult
()
{
// Prepare prog and texture
...
...
This diff is collapsed.
Click to expand it.
src/ToyBuffer.cpp
+
1
−
7
View file @
75c17e4f
...
...
@@ -161,14 +161,8 @@ void ToyBuffer::Render()
for
(
auto
&
inputs
:
boundInputs
)
inputs
->
Apply
();
// Start query measurement
timeDeltaQuery
.
Begin
(
GL_TIME_ELAPSED
);
// Render the program
context
.
RenderScreenQuad
();
// End query measurement
timeDeltaQuery
.
End
(
GL_TIME_ELAPSED
);
context
.
RenderScreenQuad
(
timeDeltaQuery
);
// Swap texture object pointers
swap
(
sourceTex
,
targetTex
);
...
...
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