]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove an unnecessary loop over block hierarchy
authorMikko Rasa <tdb@tdb.fi>
Sat, 6 Mar 2021 01:05:01 +0000 (03:05 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 6 Mar 2021 01:06:20 +0000 (03:06 +0200)
source/glsl/generate.cpp

index 770fb460d657196cf7781fd0ea9b9553a2728b21..1c8af82aa88b0b6e0426749a793aae55c4174532 100644 (file)
@@ -301,15 +301,11 @@ void VariableResolver::visit(VariableReference &var)
 void VariableResolver::visit(InterfaceBlockReference &iface)
 {
        iface.declaration = 0;
-       for(Block *block=current_block; block; block=block->parent)
+       map<string, InterfaceBlock *>::iterator i = stage->interface_blocks.find("_"+iface.name);
+       if(i!=stage->interface_blocks.end())
        {
-               map<string, InterfaceBlock *>::iterator i = stage->interface_blocks.find("_"+iface.name);
-               if(i!=stage->interface_blocks.end())
-               {
-                       iface.declaration = i->second;
-                       r_members = &i->second->members.variables;
-                       break;
-               }
+               iface.declaration = i->second;
+               r_members = &i->second->members.variables;
        }
 }