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

[ios18 support] add new case for Metal Version 3.2 that is on ios 18 -- reroutes MoltenMK to use version 3.1 #2255

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Common/MVKCommonEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ extern "C" {
#endif

/** Building with Xcode versions. iOS version also covers tvOS. */
#ifndef MVK_XCODE_16
#define MVK_XCODE_16 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 150000) || \
(__IPHONE_OS_VERSION_MAX_ALLOWED >= 180000))
#endif
#ifndef MVK_XCODE_15
# define MVK_XCODE_15 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 140000) || \
(__IPHONE_OS_VERSION_MAX_ALLOWED >= 170000))
Expand Down
25 changes: 25 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,13 @@
}
#endif

#if MVK_XCODE_16
if ( mvkOSVersionIsAtLeast(18.0) ) {
// We don't explicitly support Metal 3.2 yet
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif

#endif

#if MVK_IOS
Expand Down Expand Up @@ -2136,6 +2143,12 @@
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif
#if MVK_XCODE_16
if ( mvkOSVersionIsAtLeast(18.0) ) {
// We don't explicitly support Metal 3.2 yet
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif

#endif

Expand Down Expand Up @@ -2226,6 +2239,12 @@
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif
#if MVK_XCODE_16
if ( mvkOSVersionIsAtLeast(18.0) ) {
// We don't explicitly support Metal 3.2 yet
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif

// This is an Apple GPU--treat it accordingly.
if (supportsMTLGPUFamily(Apple1)) {
Expand Down Expand Up @@ -2341,6 +2360,12 @@
_metalFeatures.mslVersion = SPIRV_CROSS_NAMESPACE::CompilerMSL::Options::make_msl_version(maj, min);

switch (_metalFeatures.mslVersionEnum) {
#if MVK_XCODE_16
case MTLLanguageVersion3_2:
// We don't explicitly support Metal 3.2 yet
setMSLVersion(3, 1);
break;
#endif
#if MVK_XCODE_15
case MTLLanguageVersion3_1:
setMSLVersion(3, 1);
Expand Down
Loading