From 66dfc251fcd0f6acf0cf099b4d6005c9fbf72936 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 16 Nov 2015 19:56:43 -0800 Subject: [PATCH] OpenGL: Fix fast-forward on some OpenGL drivers where it may block early --- CHANGES | 1 + src/platform/qt/DisplayGL.cpp | 2 +- src/platform/sdl/gl-sdl.c | 2 +- src/platform/sdl/gles2-sdl.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 8bf1539d9..a9a5bf44f 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ Bugfixes: - GBA Memory: Fix unaligned out-of-bounds ROM loads - Qt: Add additional checks in CheatModel to prevent crashes - GBA Hardware: Fix Game Boy Player rumble in Pokemon Pinball + - OpenGL: Fix fast-forward on some OpenGL drivers where it may block early Misc: - GBA Audio: Implement missing flags on SOUNDCNT_X register diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index f9fe1356e..635d4a2ca 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -210,10 +210,10 @@ void PainterGL::draw() { } if (GBASyncWaitFrameStart(&m_context->sync, m_context->frameskip) || !m_queue.isEmpty()) { dequeue(); + GBASyncWaitFrameEnd(&m_context->sync); m_painter.begin(m_gl->context()->device()); performDraw(); m_painter.end(); - GBASyncWaitFrameEnd(&m_context->sync); m_backend.d.swap(&m_backend.d); } else { GBASyncWaitFrameEnd(&m_context->sync); diff --git a/src/platform/sdl/gl-sdl.c b/src/platform/sdl/gl-sdl.c index 12073b12a..976cc7d02 100644 --- a/src/platform/sdl/gl-sdl.c +++ b/src/platform/sdl/gl-sdl.c @@ -64,8 +64,8 @@ void GBASDLGLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* rend if (GBASyncWaitFrameStart(&context->sync, context->frameskip)) { v->postFrame(v, renderer->d.outputBuffer); } - v->drawFrame(v); GBASyncWaitFrameEnd(&context->sync); + v->drawFrame(v); v->swap(v); } } diff --git a/src/platform/sdl/gles2-sdl.c b/src/platform/sdl/gles2-sdl.c index a3a617471..e198a1602 100644 --- a/src/platform/sdl/gles2-sdl.c +++ b/src/platform/sdl/gles2-sdl.c @@ -117,8 +117,8 @@ void GBASDLGLES2Runloop(struct GBAThread* context, struct SDLSoftwareRenderer* r if (GBASyncWaitFrameStart(&context->sync, context->frameskip)) { v->postFrame(v, renderer->d.outputBuffer); } - v->drawFrame(v); GBASyncWaitFrameEnd(&context->sync); + v->drawFrame(v); #ifdef BUILD_RASPI eglSwapBuffers(renderer->display, renderer->surface); #else