Module: Mesa
Branch: master
Commit: ddca93ddf70dc76eddb0aebb80de4b19a9b134b2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ddca93ddf70dc76eddb0aebb80de4b19a9b134b2

Author: Sagar Ghuge <[email protected]>
Date:   Fri Apr 24 10:41:42 2020 -0700

anv: Enable stencil buffer compression on Gen12+

v2: (Nanley Chery)
- Fix condition check.
- Move aux_usage assignment after add_aux_state_tracking_buffer method.

v3: (Nanley Chery)
- Move stencil condition close to depth block.

v4: (Nanley Chery)
- Add DEBUG_NO_RBC condition.

v5: (Nanley Chery)
- Don't add CCS plane explicitly.
- Use isl_surf_supports_ccs.

v6:
- Simplify condition (Nanley Chery)

Signed-off-by: Sagar Ghuge <[email protected]>
Reviewed-by: Nanley Chery <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

---

 src/intel/vulkan/anv_image.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 60b3911fc07..d07d0ec0b95 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -426,6 +426,16 @@ add_aux_surface_if_supported(struct anv_device *device,
          image->planes[plane].aux_usage = ISL_AUX_USAGE_HIZ_CCS;
       }
       add_surface(image, &image->planes[plane].aux_surface, plane);
+   } else if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT) {
+
+      if (INTEL_DEBUG & DEBUG_NO_RBC)
+         return VK_SUCCESS;
+
+      if (!isl_surf_supports_ccs(&device->isl_dev,
+                                 &image->planes[plane].surface.isl))
+         return VK_SUCCESS;
+
+      image->planes[plane].aux_usage = ISL_AUX_USAGE_STC_CCS;
    } else if ((aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) && image->samples 
== 1) {
       if (image->n_planes != 1) {
          /* Multiplanar images seem to hit a sampler bug with CCS and R16G16

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to