From 0e8f8ea930d4b635fd7287f572dc2911996638bf Mon Sep 17 00:00:00 2001 From: iwubcode Date: Wed, 6 Sep 2023 00:16:26 -0500 Subject: VideoCommon: instead of using 'CustomTextureData' directly, use 'TextureData' for texture assets, this allows us to provide additional metadata for textures. Such as a sampler or type information (to distinguish cube maps) --- Source/Core/VideoCommon/TextureCacheBase.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp') diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index fa677bf1b5..50464cce5f 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -1606,7 +1606,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp } std::vector> cached_game_assets; - std::vector> data_for_assets; + std::vector data_for_assets; bool has_arbitrary_mipmaps = false; bool skip_texture_dump = false; std::shared_ptr hires_texture; @@ -1640,12 +1640,12 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp auto data = asset->GetData(); if (data) { - if (!data->m_slices.empty()) + if (!data->m_texture.m_slices.empty()) { - if (!data->m_slices[0].m_levels.empty()) + if (!data->m_texture.m_slices[0].m_levels.empty()) { - height = data->m_slices[0].m_levels[0].height; - width = data->m_slices[0].m_levels[0].width; + height = data->m_texture.m_slices[0].m_levels[0].height; + width = data->m_texture.m_slices[0].m_levels[0].width; } } } @@ -1667,7 +1667,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp { if (cached_asset.m_asset->Validate(texture_info.GetRawWidth(), texture_info.GetRawHeight())) { - data_for_assets.push_back(std::move(data)); + data_for_assets.push_back(&data->m_texture); } } } @@ -1687,8 +1687,7 @@ RcTcacheEntry TextureCacheBase::GetTexture(const int textureCacheSafetyColorSamp // expected because each texture is loaded into a texture array RcTcacheEntry TextureCacheBase::CreateTextureEntry( const TextureCreationInfo& creation_info, const TextureInfo& texture_info, - const int safety_color_sample_size, - std::vector> assets_data, + const int safety_color_sample_size, std::vector assets_data, const bool custom_arbitrary_mipmaps, bool skip_texture_dump) { #ifdef __APPLE__ @@ -1705,7 +1704,7 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry( assets_data.begin(), assets_data.end(), [](const auto& lhs, const auto& rhs) { return lhs->m_slices[0].m_levels.size() < rhs->m_slices[0].m_levels.size(); }); - return max_element->get()->m_slices[0].m_levels.size(); + return (*max_element)->m_slices[0].m_levels.size(); }; const u32 texLevels = no_mips ? 1 : (u32)calculate_max_levels(); const auto& first_level = assets_data[0]->m_slices[0].m_levels[0]; -- cgit v1.2.3