Skip to content

mesa: optimize _mesa_update_state, rework _NEW_* flags, more state var merging, etc.

Marek Olšák requested to merge mareko/mesa:opt-mesa-update-state into master

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 _NEW_* flags.

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

These are added:

  • _NEW_LIGHT_CONSTANTS (only used by _mesa_update_state and program parameters/uniforms)
  • _NEW_LIGHT_STATE (only used by drivers)
  • _NEW_MATERIAL (where _NEW_LIGHT and _NEW_CURRENT_ATTRIB used to intersect)
  • _NEW_TNL_SPACE (only used by _mesa_update_state)
  • _NEW_FF_VERT_PROGRAM (only used by _mesa_update_state)
  • _NEW_FF_FRAG_PROGRAM (only used by _mesa_update_state)

This also includes 5 commits from !8798 (merged) at the beginning that can be merged by either MR. (instead of having a dependency on !8798 (merged))

Merge request reports