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 <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
(cherry picked from commit 19ad26a8de)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40092>
This commit is contained in:
Faith Ekstrand 2026-02-07 21:13:01 -05:00 committed by Eric Engestrom
parent 3a92074d8c
commit 37191db342
3 changed files with 17 additions and 15 deletions

View file

@ -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

View file

@ -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

View file

@ -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;