diff --git a/docs/changelog.txt b/docs/changelog.txt index a2ef04174..33c01b6ec 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -7,6 +7,9 @@ USERS + All "gamecontroller[...]" config.txt options have been renamed to "gamepad[...]". The old names are still supported. ++ Fixed blank screen bugs that occur with the glslscale renderer + in conjunction with Intel HD Graphics 2500 graphics drivers + and possibly some other old drivers. + The softscale renderer now respects disable_screensaver. + HTML5: fixed the poor performance of FREADn and other features that rely on calculating the length of an open file. diff --git a/src/render_glsl.c b/src/render_glsl.c index 563c60d94..c9e0fabe2 100644 --- a/src/render_glsl.c +++ b/src/render_glsl.c @@ -1491,30 +1491,29 @@ static void glsl_sync_screen(struct graphics_data *graphics) gl_check_error(); } + gl_swap_buffers(graphics); + render_data->dirty_palette = true; + render_data->dirty_indices = true; + if(glsl.has_fbo) { + /* Switch back to the texture framebuffer. This needs to be done after + * gl_swap_buffers or the screen won't draw properly for some drivers. + * The SDL documentation cites macOS, but MegaZeux bugs were encountered + * using the Intel HD Graphics 2500 driver in Windows too. + */ glsl.glBindFramebuffer(GL_FRAMEBUFFER, render_data->fbos[FBO_SCREEN_TEX]); gl_check_error(); - - // Clear the framebuffer so elements of this frame don't bleed through. - glsl.glClear(GL_COLOR_BUFFER_BIT); - gl_check_error(); } - gl_swap_buffers(graphics); - render_data->dirty_palette = true; - render_data->dirty_indices = true; - /** + * Clear the framebuffer so elements of this frame don't bleed through. * When FBOs are not available, the next window frame needs to be cleared * since the screen will be temporarily drawn there before scaling. This call - * was previously disabled for Emscripten (which should always have FBOs). + * was previously disabled for Emscripten. */ - if(!glsl.has_fbo) - { - glsl.glClear(GL_COLOR_BUFFER_BIT); - gl_check_error(); - } + glsl.glClear(GL_COLOR_BUFFER_BIT); + gl_check_error(); } static boolean glsl_switch_shader(struct graphics_data *graphics,