diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 28 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 10 |
3 files changed, 40 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 616a7b457..0c175c557 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -605,7 +605,8 @@ 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 | SupportsPrimitiveRestart(input_assembly_topology), | 608 | (device.IsExtPrimitiveTopologyListRestartSupported() || |
| 609 | SupportsPrimitiveRestart(input_assembly_topology)), | ||
| 609 | }; | 610 | }; |
| 610 | const VkPipelineTessellationStateCreateInfo tessellation_ci{ | 611 | const VkPipelineTessellationStateCreateInfo tessellation_ci{ |
| 611 | .sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, | 612 | .sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, |
| @@ -613,7 +614,6 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { | |||
| 613 | .flags = 0, | 614 | .flags = 0, |
| 614 | .patchControlPoints = key.state.patch_control_points_minus_one.Value() + 1, | 615 | .patchControlPoints = key.state.patch_control_points_minus_one.Value() + 1, |
| 615 | }; | 616 | }; |
| 616 | |||
| 617 | std::array<VkViewportSwizzleNV, Maxwell::NumViewports> swizzles; | 617 | std::array<VkViewportSwizzleNV, Maxwell::NumViewports> swizzles; |
| 618 | std::ranges::transform(key.state.viewport_swizzles, swizzles.begin(), UnpackViewportSwizzle); | 618 | std::ranges::transform(key.state.viewport_swizzles, swizzles.begin(), UnpackViewportSwizzle); |
| 619 | const VkPipelineViewportSwizzleStateCreateInfoNV swizzle_ci{ | 619 | const VkPipelineViewportSwizzleStateCreateInfoNV swizzle_ci{ |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 7bf5b6578..38410eee4 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -433,6 +433,19 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 433 | LOG_INFO(Render_Vulkan, "Device doesn't support uint8 indexes"); | 433 | LOG_INFO(Render_Vulkan, "Device doesn't support uint8 indexes"); |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT primitive_topology_list_restart; | ||
| 437 | if (is_topology_list_restart_supported || is_patch_list_restart_supported) { | ||
| 438 | primitive_topology_list_restart = { | ||
| 439 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT, | ||
| 440 | .pNext = nullptr, | ||
| 441 | .primitiveTopologyListRestart = is_topology_list_restart_supported, | ||
| 442 | .primitiveTopologyPatchListRestart = is_patch_list_restart_supported, | ||
| 443 | }; | ||
| 444 | SetNext(next, primitive_topology_list_restart); | ||
| 445 | } else { | ||
| 446 | LOG_INFO(Render_Vulkan, "Device doesn't support list topology primitive restart"); | ||
| 447 | } | ||
| 448 | |||
| 436 | VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback; | 449 | VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback; |
| 437 | if (ext_transform_feedback) { | 450 | if (ext_transform_feedback) { |
| 438 | transform_feedback = { | 451 | transform_feedback = { |
| @@ -891,6 +904,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 891 | bool has_ext_provoking_vertex{}; | 904 | bool has_ext_provoking_vertex{}; |
| 892 | bool has_ext_vertex_input_dynamic_state{}; | 905 | bool has_ext_vertex_input_dynamic_state{}; |
| 893 | bool has_ext_line_rasterization{}; | 906 | bool has_ext_line_rasterization{}; |
| 907 | bool has_ext_primitive_topology_list_restart{}; | ||
| 894 | for (const std::string& extension : supported_extensions) { | 908 | for (const std::string& extension : supported_extensions) { |
| 895 | const auto test = [&](std::optional<std::reference_wrapper<bool>> status, const char* name, | 909 | const auto test = [&](std::optional<std::reference_wrapper<bool>> status, const char* name, |
| 896 | bool push) { | 910 | bool push) { |
| @@ -915,6 +929,8 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 915 | test(has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, false); | 929 | test(has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, false); |
| 916 | test(ext_depth_range_unrestricted, VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, true); | 930 | test(ext_depth_range_unrestricted, VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, true); |
| 917 | test(ext_index_type_uint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, true); | 931 | test(ext_index_type_uint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, true); |
| 932 | test(has_ext_primitive_topology_list_restart, | ||
| 933 | VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME, true); | ||
| 918 | test(ext_sampler_filter_minmax, VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, true); | 934 | test(ext_sampler_filter_minmax, VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME, true); |
| 919 | test(ext_shader_viewport_index_layer, VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, | 935 | test(ext_shader_viewport_index_layer, VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, |
| 920 | true); | 936 | true); |
| @@ -1128,6 +1144,18 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) { | |||
| 1128 | 1144 | ||
| 1129 | max_push_descriptors = push_descriptor.maxPushDescriptors; | 1145 | max_push_descriptors = push_descriptor.maxPushDescriptors; |
| 1130 | } | 1146 | } |
| 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 | } | ||
| 1131 | return extensions; | 1159 | return extensions; |
| 1132 | } | 1160 | } |
| 1133 | 1161 | ||
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 10653ac6b..ed7782d42 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -243,6 +243,11 @@ public: | |||
| 243 | return ext_index_type_uint8; | 243 | return ext_index_type_uint8; |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | /// Returns true if the device supports VK_EXT_primitive_topology_list_restart. | ||
| 247 | bool IsExtPrimitiveTopologyListRestartSupported() const { | ||
| 248 | return ext_primitive_topology_list_restart; | ||
| 249 | } | ||
| 250 | |||
| 246 | /// Returns true if the device supports VK_EXT_sampler_filter_minmax. | 251 | /// Returns true if the device supports VK_EXT_sampler_filter_minmax. |
| 247 | bool IsExtSamplerFilterMinmaxSupported() const { | 252 | bool IsExtSamplerFilterMinmaxSupported() const { |
| 248 | return ext_sampler_filter_minmax; | 253 | return ext_sampler_filter_minmax; |
| @@ -401,6 +406,9 @@ private: | |||
| 401 | bool is_shader_int16_supported{}; ///< Support for int16. | 406 | bool is_shader_int16_supported{}; ///< Support for int16. |
| 402 | bool is_shader_storage_image_multisample{}; ///< Support for image operations on MSAA images. | 407 | bool is_shader_storage_image_multisample{}; ///< Support for image operations on MSAA images. |
| 403 | bool is_blit_depth_stencil_supported{}; ///< Support for blitting from and to depth stencil. | 408 | bool is_blit_depth_stencil_supported{}; ///< Support for blitting from and to depth stencil. |
| 409 | bool is_topology_list_restart_supported{}; ///< Support for primitive restart with list | ||
| 410 | ///< topologies. | ||
| 411 | bool is_patch_list_restart_supported{}; ///< Support for primitive restart with list patch. | ||
| 404 | bool nv_viewport_swizzle{}; ///< Support for VK_NV_viewport_swizzle. | 412 | bool nv_viewport_swizzle{}; ///< Support for VK_NV_viewport_swizzle. |
| 405 | bool nv_viewport_array2{}; ///< Support for VK_NV_viewport_array2. | 413 | bool nv_viewport_array2{}; ///< Support for VK_NV_viewport_array2. |
| 406 | bool nv_geometry_shader_passthrough{}; ///< Support for VK_NV_geometry_shader_passthrough. | 414 | bool nv_geometry_shader_passthrough{}; ///< Support for VK_NV_geometry_shader_passthrough. |
| @@ -411,6 +419,8 @@ private: | |||
| 411 | bool khr_pipeline_executable_properties{}; ///< Support for executable properties. | 419 | bool khr_pipeline_executable_properties{}; ///< Support for executable properties. |
| 412 | bool khr_swapchain_mutable_format{}; ///< Support for VK_KHR_swapchain_mutable_format. | 420 | bool khr_swapchain_mutable_format{}; ///< Support for VK_KHR_swapchain_mutable_format. |
| 413 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. | 421 | 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. | ||
| 414 | bool ext_sampler_filter_minmax{}; ///< Support for VK_EXT_sampler_filter_minmax. | 424 | bool ext_sampler_filter_minmax{}; ///< Support for VK_EXT_sampler_filter_minmax. |
| 415 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. | 425 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. |
| 416 | bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. | 426 | bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. |