diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2017-09-29 00:31:08 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2017-11-17 22:11:32 -0600 |
| commit | 4964fc87ae15600252cea8a07df5799e91c11875 (patch) | |
| tree | dfd067d59541079078dae594dcd2476db854a168 /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | a129a53e56cdff93e2fd092fd56f3e0726408a60 (diff) | |
Video Backends: Remove the right of the xfb region for games where the
VI stride does not match the VI width
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index e63282d527..8a5ab459d0 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -651,10 +651,14 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const m_last_xfb_texture = xfb_entry->texture.get(); m_last_xfb_id = xfb_entry->id; m_last_xfb_ticks = ticks; - m_last_xfb_horizontal_scale = horizontal_scale; + + auto xfb_rect = xfb_entry->texture->GetConfig().GetRect(); + xfb_rect.right -= EFBToScaledX(fbStride - fbWidth); + + m_last_xfb_region = xfb_rect; // TODO: merge more generic parts into VideoCommon - g_renderer->SwapImpl(xfb_entry->texture.get(), rc, ticks, xfb_entry->gamma); + g_renderer->SwapImpl(xfb_entry->texture.get(), xfb_rect, ticks, xfb_entry->gamma); m_fps_counter.Update(); update_frame_count = true; @@ -693,7 +697,7 @@ bool Renderer::IsFrameDumping() void Renderer::DoDumpFrame() { - UpdateFrameDumpTexture(m_last_xfb_horizontal_scale); + UpdateFrameDumpTexture(); auto result = m_dump_texture->Map(); if (result.has_value()) @@ -704,7 +708,7 @@ void Renderer::DoDumpFrame() } } -void Renderer::UpdateFrameDumpTexture(float horizontal_scale) +void Renderer::UpdateFrameDumpTexture() { int target_width, target_height; std::tie(target_width, target_height) = CalculateOutputDimensions( @@ -719,9 +723,7 @@ void Renderer::UpdateFrameDumpTexture(float horizontal_scale) config.rendertarget = true; m_dump_texture = g_texture_cache->CreateTexture(config); } - auto source_rect = m_last_xfb_texture->GetConfig().GetRect(); - source_rect.right /= horizontal_scale; - m_dump_texture->CopyRectangleFromTexture(m_last_xfb_texture, source_rect, + m_dump_texture->CopyRectangleFromTexture(m_last_xfb_texture, m_last_xfb_region, EFBRectangle{0, 0, target_width, target_height}); } |
