diff options
| author | 2021-12-18 07:03:13 +0100 | |
|---|---|---|
| committer | 2021-12-18 07:17:08 +0100 | |
| commit | 6c00151d17050861e76677c219296fb35bf76214 (patch) | |
| tree | a2601650dd6da243df5a4316f3a3b60e585198d3 /src | |
| parent | Vulkan: implement Logical Operations. (diff) | |
| download | yuzu-6c00151d17050861e76677c219296fb35bf76214.tar.gz yuzu-6c00151d17050861e76677c219296fb35bf76214.tar.xz yuzu-6c00151d17050861e76677c219296fb35bf76214.zip | |
Vulkan: Fix the checks for primitive restart extension.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 25 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 17 |
3 files changed, 28 insertions, 21 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 7fe735e75..d514b71d0 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -605,8 +605,11 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { | |||
| 605 | .flags = 0, | 605 | .flags = 0, |
| 606 | .topology = input_assembly_topology, | 606 | .topology = input_assembly_topology, |
| 607 | .primitiveRestartEnable = key.state.primitive_restart_enable != 0 && | 607 | .primitiveRestartEnable = key.state.primitive_restart_enable != 0 && |
| 608 | (device.IsExtPrimitiveTopologyListRestartSupported() || | 608 | ((input_assembly_topology != VK_PRIMITIVE_TOPOLOGY_PATCH_LIST && |
| 609 | SupportsPrimitiveRestart(input_assembly_topology)), | 609 | device.IsTopologyListPrimitiveRestartSupported()) || |
| 610 | SupportsPrimitiveRestart(input_assembly_topology) || | ||
| 611 | (input_assembly_topology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST && | ||
| 612 | device.IsPatchListPrimitiveRestartSupported())), | ||
| 610 | }; | 613 | }; |
| 611 | const VkPipelineTessellationStateCreateInfo tessellation_ci{ | 614 | const VkPipelineTessellationStateCreateInfo tessellation_ci{ |
| 612 | .sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, | 615 | .sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 2413e72ba..9862b815b 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -1129,6 +1129,19 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1129 | khr_pipeline_executable_properties = true; | 1129 | khr_pipeline_executable_properties = true; |
| 1130 | } | 1130 | } |
| 1131 | } | 1131 | } |
| 1132 | if (has_ext_primitive_topology_list_restart) { | ||
| 1133 | VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT primitive_topology_list_restart{}; | ||
| 1134 | primitive_topology_list_restart.sType = | ||
| 1135 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; | ||
| 1136 | primitive_topology_list_restart.pNext = nullptr; | ||
| 1137 | features.pNext = &primitive_topology_list_restart; | ||
| 1138 | physical.GetFeatures2KHR(features); | ||
| 1139 | |||
| 1140 | is_topology_list_restart_supported = | ||
| 1141 | primitive_topology_list_restart.primitiveTopologyListRestart; | ||
| 1142 | is_patch_list_restart_supported = | ||
| 1143 | primitive_topology_list_restart.primitiveTopologyPatchListRestart; | ||
| 1144 | } | ||
| 1132 | if (has_khr_image_format_list && has_khr_swapchain_mutable_format) { | 1145 | if (has_khr_image_format_list && has_khr_swapchain_mutable_format) { |
| 1133 | extensions.push_back(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME); | 1146 | extensions.push_back(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME); |
| 1134 | extensions.push_back(VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME); | 1147 | extensions.push_back(VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME); |
| @@ -1144,18 +1157,6 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1144 | 1157 | ||
| 1145 | max_push_descriptors = push_descriptor.maxPushDescriptors; | 1158 | max_push_descriptors = push_descriptor.maxPushDescriptors; |
| 1146 | } | 1159 | } |
| 1147 | if (has_ext_primitive_topology_list_restart) { | ||
| 1148 | VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT primitive_topology_list_restart{}; | ||
| 1149 | primitive_topology_list_restart.sType = | ||
| 1150 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT; | ||
| 1151 | primitive_topology_list_restart.pNext = nullptr; | ||
| 1152 | physical_properties.pNext = &primitive_topology_list_restart; | ||
| 1153 | physical.GetProperties2KHR(physical_properties); | ||
| 1154 | is_topology_list_restart_supported = | ||
| 1155 | primitive_topology_list_restart.primitiveTopologyListRestart; | ||
| 1156 | is_patch_list_restart_supported = | ||
| 1157 | primitive_topology_list_restart.primitiveTopologyPatchListRestart; | ||
| 1158 | } | ||
| 1159 | return extensions; | 1160 | return extensions; |
| 1160 | } | 1161 | } |
| 1161 | 1162 | ||
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index ed7782d42..4c9d86aad 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -238,14 +238,19 @@ public: | |||
| 238 | return khr_workgroup_memory_explicit_layout; | 238 | return khr_workgroup_memory_explicit_layout; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | /// Returns true if the device supports VK_EXT_index_type_uint8. | 241 | /// Returns true if the device supports VK_EXT_primitive_topology_list_restart. |
| 242 | bool IsExtIndexTypeUint8Supported() const { | 242 | bool IsTopologyListPrimitiveRestartSupported() const { |
| 243 | return ext_index_type_uint8; | 243 | return is_topology_list_restart_supported; |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | /// Returns true if the device supports VK_EXT_primitive_topology_list_restart. | 246 | /// Returns true if the device supports VK_EXT_primitive_topology_list_restart. |
| 247 | bool IsExtPrimitiveTopologyListRestartSupported() const { | 247 | bool IsPatchListPrimitiveRestartSupported() const { |
| 248 | return ext_primitive_topology_list_restart; | 248 | return is_patch_list_restart_supported; |
| 249 | } | ||
| 250 | |||
| 251 | /// Returns true if the device supports VK_EXT_index_type_uint8. | ||
| 252 | bool IsExtIndexTypeUint8Supported() const { | ||
| 253 | return ext_index_type_uint8; | ||
| 249 | } | 254 | } |
| 250 | 255 | ||
| 251 | /// Returns true if the device supports VK_EXT_sampler_filter_minmax. | 256 | /// Returns true if the device supports VK_EXT_sampler_filter_minmax. |
| @@ -419,8 +424,6 @@ private: | |||
| 419 | bool khr_pipeline_executable_properties{}; ///< Support for executable properties. | 424 | bool khr_pipeline_executable_properties{}; ///< Support for executable properties. |
| 420 | bool khr_swapchain_mutable_format{}; ///< Support for VK_KHR_swapchain_mutable_format. | 425 | bool khr_swapchain_mutable_format{}; ///< Support for VK_KHR_swapchain_mutable_format. |
| 421 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. | 426 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. |
| 422 | bool ext_primitive_topology_list_restart{}; ///< Support for | ||
| 423 | ///< VK_EXT_primitive_topology_list_restart. | ||
| 424 | bool ext_sampler_filter_minmax{}; ///< Support for VK_EXT_sampler_filter_minmax. | 427 | bool ext_sampler_filter_minmax{}; ///< Support for VK_EXT_sampler_filter_minmax. |
| 425 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. | 428 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. |
| 426 | bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. | 429 | bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. |