diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-04-04 14:27:55 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-04-04 14:34:46 -0700 |
| commit | e9e32260261699270e1de22ec55e2e50b19f8038 (patch) | |
| tree | 22ae09ad7cc74ad17062d5a472ad494e5b8e7594 /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 9d0a78db201f82c669acb215db8043c17e0302f7 (diff) | |
TextureCacheBase: fix custom textures not being loaded
Fixes bug #10183 [0] introduced by 3bd184a / PR #4467 [1].
TextureCacheBase was no longer calling `entry->Load` for custom textures
since the compute shader decoding logic was added. This adds it back in.
It also slightly restructures the decoding if-group to match the one
below, which I think makes the logic more obvious.
(recommend viewing with `git diff -b` to ignore the indentation changes)
[0]: https://bugs.dolphin-emu.org/issues/10183
[1]: https://github.com/dolphin-emu/dolphin/pull/4467
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); |
