diff options
| author | Tilka <tilkax@gmail.com> | 2024-04-20 21:16:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-20 21:16:54 +0100 |
| commit | f1e40f73bd2a9da298d9aceafa7f956041bac142 (patch) | |
| tree | 16727f3ab7552bc6d668df2c0b3482ba3a23284b /Source/Core/VideoCommon/TextureCacheBase.cpp | |
| parent | 6443084e8c355001ad298b03423b8e4f1a6cf042 (diff) | |
| parent | c204b33314802d5e5719990d76bccc87a1907c9d (diff) | |
Merge pull request #12705 from JosJuice/get-span-for-address
Memmap: Replace GetPointer with GetSpanForAddress
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index d6fec6adc4..7184ea725e 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -1319,6 +1319,9 @@ TCacheEntry* TextureCacheBase::LoadImpl(const TextureInfo& texture_info, bool fo RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSampleSize, const TextureInfo& texture_info) { + if (!texture_info.IsDataValid()) + return {}; + // Hash assigned to texcache entry (also used to generate filenames used for texture dumping and // custom texture lookup) u64 base_hash = TEXHASH_INVALID; @@ -1337,12 +1340,6 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp // TODO: the texture cache lookup is based on address, but a texture from tmem has no reason // to have a unique and valid address. This could result in a regular texture and a tmem // texture aliasing onto the same texture cache entry. - if (!texture_info.GetData()) - { - ERROR_LOG_FMT(VIDEO, "Trying to use an invalid texture address {:#010x}", - texture_info.GetRawAddress()); - return {}; - } // If we are recording a FifoLog, keep track of what memory we read. FifoRecorder does // its own memory modification tracking independent of the texture hashing below. @@ -1916,7 +1913,7 @@ RcTcacheEntry TextureCacheBase::GetXFBTexture(u32 address, u32 width, u32 height entry->frameCount = FRAMECOUNT_INVALID; if (!g_ActiveConfig.UseGPUTextureDecoding() || !DecodeTextureOnGPU(entry, 0, src_data, total_size, entry->format.texfmt, width, height, - width, height, stride, texMem, entry->format.tlutfmt)) + width, height, stride, s_tex_mem.data(), entry->format.tlutfmt)) { const u32 decoded_size = width * height * sizeof(u32); CheckTempSize(decoded_size); |
