Clever preprocessor macro in HLSL
I've been working on implementing various data structures (octrees, queues, and
sorting algorithms) in HLSL to execute in parallel on a GPU. I quickly
discovered that I was doing a lot of copy and paste because HLSL doesn't support
fancy features like function pointers and lambdas.
Most recently I implemented