summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-30 20:43:47 -0300
committerGravatar ameerj2021-07-22 21:51:34 -0400
commit77372443c3d6b20d7f78366bb4aa162f22bd7cde (patch)
tree8e4bbd2cabc498d9547c99916a901c34f606ee8c /src/video_core/renderer_vulkan
parentvk_buffer_cache: Add transform feedback usage to buffers (diff)
downloadyuzu-77372443c3d6b20d7f78366bb4aa162f22bd7cde.tar.gz
yuzu-77372443c3d6b20d7f78366bb4aa162f22bd7cde.tar.xz
yuzu-77372443c3d6b20d7f78366bb4aa162f22bd7cde.zip
vulkan: Enable depth bounds and use it conditionally
Intel devices pre-Xe don't support this.
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp5
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index dfe6e6a80..d381109d6 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -598,13 +598,16 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
598 .depthCompareOp = dynamic.depth_test_enable 598 .depthCompareOp = dynamic.depth_test_enable
599 ? MaxwellToVK::ComparisonOp(dynamic.DepthTestFunc()) 599 ? MaxwellToVK::ComparisonOp(dynamic.DepthTestFunc())
600 : VK_COMPARE_OP_ALWAYS, 600 : VK_COMPARE_OP_ALWAYS,
601 .depthBoundsTestEnable = dynamic.depth_bounds_enable, 601 .depthBoundsTestEnable = dynamic.depth_bounds_enable && device.IsDepthBoundsSupported(),
602 .stencilTestEnable = dynamic.stencil_enable, 602 .stencilTestEnable = dynamic.stencil_enable,
603 .front = GetStencilFaceState(dynamic.front), 603 .front = GetStencilFaceState(dynamic.front),
604 .back = GetStencilFaceState(dynamic.back), 604 .back = GetStencilFaceState(dynamic.back),
605 .minDepthBounds = 0.0f, 605 .minDepthBounds = 0.0f,
606 .maxDepthBounds = 0.0f, 606 .maxDepthBounds = 0.0f,
607 }; 607 };
608 if (dynamic.depth_bounds_enable && !device.IsDepthBoundsSupported()) {
609 LOG_WARNING(Render_Vulkan, "Depth bounds is enabled but not supported");
610 }
608 static_vector<VkPipelineColorBlendAttachmentState, Maxwell::NumRenderTargets> cb_attachments; 611 static_vector<VkPipelineColorBlendAttachmentState, Maxwell::NumRenderTargets> cb_attachments;
609 const size_t num_attachments{NumAttachments(key.state)}; 612 const size_t num_attachments{NumAttachments(key.state)};
610 for (size_t index = 0; index < num_attachments; ++index) { 613 for (size_t index = 0; index < num_attachments; ++index) {
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index ef14e91e7..9611b480a 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -682,6 +682,11 @@ void RasterizerVulkan::UpdateDepthBoundsTestEnable(Tegra::Engines::Maxwell3D::Re
682 if (!state_tracker.TouchDepthBoundsTestEnable()) { 682 if (!state_tracker.TouchDepthBoundsTestEnable()) {
683 return; 683 return;
684 } 684 }
685 bool enabled = regs.depth_bounds_enable;
686 if (enabled && !device.IsDepthBoundsSupported()) {
687 LOG_WARNING(Render_Vulkan, "Depth bounds is enabled but not supported");
688 enabled = false;
689 }
685 scheduler.Record([enable = regs.depth_bounds_enable](vk::CommandBuffer cmdbuf) { 690 scheduler.Record([enable = regs.depth_bounds_enable](vk::CommandBuffer cmdbuf) {
686 cmdbuf.SetDepthBoundsTestEnableEXT(enable); 691 cmdbuf.SetDepthBoundsTestEnableEXT(enable);
687 }); 692 });