From: Connor Abbott Date: Thu, 2 Jul 2020 08:46:27 +0000 (+0200) Subject: tu: Translate VkRenderPassMultiviewCreateInfo to VkRenderPassCreateInfo2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f01a0dc27ad2bb26e627e45b2a87986beb40e8b9;p=mesa.git tu: Translate VkRenderPassMultiviewCreateInfo to VkRenderPassCreateInfo2 Part-of: --- diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c index fdc3048fdd2..bef3c3b1e39 100644 --- a/src/freedreno/vulkan/tu_pass.c +++ b/src/freedreno/vulkan/tu_pass.c @@ -518,6 +518,14 @@ tu_CreateRenderPass(VkDevice device, VkAttachmentReference2 reference[reference_count]; VkAttachmentReference2 *reference_ptr = reference; + VkRenderPassMultiviewCreateInfo *multiview_info = NULL; + vk_foreach_struct(ext, pCreateInfo->pNext) { + if (ext->sType == VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO) { + multiview_info = (VkRenderPassMultiviewCreateInfo*) ext; + break; + } + } + for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) { attachments[i] = (VkAttachmentDescription2) { .sType = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, @@ -545,6 +553,9 @@ tu_CreateRenderPass(VkDevice device, .colorAttachmentCount = pCreateInfo->pSubpasses[i].colorAttachmentCount, }; + if (multiview_info && multiview_info->subpassCount) + subpasses[i].viewMask = multiview_info->pViewMasks[i]; + subpasses[i].pInputAttachments = reference_ptr; translate_references(&reference_ptr, pCreateInfo->pSubpasses[i].pInputAttachments, @@ -584,6 +595,9 @@ tu_CreateRenderPass(VkDevice device, .dependencyFlags = pCreateInfo->pDependencies[i].dependencyFlags, .viewOffset = 0, }; + + if (multiview_info && multiview_info->dependencyCount) + dependencies[i].viewOffset = multiview_info->pViewOffsets[i]; } VkRenderPassCreateInfo2 create_info = { @@ -598,6 +612,11 @@ tu_CreateRenderPass(VkDevice device, .pDependencies = dependencies, }; + if (multiview_info) { + create_info.correlatedViewMaskCount = multiview_info->correlationMaskCount; + create_info.pCorrelatedViewMasks = multiview_info->pCorrelationMasks; + } + return tu_CreateRenderPass2(device, &create_info, pAllocator, pRenderPass); }