From 274d4679cac5fb9e6e47990d149961d0233bf8b7 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sat, 23 Jul 2022 15:56:19 -0500 Subject: [PATCH] VideoBackends:Multiple: More GPUs with broken subgroup ops --- Source/Core/VideoBackends/Metal/MTLUtil.mm | 2 +- Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | 2 +- Source/Core/VideoCommon/DriverDetails.cpp | 12 ++++++++---- Source/Core/VideoCommon/DriverDetails.h | 9 +++++++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Source/Core/VideoBackends/Metal/MTLUtil.mm b/Source/Core/VideoBackends/Metal/MTLUtil.mm index 30eb305de3..d53bf46809 100644 --- a/Source/Core/VideoBackends/Metal/MTLUtil.mm +++ b/Source/Core/VideoBackends/Metal/MTLUtil.mm @@ -224,7 +224,7 @@ void Metal::Util::PopulateBackendInfoFeatures(VideoConfig* config, id [device supportsFamily:MTLGPUFamilyMac2] || [device supportsFamily:MTLGPUFamilyApple6]; config->backend_info.bSupportsFramebufferFetch = [device supportsFamily:MTLGPUFamilyApple1]; } - if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_SUBGROUP_INVOCATION_ID)) + if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_SUBGROUP_OPS)) g_features.subgroup_ops = false; #if TARGET_OS_OSX if (@available(macOS 11, *)) diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp index bc9cc1169b..f6a1c8c32b 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp @@ -984,7 +984,7 @@ void VulkanContext::PopulateShaderSubgroupSupport() m_supports_shader_subgroup_operations = (subgroup_properties.supportedOperations & required_operations) == required_operations && subgroup_properties.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT && - !DriverDetails::HasBug(DriverDetails::BUG_BROKEN_SUBGROUP_INVOCATION_ID); + !DriverDetails::HasBug(DriverDetails::BUG_BROKEN_SUBGROUP_OPS); } bool VulkanContext::SupportsExclusiveFullscreen(const WindowSystemInfo& wsi, VkSurfaceKHR surface) diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index 09fef47a4f..ffd5fa48d7 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -132,10 +132,14 @@ constexpr BugInfo m_known_bugs[] = { -1.0, -1.0, true}, {API_VULKAN, OS_ALL, VENDOR_ARM, DRIVER_ARM, Family::UNKNOWN, BUG_BROKEN_VECTOR_BITWISE_AND, -1.0, -1.0, true}, - {API_VULKAN, OS_OSX, VENDOR_ATI, DRIVER_PORTABILITY, Family::UNKNOWN, - BUG_BROKEN_SUBGROUP_INVOCATION_ID, -1.0, -1.0, true}, - {API_METAL, OS_OSX, VENDOR_ATI, DRIVER_APPLE, Family::UNKNOWN, - BUG_BROKEN_SUBGROUP_INVOCATION_ID, -1.0, -1.0, true}, + {API_VULKAN, OS_OSX, VENDOR_ATI, DRIVER_PORTABILITY, Family::UNKNOWN, BUG_BROKEN_SUBGROUP_OPS, + -1.0, -1.0, true}, + {API_VULKAN, OS_OSX, VENDOR_INTEL, DRIVER_PORTABILITY, Family::UNKNOWN, BUG_BROKEN_SUBGROUP_OPS, + -1.0, -1.0, true}, + {API_METAL, OS_OSX, VENDOR_ATI, DRIVER_APPLE, Family::UNKNOWN, BUG_BROKEN_SUBGROUP_OPS, -1.0, + -1.0, true}, + {API_METAL, OS_OSX, VENDOR_INTEL, DRIVER_APPLE, Family::UNKNOWN, BUG_BROKEN_SUBGROUP_OPS, -1.0, + -1.0, true}, {API_OPENGL, OS_ANDROID, VENDOR_ALL, DRIVER_ALL, Family::UNKNOWN, BUG_BROKEN_MULTITHREADED_SHADER_PRECOMPILATION, -1.0, -1.0, true}, {API_VULKAN, OS_ANDROID, VENDOR_ALL, DRIVER_ALL, Family::UNKNOWN, diff --git a/Source/Core/VideoCommon/DriverDetails.h b/Source/Core/VideoCommon/DriverDetails.h index 02827c35d5..3e59e576c6 100644 --- a/Source/Core/VideoCommon/DriverDetails.h +++ b/Source/Core/VideoCommon/DriverDetails.h @@ -306,10 +306,15 @@ enum Bug BUG_BROKEN_VECTOR_BITWISE_AND, // BUG: Accessing gl_SubgroupInvocationID causes the Metal shader compiler to crash. - // Affected devices: AMD (macOS) + // Affected devices: AMD (older macOS) + // BUG: gl_HelperInvocation always returns true, even for non-helper invocations + // Affected devices: AMD (newer macOS) + // BUG: Using subgroupMax in a shader that can discard results in garbage data + // (For some reason, this only happens at 4x+ IR on Metal, but 2x+ IR on MoltenVK) + // Affected devices: Intel (macOS) // Started version: -1 // Ended version: -1 - BUG_BROKEN_SUBGROUP_INVOCATION_ID, + BUG_BROKEN_SUBGROUP_OPS, // BUG: Multi-threaded shader pre-compilation sometimes crashes // Used primarily in Videoconfig.cpp's GetNumAutoShaderPreCompilerThreads()