2 ms·
> We dispatch instanced draw calls where each instance corresponds to a segment’s quad. The vertex shader finds all of the information it needs from the primiti
by Jasper_ 8y ago
> We dispatch instanced draw calls where each instance corresponds to a segment’s quad. The vertex shader finds all of the information it needs from the primitive offset and segment id of the quad it is working on.
Hm, any reason you're using instanced quads? From my understanding of how GPUs work, instancing only has big gains when you have a lot of vertex data in the draw call [0]. Instead of the instanced quads, have you considered making a vertex buffer containing two shapes: a + for the center/edges, and four quads for the corners. That way you could still do the whole thing in two draw calls, and you're not going through the slow instancing path. And if you have to blend the bg anyway (e.g. rgba background-color), you can just draw the whole vertex buffer in one go to skip the extra draw call.
[0] http://www.joshbarczak.com/blog/?p=667 http://www.joshbarczak.com/blog/?p=667