mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-08-03 07:36:20 -04:00
Workaround for WebGL driver bug (#645)
This commit is contained in:
parent
d83a729c77
commit
fd36f07537
@ -744,6 +744,17 @@ void OpenGLES3Renderer::Flip()
|
||||
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo);
|
||||
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);
|
||||
|
||||
SDL_GL_SwapWindow(DDWindow);
|
||||
|
Loading…
x
Reference in New Issue
Block a user