anv: Handle compressed stencil buffer transition on Gen12+
authorSagar Ghuge <sagar.ghuge@intel.com>
Mon, 18 Nov 2019 19:21:14 +0000 (11:21 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Oct 2020 21:42:36 +0000 (21:42 +0000)
commitbe2ca24da55974a8129c0981ce7a8277cf5fc7bd
treec051ee99c1d266327c097ce61a703f09644e5053
parentc2a41028485d5ca0a67a4396ac7d8e491c688109
anv: Handle compressed stencil buffer transition on Gen12+

Handle compressed stencil buffer transition from one layout to another
on gen12+.

When stencil compression is enabled, we have to initialize buffer via
stencil clear (HZ_OP) before any renderpass.

v2:
- Pass predicate bit false to anv_image_ccs_op (Nanley Chery)

v3:
- update aspect assertion (Nanley Chery)

v4:
- Make state decision based on anv_layout_to_aux_state instated of
  anv_layout_to_aux_usage (Sagar Ghuge)

v5:
- No need to handle stencil CCS resolve case (Jason Ekstrand)
- Initialize buffer using HZ_OP (Nanley Chery)

v6: (Nanley Chery)
- Pass correct layer/level count.
- Remove local variable.

v7:
- Skip stencil initialization with HZ_OP packet if followed by fast
  clear. (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>
src/intel/vulkan/genX_cmd_buffer.c