summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-17 22:08:10 +0100
committerGitHub <noreply@github.com>2022-12-17 22:08:10 +0100
commit5da72a891fb4c4ddddbeefc0b235079fa3830743 (patch)
treecd4006e1a4e50c298ebb3004341191203ac11c56 /src/video_core/renderer_vulkan
parentMerge pull request #9461 from liamwhite/wanative (diff)
parentVulkan: Add support for VK_EXT_depth_clip_control. (diff)
downloadyuzu-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')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp18
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp1
2 files changed, 15 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,
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 86fdde014..e7262420c 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -321,6 +321,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device
.support_int64_atomics = device.IsExtShaderAtomicInt64Supported(),
.support_derivative_control = true,
.support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(),
+ .support_native_ndc = device.IsExtDepthClipControlSupported(),
.warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(),