4 ms·
> Well-written apps generally require primitive restart, and it’s almost free for apps that don’t need it. I'm really surprised that primitive restart is force
by Jasper_ 5y ago
> Well-written apps generally require primitive restart, and it’s almost free for apps that don’t need it.
I'm really surprised that primitive restart is forced on in Metal, but they also have a hardware bit for it! Primitive restart makes your whole pipeline slower, because you can't just chunk your index list when building your vertex packets to send to the work distributors; the possibility of a primitive restart index means you have to linearly scan for it. Though I'm not a hardware guy -- maybe the degenerate tris thing makes it just as annoying in practice.
I'd guess that the limitation to force primitive restart on in Metal came from another IHV limitation (maybe old PVR chips?)
That said, you really shouldn't be using tristrips in 2021 anyway, they have poor locality, and are hard to optimize. Index buffers solve the problems that tristrips wanted to solve to begin with.
IME, a well-written app should just ignore tristrips / restartable topologies, and just use straight tri-lists.
- atq2119 5y agoIn theory you could do parallel scan tricks to implement primitive restart at full speed, but obviously it's going to cost you and it complicates the index fetch immensely since it effectively ends up being split into two parts. Most likely, Apple simply doesn't build GPUs big enough to run into that problem, but it makes you wonder what they're doing on their hardware with AMD GPUs.