diff options
4 files changed, 17 insertions, 2 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 | }); |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index aabcb0b10..0a42efb6a 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -226,7 +226,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 226 | .depthClamp = true, | 226 | .depthClamp = true, |
| 227 | .depthBiasClamp = true, | 227 | .depthBiasClamp = true, |
| 228 | .fillModeNonSolid = true, | 228 | .fillModeNonSolid = true, |
| 229 | .depthBounds = false, | 229 | .depthBounds = is_depth_bounds_supported, |
| 230 | .wideLines = false, | 230 | .wideLines = false, |
| 231 | .largePoints = true, | 231 | .largePoints = true, |
| 232 | .alphaToOne = false, | 232 | .alphaToOne = false, |
| @@ -908,6 +908,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) { | |||
| 908 | 908 | ||
| 909 | void Device::SetupFeatures() { | 909 | void Device::SetupFeatures() { |
| 910 | const VkPhysicalDeviceFeatures features{physical.GetFeatures()}; | 910 | const VkPhysicalDeviceFeatures features{physical.GetFeatures()}; |
| 911 | is_depth_bounds_supported = features.depthBounds; | ||
| 911 | is_formatless_image_load_supported = features.shaderStorageImageReadWithoutFormat; | 912 | is_formatless_image_load_supported = features.shaderStorageImageReadWithoutFormat; |
| 912 | is_shader_float64_supported = features.shaderFloat64; | 913 | is_shader_float64_supported = features.shaderFloat64; |
| 913 | is_shader_int64_supported = features.shaderInt64; | 914 | is_shader_int64_supported = features.shaderInt64; |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 693419505..1ab63ecd7 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -159,6 +159,11 @@ public: | |||
| 159 | return is_formatless_image_load_supported; | 159 | return is_formatless_image_load_supported; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | // Returns true if depth bounds is supported. | ||
| 163 | bool IsDepthBoundsSupported() const { | ||
| 164 | return is_depth_bounds_supported; | ||
| 165 | } | ||
| 166 | |||
| 162 | /// Returns true when blitting from and to depth stencil images is supported. | 167 | /// Returns true when blitting from and to depth stencil images is supported. |
| 163 | bool IsBlitDepthStencilSupported() const { | 168 | bool IsBlitDepthStencilSupported() const { |
| 164 | return is_blit_depth_stencil_supported; | 169 | return is_blit_depth_stencil_supported; |
| @@ -314,6 +319,7 @@ private: | |||
| 314 | bool is_float16_supported{}; ///< Support for float16 arithmetics. | 319 | bool is_float16_supported{}; ///< Support for float16 arithmetics. |
| 315 | bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. | 320 | bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. |
| 316 | bool is_formatless_image_load_supported{}; ///< Support for shader image read without format. | 321 | bool is_formatless_image_load_supported{}; ///< Support for shader image read without format. |
| 322 | bool is_depth_bounds_supported{}; ///< Support for depth bounds. | ||
| 317 | bool is_shader_float64_supported{}; ///< Support for float64. | 323 | bool is_shader_float64_supported{}; ///< Support for float64. |
| 318 | bool is_shader_int64_supported{}; ///< Support for int64. | 324 | bool is_shader_int64_supported{}; ///< Support for int64. |
| 319 | bool is_shader_storage_image_multisample{}; ///< Support for image operations on MSAA images. | 325 | bool is_shader_storage_image_multisample{}; ///< Support for image operations on MSAA images. |