It seems to me simd_ballot is the key. Searching Google, I am surprised that this post is the only result apart from Metal Shading Language Specification itself!
It’s existed for a while on current hardware (eg. GCN) but only exposed on some.
https://developer.nvidia.com/reading-between-threads-shader-intrinsics
It seems to me simd_ballot is the key. Searching Google, I am surprised that this post is the only result apart from Metal Shading Language Specification itself!
It’s existed for a while on current hardware (eg. GCN) but only exposed on some.
https://developer.nvidia.com/reading-between-threads-shader-intrinsics