From efde8bf5995f1659f61ca9322043282fbb2afe1a Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 16 Oct 2025 09:13:17 -0400 Subject: [PATCH] tu: Remove tu_attachment_info This is an old leftover from the skeleton stage of the driver, and we have never needed anything other than the image view. Having this in the way made it impossible to write generic code that reads the attachments in the !image_framebuffer and dynamic rendering cases. Part-of: --- src/freedreno/vulkan/tu_cmd_buffer.cc | 2 +- src/freedreno/vulkan/tu_device.cc | 4 ++-- src/freedreno/vulkan/tu_device.h | 7 +------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.cc b/src/freedreno/vulkan/tu_cmd_buffer.cc index 5fbaa58dbc4..c86a097293e 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.cc +++ b/src/freedreno/vulkan/tu_cmd_buffer.cc @@ -5807,7 +5807,7 @@ tu_CmdBeginRenderPass2(VkCommandBuffer commandBuffer, for (unsigned i = 0; i < pass->attachment_count; i++) { cmd->state.attachments[i] = pAttachmentInfo ? tu_image_view_from_handle(pAttachmentInfo->pAttachments[i]) : - cmd->state.framebuffer->attachments[i].attachment; + cmd->state.framebuffer->attachments[i]; } if (pass->attachment_count) { for (unsigned i = 0; i < pRenderPassBegin->clearValueCount; i++) diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index 05ffad6424d..ab63d2207a2 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -3608,7 +3608,7 @@ tu_CreateFramebuffer(VkDevice _device, size_t size = sizeof(*framebuffer); if (!imageless) - size += sizeof(struct tu_attachment_info) * pCreateInfo->attachmentCount; + size += sizeof(struct tu_image_view *) * pCreateInfo->attachmentCount; framebuffer = (struct tu_framebuffer *) vk_object_alloc( &device->vk, pAllocator, size, VK_OBJECT_TYPE_FRAMEBUFFER); if (framebuffer == NULL) @@ -3623,7 +3623,7 @@ tu_CreateFramebuffer(VkDevice _device, for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) { VkImageView _iview = pCreateInfo->pAttachments[i]; struct tu_image_view *iview = tu_image_view_from_handle(_iview); - framebuffer->attachments[i].attachment = iview; + framebuffer->attachments[i] = iview; } } diff --git a/src/freedreno/vulkan/tu_device.h b/src/freedreno/vulkan/tu_device.h index 90343816ccf..1553f3fc288 100644 --- a/src/freedreno/vulkan/tu_device.h +++ b/src/freedreno/vulkan/tu_device.h @@ -501,11 +501,6 @@ VkResult tu_allocate_lazy_memory(struct tu_device *dev, struct tu_device_memory *mem); -struct tu_attachment_info -{ - struct tu_image_view *attachment; -}; - struct tu_vsc_config { /* number of tiles */ VkExtent2D tile_count; @@ -546,7 +541,7 @@ struct tu_framebuffer struct tu_tiling_config tiling[TU_GMEM_LAYOUT_COUNT]; uint32_t attachment_count; - struct tu_attachment_info attachments[0]; + const struct tu_image_view *attachments[0]; }; VK_DEFINE_NONDISP_HANDLE_CASTS(tu_framebuffer, base, VkFramebuffer, VK_OBJECT_TYPE_FRAMEBUFFER)