From ede60bc4670a8d9c14921c77abee1ac57fc0e6bf Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Thu, 6 Oct 2011 10:20:10 -0700 Subject: 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/profiles/130.frag | 2 -- src/glsl/builtins/profiles/130.vert | 2 -- 2 files changed, 4 deletions(-) (limited to 'src/glsl/builtins/profiles') diff --git a/src/glsl/builtins/profiles/130.frag b/src/glsl/builtins/profiles/130.frag index c121859f14c..1f212c16d67 100644 --- a/src/glsl/builtins/profiles/130.frag +++ b/src/glsl/builtins/profiles/130.frag @@ -288,7 +288,6 @@ vec2 smoothstep(float edge0, float edge1, vec2 x); vec3 smoothstep(float edge0, float edge1, vec3 x); vec4 smoothstep(float edge0, float edge1, vec4 x); -#if 0 bool isnan(float x); bvec2 isnan(vec2 x); bvec3 isnan(vec3 x); @@ -298,7 +297,6 @@ bool isinf(float x); bvec2 isinf(vec2 x); bvec3 isinf(vec3 x); bvec4 isinf(vec4 x); -#endif /* * 8.4 - Geometric Functions diff --git a/src/glsl/builtins/profiles/130.vert b/src/glsl/builtins/profiles/130.vert index ebd9a508851..df17ede3e80 100644 --- a/src/glsl/builtins/profiles/130.vert +++ b/src/glsl/builtins/profiles/130.vert @@ -288,7 +288,6 @@ vec2 smoothstep(float edge0, float edge1, vec2 x); vec3 smoothstep(float edge0, float edge1, vec3 x); vec4 smoothstep(float edge0, float edge1, vec4 x); -#if 0 bool isnan(float x); bvec2 isnan(vec2 x); bvec3 isnan(vec3 x); @@ -298,7 +297,6 @@ bool isinf(float x); bvec2 isinf(vec2 x); bvec3 isinf(vec3 x); bvec4 isinf(vec4 x); -#endif /* * 8.4 - Geometric Functions -- cgit v1.2.3