From bc8fd45feac14504b67db9de6fc487fac9fcbaf3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 28 Feb 2021 14:02:55 +0200 Subject: [PATCH] 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. --- source/glsl/generate.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.45.2