v3dv: don't resolve by averaging samples on depth/stencil resolves
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 14 Dec 2022 11:35:26 +0000 (12:35 +0100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 29 Dec 2022 19:25:29 +0000 (19:25 +0000)
For these we always want to use sample_0, averaging is reserved for
color formats. We were already doing this correctly for depth/stencil
resolved in render passes, but not for those happening through
vkCmdResolveImage.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
(cherry picked from commit 284285376bc7498d608dafe8b75352216fc3f483)

.pick_status.json
src/broadcom/vulkan/v3dvx_meta_common.c

index 79e9189..852cbf2 100644 (file)
         "description": "v3dv: don't resolve by averaging samples on depth/stencil resolves",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index 52a1dea..2d43766 100644 (file)
@@ -623,11 +623,14 @@ emit_resolve_image_layer_per_tile_list(struct v3dv_job *job,
       region->dstSubresource.baseArrayLayer + layer_offset :
       region->dstOffset.z + layer_offset;
 
+   bool is_depth_or_stencil =
+      region->dstSubresource.aspectMask &
+      (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT);
    emit_image_store(job->device, cl, framebuffer, dst,
                     region->dstSubresource.aspectMask,
                     dst_layer,
                     region->dstSubresource.mipLevel,
-                    false, false, true);
+                    false, false, !is_depth_or_stencil);
 
    cl_emit(cl, END_OF_TILE_MARKER, end);