Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

Max size of VertexBuffer

This topic is 4891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which member of the D3CAPS9 struct shows me the max size of a vertex buffer. Does that size indicate the total size of the sum of each element and its members in bytes or does it indicate the total number of elements? For example if the max is 65535 does that mean: 1) VertexBuffer[0].vPos (12bytes) VertexBuffer[0].float2 (8 bytes) VertexBuffer[0] = 20 bytes max size of VertexBuffer = 65535 / 20 OR does it simply mean: 2) VertexBuffer[0] - VertexBuffer[65534] is acceptable Also, MaxPrimitiveCount show 65535 MaxVertexIndex shows 65534 This is a little confusing, but does that mean my IndexBuffers can only be 65534 in size, that would only allow me to define a third that many triangles roughly. I am working on the terrain part of my game engine and I'm hitting a minor stumbling block now that I find I have to create multiple buffers cleanly in some case's. So I need these questions answered. Thanks, Halsafar [Edited by - Halsafar on May 31, 2005 10:57:16 PM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Also,
MaxPrimitiveCount show 65535
MaxVertexIndex shows 65534

This is a little confusing, but does that mean my IndexBuffers can only be 65534 in size, that would only allow me to define a third that many triangles roughly.
MaxPrimitiveCount is how many primitives you can draw in one call to Draw(Indexed)Primitive. They may be lines, triangles or point(sprite)s. I think MaxVertexIndex refers to the range of index values you can use in each render call. When drawing indexed primitives one of the parameters is an 'offset', this is added to every vertex index you pass in. e.g you send through indices {1,4,123,2000} with an offset of 5000 and the indices used into the vertex buffer are {5001,5004,5123,7000}. So if your vertex buffer has 100K vertices, you cannot index the first and last index in the same render call. Using indexed triangle lists you cannot draw more than 21,844 triangles in one go. Using triangle strips you can draw over 30,000 in one go.

The DX SDK should explain this quite well if memory serves.

Share this post


Link to post
Share on other sites
Okay, so there is no MAX size of a vertex buffer when I init it?

The limitations simply lie on how many Primitives I can draw per buffer and/or how many indices I use to render my primitives.


So if my max primitives count is 65535 and I am using triangelist then I can use (65535 * 3) vertices right?

Share this post


Link to post
Share on other sites
Quote:
Original post by Halsafar
Okay, so there is no MAX size of a vertex buffer when I init it?

You are limited by available resources (e.g. VRAM), but realistically speaking there isn't a limit if this is your primary/only resource...

Quote:
Original post by Halsafar
The limitations simply lie on how many Primitives I can draw per buffer and/or how many indices I use to render my primitives.

Yes!

Quote:
Original post by Halsafar
So if my max primitives count is 65535 and I am using triangelist then I can use (65535 * 3) vertices right?

Yes!

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!