Permalink
Browse files

OGL: Fix EFB access in MSAA-mode

  • Loading branch information...
stenzek committed May 22, 2018
1 parent 7eaba15 commit d0c025bf0bc44ac8a12b68e863e8204d365f072b
Showing with 6 additions and 4 deletions.
  1. +6 −4 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<float[]> 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<u32[]> 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;

0 comments on commit d0c025b

Please sign in to comment.