anv: Do depth/stencil optimization for dynamic depth/stencil
authorJason Ekstrand <jason.ekstrand@collabora.com>
Fri, 15 Jul 2022 02:02:35 +0000 (21:02 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 19 Jul 2022 23:16:45 +0000 (23:16 +0000)
commit9ecc26ff276099ed2eb3fe22d417c84f49700d20
tree7ebc588e74fd75aef3a0d5179374a0db5b808349
parent07f5f159634eee84d7ff1078d65712ddf66c3c6d
anv: Do depth/stencil optimization for dynamic depth/stencil

When we made depth/stencil dynamic, we lost the optimization.  This is
particularly important for cases where the stencil test is enabled but
never writes anything as certain combinations with discard can cause
the stencil write (which doesn't do anything) to get moved late which
can be a measurable perf hit.  According to 028e1137e67b ("anv/pipeline:
Be smarter about depth/stencil state", it was a couple percent for DOTA2
on Broadwell back in the day.  No idea how it affects current titles.

This may also improve the depth/stncil PMA workarounds on Gen8 and Gen9
since they're now looking at optimized depth/stencil state.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17564>
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_pipeline.c
src/intel/vulkan/gfx7_cmd_buffer.c
src/intel/vulkan/gfx8_cmd_buffer.c