summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-09-27 22:19:51 -0700
committerEric Anholt <[email protected]>2010-09-28 09:33:31 -0700
commit07fc8eed8f0398063d87acf3a7ee392da4184822 (patch)
tree5bead90952bfbcf868bdea9fec624ca7c9622e6d
parent719f84d9aba6b016e1069e0461cbfc4211f5a3b5 (diff)
i965: Set the variable type when dereferencing an array.
We don't set the type on the array virtual reg as a whole, so here's the right place. Fixes: glsl1-GLSL 1.20 arrays glsl1-temp array with constant indexing, fragment shader glsl1-temp array with swizzled variable indexing
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 78c1bc6ea6b..3b56340343f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -613,6 +613,21 @@ fs_visitor::visit(ir_dereference_array *ir)
element_size = ir->type->vector_elements;
} else {
element_size = type_size(ir->type);
+ switch (ir->type->base_type) {
+ case GLSL_TYPE_UINT:
+ this->result.type = BRW_REGISTER_TYPE_UD;
+ break;
+ case GLSL_TYPE_INT:
+ case GLSL_TYPE_BOOL:
+ this->result.type = BRW_REGISTER_TYPE_D;
+ break;
+ case GLSL_TYPE_FLOAT:
+ this->result.type = BRW_REGISTER_TYPE_F;
+ break;
+ default:
+ /* deref producing struct, no need to tweak type yet. */
+ break;
+ }
}
if (index) {