From ef44eaf157a448938267ff707a3dbfeb1a87636f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 4 Mar 2021 13:16:26 +0200 Subject: [PATCH] Copy the location when moving output declarations out of functions --- source/glsl/generate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index 7c619830..71b35b2c 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -565,8 +565,11 @@ void InterfaceGenerator::visit(VariableDeclaration &var) { /* For output variables in function scope, generate a global interface and replace the local declaration with an assignment. */ - if(function_scope && generate_interface(var, "out", var.name)) + VariableDeclaration *out_var = 0; + if(function_scope && (out_var=generate_interface(var, "out", var.name))) { + out_var->source = var.source; + out_var->line = var.line; nodes_to_remove.insert(&var); if(var.init_expression) { -- 2.45.2