From f03acfc7d7275b60418fec94f4a7044de486a05c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 May 2010 13:05:01 -0700 Subject: [PATCH] builtins: Add the mix(gentype, gentype, float) variant. The broken-in-mesa Regnum Online shader now parses, except for its preprocessor usage. --- builtin_function.cpp | 21 +++++++++++++++++++++ builtins/110/mix | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/builtin_function.cpp b/builtin_function.cpp index 1d847a6..b7719ab 100644 --- a/builtin_function.cpp +++ b/builtin_function.cpp @@ -1118,6 +1118,27 @@ static const char *builtins_110_mix = { " (declare (in) vec4 arg1)\n" " (declare (in) vec4 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" + "\n" + " (signature vec2\n" + " (parameters\n" + " (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" + "\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" + "\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" "))\n" }; diff --git a/builtins/110/mix b/builtins/110/mix index 6bdac74..032f29e 100644 --- a/builtins/110/mix +++ b/builtins/110/mix @@ -26,4 +26,25 @@ (declare (in) vec4 arg1) (declare (in) vec4 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)))))) + + (signature vec2 + (parameters + (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)))))) + + (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)))))) + + (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)))))) )) -- 2.7.4