mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix shader loading while thread not running (fixes #1528)
This commit is contained in:
parent
8708a0db52
commit
7f4ca56af8
|
@ -296,7 +296,6 @@ PainterGL::PainterGL(QWindow* surface, QOpenGLContext* parent, int forceVersion)
|
||||||
m_shader.preprocessShader = static_cast<void*>(&reinterpret_cast<mGLES2Context*>(m_backend)->initialShader);
|
m_shader.preprocessShader = static_cast<void*>(&reinterpret_cast<mGLES2Context*>(m_backend)->initialShader);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
m_gl->doneCurrent();
|
|
||||||
|
|
||||||
m_backend->user = this;
|
m_backend->user = this;
|
||||||
m_backend->filter = false;
|
m_backend->filter = false;
|
||||||
|
@ -517,6 +516,12 @@ void PainterGL::setShaders(struct VDir* dir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef BUILD_GLES2
|
#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) {
|
if (m_shader.passes) {
|
||||||
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
|
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
|
||||||
mGLES2ShaderFree(&m_shader);
|
mGLES2ShaderFree(&m_shader);
|
||||||
|
@ -524,6 +529,8 @@ void PainterGL::setShaders(struct VDir* dir) {
|
||||||
mGLES2ShaderLoad(&m_shader, dir);
|
mGLES2ShaderLoad(&m_shader, dir);
|
||||||
if (m_started) {
|
if (m_started) {
|
||||||
mGLES2ShaderAttach(reinterpret_cast<mGLES2Context*>(m_backend), static_cast<mGLES2Shader*>(m_shader.passes), m_shader.nPasses);
|
mGLES2ShaderAttach(reinterpret_cast<mGLES2Context*>(m_backend), static_cast<mGLES2Shader*>(m_shader.passes), m_shader.nPasses);
|
||||||
|
} else {
|
||||||
|
m_gl->doneCurrent();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue