From 44792dd6fb56a709d9a1d33d7fccc2ab8de905d2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 5 Mar 2021 02:17:23 +0200 Subject: [PATCH] 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. --- source/glsl/generate.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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) -- 2.43.0