Mesa (gallium-0.2): replace 1.0/sqrt() with inversesqrt()

Brian Paul brianp at kemper.freedesktop.org
Fri Oct 10 18:08:26 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: b3a68b24bd601a4fcffb701bbd73864ed92a05e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3a68b24bd601a4fcffb701bbd73864ed92a05e1

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Fri Oct 10 12:04:49 2008 -0600

replace 1.0/sqrt() with inversesqrt()

---

 progs/glsl/CH11-bumpmap.frag |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/progs/glsl/CH11-bumpmap.frag b/progs/glsl/CH11-bumpmap.frag
index 063576f..e12c5d3 100644
--- a/progs/glsl/CH11-bumpmap.frag
+++ b/progs/glsl/CH11-bumpmap.frag
@@ -24,7 +24,7 @@ void main()
 
     float d, f;
     d = p.x * p.x + p.y * p.y;
-    f = 1.0 / sqrt(d + 1.0);
+    f = inversesqrt(d + 1.0);
 
     if (d >= BumpSize)
         { p = vec2(0.0); f = 1.0; }




More information about the mesa-commit mailing list