Skip to content

iris: Constant vs. Binding Table updates

Kenneth Graunke requested to merge kwg/mesa:iris-dirty-bindings into master

This MR improves our constants vs. bindings dirty tracking. It avoids re-emitting an entire binding table on constant updates (just the pointer now). It drops the BT pointer updates on Gen8 and Gen11, where they are not needed. Overall it cuts 61% of BTP updates and 4% of 3DSTATE_CONSTANT updates in a Shadow of Mordor trace on my Icelake.

Future work would be to switch Gen9 to legacy mode where we can emit 3DSTATE_CONSTANT without needing 3DSTATE_BINDING_TABLE_POINTERS. I have patches but they rely on a register being whitelisted. I would need to detect that scenario and cope with it. Or just require a newer kernel (also painful).

Secondly, it also stops uploading SURFACE_STATEs when constbufs are entirely used as push constants, instead using the null surface for those unused entries. Removing this driver overhead improved GFXBench5's gl_driver2 scores by 32%.

Future work there would be to move the UBO surface group to the end of the binding table, and drop it post-backend-compile if there are no pull constant loads. Since it'd be at the end, nothing would have to shift. This could avoid stalls on filling up the binder.

+@cmarcelo

Edited by Kenneth Graunke

Merge request reports