From 0f38a1f459b34c5b6fccf456026dbad8dc445944 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 14 Mar 2015 16:16:05 -0700 Subject: [PATCH] Invalidate buffers after using for post shaders. --- GPU/GLES/Framebuffer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 5773e6ced..03792c287 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1115,7 +1115,6 @@ void FramebufferManager::CopyDisplayToOutput() { CenterRect(&x, &y, &w, &h, 480.0f, 272.0f, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight); // TODO ES3: Use glInvalidateFramebuffer to discard depth/stencil data at the end of frame. - // and to discard extraFBOs_ after using them. const float u0 = offsetX / (float)vfb->bufferWidth; const float v0 = offsetY / (float)vfb->bufferHeight; @@ -1167,6 +1166,12 @@ void FramebufferManager::CopyDisplayToOutput() { glstate.viewport.set(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight); DrawActiveTexture(colorTexture, x, y, w, h, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight, true, u0, v0, u1, v1); } + + if (gl_extensions.GLES3 && glInvalidateFramebuffer != nullptr) { + fbo_bind_as_render_target(extraFBOs_[0]); + GLenum attachments[3] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT }; + glInvalidateFramebuffer(GL_FRAMEBUFFER, 3, attachments); + } } else { if (g_Config.bEnableCardboard) { // Left Eye Image