Sign in to follow this  
Krohm

D3D9CAPS::MaxPrimitiveCount bests me

Recommended Posts

Here's what I got of it: DrawPrimitives accepts a primitive count... which is just fine since drawing a partial primitive is simply wrong.
Quote:
From MSDN MaxPrimitiveCount Maximum number of primitives for each IDirect3DDevice9::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).
Ok so, if MaxPrimitiveCount is (ushort16)-1 I can draw up to 65k primitives in a batch, but I can also use up to 65k unique vertices. I see this still makes sense with 32bit indices (I may take them from a bigger buffer) however...
  1. If MaxPrimitiveCount is less than 0xFFFF, how many unique indices can I draw? For absurd, say I have 0xFFFE, then I'm still in the first condition... does this mean I can have more than 0xFFFF unique vertices? It doesn't make sense! Do I have to use at most MaxPrimitiveCount unique vertices?
  2. Say I have a massive amount of artwork and my uber-batching-like-crazy subsystem manages to build batches bigger than 65k vertices: DrawPrimitive takes a UINT which I believe to be 32bits... isn't this a bit ugly? I say this because on my tests 64K batches rendered fast like hell and I can only guess the more the better (I still have to test this however). Am I worring for nothing?
Thank you for aswering my dumb questions!

Share this post


Link to post
Share on other sites
The short answer to this is: MaxPrimitiveCount will never be less than 0xFFFF. Check the card caps doc in the SDK. Your program can still check for this and exit if you want, but there's no need to worry about this.

Besides, whoever designed this feature in the API should be taken out and shot.

Share this post


Link to post
Share on other sites
Quote:
Original post by ET3D
The short answer to this is: MaxPrimitiveCount will never be less than 0xFFFF. Check the card caps doc in the SDK. Your program can still check for this and exit if you want, but there's no need to worry about this.

I was suspecting this but it was just something I wanted to think about for completeness. I now see this is really an evolutionary artifact. I guess however the right thing is that
Quote:
Original post by ET3D
whoever designed this feature in the API should be taken out and shot.

I should really care less about those things.
Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this