[Mesa-dev] [PATCH 1/6] nir: const_index helpers

Jason Ekstrand jason at jlekstrand.net
Mon Feb 8 20:28:03 UTC 2016


On Mon, Feb 8, 2016 at 12:16 PM, Rob Clark <robdclark at gmail.com> wrote:

> On Mon, Feb 8, 2016 at 3:13 PM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> >> +   if (info->index_map[NIR_INTRINSIC_BASE] ||
> >> +       info->index_map[NIR_INTRINSIC_WRMASK]) {
> >> +      fprintf(fp, " /*");
> >> +      if (info->index_map[NIR_INTRINSIC_BASE])
> >> +         fprintf(fp, " base=%d", nir_intrinsic_base(instr));
> >> +      if (info->index_map[NIR_INTRINSIC_WRMASK]) {
> >> +          unsigned wrmask = nir_intrinsic_write_mask(instr);
> >> +          fprintf(fp, " wrmask=");
> >> +          for (unsigned i = 0; i < 4; i++)
> >> +             if ((wrmask >> i) & 1)
> >> +                fprintf(fp, "%c", "xyzw"[i]);
> >> +      }
> >> +      fprintf(fp, " */");
> >> +   }
> >
> >
> > Can we use an enum -> name table to name all of them?  Right now, it
> looks
> > like it only names baes and writemask.
>
> Hmm.. sure.  I think writemask is really the only one needing special
> casing.  I guess all the others would just show as %d..
>

Sure.  That one makes sense as hex.  The others shouldn't matter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160208/c6842fb8/attachment.html>


More information about the mesa-dev mailing list