mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-17 04:41:16 +00:00
Workaround for WebGL driver bug
This commit is contained in:
parent
b69687d2f1
commit
0fc0b07d31
@ -744,6 +744,17 @@ void OpenGLES3Renderer::Flip()
|
|||||||
|
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo);
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
|
||||||
|
|
||||||
|
// This is a workaround for what is (presumably) a driver bug in some WebGL environments (Android Chrome)
|
||||||
|
// During transitions, the screen would sometimes (randomly) briefly be cleared / flicker black when using
|
||||||
|
// glBlitFramebuffer. Any write to the back buffer before that fixes this issue. The following should have minimal
|
||||||
|
// performance impact.
|
||||||
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
glScissor(0, 0, 1, 1);
|
||||||
|
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
glBlitFramebuffer(0, 0, m_width, m_height, 0, 0, m_width, m_height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
glBlitFramebuffer(0, 0, m_width, m_height, 0, 0, m_width, m_height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||||
|
|
||||||
SDL_GL_SwapWindow(DDWindow);
|
SDL_GL_SwapWindow(DDWindow);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user