From 03a81d79f895a9e81df03cb7e6b1e8a8e3945126 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 2 Oct 2024 15:36:03 -0400 Subject: [PATCH] hk: Reset rendering attachment locations in BeginCommandBuffer/Rendering backport of b1abf771c7d ("nvk: Reset rendering attachment locations in BeginCommandBuffer/Rendering") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/vulkan/hk_cmd_draw.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/asahi/vulkan/hk_cmd_draw.c b/src/asahi/vulkan/hk_cmd_draw.c index e5c3dec4416..ddf7b839bdd 100644 --- a/src/asahi/vulkan/hk_cmd_draw.c +++ b/src/asahi/vulkan/hk_cmd_draw.c @@ -225,6 +225,18 @@ hk_cmd_buffer_begin_graphics(struct hk_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); + hk_cmd_buffer_dirty_render_pass(cmd); } } @@ -620,6 +632,12 @@ hk_CmdBeginRendering(VkCommandBuffer commandBuffer, render->tilebuffer = agx_build_tilebuffer_layout( formats, render->color_att_count, render->tilebuffer.nr_samples, true); + 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); + hk_cmd_buffer_dirty_render_pass(cmd); /* Determine whether the render area is complete, enabling us to use a