iris: Track dirty UBOs per-stage for more targeted flushing.
This allows us to skip over individual constant buffer bindings which
haven't been changed since the last flush, or which are set to a user
buffer, which means they don't require flushing.
Omitting this commit would lead to the following statistically
significant Piglit Draw Overhead regressions:
107/DrawArrays (16 VBO| 8 UBO| 8 Tex) w/ 1 UBO change: XXX ±2.31% x22 -> XXX ±2.55% x21 d=-3.49% ±2.38% p=0.00%
79/DrawArrays ( 1 VBO| 8 UBO| 8 Tex) w/ 8 UBOs change: XXX ±1.90% x22 -> XXX ±2.25% x21 d=-3.20% ±2.04% p=0.00%
78/DrawArrays ( 1 VBO| 8 UBO| 8 Tex) w/ 1 UBO change: XXX ±2.64% x22 -> XXX ±2.58% x21 d=-2.74% ±2.58% p=0.12%
45/DrawElements (16 VBO| 8 UBO| 8 Tex) w/ 1 UBO change: XXX ±2.53% x22 -> XXX ±2.29% x21 d=-2.41% ±2.39% p=0.20%
108/DrawArrays (16 VBO| 8 UBO| 8 Tex) w/ 8 UBOs change: XXX ±2.10% x22 -> XXX ±1.41% x21 d=-2.36% ±1.78% p=0.01%
16/DrawElements ( 1 VBO| 8 UBO| 8 Tex) w/ 1 UBO change: XXX ±2.44% x22 -> XXX ±1.19% x21 d=-2.12% ±1.93% p=0.09%
46/DrawElements (16 VBO| 8 UBO| 8 Tex) w/ 8 UBOs change: XXX ±2.93% x22 -> XXX ±2.44% x21 d=-1.99% ±2.68% p=1.93%
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12691>