nvk: Reset rendering attachment locations in BeginCommandBuffer/Rendering

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31033>
This commit is contained in:
Faith Ekstrand 2024-09-04 13:56:11 -05:00 committed by Marge Bot
parent 9ba70bb1ed
commit b1abf771c7

View file

@ -647,6 +647,18 @@ nvk_cmd_buffer_begin_graphics(struct nvk_cmd_buffer *cmd,
render->stencil_att.vk_format =
inheritance_info->stencilAttachmentFormat;
const VkRenderingAttachmentLocationInfoKHR att_loc_info_default = {
.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR,
.colorAttachmentCount = inheritance_info->colorAttachmentCount,
};
const VkRenderingAttachmentLocationInfoKHR *att_loc_info =
vk_get_command_buffer_rendering_attachment_location_info(
cmd->vk.level, pBeginInfo);
if (att_loc_info == NULL)
att_loc_info = &att_loc_info_default;
vk_cmd_set_rendering_attachment_locations(&cmd->vk, att_loc_info);
nvk_cmd_buffer_dirty_render_pass(cmd);
}
}
@ -784,6 +796,12 @@ nvk_CmdBeginRendering(VkCommandBuffer commandBuffer,
render->all_linear = nvk_rendering_all_linear(render);
const VkRenderingAttachmentLocationInfoKHR ral_info = {
.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR,
.colorAttachmentCount = pRenderingInfo->colorAttachmentCount,
};
vk_cmd_set_rendering_attachment_locations(&cmd->vk, &ral_info);
nvk_cmd_buffer_dirty_render_pass(cmd);
/* Always emit at least one color attachment, even if it's just a dummy. */