]> git.tdb.fi Git - libs/gl.git/commitdiff
Decorate builtin variables in the global scope
authorMikko Rasa <tdb@tdb.fi>
Sun, 10 Oct 2021 12:48:46 +0000 (15:48 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 10 Oct 2021 15:35:28 +0000 (18:35 +0300)
source/glsl/spirv.cpp

index 16168a8cb8725671197bf39567d276992e6c5695..d8f24d20b7007342827423cfd3b7d3b5b85bee79 100644 (file)
@@ -1646,6 +1646,11 @@ void SpirVGenerator::visit(VariableDeclaration &var)
                                        writer.write_op_decorate(var_id, DECO_BINDING, q.value);
                        }
                }
+               if(!var.name.compare(0, 3, "gl_"))
+               {
+                       BuiltinSemantic semantic = get_builtin_semantic(var.name);
+                       writer.write_op_decorate(var_id, DECO_BUILTIN, semantic);
+               }
 
                if(init_id && current_function)
                {