Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12055 from iwubcode/skip_dump_async
VideoCommon: skip the texture dump if a custom texture is available, regardless if it is loaded or not
  • Loading branch information
AdmiralCurtiss committed Jul 23, 2023
2 parents c1a4b3f + f7e7874 commit a76cc14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions Source/Core/VideoCommon/TextureCacheBase.cpp
Expand Up @@ -1607,6 +1607,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp
std::vector<VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>> cached_game_assets;
std::vector<std::shared_ptr<VideoCommon::CustomTextureData>> data_for_assets;
bool has_arbitrary_mipmaps = false;
bool skip_texture_dump = false;
std::shared_ptr<HiresTexture> hires_texture;
if (g_ActiveConfig.bHiresTextures)
{
Expand All @@ -1618,6 +1619,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp
cached_game_assets.push_back(
VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>{std::move(asset), loaded_time});
has_arbitrary_mipmaps = hires_texture->HasArbitraryMipmaps();
skip_texture_dump = true;
}
}

Expand Down Expand Up @@ -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);
Expand All @@ -1679,7 +1682,7 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry(
const TextureCreationInfo& creation_info, const TextureInfo& texture_info,
const int safety_color_sample_size,
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__
const bool no_mips = g_ActiveConfig.bNoMipmapping;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/TextureCacheBase.h
Expand Up @@ -351,7 +351,7 @@ class TextureCacheBase
CreateTextureEntry(const TextureCreationInfo& creation_info, const TextureInfo& texture_info,
int safety_color_sample_size,
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);

Expand Down

0 comments on commit a76cc14

Please sign in to comment.