summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/FramebufferManager.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2019-03-27 10:53:47 -0400
committerGitHub <noreply@github.com>2019-03-27 10:53:47 -0400
commitb4b0ebae27c9f8e3545cd3632948fc92783d99c3 (patch)
treefce4ed7f42c58bc6355ea42be88280090cb6af46 /Source/Core/VideoCommon/FramebufferManager.cpp
parenta1f53716dc96fa5eccf1702b4f6e91861bdb407d (diff)
parent92fa6c34cd2394d93855e20f75c1e51baee2bcbe (diff)
Merge pull request #7934 from stenzek/stretched-efb-peeks
FramebufferManager: Fix EFB peek cache stretching last tile
Diffstat (limited to 'Source/Core/VideoCommon/FramebufferManager.cpp')
-rw-r--r--Source/Core/VideoCommon/FramebufferManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/FramebufferManager.cpp b/Source/Core/VideoCommon/FramebufferManager.cpp
index 4f14ebef72..1c92e36c94 100644
--- a/Source/Core/VideoCommon/FramebufferManager.cpp
+++ b/Source/Core/VideoCommon/FramebufferManager.cpp
@@ -573,8 +573,12 @@ void FramebufferManager::PopulateEFBCache(bool depth, u32 tile_index)
{native_rect.left * rcp_src_width, native_rect.top * rcp_src_height,
native_rect.GetWidth() * rcp_src_width, native_rect.GetHeight() * rcp_src_height}};
g_vertex_manager->UploadUtilityUniforms(&uniforms, sizeof(uniforms));
+
+ // Viewport will not be TILE_SIZExTILE_SIZE for the last row of tiles, assuming a tile size of
+ // 64, because 528 is not evenly divisible by 64.
g_renderer->SetAndDiscardFramebuffer(data.framebuffer.get());
- g_renderer->SetViewportAndScissor(data.framebuffer->GetRect());
+ g_renderer->SetViewportAndScissor(
+ MathUtil::Rectangle<int>(0, 0, rect.GetWidth(), rect.GetHeight()));
g_renderer->SetPipeline(data.copy_pipeline.get());
g_renderer->SetTexture(0, src_texture);
g_renderer->SetSamplerState(0, depth ? RenderState::GetPointSamplerState() :
@@ -743,7 +747,7 @@ void FramebufferManager::CreatePokeVertices(std::vector<EFBPokeVertex>* destinat
const float x1 = static_cast<float>(x) * cs_pixel_width - 1.0f;
const float y1 = 1.0f - static_cast<float>(y) * cs_pixel_height;
const float x2 = x1 + cs_pixel_width;
- const float y2 = y1 + cs_pixel_height;
+ const float y2 = y1 - cs_pixel_height;
destination_list->push_back({{x1, y1, z, 1.0f}, color});
destination_list->push_back({{x2, y1, z, 1.0f}, color});
destination_list->push_back({{x1, y2, z, 1.0f}, color});