From: Mikko Rasa Date: Sat, 6 Mar 2021 01:05:01 +0000 (+0200) Subject: Remove an unnecessary loop over block hierarchy X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=085ebad01690fafedeafe4bfe8421c9588f0238e;p=libs%2Fgl.git Remove an unnecessary loop over block hierarchy --- diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index 770fb460..1c8af82a 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -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::iterator i = stage->interface_blocks.find("_"+iface.name); + if(i!=stage->interface_blocks.end()) { - map::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; } }