Accessing texture bound to pitched memory.


I copied an image to pitched memory in the graphics card and bound the memory to a texture. We need to add 0.5 to the texture offsets to access exact pixels. I do it when I bind a texture to a cudaArray but what I am confused is do I have to add those 0.5 to the offsets when I bind the texture to pitched memory also ?

Anil Mahmud.

Whether you bound a texture to a CUDA array or (pitched) linear memory does not change how the texture is being accesses. The middle of each texel is at the half-integer increment either way.

Thank you for your quick answer :) that was very helpful.