<p dir="ltr"><br>
On Nov 6, 2015 12:21 PM, "Matt Turner" <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>> wrote:<br>
><br>
> On Fri, Nov 6, 2015 at 8:27 AM, Juan A. Suarez Romero<br>
> <<a href="mailto:jasuarez@igalia.com">jasuarez@igalia.com</a>> wrote:<br>
> > Replace the current loop by a direct call to _mesa_fls() function.<br>
> ><br>
> > It also fixes an implicit bug in the current code where num_textures<br>
> > seems to be one value less than it should be when sh->Program->SamplersUsed > 0.<br>
> ><br>
> > For instance, num_textures is 0 instead of 1 when<br>
> > sh->Program->SamplersUsed is 1.<br>
><br>
> Looks good to me, and we use _mesa_fls elsewhere to do this same calculation.<br>
><br>
> Reviewed-by: Matt Turner <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>><br>
><br>
> Jason, was there some reason we weren't doing this? I'm confused why<br>
> we would have had a one-line comment and a 4-line loop when the all we<br>
> needed to do was call one functon?</p>
<p dir="ltr">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.</p>