From 6a2704a52049ec51bc50e21a1b2edcd9a2a278b4 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 9 Apr 2026 15:18:41 +0200 Subject: [PATCH] vulkan: mark RP attachments as invalid when no rendering create info VkPipelineRenderingCreateInfo is only required in the fragment output interface lib. For pre-rasterization shaders and fragment shader state libs, only the view mask is used but it's optional. If the attachments info isn't marked invalid merging renderpass info during lib imports wouldn't work because it would assume that the first lib has attachment info (eg. the pre-rasterization lib). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15241 Cc: mesa-stable Signed-off-by: Samuel Pitoiset (cherry picked from commit 1950b6c1a7cec1ac7df6fc35899ae64e5dfaf2ee) Part-of: --- .pick_status.json | 2 +- src/vulkan/runtime/vk_graphics_state.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 16754322229..eabdd93bc31 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -604,7 +604,7 @@ "description": "vulkan: mark RP attachments as invalid when no rendering create info", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c index 2c6415ee796..e80fca11028 100644 --- a/src/vulkan/runtime/vk_graphics_state.c +++ b/src/vulkan/runtime/vk_graphics_state.c @@ -1232,6 +1232,7 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp, *rp = (struct vk_render_pass_state) { .depth_attachment_format = VK_FORMAT_UNDEFINED, .stencil_attachment_format = VK_FORMAT_UNDEFINED, + .attachments = MESA_VK_RP_ATTACHMENT_INFO_INVALID, }; if (info->renderPass != VK_NULL_HANDLE && driver_rp != NULL) { @@ -1269,7 +1270,6 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp, */ if (info->renderPass == VK_NULL_HANDLE && !(lib & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)) { - rp->attachments = MESA_VK_RP_ATTACHMENT_INFO_INVALID; return; } @@ -1303,6 +1303,8 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp, rp->depth_stencil_attachment_samples = asc_info->depthStencilAttachmentSamples; } + rp->attachments = 0; + for (uint32_t i = 0; i < r_info->colorAttachmentCount; i++) { if (rp->color_attachment_formats[i] != VK_FORMAT_UNDEFINED) rp->attachments |= MESA_VK_RP_ATTACHMENT_COLOR_BIT(i);