VideoCommon: skip the texture dump if the texture is using a custom texture, regardless of whether or not it is loaded yet

This commit is contained in:
iwubcode 2023-07-19 23:44:41 -05:00
parent 2764978beb
commit f7e78742cf
2 changed files with 9 additions and 6 deletions

View File

@ -1607,6 +1607,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp
std::vector<VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>> cached_game_assets; std::vector<VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>> cached_game_assets;
std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> data_for_assets; std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> data_for_assets;
bool has_arbitrary_mipmaps = false; bool has_arbitrary_mipmaps = false;
bool skip_texture_dump = false;
std::shared_ptr<HiresTexture> hires_texture; std::shared_ptr<HiresTexture> hires_texture;
if (g_ActiveConfig.bHiresTextures) if (g_ActiveConfig.bHiresTextures)
{ {
@ -1618,6 +1619,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp
cached_game_assets.push_back( cached_game_assets.push_back(
VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>{std::move(asset), loaded_time}); VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>{std::move(asset), loaded_time});
has_arbitrary_mipmaps = hires_texture->HasArbitraryMipmaps(); has_arbitrary_mipmaps = hires_texture->HasArbitraryMipmaps();
skip_texture_dump = true;
} }
} }
@ -1666,9 +1668,10 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp
} }
} }
auto entry = CreateTextureEntry( auto entry =
TextureCreationInfo{base_hash, full_hash, bytes_per_block, palette_size}, texture_info, CreateTextureEntry(TextureCreationInfo{base_hash, full_hash, bytes_per_block, palette_size},
textureCacheSafetyColorSampleSize, std::move(data_for_assets), has_arbitrary_mipmaps); 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_game_texture_assets = std::move(cached_game_assets);
entry->linked_asset_dependencies = std::move(additional_dependencies); entry->linked_asset_dependencies = std::move(additional_dependencies);
entry->texture_info_name = std::move(texture_name); entry->texture_info_name = std::move(texture_name);
@ -1679,7 +1682,7 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry(
const TextureCreationInfo& creation_info, const TextureInfo& texture_info, const TextureCreationInfo& creation_info, const TextureInfo& texture_info,
const int safety_color_sample_size, const int safety_color_sample_size,
std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> assets_data, std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> assets_data,
const bool custom_arbitrary_mipmaps) const bool custom_arbitrary_mipmaps, bool skip_texture_dump)
{ {
#ifdef __APPLE__ #ifdef __APPLE__
const bool no_mips = g_ActiveConfig.bNoMipmapping; const bool no_mips = g_ActiveConfig.bNoMipmapping;
@ -1828,7 +1831,7 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry(
entry->has_arbitrary_mips = arbitrary_mip_detector.HasArbitraryMipmaps(dst_buffer); 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(); const std::string basename = texture_info.CalculateTextureName().GetFullName();
for (u32 level = 0; level < texLevels; ++level) for (u32 level = 0; level < texLevels; ++level)

View File

@ -351,7 +351,7 @@ private:
CreateTextureEntry(const TextureCreationInfo& creation_info, const TextureInfo& texture_info, CreateTextureEntry(const TextureCreationInfo& creation_info, const TextureInfo& texture_info,
int safety_color_sample_size, int safety_color_sample_size,
std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> assets_data, std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> assets_data,
bool custom_arbitrary_mipmaps); bool custom_arbitrary_mipmaps, bool skip_texture_dump);
RcTcacheEntry GetXFBFromCache(u32 address, u32 width, u32 height, u32 stride); RcTcacheEntry GetXFBFromCache(u32 address, u32 width, u32 height, u32 stride);