From 6e13a7d7e97adfc807c260fa80e4fdf91191d50a Mon Sep 17 00:00:00 2001 From: iwubcode Date: Thu, 20 Nov 2025 23:51:34 -0600 Subject: [PATCH] VideoCommon: fix MaterialAsset so that boolean parameters are written to memory as integers, matching the format internally expected by shaders --- Source/Core/VideoCommon/Assets/MaterialAsset.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/Assets/MaterialAsset.cpp b/Source/Core/VideoCommon/Assets/MaterialAsset.cpp index 5f5c97a9f1b..200bccf333f 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& value) { write_memory(value.data(), sizeof(float) * 2); }, [&](const std::array& value) { write_memory(value.data(), sizeof(float) * 3); }, [&](const std::array& 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(value); + write_memory(&val, sizeof(u32)); + }}, property.m_value); }