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,
.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,
.dependencyFlags = pCreateInfo->pDependencies[i].dependencyFlags,
.viewOffset = 0,
};
+
+ if (multiview_info && multiview_info->dependencyCount)
+ dependencies[i].viewOffset = multiview_info->pViewOffsets[i];
}
VkRenderPassCreateInfo2 create_info = {
.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);
}