Max size of VertexBuffer

Started by
2 comments, last by jollyjeffers 18 years, 10 months ago
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]
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.
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?
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement