Jump to content
  • Advertisement
Sign in to follow this  
thomahawk

Optimal use of VBOs?

This topic is 4586 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 have been looking through all the available literature on VBOs and it looks to me like all of the data within a VBO must use the same texture. From some tests I've done, it appears that using large numbers of small VBO's causes pretty bad stalls. Large VBOs are very efficient though. Am I correct in thinking that VBOs are only useful for large objects with the same texture? If there is only one triangle on the screen that uses a particular texture, is it more efficient to use glBegin...glEnd? (From my tests this seems true, but I'm hoping someone can verify with their own experience or more info!) -Thomas

Share this post


Link to post
Share on other sites
Advertisement
With modern graphics hardware it's important that your batch sizes (i.e. the amount of stuff you can draw with one draw call) are as large as possible to keep the total number of draw calls down. This is to ensure that your GPU can get lots of work queued up while the CPU gets on with other things. If you have small batches and lots of draw calls the CPU is spending all it's time doing draw calls and as they're small the GPU does them quickly and needs to wait around for the next one.

This document from ATI may be of interest to you, it's entitled 'OpenGL Performance Tuning. There's also this one which has the same title but it's from GDC 04 and the others from GDC 05.

Share this post


Link to post
Share on other sites
Here an excerpt from a thread about indexed tri strips

Quote:
Original post by phantom
Quote:
Original post by Basiror
And whats be optimal size of a VBO, I guess there are some limitations here and there.

would you align the VBOs to a power of two or more or less match the required buffer size?


VBO sizes should probably be a multiple of 32bytes, this fits into an AGP/PCIe transaction size and allows for efficant transfer across the bus. Granted, you dont have to be precies about this as the pre-T&L cache can cache things which go over that 32byte transfer, which helps if your vertices are spaceally coherant.

Optimal sizes vary a bit, I belive 6 to 8meg was the last agreed sweet spot, however less would be fine as well.


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!