From d5a146a5c86eab53460effcb1addbe1bbfe18109 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 10 Oct 2021 15:48:46 +0300 Subject: [PATCH] Decorate builtin variables in the global scope --- source/glsl/spirv.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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) { -- 2.45.2