From 353528b63dd4c9ae86c6360e84ef1854572f25de Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 4 May 2013 15:28:57 -0700 Subject: [PATCH] When displaying an FBO, pick the most recent used. Fixes flicker in Jewel Summoner, and black screen in Shadow of Destiny. --- GPU/GLES/Framebuffer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 7436028cd..9b8a7ca61 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -241,13 +241,20 @@ void FramebufferManager::DrawActiveTexture(float x, float y, float w, float h, b } VirtualFramebuffer *FramebufferManager::GetDisplayFBO() { + VirtualFramebuffer *match = NULL; for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ++iter) { VirtualFramebuffer *v = *iter; if (MaskedEqual(v->fb_address, displayFramebufPtr_) && v->format == displayFormat_) { // Could check w too but whatever - return *iter; + if (match == NULL || match->last_frame_used < v->last_frame_used) { + match = v; + } } } + if (match != NULL) { + return match; + } + DEBUG_LOG(HLE, "Finding no FBO matching address %08x", displayFramebufPtr_); #if 0 // defined(_DEBUG) std::string debug = "FBOs: ";