From f7e78742cf2c1d5dae1f0158422384a71b32fc3d Mon Sep 17 00:00:00 2001 From: iwubcode Date: Wed, 19 Jul 2023 23:44:41 -0500 Subject: [PATCH] VideoCommon: skip the texture dump if the texture is using a custom texture, regardless of whether or not it is loaded yet --- Source/Core/VideoCommon/TextureCacheBase.cpp | 13 ++++++++----- Source/Core/VideoCommon/TextureCacheBase.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 2fd0a4b284..37dadba967 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -1607,6 +1607,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp std::vector> cached_game_assets; std::vector> data_for_assets; bool has_arbitrary_mipmaps = false; + bool skip_texture_dump = false; std::shared_ptr hires_texture; if (g_ActiveConfig.bHiresTextures) { @@ -1618,6 +1619,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp cached_game_assets.push_back( VideoCommon::CachedAsset{std::move(asset), loaded_time}); has_arbitrary_mipmaps = hires_texture->HasArbitraryMipmaps(); + skip_texture_dump = true; } } @@ -1666,9 +1668,10 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp } } - auto entry = CreateTextureEntry( - TextureCreationInfo{base_hash, full_hash, bytes_per_block, palette_size}, texture_info, - textureCacheSafetyColorSampleSize, std::move(data_for_assets), has_arbitrary_mipmaps); + auto entry = + CreateTextureEntry(TextureCreationInfo{base_hash, full_hash, bytes_per_block, palette_size}, + texture_info, textureCacheSafetyColorSampleSize, + std::move(data_for_assets), has_arbitrary_mipmaps, skip_texture_dump); entry->linked_game_texture_assets = std::move(cached_game_assets); entry->linked_asset_dependencies = std::move(additional_dependencies); entry->texture_info_name = std::move(texture_name); @@ -1679,7 +1682,7 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry( const TextureCreationInfo& creation_info, const TextureInfo& texture_info, const int safety_color_sample_size, std::vector> assets_data, - const bool custom_arbitrary_mipmaps) + const bool custom_arbitrary_mipmaps, bool skip_texture_dump) { #ifdef __APPLE__ const bool no_mips = g_ActiveConfig.bNoMipmapping; @@ -1828,7 +1831,7 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry( entry->has_arbitrary_mips = arbitrary_mip_detector.HasArbitraryMipmaps(dst_buffer); - if (g_ActiveConfig.bDumpTextures) + if (g_ActiveConfig.bDumpTextures && !skip_texture_dump) { const std::string basename = texture_info.CalculateTextureName().GetFullName(); for (u32 level = 0; level < texLevels; ++level) diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index 65b0d2b469..3592535a65 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -351,7 +351,7 @@ private: CreateTextureEntry(const TextureCreationInfo& creation_info, const TextureInfo& texture_info, int safety_color_sample_size, std::vector> assets_data, - bool custom_arbitrary_mipmaps); + bool custom_arbitrary_mipmaps, bool skip_texture_dump); RcTcacheEntry GetXFBFromCache(u32 address, u32 width, u32 height, u32 stride);