anv: Return optimal aux state for stencil buffer compression
authorSagar Ghuge <sagar.ghuge@intel.com>
Fri, 24 Apr 2020 17:33:27 +0000 (10:33 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Oct 2020 21:42:36 +0000 (21:42 +0000)
v2:
- Assert on aux_supported. (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/anv_image.c

index 044af4e..60b3911 100644 (file)
@@ -1359,9 +1359,6 @@ anv_layout_to_aux_state(const struct gen_device_info * const devinfo,
    /* All images that use an auxiliary surface are required to be tiled. */
    assert(image->planes[plane].surface.isl.tiling != ISL_TILING_LINEAR);
 
-   /* Stencil has no aux */
-   assert(aspect != VK_IMAGE_ASPECT_STENCIL_BIT);
-
    /* Handle a few special cases */
    switch (layout) {
    /* Invalid layouts */
@@ -1460,6 +1457,7 @@ anv_layout_to_aux_state(const struct gen_device_info * const devinfo,
 
       case ISL_AUX_USAGE_CCS_E:
       case ISL_AUX_USAGE_MCS:
+      case ISL_AUX_USAGE_STC_CCS:
          break;
 
       default:
@@ -1496,6 +1494,10 @@ anv_layout_to_aux_state(const struct gen_device_info * const devinfo,
          return ISL_AUX_STATE_PASS_THROUGH;
       }
 
+   case ISL_AUX_USAGE_STC_CCS:
+      assert(aux_supported);
+      return ISL_AUX_STATE_COMPRESSED_NO_CLEAR;
+
    default:
       unreachable("Unsupported aux usage");
    }