Skip to content

Commit

Permalink
[ios18 support] add new case for Metal Version 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Daij-Djan committed Jun 14, 2024
1 parent e6b7806 commit 18ae905
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
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

0 comments on commit 18ae905

Please sign in to comment.