Creating octtree on GPU

Has anyone here tried to build an Octtree in a shader?

Basically this requires syncrhonization and a simple attempt to implement a per-node mutex using InterlockedAdd or InterlockedCompareExchange causes shader to lock up and get killed by driver.

Online sources seem to suggest using Morton codes and sorting them. Been wondering if this can be done without a sorting phase.

Did you build an octree in shader?
I am trying to build tree in shader and fail. When InterlockedCompareExchange is used, data read from RWBuffer are all 0. I wonder if InterlockedCompareExchange in unity is working properly.

Never mind, InterlockedCompareExchange works.

Please don’t necro threads like this. Create your own threads and ask a question please.