PDA

View Full Version : General GPU Compute problem



Cgor_Cyrosly
11-14-2007, 12:05 AM
HI,if doing tensor operation on GPU use texture.The problem is that the return values of texture loopup in the range of [0,1] with RGBA mode.Whether`s non-normalized of the return sampling data if the data loaded to textures as arbitrary?If not ,how make the texture lookup not normalizing for the return values?
Thanks!!!

Zengar
11-14-2007, 02:32 AM
Use floating-point textures

Cgor_Cyrosly
11-14-2007, 09:31 AM
Thanks for Zengar!Your means with the internal format RGBA32F_ARB?

Zengar
11-14-2007, 10:01 AM
For example. The normal RGBA textures have 8 bits per channel. It is actually a fixed-point representation, with 255 -> 1.0 and 0 -> 0. That is why you can't pack a value greater then one into such texture.

Humus
11-14-2007, 02:55 PM
You may want to consider how much range and precision you need. Just because you need range outside [0..1] doesn't neccesarily mean RGBA8 won't do. You can pack and unpack to this range simply by a scale and bias. For instance it's common to use [-1..1] by doing texValue * 2.0 - 1.0. Depending on the distribution of your data it may be better to use fixed point than floating point. Fixed point has better precision than floating point if the data is generally linear in nature.

Cgor_Cyrosly
11-14-2007, 08:48 PM
Thanks!!!I know how to do this:use the extension ARB_float_texture and ARB_float_color_buffer.
^_^