What is Nostr?
gentoobro /
npub1hap…jkkv
2024-09-14 05:32:47
in reply to nevent1q…qnpp

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".
Author Public Key
npub1hap4f3j40p06jdjde9yeh5k85sdvhw4p00mh3kthnq744j9y8zcsuvjkkv