]> git.tdb.fi Git - libs/gl.git/commitdiff
Copy the location when moving output declarations out of functions
authorMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 11:16:26 +0000 (13:16 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 15:32:04 +0000 (17:32 +0200)
source/glsl/generate.cpp

index 7c619830c1733f43160323172ff19605a69632e4..71b35b2c59f3ef8217db37d32b93123da763d047 100644 (file)
@@ -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)
                        {