Jump to content
  • Advertisement
Sign in to follow this  
Alex F

Optimal cDeviceBufferSize parameter for D3DX10CreateSprite

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

This is MSDN definition for D3DX10CreateSprite parameter:

cDeviceBufferSize

[in] The size of the vertex buffer, in number of sprites, that will be sent to the device when ID3DX10Sprite::Flush or ID3DX10Sprite::DrawSpritesImmediate is called. This should be a small number if you know you will be rendering a small number of sprites at a time (to save memory) and a large number if you know you will be rendering a large number of sprites at a time. The maximum value is 4096. If 0 is specified, the vertex buffer size will automatically be set to 4096.

My 3D scene contains exactly one sprite. Default 0 is translated to 4096, which doesn't look optimal in my case. So, what exactly "a small number" means, should it be 1 in my case?

Share this post


Link to post
Share on other sites
Advertisement
It's effectively the number of sprites that it will be able to batch into single draw call. So if you only ever draw one sprite then it should be 1, since any more would be a waste of memory. If you ever have more sprites that will use the same texture, then you should set that to the maximum number of times you would use a texture as a sprite during a frame (so that those sprites get batched together).

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!