summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Assets
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2025-11-20 23:51:34 -0600
committeriwubcode <iwubcode@users.noreply.github.com>2025-11-20 23:51:34 -0600
commit6e13a7d7e97adfc807c260fa80e4fdf91191d50a (patch)
tree6c338d8b38d87f05a2fb867095406db01b29927e /Source/Core/VideoCommon/Assets
parent4f30aaf1ca1ba410904422e55e2a14012ce8163e (diff)
VideoCommon: fix MaterialAsset so that boolean parameters are written to memory as integers, matching the format internally expected by shaders
Diffstat (limited to 'Source/Core/VideoCommon/Assets')
-rw-r--r--Source/Core/VideoCommon/Assets/MaterialAsset.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Assets/MaterialAsset.cpp b/Source/Core/VideoCommon/Assets/MaterialAsset.cpp
index 5f5c97a9f1..200bccf333 100644
--- a/Source/Core/VideoCommon/Assets/MaterialAsset.cpp
+++ b/Source/Core/VideoCommon/Assets/MaterialAsset.cpp
@@ -197,7 +197,12 @@ void MaterialProperty::WriteToMemory(u8*& buffer, const MaterialProperty& proper
[&](const std::array<float, 2>& value) { write_memory(value.data(), sizeof(float) * 2); },
[&](const std::array<float, 3>& value) { write_memory(value.data(), sizeof(float) * 3); },
[&](const std::array<float, 4>& value) { write_memory(value.data(), sizeof(float) * 4); },
- [&](bool value) { write_memory(&value, sizeof(bool)); }},
+
+ // Bool has the size of an int in the shader
+ [&](bool value) {
+ u32 val = static_cast<u32>(value);
+ write_memory(&val, sizeof(u32));
+ }},
property.m_value);
}