From df9119a9bf2d348a513c515ed92953353da97b54 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 7 Nov 2021 19:12:14 +0200 Subject: [PATCH] Always set uniform array size to at least one This makes it consistent between GLSL and SPIR-V. --- source/core/program.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/program.cpp b/source/core/program.cpp index 2934d240..476a9c7d 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -79,7 +79,7 @@ void Program::collect_uniforms(const SpirVModule &mod, const map info.tag = v.name; info.location = v.location; info.binding = v.binding; - info.array_size = v.array_size; + info.array_size = max(v.array_size, 1U); info.type = v.type; } } @@ -136,7 +136,7 @@ void Program::collect_block_uniforms(const SpirVModule::Structure &strct, const info.name = name; info.tag = name; info.offset = offset; - info.array_size = m.array_size; + info.array_size = max(m.array_size, 1U); info.array_stride = m.array_stride; info.matrix_stride = m.matrix_stride; info.type = m.type; -- 2.45.2