Hello,
The CUDA C Programming Guide says:
Why is there this restriction? For example, if a 1-D texture has values (0, 4, 8, 12…) then the value at location 1.25 would be 5 if FilterModeLinear were supported – so why isn’t FilterModeLinear supported for integer return values?
Thanks,
This is a hardware restriction, no filtering for integer formats. There’s no reason you can’t just use the normalized formats and multiply by 255, though.
Thanks for the explanation of the restriction,
but I am sorry I don’t understand the suggested work-around: normalized refers to addressing mode, how would use of normalized coordinate system help with interpolation? Suppose the the example 1-D texture of 16 bit unsigned shorts with values {0, 4, 8, 12, …} has 100 elements; then address 1.25 would have normalized value of 0.0125, but the value returned will continue to be 4 (rather than the linearly interpolated 5) (and there would not be any need to multiply the returned value by anything). Please explain the workaround. Being able to linearly interpolate will save us amount of global memory used (16 bits rather than 32 bit floats).
and the work-around.