summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-22 14:25:26 -0700
committerEric Anholt <[email protected]>2010-07-22 14:25:26 -0700
commite65dfa89eef86be127d788ecd5bd23c35c8fbbe4 (patch)
treedad1148347195064db7fad42fa2ed8befde7928a /src
parent8ec0b8187ea695353c75eed7314e86344df60e5a (diff)
glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float).
Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0). Fixes: glsl1-mix(vec4) function
Diffstat (limited to 'src')
-rw-r--r--src/glsl/builtin_function.cpp6
-rw-r--r--src/glsl/builtins/110/mix6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index 10e59e491e4..ae0eabcf778 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -1320,21 +1320,21 @@ static const char *builtins_110_mix = {
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1)\n"
" (declare (in) float arg2))\n"
- " ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n"
+ " ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n"
"\n"
" (signature vec3\n"
" (parameters\n"
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1)\n"
" (declare (in) float arg2))\n"
- " ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n"
+ " ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n"
"\n"
" (signature vec4\n"
" (parameters\n"
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1)\n"
" (declare (in) float arg2))\n"
- " ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n"
+ " ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n"
"))\n"
};
diff --git a/src/glsl/builtins/110/mix b/src/glsl/builtins/110/mix
index 032f29e5fa8..8638d06887c 100644
--- a/src/glsl/builtins/110/mix
+++ b/src/glsl/builtins/110/mix
@@ -32,19 +32,19 @@
(declare (in) vec2 arg0)
(declare (in) vec2 arg1)
(declare (in) float arg2))
- ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))
+ ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1)
(declare (in) float arg2))
- ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))
+ ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1)
(declare (in) float arg2))
- ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))
+ ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))
))