summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/glsl/builtin_function.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index d96c15cb30..87ac0f79db 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -724,9 +724,7 @@ static const char *builtin_distance =
" (parameters\n"
" (declare (in) float p0)\n"
" (declare (in) float p1))\n"
- " ((declare () float p)\n"
- " (assign (constant bool (1)) (x) (var_ref p) (expression float - (var_ref p0) (var_ref p1)))\n"
- " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
+ " ((return (expression float - (var_ref p0) (var_ref p1)))))\n"
"\n"
" (signature float\n"
" (parameters\n"
@@ -760,7 +758,7 @@ static const char *builtin_dot =
" (parameters\n"
" (declare (in) float arg0)\n"
" (declare (in) float arg1))\n"
- " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n"
+ " ((return (expression float * (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature float\n"
" (parameters\n"
@@ -961,7 +959,7 @@ static const char *builtin_faceforward =
" (declare (in) float N)\n"
" (declare (in) float I)\n"
" (declare (in) float Nref))\n"
- " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n"
+ " ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0)))\n"
" ((return (var_ref N)))\n"
" ((return (expression float neg (var_ref N)))))))\n"
"\n"
@@ -1304,7 +1302,7 @@ static const char *builtin_length =
" (signature float\n"
" (parameters\n"
" (declare (in) float arg0))\n"
- " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n"
+ " ((return (var_ref arg0))))\n"
"\n"
" (signature float\n"
" (parameters\n"
@@ -2139,7 +2137,7 @@ static const char *builtin_normalize =
" (signature float\n"
" (parameters\n"
" (declare (in) float arg0))\n"
- " ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n"
+ " ((return (constant float (1.0)))))\n"
"\n"
" (signature vec2\n"
" (parameters\n"
@@ -2459,7 +2457,7 @@ static const char *builtin_reflect =
" (expression float *\n"
" (constant float (2.0))\n"
" (expression float *\n"
- " (expression float dot\n"
+ " (expression float *\n"
" (var_ref n)\n"
" (var_ref i))\n"
" (var_ref n)))))))\n"
@@ -2523,8 +2521,8 @@ static const char *builtin_refract =
" (expression float * (var_ref eta)\n"
" (expression float - (constant float (1.0))\n"
" (expression float * \n"
- " (expression float dot (var_ref n) (var_ref i))\n"
- " (expression float dot (var_ref n) (var_ref i))))))))\n"
+ " (expression float * (var_ref n) (var_ref i))\n"
+ " (expression float * (var_ref n) (var_ref i))))))))\n"
" (if (expression bool < (var_ref k) (constant float (0.0)))\n"
" ((return (constant float (0.0))))\n"
" ((return (expression float -\n"
@@ -2532,7 +2530,7 @@ static const char *builtin_refract =
" (expression float *\n"
" (expression float +\n"
" (expression float * (var_ref eta)\n"
- " (expression float dot (var_ref n) (var_ref i)))\n"
+ " (expression float * (var_ref n) (var_ref i)))\n"
" (expression float sqrt (var_ref k)))\n"
" (var_ref n))))))))\n"
"\n"