From: Kenneth Graunke Date: Thu, 9 Sep 2010 22:15:31 +0000 (-0700) Subject: glsl/builtins: normalize of a negative scalar should be -1.0. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6dcca5a308efd7a85caa52f970ed020926c487e9;p=mesa.git glsl/builtins: normalize of a negative scalar should be -1.0. --- diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index d897fa65ec5..7e40cd7cc9c 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 02b249a57f8..0de0db0b648 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