Excerpts from Brian Paul's message of Wed Sep 02 16:28:34 +0100 2009:
> Chris Wilson wrote:
> > Only use the active part of the state key and ignore all the texture units
> > beyond Const.MaxTextureUnits. For instance on my i915, this reduces
> > sizeof(struct state_key) from 196 to 100 bytes.
> 
> Actually, we can do better than that.  If we use key->nr_enabled_units 
> instead of ctx->Const.MaxTextureUnits we can ignore the disabled 
> texture units.  When no textures are enabled, the key size is only 4 
> bytes.  With unit[0] enabled, the key size is 16 bytes.

And since the memcmp() will stop after the inequality between
key->nr_enabled_units, there is no worry about reading beyond the end of
the short key. Excellent!
-ickle

------------------------------------------------------------------------------
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

Reply via email to