Add limited support for frame pacing to EGLRenderer

This commit is contained in:
Cameron Gutman
2020-05-16 15:59:10 -07:00
parent 4bbe571f5f
commit 5f25e0d4e2

View File

@@ -401,8 +401,10 @@ bool EGLRenderer::initialize(PDECODER_PARAMETERS params)
glClear(GL_COLOR_BUFFER_BIT);
if (params->enableVsync) {
/* Try to use adaptive VSYNC */
if (SDL_GL_SetSwapInterval(-1))
// Try to use adaptive VSYNC unless we're using frame pacing.
// Frame pacing relies on us blocking in renderFrame() to
// match the display refresh rate.
if (params->enableFramePacing || SDL_GL_SetSwapInterval(-1))
SDL_GL_SetSwapInterval(1);
} else {
SDL_GL_SetSwapInterval(0);