diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-11-25 11:42:20 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-12-14 03:39:18 +0100 |
commit | 0104e28fe4215468b8c444500e24b62d1ec0cc56 (patch) | |
tree | 382ce9bb47ed5d70feee2482dc0796f31ce3c0c6 /src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |
parent | Merge pull request #9425 from german77/german_unlimited (diff) | |
download | yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.gz yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.bz2 yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.lz yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.xz yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.zst yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 006128638..00d7dbeea 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -634,23 +634,33 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { }; std::array<VkViewportSwizzleNV, Maxwell::NumViewports> swizzles; std::ranges::transform(key.state.viewport_swizzles, swizzles.begin(), UnpackViewportSwizzle); - const VkPipelineViewportSwizzleStateCreateInfoNV swizzle_ci{ + VkPipelineViewportSwizzleStateCreateInfoNV swizzle_ci{ .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, .pNext = nullptr, .flags = 0, .viewportCount = Maxwell::NumViewports, .pViewportSwizzles = swizzles.data(), }; - const VkPipelineViewportStateCreateInfo viewport_ci{ + VkPipelineViewportDepthClipControlCreateInfoEXT ndc_info{ + .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT, + .pNext = nullptr, + .negativeOneToOne = key.state.ndc_minus_one_to_one.Value() != 0 ? VK_TRUE : VK_FALSE, + }; + VkPipelineViewportStateCreateInfo viewport_ci{ .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, - .pNext = device.IsNvViewportSwizzleSupported() ? &swizzle_ci : nullptr, + .pNext = nullptr, .flags = 0, .viewportCount = Maxwell::NumViewports, .pViewports = nullptr, .scissorCount = Maxwell::NumViewports, .pScissors = nullptr, }; - + if (device.IsNvViewportSwizzleSupported()) { + swizzle_ci.pNext = std::exchange(viewport_ci.pNext, &swizzle_ci); + } + if (device.IsExtDepthClipControlSupported()) { + ndc_info.pNext = std::exchange(viewport_ci.pNext, &ndc_info); + } VkPipelineRasterizationStateCreateInfo rasterization_ci{ .sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, .pNext = nullptr, |