mirror of https://github.com/mgba-emu/mgba.git
Qt: Force OpenGL paint engine creation thread (fixes #1642)
This commit is contained in:
parent
cde4e1adee
commit
0450995074
1
CHANGES
1
CHANGES
|
@ -11,6 +11,7 @@ Emulation fixes:
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- Qt: Only dynamically reset video scale if a game is running
|
- Qt: Only dynamically reset video scale if a game is running
|
||||||
- Qt: Fix race condition with proxied video events
|
- 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)
|
0.8.0: (2020-01-21)
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -271,6 +271,15 @@ PainterGL::PainterGL(QWindow* surface, QOpenGLContext* parent, int forceVersion)
|
||||||
|
|
||||||
m_gl->makeCurrent(m_surface);
|
m_gl->makeCurrent(m_surface);
|
||||||
m_window = new QOpenGLPaintDevice;
|
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)
|
#if defined(_WIN32) && defined(USE_EPOXY)
|
||||||
epoxy_handle_external_wglMakeCurrent();
|
epoxy_handle_external_wglMakeCurrent();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue