summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2015-02-13 08:29:32 +0100
committerIago Toral Quiroga <itoral@igalia.com>2015-02-16 10:53:48 +0100
commit0a811e1d1e5b23ecefda3f4569f68198e2612f3f (patch)
tree16ed3331d7fbc96cfcf066d7432d6e291a3ee8d9 /src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
parentba426522dddf0860f59dedfe9953dbd509160c7d (diff)
downloadexternal_mesa3d-0a811e1d1e5b23ecefda3f4569f68198e2612f3f.zip
external_mesa3d-0a811e1d1e5b23ecefda3f4569f68198e2612f3f.tar.gz
external_mesa3d-0a811e1d1e5b23ecefda3f4569f68198e2612f3f.tar.bz2
i965: Fix a crash in the texture gradient lowering pass with cube samplers
We need to swizzle the rhs to match the number of components in the writemask, otherwise we'll hit an assertion in ir_assignment. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
index 9679d28..0424003 100644
--- a/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
+++ b/src/mesa/drivers/dri/i965/brw_lower_texture_gradients.cpp
@@ -124,7 +124,9 @@ lower_texture_grad_visitor::visit_leave(ir_texture *ir)
new(mem_ctx) ir_variable(grad_type, "size", ir_var_temporary);
if (ir->sampler->type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE) {
base_ir->insert_before(size);
- base_ir->insert_before(assign(size, expr(ir_unop_i2f, txs), WRITEMASK_XY));
+ base_ir->insert_before(assign(size,
+ swizzle_for_size(expr(ir_unop_i2f, txs), 2),
+ WRITEMASK_XY));
base_ir->insert_before(assign(size, new(mem_ctx) ir_constant(1.0f), WRITEMASK_Z));
} else {
emit(size, expr(ir_unop_i2f,