From 37191db3420f0adf1bf8b6a1dddf858ea0015353 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sat, 7 Feb 2026 21:13:01 -0500 Subject: [PATCH] panvk: Create both Z/S descriptors, even for separate Z/S The Vulkan spec says that aspects are ignored for Z/S attachments so we shouldn't consider that as a factor when deciding whether or not to create other aspect descriptors. This will be irrelevant in a couple of commits but we need it for the backport anyway. Cc: mesa-stable Reviewed-by: Lars-Ivar Hesselberg Simonsen Acked-by: Boris Brezillon Acked-by: Eric R. Smith (cherry picked from commit 19ad26a8de7834bb6beba92c9d8eb7842b08ca48) Part-of: --- .pick_status.json | 2 +- src/panfrost/ci/panfrost-g52-fails.txt | 5 ----- src/panfrost/vulkan/panvk_vX_image_view.c | 25 +++++++++++++++-------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index cd05fa14d04..84e5531f378 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1264,7 +1264,7 @@ "description": "panvk: Create both Z/S descriptors, even for separate Z/S", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt index 2f264ebfd82..4ecbe91052c 100644 --- a/src/panfrost/ci/panfrost-g52-fails.txt +++ b/src/panfrost/ci/panfrost-g52-fails.txt @@ -352,11 +352,6 @@ dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_2_primary_cm dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_primary_cmdbuffers_resuming,Fail dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.single_cmdbuffer_resuming,Fail -dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_1.multi_draw_barriers,Crash -dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_4.multi_draw_barriers,Crash -dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_1.multi_draw_barriers,Crash -dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_4.multi_draw_barriers,Crash - # New fails in 1.4.3.3 dEQP-VK.pipeline.fast_linked_library.empty_fs.masked_samples,Fail dEQP-VK.pipeline.monolithic.empty_fs.masked_samples,Fail diff --git a/src/panfrost/vulkan/panvk_vX_image_view.c b/src/panfrost/vulkan/panvk_vX_image_view.c index 860bf1f0b4f..dfb6cfc4911 100644 --- a/src/panfrost/vulkan/panvk_vX_image_view.c +++ b/src/panfrost/vulkan/panvk_vX_image_view.c @@ -87,12 +87,8 @@ prepare_tex_descs(struct panvk_image_view *view) bool img_combined_ds = vk_format_aspects(image->vk.format) == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT); - bool view_combined_ds = view->vk.aspects == - (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT); - bool can_preload_other_aspect = - (view->vk.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && - (img_combined_ds && - (view_combined_ds || panvk_image_is_interleaved_depth_stencil(image))); + bool can_preload_other_aspect = img_combined_ds && + (view->vk.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT); if (util_format_is_depth_or_stencil(view->pview.format)) { /* Vulkan wants R001, where the depth/stencil is stored in the red @@ -209,9 +205,20 @@ prepare_tex_descs(struct panvk_image_view *view) * already, so move on to the stencil. If it wasn't present, it's the * stencil texture we create first, and we need t handle the depth here. */ - pview.format = (view->vk.aspects & VK_IMAGE_ASPECT_DEPTH_BIT) - ? panvk_image_stencil_only_pfmt(image) - : panvk_image_depth_only_pfmt(image); + const VkImageAspectFlagBits other_aspect = + (view->vk.aspects & VK_IMAGE_ASPECT_DEPTH_BIT) + ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT; + const uint8_t other_plane = panvk_plane_index(image, other_aspect); + + pview.format = other_aspect == VK_IMAGE_ASPECT_DEPTH_BIT + ? panvk_image_depth_only_pfmt(image) + : panvk_image_stencil_only_pfmt(image); + + memset(pview.planes, 0, sizeof(pview.planes)); + pview.planes[0] = (struct pan_image_plane_ref) { + .image = &image->planes[other_plane].image, + .plane_idx = 0, + }; ptr.cpu += tex_payload_size; ptr.gpu += tex_payload_size;