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 <samuel.pitoiset@gmail.com>
(cherry picked from commit 1950b6c1a7)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
Samuel Pitoiset 2026-04-09 15:18:41 +02:00 committed by Eric Engestrom
parent 0e1922550d
commit 6a2704a520
2 changed files with 4 additions and 2 deletions

View file

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

View file

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