So I'm trying to implement a material compositing system using Texture2DArrays and vector arrays indexed by a sample from a mask texture.
1.) Is it even possible to use a texture sample as an index into a uniform array?
2.) If it is, is there a huge performance hit?