summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-03-29 11:31:02 -0600
committerBrian Paul <[email protected]>2010-03-29 11:47:38 -0600
commit1cbd51068802a3aa530b9c12d86c40cb3a1bbfa4 (patch)
tree89230ed5c3b174f06e1221d53ac10b9964e3d407 /src/mesa/shader
parentab0b9f80f45fcab55155b0a16b91a56ff4b3db1e (diff)
glsl: avoid using rcp in length() functions
See prev commit for related info.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin.gc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
index 3d464630df2..d75354deffe 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
@@ -1160,7 +1160,7 @@ float length(const vec2 v)
float r;
const float p = dot(v, v); // p = v.x * v.x + v.y * v.y
__asm float_rsq r, p; // r = 1 / sqrt(p)
- __asm float_rcp __retVal.x, r; // retVal = 1 / r
+ __retVal = p * r; // p * r = sqrt(p);
}
float length(const vec3 v)
@@ -1168,7 +1168,7 @@ float length(const vec3 v)
float r;
const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + v.z * v.z
__asm float_rsq r, p; // r = 1 / sqrt(p)
- __asm float_rcp __retVal, r; // retVal = 1 / r
+ __retVal = p * r; // p * r = sqrt(p);
}
float length(const vec4 v)
@@ -1176,7 +1176,7 @@ float length(const vec4 v)
float r;
const float p = dot(v, v); // p = v.x * v.x + v.y * v.y + ...
__asm float_rsq r, p; // r = 1 / sqrt(p)
- __asm float_rcp __retVal, r; // retVal = 1 / r
+ __retVal = p * r; // p * r = sqrt(p);
}