]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove default uniform block if it has no uniforms
authorMikko Rasa <tdb@tdb.fi>
Thu, 11 Nov 2021 11:34:59 +0000 (13:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 11 Nov 2021 11:34:59 +0000 (13:34 +0200)
source/core/program.cpp

index 66fbb7af61179a7ccb64554f24afb3bb5ac26868..8e8455626dc1dc7ab6ced86ba86f0cd2a741f25c 100644 (file)
@@ -108,6 +108,9 @@ void Program::collect_uniforms(const SpirVModule &mod)
                block.update_layout_hash();
        }
 
+       if(reflect_data.uniform_blocks.front().uniforms.empty())
+               reflect_data.uniform_blocks.erase(reflect_data.uniform_blocks.begin());
+
        reflect_data.update_layout_hash();
 }