diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2017-04-05 16:49:54 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-05 16:49:54 +1000 |
| commit | 27e9e469d43f59c3e2611a9c8442e009f0b2cb06 (patch) | |
| tree | 91ccf2feafa1bf8add00ca08f1a6e031a9530704 /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 9fc223302b11ecf809285f85ad3d801249c92c4f (diff) | |
| parent | e9e32260261699270e1de22ec55e2e50b19f8038 (diff) | |
Merge pull request #5206 from ligfx/fixcustomtextures
TextureCacheBase: fix custom textures not being loaded
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 862dd7c699..4894914b5c 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -781,32 +781,33 @@ TextureCacheBase::TCacheEntryBase* TextureCacheBase::Load(const u32 stage) if (!entry) return nullptr; - if (!hires_tex) + const u8* tlut = &texMem[tlutaddr]; + if (hires_tex) + { + entry->Load(temp, width, height, expandedWidth, 0); + } + else if (decode_on_gpu) { - const u8* tlut = &texMem[tlutaddr]; - if (decode_on_gpu) + u32 row_stride = bytes_per_block * (expandedWidth / bsw); + g_texture_cache->DecodeTextureOnGPU( + entry, 0, src_data, texture_size, static_cast<TextureFormat>(texformat), width, height, + expandedWidth, expandedHeight, row_stride, tlut, static_cast<TlutFormat>(tlutfmt)); + } + else + { + if (!(texformat == GX_TF_RGBA8 && from_tmem)) { - u32 row_stride = bytes_per_block * (expandedWidth / bsw); - g_texture_cache->DecodeTextureOnGPU( - entry, 0, src_data, texture_size, static_cast<TextureFormat>(texformat), width, height, - expandedWidth, expandedHeight, row_stride, tlut, static_cast<TlutFormat>(tlutfmt)); + TexDecoder_Decode(temp, src_data, expandedWidth, expandedHeight, texformat, tlut, + (TlutFormat)tlutfmt); } else { - if (!(texformat == GX_TF_RGBA8 && from_tmem)) - { - TexDecoder_Decode(temp, src_data, expandedWidth, expandedHeight, texformat, tlut, - (TlutFormat)tlutfmt); - } - else - { - u8* src_data_gb = - &texMem[bpmem.tex[stage / 4].texImage2[stage % 4].tmem_odd * TMEM_LINE_SIZE]; - TexDecoder_DecodeRGBA8FromTmem(temp, src_data, src_data_gb, expandedWidth, expandedHeight); - } - - entry->Load(temp, width, height, expandedWidth, 0); + u8* src_data_gb = + &texMem[bpmem.tex[stage / 4].texImage2[stage % 4].tmem_odd * TMEM_LINE_SIZE]; + TexDecoder_DecodeRGBA8FromTmem(temp, src_data, src_data_gb, expandedWidth, expandedHeight); } + + entry->Load(temp, width, height, expandedWidth, 0); } iter = textures_by_address.emplace(address, entry); |
