Mesa (main): turnip: Refactor a bit of subpass attachment processing.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 7 00:23:17 UTC 2022
Module: Mesa
Branch: main
Commit: b8619ef343fbeba5ec9cad558d3b0f15f93ef34b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8619ef343fbeba5ec9cad558d3b0f15f93ef34b
Author: Emma Anholt <emma at anholt.net>
Date: Thu May 19 21:23:29 2022 -0700
turnip: Refactor a bit of subpass attachment processing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>
---
src/freedreno/vulkan/tu_pass.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c
index f92abbbe481..0580f320979 100644
--- a/src/freedreno/vulkan/tu_pass.c
+++ b/src/freedreno/vulkan/tu_pass.c
@@ -671,6 +671,16 @@ is_depth_stencil_resolve_enabled(const VkSubpassDescriptionDepthStencilResolve *
return false;
}
+static void
+tu_subpass_use_attachment(struct tu_render_pass *pass, int i, uint32_t a, const VkRenderPassCreateInfo2KHR *pCreateInfo)
+{
+ struct tu_subpass *subpass = &pass->subpasses[i];
+
+ pass->attachments[a].gmem_offset = 0;
+ update_samples(subpass, pCreateInfo->pAttachments[a].samples);
+ pass->attachments[a].clear_views |= subpass->multiview_mask;
+}
+
VKAPI_ATTR VkResult VKAPI_CALL
tu_CreateRenderPass2(VkDevice _device,
const VkRenderPassCreateInfo2KHR *pCreateInfo,
@@ -799,13 +809,10 @@ tu_CreateRenderPass2(VkDevice _device,
subpass->color_attachments[j].attachment = a;
if (a != VK_ATTACHMENT_UNUSED) {
- pass->attachments[a].gmem_offset = 0;
- update_samples(subpass, pCreateInfo->pAttachments[a].samples);
+ tu_subpass_use_attachment(pass, i, a, pCreateInfo);
if (vk_format_is_srgb(pass->attachments[a].format))
subpass->srgb_cntl |= 1 << j;
-
- pass->attachments[a].clear_views |= subpass->multiview_mask;
}
}
}
@@ -841,12 +848,8 @@ tu_CreateRenderPass2(VkDevice _device,
uint32_t a = desc->pDepthStencilAttachment ?
desc->pDepthStencilAttachment->attachment : VK_ATTACHMENT_UNUSED;
subpass->depth_stencil_attachment.attachment = a;
- if (a != VK_ATTACHMENT_UNUSED) {
- pass->attachments[a].gmem_offset = 0;
- update_samples(subpass, pCreateInfo->pAttachments[a].samples);
-
- pass->attachments[a].clear_views |= subpass->multiview_mask;
- }
+ if (a != VK_ATTACHMENT_UNUSED)
+ tu_subpass_use_attachment(pass, i, a, pCreateInfo);
}
tu_render_pass_patch_input_gmem(pass);
More information about the mesa-commit
mailing list