mesa: optimize _mesa_update_state, rework _NEW_* flags, more state var merging, etc.
This is a sizeable rework of some of the fixed-function code. Most commits focus on decreasing the CPU overhead in
_mesa_update_state. That required reworking some of the
I'm obviously targeting viewperf, but all apps using legacy features should benefit too, and maybe even some modern apps.
There are a few bug fixes for missing
_NEW flagging, but I didn't try to isolate them for stable branches due to complexities.
These are removed:
_NEW_LIGHT(this one was very heavy, so it's replaced by all 6 new flags)
_NEW_VARYING_VP_INPUTS(replaced by fixed-func program flags)
One flag is temporarily added and then removed by a later commit:
These are added:
_NEW_LIGHT_CONSTANTS(only used by
_mesa_update_stateand program parameters/uniforms)
_NEW_LIGHT_STATE(only used by drivers)
_NEW_CURRENT_ATTRIBused to intersect)
_NEW_TNL_SPACE(only used by
_NEW_FF_VERT_PROGRAM(only used by
_NEW_FF_FRAG_PROGRAM(only used by