Sign in to follow this  

checking if its already binded?

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

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