From 0e021a9cbc61d5211b41a4cca339f7e1b9d63bbe Mon Sep 17 00:00:00 2001 From: MaranBr Date: Tue, 18 Nov 2025 17:17:11 -0400 Subject: [PATCH] Remove unused code --- .../vulkan_common/vulkan_device.cpp | 88 ++----------------- 1 file changed, 8 insertions(+), 80 deletions(-) diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index b6db82cabe..d52db9192a 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -494,18 +494,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR CollectPhysicalMemoryInfo(); CollectToolingInfo(); - if (is_qualcomm || is_turnip) { - LOG_WARNING(Render_Vulkan, - "Qualcomm and Turnip drivers have broken VK_EXT_custom_border_color"); - //RemoveExtensionFeature(extensions.custom_border_color, features.custom_border_color, - //VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); - } - if (is_qualcomm) { - LOG_WARNING(Render_Vulkan, - "Qualcomm drivers have a slow VK_KHR_push_descriptor implementation"); - //RemoveExtension(extensions.push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); - LOG_WARNING(Render_Vulkan, "Disabling shader float controls and 64-bit integer features on Qualcomm proprietary drivers"); RemoveExtension(extensions.shader_float_controls, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME); @@ -544,51 +533,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR if (arch >= NvidiaArchitecture::Arch_AmpereOrNewer) { LOG_WARNING(Render_Vulkan, "Ampere and newer have broken float16 math"); features.shader_float16_int8.shaderFloat16 = false; - } else if (arch <= NvidiaArchitecture::Arch_Volta) { - if (nv_major_version < 527) { - LOG_WARNING(Render_Vulkan, "Volta and older have broken VK_KHR_push_descriptor"); - //RemoveExtension(extensions.push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); - } } + if (nv_major_version >= 510) { LOG_WARNING(Render_Vulkan, "NVIDIA Drivers >= 510 do not support MSAA image blits"); cant_blit_msaa = true; } } - if (extensions.extended_dynamic_state && is_radv) { - // Mask driver version variant - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version < VK_MAKE_API_VERSION(0, 21, 2, 0)) { - LOG_WARNING(Render_Vulkan, - "RADV versions older than 21.2 have broken VK_EXT_extended_dynamic_state"); - //RemoveExtensionFeature(extensions.extended_dynamic_state, - //features.extended_dynamic_state, - //VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); - } - } - if (extensions.extended_dynamic_state2 && is_radv) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version < VK_MAKE_API_VERSION(0, 22, 3, 1)) { - LOG_WARNING( - Render_Vulkan, - "RADV versions older than 22.3.1 have broken VK_EXT_extended_dynamic_state2"); - // RemoveExtensionFeature(extensions.extended_dynamic_state2, - // features.extended_dynamic_state2, - // VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME); - } - } - if (extensions.extended_dynamic_state2 && is_qualcomm) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) && - version < VK_MAKE_API_VERSION(0, 0, 680, 0)) { - // Qualcomm Adreno 7xx drivers do not properly support extended_dynamic_state2. - LOG_WARNING(Render_Vulkan, - "Qualcomm Adreno 7xx drivers have broken VK_EXT_extended_dynamic_state2"); - //RemoveExtensionFeature(extensions.extended_dynamic_state2, - //features.extended_dynamic_state2, - //VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME); - } - } + if (extensions.extended_dynamic_state3 && is_radv) { LOG_WARNING(Render_Vulkan, "RADV has broken extendedDynamicState3ColorBlendEquation"); features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false; @@ -603,6 +555,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR dynamic_state3_enables = false; } } + if (extensions.extended_dynamic_state3 && (is_amd_driver || driver_id == VK_DRIVER_ID_SAMSUNG_PROPRIETARY)) { // AMD and Samsung drivers have broken extendedDynamicState3ColorBlendEquation LOG_WARNING(Render_Vulkan, @@ -611,27 +564,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = false; dynamic_state3_blending = false; } - if (extensions.vertex_input_dynamic_state && is_radv) { - // TODO(ameerj): Blacklist only offending driver versions - // TODO(ameerj): Confirm if RDNA1 is affected - const bool is_rdna2 = - supported_extensions.contains(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME); - if (is_rdna2) { - LOG_WARNING(Render_Vulkan, - "RADV has broken VK_EXT_vertex_input_dynamic_state on RDNA2 hardware"); - // RemoveExtensionFeature(extensions.vertex_input_dynamic_state, - // features.vertex_input_dynamic_state, - // VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); - } - } - if (extensions.vertex_input_dynamic_state && is_qualcomm) { - // Qualcomm drivers do not properly support vertex_input_dynamic_state. - LOG_WARNING(Render_Vulkan, - "Qualcomm drivers have broken VK_EXT_vertex_input_dynamic_state"); - //RemoveExtensionFeature(extensions.vertex_input_dynamic_state, - // features.vertex_input_dynamic_state, - // VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); - } sets_per_pool = 64; if (is_amd_driver) { @@ -644,12 +576,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR has_broken_cube_compatibility = true; } } + if (is_qualcomm) { const u32 version = (properties.properties.driverVersion << 3) >> 3; if (version < VK_MAKE_API_VERSION(0, 255, 615, 512)) { has_broken_parallel_compiling = true; } } + if (extensions.sampler_filter_minmax && is_amd) { // Disable ext_sampler_filter_minmax on AMD GCN4 and lower as it is broken. if (!features.shader_float16_int8.shaderFloat16) { @@ -660,24 +594,17 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR } } - if (extensions.vertex_input_dynamic_state && is_intel_windows) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version < VK_MAKE_API_VERSION(27, 20, 100, 0)) { - LOG_WARNING(Render_Vulkan, "Intel has broken VK_EXT_vertex_input_dynamic_state"); - //RemoveExtensionFeature(extensions.vertex_input_dynamic_state, - //features.vertex_input_dynamic_state, - //VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); - } - } if (features.shader_float16_int8.shaderFloat16 && is_intel_windows) { // Intel's compiler crashes when using fp16 on Astral Chain, disable it for the time being. LOG_WARNING(Render_Vulkan, "Intel has broken float16 math"); features.shader_float16_int8.shaderFloat16 = false; } + if (is_intel_windows) { LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits"); cant_blit_msaa = true; } + has_broken_compute = CheckBrokenCompute(properties.driver.driverID, properties.properties.driverVersion) && !Settings::values.enable_compute_pipelines.GetValue(); @@ -685,6 +612,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format"); must_emulate_bgr565 = true; } + if (extensions.push_descriptor && is_intel_anv) { const u32 version = (properties.properties.driverVersion << 3) >> 3; if (version >= VK_MAKE_API_VERSION(0, 22, 3, 0) &&