mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 23:35:55 +00:00
Ensure our GL context is always current
This commit is contained in:
parent
c658daeac6
commit
8159e07427
@ -696,9 +696,6 @@ const float *EGLRenderer::getColorMatrix() {
|
||||
bool EGLRenderer::specialize() {
|
||||
SDL_assert(!m_VAO);
|
||||
|
||||
// Attach our GL context to the render thread
|
||||
SDL_GL_MakeCurrent(m_Window, m_Context);
|
||||
|
||||
if (!compileShaders())
|
||||
return false;
|
||||
|
||||
@ -760,6 +757,12 @@ void EGLRenderer::renderFrame(AVFrame* frame)
|
||||
return;
|
||||
}
|
||||
|
||||
// Attach our GL context to the render thread
|
||||
// NB: It should already be current, unless the SDL render event watcher
|
||||
// performs a rendering operation (like a viewport update on resize) on
|
||||
// our fake SDL_Renderer. If it's already current, this is a no-op.
|
||||
SDL_GL_MakeCurrent(m_Window, m_Context);
|
||||
|
||||
// Find the native read-back format and load the shaders
|
||||
if (m_EGLImagePixelFormat == AV_PIX_FMT_NONE) {
|
||||
m_EGLImagePixelFormat = m_Backend->getEGLImagePixelFormat();
|
||||
|
Loading…
x
Reference in New Issue
Block a user