[Bf-committers] Layer system

David Bryant aceone at bellsouth.net
Fri Dec 21 23:52:45 CET 2007


This would be very fast if the loops unrolled. But,how would it meld in with 
the present code? Wouldn't a total overhaul still be necessary?

----- Original Message ----- 
From: "Martin Poirier" <theeth at yahoo.com>
To: "bf-blender developers" <bf-committers at blender.org>
Sent: Friday, December 21, 2007 5:48 PM
Subject: Re: [Bf-committers] Layer system


>
> --- David Bryant <aceone at bellsouth.net> wrote:
>
>> I use bitfields in my patch but making bitfield
>> arraysI'im unsure.Give a
>> code example.I need to understand.
>
> int isOnLayers(int *obLayers, int *checkLayers)
> {
>    int i;
>    for( i = 0; i < NB_LAYER_BLOCKS; i++)
>    {
>        if (obLayers[i] & checkLayers[i])
>            return 1;
>    }
>    return 0;
> }
>
> With any decent compiler that loop is unrolled
> (NB_LAYER_BLOCKS is constant) and with luck combines
> multiple blocks in a scalar instruction (SSE*).
>
> That's pretty much the equivalent of just using a
> larger data type, without limits to the number of bits
> in the field.
>
> Martin
>
>
> 
> ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search. 
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers 



More information about the Bf-committers mailing list