Search code examples
optimizationdirectxvbodirectx-9

Restart primitive within single draw call (directx9)


I am porting openGL application wich use ability to restart triangle strip to optimize draw calls. So we can render dozens of separate object with two buffers and one draw call. In openGL index buffer must just duplicate some index, and openGL will restart primitive from there. As mentioned here we can restart triangle strip using "-1" magic-index. But it is dx10 man. How can i do the same in dx9?


Solution

  • Zdd is right - there is no special mark (such as -1) to restart primitive. But the answer is still there and very simple. I just had not thought of how OpenGL can break primitive. Now I do not think, that two double index processed in any special way. This is simple geometry - indices [1, 2, 3, 4, 4, 5, 5, 6, 6, 7, 8] will render

    • 4 visible triangles
    • 4 invisible (degenerate) triangles
    • 1 strip (formally, partially invisible)

    So, 2 strips will be perceived by the observer. Exactly what was needed.