
Borderland Between Rendering and Editor – Part 2: Picking - ibobev
https://ourmachinery.com/post/borderland-part-2-picking/
======
Arelius
I think a word of caution should be provided. The sort of spin-lock used here
while may appear to work in the vast majority of scenarios, the forward
progress guarantee required doesn't exists on all (or even many) modern GPUs.
It's entirely possible for the thread holding the lock to get suspended, and
never resume due to another thread spinning while waiting on the lock.

I really like Tobias, and think they are doing some great stuff on The
Machinery, but I think he should (and eventually will be forced to) reconsider
how he is implementing picking.

~~~
raphlinus
Indeed. I discussed this with a bunch of my GPU buddies, and we came to the
conclusion that this code is not safe in the face of lack of forward progress
guarantees. Also, shameless self-promotion, I have an extensive discussion of
GPU forward progress in my recent blog:
[https://raphlinus.github.io/gpu/2020/04/30/prefix-
sum.html](https://raphlinus.github.io/gpu/2020/04/30/prefix-sum.html)

~~~
Arelius
Nice post!

------
gens
Nice that it works with various deformations, but because of the latency and
more shaders i'l skip this. I have still learned some things from this post.

------
Jasper_
What's wrong with reading back an object ID buffer GL_SELECT style?

