From 7be6632f7d9a18557d2f75cce607ea17d93313f5 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 1 Sep 2021 13:01:11 +0300 Subject: [PATCH] anv: use shadow surface for stencil input attachment on gfx7 This fixes a number of tests like : dEQP-VK.renderpass*.suballocation.multisample.s8_uint.* dEQP-VK.renderpass*.suballocation.multisample.separate_stencil_usage.d24_unorm_s8_uint.*.test_stencil dEQP-VK.renderpass*.suballocation.multisample.d24_unorm_s8_uint.* dEQP-VK.renderpass*.suballocation.multisample.d32_sfloat_s8_uint.* Because the driver asserts when generating RENDER_SURFACE_STATE with a 8 Valign value for stencil buffer (only 2 & 4 are supported). Signed-off-by: Lionel Landwerlin Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/anv_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 7422ccdaf9e..62d14cc3b80 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -360,7 +360,8 @@ anv_image_plane_needs_shadow_surface(const struct intel_device_info *devinfo, if (devinfo->ver <= 7 && plane_format.aspect == VK_IMAGE_ASPECT_STENCIL_BIT && - (vk_plane_usage & VK_IMAGE_USAGE_SAMPLED_BIT)) { + (vk_plane_usage & (VK_IMAGE_USAGE_SAMPLED_BIT | + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT))) { /* gfx7 can't sample from W-tiled surfaces. */ return true; }