diff options
| author | Scott Mansell <phiren@gmail.com> | 2015-09-01 02:41:16 +1200 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-09-05 23:37:24 +1200 |
| commit | 52948bb3ef016abd7e35e775b17b7cf3f487d49c (patch) | |
| tree | 5592f0732af5628ff02dc2a70177acf8217b16f4 /Source/Core/VideoCommon/BPStructs.cpp | |
| parent | a47bbee02a3d8f6f585961c15ba9e6727a64df49 (diff) | |
Cleanup and unify handling of efb copy stride.
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 2717fe4b21..e30aa2fcaa 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -20,6 +20,7 @@ #include "VideoCommon/PixelShaderManager.h" #include "VideoCommon/RenderBase.h" #include "VideoCommon/Statistics.h" +#include "VideoCommon/TextureCacheBase.h" #include "VideoCommon/TextureDecoder.h" #include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/VideoCommon.h" @@ -205,6 +206,7 @@ static void BPWritten(const BPCmd& bp) // The values in bpmem.copyTexSrcXY and bpmem.copyTexSrcWH are updated in case 0x49 and 0x4a in this function u32 destAddr = bpmem.copyTexDest << 5; + u32 destStride = bpmem.copyMipMapStrideChannels << 5; EFBRectangle srcRect; srcRect.left = (int)bpmem.copyTexSrcXY.x; @@ -223,8 +225,9 @@ static void BPWritten(const BPCmd& bp) if (g_ActiveConfig.bShowEFBCopyRegions) stats.efb_regions.push_back(srcRect); - CopyEFB(destAddr, srcRect, - PE_copy.tp_realFormat(), bpmem.zcontrol.pixel_format, + // bpmem.zcontrol.pixel_format to PEControl::Z24 is when the game wants to copy from ZBuffer (Zbuffer uses 24-bit Format) + TextureCache::CopyRenderTargetToTexture(destAddr, PE_copy.tp_realFormat(), destStride, + bpmem.zcontrol.pixel_format, srcRect, !!PE_copy.intensity_fmt, !!PE_copy.half_scale); } else @@ -251,10 +254,9 @@ static void BPWritten(const BPCmd& bp) height = MAX_XFB_HEIGHT; } - u32 stride = bpmem.copyMipMapStrideChannels << 5; DEBUG_LOG(VIDEO, "RenderToXFB: destAddr: %08x | srcRect {%d %d %d %d} | fbWidth: %u | fbStride: %u | fbHeight: %u", - destAddr, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom, bpmem.copyTexSrcWH.x + 1, stride, height); - Renderer::RenderToXFB(destAddr, srcRect, stride, height, s_gammaLUT[PE_copy.gamma]); + destAddr, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom, bpmem.copyTexSrcWH.x + 1, destStride, height); + Renderer::RenderToXFB(destAddr, srcRect, destStride, height, s_gammaLUT[PE_copy.gamma]); } // Clear the rectangular region after copying it. |
