diff --git a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp index ceafb75dca..eeea9da38b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp @@ -435,6 +435,8 @@ void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) void XFBSource::CopyEFB(float Gamma) { + g_renderer->ResetAPIState(); + // Copy EFB data to XFB and restore render target again glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer()); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer()); @@ -451,6 +453,8 @@ void XFBSource::CopyEFB(float Gamma) // Return to EFB. FramebufferManager::SetFramebuffer(0); + + g_renderer->RestoreAPIState(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index ee159929d1..8ac9fc9d4c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -958,9 +958,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) { if (s_MSAASamples > 1) { + g_renderer->ResetAPIState(); + // Resolve our rectangle. FramebufferManager::GetEFBDepthTexture(efbPixelRc); glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer()); + + g_renderer->RestoreAPIState(); } u32* depthMap = new u32[targetPixelRcWidth * targetPixelRcHeight]; @@ -1007,9 +1011,13 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) { if (s_MSAASamples > 1) { + g_renderer->ResetAPIState(); + // Resolve our rectangle. FramebufferManager::GetEFBColorTexture(efbPixelRc); glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetResolvedFramebuffer()); + + g_renderer->RestoreAPIState(); } u32* colorMap = new u32[targetPixelRcWidth * targetPixelRcHeight];