Skip unnecessary glClear() on X11

This commit is contained in:
Cameron Gutman
2025-12-29 16:50:15 -06:00
parent 93dc6d6b60
commit e89f63b8fb

View File

@@ -803,7 +803,11 @@ void EGLRenderer::renderFrame(AVFrame* frame)
m_glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, imgs[i]);
}
glClear(GL_COLOR_BUFFER_BIT);
// We already called glClear() after last frame's SDL_GL_SwapWindow()
// to synchronize with our fence if swap buffers is blocking
if (!m_BlockingSwapBuffers) {
glClear(GL_COLOR_BUFFER_BIT);
}
int drawableWidth, drawableHeight;
SDL_GL_GetDrawableSize(m_Window, &drawableWidth, &drawableHeight);