]> git.tdb.fi Git - libs/gl.git/commitdiff
Clear the stage map at the beginning if a resolving pass
authorMikko Rasa <tdb@tdb.fi>
Sun, 28 Feb 2021 12:02:55 +0000 (14:02 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 28 Feb 2021 19:41:54 +0000 (21:41 +0200)
This avoids accidentally resolving things to a declarations which is not
visible to the reference.

source/glsl/generate.cpp

index f93446b90a7d05dcbf50482a42b3aefe83710d46..fe053ade254c3105d80771a72d575b264583946a 100644 (file)
@@ -126,6 +126,8 @@ VariableResolver::VariableResolver():
 void VariableResolver::apply(Stage &s)
 {
        stage = &s;
+       s.types.clear();
+       s.interface_blocks.clear();
        Stage *builtin_stage = get_builtins(s.type);
        builtins = (builtin_stage ? &builtin_stage->content : 0);
        s.content.visit(*this);
@@ -306,6 +308,7 @@ void VariableResolver::visit(InterfaceBlock &iface)
 void FunctionResolver::apply(Stage &s)
 {
        stage = &s;
+       s.functions.clear();
        s.content.visit(*this);
 }