Mesa (main): v3dv: store multiview info in our render pass data

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 07:45:58 UTC 2021


Module: Mesa
Branch: main
Commit: f5e67e1ce79b8e04847f1ea35b66790aa7fe5db3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5e67e1ce79b8e04847f1ea35b66790aa7fe5db3

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue Jul 20 10:57:12 2021 +0200

v3dv: store multiview info in our render pass data

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12034>

---

 src/broadcom/vulkan/v3dv_pass.c    | 7 +++++++
 src/broadcom/vulkan/v3dv_private.h | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/src/broadcom/vulkan/v3dv_pass.c b/src/broadcom/vulkan/v3dv_pass.c
index c2fd8d7902c..5df93c46fcf 100644
--- a/src/broadcom/vulkan/v3dv_pass.c
+++ b/src/broadcom/vulkan/v3dv_pass.c
@@ -112,6 +112,10 @@ v3dv_CreateRenderPass(VkDevice _device,
 
    assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO);
 
+   const VkRenderPassMultiviewCreateInfo *multiview_info =
+      vk_find_struct_const(pCreateInfo->pNext, RENDER_PASS_MULTIVIEW_CREATE_INFO);
+   bool multiview_enabled = multiview_info && multiview_info->subpassCount > 0;
+
    size_t size = sizeof(*pass);
    size_t subpasses_offset = size;
    size += pCreateInfo->subpassCount * sizeof(pass->subpasses[0]);
@@ -123,6 +127,7 @@ v3dv_CreateRenderPass(VkDevice _device,
    if (pass == NULL)
       return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
 
+   pass->multiview_enabled = multiview_enabled;
    pass->attachment_count = pCreateInfo->attachmentCount;
    pass->attachments = (void *) pass + attachments_offset;
    pass->subpass_count = pCreateInfo->subpassCount;
@@ -158,6 +163,8 @@ v3dv_CreateRenderPass(VkDevice _device,
 
       subpass->input_count = desc->inputAttachmentCount;
       subpass->color_count = desc->colorAttachmentCount;
+      if (multiview_enabled)
+         subpass->view_mask = multiview_info->pViewMasks[i];
 
       if (desc->inputAttachmentCount > 0) {
          subpass->input_attachments = p;
diff --git a/src/broadcom/vulkan/v3dv_private.h b/src/broadcom/vulkan/v3dv_private.h
index f37602bf7cb..c6fa66b134b 100644
--- a/src/broadcom/vulkan/v3dv_private.h
+++ b/src/broadcom/vulkan/v3dv_private.h
@@ -650,6 +650,9 @@ struct v3dv_subpass {
     */
    bool do_depth_clear_with_draw;
    bool do_stencil_clear_with_draw;
+
+   /* Multiview */
+   uint32_t view_mask;
 };
 
 struct v3dv_render_pass_attachment {
@@ -666,6 +669,8 @@ struct v3dv_render_pass_attachment {
 struct v3dv_render_pass {
    struct vk_object_base base;
 
+   bool multiview_enabled;
+
    uint32_t attachment_count;
    struct v3dv_render_pass_attachment *attachments;
 



More information about the mesa-commit mailing list