From: Mikko Rasa Date: Fri, 5 Mar 2021 00:17:23 +0000 (+0200) Subject: Fix a bug with resolving member declarations X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=44792dd6fb56a709d9a1d33d7fccc2ab8de905d2;p=libs%2Fgl.git Fix a bug with resolving member declarations The logic changes in 7daccf2 caused members of variables declared within anonymous interface blocks to not be resolved correctly. --- diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index 42694a8a..8626cac6 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -197,12 +197,7 @@ void VariableResolver::visit(VariableReference &var) var.declaration = i->second; } - if(var.declaration) - { - if(StructDeclaration *strct = dynamic_cast(var.declaration->type_declaration)) - r_members = &strct->members.variables; - } - else + if(!var.declaration) { const map &blocks = stage->interface_blocks; map::const_iterator i = blocks.find("_"+var.name); @@ -230,6 +225,10 @@ void VariableResolver::visit(VariableReference &var) } } + if(var.declaration) + if(StructDeclaration *strct = dynamic_cast(var.declaration->type_declaration)) + r_members = &strct->members.variables; + if(record_target) { if(r_assignment_target)