I plan to use an array of texture references…I understand that currently the texture reference variable has to be declared as static. So, maybe i am not able to dynamically allocate texture references like:
I think you will find that despite looking like a templated type, the compiler doesn’t support textures in arrays or structures or anything else that you might expect to be able to do with a type. Texture references currently have to be declared “statically” at file scope for everything to work. Amongst other things, nvcc is generating inline assembler for the texture read calls and it seems to require integral values resolvable during preprocessing or the first compiler pass work correctly.
Yes…i guess there is no way to use texture array as i found some old post in the forum mentioning about it. They suggest using a large texture to hold everything… I’ll try to work in this way, but i can imagine it should be hard for 3D textures…
BTW, I think the nvcc should add at least a warning in future version if people are declaring an array of textures.