Currently, having many bindless resident textures can cause a big performance overhead in the OpenGL driver. Just to give you a rough idea of scale, these are the numbers I am getting in my renderer:
| Count | Time |
|---|---|
| 0 | 0.5ms |
| 1_000 | 0.56ms |
| 2_000 | 7.8ms |
| 4_000 | 16.6ms |
| 8_000 | 58.8ms |
After the first ~1000 it goes downhill. I am not using the textures in any way, just creating and making resident.
I've made a minimal reproducible
with an empty render loop (no GL-calls). When you run it with shouldReproduce = true the FPS shown in the window title should be significantly lower than with shouldReproduce = false.
Note that the overhead in the minimal reproducible is not nearly as big as in my renderer but it's still there.
I wonder what is causing the overhead and wether it can be reduced.