Download

can't build UE5 from source: Shader compiler errors compiling WorldGridMaterial for platform SF_METAL_SM5

[UE] LogInit: Build: UE5-CL-0**
[UE] LogInit: Engine Version: 5.1.0-0+UE5**
[UE] LogInit: Compatible Engine Version: 5.1.0-0+UE5**
[UE] LogInit: Net CL: 0**
[UE] LogInit: OS: 12.0.1 (21A559), CPU: Apple M1 Max, GPU: Apple G13X**
[UE] LogInit: Compiled (64-bit): Dec 8 2021 08:47:08**
[UE] LogInit: Compiled with Clang: 13.0.0 (clang-1300.0.29.3)**
[UE] LogInit: Build Configuration: Development**
[UE] LogInit: Branch Name: UE5**
[UE] LogInit: Command Line: -NSDocumentRevisionsDebugMode YES**

2021-12-08 10:17:20.314609-0500 UnrealEditor[37446:1115732] [UE] [2021.12.08-15.17.20:314][ 0]LogShaderCompilers: Warning: 28 Shader compiler errors compiling WorldGridMaterial for platform SF_METAL_SM5:
2021-12-08 10:17:20.315063-0500 UnrealEditor[37446:1115732] [UE] Shader debug info dumped to: “/Users/rspaulino/Downloads/repos/debugunreal/UnrealEngine/Engine/Saved/ShaderDebugInfo/SF_METAL_SM5/WorldGridMaterial/FLandscapeFixedGridVertexFactory/FDebugViewModePS/0”
/var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal(0): Shader FDebugViewModePS, Permutation 0, VF FLandscapeFixedGridVertexFactory:
/var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal(0): Failed to compile /var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal to bytecode /var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.air, code: 1, output: /var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal:91:745: error: ‘primitive_id’ attribute requires Metal language standard macos-metal2.2 or higher
fragment Main_out Main_0000a6d9_31b4d34e(Main_in in [[stage_in]], constant uint* spvBufferSizeConstants [[buffer(5)]], constant type_View& View [[buffer(1)]], constant type_DebugViewModePass& DebugViewModePass [[buffer(2)]], constant type_Material& Material [[buffer(3)]], constant type_Globals& _Globals [[buffer(4)]], texture2d<uint, access::read_write> DebugViewModePass_QuadOverdraw [[texture(0)]], device atomic_uint* DebugViewModePass_QuadOverdraw_atomic [[buffer(0)]], texture2d Material_Texture2D_0 [[texture(1)]], texture2d Material_Texture2D_1 [[texture(2)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_1Sampler [[sampler(1)]], float4 gl_FragCoord [[position]], uint gl_PrimitiveID [[primitive_id]])
^~~~~~~~~~~~
/var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal:163:189: error: no matching function for call to ‘spvImageAtomicCoord’
} while (!atomic_compare_exchange_weak_explicit((device atomic_uint*)&DebugViewModePass_QuadOverdraw_atomic[spvStorageBufferCoords(0, spvBufferSizeConstants, uint, spvImageAtomicCoord(DebugViewModePass_QuadOverdraw, _1181, spvBufferSizeConstants[(0*3)+2]))], &_1232, (gl_PrimitiveID + 1u) << 2u, memory_order_relaxed, memory_order_relaxed) && _1232 == 0u);
^~~~~~~~~~~~~~~~~~~
/var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal:29:69: note: expanded from macro ‘spvStorageBufferCoords’
#define spvStorageBufferCoords(idx, sizes, type, coord) metal::min((coord), (sizes[(idx)*3] / sizeof(type)) - 1)
^~~~~
/var/folders/zy/rrsjvrfj1cs3lk0nlts8ln780000gn/T/MetalShaderCompilation/37685/42713_833934158.metal:14:13: note: candidate template ignored: could not match 0 against 3
inline uint spvImageAtomicCoord(texture2d tex, uint2 tc, uint element_pitch)
^