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

Jason Ekstrand jason at jlekstrand.net
Fri Nov 13 07:42:39 PST 2015


On Nov 13, 2015 5:49 AM, "Iago Toral" <itoral at igalia.com> wrote:
>
> 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>

It's only gen 4-5 where you get any choice.  At least on gen4, you can ask
for it in float and the hardware will, supposedly do that. However, there's
no real point. I can change it to just always stomp resinfo to uint32.
--Jason

>
> > +      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;
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151113/cc67c0ef/attachment.html>


More information about the mesa-dev mailing list