I use CUDA 2.0 beta, and try to modify the smple project volumeRender.
The sample project use only one 3D texture for demo. But I want to use multiple volume for rendering.
When I try to declare the texture as texture array or a pointer of texture, the compile will return an error messenge:
identifier “tex” is undefined
It looks like that I can’t use a texture as a pointer, an can’t use a texture array?
How can I use multiple texture (the number of texture will decided in runtime) in CUDA? Can someone give me a suggest?
The original code is:
texture<unsigned char, 3, cudaReadModeNormalizedFloat> tex;
...
float sample = tex3D(tex, pos.x, pos.y, pos.z);
and the modified code:
texture<unsigned char, 3, cudaReadModeNormalizedFloat> *tex;
...
float sample = tex3D(*tex, pos.x, pos.y, pos.z);