From: Mikko Rasa Date: Thu, 4 Mar 2021 19:24:59 +0000 (+0200) Subject: Only set assign_to_subfield when in assignment target X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=dda547f94e4aff590592908b38ca1e78c2c24b08;p=libs%2Fgl.git Only set assign_to_subfield when in assignment target --- diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 0af24e3e..137bd943 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -678,7 +678,8 @@ void UnusedVariableRemover::visit(InterfaceBlockReference &iface) void UnusedVariableRemover::visit(MemberAccess &memacc) { - r_assign_to_subfield = true; + if(assignment_target) + r_assign_to_subfield = true; TraversingVisitor::visit(memacc); unused_nodes.erase(memacc.declaration); }