I am wondering why I cannot have an array of textures. It seems logical to me that such a thing should be allowed, but I can’t seem to get my code to work with such a construct. It is as if the tex1D method is looking at the NAME of the first parameter, as if it were a string. The following is an example of my code, and the compile-time error that I receive.
// The following is globally defined texture<float2> tex; ... // The next line of code (called from within the kernel) throws the following exception in VS2008 // error C2440: '=' : cannot convert from 'texture<T,dim,mode>' to '__cuda_emu::__texture_type__' float2 result = tex1D(tex[idx], val);
I did find a post in the forums from 2007 that discussed this issue, but the person in that thread was receiving a different error, and made specific reference to CUDA v1.1. The link to that thread is http://forums.nvidia.com/lofiversion/index.php?t44424.html. I know that I could just make it a two-dimensional texture, but this seems unintuitive, and I am using normalized indexing, so I would have to convert the variable ‘idx’ from the code to ‘idx / (8 - 1)’, which seems ridiculous. Thanks for any help deciphering why my texture array is not valid,