glsl: Add isinf() and isnan() builtins.
authorPaul Berry <stereotype441@gmail.com>
Thu, 6 Oct 2011 17:20:10 +0000 (10:20 -0700)
committerPaul Berry <stereotype441@gmail.com>
Mon, 31 Oct 2011 18:24:03 +0000 (11:24 -0700)
commitede60bc4670a8d9c14921c77abee1ac57fc0e6bf
treec545778fe124435a470d0958d60110a52863e242
parentb6f32bbe12e1082e78951b6ef073bf244ba0b8b7
glsl: Add isinf() and isnan() builtins.

The implementations are as follows:

isinf(x) = (abs(x) == +infinity)
isnan(x) = (x != x)

Note: the latter formula is not necessarily obvious.  It works because
NaN is the only floating point number that does not equal itself.

Fixes piglit tests "isinf-and-isnan fs_basic" and "isinf-and-isnan
vs_basic".
src/glsl/builtins/ir/isinf.ir [new file with mode: 0644]
src/glsl/builtins/ir/isnan.ir [new file with mode: 0644]
src/glsl/builtins/profiles/130.frag
src/glsl/builtins/profiles/130.vert