Let's assume I want to draw several separated (possibly textured) quads in Direct3D 9, each consisting of two triangles:

several quads

How should I draw these for maximum performance, i.e. which of the following ways is better in terms of speed?

  1. Describe each quad by 4 vertices, use D3DPT_TRIANGLESTRIP and call IDirect3DDevice9::DrawPrimitive for each individual quad, since they are not connected.
  2. Describe each quad by 6 vertices, use D3DPT_TRIANGLELIST and call IDirect3DDevice9::DrawPrimitive just once.

The first method uses less memory, while the second one requires only one draw call.

However, the second way seems to be feasible only if all the quads have the same texture, since otherwise a switch would be required.

  • 1
    \$\begingroup\$ Why not just try both and see what kind of performance you get? \$\endgroup\$
    – OmniOwl
    Aug 10, 2013 at 12:38
  • \$\begingroup\$ I hoped that somebody could share his experience. If this isn't the case or if a general answer is not possible, I will do my own tests of course. It's just that every tutorial recommends to use D3DPT_TRIANGLESTRIP instead of D3DPT_TRIANGLELIST, but I don't know if this applies to the case of separated sprites as well. \$\endgroup\$
    – ph4nt0m
    Aug 10, 2013 at 12:50
  • 2
    \$\begingroup\$ On stackexchange sites it's usually expected that you try your approach and then report in if it doesn't work or doesn't work as you expected it to and need answers. These kind of questions are usually a "try and see" :) \$\endgroup\$
    – OmniOwl
    Aug 10, 2013 at 12:55

1 Answer 1


Option 2 should be quicker.

Ideally you'd want to combine it with an index buffer and DrawIndexedPrimitive(). That way you'll get one draw call, and only need 4 vertices. The index buffer can be created once on start-up since it'll be exactly the same regardless of what the vertex data is, you just need to tell D3D how much of it to use.

Once you add textures, you'll probably end up with one draw call for each different texture you're using. This can be optimized further with a texture atlas if you really need to do so.

However, unless the quads are tiny, the number of vertices won't have a significant impact on performance, because the per pixel cost will be far higher. For example if there's any transparency in the texture then adding extra polygons so you draw fewer completely transparent pixels will generally make it go faster.

Of course the more optimized it is, the more code you need to write, so don't go overboard optimizing unless you're having performance problems, and a profiler tells you what the causes are.

  • \$\begingroup\$ +1, That's exactly the kind of answer I hoped for. Your explanation is very clear and does really help me a lot. Thank you! \$\endgroup\$
    – ph4nt0m
    Aug 10, 2013 at 22:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .