ivec and samplers

Is there a way to read an ivec from a sampler?


For example if I read a sample from a 16-Bit image, all the values return in the range of 0.0 ~ 1.0. However is there a way I could get them returned in the range of 0 ~ 65535, without having to multiply them?

Replies

It depends on the format of your image. If you choose a floating-point format such as

kCIFormatRGBAh
you should get the value directly when sampling.