From 8799ec430edae1211dcebf9868e5aec58f951dce Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 26 Feb 2021 00:50:52 +0200 Subject: [PATCH] Populate the interface block map in VariableResolver They're more variable-y than block-y. --- source/glsl/generate.cpp | 16 ++++++---------- source/glsl/generate.h | 1 - 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index e037e0a5..751043d9 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -78,16 +78,6 @@ void BlockResolver::enter(Block &block) block.parent = current_block; } -void BlockResolver::visit(InterfaceBlock &iface) -{ - /* Block names can't be used for any other identifiers so we can put them - in the same map with instance names. */ - current_block->interfaces[iface.name] = &iface; - if(!iface.instance_name.empty()) - current_block->interfaces[iface.instance_name] = &iface; - TraversingVisitor::visit(iface); -} - VariableResolver::VariableResolver(): builtins(0), @@ -268,6 +258,12 @@ void VariableResolver::visit(VariableDeclaration &var) void VariableResolver::visit(InterfaceBlock &iface) { + /* Block names can't be used for any other identifiers so we can put them + in the same map with instance names. */ + current_block->interfaces[iface.name] = &iface; + if(!iface.instance_name.empty()) + current_block->interfaces[iface.instance_name] = &iface; + SetForScope set_iface(block_interface, iface.interface); TraversingVisitor::visit(iface); } diff --git a/source/glsl/generate.h b/source/glsl/generate.h index 2a36f704..d0cbc08f 100644 --- a/source/glsl/generate.h +++ b/source/glsl/generate.h @@ -34,7 +34,6 @@ public: private: virtual void enter(Block &); - virtual void visit(InterfaceBlock &); }; class VariableResolver: private TraversingVisitor -- 2.43.0