Mesa (master): i965: Fix array indexing of arrays of matrices.

Eric Anholt anholt at kemper.freedesktop.org
Tue Sep 28 23:32:12 UTC 2010


Module: Mesa
Branch: master
Commit: ff0eb45f47ebf2fcc1af06a8b6b934c79dff1d41
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff0eb45f47ebf2fcc1af06a8b6b934c79dff1d41

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 28 15:25:40 2010 -0700

i965: Fix array indexing of arrays of matrices.

The deleted code was meant to be handling indexing of a matrix, which
would have been a noop if it had been correct.

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index feb0cc1..2ed5f26 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -796,12 +796,8 @@ fs_visitor::visit(ir_dereference_array *ir)
    ir->array->accept(this);
    index = ir->array_index->as_constant();
 
-   if (ir->type->is_matrix()) {
-      element_size = ir->type->vector_elements;
-   } else {
-      element_size = type_size(ir->type);
-      this->result.type = brw_type_for_base_type(ir->type);
-   }
+   element_size = type_size(ir->type);
+   this->result.type = brw_type_for_base_type(ir->type);
 
    if (index) {
       assert(this->result.file == UNIFORM ||
@@ -809,7 +805,7 @@ fs_visitor::visit(ir_dereference_array *ir)
 	      this->result.reg != 0));
       this->result.reg_offset += index->value.i[0] * element_size;
    } else {
-      assert(!"FINISHME: non-constant matrix column");
+      assert(!"FINISHME: non-constant array element");
    }
 }
 




More information about the mesa-commit mailing list