summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2015-12-01 05:07:36 +1300
committerScott Mansell <phiren@gmail.com>2015-12-01 05:25:38 +1300
commit03461915a7aa7ac5f5ba058dcf51c4474279d819 (patch)
treeb861d326bd4b1c95571f3c2155c61b05feeda8d9 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent02d5981b226c356347841e04367cf6284d9738a6 (diff)
Fix lens flares in Mario Kart Wii.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index c5330d6b86..80b8b12ea6 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -910,7 +910,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFo
case 8: // R8
colmat[0] = colmat[4] = colmat[8] = colmat[12] = 1;
cbufid = 15;
- dstFormat |= _GX_TF_CTF;
+ dstFormat = GX_CTF_R8;
break;
case 2: // RA4
@@ -1047,8 +1047,11 @@ void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFo
}
}
- u32 blockH = TexDecoder_GetBlockHeightInTexels(dstFormat);
- const u32 blockW = TexDecoder_GetBlockWidthInTexels(dstFormat);
+ // Get the base (in memory) format of this efb copy.
+ int baseFormat = TexDecoder_GetEfbCopyBaseFormat(dstFormat);
+
+ u32 blockH = TexDecoder_GetBlockHeightInTexels(baseFormat);
+ const u32 blockW = TexDecoder_GetBlockWidthInTexels(baseFormat);
// Round up source height to multiple of block size
u32 actualHeight = ROUND_UP(tex_h, blockH);
@@ -1058,7 +1061,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFo
const u32 num_blocks_x = actualWidth / blockW;
// RGBA takes two cache lines per block; all others take one
- const u32 bytes_per_block = dstFormat == GX_TF_RGBA8 ? 64 : 32;
+ const u32 bytes_per_block = baseFormat == GX_TF_RGBA8 ? 64 : 32;
u32 bytes_per_row = num_blocks_x * bytes_per_block;
@@ -1131,7 +1134,7 @@ void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFo
if (entry)
{
- entry->SetGeneralParameters(dstAddr, 0, dstFormat);
+ entry->SetGeneralParameters(dstAddr, 0, baseFormat);
entry->SetDimensions(tex_w, tex_h, 1);
entry->frameCount = FRAMECOUNT_INVALID;