Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Oct 1999
Offline Last Active Sep 17 2016 10:52 AM

#5214791 glBindTexture - what is the technical reason that it is slow?

Posted by on 05 March 2015 - 12:36 PM

I've been looking all over the place for an answer to this question and I'm only getting bits and pieces of the answer. I learned the hard way a long time ago that calling glBindTexture is relatively slow; I found out from a friend of mine that it was because I was binding the texture every time I drew a triangle lol! The simple fact is that calling glBindTexture comes at a price, and minimizing calls is always the best choice!


Anyway, there's a reason it's slower than most other function calls that change the opengl states, and I'm looking for the technical answer.


So far, with my limited understanding of hardware in general, the main reason I think it's slow is because every time you call glBindTexture, the hardware copies the texture from Texture RAM into the Texture Cache because the Cache is faster to read from. Although the copy is fast in it's own right, copying larger textures should take longer than smaller textures, and if done enough times no matter the size of the texture, will become a performance bottleneck.


Yes/No? Is there more to it than that?