Mesa (master): lavapipe: add render pass support for multiview
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Mar 12 05:34:53 UTC 2021
Module: Mesa
Branch: master
Commit: cbd01045bc33f6213a95762b698b99256430be9b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbd01045bc33f6213a95762b698b99256430be9b
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Mar 4 14:01:36 2021 +1000
lavapipe: add render pass support for multiview
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9399>
---
src/gallium/frontends/lavapipe/lvp_pass.c | 16 ++++++++++++++++
src/gallium/frontends/lavapipe/lvp_private.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/src/gallium/frontends/lavapipe/lvp_pass.c b/src/gallium/frontends/lavapipe/lvp_pass.c
index e887e6721db..0e366f79866 100644
--- a/src/gallium/frontends/lavapipe/lvp_pass.c
+++ b/src/gallium/frontends/lavapipe/lvp_pass.c
@@ -23,6 +23,8 @@
#include "lvp_private.h"
+#include "vk_util.h"
+
static void
lvp_render_pass_compile(struct lvp_render_pass *pass)
{
@@ -152,6 +154,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass(
struct lvp_render_pass *pass;
size_t size;
size_t attachments_offset;
+ VkRenderPassMultiviewCreateInfo *multiview_info = NULL;
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO);
@@ -176,6 +179,16 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass(
pass->subpass_count = pCreateInfo->subpassCount;
pass->attachments = (struct lvp_render_pass_attachment *)((char *)pass + attachments_offset);
+ vk_foreach_struct(ext, pCreateInfo->pNext) {
+ switch(ext->sType) {
+ case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO:
+ multiview_info = (VkRenderPassMultiviewCreateInfo*)ext;
+ break;
+ default:
+ break;
+ }
+ }
+
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
struct lvp_render_pass_attachment *att = &pass->attachments[i];
@@ -214,6 +227,9 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass(
subpass->attachment_count = lvp_num_subpass_attachments(desc);
subpass->attachments = p;
+ if (multiview_info)
+ subpass->view_mask = multiview_info->pViewMasks[i];
+
if (desc->inputAttachmentCount > 0) {
subpass->input_attachments = p;
p += desc->inputAttachmentCount;
diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h
index cb9e9d31579..4e54f9c7295 100644
--- a/src/gallium/frontends/lavapipe/lvp_private.h
+++ b/src/gallium/frontends/lavapipe/lvp_private.h
@@ -353,6 +353,8 @@ struct lvp_subpass {
bool has_color_att;
VkSampleCountFlagBits max_sample_count;
+
+ uint32_t view_mask;
};
struct lvp_render_pass_attachment {
More information about the mesa-commit
mailing list