all repos — mgba @ 045099507497291f0d18b4d09fca5c50feb0e9e5

mGBA Game Boy Advance Emulator

Qt: Force OpenGL paint engine creation thread (fixes #1642)
Vicki Pfau vi@endrift.com
Sat, 25 Jan 2020 15:10:15 -0800
commit

045099507497291f0d18b4d09fca5c50feb0e9e5

parent

cde4e1adee349cb162b12301c861de0a3460e7fb

2 files changed, 10 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -11,6 +11,7 @@ - GBA Video: Fix OAM not invalidating after reset (fixes mgba.io/i/1630)

Other fixes: - Qt: Only dynamically reset video scale if a game is running - Qt: Fix race condition with proxied video events + - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) 0.8.0: (2020-01-21) Features:
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -271,6 +271,15 @@ #endif

m_gl->makeCurrent(m_surface); m_window = new QOpenGLPaintDevice; + { + // XXX: Qt creates TLS for OpenGL objects in the local thread + // We need to prevent that thread from being the painter thread + // Qt also caches the engine object on the device if a different + // engine is active, so let's make a temporary one + QOpenGLPaintDevice* fakeDevice = new QOpenGLPaintDevice; + QPainter fakePainter(fakeDevice); + m_window->paintEngine(); + } #if defined(_WIN32) && defined(USE_EPOXY) epoxy_handle_external_wglMakeCurrent(); #endif