Mesa (master): tu: Parse multiview render pass info
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Aug 20 19:36:07 UTC 2020
Module: Mesa
Branch: master
Commit: 99a87e5e0ec84c4680755c4ae8c48cc9104c8eb7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=99a87e5e0ec84c4680755c4ae8c48cc9104c8eb7
Author: Connor Abbott <cwabbott0 at gmail.com>
Date: Thu Jul 2 11:16:50 2020 +0200
tu: Parse multiview render pass info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5720>
---
src/freedreno/vulkan/tu_pass.c | 19 ++++++++++++++++++-
src/freedreno/vulkan/tu_private.h | 2 ++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c
index bef3c3b1e39..fd910452300 100644
--- a/src/freedreno/vulkan/tu_pass.c
+++ b/src/freedreno/vulkan/tu_pass.c
@@ -699,6 +699,8 @@ tu_CreateRenderPass2(VkDevice _device,
subpass->samples = 0;
subpass->srgb_cntl = 0;
+ subpass->multiview_mask = desc->viewMask;
+
if (desc->inputAttachmentCount > 0) {
subpass->input_attachments = p;
p += desc->inputAttachmentCount;
@@ -725,6 +727,8 @@ tu_CreateRenderPass2(VkDevice _device,
if (vk_format_is_srgb(pass->attachments[a].format))
subpass->srgb_cntl |= 1 << j;
+
+ pass->attachments[a].clear_views |= subpass->multiview_mask;
}
}
}
@@ -759,7 +763,20 @@ tu_CreateRenderPass2(VkDevice _device,
}
}
- tu_render_pass_gmem_config(pass, device->physical_device);
+ /* From the VK_KHR_multiview spec:
+ *
+ * Multiview is all-or-nothing for a render pass - that is, either all
+ * subpasses must have a non-zero view mask (though some subpasses may
+ * have only one view) or all must be zero.
+ *
+ * This means we only have to check one of the view masks.
+ */
+ if (pCreateInfo->pSubpasses[0].viewMask) {
+ /* It seems multiview must use sysmem rendering. */
+ pass->gmem_pixels = 0;
+ } else {
+ tu_render_pass_gmem_config(pass, device->physical_device);
+ }
for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {
tu_render_pass_add_subpass_dep(pass, &pCreateInfo->pDependencies[i]);
diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h
index 7470d69b868..3d180fbecf6 100644
--- a/src/freedreno/vulkan/tu_private.h
+++ b/src/freedreno/vulkan/tu_private.h
@@ -1484,6 +1484,7 @@ struct tu_subpass
VkSampleCountFlagBits samples;
uint32_t srgb_cntl;
+ uint32_t multiview_mask;
struct tu_subpass_barrier start_barrier;
};
@@ -1494,6 +1495,7 @@ struct tu_render_pass_attachment
uint32_t samples;
uint32_t cpp;
VkImageAspectFlags clear_mask;
+ uint32_t clear_views;
bool load;
bool store;
int32_t gmem_offset;
More information about the mesa-commit
mailing list