[Mesa-dev] [PATCH 2/6] i965: vs: Add fixup for textureSize with cube array samplers
Chris Forbes
chrisf at ijw.co.nz
Thu Nov 22 04:35:36 PST 2012
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index f243699..9859992 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2112,6 +2112,17 @@ vec4_visitor::visit(ir_texture *ir)
emit(inst);
+ /* fixup num layers (z) for cube arrays: hardware returns faces * layers;
+ * spec requires layers. */
+ if (ir->op == ir_txs) {
+ glsl_type const * type = ir->sampler->variable_referenced()->type;
+ if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE &&
+ type->sampler_array)
+ emit_math(SHADER_OPCODE_INT_QUOTIENT,
+ with_writemask(inst->dst, WRITEMASK_Z),
+ src_reg(inst->dst), src_reg(6));
+ }
+
swizzle_result(ir, src_reg(inst->dst), sampler);
}
--
1.8.0
More information about the mesa-dev
mailing list