From c2f4fad56aada331bbd8dd7db99037285bab853f Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 29 Sep 2015 22:10:01 +0200 Subject: [PATCH] Fix another framebuffer race condition affecting #8002 (with postprocessing) We can only wipe framebuffers at end of frame time when we react to the resolution change. If we wipe at any other time, they can get recreated early and thus at the previous size. --- GPU/GLES/Framebuffer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index d29a59542be0..79a0bce9f104 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1016,12 +1016,6 @@ void FramebufferManager::CopyDisplayToOutput() { } displayFramebuf_ = vfb; - if (resized_) { - ClearBuffer(); - DestroyDraw2DProgram(); - SetLineWidth(); - } - if (vfb->fbo) { DEBUG_LOG(SCEGE, "Displaying FBO %08x", vfb->fb_address); DisableState(); @@ -1661,6 +1655,7 @@ void FramebufferManager::EndFrame() { if (resized_) { // TODO: Only do this if the new size actually changed the renderwidth/height. DestroyAllFBOs(); + // Probably not necessary glstate.viewport.set(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight); @@ -1692,6 +1687,9 @@ void FramebufferManager::EndFrame() { #ifdef _WIN32 ShowScreenResolution(); #endif + ClearBuffer(); + DestroyDraw2DProgram(); + SetLineWidth(); } #ifndef USING_GLES2