diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-12-17 22:08:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 22:08:10 +0100 |
commit | 5da72a891fb4c4ddddbeefc0b235079fa3830743 (patch) | |
tree | cd4006e1a4e50c298ebb3004341191203ac11c56 /src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |
parent | Merge pull request #9461 from liamwhite/wanative (diff) | |
parent | Vulkan: Add support for VK_EXT_depth_clip_control. (diff) | |
download | yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.tar yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.tar.gz yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.tar.bz2 yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.tar.lz yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.tar.xz yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.tar.zst yuzu-5da72a891fb4c4ddddbeefc0b235079fa3830743.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 4b10fe7bc..515d8d869 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -640,23 +640,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, |