From c28393d6f90efe8503525ab905cf48056220d3e3 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 27 Mar 2019 22:12:40 +1000 Subject: [PATCH 1/2] FramebufferManager: Fix EFB peek cache stretching last tile --- Source/Core/VideoCommon/FramebufferManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/FramebufferManager.cpp b/Source/Core/VideoCommon/FramebufferManager.cpp index c3c41af2c7..c308fcebfc 100644 --- a/Source/Core/VideoCommon/FramebufferManager.cpp +++ b/Source/Core/VideoCommon/FramebufferManager.cpp @@ -569,8 +569,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(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() : From 92fa6c34cd2394d93855e20f75c1e51baee2bcbe Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 27 Mar 2019 23:28:34 +1000 Subject: [PATCH 2/2] FramebufferManager: Fix EFB pokes being offset by 1 in D3D --- Source/Core/VideoCommon/FramebufferManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/FramebufferManager.cpp b/Source/Core/VideoCommon/FramebufferManager.cpp index c308fcebfc..57d7f526f4 100644 --- a/Source/Core/VideoCommon/FramebufferManager.cpp +++ b/Source/Core/VideoCommon/FramebufferManager.cpp @@ -743,7 +743,7 @@ void FramebufferManager::CreatePokeVertices(std::vector* destinat const float x1 = static_cast(x) * cs_pixel_width - 1.0f; const float y1 = 1.0f - static_cast(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});