Skip to content

Commit

Permalink
Completed the support for MSL 3.1 enum
Browse files Browse the repository at this point in the history
This commit adds some extra code that was needed to define to MSL 3.1 enum that was not included in the first commit. Based on PR: KhronosGroup#1940
  • Loading branch information
AntarticCoder committed Jul 5, 2023
1 parent 6bca44c commit 056dec8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,12 @@
}
#endif

#if MVK_XCODE_15
if ( mvkOSVersionIsAtLeast(17.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif

#endif

#if MVK_IOS
Expand Down Expand Up @@ -1897,6 +1903,11 @@
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_0;
}
#endif
#if MVK_XCODE_15
if ( mvkOSVersionIsAtLeast(17.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif

#endif

Expand Down Expand Up @@ -1982,6 +1993,11 @@
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_0;
}
#endif
#if MVK_XCODE_15
if ( mvkOSVersionIsAtLeast(14.0) ) {
_metalFeatures.mslVersionEnum = MTLLanguageVersion3_1;
}
#endif

// This is an Apple GPU--treat it accordingly.
if (supportsMTLGPUFamily(Apple1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
#define mslVer(MJ, MN, PT) mslVersionMajor == MJ && mslVersionMinor == MN && mslVersionPoint == PT

MTLLanguageVersion mslVerEnum = (MTLLanguageVersion)0;
#if MVK_XCODE_15
if (mslVer(3, 1, 0)) {
mslVerEnum = MTLLanguageVersion3_1;
} else
#endif
#if MVK_XCODE_14
if (mslVer(3, 0, 0)) {
mslVerEnum = MTLLanguageVersion3_0;
Expand Down

0 comments on commit 056dec8

Please sign in to comment.