diff options
| author | JMC47 <JMC4789@gmail.com> | 2026-01-17 16:03:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-17 16:03:26 -0500 |
| commit | 8a606fca88a81b5a24d8cc53e5eaba91f2e38fbd (patch) | |
| tree | 531fa197722dfb7c1684292c4259232d8a5205c8 /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 7ec5b06ab9b4464710a807f79f493b6c7ea3356c (diff) | |
| parent | f7b4d2738be26b233510577bd4e972da298dc578 (diff) | |
Merge pull request #14286 from JosJuice/textureinfo-vector
VideoCommon: Don't create mipmap vector in TextureInfo
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 6ae8b4f96f..f46c73e7bd 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -1721,32 +1721,36 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry( dst_buffer += decoded_texture_size; } - for (u32 level = 1; level != texLevels; ++level) + for (const auto& mip_level : texture_info.GetMipMapLevels()) { - auto mip_level = texture_info.GetMipMapLevel(level - 1); - if (!mip_level) + if (!mip_level.IsDataValid()) + { + ERROR_LOG_FMT(VIDEO, "Trying to use an invalid mipmap address {:#010x}", + texture_info.GetRawAddress()); continue; + } if (!decode_on_gpu || - !DecodeTextureOnGPU(entry, level, mip_level->GetData(), mip_level->GetTextureSize(), - texture_info.GetTextureFormat(), mip_level->GetRawWidth(), - mip_level->GetRawHeight(), mip_level->GetExpandedWidth(), - mip_level->GetExpandedHeight(), + !DecodeTextureOnGPU(entry, mip_level.GetLevel(), mip_level.GetData(), + mip_level.GetTextureSize(), texture_info.GetTextureFormat(), + mip_level.GetRawWidth(), mip_level.GetRawHeight(), + mip_level.GetExpandedWidth(), mip_level.GetExpandedHeight(), creation_info.bytes_per_block * - (mip_level->GetExpandedWidth() / texture_info.GetBlockWidth()), + (mip_level.GetExpandedWidth() / texture_info.GetBlockWidth()), texture_info.GetTlutAddress(), texture_info.GetTlutFormat())) { // No need to call CheckTempSize here, as the whole buffer is preallocated at the beginning const u32 decoded_mip_size = - mip_level->GetExpandedWidth() * sizeof(u32) * mip_level->GetExpandedHeight(); - TexDecoder_Decode(dst_buffer, mip_level->GetData(), mip_level->GetExpandedWidth(), - mip_level->GetExpandedHeight(), texture_info.GetTextureFormat(), + mip_level.GetExpandedWidth() * sizeof(u32) * mip_level.GetExpandedHeight(); + TexDecoder_Decode(dst_buffer, mip_level.GetData(), mip_level.GetExpandedWidth(), + mip_level.GetExpandedHeight(), texture_info.GetTextureFormat(), texture_info.GetTlutAddress(), texture_info.GetTlutFormat()); - entry->texture->Load(level, mip_level->GetRawWidth(), mip_level->GetRawHeight(), - mip_level->GetExpandedWidth(), dst_buffer, decoded_mip_size); + entry->texture->Load(mip_level.GetLevel(), mip_level.GetRawWidth(), + mip_level.GetRawHeight(), mip_level.GetExpandedWidth(), dst_buffer, + decoded_mip_size); - arbitrary_mip_detector.AddLevel(mip_level->GetRawWidth(), mip_level->GetRawHeight(), - mip_level->GetExpandedWidth(), dst_buffer); + arbitrary_mip_detector.AddLevel(mip_level.GetRawWidth(), mip_level.GetRawHeight(), + mip_level.GetExpandedWidth(), dst_buffer); dst_buffer += decoded_mip_size; } |
