[Mesa-dev] [PATCH V2 5/7] i965: fs: Add fixup for textureSize on Gen6/7

Matt Turner mattst88 at gmail.com
Wed Nov 28 13:40:18 PST 2012


On Wed, Nov 28, 2012 at 12:08 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> V2: Moved up into emit(ir_texture *) to avoid duplication and fix
> ordering for Gen7; Gen6 math quirks moved into previous patches.
>
> Tested on Gen6 only; passes all the cube_map_array piglits.
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> index d548709..a7de649 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> @@ -1309,6 +1309,18 @@ fs_visitor::visit(ir_texture *ir)
>     if (ir->shadow_comparitor)
>        inst->shadow_compare = true;
>
> +   /* fixup #layers for cube map arrays */
> +   if (ir->op == ir_txs) {
> +      glsl_type const * type = ir->sampler->variable_referenced()->type;

No space between * and type.

> +      if (type->sampler_dimensionality == GLSL_SAMPLER_DIM_CUBE &&
> +            type->sampler_array) {
> +
> +         fs_reg depth = dst;
> +         depth.reg_offset = 2;
> +         emit_math(SHADER_OPCODE_INT_QUOTIENT, depth, depth, fs_reg(6));
> +      }
> +   }
> +
>     swizzle_result(ir, dst, sampler);
>  }
>
> --
> 1.8.0.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list