[Mesa-dev] [PATCH 1/2] nir: Add is_divergent_vector search helper

Ilia Mirkin imirkin at alum.mit.edu
Tue May 7 22:07:04 UTC 2019


On Tue, May 7, 2019 at 5:45 PM Alyssa Rosenzweig <alyssa at rosenzweig.io> wrote:
>
> > IMO better names might be is_scalar_swizzle or something.
>
> Ah, yes, that would be a better name! is_not_scalar_swizzle in this case
> (logic is flipped).
>
> > Can num_components be 1? If so, then this will return false, whereas
> > you probably wanted it to return true.
>
> I think that's the correct behaviour...? It should return true if
> multiple distinct channels are accessed. For nr_components=1, that's
> false by definition.

Right, that's my bad -- I was thinking is_scalar, but this is
is_non_scalar, so you're good. (My personal preference would be to
make it is_scalar and then stick a negation into the nir rule, but I
don't have anything solid to back up that preference. Negations in
names are confusing to me, I guess.)

Cheers,

  -ilia


More information about the mesa-dev mailing list