You'd think there's a million ready-to-use "sort some things, on the GPU" codes out there, but outside of CUDA there isn't all that much. The ones that work, that is.

So I spent way too much time debugging sorting of a bunch of points! As a side effect though, Unity HDRP GPU sorting utility got a fix pull request :) https://github.com/Unity-Technologies/Graphics/pull/7954

Improve robustness of GPUSort wrt out of bounds buffer reads/writes by aras-p · Pull Request #7954 · Unity-Technologies/Graphics

Purpose of this PR GPUSort utility (which seems to be used for the "software" Line Rendering system in HDRP) in some cases produces incorrect results, at least on Metal (most notably, when the size...

GitHub
@aras thank you Aras for the fixes. We encourage everyone to help us. If it wasn't for Natasha and Seb this work would be dead. So we shouldn't take it for granted, is a privilege to have it out and we fought current unity management to not kill these features
We have a full prototype of the hair rasterizer as well on a smaller GitHub project in python and hlsl
https://github.com/johnpars/LineSoftwareRasterizer
If you anyone buys me MacBook pro I'll port it metal :)
GitHub - johnpars/LineSoftwareRasterizer

Contribute to johnpars/LineSoftwareRasterizer development by creating an account on GitHub.

GitHub