Thanks for the reply Wanderine; I think I may have already addressed the texture datatype with something along these lines:
//volumeRender_kernel.cu
typedef unsigned short ushort;
texture<ushort, 3, cudaReadModeNormalizedFloat> tex; // 3D texture
texture<float4, 1, cudaReadModeElementType> transferTex; // 1D transfer function
void initCuda(ushort *h_volume, cudaExtent volumeSize)
{
…
// set texture parameters
tex.normalized = true; // access with normalized texture coordinates
tex.filterMode = cudaFilterModeLinear; // linear interpolation
tex.addressMode[0] = cudaAddressModeClamp; // wrap texture coordinates
tex.addressMode[1] = cudaAddressModeClamp;
…
}
The 3D texture is what you’re referring to, I believe, it is what is bound to the d_VolumeArray:
// bind array to 3D texture
cutilSafeCall(cudaBindTextureToArray(tex, d_volumeArray, channelDesc));
I’ve looked at some other examples and the channelDesc looks okay when it is changed to a ushort:
cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc();
The problem still remains with the host to device memory transaction which uses this source pitched pointer:
//copyParams.srcPtr = make_cudaPitchedPtr((void*)h_volume, volumeSize.width*sizeof(ushort), volumeSize.width, volumeSize.height);
Where the volume dimensions are currently 32 X 32 X 32. The pitch should be 64 using * sizeof(ushort)… not sure what this has to do with anything, just following /DOCs & forum examples :rolleyes:
Thanks for the continued assistance, and also, I’d be happy to see the Matlab example (i’ll look for it here… let you know if I can’t locate it!).
TIA (again!)