i965: Don't try to normalize cubemap coordinates for textureSize.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 9 Nov 2011 09:09:03 +0000 (01:09 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 12 Nov 2011 08:56:20 +0000 (00:56 -0800)
Although textureSize is represented as an ir_texture with op == ir_txs,
it doesn't have a coordinate, so normalizing it doesn't make sense.

Fixes crashes in oglconform glsl-bif-tex-size basic.samplerCube.* tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp

index 37f6d11c9fc2e4e900343ae43044c05abfd25617..9e149f96f5382178db42024bde876821e0bb0ccc 100644 (file)
@@ -51,6 +51,9 @@ brw_cubemap_normalize_visitor::visit_leave(ir_texture *ir)
    if (ir->sampler->type->sampler_dimensionality != GLSL_SAMPLER_DIM_CUBE)
       return visit_continue;
 
+   if (ir->op == ir_txs)
+      return visit_continue;
+
    void *mem_ctx = ralloc_parent(ir);
 
    ir_variable *var = new(mem_ctx) ir_variable(ir->coordinate->type,