Maximum primitivecount

Hi all, I’m moving over to DirectX from OpenGL for my CAD program. Just found that there is a maximum primitivecount limit, I can easily have 1,000,000 plus verities (Circles and Arcs use a lot!). I’m using One big Vertex buffer, for every thing, before I start splitting things up I just want to make sure that I have not missed anything obvious and that I have no alternative. I very new to DirectX you see!

Cheers

Julian



Answer this question

Maximum primitivecount

  • yflie

    Talyrond wrote:

    Umm, seems that the MaxPrimitiveCount (which is 65535 according to caps) limit is actually the number of vertices not primitives!

    As the DirectX documentation states:

    MaxPrimitiveCount
    Maximum number of primitives for each DrawPrimitive call. There are two cases:
    • If MaxPrimitiveCount is not equal to 0xffff, you can draw at most MaxPrimitiveCount primitives with each draw call.
    • However, if MaxPrimitiveCount equals 0xffff, you can still draw at most MaxPrimitiveCount primitive, but you may also use no more than MaxPrimitiveCount unique vertices (since each primitive can potentially use three different vertices).

    Since 0xFFFF is equal to 65535 you'll also need to use this number as a vertex limit.


  • johnFromJersey

    Thanks Ralf, that will say me a lot of time!

    Cheers

    Julian


  • Jim Foster 2007

    Thanks Ross, I feel a lot happier now!
  • Nicklas Gummesson

    Umm, seems that the MaxPrimitiveCount (which is 65535 according to caps) limit is actually the number of vertices not primitives! my app draws erratically after 65535/2. I’m drawing LineLists, you see.

    Does this seem right, I’m a little concerned

    Thank you

    Julian


  • Daniel Chait

    MaxPrimitiveCount does not limit the size of your vertex buffers. It only limits the number of primitives you can draw with one call. In the case you objects have more primitives you can call DrawPrimitive multiple times with different StartVertex values.

    But in the case you use an index buffer too you should check MaxVertexIndex because you cannot use indices beyond this limit.



  • Maximum primitivecount