From e204b3c8ee46653ca1c9d2aea6877ec3d11f7472 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sun, 15 Oct 2023 16:34:06 -0500 Subject: VideoCommon: add additional data types (int, int2, float, bool, etc) as properties of materials and some helper functions to support sending the data to the GPU --- .../Runtime/Actions/CustomPipelineAction.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'Source/Core/VideoCommon/GraphicsModSystem/Runtime') diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp index 267f88bb4c..0a51bb995e 100644 --- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp +++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp @@ -393,21 +393,15 @@ void CustomPipelineAction::OnTextureCreate(GraphicsModActionData::TextureCreate* return; } - if (property.m_type == VideoCommon::MaterialProperty::Type::Type_TextureAsset) + if (auto* value = std::get_if(&property.m_value)) { - if (property.m_value) + auto asset = loader.LoadGameTexture(*value, m_library); + if (asset) { - if (auto* value = std::get_if(&*property.m_value)) - { - auto asset = loader.LoadGameTexture(*value, m_library); - if (asset) - { - const auto loaded_time = asset->GetLastLoadedTime(); - game_assets.push_back(VideoCommon::CachedAsset{ - std::move(asset), loaded_time}); - m_texture_code_names.push_back(property.m_code_name); - } - } + const auto loaded_time = asset->GetLastLoadedTime(); + game_assets.push_back( + VideoCommon::CachedAsset{std::move(asset), loaded_time}); + m_texture_code_names.push_back(property.m_code_name); } } } -- cgit v1.2.3