gentoobro on Nostr: The proper OpenGL solution is to bind an array of all your textures once per frame ...
The proper OpenGL solution is to bind an array of all your textures once per frame and access them by index. Bindless textures can incur significant penalties on some hardware and driver combos. I ran into lots of performance voodoo trying to get it to work properly.
Underneath it all, the expensive thing is changing uniform values. Uniforms occupy a special section of cache in the GPU and swapping them out is costly. Vulkan exposes this directly with Descriptor Sets and lets you manually manage which parts are being changed and when. With OpenGL, you're at the mercy of the driver to maybe do something clever if you carefully abide by a bunch of unwritten rules and also the stars align. Hence "rebinding textures is expensive", though it should actually be "rebinding any uniforms will probably be expensive".
Underneath it all, the expensive thing is changing uniform values. Uniforms occupy a special section of cache in the GPU and swapping them out is costly. Vulkan exposes this directly with Descriptor Sets and lets you manually manage which parts are being changed and when. With OpenGL, you're at the mercy of the driver to maybe do something clever if you carefully abide by a bunch of unwritten rules and also the stars align. Hence "rebinding textures is expensive", though it should actually be "rebinding any uniforms will probably be expensive".