]> git.tdb.fi Git - libs/gl.git/commitdiff
Only set assign_to_subfield when in assignment target
authorMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 19:24:59 +0000 (21:24 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 19:24:59 +0000 (21:24 +0200)
source/glsl/optimize.cpp

index 0af24e3e8f88df55e0d449e0044f6007fafe0275..137bd94343190f275eebbaa877dfa554b4785a50 100644 (file)
@@ -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);
 }