From 085ebad01690fafedeafe4bfe8421c9588f0238e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 6 Mar 2021 03:05:01 +0200 Subject: [PATCH] Remove an unnecessary loop over block hierarchy --- source/glsl/generate.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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; } } -- 2.45.2