Ok I am removing distortion from images and then rectifying a stereo pair. I have two lookup maps using textures, 1 for the distortion map and one for the rectification map.
I first run a undistort kernel that uses the distortion map texture to create an undistorted image. I then want to bind that result to a new texture to use in a rectification kernel that will use the rectification map texture to fetch data in the undistort result texture. (I hope this makes sense)
I have it working but after ther undistor kernel I am doing the following on the host:
CUDA_SAFE_CALL( cudaMemcpyToArray( cu_arrayLu, 0, 0, dResultDatafL, RES_H*RES_V*sizeof(float4), cudaMemcpyDeviceToDevice)); CUDA_SAFE_CALL( cudaBindTextureToArray( tex_unImageL, cu_arrayLu, channelDesc32));
My question is whether I have to do the cudaMemcpyToArray() or can I just bind the undistort result memory directly to a texture? I tried just doing a cudaBindTexture() but I get black images back. I assume this is because I am doing 2D texture fetches on linear data.
I want to avoid the devicetodevice memcpy as it is a bottle neck (reduces speed by ~10Hz).