diff options
author | Brian Paul <brianp@vmware.com> | 2010-03-29 11:31:02 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-03-29 11:47:38 -0600 |
commit | 1cbd51068802a3aa530b9c12d86c40cb3a1bbfa4 (patch) | |
tree | 89230ed5c3b174f06e1221d53ac10b9964e3d407 | |
parent | ab0b9f80f45fcab55155b0a16b91a56ff4b3db1e (diff) |
glsl: avoid using rcp in length() functions
See prev commit for related info.
-rw-r--r-- | src/mesa/shader/slang/library/slang_common_builtin.gc | 6 |
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 3d464630df..d75354deff 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); } |