[Mesa-dev] [PATCH] nir/glsl_to_nir: use _mesa_fls() to compute num_textures
Matt Turner
mattst88 at gmail.com
Fri Nov 6 12:21:38 PST 2015
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?
More information about the mesa-dev
mailing list