CUDA Texture Linear Filtering

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:07:55

问题


In the CUDA C Programming Guide Version 5, Appendix E.2 (Linear Filtering), it is stated that:

In this filtering mode, which is only available for floating-point textures, the value returned by the texture fetch is...

The part in bold case is confusing me. Does floating point mean the texel type only, or the return type also? For example, I declare 3 textures as follows.

texture<float,cudaTextureType2D> tex32f;
texture<unsigned char, cudaTextureType2D, cudaReadModeNormalizedFloat> tex8u;
texture<unsigned short, cudaTextureType2D, cudaReadModeNormalizedFloat> tex16u;

Is linear filtering available for tex32f only, or also for tex8u and tex16u?


回答1:


It means that linear filtering is available only when the "read mode" of the texture is cudaReadModeNormalizedFloat, i.e. integer types (such as u8) get promoted to floating point values in the range [0.0, 1.0] (for unsigned integers) or [-1.0, 1.0] (for signed integers).



来源:https://stackoverflow.com/questions/14112701/cuda-texture-linear-filtering

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!