]> git.tdb.fi Git - libs/gl.git/commitdiff
Populate the interface block map in VariableResolver
authorMikko Rasa <tdb@tdb.fi>
Thu, 25 Feb 2021 22:50:52 +0000 (00:50 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 25 Feb 2021 23:21:10 +0000 (01:21 +0200)
They're more variable-y than block-y.

source/glsl/generate.cpp
source/glsl/generate.h

index e037e0a5bb09ee7ee26cb1bee9eb62155d41a2c3..751043d9231a64d4c72af4894ec29c39b8143d48 100644 (file)
@@ -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<string> set_iface(block_interface, iface.interface);
        TraversingVisitor::visit(iface);
 }
index 2a36f704603592ab5c60c035605cb1b6e85a5c47..d0cbc08f279c4b8c12837abf2e0f040b784f6f2b 100644 (file)
@@ -34,7 +34,6 @@ public:
 
 private:
        virtual void enter(Block &);
-       virtual void visit(InterfaceBlock &);
 };
 
 class VariableResolver: private TraversingVisitor