PDA

View Full Version : textures : re-binding vs keep to different units



babis
07-25-2008, 05:33 PM
Hello,

I have one minor question that has been bugging me for a while.
Say I have 10 textures used in 10 shaders, 1 tex/shader. These textures/shaders are all I use in my render loop.

Is it better to a) bind each one to, say, tex unit 0 when needed, or b) bind them once in tex units 0-9 & forget about them?

Provided that I have the available VRAM to store them, is there an advantage for the b) method?

Thanks,
babis

Zengar
07-25-2008, 11:55 PM
b) could be faster :) But you never know how the driver works. I personally see no disadvantage in using b) except it is kind of a hack :)

babis
07-26-2008, 04:27 AM
Thanks Zengar,

I'm using b) for the speed potential of no rebinding, but it can get pretty messy after a while with many textures :)