`assert` in metal?

Apple Recommended

Replies

Currently, there is no support for assert in the Metal Shading Language. We do not recommend using the Clang’s __builtin_trap() for this.
Please submit an enhancement request via Feedback Assistant.

Having said that, please consider turning on the validation layer and performing an out-of-bounds access on a buffer as a solution to what you are trying to do.
For more information on the validation layer please watch Debug GPU-side errors in Metal.

I also need an assert. The MBP 16" is generating valid uv, with 0 length derivatives and that causes problems. Being able to assert on this condition would help. Drew's recommendation just seems to result in a compilation failure on macOS Big Sur.