Sign in to follow this  

static or dynamic vertex buffers?

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

Hi I'm developing a 2d application using SlimDX. The app mostly renders textures, text and stuff like that. In general my vertex buffers dont change much. Some never change, some do change but perhaps every 20 frames Now i'm wondering what's gives the best performance. static vertex buffers or dynamic vertex buffers? I tried both on my pc and didnt notice any difference, but perhaps it will make a difference on other pcs / gpus ???

Share this post


Link to post
Share on other sites
What sort of frame rate are you getting? There's no point trying to test the difference at 10,000 FPS, you'll need to get it to drop to 20 or 30 FPS (With v-sync disabled) before you can really see if anything makes much difference.

How long is 20 frames? 0.3 seconds? And how much data are you copying into the vertex buffer each time?

This sounds like a bit of an edge case though where it won't make an awful lot of difference. I'm tempted to say just make them dynamic to be sure, but without meaningful profiling it's just a guess.

Share this post


Link to post
Share on other sites
>What sort of frame rate are you getting?
With vsync disabled i get around 50 fps.

>And how much data are you copying into the vertex buffer each time?
Most are simple rectangles so 4 vertices/buffer
for text its much more easily going up to 2000 vertices/buffer

>How long is 20 frames? 0.3 seconds?
yup


I would like to reach at least 60 fps since thats the refreshrate of the lcd screen

Another thing i'm wondering about is if performance will greatly improve if i merge all the small vertex buffers together into 1 big vertex buffer ?
(and perhaps all small textures in 1 big texture)

When done I will still need the same amount of DrawIndexPrimitive()
but i only need to set the vertex format & vertex buffer & texture 1 time

Then again most of the times i only do 10-20 DrawIndexedPrimitive() calls/frame

erwin

Share this post


Link to post
Share on other sites
Quote:
Original post by ebeckers
With vsync disabled i get around 50 fps.
I would like to reach at least 60 fps since thats the refreshrate of the lcd screen
If you don't notice any difference at that frame rate, you're unlikely to ever notice a difference. The only real way to be sure is to try it out on different hardware.

Quote:
Original post by ebeckers
Another thing i'm wondering about is if performance will greatly improve if i merge all the small vertex buffers together into 1 big vertex buffer ?
(and perhaps all small textures in 1 big texture)

When done I will still need the same amount of DrawIndexPrimitive()
but i only need to set the vertex format & vertex buffer & texture 1 time
It won't make much difference really - it's the number of batches (I.e. DrawIndexedPrimitive calls) that affect performance. Usually, the reason to combine VBs and textures like that is so you can make fewer DIP() calls; what are you doing that requires multiple calls?

Quote:
Original post by ebeckers
Then again most of the times i only do 10-20 DrawIndexedPrimitive() calls/frame
At 20 calls per frame, you're also not going to notice much difference really. If you had a few hundred, you might see a difference.

You'll need to use something like NVPerfHUD (With is NVidia only, or equivalent for an ATI card) to profile the GPU properly.

Share this post


Link to post
Share on other sites

This topic is 3094 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.

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