Files
test2/intern
Weizhen Huang 04166ea0ea Cycles: support printf in Metal 15.0
For metal version after 3.2 it's possible to log debugging messages, it
works similar to `printf()`, except for a few differences:
- `%s` is not supported,
- `double` doesn't exist, so no casting to double for `%f`,
- no `\n` needed at the end of the format string.

To see the print in the console, environment variables `MTL_LOG_LEVEL`
should be set to `MTLLogLevelDebug`, and `MTL_LOG_TO_STDERR` should be
set to `1`. See
https://developer.apple.com/documentation/metal/logging-shader-debug-messages

Right now `printf()`, `print_float()`, `print_float2()`,
`print_float3()` and `print_float4()` are supported.

Thanks to @fclem for finding this out.

Pull Request: https://projects.blender.org/blender/blender/pulls/146585
2025-10-01 14:25:44 +02:00
..