mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-06 10:20:37 +01:00
v3dv: store multiview info in our render pass data
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12034>
This commit is contained in:
parent
dc86e032cb
commit
f5e67e1ce7
2 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue