Commit fdb376ea by Charlie Lao Committed by Commit Bot

Vulkan: minimize-gpu-work: Skip blit from offscreen fbo

Since we only care about driver state tracking logic, blit is unrelated here. This further reduce the noise of test result. Instead of blit and swap every N frame, we will issue glFlush for offscreen rendering. The onscreen will still issue swap every frame. Bug: b/186881553 Change-Id: Id048eaafa6dcef26d851fd19f069331d240e1bf5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2846527 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 3fc83291
...@@ -1154,13 +1154,22 @@ void TracePerfTest::drawBenchmark() ...@@ -1154,13 +1154,22 @@ void TracePerfTest::drawBenchmark()
if (params.surfaceType == SurfaceType::Offscreen) if (params.surfaceType == SurfaceType::Offscreen)
{ {
if (gMinimizeGPUWork)
{
// To keep GPU work minimum, we skip the blit.
glFlush();
mOffscreenFrameCount++;
}
else
{
GLint currentDrawFBO, currentReadFBO; GLint currentDrawFBO, currentReadFBO;
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &currentDrawFBO); glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &currentDrawFBO);
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &currentReadFBO); glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &currentReadFBO);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, glBindFramebuffer(
mOffscreenFramebuffers[mTotalFrameCount % mMaxOffscreenBufferCount]); GL_READ_FRAMEBUFFER,
mOffscreenFramebuffers[mOffscreenFrameCount % mMaxOffscreenBufferCount]);
uint32_t frameX = (mOffscreenFrameCount % kFramesPerXY) % kFramesPerX; uint32_t frameX = (mOffscreenFrameCount % kFramesPerXY) % kFramesPerX;
uint32_t frameY = (mOffscreenFrameCount % kFramesPerXY) / kFramesPerX; uint32_t frameY = (mOffscreenFrameCount % kFramesPerXY) / kFramesPerX;
...@@ -1169,8 +1178,8 @@ void TracePerfTest::drawBenchmark() ...@@ -1169,8 +1178,8 @@ void TracePerfTest::drawBenchmark()
if (gVerboseLogging) if (gVerboseLogging)
{ {
printf("Frame %d: x %d y %d (screen x %d, screen y %d)\n", mOffscreenFrameCount, frameX, printf("Frame %d: x %d y %d (screen x %d, screen y %d)\n", mOffscreenFrameCount,
frameY, windowX, windowY); frameX, frameY, windowX, windowY);
} }
GLboolean scissorTest = GL_FALSE; GLboolean scissorTest = GL_FALSE;
...@@ -1204,6 +1213,7 @@ void TracePerfTest::drawBenchmark() ...@@ -1204,6 +1213,7 @@ void TracePerfTest::drawBenchmark()
} }
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, currentDrawFBO); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, currentDrawFBO);
glBindFramebuffer(GL_READ_FRAMEBUFFER, currentReadFBO); glBindFramebuffer(GL_READ_FRAMEBUFFER, currentReadFBO);
}
mTotalFrameCount++; mTotalFrameCount++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment