Merge pull request #63296 from RandomShaper/fix_vk_singleview
This commit is contained in:
commit
a446d761fb
2 changed files with 18 additions and 7 deletions
|
@ -3815,7 +3815,12 @@ VkRenderPass RenderingDeviceVulkan::_render_pass_create(const Vector<AttachmentF
|
||||||
subpass.pNext = subpass_nextptr;
|
subpass.pNext = subpass_nextptr;
|
||||||
subpass.flags = 0;
|
subpass.flags = 0;
|
||||||
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||||
subpass.viewMask = view_mask;
|
if (p_view_count == 1) {
|
||||||
|
// VUID-VkSubpassDescription2-multiview-06558: If the multiview feature is not enabled, viewMask must be 0.
|
||||||
|
subpass.viewMask = 0;
|
||||||
|
} else {
|
||||||
|
subpass.viewMask = view_mask;
|
||||||
|
}
|
||||||
subpass.inputAttachmentCount = input_references.size();
|
subpass.inputAttachmentCount = input_references.size();
|
||||||
if (input_references.size()) {
|
if (input_references.size()) {
|
||||||
subpass.pInputAttachments = input_references.ptr();
|
subpass.pInputAttachments = input_references.ptr();
|
||||||
|
@ -3903,8 +3908,14 @@ VkRenderPass RenderingDeviceVulkan::_render_pass_create(const Vector<AttachmentF
|
||||||
render_pass_create_info.pDependencies = nullptr;
|
render_pass_create_info.pDependencies = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
render_pass_create_info.correlatedViewMaskCount = 1;
|
if (p_view_count == 1) {
|
||||||
render_pass_create_info.pCorrelatedViewMasks = &correlation_mask;
|
// VUID-VkRenderPassCreateInfo2-viewMask-03057: If the VkSubpassDescription2::viewMask member of all elements of pSubpasses is 0, correlatedViewMaskCount must be 0.
|
||||||
|
render_pass_create_info.correlatedViewMaskCount = 0;
|
||||||
|
render_pass_create_info.pCorrelatedViewMasks = nullptr;
|
||||||
|
} else {
|
||||||
|
render_pass_create_info.correlatedViewMaskCount = 1;
|
||||||
|
render_pass_create_info.pCorrelatedViewMasks = &correlation_mask;
|
||||||
|
}
|
||||||
|
|
||||||
Vector<uint32_t> view_masks;
|
Vector<uint32_t> view_masks;
|
||||||
VkRenderPassMultiviewCreateInfo render_pass_multiview_create_info;
|
VkRenderPassMultiviewCreateInfo render_pass_multiview_create_info;
|
||||||
|
@ -4005,6 +4016,7 @@ RenderingDevice::FramebufferFormatID RenderingDeviceVulkan::framebuffer_format_c
|
||||||
subpass.pNext = nullptr;
|
subpass.pNext = nullptr;
|
||||||
subpass.flags = 0;
|
subpass.flags = 0;
|
||||||
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||||
|
subpass.viewMask = 0;
|
||||||
subpass.inputAttachmentCount = 0; //unsupported for now
|
subpass.inputAttachmentCount = 0; //unsupported for now
|
||||||
subpass.pInputAttachments = nullptr;
|
subpass.pInputAttachments = nullptr;
|
||||||
subpass.colorAttachmentCount = 0;
|
subpass.colorAttachmentCount = 0;
|
||||||
|
|
|
@ -1827,7 +1827,7 @@ Error VulkanContext::_update_swap_chain(Window *window) {
|
||||||
/*pNext*/ nullptr,
|
/*pNext*/ nullptr,
|
||||||
/*flags*/ 0,
|
/*flags*/ 0,
|
||||||
/*pipelineBindPoint*/ VK_PIPELINE_BIND_POINT_GRAPHICS,
|
/*pipelineBindPoint*/ VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
/*viewMask*/ 1,
|
/*viewMask*/ 0,
|
||||||
/*inputAttachmentCount*/ 0,
|
/*inputAttachmentCount*/ 0,
|
||||||
/*pInputAttachments*/ nullptr,
|
/*pInputAttachments*/ nullptr,
|
||||||
/*colorAttachmentCount*/ 1,
|
/*colorAttachmentCount*/ 1,
|
||||||
|
@ -1838,7 +1838,6 @@ Error VulkanContext::_update_swap_chain(Window *window) {
|
||||||
/*pPreserveAttachments*/ nullptr,
|
/*pPreserveAttachments*/ nullptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t view_masks = 1;
|
|
||||||
const VkRenderPassCreateInfo2KHR rp_info = {
|
const VkRenderPassCreateInfo2KHR rp_info = {
|
||||||
/*sType*/ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR,
|
/*sType*/ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR,
|
||||||
/*pNext*/ nullptr,
|
/*pNext*/ nullptr,
|
||||||
|
@ -1849,8 +1848,8 @@ Error VulkanContext::_update_swap_chain(Window *window) {
|
||||||
/*pSubpasses*/ &subpass,
|
/*pSubpasses*/ &subpass,
|
||||||
/*dependencyCount*/ 0,
|
/*dependencyCount*/ 0,
|
||||||
/*pDependencies*/ nullptr,
|
/*pDependencies*/ nullptr,
|
||||||
/*correlatedViewMaskCount*/ 1,
|
/*correlatedViewMaskCount*/ 0,
|
||||||
/*pCorrelatedViewMasks*/ &view_masks,
|
/*pCorrelatedViewMasks*/ nullptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
err = vkCreateRenderPass2KHR(device, &rp_info, nullptr, &window->render_pass);
|
err = vkCreateRenderPass2KHR(device, &rp_info, nullptr, &window->render_pass);
|
||||||
|
|
Loading…
Reference in a new issue