[Mesa-dev] [PATCH] i965: Don't try to normalize cubemap coordinates for textureSize.

Kenneth Graunke kenneth at whitecape.org
Fri Nov 11 02:07:00 PST 2011


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 at whitecape.org>
---
 .../drivers/dri/i965/brw_cubemap_normalize.cpp     |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
index 37f6d11..9e149f9 100644
--- a/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cubemap_normalize.cpp
@@ -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,
-- 
1.7.7.2



More information about the mesa-dev mailing list