From: Mikko Rasa Date: Sun, 28 Feb 2021 12:02:55 +0000 (+0200) Subject: Clear the stage map at the beginning if a resolving pass X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=bc8fd45feac14504b67db9de6fc487fac9fcbaf3 Clear the stage map at the beginning if a resolving pass This avoids accidentally resolving things to a declarations which is not visible to the reference. --- diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index f93446b9..fe053ade 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -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); }