[Mesa-dev] [PATCH 10/11] i965/fs: Don't allow SINT32 as a return type for resinfo

Iago Toral itoral at igalia.com
Fri Nov 13 05:49:03 PST 2015


On Wed, 2015-11-11 at 17:26 -0800, Jason Ekstrand wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> index 974219f..dad541b 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> @@ -680,7 +680,15 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src
>  
>     switch (dst.type) {
>     case BRW_REGISTER_TYPE_D:
> -      return_format = BRW_SAMPLER_RETURN_FORMAT_SINT32;
> +      /* SINT32 isn't actually allowed for TXS.  This isn't explicitly stated
> +       * in the PRM, but the i965 PRM explicitly lists UINT32 and FLOAT32 as
> +       * being valid for resinfo but not SINT32 (Vol. 4 Section 4.8.1.1).
> +       * Emperical testing has also verified this.

Empirical

> +       */

Actually, I only see UINT32. For example, from the IVB PRM, volume 4,
part 1, page 130:

"The surface indicated in the surface state is not sampled. Instead, the
width, height, depth, and MIP count of the surface are returned as
indicated in the table below. The format of the returned data is UINT32"

I see the same text for HSW and BDW. Either way:

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>


> +      if (inst->opcode == SHADER_OPCODE_TXS)
> +         return_format = BRW_SAMPLER_RETURN_FORMAT_UINT32;
> +      else
> +         return_format = BRW_SAMPLER_RETURN_FORMAT_SINT32;
>        break;
>     case BRW_REGISTER_TYPE_UD:
>        return_format = BRW_SAMPLER_RETURN_FORMAT_UINT32;




More information about the mesa-dev mailing list