diff options
author | Chris Forbes <[email protected]> | 2012-11-22 21:32:08 +1300 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-12-14 15:26:31 -0800 |
commit | f6a3fda25d2d9cf825c38e3e46f7cf44bd7c99e1 (patch) | |
tree | 0b3f0744193825efbfeeba68e6418bb9c669f7ce /src | |
parent | 1cb57ea493d892bf5065e5fb0c5dd745744cc71c (diff) |
i965: vs: Add fixup for textureSize with cube array samplers
V3: Fixed weird whitespace
V4: Use sampler's type rather than variable's type; otherwise broken
with arrays of samplers. (Thanks Eric)
v5: Fix a couple more style nits (by anholt)
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 13 |
1 files changed, 13 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 97593d090b1..104057cf119 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -2117,6 +2117,19 @@ 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->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); } |