From d0c025bf0bc44ac8a12b68e863e8204d365f072b Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 22 May 2018 15:35:20 +1000 Subject: [PATCH] OGL: Fix EFB access in MSAA-mode --- Source/Core/VideoBackends/OGL/Render.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index f049ee9e3a..ffd84a1623 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -997,8 +997,6 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) // Resolve our rectangle. FramebufferManager::GetEFBDepthTexture(efbPixelRc); glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer()); - - RestoreAPIState(); } std::unique_ptr depthMap(new float[targetPixelRcWidth * targetPixelRcHeight]); @@ -1007,6 +1005,9 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) targetPixelRcHeight, GL_DEPTH_COMPONENT, GL_FLOAT, depthMap.get()); UpdateEFBCache(type, cacheRectIdx, efbPixelRc, targetPixelRc, depthMap.get()); + + if (s_MSAASamples > 1) + RestoreAPIState(); } u32 xRect = x % EFB_CACHE_RECT_SIZE; @@ -1036,8 +1037,6 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) // Resolve our rectangle. FramebufferManager::GetEFBColorTexture(efbPixelRc); glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer()); - - RestoreAPIState(); } std::unique_ptr colorMap(new u32[targetPixelRcWidth * targetPixelRcHeight]); @@ -1051,6 +1050,9 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) targetPixelRcHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, colorMap.get()); UpdateEFBCache(type, cacheRectIdx, efbPixelRc, targetPixelRc, colorMap.get()); + + if (s_MSAASamples > 1) + RestoreAPIState(); } u32 xRect = x % EFB_CACHE_RECT_SIZE;