glsl: Fix off-by-one error setting max_array_access for non-constant indexing
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 24 Mar 2011 23:50:23 +0000 (16:50 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 25 Mar 2011 18:28:07 +0000 (11:28 -0700)
NOTE: This is a candidate for the stable branches.

src/glsl/ast_to_hir.cpp

index cdb16fd..a1c76e8 100644 (file)
@@ -1577,7 +1577,7 @@ ast_expression::hir(exec_list *instructions,
             */
            ir_variable *v = array->whole_variable_referenced();
            if (v != NULL)
-              v->max_array_access = array->type->array_size();
+              v->max_array_access = array->type->array_size() - 1;
         }
       }