@@ -111,8 +111,8 @@ def print_msl_compiler_version():
111111
112112def msl_compiler_supports_version (version ):
113113 try :
114- subprocess .check_call (['xcrun' , '--sdk' , 'macosx' , 'metal' , '-x' , 'metal' , '-std=macos-metal' + version , '-' ],
115- stdin = subprocess .DEVNULL , stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
114+ subprocess .check_call (['xcrun' , '--sdk' , 'macosx' , 'metal' , '-x' , 'metal' , version , '-' ],
115+ stdin = subprocess .DEVNULL , stdout = subprocess .DEVNULL , stderr = subprocess .DEVNULL )
116116 print ('Current SDK supports MSL {0}. Enabling validation for MSL {0} shaders.' .format (version ))
117117 return True
118118 except OSError as e :
@@ -124,7 +124,9 @@ def msl_compiler_supports_version(version):
124124
125125def path_to_msl_standard (shader ):
126126 if '.ios.' in shader :
127- if '.msl2.' in shader :
127+ if '.msl3.' in shader :
128+ return '-std=metal3.0'
129+ elif '.msl2.' in shader :
128130 return '-std=ios-metal2.0'
129131 elif '.msl21.' in shader :
130132 return '-std=ios-metal2.1'
@@ -141,7 +143,9 @@ def path_to_msl_standard(shader):
141143 else :
142144 return '-std=ios-metal1.2'
143145 else :
144- if '.msl2.' in shader :
146+ if '.msl3.' in shader :
147+ return '-std=metal3.0'
148+ elif '.msl2.' in shader :
145149 return '-std=macos-metal2.0'
146150 elif '.msl21.' in shader :
147151 return '-std=macos-metal2.1'
@@ -157,7 +161,9 @@ def path_to_msl_standard(shader):
157161 return '-std=macos-metal1.2'
158162
159163def path_to_msl_standard_cli (shader ):
160- if '.msl2.' in shader :
164+ if '.msl3.' in shader :
165+ return '30000'
166+ elif '.msl2.' in shader :
161167 return '20000'
162168 elif '.msl21.' in shader :
163169 return '20100'
@@ -1017,11 +1023,13 @@ def main():
10171023 args .msl22 = False
10181024 args .msl23 = False
10191025 args .msl24 = False
1026+ args .msl30 = False
10201027 if args .msl :
10211028 print_msl_compiler_version ()
1022- args .msl22 = msl_compiler_supports_version ('2.2' )
1023- args .msl23 = msl_compiler_supports_version ('2.3' )
1024- args .msl24 = msl_compiler_supports_version ('2.4' )
1029+ args .msl22 = msl_compiler_supports_version ('-std=macos-metal2.2' )
1030+ args .msl23 = msl_compiler_supports_version ('-std=macos-metal2.3' )
1031+ args .msl24 = msl_compiler_supports_version ('-std=macos-metal2.4' )
1032+ args .msl30 = msl_compiler_supports_version ('-std=metal3.0' )
10251033
10261034 backend = 'glsl'
10271035 if (args .msl or args .metal ):
0 commit comments