summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/glsl/builtin_function.cpp4
-rw-r--r--src/glsl/builtins/ir/distance2
-rw-r--r--src/glsl/builtins/ir/length2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index 11b96fdcbd..0a2b0120f2 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -724,7 +724,7 @@ static const char *builtin_distance =
" (parameters\n"
" (declare (in) float p0)\n"
" (declare (in) float p1))\n"
- " ((return (expression float - (var_ref p0) (var_ref p1)))))\n"
+ " ((return (expression float abs (expression float - (var_ref p0) (var_ref p1))))))\n"
"\n"
" (signature float\n"
" (parameters\n"
@@ -1302,7 +1302,7 @@ static const char *builtin_length =
" (signature float\n"
" (parameters\n"
" (declare (in) float arg0))\n"
- " ((return (var_ref arg0))))\n"
+ " ((return (expression float abs (var_ref arg0)))))\n"
"\n"
" (signature float\n"
" (parameters\n"
diff --git a/src/glsl/builtins/ir/distance b/src/glsl/builtins/ir/distance
index f73f755b32..7789ca6314 100644
--- a/src/glsl/builtins/ir/distance
+++ b/src/glsl/builtins/ir/distance
@@ -3,7 +3,7 @@
(parameters
(declare (in) float p0)
(declare (in) float p1))
- ((return (expression float - (var_ref p0) (var_ref p1)))))
+ ((return (expression float abs (expression float - (var_ref p0) (var_ref p1))))))
(signature float
(parameters
diff --git a/src/glsl/builtins/ir/length b/src/glsl/builtins/ir/length
index 3fc3103da1..b72334ee8a 100644
--- a/src/glsl/builtins/ir/length
+++ b/src/glsl/builtins/ir/length
@@ -2,7 +2,7 @@
(signature float
(parameters
(declare (in) float arg0))
- ((return (var_ref arg0))))
+ ((return (expression float abs (var_ref arg0)))))
(signature float
(parameters