[Mesa-dev] [PATCH 025/133] i965/fs_nir: Use the correct types for texture inputs

Connor Abbott cwabbott0 at gmail.com
Tue Dec 16 21:48:36 PST 2014


I know I had another solution to this problem, but... meh. I don't
particularly care what solution gets chosen.

Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>

On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 32 +++++++++++++++++++++++++-------
>  1 file changed, 25 insertions(+), 7 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> index aad5018..97fb0b7 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
> @@ -1566,29 +1566,47 @@ fs_visitor::nir_emit_texture(nir_tex_instr *instr)
>        fs_reg src = get_nir_src(instr->src[i]);
>        switch (instr->src_type[i]) {
>        case nir_tex_src_bias:
> -         lod = src;
> +         lod = retype(src, BRW_REGISTER_TYPE_F);
>           break;
>        case nir_tex_src_comparitor:
> -         shadow_comparitor = src;
> +         shadow_comparitor = retype(src, BRW_REGISTER_TYPE_F);
>           break;
>        case nir_tex_src_coord:
> -         coordinate = src;
> +         switch (instr->op) {
> +         case nir_texop_txf:
> +         case nir_texop_txf_ms:
> +            coordinate = retype(src, BRW_REGISTER_TYPE_D);
> +            break;
> +         default:
> +            coordinate = retype(src, BRW_REGISTER_TYPE_F);
> +            break;
> +         }
>           break;
>        case nir_tex_src_ddx:
> -         lod = src;
> +         lod = retype(src, BRW_REGISTER_TYPE_F);
>           lod_components = nir_tex_instr_src_size(instr, i);
>           break;
>        case nir_tex_src_ddy:
> -         lod2 = src;
> +         lod2 = retype(src, BRW_REGISTER_TYPE_F);
>           break;
>        case nir_tex_src_lod:
> -         lod = src;
> +         switch (instr->op) {
> +         case nir_texop_txs:
> +            lod = retype(src, BRW_REGISTER_TYPE_UD);
> +            break;
> +         case nir_texop_txf:
> +            lod = retype(src, BRW_REGISTER_TYPE_D);
> +            break;
> +         default:
> +            lod = retype(src, BRW_REGISTER_TYPE_F);
> +            break;
> +         }
>           break;
>        case nir_tex_src_ms_index:
>           sample_index = retype(src, BRW_REGISTER_TYPE_UD);
>           break;
>        case nir_tex_src_offset:
> -         offset = src;
> +         offset = retype(src, BRW_REGISTER_TYPE_D);
>           if (instr->is_array)
>              offset_components = instr->coord_components - 1;
>           else
> --
> 2.2.0
>
> _______________________________________________
> 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