I'm interested in selecting textures dynamically within a Vulkan shader (though maybe this question applies equally to OpenGL). I am presently emerging from a long process of being confused by the distinction between a single sampler2DArray
and an array of sampler2D
objects. The latter, it seems, cannot be dynamically (let alone non-uniformly) indexed unless certain features or extensions are reported by the graphics library to be supported.
But is it allowed to choose a layer from a sampler2DArray
in a dynamic, non-uniform way (that is, using completely arbitrary indices), on all hardware, regardless of reported feature support or extension presence? I think I am reading in some places that it is, but this is so confusing that I'd like to be told as explicitly as possible.