Hi,
I am moving from compiling my Metal shader in the runtime (the app) into the toolchain, as I read the compiler may do more optimisation when performed in the toolchain.
When compiling for macos, I used to following command:
xcrun -sdk macos metal -ffast-math -o
When compiling for iOS:
xcrun -sdk iphoneos metal -ffast-math -o
Everything compile fine for the macos platform. However, when compiling for iOS, shaders that use "texturecube_array" fail to compile. The error message is:
/tmp/noxMaterialDefConverter/temp_DI3EEf.metal:17:168: error: unknown type name 'texturecube_array';
did you mean 'texture_cube_array_t'?
fragment main0_out main0(constant UDefaultFs& _UDefaultFs_0 [[buffer(0)]], texture2d g_samples [[texture(0)]],
texturecube g_radianceMap [[texture(1)]], texturecube_array g_sh2Weights [[texture(2)]],
sampler g_samplesSmplr [[sampler(0)]], sampler g_radianceMapSmplr [[sampler(1)]],
sampler g_sh2WeightsSmplr [[sampler(2)]], float4 gl_FragCoord [[position]])
^~~~~~~~~~~~~~~~~
texture_cube_array_t
note: 'texture_cube_array_t' declared here
The shader language specification indicates that texturecube_array should be supported. Is that i am not compiling for the correct shader language version? How can I specify the shader language version I would like to use from the command line "xcrun -sdk iphoneos metal" ?
Thanks.