summaryrefslogtreecommitdiffstats
path: root/thirdparty/spirv-reflect/spirv_reflect.c
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-08-16 10:35:06 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-08-16 10:35:06 +0200
commit55c8fd85ed57150667c10f93525cd223eedbe803 (patch)
treeaec8765a360ecd209dc72e6d27591e7d0fd56ee5 /thirdparty/spirv-reflect/spirv_reflect.c
parent5098ac587ef532607c4aea6c1d558a8bcb4cb711 (diff)
parent90679f1dcf3e1ad9e8ef50372de39578bc196ec5 (diff)
downloadredot-engine-55c8fd85ed57150667c10f93525cd223eedbe803.tar.gz
Merge pull request #94985 from RandomShaper/sc_sized_array
Report shader arrays sized after spec constants as zero-sized
Diffstat (limited to 'thirdparty/spirv-reflect/spirv_reflect.c')
-rw-r--r--thirdparty/spirv-reflect/spirv_reflect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c
index c96dd85439..d6c926b40a 100644
--- a/thirdparty/spirv-reflect/spirv_reflect.c
+++ b/thirdparty/spirv-reflect/spirv_reflect.c
@@ -2692,6 +2692,13 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p
// ...then array
uint32_t element_count = (p_member_var->array.dims_count > 0 ? 1 : 0);
for (uint32_t i = 0; i < p_member_var->array.dims_count; ++i) {
+// -- GODOT begin --
+ if (p_member_var->array.spec_constant_op_ids[i] != (uint32_t)INVALID_VALUE) {
+ // Force size to be reported as 0 to effectively disable buffer size validation, since
+ // the value is unreliable anyway as only valid for the default values of the SCs involved.
+ element_count = 0;
+ }
+// -- GODOT end --
element_count *= p_member_var->array.dims[i];
}
p_member_var->size = element_count * p_member_var->array.stride;