I'd like to make a video sampler than runs as an ISF shader.
I believe is possible by using persistent buffers.
My question is:
Is it possible to make arrays of textures, sometimes called "Opaque arrays", implemented in GLSL version 3.30 and above, and described here:
https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)
-----------------
Opaque arrays
Arrays of opaque types are special. Under GLSL version 3.30, Sampler arrays (the only opaque type 3.30 provides) can be declared, but they can only be accessed by compile-time integral Constant Expressions. So you cannot loop over an array of samplers, no matter what the array initializer, offset and comparison expressions are.
Under GLSL 4.00 and above, arrays of opaque can be accessed by non-compile-time constants, but there are still limitations. The expression used to access the array must be a Dynamically Uniform Expression. This means that the value used to access opaque arrays must be the same, in the same execution order, regardless of any non-uniform parameter values..
For example, in 4.00, it is legal to loop over an array of samplers, so long as the loop index is based on constants and uniforms. So this is legal:
uniform sampler images[10];
uniform int imageCount;
void main()
{
vec4 accum = vec4(0.0);
for(int i = 0; i < imageCount; i++)
{
accum += texture(images[i], ...);
}
}
This would add up all of the values in the textures, up to imageCount in size. Note that this is not legal in GLSL 3.30.