Jump to content
  • Advertisement
Sign in to follow this  
Dragon_Strike

checking if its already binded?

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

sometimes when ur rendering alot of stuff u usually do a unnecessary bind for a texture or some buffer... since its already binded... how large of a performance penalty is it to "rebind" something thats all ready binded to the renderdevice? is it a good idea to keep track of what texture/buffer is currently binded and only bind if the one u want to bind differs from the currently binded?

Share this post


Link to post
Share on other sites
Advertisement
Binding a texture (or buffer) that's already bound has the same call overhead as every other command. DirectX calls as such have been known to be quite expensive for a long time, although I'm told that DX10 is a lot more efficient (haven't seen, can't tell). In OpenGL, it's not an issue.
Apart from that, it should have no measurable overhead, unless the driver writer was high.

If you only use only a small set of textures/buffers/whatever and the driver is reasonably smart, it is even possible that binding a different texture is a free (or almost free) operation. Graphic cards have a certain number of render state sets. If you don't exceed that limit, binding is (more or less) free.
The bad news is that there is no way of knowing if-when-what-how-many. The APIs doesn't have provisions to query such information.
Therefore, it's a good idea to assume that needless binding may always be expensive and avoid it when you can (you won't be able to avoid all of them anyway).

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!