summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-08-05 19:29:41 -0700
committerEric Anholt <[email protected]>2011-08-16 13:04:42 -0700
commite5363c7fd2ed6318e86ba4a62adc0c2377e51eef (patch)
tree404f0c698758a85288e51018f0fc9bf70ea6f177
parenteca762d831e099b549dafa0be896eac82b3fceb9 (diff)
i965/vs: Use an appropriate swizzle on src regs from variables.
Fixes glsl-vs-if-bool.
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 014f7e62284..734e2514536 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1140,6 +1140,7 @@ vec4_visitor::visit(ir_swizzle *ir)
void
vec4_visitor::visit(ir_dereference_variable *ir)
{
+ const struct glsl_type *type = ir->type;
dst_reg *reg = variable_storage(ir->var);
if (!reg) {
@@ -1149,6 +1150,9 @@ vec4_visitor::visit(ir_dereference_variable *ir)
}
this->result = src_reg(*reg);
+
+ if (type->is_scalar() || type->is_vector() || type->is_matrix())
+ this->result.swizzle = swizzle_for_size(type->vector_elements);
}
void