To reduce driver overhead, we can eliminate texture binding calls. All textures are uploaded into slices of an array texture. Each array texture will essentially be a bucket for {texture format, size, samples}. Each GLSL shader will contain an array of array textures, e.g.: uniform sampler2DArray u_DiffuseTextures[30]; and the texture to use can be identified by passing uniform integers to dynamically select the texture.
For HW that supports it, this can be taken even further by using either sparse textures, where all texture virtual memory is preallocated ahead of time, and then backed with physical memory as/when necessary.
Bindless textures are also an option where the texture handles are passed directly to the shader through a uniform, rather than binding each individual texture.
To reduce driver overhead, we can eliminate texture binding calls. All textures are uploaded into slices of an array texture. Each array texture will essentially be a bucket for {texture format, size, samples}. Each GLSL shader will contain an array of array textures, e.g.:
uniform sampler2DArray u_DiffuseTextures[30];
and the texture to use can be identified by passing uniform integers to dynamically select the texture.For HW that supports it, this can be taken even further by using either sparse textures, where all texture virtual memory is preallocated ahead of time, and then backed with physical memory as/when necessary.
Bindless textures are also an option where the texture handles are passed directly to the shader through a uniform, rather than binding each individual texture.