mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-05 12:26:33 +01:00
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
This commit is contained in:
parent
9d0a78db20
commit
e9e3226026
@ -781,32 +781,33 @@ TextureCacheBase::TCacheEntryBase* TextureCacheBase::Load(const u32 stage)
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
if (!hires_tex)
|
const u8* tlut = &texMem[tlutaddr];
|
||||||
|
if (hires_tex)
|
||||||
{
|
{
|
||||||
const u8* tlut = &texMem[tlutaddr];
|
entry->Load(temp, width, height, expandedWidth, 0);
|
||||||
if (decode_on_gpu)
|
}
|
||||||
|
else 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);
|
TexDecoder_Decode(temp, src_data, expandedWidth, expandedHeight, texformat, tlut,
|
||||||
g_texture_cache->DecodeTextureOnGPU(
|
(TlutFormat)tlutfmt);
|
||||||
entry, 0, src_data, texture_size, static_cast<TextureFormat>(texformat), width, height,
|
|
||||||
expandedWidth, expandedHeight, row_stride, tlut, static_cast<TlutFormat>(tlutfmt));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(texformat == GX_TF_RGBA8 && from_tmem))
|
u8* src_data_gb =
|
||||||
{
|
&texMem[bpmem.tex[stage / 4].texImage2[stage % 4].tmem_odd * TMEM_LINE_SIZE];
|
||||||
TexDecoder_Decode(temp, src_data, expandedWidth, expandedHeight, texformat, tlut,
|
TexDecoder_DecodeRGBA8FromTmem(temp, src_data, src_data_gb, expandedWidth, expandedHeight);
|
||||||
(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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entry->Load(temp, width, height, expandedWidth, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
iter = textures_by_address.emplace(address, entry);
|
iter = textures_by_address.emplace(address, entry);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user