On 05/25/2016 12:57 PM, Matt Turner wrote: > On Wed, May 25, 2016 at 9:17 AM, Ian Romanick <i...@freedesktop.org> wrote: >> On 05/23/2016 11:42 PM, mathias.froehl...@gmx.net wrote: >>> From: Mathias Fröhlich <mathias.froehl...@web.de> >>> >>> Replaces loops that iterate all lights and test >>> which of them is enabled by a loop only iterating over >>> the bits set in the enabled bitmask. >>> --- >>> src/mesa/tnl/t_vb_light.c | 2 +- >>> src/mesa/tnl/t_vb_lighttmp.h | 27 ++++++++++++++++++++------- >>> 2 files changed, 21 insertions(+), 8 deletions(-) >>> >>> diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c >>> index 029265a..0cdb925 100644 >>> --- a/src/mesa/tnl/t_vb_light.c >>> +++ b/src/mesa/tnl/t_vb_light.c >>> @@ -394,7 +394,7 @@ static void validate_lighting( struct gl_context *ctx, >>> tab = _tnl_light_tab; >>> } >>> else { >>> - if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) >>> + if (_mesa_bitcount(ctx->Light._EnabledLights) == 1) >> >> I think using an is_pow2() predicate here would be better. It looks >> like the only one in Mesa is in src/intel/isl/isl_priv.h, but it should >> be easy enough to add that to somewhere in src/util. > > _mesa_is_pow_two in imports.h.
Ugh. So... there are three different versions in the code base, and each spells things completely different. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev