From: Mikko Rasa Date: Wed, 17 Nov 2021 12:52:06 +0000 (+0200) Subject: Remove empty default block before adding uniforms to blocks X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e0d9f85a9e4554f2bbf4354aa37ad6ae46aef718;p=libs%2Fgl.git Remove empty default block before adding uniforms to blocks Otherwise the block pointers of the uniforms will be incorrect --- diff --git a/source/core/program.cpp b/source/core/program.cpp index 8e845562..0b07da8e 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -94,6 +94,12 @@ void Program::collect_uniforms(const SpirVModule &mod) sort_member(reflect_data.uniforms, &ReflectData::UniformInfo::tag); + if(block_uniform_names.front().empty()) + { + reflect_data.uniform_blocks.erase(reflect_data.uniform_blocks.begin()); + block_uniform_names.erase(block_uniform_names.begin()); + } + for(unsigned i=0; i