It seems cleaner to me to unbind using glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)
and/or glBindBuffer(GL_ARRAY_BUFFER, 0)
at the end of a given draw call. I like being sure that nothing is bound that should not be; however, is there much of a performance hit to this?
Would anyone consider doing it the "clean" way to be at all useful? Or should I just go down the fast & sloppy route?
(Yes, I'm aware that the bound buffer object will be replaced by the next buffer object to be bound on that target, anyway -- whether in this or the next render update. And yes, I could do performance tests. But a quick human response would be nice.)
I would unbind for cleanliness while coding and then optimize it all away near release.
The benefits are that you can reorganize your code without worrying about state changes, but still have optimized state changes in the end. And you'll only be spending a fraction of the time on the actual optimization.
In terms of performance hit, if you've got thousands of additional unbind calls there will be some overhead, but it's unlikely that it'll be your bottleneck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With