all repos — mgba @ 7f4ca56af8d543c1dbf7b8ce12c3d7c6f2ce05d6

mGBA Game Boy Advance Emulator

Qt: Fix shader loading while thread not running (fixes #1528)
Vicki Pfau vi@endrift.com
Wed, 18 Sep 2019 18:51:09 -0700
commit

7f4ca56af8d543c1dbf7b8ce12c3d7c6f2ce05d6

parent

8708a0db52de758753a675bc646fb7b6cdafb874

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -296,7 +296,6 @@ if (m_supportsShaders) {

m_shader.preprocessShader = static_cast<void*>(&reinterpret_cast<mGLES2Context*>(m_backend)->initialShader); } #endif - m_gl->doneCurrent(); m_backend->user = this; m_backend->filter = false;

@@ -517,6 +516,12 @@ if (!supportsShaders()) {

return; } #ifdef BUILD_GLES2 + if (!m_started) { + m_gl->makeCurrent(m_surface); +#if defined(_WIN32) && defined(USE_EPOXY) + epoxy_handle_external_wglMakeCurrent(); +#endif + } if (m_shader.passes) { mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend)); mGLES2ShaderFree(&m_shader);

@@ -524,6 +529,8 @@ }

mGLES2ShaderLoad(&m_shader, dir); if (m_started) { mGLES2ShaderAttach(reinterpret_cast<mGLES2Context*>(m_backend), static_cast<mGLES2Shader*>(m_shader.passes), m_shader.nPasses); + } else { + m_gl->doneCurrent(); } #endif }