Archived

This topic is now archived and is closed to further replies.

VertexBuffer sizing

This topic is 4982 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

I''m messing around with particle systems, and from the tutorials and sample code, it looks like the creation of a VBuf often reserves more space than is actually used. Specifically, I''m looking at the second constructor, which takes the parameters Type, NumVerts, Device, Usage, Format, and Pool. I''ve seen NumVerts set as high as 2048, but later on the Lock call only pulls back something like 512 verts (based on the "ranks" parameter, the last one in the Lock method). Even the VertexBuffer.Lock documentation on MSDN shows this. The first example sets NumVerts to 200, but the Ranks array is only 3x2 elements. Does NumVerts actually allocate memory, or is it just some kind of upper-bounds checker? Is there any reason I shouldn''t try to more closely match NumVerts to the actual expected number of verts?

Share this post


Link to post
Share on other sites