I think the arbitrary-length bitset type is overkill. We really just
need a 64-bit bitfield for the foreseeable future, right?
These macros in bitset.h are pretty "heavy" if all the bitsets are
just 64 bits or less.
#define BITSET_COPY(x, y) _mesa_memcpy( (x), (y), sizeof (x) )
#define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0)
#define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) )
#define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) )
I propose this:
#ifdef HAVE_64_BIT_LONG_LONG // or some other test:
typedef unsigned long long Bitfield64;
#define BITSET_COPY(x, y) x = y
#define BITSET_EQUAL(x, y) (x == y)
#define BITSET_ZERO(x) x = 0
#define BITSET_ONES(x) x = ~0u
#else
// Use a pair of 4-byte ints:
typedef GLuint Bitfield64[2];
#define BITSET_COPY(x, y) x[0] = y[0]; x[1] = y[1]
#define BITSET_EQUAL(x, y) (x[0] == y[0] && x[1] == y[1])
#define BITSET_ZERO(x) x[0] = x[1] = 0
#define BITSET_ONES(x) x[0] = x[1] = ~0u
#endif
The code would be far more efficient this way. What do you think?
I still need to review the rest of the patch in more detail. Maybe
this evening - I've got other things I need to work on.
-Brian
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev