summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-09-09 15:15:31 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-09-09 15:23:12 -0700
commit6dcca5a308efd7a85caa52f970ed020926c487e9 (patch)
treeacb9a806833f255030a617168eb4904ef58478d8 /src
parent6fe1b479ca92b8abc7461d4be1c019bbefe0ef51 (diff)
glsl/builtins: normalize of a negative scalar should be -1.0.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/builtin_function.cpp2
-rw-r--r--src/glsl/builtins/ir/normalize2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index d897fa65ec..7e40cd7cc9 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -2138,7 +2138,7 @@ static const char *builtin_normalize =
" (signature float\n"
" (parameters\n"
" (declare (in) float arg0))\n"
- " ((return (constant float (1.0)))))\n"
+ " ((return (expression float sign (var_ref arg0)))))\n"
"\n"
" (signature vec2\n"
" (parameters\n"
diff --git a/src/glsl/builtins/ir/normalize b/src/glsl/builtins/ir/normalize
index 02b249a57f..0de0db0b64 100644
--- a/src/glsl/builtins/ir/normalize
+++ b/src/glsl/builtins/ir/normalize
@@ -2,7 +2,7 @@
(signature float
(parameters
(declare (in) float arg0))
- ((return (constant float (1.0)))))
+ ((return (expression float sign (var_ref arg0)))))
(signature vec2
(parameters