From: Mikko Rasa Date: Sun, 10 Oct 2021 12:48:46 +0000 (+0300) Subject: Decorate builtin variables in the global scope X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d5a146a5c86eab53460effcb1addbe1bbfe18109;p=libs%2Fgl.git Decorate builtin variables in the global scope --- diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 16168a8c..d8f24d20 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -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) {