From: Mikko Rasa Date: Thu, 4 Mar 2021 11:16:26 +0000 (+0200) Subject: Copy the location when moving output declarations out of functions X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ef44eaf157a448938267ff707a3dbfeb1a87636f;p=libs%2Fgl.git Copy the location when moving output declarations out of functions --- 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) {