开发者

How can we know what precision the I/O of GLSL functions use?

Apple says

Many built-in functions use medium-precision inputs and outputs. If your application provides low-precision floating-point values as parameters or assigns the results to a low-precision floating-point variable, the shader may have to include additional instructions to convert the values.

Where is this info开发者_StackOverflow社区rmation located? I didn't find it in the spec. (I've been using lowp all over the place, and have concerns about it after checking out the link at the top.)


I haven't used iPhone's implementation yet (just on WebGL and Android) but as i can see from the Apple snippet you posted, they are stating that their implementation uses mediump, so if you're using lowp then their implementation will have to convert those low precision floating point values to medium precision values (floating point conversion isn't like integer conversions, they have to adjust mantissas and exponents).

Remember that GLSL (or HLSL for DX11) shaders get compiled into implementation specific code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜