summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2017-12-21 11:22:46 -0600
committeriwubcode <iwubcode@users.noreply.github.com>2017-12-21 21:19:26 -0600
commite1332b1d7ed4696a4a727906bce62689b8eb329c (patch)
tree05d6b579e35c9b41b927f450dec7b5895fa1b4d7 /Source/Core/VideoCommon/BPStructs.cpp
parentf475c6d3de8d706501eb974c5cb5bd9b0516a65c (diff)
Texture Cache Base: Move PAL vertical scaling to be baked into the texture size. This saves on a number of multiplications and fixes an issue where we were multiplying the y-scaling factor by the srcRectangle's height + 1 which was causing a crash in some GC titles
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 108a478035..2e79db8477 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -252,12 +252,14 @@ static void BPWritten(const BPCmd& bp)
float num_xfb_lines = 1.0f + bpmem.copyTexSrcWH.y * yScale;
+ srcRect.bottom = (int)(bpmem.copyTexSrcXY.y + num_xfb_lines);
+
u32 height = static_cast<u32>(num_xfb_lines);
DEBUG_LOG(VIDEO, "RenderToXFB: destAddr: %08x | srcRect {%d %d %d %d} | fbWidth: %u | "
- "fbStride: %u | fbHeight: %u",
+ "fbStride: %u | fbHeight: %u | yScale: %f",
destAddr, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom,
- bpmem.copyTexSrcWH.x + 1, destStride, height);
+ bpmem.copyTexSrcWH.x + 1, destStride, height, yScale);
bool is_depth_copy = bpmem.zcontrol.pixel_format == PEControl::Z24;
g_texture_cache->CopyRenderTargetToTexture(destAddr, EFBCopyFormat::XFB, destStride,