-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris Wilson wrote:
> By rearranging the bitfields within the key we can reduce the size
> of the key from 644 to 196 bytes, reducing the cost of both the
> hashing and equality tests.
How did you arrive at these numbers? Is that what sizeof says, or did
you count?
> ---
> src/mesa/main/texenvprogram.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
> index 5913957..3851937 100644
> --- a/src/mesa/main/texenvprogram.c
> +++ b/src/mesa/main/texenvprogram.c
> @@ -82,8 +82,8 @@ texenv_doing_secondary_color(GLcontext *ctx)
> #define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM)
>
> struct mode_opt {
> - GLuint Source:4; /**< SRC_x */
> - GLuint Operand:3; /**< OPR_x */
> + GLubyte Source:4; /**< SRC_x */
> + GLubyte Operand:3; /**< OPR_x */
> };
As mentioned in a couple other replies, this won't do what you want.
C99 only allows int and unsigned int as bitfields. The standard also
requires that the structure sizes be aligned to the native alignment.
> struct state_key {
> @@ -103,10 +103,11 @@ struct state_key {
>
> GLuint NumArgsRGB:3; /**< up to MAX_COMBINER_TERMS */
> GLuint ModeRGB:5; /**< MODE_x */
> - struct mode_opt OptRGB[MAX_COMBINER_TERMS];
>
> GLuint NumArgsA:3; /**< up to MAX_COMBINER_TERMS */
> GLuint ModeA:5; /**< MODE_x */
> +
> + struct mode_opt OptRGB[MAX_COMBINER_TERMS];
> struct mode_opt OptA[MAX_COMBINER_TERMS];
> } unit[MAX_TEXTURE_UNITS];
> };
The second part looks good, and it will do what you want. :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkqfAzAACgkQX1gOwKyEAw/cfACgiieM8EO32lJrtGgh55VvsEGz
Ng4AnAwiI5KwuU1k5ySI51dc3I709WwP
=YIvN
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev