]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/spirv.cpp
Decorate builtin variables in the global scope
[libs/gl.git] / 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)
                {