Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 75c17e4f authored by TAVERNIER Vincent's avatar TAVERNIER Vincent
Browse files

Remove binding changes from runtime measurement

parent 0e7d394a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment