turnip: fix resolve MSAA D24_UNORM_S8_UINT image to S8_UINT
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 12 Jan 2021 21:31:33 +0000 (21:31 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Feb 2021 16:51:02 +0000 (16:51 +0000)
commit09e9be3d8f5aee0819fe2a5bb9d8f598f3b0d842
treeafb86735942ecafbb42e519f9b9cd342e92e3f81
parentb609d4677d3f910c546c1d94d8ddfe4511e2f065
turnip: fix resolve MSAA D24_UNORM_S8_UINT image to S8_UINT

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 <siglesias@igalia.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8527>
src/freedreno/vulkan/tu_clear_blit.c