glsl: Fix setting of OutputsWritten for whole array dereference.
authorEric Anholt <eric@anholt.net>
Wed, 7 Sep 2011 18:00:03 +0000 (11:00 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 9 Sep 2011 03:20:49 +0000 (20:20 -0700)
We just want to mark the whole thing used, not mark from each element
the whole size in use.  Fixes undefined URB entry writes on i965,
which blew up with debugging enabled.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ir_set_program_inouts.cpp

index 085456533c5970a9b4c52e96ee63383e973b0c75..3b10b909724a2dfc833fc8ecbad923626caa643b 100644 (file)
@@ -94,10 +94,8 @@ ir_set_program_inouts_visitor::visit(ir_dereference_variable *ir)
       return visit_continue;
 
    if (ir->type->is_array()) {
-      for (unsigned int i = 0; i < ir->type->length; i++) {
-        mark(this->prog, ir->var, i,
-             ir->type->length * ir->type->fields.array->matrix_columns);
-      }
+      mark(this->prog, ir->var, 0,
+          ir->type->length * ir->type->fields.array->matrix_columns);
    } else {
       mark(this->prog, ir->var, 0, ir->type->matrix_columns);
    }