glsl: only call mark_max_array if we are assigning an
authorTimothy Arceri <t_arceri@yahoo.com.au>
Thu, 23 Jan 2014 12:19:54 +0000 (23:19 +1100)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Thu, 23 Jan 2014 12:37:36 +0000 (23:37 +1100)
 array

This change does not help fix or prevent any bugs
it just seems reasonable to do

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/ast_to_hir.cpp

index e25cba3fa6497f27b4ed960c1b3a1b9bdb6c5b38..be12f97c3bef322af6a03635582a84c786b59798 100644 (file)
@@ -830,8 +830,10 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
                                                   rhs->type->array_size());
         d->type = var->type;
       }
-      mark_whole_array_access(rhs);
-      mark_whole_array_access(lhs);
+      if (lhs->type->is_array()) {
+         mark_whole_array_access(rhs);
+         mark_whole_array_access(lhs);
+      }
    }
 
    /* Most callers of do_assignment (assign, add_assign, pre_inc/dec,