**System Information**
Operating system: macOS-12.1-arm64-arm-64bit 64 Bits
Graphics card: Apple M1 Apple 4.1 Metal - 76.3
**Blender Version**
Broken: version: 3.1.0 Alpha, branch: master (modified), commit date: 2022-01-05 14:58, hash: `rB8393ccd07634`
Worked: rB86141a75ebc5
**Short description of error**
Blender crashes with on Apple M1 when using Cycles with GPU Compute
**Exact steps for others to reproduce the error**
1) Have the default scene open
2) In the Blender Preferences > System setting in the Metal tab of the Cycles Render Devices section enable Apple M1 (GPU)
3) Set the render engine to Cycles and device to GPU compute
4) Either hit F12 to render or switch to rendered view
Blender will immediately crash but earlier show a failed Metal kernel compilation.
The error that only affects Metal was introduced in rB8393ccd07634. When the number of function parameters of filter_guiding_preprocess was increased from 16 to 18 the macro magic in intern/cycles/kernel/device/metal/compat.h was missing the defines for 17 and 18 parameters.
Additionally Metal needs ccl_global qualifiers for the code that was added.