]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/optimize.cpp
Fix some bugs with name conflicts in function inlining
[libs/gl.git] / source / glsl / optimize.cpp
index c4118dee205d09f2f84c1e468001b6c6706de1c9..2a9bfb17273aa743c7dd7af8608065f7b66058a0 100644 (file)
@@ -90,6 +90,9 @@ const string &InlineContentInjector::apply(Stage &stage, FunctionDeclaration &ta
                inlined.push_back(r_inlined_statement);
        }
 
+       // Insert the variables here to enable further inlinings to avoid conflicts.
+       tgt_blk.variables.insert(variable_map.begin(), variable_map.end());
+
        SetForScope<unsigned> set_remap(remap_names, 1);
        SetForScope<string> set_prefix(remap_prefix, target_func.name);
        variable_map.clear();