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

This commit is contained in:
iwubcode
2017-12-21 11:22:46 -06:00
parent f475c6d3de
commit e1332b1d7e
3 changed files with 21 additions and 19 deletions

View File

@ -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,