[Mesa-dev] [PATCH] nir/glsl_to_nir: use _mesa_fls() to compute num_textures
Jason Ekstrand
jason at jlekstrand.net
Fri Nov 13 07:37:31 PST 2015
On Nov 6, 2015 12:21 PM, "Matt Turner" <mattst88 at gmail.com> wrote:
>
> On Fri, Nov 6, 2015 at 8:27 AM, Juan A. Suarez Romero
> <jasuarez at igalia.com> wrote:
> > Replace the current loop by a direct call to _mesa_fls() function.
> >
> > It also fixes an implicit bug in the current code where num_textures
> > seems to be one value less than it should be when
sh->Program->SamplersUsed > 0.
> >
> > For instance, num_textures is 0 instead of 1 when
> > sh->Program->SamplersUsed is 1.
>
> Looks good to me, and we use _mesa_fls elsewhere to do this same
calculation.
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
>
> Jason, was there some reason we weren't doing this? I'm confused why
> we would have had a one-line comment and a 4-line loop when the all we
> needed to do was call one functon?
I didn't want to pull a non-inline mesa function into NIR and add a link
dependency and I was too lazy to move it into util.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151113/db77ea65/attachment.html>
More information about the mesa-dev
mailing list