Replies: 2 comments 1 reply
-
The term for 2 is "programmable vertex pulling" or "vertex pulling". I'll call 1 "vertex buffers". Generally, vertex buffers should never be worse than vertex pulling. If, on some GPU, vertex buffers are worse than vertex pulling, then that GPU's driver should just implement vertex buffers using vertex pulling! And in fact some GPUs do implement vertex buffers using vertex pulling (this can be seen in AMD shader disassemblies, IIRC). OTOH, vertex pulling can definitely be worse for performance on some devices. See here for example: |
Beta Was this translation helpful? Give feedback.
-
Very Old timings https://github.com/nlguillemot/ProgrammablePulling https://www.yosoygames.com.ar/wp/2018/03/vertex-formats-part-2-fetch-vs-pull/ Personally I don't think it's worth obsessing one over the other. I'm relatively confident that, for example, not a single three.js example would show a noticble per different with one technique vs the other. Feel free to prove me wrong. Most projects are not pushing to the limit. If you do want to push the the limit then you'll need to test for every GPU or add some tests to your code or, like most PC games, provide extensive "graphics options" to the user. For me, I'd just use whatever is easier for my particular project. I'd use vertex buffers by default and use storage buffers when I need the flexibility. |
Beta Was this translation helpful? Give feedback.
-
In WebGPU, when drawing multiple rectangles using the draw instance method, there are two ways to read coordinates:
Which method performs better?
If the performance of the two methods is not significantly different, considering other factors such as frequent modification of point coordinates , point size, color, etc., it may be more convenient to read from the storage buffer?
in this demo
how about write it by using storage buffer to receive points position , and use
points[instance_index].xy
to get positon?Beta Was this translation helpful? Give feedback.
All reactions