iris: Track dirty UBOs per-stage for more targeted flushing.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 5 May 2020 20:05:52 +0000 (13:05 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 2 Sep 2021 03:14:37 +0000 (03:14 +0000)
commit9f1053a1f399324d626bf4946c1f6d6263ab027c
treeebebc87b5eadfe8b07fa41bf047cbe8d6ada831e
parent8be320117b03523806d5b643a87cc33bde5765d1
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>
src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_resolve.c
src/gallium/drivers/iris/iris_state.c