Skip to main content
gamedev.net
🔒 Locked

DrawPrimitive

Started by Klaatu 3 replies 450+ views
Original Post
Klaatu
Klaatu
I ran up against the MaxPrimitiveCount limit when trying to render a triangle list. I had 107k vertices in the vertex buffer and the device only allows 64k max primitives. So, I wrote a loop to render no more than 64k primitives at a time. I left the vertex buffer alone. It still contained 107k vertices. Still, the application crashes with this message: Direct3D9: (ERROR) rimitive count or vertex count is too big. Check device caps. What gives? Gort...Klaatu, Barada Nikto!
Gort...Klaatu, Barada Nikto!
Nik02
Nik02
In what part does it crash: At creation of the vertexbuffer, at SetStreamSource or at DrawPrimitive?

It may be that the card simply cannot address to more than 216 vertices.

-Nik

EDIT: Exponent formatting :D

[edited by - Nik02 on January 9, 2004 11:50:07 AM]
Niko Suni
Klaatu
Klaatu
It crashes at the DrawPrimitive call. I''ve used the debugger to look at the number of primitives to render and they''re less than 64k. However, the vertex buffer still has the entire 107k vertices. Using the caps viewer, the card says it can handle 64k primitives.

Gort...Klaatu, Barada Nikto!
Gort...Klaatu, Barada Nikto!
don
don
The number of vertices can''t exceed D3DCAPS9::MaxPrimitiveCount either. This is mentioned in the SDK docs.

MaxPrimitiveCount
...
This means that not only the number of primitives but also the number of vertices is limited by this value.

Nik02
Nik02
So that means that the card''s secondary geometry cache is overflown.

The only suitable action is to divide the geometry to multiple vertex buffers, not single one exceeding the card''s limits, and calling SetStreamSource (and appropriate rendering functions) on all of them individually.

-Nik
Niko Suni

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.