Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal: fix crash by enabling concurrent compilation only if available #12311

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion Source/Core/VideoBackends/Metal/MTLMain.mm
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,23 @@ static bool WindowSystemTypeSupportsMetal(WindowSystemType type)
Util::PopulateBackendInfoFeatures(&g_Config, adapter);

#if TARGET_OS_OSX
if (@available(macOS 13.3, *))
// This should be available on all macOS 13.3+ systems – but when using OCLP drivers, some devices
// fail with "Unrecognized selector -[MTLIGAccelDevice setShouldMaximizeConcurrentCompilation:]"
//
// This concerns Intel Ivy Bridge, Haswell and Nvidia Kepler on macOS 13.3 or newer.
// (See
// https://github.com/dortania/OpenCore-Legacy-Patcher/blob/34676702f494a2a789c514cc76dba19b8b7206b1/docs/PATCHEXPLAIN.md?plain=1#L354C1-L354C83)
//
// Perform the feature detection dynamically instead.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"

if ([adapter respondsToSelector:@selector(setShouldMaximizeConcurrentCompilation:)])
{
[adapter setShouldMaximizeConcurrentCompilation:YES];
}

#pragma clang diagnostic pop
#endif

UpdateActiveConfig();
Expand Down