diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2023-09-06 00:16:26 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2023-10-10 09:58:14 -0500 |
| commit | 0e8f8ea930d4b635fd7287f572dc2911996638bf (patch) | |
| tree | 68b2ea7ddcff5beda8c1b3f02ef55e3d8e5e369d /Source/Core/VideoCommon/Assets/TextureAsset.cpp | |
| parent | 1b7a590b4bb7d34152178e4768d453b40a4118ff (diff) | |
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)
Diffstat (limited to 'Source/Core/VideoCommon/Assets/TextureAsset.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Assets/TextureAsset.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/Assets/TextureAsset.cpp b/Source/Core/VideoCommon/Assets/TextureAsset.cpp index 8cd92aa89f..9418add8d1 100644 --- a/Source/Core/VideoCommon/Assets/TextureAsset.cpp +++ b/Source/Core/VideoCommon/Assets/TextureAsset.cpp @@ -97,20 +97,6 @@ bool ParseSampler(const VideoCommon::CustomAssetLibrary::AssetID& asset_id, return true; } } // namespace -CustomAssetLibrary::LoadInfo RawTextureAsset::LoadImpl(const CustomAssetLibrary::AssetID& asset_id) -{ - auto potential_data = std::make_shared<CustomTextureData>(); - const auto loaded_info = m_owning_library->LoadTexture(asset_id, potential_data.get()); - if (loaded_info.m_bytes_loaded == 0) - return {}; - { - std::lock_guard lk(m_data_lock); - m_loaded = true; - m_data = std::move(potential_data); - } - return loaded_info; -} - bool TextureData::FromJson(const CustomAssetLibrary::AssetID& asset_id, const picojson::object& json, TextureData* data) { @@ -160,7 +146,7 @@ bool TextureData::FromJson(const CustomAssetLibrary::AssetID& asset_id, CustomAssetLibrary::LoadInfo GameTextureAsset::LoadImpl(const CustomAssetLibrary::AssetID& asset_id) { - auto potential_data = std::make_shared<CustomTextureData>(); + auto potential_data = std::make_shared<TextureData>(); const auto loaded_info = m_owning_library->LoadGameTexture(asset_id, potential_data.get()); if (loaded_info.m_bytes_loaded == 0) return {}; @@ -184,7 +170,7 @@ bool GameTextureAsset::Validate(u32 native_width, u32 native_height) const return false; } - if (m_data->m_slices.empty()) + if (m_data->m_texture.m_slices.empty()) { ERROR_LOG_FMT(VIDEO, "Game texture can't be validated for asset '{}' because no data was available.", @@ -192,7 +178,7 @@ bool GameTextureAsset::Validate(u32 native_width, u32 native_height) const return false; } - if (m_data->m_slices.size() > 1) + if (m_data->m_texture.m_slices.size() > 1) { ERROR_LOG_FMT( VIDEO, @@ -201,7 +187,7 @@ bool GameTextureAsset::Validate(u32 native_width, u32 native_height) const return false; } - const auto& slice = m_data->m_slices[0]; + const auto& slice = m_data->m_texture.m_slices[0]; if (slice.m_levels.empty()) { ERROR_LOG_FMT( |
