diff options
| author | 2021-11-25 11:42:20 +0100 | |
|---|---|---|
| committer | 2022-12-13 21:39:18 -0500 | |
| commit | 0104e28fe4215468b8c444500e24b62d1ec0cc56 (patch) | |
| tree | 382ce9bb47ed5d70feee2482dc0796f31ce3c0c6 /src/video_core/vulkan_common | |
| parent | Merge pull request #9425 from german77/german_unlimited (diff) | |
| download | yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.gz yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.tar.xz yuzu-0104e28fe4215468b8c444500e24b62d1ec0cc56.zip | |
Vulkan: Add support for VK_EXT_depth_clip_control.
Diffstat (limited to 'src/video_core/vulkan_common')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 25 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 6 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 6a2ad4b1d..3604c83c1 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -660,6 +660,16 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 660 | LOG_INFO(Render_Vulkan, "Device doesn't support depth range unrestricted"); | 660 | LOG_INFO(Render_Vulkan, "Device doesn't support depth range unrestricted"); |
| 661 | } | 661 | } |
| 662 | 662 | ||
| 663 | VkPhysicalDeviceDepthClipControlFeaturesEXT depth_clip_control_features; | ||
| 664 | if (ext_depth_clip_control) { | ||
| 665 | depth_clip_control_features = { | ||
| 666 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT, | ||
| 667 | .pNext = nullptr, | ||
| 668 | .depthClipControl = VK_TRUE, | ||
| 669 | }; | ||
| 670 | SetNext(next, depth_clip_control_features); | ||
| 671 | } | ||
| 672 | |||
| 663 | VkDeviceDiagnosticsConfigCreateInfoNV diagnostics_nv; | 673 | VkDeviceDiagnosticsConfigCreateInfoNV diagnostics_nv; |
| 664 | if (Settings::values.enable_nsight_aftermath && nv_device_diagnostics_config) { | 674 | if (Settings::values.enable_nsight_aftermath && nv_device_diagnostics_config) { |
| 665 | nsight_aftermath_tracker = std::make_unique<NsightAftermathTracker>(); | 675 | nsight_aftermath_tracker = std::make_unique<NsightAftermathTracker>(); |
| @@ -1083,6 +1093,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1083 | bool has_ext_vertex_input_dynamic_state{}; | 1093 | bool has_ext_vertex_input_dynamic_state{}; |
| 1084 | bool has_ext_line_rasterization{}; | 1094 | bool has_ext_line_rasterization{}; |
| 1085 | bool has_ext_primitive_topology_list_restart{}; | 1095 | bool has_ext_primitive_topology_list_restart{}; |
| 1096 | bool has_ext_depth_clip_control{}; | ||
| 1086 | for (const std::string& extension : supported_extensions) { | 1097 | for (const std::string& extension : supported_extensions) { |
| 1087 | const auto test = [&](std::optional<std::reference_wrapper<bool>> status, const char* name, | 1098 | const auto test = [&](std::optional<std::reference_wrapper<bool>> status, const char* name, |
| 1088 | bool push) { | 1099 | bool push) { |
| @@ -1116,6 +1127,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1116 | test(ext_shader_stencil_export, VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, true); | 1127 | test(ext_shader_stencil_export, VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, true); |
| 1117 | test(ext_conservative_rasterization, VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, | 1128 | test(ext_conservative_rasterization, VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, |
| 1118 | true); | 1129 | true); |
| 1130 | test(has_ext_depth_clip_control, VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME, false); | ||
| 1119 | test(has_ext_transform_feedback, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, false); | 1131 | test(has_ext_transform_feedback, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, false); |
| 1120 | test(has_ext_custom_border_color, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, false); | 1132 | test(has_ext_custom_border_color, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, false); |
| 1121 | test(has_ext_extended_dynamic_state, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, false); | 1133 | test(has_ext_extended_dynamic_state, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, false); |
| @@ -1279,6 +1291,19 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1279 | ext_line_rasterization = true; | 1291 | ext_line_rasterization = true; |
| 1280 | } | 1292 | } |
| 1281 | } | 1293 | } |
| 1294 | if (has_ext_depth_clip_control) { | ||
| 1295 | VkPhysicalDeviceDepthClipControlFeaturesEXT depth_clip_control_features; | ||
| 1296 | depth_clip_control_features.sType = | ||
| 1297 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT; | ||
| 1298 | depth_clip_control_features.pNext = nullptr; | ||
| 1299 | features.pNext = &depth_clip_control_features; | ||
| 1300 | physical.GetFeatures2(features); | ||
| 1301 | |||
| 1302 | if (depth_clip_control_features.depthClipControl) { | ||
| 1303 | extensions.push_back(VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME); | ||
| 1304 | ext_depth_clip_control = true; | ||
| 1305 | } | ||
| 1306 | } | ||
| 1282 | if (has_khr_workgroup_memory_explicit_layout) { | 1307 | if (has_khr_workgroup_memory_explicit_layout) { |
| 1283 | VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR layout; | 1308 | VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR layout; |
| 1284 | layout.sType = | 1309 | layout.sType = |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index db802437c..3755275c3 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -256,6 +256,11 @@ public: | |||
| 256 | return ext_depth_range_unrestricted; | 256 | return ext_depth_range_unrestricted; |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | /// Returns true if the device supports VK_EXT_depth_clip_control. | ||
| 260 | bool IsExtDepthClipControlSupported() const { | ||
| 261 | return ext_depth_clip_control; | ||
| 262 | } | ||
| 263 | |||
| 259 | /// Returns true if the device supports VK_EXT_shader_viewport_index_layer. | 264 | /// Returns true if the device supports VK_EXT_shader_viewport_index_layer. |
| 260 | bool IsExtShaderViewportIndexLayerSupported() const { | 265 | bool IsExtShaderViewportIndexLayerSupported() const { |
| 261 | return ext_shader_viewport_index_layer; | 266 | return ext_shader_viewport_index_layer; |
| @@ -446,6 +451,7 @@ private: | |||
| 446 | bool khr_swapchain_mutable_format{}; ///< Support for VK_KHR_swapchain_mutable_format. | 451 | bool khr_swapchain_mutable_format{}; ///< Support for VK_KHR_swapchain_mutable_format. |
| 447 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. | 452 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. |
| 448 | bool ext_sampler_filter_minmax{}; ///< Support for VK_EXT_sampler_filter_minmax. | 453 | bool ext_sampler_filter_minmax{}; ///< Support for VK_EXT_sampler_filter_minmax. |
| 454 | bool ext_depth_clip_control{}; ///< Support for VK_EXT_depth_clip_control | ||
| 449 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. | 455 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. |
| 450 | bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. | 456 | bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. |
| 451 | bool ext_tooling_info{}; ///< Support for VK_EXT_tooling_info. | 457 | bool ext_tooling_info{}; ///< Support for VK_EXT_tooling_info. |