mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 02:29:59 -06:00
Merge pull request #12537 from TellowKrinkle/MTLSubgroup
VideoCommon: More specific subgroup op bugs
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "VideoBackends/Vulkan/VulkanContext.h"
|
||||
#include "VideoCommon/DriverDetails.h"
|
||||
#include "VideoCommon/Spirv.h"
|
||||
|
||||
namespace Vulkan::ShaderCompiler
|
||||
@ -98,6 +99,13 @@ static std::string GetShaderCode(std::string_view source, std::string_view heade
|
||||
full_source_code.append(header);
|
||||
if (g_vulkan_context->SupportsShaderSubgroupOperations())
|
||||
full_source_code.append(SUBGROUP_HELPER_HEADER, subgroup_helper_header_length);
|
||||
if (DriverDetails::HasBug(DriverDetails::BUG_INVERTED_IS_HELPER))
|
||||
{
|
||||
full_source_code.append("#define gl_HelperInvocation !gl_HelperInvocation "
|
||||
"// Work around broken AMD Metal driver\n");
|
||||
}
|
||||
if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_SUBGROUP_OPS_WITH_DISCARD))
|
||||
full_source_code.append("#define BROKEN_SUBGROUP_WITH_DISCARD 1\n");
|
||||
full_source_code.append(source);
|
||||
}
|
||||
|
||||
|
@ -967,7 +967,7 @@ void VulkanContext::InitDriverDetails()
|
||||
|
||||
DriverDetails::Init(DriverDetails::API_VULKAN, vendor, driver,
|
||||
static_cast<double>(m_device_properties.driverVersion),
|
||||
DriverDetails::Family::UNKNOWN);
|
||||
DriverDetails::Family::UNKNOWN, std::move(device_name));
|
||||
}
|
||||
|
||||
void VulkanContext::PopulateShaderSubgroupSupport()
|
||||
@ -1000,8 +1000,7 @@ void VulkanContext::PopulateShaderSubgroupSupport()
|
||||
VK_SUBGROUP_FEATURE_BALLOT_BIT | VK_SUBGROUP_FEATURE_SHUFFLE_BIT;
|
||||
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_OPS);
|
||||
subgroup_properties.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
}
|
||||
|
||||
bool VulkanContext::SupportsExclusiveFullscreen(const WindowSystemInfo& wsi, VkSurfaceKHR surface)
|
||||
|
Reference in New Issue
Block a user