From 09e9be3d8f5aee0819fe2a5bb9d8f598f3b0d842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Iglesias=20Gons=C3=A1lvez?= Date: Tue, 12 Jan 2021 21:31:33 +0000 Subject: [PATCH] turnip: fix resolve MSAA D24_UNORM_S8_UINT image to S8_UINT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to VK_KHR_depth_stencil_resolve spec (see VUID-VkSubpassDescriptionDepthStencilResolve-pDepthStencilResolveAttachment-03182) "If the VkFormat of pDepthStencilResolveAttachment has a stencil component, then the VkFormat of pDepthStencilAttachment must have a stencil component with the same number of bits and numerical type" That means that we can resolve MSAA depth/stencil to a stencil only image only if the stencil component matches with same number of bits and type. Although the driver only supports VK_RESOLVE_MODE_SAMPLE_ZERO_BIT resolve mode, it was doing a sample average when resolving a MSAA D24_UNORM_S8_UINT image to S8_UINT. Fixes the following tests: dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint.compatibility_depth_zero_stencil_zero_testing_s tencil dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint_separate_layouts.compatibility_depth_zero_stenc il_zero_testing_stencil Signed-off-by: Samuel Iglesias Gonsálvez Reviewed-by: Jonathan Marek Part-of: --- src/freedreno/vulkan/tu_clear_blit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_clear_blit.c b/src/freedreno/vulkan/tu_clear_blit.c index 654511b232a..3b3f31a96ff 100644 --- a/src/freedreno/vulkan/tu_clear_blit.c +++ b/src/freedreno/vulkan/tu_clear_blit.c @@ -2392,7 +2392,8 @@ tu_emit_blit(struct tu_cmd_buffer *cmd, .unk0 = !resolve, .gmem = !resolve, /* "integer" bit disables msaa resolve averaging */ - .integer = vk_format_is_int(attachment->format))); + .integer = vk_format_is_int(attachment->format) | + vk_format_is_depth_or_stencil(attachment->format))); tu_cs_emit_pkt4(cs, REG_A6XX_RB_BLIT_DST_INFO, 4); if (separate_stencil) {