From 1950b6c1a7cec1ac7df6fc35899ae64e5dfaf2ee 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 Part-of: --- src/vulkan/runtime/vk_graphics_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c index 273ef7b8799..c25855fb76b 100644 --- a/src/vulkan/runtime/vk_graphics_state.c +++ b/src/vulkan/runtime/vk_graphics_state.c @@ -1293,6 +1293,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) { @@ -1328,7 +1329,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; } @@ -1362,6 +1362,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);