summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/library/slang_common_builtin.gc
diff options
context:
space:
mode:
authorJouk <joukj@tarantella.(none)>2007-06-08 13:38:24 +0200
committerJouk <joukj@tarantella.(none)>2007-06-08 13:38:24 +0200
commit55f8b7053065ce88296608071feed6f9540f6c0d (patch)
tree86ac301ed5805c895985040caf56f857de017233 /src/mesa/shader/slang/library/slang_common_builtin.gc
parent518f9168862b2096278ae14a65c8c854c208e004 (diff)
parent7b559a91028d297b34df9ec939bd4d00fad6027c (diff)
Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa/shader/slang/library/slang_common_builtin.gc')
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin.gc26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
index 04876ad155..45cf1c6fd0 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
@@ -471,28 +471,32 @@ vec4 pow(const vec4 a, const vec4 b)
float exp(const float a)
{
- __asm float_exp __retVal.x, a;
+ const float e = 2.71828;
+ __asm float_power __retVal, e, a;
}
vec2 exp(const vec2 a)
{
- __asm float_exp __retVal.x, a.x;
- __asm float_exp __retVal.y, a.y;
+ const float e = 2.71828;
+ __asm float_power __retVal.x, e, a.x;
+ __asm float_power __retVal.y, e, a.y;
}
vec3 exp(const vec3 a)
{
- __asm float_exp __retVal.x, a.x;
- __asm float_exp __retVal.y, a.y;
- __asm float_exp __retVal.z, a.z;
+ const float e = 2.71828;
+ __asm float_power __retVal.x, e, a.x;
+ __asm float_power __retVal.y, e, a.y;
+ __asm float_power __retVal.z, e, a.z;
}
vec4 exp(const vec4 a)
{
- __asm float_exp __retVal.x, a.x;
- __asm float_exp __retVal.y, a.y;
- __asm float_exp __retVal.z, a.z;
- __asm float_exp __retVal.w, a.w;
+ const float e = 2.71828;
+ __asm float_power __retVal.x, e, a.x;
+ __asm float_power __retVal.y, e, a.y;
+ __asm float_power __retVal.z, e, a.z;
+ __asm float_power __retVal.w, e, a.w;
}
@@ -894,7 +898,7 @@ vec4 mod(const vec4 a, const vec4 b)
__retVal.x = a.x - b.x * floor(a.x * oneOverBx);
__retVal.y = a.y - b.y * floor(a.y * oneOverBy);
__retVal.z = a.z - b.z * floor(a.z * oneOverBz);
- __retVal.w = a.w - b.w * floor(a.w * oneOverBz);
+ __retVal.w = a.w - b.w * floor(a.w * oneOverBw);
}