From 88229f4716c7f3a5994b1a83312927e4069eefa3 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 29 Sep 2019 12:41:58 +0300 Subject: [PATCH] gl: Remember to unbind attachments from active framebuffer after clear - If a stale reference is left lying around (e.g the texture bound to depth has been deleted and we attach a color image) no operations actually take place. glCheckFramebufferStatus also does not catch this problem. --- rpcs3/Emu/RSX/GL/GLHelpers.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLHelpers.cpp b/rpcs3/Emu/RSX/GL/GLHelpers.cpp index e27c0207c1..80f847c0b2 100644 --- a/rpcs3/Emu/RSX/GL/GLHelpers.cpp +++ b/rpcs3/Emu/RSX/GL/GLHelpers.cpp @@ -471,6 +471,7 @@ namespace gl cmd.drv->color_maski(0, true, true, true, true); glClear(GL_COLOR_BUFFER_BIT); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, GL_NONE, 0); } void blitter::fast_clear_image(gl::command_context& cmd, const texture* dst, float depth, u8 stencil) @@ -505,5 +506,6 @@ namespace gl cmd.drv->stencil_mask(0xFF); glClear(clear_mask); + glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GL_TEXTURE_2D, GL_NONE, 0); } }