From: Eric Anholt Date: Mon, 23 Aug 2010 19:39:35 +0000 (-0700) Subject: glsl: Regenerate builtins with the new sorting. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=47003a8f653db881fbafc96fca93aba38ea3ebc2;p=mesa.git glsl: Regenerate builtins with the new sorting. --- diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index b4138d0af76..517a6ad86d2 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -70,6 +70,55 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne return sh; } +static const char *builtin_abs = + "((function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0))\n" + " ((return (expression float abs (var_ref arg0)))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 abs (var_ref arg0)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 abs (var_ref arg0)))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 abs (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_acos = + "((function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (expression float - (constant float (1.5707963))\n" + " (call asin ((var_ref x)))))))\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 - (constant float (1.5707963))\n" + " (call asin ((var_ref x)))))))\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 - (constant float (1.5707963))\n" + " (call asin ((var_ref x)))))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 - (constant float (1.5707963))\n" + " (call asin ((var_ref x)))))))\n" + "))\n" + "" +; static const char *builtin_all = "((function all\n" " (signature bool\n" @@ -89,541 +138,569 @@ static const char *builtin_all = "))\n" "" ; -static const char *builtin_textureProj = - "((function textureProj\n" - " (signature vec4\n" +static const char *builtin_any = + "((function any\n" + " (signature bool\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" + " (declare (in) bvec2 arg0))\n" + " ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n" "\n" - " (signature ivec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" + " (declare (in) bvec3 arg0))\n" + " ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))))))\n" "\n" - " (signature uvec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) bvec4 arg0))\n" + " ((return (expression bool || (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0))))))\n" + "))\n" + "" +; +static const char *builtin_asin = + "((function asin\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) float x))\n" + " ((return (expression float *\n" + " (expression float sign (var_ref x))\n" + " (expression float -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression float *\n" + " (expression float sqrt\n" + " (expression float -\n" + " (constant float (1.0))\n" + " (expression float abs (var_ref x))))\n" + " (expression float +\n" + " (constant float (1.5707288))\n" + " (expression float *\n" + " (expression float abs (var_ref x))\n" + " (expression float +\n" + " (constant float (-0.2121144))\n" + " (expression float *\n" + " (constant float (0.0742610))\n" + " (expression float abs (var_ref x))))))))))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 *\n" + " (expression vec2 sign (var_ref x))\n" + " (expression vec2 -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression vec2 *\n" + " (expression vec2 sqrt\n" + " (expression vec2 -\n" + " (constant float (1.0))\n" + " (expression vec2 abs (var_ref x))))\n" + " (expression vec2 +\n" + " (constant float (1.5707288))\n" + " (expression vec2 *\n" + " (expression vec2 abs (var_ref x))\n" + " (expression vec2 +\n" + " (constant float (-0.2121144))\n" + " (expression vec2 *\n" + " (constant float (0.0742610))\n" + " (expression vec2 abs (var_ref x))))))))))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 *\n" + " (expression vec3 sign (var_ref x))\n" + " (expression vec3 -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression vec3 *\n" + " (expression vec3 sqrt\n" + " (expression vec3 -\n" + " (constant float (1.0))\n" + " (expression vec3 abs (var_ref x))))\n" + " (expression vec3 +\n" + " (constant float (1.5707288))\n" + " (expression vec3 *\n" + " (expression vec3 abs (var_ref x))\n" + " (expression vec3 +\n" + " (constant float (-0.2121144))\n" + " (expression vec3 *\n" + " (constant float (0.0742610))\n" + " (expression vec3 abs (var_ref x))))))))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 *\n" + " (expression vec4 sign (var_ref x))\n" + " (expression vec4 -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression vec4 *\n" + " (expression vec4 sqrt\n" + " (expression vec4 -\n" + " (constant float (1.0))\n" + " (expression vec4 abs (var_ref x))))\n" + " (expression vec4 +\n" + " (constant float (1.5707288))\n" + " (expression vec4 *\n" + " (expression vec4 abs (var_ref x))\n" + " (expression vec4 +\n" + " (constant float (-0.2121144))\n" + " (expression vec4 *\n" + " (constant float (0.0742610))\n" + " (expression vec4 abs (var_ref x))))))))))))\n" + "))\n" + "" +; +static const char *builtin_atan = + "((function atan\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) float x))\n" + " ((return (call asin ((expression float *\n" + " (var_ref x)\n" + " (expression float rsq\n" + " (expression float +\n" + " (expression float *\n" + " (var_ref x)\n" + " (var_ref x))\n" + " (constant float (1.0))))))))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec2 y_over_x))\n" + " ((return (call asin ((expression vec2 *\n" + " (var_ref y_over_x)\n" + " (expression vec2 rsq\n" + " (expression vec2 +\n" + " (expression vec2 *\n" + " (var_ref y_over_x)\n" + " (var_ref y_over_x))\n" + " (constant float (1.0))))))))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec3 y_over_x))\n" + " ((return (call asin ((expression vec3 *\n" + " (var_ref y_over_x)\n" + " (expression vec3 rsq\n" + " (expression vec3 +\n" + " (expression vec3 *\n" + " (var_ref y_over_x)\n" + " (var_ref y_over_x))\n" + " (constant float (1.0))))))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec4 y_over_x))\n" + " ((return (call asin ((expression vec4 *\n" + " (var_ref y_over_x)\n" + " (expression vec4 rsq\n" + " (expression vec4 +\n" + " (expression vec4 *\n" + " (var_ref y_over_x)\n" + " (var_ref y_over_x))\n" + " (constant float (1.0))))))))))\n" "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y)\n" + " (declare (in ) float x)\n" + " )\n" + " (\n" + " (declare () float r)\n" + " (declare ( ) float abs_retval)\n" + " (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) ))\n" + ") \n" + " (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) (\n" + " (declare ( ) float atan_retval)\n" + " (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))\n" + ") \n" + " (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) ) \n" + " (if (expression bool < (var_ref x) (constant float (0.000000)) ) (\n" + " (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (\n" + " (declare ( ) float assignment_tmp)\n" + " (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) \n" + " (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) \n" + " )\n" + " (\n" + " (declare ( ) float assignment_tmp)\n" + " (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) \n" + " (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) \n" + " ))\n" "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " )\n" + " (\n" + " ))\n" "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " )\n" + " (\n" + " (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (\n" + " (assign (constant bool (1)) (var_ref r) (constant float (1.570796)) ) \n" + " )\n" + " (\n" + " (assign (constant bool (1)) (var_ref r) (constant float (-1.570796)) ) \n" + " ))\n" "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + " ))\n" "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + " (return (var_ref r) )\n" + " ))\n" "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 x))\n" + " ((declare () vec2 r)\n" + " (assign (constant bool (1))\n" + " (swiz x (var_ref r))\n" + " (call atan ((swiz x (var_ref y))\n" + " (swiz x (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz y (var_ref r))\n" + " (call atan ((swiz y (var_ref y))\n" + " (swiz y (var_ref x)))))\n" + " (return (var_ref r))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 x))\n" + " ((declare () vec3 r)\n" + " (assign (constant bool (1))\n" + " (swiz x (var_ref r))\n" + " (call atan ((swiz x (var_ref y))\n" + " (swiz x (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz y (var_ref r))\n" + " (call atan ((swiz y (var_ref y))\n" + " (swiz y (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz z (var_ref r))\n" + " (call atan ((swiz z (var_ref y))\n" + " (swiz z (var_ref x)))))\n" + " (return (var_ref r))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 x))\n" + " ((declare () vec4 r)\n" + " (assign (constant bool (1))\n" + " (swiz x (var_ref r))\n" + " (call atan ((swiz x (var_ref y))\n" + " (swiz x (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz y (var_ref r))\n" + " (call atan ((swiz y (var_ref y))\n" + " (swiz y (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz z (var_ref r))\n" + " (call atan ((swiz z (var_ref y))\n" + " (swiz z (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz w (var_ref r))\n" + " (call atan ((swiz w (var_ref y))\n" + " (swiz w (var_ref x)))))\n" + " (return (var_ref r)))))\n" "\n" "))\n" "" ; -static const char *builtin_fwidth = - "((function fwidth\n" +static const char *builtin_ceil = + "((function ceil\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float +\n" - " (expression float abs (expression float dFdx (var_ref p)))\n" - " (expression float abs (expression float dFdy (var_ref p)))))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float ceil (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 +\n" - " (expression vec2 abs (expression vec2 dFdx (var_ref p)))\n" - " (expression vec2 abs (expression vec2 dFdy (var_ref p)))))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 ceil (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 +\n" - " (expression vec3 abs (expression vec3 dFdx (var_ref p)))\n" - " (expression vec3 abs (expression vec3 dFdy (var_ref p)))))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 ceil (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 +\n" - " (expression vec4 abs (expression vec4 dFdx (var_ref p)))\n" - " (expression vec4 abs (expression vec4 dFdy (var_ref p)))))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 ceil (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_texture2DProj = - "((function texture2DProj\n" - " (signature vec4\n" +static const char *builtin_clamp = + "((function clamp\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1)\n" + " (declare (in) float arg2))\n" + " ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1)\n" + " (declare (in) vec2 arg2))\n" + " ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1)\n" + " (declare (in) vec3 arg2))\n" + " ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_shadow1DProjLod = - "((function shadow1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1)\n" + " (declare (in) vec4 arg2))\n" + " ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture3DLod = - "((function texture3DLod\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) float arg1)\n" + " (declare (in) float arg2))\n" + " ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_textureCubeLod = - "((function textureCubeLod\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) float arg1)\n" + " (declare (in) float arg2))\n" + " ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture = - "((function texture\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) float arg1)\n" + " (declare (in) float arg2))\n" + " ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) int arg0)\n" + " (declare (in) int arg1)\n" + " (declare (in) int arg2))\n" + " ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1)\n" + " (declare (in) ivec2 arg2))\n" + " ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1)\n" + " (declare (in) ivec3 arg2))\n" + " ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1)\n" + " (declare (in) ivec4 arg2))\n" + " ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) int arg1)\n" + " (declare (in) int arg2))\n" + " ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) int arg1)\n" + " (declare (in) int arg2))\n" + " ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) int arg1)\n" + " (declare (in) int arg2))\n" + " ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) uint arg0)\n" + " (declare (in) uint arg1)\n" + " (declare (in) uint arg2))\n" + " ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1)\n" + " (declare (in) uvec2 arg2))\n" + " ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1)\n" + " (declare (in) uvec3 arg2))\n" + " ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1)\n" + " (declare (in) uvec4 arg2))\n" + " ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uint arg1)\n" + " (declare (in) uint arg2))\n" + " ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uint arg1)\n" + " (declare (in) uint arg2))\n" + " ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uint arg1)\n" + " (declare (in) uint arg2))\n" + " ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + "))\n" + "" +; +static const char *builtin_cos = + "((function cos\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) float angle))\n" + " ((return (expression float cos (var_ref angle)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) vec2 angle))\n" + " ((return (expression vec2 cos (var_ref angle)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 cos (var_ref angle)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" + " (declare (in) vec4 angle))\n" + " ((return (expression vec4 cos (var_ref angle)))))\n" + "))\n" + "" +; +static const char *builtin_cosh = + "((function cosh\n" + " (signature float\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" + " (declare (in) float x))\n" + " ((return (expression float * (constant float (0.5))\n" + " (expression float +\n" + " (expression float exp (var_ref x))\n" + " (expression float exp (expression float neg (var_ref x))))))))\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 * (constant vec2 (0.5))\n" + " (expression vec2 +\n" + " (expression vec2 exp (var_ref x))\n" + " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 * (constant vec3 (0.5))\n" + " (expression vec3 +\n" + " (expression vec3 exp (var_ref x))\n" + " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 * (constant vec4 (0.5))\n" + " (expression vec4 +\n" + " (expression vec4 exp (var_ref x))\n" + " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" + "))\n" + "" +; +static const char *builtin_cross = + "((function cross\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))\n" + "))\n" + "" +; +static const char *builtin_dFdx = + "((function dFdx\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) float p))\n" + " ((return (expression float dFdx (var_ref p)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec2 p))\n" + " ((return (expression vec2 dFdx (var_ref p)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec3 p))\n" + " ((return (expression vec3 dFdx (var_ref p)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) vec4 p))\n" + " ((return (expression vec4 dFdx (var_ref p)))))\n" + "))\n" + "" +; +static const char *builtin_dFdy = + "((function dFdy\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) float p))\n" + " ((return (expression float dFdy (var_ref p)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec2 p))\n" + " ((return (expression vec2 dFdy (var_ref p)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec3 p))\n" + " ((return (expression vec3 dFdy (var_ref p)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" + " (declare (in) vec4 p))\n" + " ((return (expression vec4 dFdy (var_ref p)))))\n" "))\n" "" ; @@ -651,1333 +728,1444 @@ static const char *builtin_degrees = "))\n" "" ; -static const char *builtin_texture2DArrayLod = - "((function texture2DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_ceil = - "((function ceil\n" +static const char *builtin_distance = + "((function distance\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float ceil (var_ref arg0)))))\n" + " (declare (in) float p0)\n" + " (declare (in) float p1))\n" + " ((declare () float p)\n" + " (assign (constant bool (1)) (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" "\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 ceil (var_ref arg0)))))\n" + " (declare (in) vec2 p0)\n" + " (declare (in) vec2 p1))\n" + " ((declare () vec2 p)\n" + " (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))\n" + " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" "\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 ceil (var_ref arg0)))))\n" + " (declare (in) vec3 p0)\n" + " (declare (in) vec3 p1))\n" + " ((declare () vec3 p)\n" + " (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))\n" + " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" "\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 ceil (var_ref arg0)))))\n" + " (declare (in) vec4 p0)\n" + " (declare (in) vec4 p1))\n" + " ((declare () vec4 p)\n" + " (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))\n" + " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" "))\n" "" ; -static const char *builtin_texture1D = - "((function texture1D\n" - " (signature vec4\n" +static const char *builtin_dot = + "((function dot\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_not = - "((function not\n" +static const char *builtin_equal = + "((function equal\n" " (signature bvec2\n" " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bvec2 ! (var_ref arg0)))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" " (parameters\n" - " (declare (in) bvec3 arg0))\n" - " ((return (expression bvec3 ! (var_ref arg0)))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bvec4 ! (var_ref arg0)))))\n" - "))\n" - "" -; -static const char *builtin_texture2DRectProj = - "((function texture2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - "))\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "))\n" "" ; -static const char *builtin_mod = - "((function mod\n" +static const char *builtin_exp = + "((function exp\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float exp (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 exp (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 exp (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 exp (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_exp2 = + "((function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0))\n" + " ((return (expression float exp2 (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 exp2 (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 exp2 (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 exp2 (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_radians = - "((function radians\n" +static const char *builtin_faceforward = + "((function faceforward\n" + " (signature float\n" + " (parameters\n" + " (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" + " ((return (var_ref N)))\n" + " ((return (expression float neg (var_ref N)))))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 N)\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 Nref))\n" + " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" + " ((return (var_ref N)))\n" + " ((return (expression vec2 neg (var_ref N)))))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 N)\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 Nref))\n" + " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" + " ((return (var_ref N)))\n" + " ((return (expression vec3 neg (var_ref N)))))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 N)\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 Nref))\n" + " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" + " ((return (var_ref N)))\n" + " ((return (expression vec4 neg (var_ref N)))))))\n" + "))\n" + "" +; +static const char *builtin_floor = + "((function floor\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (0.017453))))))\n" + " ((return (expression float floor (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (0.017453))))))\n" + " ((return (expression vec2 floor (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (0.017453))))))\n" + " ((return (expression vec3 floor (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n" + " ((return (expression vec4 floor (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_smoothstep = - "((function smoothstep\n" +static const char *builtin_fract = + "((function fract\n" " (signature float\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" " (declare (in) float x))\n" - " ((declare () float t)\n" - "\n" - " (assign (constant bool (1)) (var_ref t)\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n" + " ((return (expression float fract (var_ref x)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (declare () vec2 retval)\n" - "\n" - " (assign (constant bool (1)) (swiz x (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" - " (return (var_ref retval))\n" - " ))\n" + " ((return (expression vec2 fract (var_ref x)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (declare () vec3 retval)\n" - "\n" - " (assign (constant bool (1)) (swiz x (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz z (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" - " (return (var_ref retval))\n" - " ))\n" - "\n" + " ((return (expression vec3 fract (var_ref x)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (declare () vec4 retval)\n" - "\n" - " (assign (constant bool (1)) (swiz x (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz z (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" + " ((return (expression vec4 fract (var_ref x)))))\n" + "))\n" "\n" - " (assign (constant bool (1)) (swiz w (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n" - " (return (var_ref retval))\n" - " ))\n" + "" +; +static const char *builtin_ftransform = + "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" + " (declare (in) vec4 gl_Vertex)\n" + " (function ftransform\n" + " (signature vec4\n" + " (parameters)\n" + " ((return (expression vec4 *\n" + " (var_ref gl_ModelViewProjectionMatrix)\n" + " (var_ref gl_Vertex)))))\n" + "))\n" + "" +; +static const char *builtin_fwidth = + "((function fwidth\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ((return (expression float +\n" + " (expression float abs (expression float dFdx (var_ref p)))\n" + " (expression float abs (expression float dFdy (var_ref p)))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 max\n" - " (expression vec2 min\n" - " (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))\n" - " (constant vec2 (1.0 1.0)))\n" - " (constant vec2 (0.0 0.0))))))\n" + " (declare (in) vec2 p))\n" + " ((return (expression vec2 +\n" + " (expression vec2 abs (expression vec2 dFdx (var_ref p)))\n" + " (expression vec2 abs (expression vec2 dFdy (var_ref p)))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 max\n" - " (expression vec3 min\n" - " (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))\n" - " (constant vec3 (1.0 1.0 1.0)))\n" - " (constant vec3 (0.0 0.0 0.0))))))\n" + " (declare (in) vec3 p))\n" + " ((return (expression vec3 +\n" + " (expression vec3 abs (expression vec3 dFdx (var_ref p)))\n" + " (expression vec3 abs (expression vec3 dFdy (var_ref p)))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 max\n" - " (expression vec4 min\n" - " (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))\n" - " (constant vec4 (1.0 1.0 1.0 1.0)))\n" - " (constant vec4 (0.0 0.0 0.0 0.0))))))\n" + " (declare (in) vec4 p))\n" + " ((return (expression vec4 +\n" + " (expression vec4 abs (expression vec4 dFdx (var_ref p)))\n" + " (expression vec4 abs (expression vec4 dFdy (var_ref p)))))))\n" "))\n" - "\n" "" ; -static const char *builtin_textureProjGrad = - "((function textureProjGrad\n" - " (signature vec4\n" +static const char *builtin_greaterThan = + "((function greaterThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "))\n" + "" +; +static const char *builtin_greaterThanEqual = + "((function greaterThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_dFdx = - "((function dFdx\n" +static const char *builtin_inversesqrt = + "((function inversesqrt\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdx (var_ref p)))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float rsq (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 dFdx (var_ref p)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 rsq (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 dFdx (var_ref p)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 rsq (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 dFdx (var_ref p)))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 rsq (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_dFdy = - "((function dFdy\n" +static const char *builtin_length = + "((function length\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdy (var_ref p)))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" "\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 dFdy (var_ref p)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" "\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 dFdy (var_ref p)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" "\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 dFdy (var_ref p)))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" "))\n" "" ; -static const char *builtin_textureGrad = - "((function textureGrad\n" - " (signature vec4\n" +static const char *builtin_lessThan = + "((function lessThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "))\n" + "" +; +static const char *builtin_lessThanEqual = + "((function lessThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature ivec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" - " (signature uvec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_clamp = - "((function clamp\n" +static const char *builtin_log = + "((function log\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float log (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1)\n" - " (declare (in) vec2 arg2))\n" - " ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 log (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1)\n" - " (declare (in) vec3 arg2))\n" - " ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 log (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1)\n" - " (declare (in) vec4 arg2))\n" - " ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 log (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_log2 = + "((function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0))\n" + " ((return (expression float log2 (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 log2 (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 log2 (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" - "\n" - " (signature ivec2\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 log2 (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_matrixCompMult = + "((function matrixCompMult\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1)\n" - " (declare (in) ivec2 arg2))\n" - " ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) mat2 x)\n" + " (declare (in) mat2 y))\n" + " ((declare () mat2 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + "(return (var_ref z))))\n" "\n" - " (signature ivec3\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1)\n" - " (declare (in) ivec3 arg2))\n" - " ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) mat3 x)\n" + " (declare (in) mat3 y))\n" + " ((declare () mat3 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" + "(return (var_ref z))))\n" "\n" - " (signature ivec4\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1)\n" - " (declare (in) ivec4 arg2))\n" - " ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) mat4 x)\n" + " (declare (in) mat4 y))\n" + " ((declare () mat4 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n" + "(return (var_ref z))))\n" "\n" - " (signature ivec2\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) mat2x3 x)\n" + " (declare (in) mat2x3 y))\n" + " ((declare () mat2x3 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + "(return (var_ref z))))\n" "\n" - " (signature ivec3\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) mat3x2 x)\n" + " (declare (in) mat3x2 y))\n" + " ((declare () mat3x2 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" + "(return (var_ref z))))\n" "\n" - " (signature ivec4\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) mat2x4 x)\n" + " (declare (in) mat2x4 y))\n" + " ((declare () mat2x4 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + "(return (var_ref z))))\n" "\n" - " (signature uint\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat4x2 x)\n" + " (declare (in) mat4x2 y))\n" + " ((declare () mat4x2 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n" + "(return (var_ref z))))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat3x4 x)\n" + " (declare (in) mat3x4 y))\n" + " ((declare () mat3x4 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" + "(return (var_ref z))))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat4x3 x)\n" + " (declare (in) mat4x3 y))\n" + " ((declare () mat4x3 z)\n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" + " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n" + "(return (var_ref z))))\n" + "))\n" + "" +; +static const char *builtin_max = + "((function max\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature int\n" + " (parameters\n" + " (declare (in) int arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression int max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature ivec2\n" + " (parameters\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature ivec3\n" + " (parameters\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature ivec2\n" + " (parameters\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature ivec3\n" + " (parameters\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature uint\n" " (parameters\n" " (declare (in) uint arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) uint arg1))\n" + " ((return (expression uint max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature uvec2\n" " (parameters\n" " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1)\n" - " (declare (in) uvec2 arg2))\n" - " ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) uvec2 arg1))\n" + " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature uvec3\n" " (parameters\n" " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1)\n" - " (declare (in) uvec3 arg2))\n" - " ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) uvec3 arg1))\n" + " ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature uvec4\n" " (parameters\n" " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1)\n" - " (declare (in) uvec4 arg2))\n" - " ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) uvec4 arg1))\n" + " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature uvec2\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature uvec3\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char *builtin_texture2DRect = - "((function texture2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_cosh = - "((function cosh\n" +static const char *builtin_min = + "((function min\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float * (constant float (0.5))\n" - " (expression float +\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n" + "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 * (constant vec2 (0.5))\n" - " (expression vec2 +\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" + "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 * (constant vec3 (0.5))\n" - " (expression vec3 +\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 * (constant vec4 (0.5))\n" - " (expression vec4 +\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" - "))\n" - "" -; -static const char *builtin_texture1DArrayLod = - "((function texture1DArrayLod\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_asin = - "((function asin\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float *\n" - " (expression float sign (var_ref x))\n" - " (expression float -\n" - " (expression float *\n" - " (constant float (3.1415926))\n" - " (constant float (0.5)))\n" - " (expression float *\n" - " (expression float sqrt\n" - " (expression float -\n" - " (constant float (1.0))\n" - " (expression float abs (var_ref x))))\n" - " (expression float +\n" - " (constant float (1.5707288))\n" - " (expression float *\n" - " (expression float abs (var_ref x))\n" - " (expression float +\n" - " (constant float (-0.2121144))\n" - " (expression float *\n" - " (constant float (0.0742610))\n" - " (expression float abs (var_ref x))))))))))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec2\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 *\n" - " (expression vec2 sign (var_ref x))\n" - " (expression vec2 -\n" - " (expression float *\n" - " (constant float (3.1415926))\n" - " (constant float (0.5)))\n" - " (expression vec2 *\n" - " (expression vec2 sqrt\n" - " (expression vec2 -\n" - " (constant float (1.0))\n" - " (expression vec2 abs (var_ref x))))\n" - " (expression vec2 +\n" - " (constant float (1.5707288))\n" - " (expression vec2 *\n" - " (expression vec2 abs (var_ref x))\n" - " (expression vec2 +\n" - " (constant float (-0.2121144))\n" - " (expression vec2 *\n" - " (constant float (0.0742610))\n" - " (expression vec2 abs (var_ref x))))))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 *\n" - " (expression vec3 sign (var_ref x))\n" - " (expression vec3 -\n" - " (expression float *\n" - " (constant float (3.1415926))\n" - " (constant float (0.5)))\n" - " (expression vec3 *\n" - " (expression vec3 sqrt\n" - " (expression vec3 -\n" - " (constant float (1.0))\n" - " (expression vec3 abs (var_ref x))))\n" - " (expression vec3 +\n" - " (constant float (1.5707288))\n" - " (expression vec3 *\n" - " (expression vec3 abs (var_ref x))\n" - " (expression vec3 +\n" - " (constant float (-0.2121144))\n" - " (expression vec3 *\n" - " (constant float (0.0742610))\n" - " (expression vec3 abs (var_ref x))))))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 *\n" - " (expression vec4 sign (var_ref x))\n" - " (expression vec4 -\n" - " (expression float *\n" - " (constant float (3.1415926))\n" - " (constant float (0.5)))\n" - " (expression vec4 *\n" - " (expression vec4 sqrt\n" - " (expression vec4 -\n" - " (constant float (1.0))\n" - " (expression vec4 abs (var_ref x))))\n" - " (expression vec4 +\n" - " (constant float (1.5707288))\n" - " (expression vec4 *\n" - " (expression vec4 abs (var_ref x))\n" - " (expression vec4 +\n" - " (constant float (-0.2121144))\n" - " (expression vec4 *\n" - " (constant float (0.0742610))\n" - " (expression vec4 abs (var_ref x))))))))))))\n" - "))\n" - "" -; -static const char *builtin_texture1DProj = - "((function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) int arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_lessThan = - "((function lessThan\n" - " (signature bvec2\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec2\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) uint arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec2\n" + " (signature uvec2\n" " (parameters\n" " (declare (in) uvec2 arg0)\n" " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec3\n" + " (signature uvec3\n" " (parameters\n" " (declare (in) uvec3 arg0)\n" " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec4\n" + " (signature uvec4\n" " (parameters\n" " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "))\n" - "" -; -static const char *builtin_shadow2DProj = - "((function shadow2DProj\n" - " (signature vec4\n" + " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_textureLod = - "((function textureLod\n" - " (signature vec4\n" +static const char *builtin_mix = + "((function mix\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1)\n" + " (declare (in) float arg2))\n" + " ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2))))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1)\n" + " (declare (in) vec2 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 uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1)\n" + " (declare (in) vec3 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) sampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec4 arg0)\n" + " (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 ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\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 float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\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 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) samplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\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 float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n" "\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) float v1)\n" + " (declare (in) float v2)\n" + " (declare (in) bool a))\n" + " ((assign (var_ref a) (var_ref v1) (var_ref v2))\n" + " (return (var_ref v1))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec2 v1)\n" + " (declare (in) vec2 v2)\n" + " (declare (in) bvec2 a))\n" + " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" + " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" + " (return (var_ref v1))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec3 v1)\n" + " (declare (in) vec3 v2)\n" + " (declare (in) bvec3 a))\n" + " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" + " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" + " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" + " (return (var_ref v1))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" + " (declare (in) vec4 v1)\n" + " (declare (in) vec4 v2)\n" + " (declare (in) bvec4 a))\n" + " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" + " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" + " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" + " (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))\n" + " (return (var_ref v1))))\n" "))\n" "" ; -static const char *builtin_faceforward = - "((function faceforward\n" +static const char *builtin_mod = + "((function mod\n" " (signature float\n" " (parameters\n" - " (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" - " ((return (var_ref N)))\n" - " ((return (expression float neg (var_ref N)))))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" - " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression vec2 neg (var_ref N)))))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" - " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression vec3 neg (var_ref N)))))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression vec4 neg (var_ref N)))))))\n" - "))\n" - "" -; -static const char *builtin_abs = - "((function abs\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float abs (var_ref arg0)))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 abs (var_ref arg0)))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 abs (var_ref arg0)))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 abs (var_ref arg0)))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_log2 = - "((function log2\n" +static const char *builtin_noise1 = + "((function noise1\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log2 (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 log2 (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" + " (declare (in) float x))\n" + " ((return (constant float (0)))))\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 log2 (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" + " (declare (in) vec2 x))\n" + " ((return (constant float (0)))))\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 log2 (var_ref arg0)))))\n" - "))\n" - "" -; -static const char *builtin_shadow2DRect = - "((function shadow2DRect\n" - " (signature vec4\n" + " (declare (in) vec3 x))\n" + " ((return (constant float (0)))))\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" - "\n" + " (declare (in) vec4 x))\n" + " ((return (constant float (0)))))\n" "))\n" "" ; -static const char *builtin_lessThanEqual = - "((function lessThanEqual\n" - " (signature bvec2\n" +static const char *builtin_noise2 = + "((function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (constant vec2 (0 0)))))\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ((return (constant vec2 (0 0)))))\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (constant vec2 (0 0)))))\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ((return (constant vec2 (0 0)))))\n" + "))\n" + "" +; +static const char *builtin_noise3 = + "((function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (constant vec3 (0 0 0)))))\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ((return (constant vec3 (0 0 0)))))\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (constant vec3 (0 0 0)))))\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ((return (constant vec3 (0 0 0)))))\n" + "))\n" + "" +; +static const char *builtin_noise4 = + "((function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + "))\n" + "" +; +static const char *builtin_normalize = + "((function normalize\n" + " (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" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" + "))\n" + "" +; +static const char *builtin_not = + "((function not\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) bvec2 arg0))\n" + " ((return (expression bvec2 ! (var_ref arg0)))))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) bvec3 arg0))\n" + " ((return (expression bvec3 ! (var_ref arg0)))))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) bvec4 arg0))\n" + " ((return (expression bvec4 ! (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_notEqual = + "((function notEqual\n" + " (signature bvec2\n" " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -1985,9 +2173,9 @@ static const char *builtin_lessThanEqual = " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -1995,10 +2183,10 @@ static const char *builtin_lessThanEqual = " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -2006,8 +2194,8 @@ static const char *builtin_lessThanEqual = " (declare (in) ivec2 arg0)\n" " (declare (in) ivec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -2015,9 +2203,9 @@ static const char *builtin_lessThanEqual = " (declare (in) ivec3 arg0)\n" " (declare (in) ivec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -2025,10 +2213,10 @@ static const char *builtin_lessThanEqual = " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -2036,8 +2224,8 @@ static const char *builtin_lessThanEqual = " (declare (in) uvec2 arg0)\n" " (declare (in) uvec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -2045,9 +2233,9 @@ static const char *builtin_lessThanEqual = " (declare (in) uvec3 arg0)\n" " (declare (in) uvec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -2055,957 +2243,884 @@ static const char *builtin_lessThanEqual = " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_transpose = - "((function transpose\n" +static const char *builtin_outerProduct = + "((function outerProduct\n" " (signature mat2\n" " (parameters\n" - " (declare (in) mat2 m))\n" - " ((declare () mat2 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec2 u)\n" + " (declare (in) vec2 v))\n" + " ((declare () mat2 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" - " (signature mat3x2\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ((declare () mat3x2 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec3 u)\n" + " (declare (in) vec2 v))\n" + " ((declare () mat2x3 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" - " (signature mat4x2\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ((declare () mat4x2 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec4 u)\n" + " (declare (in) vec2 v))\n" + " ((declare () mat2x4 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" - " (signature mat2x3\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) mat3x2 m))\n" - " ((declare () mat2x3 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec2 u)\n" + " (declare (in) vec3 v))\n" + " ((declare () mat3x2 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" + " (return (var_ref m))\n" + " ))\n" "\n" " (signature mat3\n" " (parameters\n" - " (declare (in) mat3 m))\n" - " ((declare () mat3 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec3 u)\n" + " (declare (in) vec3 v))\n" + " ((declare () mat3 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" - " (signature mat4x3\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) mat3x4 m))\n" - " ((declare () mat4x3 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec4 u)\n" + " (declare (in) vec3 v))\n" + " ((declare () mat3x4 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" - " (signature mat2x4\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) mat4x2 m))\n" - " ((declare () mat2x4 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec2 u)\n" + " (declare (in) vec4 v))\n" + " ((declare () mat4x2 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" - " (signature mat3x4\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) mat4x3 m))\n" - " ((declare () mat3x4 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec3 u)\n" + " (declare (in) vec4 v))\n" + " ((declare () mat4x3 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))\n" + " (return (var_ref m))))\n" "\n" " (signature mat4\n" " (parameters\n" - " (declare (in) mat4 m))\n" - " ((declare () mat4 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) \n" - "(return (var_ref t))))\n" - ")\n" - "\n" - ")\n" - "\n" + " (declare (in) vec4 u)\n" + " (declare (in) vec4 v))\n" + " ((declare () mat4 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))\n" + " (return (var_ref m))))\n" + "))\n" "" ; -static const char *builtin_step = - "((function step\n" +static const char *builtin_pow = + "((function pow\n" " (signature float\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float pow (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" - " (return (var_ref t))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression vec2 pow (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n" - " (return (var_ref t))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 pow (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge)))))\n" - " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))\n" - " (return (var_ref t))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n" "))\n" - "\n" "" ; -static const char *builtin_sinh = - "((function sinh\n" +static const char *builtin_radians = + "((function radians\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float * (constant float (0.5))\n" - " (expression float -\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float * (var_ref arg0) (constant float (0.017453))))))\n" + "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 * (constant vec2 (0.5))\n" - " (expression vec2 -\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 * (var_ref arg0) (constant float (0.017453))))))\n" + "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 * (constant vec3 (0.5))\n" - " (expression vec3 -\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 * (var_ref arg0) (constant float (0.017453))))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 * (constant vec4 (0.5))\n" - " (expression vec4 -\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n" "))\n" "" ; -static const char *builtin_cos = - "((function cos\n" +static const char *builtin_reflect = + "((function reflect\n" " (signature float\n" " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float cos (var_ref angle)))))\n" + " (declare (in) float i)\n" + " (declare (in) float n))\n" + " ((return (expression float -\n" + " (var_ref i)\n" + " (expression float *\n" + " (constant float (2.0))\n" + " (expression float *\n" + " (expression float dot\n" + " (var_ref n)\n" + " (var_ref i))\n" + " (var_ref n)))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 cos (var_ref angle)))))\n" + " (declare (in) vec2 i)\n" + " (declare (in) vec2 n))\n" + " ((return (expression vec2 -\n" + " (var_ref i)\n" + " (expression vec2 *\n" + " (constant float (2.0))\n" + " (expression vec2 *\n" + " (expression float dot\n" + " (var_ref n)\n" + " (var_ref i))\n" + " (var_ref n)))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 cos (var_ref angle)))))\n" + " (declare (in) vec3 i)\n" + " (declare (in) vec3 n))\n" + " ((return (expression vec3 -\n" + " (var_ref i)\n" + " (expression vec3 *\n" + " (constant float (2.0))\n" + " (expression vec3 *\n" + " (expression float dot\n" + " (var_ref n)\n" + " (var_ref i))\n" + " (var_ref n)))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 cos (var_ref angle)))))\n" - "))\n" - "" -; -static const char *builtin_shadow2DProjLod = - "((function shadow2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_shadow2DArray = - "((function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_equal = - "((function equal\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "))\n" - "" -; -static const char *builtin_length = - "((function length\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "))\n" - "" -; -static const char *builtin_acos = - "((function acos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float - (constant float (1.5707963))\n" - " (call asin ((var_ref x)))))))\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 - (constant float (1.5707963))\n" - " (call asin ((var_ref x)))))))\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 - (constant float (1.5707963))\n" - " (call asin ((var_ref x)))))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 - (constant float (1.5707963))\n" - " (call asin ((var_ref x)))))))\n" - "))\n" - "" -; -static const char *builtin_matrixCompMult = - "((function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ((declare () mat2 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" - " ((declare () mat3 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" - " ((declare () mat4 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" - " ((declare () mat2x3 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" - " ((declare () mat3x2 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ((declare () mat2x4 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" - " ((declare () mat4x2 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n" - "(return (var_ref z))))\n" - "\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" - " ((declare () mat3x4 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" - "(return (var_ref z))))\n" + " (declare (in) vec4 i)\n" + " (declare (in) vec4 n))\n" + " ((return (expression vec4 -\n" + " (var_ref i)\n" + " (expression vec4 *\n" + " (constant float (2.0))\n" + " (expression vec4 *\n" + " (expression float dot\n" + " (var_ref n)\n" + " (var_ref i))\n" + " (var_ref n)))))))\n" "\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ((declare () mat4x3 z)\n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n" - " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n" - "(return (var_ref z))))\n" "))\n" "" ; -static const char *builtin_pow = - "((function pow\n" +static const char *builtin_refract = + "((function refract\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float pow (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) float i)\n" + " (declare (in) float n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (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" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant float (0.0))))\n" + " ((return (expression float -\n" + " (expression float * (var_ref eta) (var_ref i))\n" + " (expression float *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 pow (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec2 i)\n" + " (declare (in) vec2 n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (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" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant vec2 (0.0 0.0))))\n" + " ((return (expression vec2 -\n" + " (expression vec2 * (var_ref eta) (var_ref i))\n" + " (expression vec2 *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 pow (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec3 i)\n" + " (declare (in) vec3 n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (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" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant vec3 (0.0 0.0 0.0))))\n" + " ((return (expression vec3 -\n" + " (expression vec3 * (var_ref eta) (var_ref i))\n" + " (expression vec3 *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec4 i)\n" + " (declare (in) vec4 n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (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" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant vec4 (0.0 0.0 0.0 0.0))))\n" + " ((return (expression vec4 -\n" + " (expression vec4 * (var_ref eta) (var_ref i))\n" + " (expression vec4 *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" + "\n" "))\n" "" ; -static const char *builtin_texture2DProjLod = - "((function texture2DProjLod\n" +static const char *builtin_shadow1D = + "((function shadow1D\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" "\n" "))\n" "" ; -static const char *builtin_textureProjLod = - "((function textureProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" - "\n" +static const char *builtin_shadow1DArray = + "((function shadow1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" "\n" - " (signature ivec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" + " (declare (in) sampler1DArrayShadow sampler)\n" " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" "\n" - " (signature uvec4\n" + "))\n" + "" +; +static const char *builtin_shadow1DArrayLod = + "((function shadow1DArrayLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" + " (declare (in) sampler1DArrayShadow sampler)\n" " (declare (in) vec3 P) \n" " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" "\n" + "))\n" + "" +; +static const char *builtin_shadow1DLod = + "((function shadow1DLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P) \n" " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" "\n" - " (signature ivec4\n" + "))\n" + "" +; +static const char *builtin_shadow1DProj = + "((function shadow1DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" "\n" - " (signature uvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" + " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))\n" "\n" + "))\n" + "" +; +static const char *builtin_shadow1DProjLod = + "((function shadow1DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" + " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec4 P) \n" " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n" "\n" - " (signature ivec4\n" + "))\n" + "" +; +static const char *builtin_shadow2D = + "((function shadow2D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" "\n" - " (signature uvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" "\n" "))\n" "" ; -static const char *builtin_log = - "((function log\n" - " (signature float\n" +static const char *builtin_shadow2DArray = + "((function shadow2DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log (var_ref arg0)))))\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) ))))\n" "\n" - " (signature vec2\n" + "))\n" + "" +; +static const char *builtin_shadow2DLod = + "((function shadow2DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 log (var_ref arg0)))))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" "\n" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_shadow2DProj = + "((function shadow2DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 log (var_ref arg0)))))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 log (var_ref arg0)))))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_exp2 = - "((function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float exp2 (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" +static const char *builtin_shadow2DProjLod = + "((function shadow2DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp2 (var_ref arg0)))))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n" "\n" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_shadow2DRect = + "((function shadow2DRect\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp2 (var_ref arg0)))))\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" "\n" + "))\n" + "" +; +static const char *builtin_shadow2DRectProj = + "((function shadow2DRectProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 exp2 (var_ref arg0)))))\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_fract = - "((function fract\n" +static const char *builtin_sign = + "((function sign\n" " (signature float\n" " (parameters\n" " (declare (in) float x))\n" - " ((return (expression float fract (var_ref x)))))\n" + " ((return (expression float sign (var_ref x)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 x))\n" - " ((return (expression vec2 fract (var_ref x)))))\n" + " ((return (expression vec2 sign (var_ref x)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 x))\n" - " ((return (expression vec3 fract (var_ref x)))))\n" + " ((return (expression vec3 sign (var_ref x)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 x))\n" - " ((return (expression vec4 fract (var_ref x)))))\n" - "))\n" + " ((return (expression vec4 sign (var_ref x)))))\n" "\n" - "" -; -static const char *builtin_shadow1DLod = - "((function shadow1DLod\n" - " (signature vec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" + " (declare (in) int x))\n" + " ((return (expression int sign (var_ref x)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture1DLod = - "((function texture1DLod\n" - " (signature vec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) ivec2 x))\n" + " ((return (expression ivec2 sign (var_ref x)))))\n" + "\n" + " (signature ivec3\n" + " (parameters\n" + " (declare (in) ivec3 x))\n" + " ((return (expression ivec3 sign (var_ref x)))))\n" "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) ivec4 x))\n" + " ((return (expression ivec4 sign (var_ref x)))))\n" "))\n" + "\n" "" ; -static const char *builtin_texture2DArray = - "((function texture2DArray\n" - " (signature vec4\n" +static const char *builtin_sin = + "((function sin\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) float angle))\n" + " ((return (expression float sin (var_ref angle)))))\n" "\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec2 angle))\n" + " ((return (expression vec2 sin (var_ref angle)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 sin (var_ref angle)))))\n" "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ((return (expression vec4 sin (var_ref angle)))))\n" "))\n" "" ; -static const char *builtin_texture3DProj = - "((function texture3DProj\n" - " (signature vec4\n" +static const char *builtin_sinh = + "((function sinh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (expression float * (constant float (0.5))\n" + " (expression float -\n" + " (expression float exp (var_ref x))\n" + " (expression float exp (expression float neg (var_ref x))))))))\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 * (constant vec2 (0.5))\n" + " (expression vec2 -\n" + " (expression vec2 exp (var_ref x))\n" + " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 * (constant vec3 (0.5))\n" + " (expression vec3 -\n" + " (expression vec3 exp (var_ref x))\n" + " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 * (constant vec4 (0.5))\n" + " (expression vec4 -\n" + " (expression vec4 exp (var_ref x))\n" + " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" "))\n" "" ; -static const char *builtin_sign = - "((function sign\n" +static const char *builtin_smoothstep = + "((function smoothstep\n" " (signature float\n" " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" " (declare (in) float x))\n" - " ((return (expression float sign (var_ref x)))))\n" + " ((declare () float t)\n" + "\n" + " (assign (constant bool (1)) (var_ref t)\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n" "\n" " (signature vec2\n" " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" " (declare (in) vec2 x))\n" - " ((return (expression vec2 sign (var_ref x)))))\n" + " ((declare () vec2 t)\n" + " (declare () vec2 retval)\n" + "\n" + " (assign (constant bool (1)) (swiz x (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz y (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + " (return (var_ref retval))\n" + " ))\n" "\n" " (signature vec3\n" " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" " (declare (in) vec3 x))\n" - " ((return (expression vec3 sign (var_ref x)))))\n" + " ((declare () vec3 t)\n" + " (declare () vec3 retval)\n" + "\n" + " (assign (constant bool (1)) (swiz x (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz y (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz z (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" + " (return (var_ref retval))\n" + " ))\n" + "\n" "\n" " (signature vec4\n" " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" " (declare (in) vec4 x))\n" - " ((return (expression vec4 sign (var_ref x)))))\n" + " ((declare () vec4 t)\n" + " (declare () vec4 retval)\n" "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x))\n" - " ((return (expression int sign (var_ref x)))))\n" + " (assign (constant bool (1)) (swiz x (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" "\n" - " (signature ivec2\n" + " (assign (constant bool (1)) (swiz y (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz z (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz w (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n" + " (return (var_ref retval))\n" + " ))\n" + "\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) ivec2 x))\n" - " ((return (expression ivec2 sign (var_ref x)))))\n" + " (declare (in) vec2 edge0)\n" + " (declare (in) vec2 edge1)\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 max\n" + " (expression vec2 min\n" + " (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))\n" + " (constant vec2 (1.0 1.0)))\n" + " (constant vec2 (0.0 0.0))))))\n" "\n" - " (signature ivec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) ivec3 x))\n" - " ((return (expression ivec3 sign (var_ref x)))))\n" + " (declare (in) vec3 edge0)\n" + " (declare (in) vec3 edge1)\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 max\n" + " (expression vec3 min\n" + " (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))\n" + " (constant vec3 (1.0 1.0 1.0)))\n" + " (constant vec3 (0.0 0.0 0.0))))))\n" "\n" - " (signature ivec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 x))\n" - " ((return (expression ivec4 sign (var_ref x)))))\n" + " (declare (in) vec4 edge0)\n" + " (declare (in) vec4 edge1)\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 max\n" + " (expression vec4 min\n" + " (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))\n" + " (constant vec4 (1.0 1.0 1.0 1.0)))\n" + " (constant vec4 (0.0 0.0 0.0 0.0))))))\n" "))\n" "\n" "" ; -static const char *builtin_inversesqrt = - "((function inversesqrt\n" +static const char *builtin_sqrt = + "((function sqrt\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0))\n" - " ((return (expression float rsq (var_ref arg0)))))\n" + " ((return (expression float sqrt (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 rsq (var_ref arg0)))))\n" + " ((return (expression vec2 sqrt (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 rsq (var_ref arg0)))))\n" + " ((return (expression vec3 sqrt (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 rsq (var_ref arg0)))))\n" + " ((return (expression vec4 sqrt (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_distance = - "((function distance\n" +static const char *builtin_step = + "((function step\n" " (signature float\n" " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" - " ((declare () float p)\n" - " (assign (constant bool (1)) (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" + " (declare (in) float edge)\n" + " (declare (in) float x))\n" + " ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge))))))\n" "\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" - " ((declare () vec2 p)\n" - " (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))\n" - " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" + " (declare (in) float edge)\n" + " (declare (in) vec2 x))\n" + " ((declare () vec2 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" + " (return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" - " ((declare () vec3 p)\n" - " (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))\n" - " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" + " (declare (in) float edge)\n" + " (declare (in) vec3 x))\n" + " ((declare () vec3 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" + " (return (var_ref t))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) vec4 x))\n" + " ((declare () vec4 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))\n" + " (return (var_ref t))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 edge)\n" + " (declare (in) vec2 x))\n" + " ((declare () vec2 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" + " (return (var_ref t))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 edge)\n" + " (declare (in) vec3 x))\n" + " ((declare () vec3 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n" + " (return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ((declare () vec4 p)\n" - " (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))\n" - " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" + " (declare (in) vec4 edge)\n" + " (declare (in) vec4 x))\n" + " ((declare () vec4 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))\n" + " (return (var_ref t))))\n" "))\n" + "\n" "" ; -static const char *builtin_noise2 = - "((function noise2\n" - " (signature vec2\n" +static const char *builtin_tan = + "((function tan\n" + " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant vec2 (0 0)))))\n" + " (declare (in) float angle))\n" + " ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n" + "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant vec2 (0 0)))))\n" - " (signature vec2\n" + " (declare (in) vec2 angle))\n" + " ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n" + "\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant vec2 (0 0)))))\n" - " (signature vec2\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n" + "\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec2 (0 0)))))\n" + " (declare (in) vec4 angle))\n" + " ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n" "))\n" "" ; @@ -3054,50 +3169,246 @@ static const char *builtin_tanh = "))\n" "" ; -static const char *builtin_texture1DProjLod = - "((function texture1DProjLod\n" +static const char *builtin_texelFetch = + "((function texelFetch\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) int P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) int P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) int P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) ivec2 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) ivec2 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) ivec2 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) ivec3 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) ivec3 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) ivec3 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) ivec2 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) ivec2 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) ivec2 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) ivec3 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) ivec3 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) ivec3 P) \n" + " (declare (in) int lod) )\n" + " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + "\n" + "))\n" + "" +; +static const char *builtin_texture = + "((function texture\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture1DArray = - "((function texture1DArray\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) \n" " (declare (in) float bias) )\n" " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture2D = - "((function texture2D\n" - " (signature vec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" " (signature vec4\n" " (parameters\n" @@ -3106,1614 +3417,1303 @@ static const char *builtin_texture2D = " (declare (in) float bias) )\n" " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_greaterThanEqual = - "((function greaterThanEqual\n" - " (signature bvec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "))\n" - "" -; -static const char *builtin_texture3DProjLod = - "((function texture3DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_tan = - "((function tan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n" - "))\n" - "" -; -static const char *builtin_any = - "((function any\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bool\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) bvec3 arg0))\n" - " ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))))))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature bool\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bool || (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0))))))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_normalize = - "((function normalize\n" - " (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" - "\n" - " (signature vec2\n" +static const char *builtin_texture1D = + "((function texture1D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" "))\n" "" ; -static const char *builtin_shadow1DProj = - "((function shadow1DProj\n" +static const char *builtin_texture1DArray = + "((function texture1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P) \n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" "))\n" "" ; -static const char *builtin_floor = - "((function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float floor (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 floor (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 floor (var_ref arg0)))))\n" - "\n" +static const char *builtin_texture1DArrayLod = + "((function texture1DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 floor (var_ref arg0)))))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_cross = - "((function cross\n" - " (signature vec3\n" +static const char *builtin_texture1DLod = + "((function texture1DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_sqrt = - "((function sqrt\n" - " (signature float\n" +static const char *builtin_texture1DProj = + "((function texture1DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float sqrt (var_ref arg0)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" "\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 sqrt (var_ref arg0)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 sqrt (var_ref arg0)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 sqrt (var_ref arg0)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_mix = - "((function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (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) vec2 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) vec3 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" +static const char *builtin_texture1DProjLod = + "((function texture1DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (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 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 float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\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 float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature float\n" + "))\n" + "" +; +static const char *builtin_texture2D = + "((function texture2D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float v1)\n" - " (declare (in) float v2)\n" - " (declare (in) bool a))\n" - " ((assign (var_ref a) (var_ref v1) (var_ref v2))\n" - " (return (var_ref v1))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 v1)\n" - " (declare (in) vec2 v2)\n" - " (declare (in) bvec2 a))\n" - " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" - " (return (var_ref v1))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_texture2DArray = + "((function texture2DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 v1)\n" - " (declare (in) vec3 v2)\n" - " (declare (in) bvec3 a))\n" - " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" - " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" - " (return (var_ref v1))))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 v1)\n" - " (declare (in) vec4 v2)\n" - " (declare (in) bvec4 a))\n" - " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" - " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" - " (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))\n" - " (return (var_ref v1))))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_shadow1DArrayLod = - "((function shadow1DArrayLod\n" +static const char *builtin_texture2DArrayLod = + "((function texture2DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) sampler2DArray sampler)\n" " (declare (in) vec3 P) \n" " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" "))\n" "" ; -static const char *builtin_ftransform = - "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" - " (declare (in) vec4 gl_Vertex)\n" - " (function ftransform\n" +static const char *builtin_texture2DLod = + "((function texture2DLod\n" " (signature vec4\n" - " (parameters)\n" - " ((return (expression vec4 *\n" - " (var_ref gl_ModelViewProjectionMatrix)\n" - " (var_ref gl_Vertex)))))\n" - "))\n" - "" -; -static const char *builtin_sin = - "((function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float sin (var_ref angle)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 sin (var_ref angle)))))\n" - "\n" - " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 sin (var_ref angle)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 sin (var_ref angle)))))\n" "))\n" "" ; -static const char *builtin_shadow2D = - "((function shadow2D\n" +static const char *builtin_texture2DProj = + "((function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 P) \n" " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" "))\n" "" ; -static const char *builtin_shadow2DLod = - "((function shadow2DLod\n" +static const char *builtin_texture2DProjLod = + "((function texture2DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 P) \n" " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" "))\n" "" ; -static const char *builtin_shadow2DRectProj = - "((function shadow2DRectProj\n" +static const char *builtin_texture2DRect = + "((function texture2DRect\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" "))\n" "" ; -static const char *builtin_atan = - "((function atan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (call asin ((expression float *\n" - " (var_ref x)\n" - " (expression float rsq\n" - " (expression float +\n" - " (expression float *\n" - " (var_ref x)\n" - " (var_ref x))\n" - " (constant float (1.0))))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ((return (call asin ((expression vec2 *\n" - " (var_ref y_over_x)\n" - " (expression vec2 rsq\n" - " (expression vec2 +\n" - " (expression vec2 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0))))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ((return (call asin ((expression vec3 *\n" - " (var_ref y_over_x)\n" - " (expression vec3 rsq\n" - " (expression vec3 +\n" - " (expression vec3 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0))))))))))\n" - "\n" +static const char *builtin_texture2DRectProj = + "((function texture2DRectProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 y_over_x))\n" - " ((return (call asin ((expression vec4 *\n" - " (var_ref y_over_x)\n" - " (expression vec4 rsq\n" - " (expression vec4 +\n" - " (expression vec4 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0))))))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in ) float y)\n" - " (declare (in ) float x)\n" - " )\n" - " (\n" - " (declare () float r)\n" - " (declare ( ) float abs_retval)\n" - " (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) ))\n" - ") \n" - " (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) (\n" - " (declare ( ) float atan_retval)\n" - " (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))\n" - ") \n" - " (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) ) \n" - " (if (expression bool < (var_ref x) (constant float (0.000000)) ) (\n" - " (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (\n" - " (declare ( ) float assignment_tmp)\n" - " (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) \n" - " (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) \n" - " )\n" - " (\n" - " (declare ( ) float assignment_tmp)\n" - " (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) \n" - " (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) \n" - " ))\n" - "\n" - " )\n" - " (\n" - " ))\n" - "\n" - " )\n" - " (\n" - " (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (\n" - " (assign (constant bool (1)) (var_ref r) (constant float (1.570796)) ) \n" - " )\n" - " (\n" - " (assign (constant bool (1)) (var_ref r) (constant float (-1.570796)) ) \n" - " ))\n" - "\n" - " ))\n" - "\n" - " (return (var_ref r) )\n" - " ))\n" - "\n" - "\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 r)\n" - " (assign (constant bool (1))\n" - " (swiz x (var_ref r))\n" - " (call atan ((swiz x (var_ref y))\n" - " (swiz x (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz y (var_ref r))\n" - " (call atan ((swiz y (var_ref y))\n" - " (swiz y (var_ref x)))))\n" - " (return (var_ref r))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 r)\n" - " (assign (constant bool (1))\n" - " (swiz x (var_ref r))\n" - " (call atan ((swiz x (var_ref y))\n" - " (swiz x (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz y (var_ref r))\n" - " (call atan ((swiz y (var_ref y))\n" - " (swiz y (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz z (var_ref r))\n" - " (call atan ((swiz z (var_ref y))\n" - " (swiz z (var_ref x)))))\n" - " (return (var_ref r))))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 r)\n" - " (assign (constant bool (1))\n" - " (swiz x (var_ref r))\n" - " (call atan ((swiz x (var_ref y))\n" - " (swiz x (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz y (var_ref r))\n" - " (call atan ((swiz y (var_ref y))\n" - " (swiz y (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz z (var_ref r))\n" - " (call atan ((swiz z (var_ref y))\n" - " (swiz z (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz w (var_ref r))\n" - " (call atan ((swiz w (var_ref y))\n" - " (swiz w (var_ref x)))))\n" - " (return (var_ref r)))))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" "))\n" "" ; -static const char *builtin_max = - "((function max\n" - " (signature float\n" +static const char *builtin_texture3D = + "((function texture3D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_texture3DLod = + "((function texture3DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" + "))\n" + "" +; +static const char *builtin_texture3DProj = + "((function texture3DProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_texture3DProjLod = + "((function texture3DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" + "))\n" + "" +; +static const char *builtin_textureCube = + "((function textureCube\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature int\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression int max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature ivec2\n" + "))\n" + "" +; +static const char *builtin_textureCubeLod = + "((function textureCubeLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" - " (signature ivec3\n" + "))\n" + "" +; +static const char *builtin_textureGrad = + "((function textureGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uint\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uint max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char *builtin_reflect = - "((function reflect\n" - " (signature float\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + "\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float i)\n" - " (declare (in) float n))\n" - " ((return (expression float -\n" - " (var_ref i)\n" - " (expression float *\n" - " (constant float (2.0))\n" - " (expression float *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 i)\n" - " (declare (in) vec2 n))\n" - " ((return (expression vec2 -\n" - " (var_ref i)\n" - " (expression vec2 *\n" - " (constant float (2.0))\n" - " (expression vec2 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 i)\n" - " (declare (in) vec3 n))\n" - " ((return (expression vec3 -\n" - " (var_ref i)\n" - " (expression vec3 *\n" - " (constant float (2.0))\n" - " (expression vec3 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 i)\n" - " (declare (in) vec4 n))\n" - " ((return (expression vec4 -\n" - " (var_ref i)\n" - " (expression vec4 *\n" - " (constant float (2.0))\n" - " (expression vec4 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture3D = - "((function texture3D\n" - " (signature vec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" + " (declare (in) usampler2DArray sampler)\n" " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" "))\n" "" ; -static const char *builtin_texelFetch = - "((function texelFetch\n" +static const char *builtin_textureLod = + "((function textureLod\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" - " (declare (in) int P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) float P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" " (declare (in) isampler1D sampler)\n" - " (declare (in) int P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) float P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" " (declare (in) usampler1D sampler)\n" - " (declare (in) int P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) float P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" " (declare (in) isampler2D sampler)\n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" " (declare (in) usampler2D sampler)\n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" " (declare (in) isampler3D sampler)\n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" " (declare (in) usampler3D sampler)\n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1DArray sampler)\n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" " (declare (in) isampler1DArray sampler)\n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" " (declare (in) usampler1DArray sampler)\n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2DArray sampler)\n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" " (declare (in) isampler2DArray sampler)\n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" " (declare (in) usampler2DArray sampler)\n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" "))\n" "" ; -static const char *builtin_noise4 = - "((function noise4\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" +static const char *builtin_textureProj = + "((function textureProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" - "))\n" - "" -; -static const char *builtin_notEqual = - "((function notEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" - " (return (var_ref temp))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" "\n" - " (signature bvec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" "\n" - " (signature bvec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "))\n" - "" -; -static const char *builtin_outerProduct = - "((function outerProduct\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec2 v))\n" - " ((declare () mat2 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (return (var_ref m))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature mat2x3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec2 v))\n" - " ((declare () mat2x3 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" - " (return (var_ref m))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature mat2x4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec2 v))\n" - " ((declare () mat2x4 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" - " (return (var_ref m))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature mat3x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3x2 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))\n" - " ))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" "\n" - " (signature mat3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" "\n" - " (signature mat3x4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3x4 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" "\n" - " (signature mat4x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec4 v))\n" - " ((declare () mat4x2 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))\n" - " (return (var_ref m))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature mat4x3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec4 v))\n" - " ((declare () mat4x3 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))\n" - " (return (var_ref m))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" - " (signature mat4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec4 v))\n" - " ((declare () mat4 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))\n" - " (return (var_ref m))))\n" - "))\n" - "" -; -static const char *builtin_shadow1D = - "((function shadow1D\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P) \n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) \n" " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_noise1 = - "((function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant float (0)))))\n" - "))\n" - "" -; -static const char *builtin_refract = - "((function refract\n" - " (signature float\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float i)\n" - " (declare (in) float n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (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" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant float (0.0))))\n" - " ((return (expression float -\n" - " (expression float * (var_ref eta) (var_ref i))\n" - " (expression float *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" - " (signature vec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 i)\n" - " (declare (in) vec2 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (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" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec2 (0.0 0.0))))\n" - " ((return (expression vec2 -\n" - " (expression vec2 * (var_ref eta) (var_ref i))\n" - " (expression vec2 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" - " (signature vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 i)\n" - " (declare (in) vec3 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (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" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec3 (0.0 0.0 0.0))))\n" - " ((return (expression vec3 -\n" - " (expression vec3 * (var_ref eta) (var_ref i))\n" - " (expression vec3 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 i)\n" - " (declare (in) vec4 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (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" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec4 (0.0 0.0 0.0 0.0))))\n" - " ((return (expression vec4 -\n" - " (expression vec4 * (var_ref eta) (var_ref i))\n" - " (expression vec4 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_noise3 = - "((function noise3\n" - " (signature vec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " (signature vec3\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " (signature vec3\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " (signature vec3\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_min = - "((function min\n" - " (signature float\n" +static const char *builtin_textureProjGrad = + "((function textureProjGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uint\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uvec2\n" + "))\n" + "" +; +static const char *builtin_textureProjLod = + "((function textureProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char *builtin_textureCube = - "((function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" + " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_shadow1DArray = - "((function shadow1DArray\n" - " (signature vec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) usampler2D sampler)\n" " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_exp = - "((function exp\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float exp (var_ref arg0)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp (var_ref arg0)))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp (var_ref arg0)))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 exp (var_ref arg0)))))\n" - "))\n" - "" -; -static const char *builtin_greaterThan = - "((function greaterThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature bvec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature bvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" "\n" - " (signature bvec3\n" + "))\n" + "" +; +static const char *builtin_transpose = + "((function transpose\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) mat2 m))\n" + " ((declare () mat2 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature bvec4\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) mat2x3 m))\n" + " ((declare () mat3x2 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature bvec2\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) mat2x4 m))\n" + " ((declare () mat4x2 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature bvec3\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (declare (in) mat3x2 m))\n" + " ((declare () mat2x3 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" - "))\n" - "" -; -static const char *builtin_texture2DLod = - "((function texture2DLod\n" - " (signature vec4\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) mat3 m))\n" + " ((declare () mat3 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" + "(return (var_ref t))))\n" "\n" - "))\n" - "" -; -static const char *builtin_dot = - "((function dot\n" - " (signature float\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) mat3x4 m))\n" + " ((declare () mat4x3 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) mat4x2 m))\n" + " ((declare () mat2x4 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) mat4x3 m))\n" + " ((declare () mat3x4 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" - "))\n" + " (declare (in) mat4 m))\n" + " ((declare () mat4 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) \n" + "(return (var_ref t))))\n" + ")\n" + "\n" + ")\n" + "\n" "" ; -static const char *prototypes_for_120_vert = +static const char *prototypes_for_110_frag = "(\n" "(function radians\n" " (signature float\n" @@ -5434,10 +5434,6 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) vec4 x))\n" " ()))\n" - "(function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ()))\n" "(function faceforward\n" " (signature float\n" " (parameters\n" @@ -5524,119 +5520,6 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) mat4 x)\n" " (declare (in) mat4 y))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ()))\n" - "(function outerProduct\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec4 r))\n" - " ()))\n" - "(function transpose\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 m))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 m))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 m))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat3x2 m))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat4x2 m))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat4x3 m))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat3x4 m))\n" " ()))\n" "(function lessThan\n" " (signature bvec2\n" @@ -5898,6 +5781,12 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) float coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture1DProj\n" " (signature vec4\n" @@ -5909,32 +5798,30 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture1DProjLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture2D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec2 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture2DProj\n" " (signature vec4\n" @@ -5946,117 +5833,153 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture3D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture3DProj\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function texture3DLod\n" + "(function texture3DProj\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" + " (declare (in) vec4 coord))\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function textureCube\n" " (signature vec4\n" " (parameters\n" " (declare (in) samplerCube sampler)\n" " (declare (in) vec3 coord))\n" - " ()))\n" - "(function textureCubeLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) samplerCube sampler)\n" " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow1D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow2D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2DShadow sampler)\n" " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow1DProj\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec4 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow2DProj\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2DShadow sampler)\n" " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow1DLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function shadow2DLod\n" + "(function dFdx\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 p))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p))\n" " ()))\n" - "(function shadow1DProjLod\n" + "(function dFdy\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 p))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p))\n" " ()))\n" - "(function shadow2DProjLod\n" + "(function fwidth\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 p))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p))\n" " ()))\n" "(function noise1\n" " (signature float\n" @@ -6127,132 +6050,70 @@ static const char *prototypes_for_120_vert = " (declare (in) vec4 x))\n" " ())))" ; -static const char *functions_for_120_vert [] = { +static const char *functions_for_110_frag [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_matrixCompMult, - builtin_shadow2DProjLod, - builtin_noise2, - builtin_texture3DProjLod, - builtin_pow, - builtin_texture2DProj, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, + builtin_cos, + builtin_cross, + builtin_dFdx, + builtin_dFdy, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_shadow2DProj, - builtin_shadow1DProjLod, - builtin_any, - builtin_shadow1DProj, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_texture3DLod, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_shadow1DLod, - builtin_ftransform, - builtin_sin, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_transpose, - builtin_outerProduct, - builtin_ceil, - builtin_reflect, - builtin_textureCubeLod, - builtin_step, - builtin_texture1D, + builtin_fwidth, builtin_greaterThan, - builtin_texture3D, - builtin_not, - builtin_texture2DProjLod, + builtin_greaterThanEqual, builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, builtin_noise1, - builtin_refract, + builtin_noise2, builtin_noise3, - builtin_texture2DLod, - builtin_min, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_pow, builtin_radians, - builtin_smoothstep, - builtin_texture1DProjLod, - builtin_textureCube, - builtin_length, - builtin_texture1DLod, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, -}; -static const char *prototypes_for_EXT_texture_array_frag = - "(\n" - "(function texture1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_texture_array_frag [] = { - builtin_shadow2DArray, - builtin_shadow1DArray, - builtin_texture1DArray, - builtin_texture2DArray, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DProj, + builtin_shadow2D, + builtin_shadow2DProj, + builtin_sign, + builtin_sin, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DProj, + builtin_texture2D, + builtin_texture2DProj, + builtin_texture3D, + builtin_texture3DProj, + builtin_textureCube, }; static const char *prototypes_for_110_vert = "(\n" @@ -7556,80 +7417,80 @@ static const char *prototypes_for_110_vert = " ())))" ; static const char *functions_for_110_vert [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_matrixCompMult, - builtin_shadow2DProjLod, - builtin_noise2, - builtin_texture3DProjLod, - builtin_pow, - builtin_texture2DProj, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, + builtin_cos, + builtin_cross, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_shadow2DProj, - builtin_shadow1DProjLod, - builtin_any, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_texture3DLod, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_shadow1DLod, builtin_ftransform, - builtin_sin, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_shadow1DProj, - builtin_ceil, - builtin_reflect, - builtin_textureCubeLod, - builtin_step, - builtin_texture1D, builtin_greaterThan, - builtin_texture3D, - builtin_not, - builtin_texture2DProjLod, + builtin_greaterThanEqual, builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, builtin_noise1, - builtin_refract, + builtin_noise2, builtin_noise3, - builtin_texture2DLod, - builtin_min, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_pow, builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, builtin_texture1DProjLod, + builtin_texture2D, + builtin_texture2DLod, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, builtin_textureCube, - builtin_length, - builtin_texture1DLod, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, + builtin_textureCubeLod, }; -static const char *prototypes_for_110_frag = +static const char *prototypes_for_120_frag = "(\n" "(function radians\n" " (signature float\n" @@ -8399,43 +8260,156 @@ static const char *prototypes_for_110_frag = "(function refract\n" " (signature float\n" " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" + " (declare (in) float I)\n" + " (declare (in) float N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N)\n" + " (declare (in) float eta))\n" + " ()))\n" + "(function matrixCompMult\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) mat2 x)\n" + " (declare (in) mat2 y))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 x)\n" + " (declare (in) mat3 y))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 x)\n" + " (declare (in) mat4 y))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) mat2x3 x)\n" + " (declare (in) mat2x3 y))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat2x4 x)\n" + " (declare (in) mat2x4 y))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat3x2 x)\n" + " (declare (in) mat3x2 y))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat3x4 x)\n" + " (declare (in) mat3x4 y))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat4x2 x)\n" + " (declare (in) mat4x2 y))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat4x3 x)\n" + " (declare (in) mat4x3 y))\n" + " ()))\n" + "(function outerProduct\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec4 r))\n" + " ()))\n" + "(function transpose\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) mat2 m))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 m))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 m))\n" " ())\n" - " (signature vec2\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" + " (declare (in) mat3x2 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" + " (declare (in) mat2x3 m))\n" " ())\n" - " (signature vec4\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" + " (declare (in) mat4x2 m))\n" + " ())\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" + " (declare (in) mat2x4 m))\n" " ())\n" - " (signature mat3\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" + " (declare (in) mat4x3 m))\n" " ())\n" - " (signature mat4\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" + " (declare (in) mat3x4 m))\n" " ()))\n" "(function lessThan\n" " (signature bvec2\n" @@ -8966,129 +8940,74 @@ static const char *prototypes_for_110_frag = " (declare (in) vec4 x))\n" " ())))" ; -static const char *functions_for_110_frag [] = { +static const char *functions_for_120_frag [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_matrixCompMult, - builtin_noise2, - builtin_pow, - builtin_texture2DProj, - builtin_fwidth, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, + builtin_cos, + builtin_cross, + builtin_dFdx, + builtin_dFdy, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_any, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_shadow2DProj, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_dFdx, - builtin_sin, - builtin_shadow2D, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_shadow1DProj, - builtin_ceil, - builtin_reflect, - builtin_step, - builtin_texture1D, + builtin_fwidth, builtin_greaterThan, - builtin_texture3D, - builtin_not, + builtin_greaterThanEqual, builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, builtin_noise1, - builtin_refract, + builtin_noise2, builtin_noise3, - builtin_min, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_outerProduct, + builtin_pow, builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DProj, + builtin_shadow2D, + builtin_shadow2DProj, + builtin_sign, + builtin_sin, builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DProj, + builtin_texture2D, + builtin_texture2DProj, + builtin_texture3D, + builtin_texture3DProj, builtin_textureCube, - builtin_length, - builtin_dFdy, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, -}; -static const char *prototypes_for_EXT_texture_array_vert = - "(\n" - "(function texture1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture1DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture2DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow1DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_texture_array_vert [] = { - builtin_texture1DArrayLod, - builtin_shadow2DArray, - builtin_texture2DArrayLod, - builtin_shadow1DArrayLod, - builtin_shadow1DArray, - builtin_texture2DArray, - builtin_texture1DArray, + builtin_transpose, }; -static const char *prototypes_for_130_frag = +static const char *prototypes_for_120_vert = "(\n" "(function radians\n" " (signature float\n" @@ -9246,57 +9165,6 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) vec4 y_over_x))\n" " ()))\n" - "(function sinh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function cosh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function tanh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" "(function pow\n" " (signature float\n" " (parameters\n" @@ -9436,22 +9304,6 @@ static const char *prototypes_for_130_frag = " (signature vec4\n" " (parameters\n" " (declare (in) vec4 x))\n" - " ())\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x))\n" " ()))\n" "(function sign\n" " (signature float\n" @@ -9469,22 +9321,6 @@ static const char *prototypes_for_130_frag = " (signature vec4\n" " (parameters\n" " (declare (in) vec4 x))\n" - " ())\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x))\n" " ()))\n" "(function floor\n" " (signature float\n" @@ -9608,76 +9444,6 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) vec4 x)\n" " (declare (in) float y))\n" - " ())\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint x)\n" - " (declare (in) uint y))\n" - " ())\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" - " ())\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uint y))\n" - " ())\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uint y))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uint y))\n" " ()))\n" "(function max\n" " (signature float\n" @@ -9714,203 +9480,49 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) vec4 x)\n" " (declare (in) float y))\n" - " ())\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint x)\n" - " (declare (in) uint y))\n" - " ())\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" - " ())\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uint y))\n" - " ())\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uint y))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uint y))\n" " ()))\n" "(function clamp\n" " (signature float\n" " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 minVal)\n" - " (declare (in) ivec2 maxVal))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 minVal)\n" - " (declare (in) ivec3 maxVal))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 minVal)\n" - " (declare (in) ivec4 maxVal))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" - " ())\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) float x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature uvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 minVal)\n" - " (declare (in) uvec2 maxVal))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 minVal)\n" + " (declare (in) vec2 maxVal))\n" " ())\n" - " (signature uvec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 minVal)\n" - " (declare (in) uvec3 maxVal))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 minVal)\n" + " (declare (in) vec3 maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 minVal)\n" - " (declare (in) uvec4 maxVal))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 minVal)\n" + " (declare (in) vec4 maxVal))\n" " ())\n" - " (signature uvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature uvec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ()))\n" "(function mix\n" " (signature float\n" @@ -10116,6 +9728,10 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) vec4 x))\n" " ()))\n" + "(function ftransform\n" + " (signature vec4\n" + " (parameters)\n" + " ()))\n" "(function faceforward\n" " (signature float\n" " (parameters\n" @@ -10346,21 +9962,6 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) ivec4 x)\n" " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" " ()))\n" "(function lessThanEqual\n" " (signature bvec2\n" @@ -10392,21 +9993,6 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) ivec4 x)\n" " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" " ()))\n" "(function greaterThan\n" " (signature bvec2\n" @@ -10438,21 +10024,6 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) ivec4 x)\n" " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" " ()))\n" "(function greaterThanEqual\n" " (signature bvec2\n" @@ -10484,21 +10055,6 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) ivec4 x)\n" " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" " ()))\n" "(function equal\n" " (signature bvec2\n" @@ -10533,21 +10089,6 @@ static const char *prototypes_for_130_frag = " ())\n" " (signature bvec2\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" " (declare (in) bvec2 x)\n" " (declare (in) bvec2 y))\n" " ())\n" @@ -10594,21 +10135,6 @@ static const char *prototypes_for_130_frag = " ())\n" " (signature bvec2\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" " (declare (in) bvec2 x)\n" " (declare (in) bvec2 y))\n" " ())\n" @@ -10661,5761 +10187,5994 @@ static const char *prototypes_for_130_frag = " (parameters\n" " (declare (in) bvec4 x))\n" " ()))\n" - "(function texture\n" + "(function texture1D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" - " (declare (in) float P))\n" + " (declare (in) float coord))\n" + " ()))\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 coord))\n" " ())\n" - " (signature ivec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function texture1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature uvec4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord))\n" + " ()))\n" + "(function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function texture2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture3D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function texture3DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function texture3DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture3DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function textureCube\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function textureCubeLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P))\n" - " ())\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1D\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature ivec4\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow2D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature uvec4\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow1DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function shadow2DProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" - " (signature ivec4\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function shadow1DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" - " (signature uvec4\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" - " (signature ivec4\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" - " (signature uvec4\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function noise1\n" + " (signature float\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) float x))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 x))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ())))" +; +static const char *functions_for_120_vert [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, + builtin_clamp, + builtin_cos, + builtin_cross, + builtin_degrees, + builtin_distance, + builtin_dot, + builtin_equal, + builtin_exp, + builtin_exp2, + builtin_faceforward, + builtin_floor, + builtin_fract, + builtin_ftransform, + builtin_greaterThan, + builtin_greaterThanEqual, + builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, + builtin_mod, + builtin_noise1, + builtin_noise2, + builtin_noise3, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_outerProduct, + builtin_pow, + builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, + builtin_texture1DProjLod, + builtin_texture2D, + builtin_texture2DLod, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, + builtin_textureCube, + builtin_textureCubeLod, + builtin_transpose, +}; +static const char *prototypes_for_130_frag = + "(\n" + "(function radians\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float degrees))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 degrees))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 degrees))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 degrees))\n" + " ()))\n" + "(function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float radians))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 radians))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 radians))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 radians))\n" + " ()))\n" + "(function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 angle))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function cos\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 angle))\n" " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function tan\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) float angle))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 angle))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function asin\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 angle))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 angle))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 angle))\n" " ()))\n" - "(function textureProj\n" - " (signature vec4\n" + "(function atan\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) float y)\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) float y_over_x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 y_over_x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 y_over_x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec4 y_over_x))\n" + " ()))\n" + "(function sinh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function cosh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function tanh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 x))\n" " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function pow\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ()))\n" + "(function exp\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function sqrt\n" + " (signature float\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) float x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function textureLod\n" - " (signature vec4\n" + "(function inversesqrt\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float lod))\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) int x))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec3 x))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature uvec4\n" + " (declare (in) ivec4 x))\n" + " ()))\n" + "(function sign\n" + " (signature float\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) float x))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) int x))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec3 x))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec4 x))\n" + " ()))\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texelFetch\n" + " (declare (in) vec3 x))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) int P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function ceil\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) int P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) int P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ()))\n" + "(function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" - " ()))\n" - "(function textureProjLod\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) int x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) int y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uint x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature float\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature float\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uint y))\n" + " ())\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uint y))\n" " ()))\n" - "(function textureGrad\n" - " (signature vec4\n" + "(function max\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) int x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature float\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature float\n" + " (signature uint\n" " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) uint x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uint y))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uint y))\n" + " ()))\n" + "(function clamp\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) float x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function textureProjGrad\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 minVal)\n" + " (declare (in) vec2 maxVal))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 minVal)\n" + " (declare (in) vec3 maxVal))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 minVal)\n" + " (declare (in) vec4 maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) int x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 minVal)\n" + " (declare (in) ivec2 maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 minVal)\n" + " (declare (in) ivec3 maxVal))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 minVal)\n" + " (declare (in) ivec4 maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) uint x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 minVal)\n" + " (declare (in) uvec2 maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 minVal)\n" + " (declare (in) uvec3 maxVal))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 minVal)\n" + " (declare (in) uvec4 maxVal))\n" " ())\n" - " (signature float\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture1D\n" - " (signature vec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" + "(function mix\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord))\n" + " (declare (in) float x)\n" + " (declare (in) float y)\n" + " (declare (in) float a))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 a))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 a))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1DLod\n" - " (signature vec4\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 a))\n" + " ())\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture1DProjLod\n" - " (signature vec4\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y)\n" + " (declare (in) float a))\n" + " ())\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y)\n" + " (declare (in) float a))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y)\n" + " (declare (in) float a))\n" " ()))\n" - "(function texture2D\n" - " (signature vec4\n" + "(function step\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord))\n" + " (declare (in) float edge)\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" + " (declare (in) vec2 edge)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec3 edge)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec4 edge)\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) float edge)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DLod\n" + " (declare (in) float edge)\n" + " (declare (in) vec3 x))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float edge)\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function texture2DProjLod\n" - " (signature vec4\n" + "(function smoothstep\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" + " (declare (in) vec2 edge0)\n" + " (declare (in) vec2 edge1)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec3 edge0)\n" + " (declare (in) vec3 edge1)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" + " (declare (in) vec4 edge0)\n" + " (declare (in) vec4 edge1)\n" + " (declare (in) vec4 x))\n" + " ())\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DLod\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec3 x))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function texture3DProjLod\n" - " (signature vec4\n" + "(function length\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" + " (declare (in) float x))\n" + " ())\n" + " (signature float\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCubeLod\n" - " (signature vec4\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature float\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" + "(function distance\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) float p0)\n" + " (declare (in) float p1))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec2 p0)\n" + " (declare (in) vec2 p1))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 p0)\n" + " (declare (in) vec3 p1))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 p0)\n" + " (declare (in) vec4 p1))\n" " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" + "(function dot\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ()))\n" - "(function shadow1DLod\n" - " (signature vec4\n" + "(function cross\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ()))\n" - "(function shadow2DLod\n" - " (signature vec4\n" + "(function normalize\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DProjLod\n" - " (signature vec4\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DProjLod\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function dFdx\n" + "(function faceforward\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" + " (declare (in) float N)\n" + " (declare (in) float I)\n" + " (declare (in) float Nref))\n" " ())\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" + " (declare (in) vec2 N)\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 Nref))\n" " ())\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" + " (declare (in) vec3 N)\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 Nref))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p))\n" + " (declare (in) vec4 N)\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 Nref))\n" " ()))\n" - "(function dFdy\n" + "(function reflect\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" + " (declare (in) float I)\n" + " (declare (in) float N))\n" " ())\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N))\n" " ())\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p))\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N))\n" " ()))\n" - "(function fwidth\n" + "(function refract\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" + " (declare (in) float I)\n" + " (declare (in) float N)\n" + " (declare (in) float eta))\n" " ())\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N)\n" + " (declare (in) float eta))\n" " ())\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N)\n" + " (declare (in) float eta))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p))\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N)\n" + " (declare (in) float eta))\n" " ()))\n" - "(function noise1\n" - " (signature float\n" + "(function matrixCompMult\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) mat2 x)\n" + " (declare (in) mat2 y))\n" " ())\n" - " (signature float\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) mat3 x)\n" + " (declare (in) mat3 y))\n" " ())\n" - " (signature float\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) mat4 x)\n" + " (declare (in) mat4 y))\n" " ())\n" - " (signature float\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) mat2x3 x)\n" + " (declare (in) mat2x3 y))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat2x4 x)\n" + " (declare (in) mat2x4 y))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat3x2 x)\n" + " (declare (in) mat3x2 y))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat3x4 x)\n" + " (declare (in) mat3x4 y))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat4x2 x)\n" + " (declare (in) mat4x2 y))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat4x3 x)\n" + " (declare (in) mat4x3 y))\n" " ()))\n" - "(function noise2\n" - " (signature vec2\n" + "(function outerProduct\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec2 r))\n" " ())\n" - " (signature vec2\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec3 r))\n" " ())\n" - " (signature vec2\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec4 r))\n" " ())\n" - " (signature vec2\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec4 r))\n" " ()))\n" - "(function noise3\n" - " (signature vec3\n" + "(function transpose\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) mat2 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 m))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 m))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) mat3x2 m))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat2x3 m))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat4x2 m))\n" + " ())\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) mat2x4 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) mat4x3 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) mat3x4 m))\n" " ()))\n" - "(function noise4\n" - " (signature vec4\n" + "(function lessThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ())))" -; -static const char *functions_for_130_frag [] = { - builtin_all, - builtin_textureProj, - builtin_fwidth, - builtin_texture2DProj, - builtin_shadow1DProjLod, - builtin_texture3DLod, - builtin_mix, - builtin_texture, - builtin_degrees, - builtin_ceil, - builtin_texture1D, - builtin_not, - builtin_mod, - builtin_radians, - builtin_smoothstep, - builtin_textureProjGrad, - builtin_lessThan, - builtin_dFdy, - builtin_textureGrad, - builtin_clamp, - builtin_cosh, - builtin_asin, - builtin_texture1DProj, - builtin_dFdx, - builtin_shadow2DProj, - builtin_textureLod, - builtin_faceforward, - builtin_abs, - builtin_log2, - builtin_lessThanEqual, - builtin_transpose, - builtin_step, - builtin_sinh, - builtin_cos, - builtin_shadow2DProjLod, - builtin_equal, - builtin_length, - builtin_texelFetch, - builtin_matrixCompMult, - builtin_pow, - builtin_texture2DProjLod, - builtin_textureProjLod, - builtin_log, - builtin_exp2, - builtin_fract, - builtin_shadow1DLod, - builtin_texture1DLod, - builtin_greaterThan, - builtin_texture3DProj, - builtin_sign, - builtin_inversesqrt, - builtin_distance, - builtin_refract, - builtin_tanh, - builtin_texture1DProjLod, - builtin_texture2D, - builtin_greaterThanEqual, - builtin_texture3DProjLod, - builtin_tan, - builtin_any, - builtin_normalize, - builtin_shadow1DProj, - builtin_floor, - builtin_cross, - builtin_sqrt, - builtin_textureCubeLod, - builtin_sin, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_atan, - builtin_max, - builtin_reflect, - builtin_texture3D, - builtin_acos, - builtin_noise4, - builtin_notEqual, - builtin_outerProduct, - builtin_shadow1D, - builtin_noise1, - builtin_noise2, - builtin_noise3, - builtin_min, - builtin_textureCube, - builtin_exp, - builtin_texture2DLod, - builtin_dot, -}; -static const char *prototypes_for_ARB_texture_rectangle_vert = - "(\n" - "(function texture2DRect\n" - " (signature vec4\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DRectProj\n" - " (signature vec4\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow2DRect\n" - " (signature vec4\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function shadow2DRectProj\n" - " (signature vec4\n" + "(function lessThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_ARB_texture_rectangle_vert [] = { - builtin_texture2DRect, - builtin_shadow2DRectProj, - builtin_shadow2DRect, - builtin_texture2DRectProj, -}; -static const char *prototypes_for_130_vert = - "(\n" - "(function radians\n" - " (signature float\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float degrees))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 degrees))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 degrees))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 degrees))\n" - " ()))\n" - "(function degrees\n" - " (signature float\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) float radians))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 radians))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 radians))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 radians))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function sin\n" - " (signature float\n" + "(function greaterThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function cos\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 angle))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function tan\n" - " (signature float\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function asin\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 angle))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function acos\n" - " (signature float\n" + "(function equal\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function atan\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float y)\n" - " (declare (in) float x))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" - " (signature float\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) float y_over_x))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 y_over_x))\n" + " (declare (in) bvec2 x)\n" + " (declare (in) bvec2 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 y_over_x))\n" + " (declare (in) bvec3 x)\n" + " (declare (in) bvec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 y_over_x))\n" + " (declare (in) bvec4 x)\n" + " (declare (in) bvec4 y))\n" " ()))\n" - "(function sinh\n" - " (signature float\n" + "(function notEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function cosh\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function tanh\n" - " (signature float\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) bvec2 x)\n" + " (declare (in) bvec2 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) bvec3 x)\n" + " (declare (in) bvec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) bvec4 x)\n" + " (declare (in) bvec4 y))\n" " ()))\n" - "(function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" + "(function any\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) bvec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) bvec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) bvec4 x))\n" " ()))\n" - "(function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" + "(function all\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) bvec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) bvec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) bvec4 x))\n" " ()))\n" - "(function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" + "(function not\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) bvec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) bvec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) bvec4 x))\n" " ()))\n" - "(function exp2\n" - " (signature float\n" + "(function texture\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function abs\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) samplerCubeShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int x))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x))\n" - " ()))\n" - "(function sign\n" - " (signature float\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x))\n" - " ()))\n" - "(function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ceil\n" - " (signature float\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function fract\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" + " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) samplerCubeShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function min\n" - " (signature float\n" + "(function textureProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int x)\n" - " (declare (in) int y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) int y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) int y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) int y))\n" - " ())\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint x)\n" - " (declare (in) uint y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature uvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature uvec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature uvec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uint y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uint y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uint y))\n" - " ()))\n" - "(function max\n" - " (signature float\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" + " ())\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int x)\n" - " (declare (in) int y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) int y))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature ivec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) int y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function textureLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) int y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature uint\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uint x)\n" - " (declare (in) uint y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uint y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uint y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uint y))\n" - " ()))\n" - "(function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 minVal)\n" - " (declare (in) ivec2 maxVal))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 minVal)\n" - " (declare (in) ivec3 maxVal))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 minVal)\n" - " (declare (in) ivec4 maxVal))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature ivec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texelFetch\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) int P)\n" + " (declare (in) int lod))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) int minVal)\n" - " (declare (in) int maxVal))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) int P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature uint\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uint x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) int P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 minVal)\n" - " (declare (in) uvec2 maxVal))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 minVal)\n" - " (declare (in) uvec3 maxVal))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 minVal)\n" - " (declare (in) uvec4 maxVal))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uint minVal)\n" - " (declare (in) uint maxVal))\n" - " ()))\n" - "(function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y)\n" - " (declare (in) float a))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 a))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 a))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 a))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) float a))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) float a))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) float a))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ()))\n" - "(function step\n" - " (signature float\n" + "(function textureProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function length\n" - " (signature float\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function distance\n" - " (signature float\n" + "(function textureGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature float\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ()))\n" - "(function dot\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature float\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function cross\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ()))\n" - "(function normalize\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ()))\n" - "(function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ()))\n" - "(function reflect\n" " (signature float\n" " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N))\n" + " (declare (in) samplerCubeShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N))\n" - " ()))\n" - "(function refract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat2x3\n" + " (signature float\n" " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat2x4\n" + " (signature float\n" " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ())\n" - " (signature mat3x2\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" + " ()))\n" + "(function textureProjGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat3x4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat4x2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ()))\n" - "(function outerProduct\n" - " (signature mat2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec2 r))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec3 r))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec4 r))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat2x3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec2 r))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat3x2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec3 r))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat2x4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec2 r))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat4x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec4 r))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat3x4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec3 r))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature mat4x3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec4 r))\n" - " ()))\n" - "(function transpose\n" - " (signature mat2\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" + " ())\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat2 m))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature mat3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat3 m))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature mat4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat4 m))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature mat2x3\n" + " (signature float\n" " (parameters\n" - " (declare (in) mat3x2 m))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature mat3x2\n" + " (signature float\n" " (parameters\n" - " (declare (in) mat2x3 m))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" + " ()))\n" + "(function texture1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord))\n" " ())\n" - " (signature mat2x4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat4x2 m))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 coord))\n" " ())\n" - " (signature mat4x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat2x4 m))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord))\n" " ())\n" - " (signature mat3x4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat4x3 m))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature mat4x3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat3x4 m))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function lessThan\n" - " (signature bvec2\n" + "(function texture1DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture1DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function texture2DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function lessThanEqual\n" - " (signature bvec2\n" + "(function texture2DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture3D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function texture3DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" - " ())\n" - " (signature bvec3\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function texture3DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture3DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function greaterThan\n" - " (signature bvec2\n" + "(function textureCube\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function textureCubeLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow2D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function greaterThanEqual\n" - " (signature bvec2\n" + "(function shadow1DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function dFdx\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) float p))\n" " ())\n" - " (signature bvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) vec2 p))\n" " ())\n" - " (signature bvec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) vec3 p))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) vec4 p))\n" + " ()))\n" + "(function dFdy\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" " ())\n" - " (signature bvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) vec2 p))\n" " ())\n" - " (signature bvec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" + " (declare (in) vec3 p))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) vec4 p))\n" " ()))\n" - "(function equal\n" - " (signature bvec2\n" + "(function fwidth\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) float p))\n" " ())\n" - " (signature bvec3\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) vec2 p))\n" " ())\n" - " (signature bvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) vec3 p))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" + " (declare (in) vec4 p))\n" + " ()))\n" + "(function noise1\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) float x))\n" " ())\n" - " (signature bvec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature bvec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature bvec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" - " ())\n" - " (signature bvec4\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) float x))\n" " ())\n" - " (signature bvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature bvec3\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature bvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function notEqual\n" - " (signature bvec2\n" + "(function noise3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) float x))\n" " ())\n" - " (signature bvec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature bvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature bvec2\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ())))" +; +static const char *functions_for_130_frag [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, + builtin_clamp, + builtin_cos, + builtin_cosh, + builtin_cross, + builtin_dFdx, + builtin_dFdy, + builtin_degrees, + builtin_distance, + builtin_dot, + builtin_equal, + builtin_exp, + builtin_exp2, + builtin_faceforward, + builtin_floor, + builtin_fract, + builtin_fwidth, + builtin_greaterThan, + builtin_greaterThanEqual, + builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, + builtin_mod, + builtin_noise1, + builtin_noise2, + builtin_noise3, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_outerProduct, + builtin_pow, + builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, + builtin_sinh, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_tanh, + builtin_texelFetch, + builtin_texture, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, + builtin_texture1DProjLod, + builtin_texture2D, + builtin_texture2DLod, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, + builtin_textureCube, + builtin_textureCubeLod, + builtin_textureGrad, + builtin_textureLod, + builtin_textureProj, + builtin_textureProjGrad, + builtin_textureProjLod, + builtin_transpose, +}; +static const char *prototypes_for_130_vert = + "(\n" + "(function radians\n" + " (signature float\n" " (parameters\n" - " (declare (in) uvec2 x)\n" - " (declare (in) uvec2 y))\n" + " (declare (in) float degrees))\n" " ())\n" - " (signature bvec3\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec3 x)\n" - " (declare (in) uvec3 y))\n" + " (declare (in) vec2 degrees))\n" " ())\n" - " (signature bvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) uvec4 x)\n" - " (declare (in) uvec4 y))\n" + " (declare (in) vec3 degrees))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" + " (declare (in) vec4 degrees))\n" + " ()))\n" + "(function degrees\n" + " (signature float\n" " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" + " (declare (in) float radians))\n" " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function any\n" - " (signature bool\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) bvec2 x))\n" + " (declare (in) vec2 radians))\n" " ())\n" - " (signature bool\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) bvec3 x))\n" + " (declare (in) vec3 radians))\n" " ())\n" - " (signature bool\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec4 x))\n" + " (declare (in) vec4 radians))\n" " ()))\n" - "(function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" + "(function sin\n" + " (signature float\n" " (parameters\n" - " (declare (in) bvec3 x))\n" + " (declare (in) float angle))\n" " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function not\n" - " (signature bvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) bvec2 x))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature bvec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) bvec3 x))\n" + " (declare (in) vec3 angle))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec4 x))\n" + " (declare (in) vec4 angle))\n" " ()))\n" - "(function texture\n" - " (signature vec4\n" + "(function cos\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P))\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P))\n" + " (declare (in) vec3 angle))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature vec4\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function tan\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec3 angle))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function asin\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) float angle))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 angle))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P))\n" - " ())\n" - " (signature vec4\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function acos\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) float angle))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 angle))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec3 angle))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P))\n" - " ())\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function atan\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 P))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" + " (declare (in) float y)\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) float y_over_x))\n" " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 y_over_x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 y_over_x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 y_over_x))\n" + " ()))\n" + "(function sinh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function cosh\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) float x))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function tanh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function pow\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ()))\n" - "(function textureProj\n" - " (signature vec4\n" + "(function exp\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec3 x))\n" " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function inversesqrt\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) float x))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P))\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) int x))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) ivec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" + " (parameters\n" + " (declare (in) ivec3 x))\n" + " ())\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) ivec4 x))\n" + " ()))\n" + "(function sign\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) int x))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) ivec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) ivec3 x))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) ivec4 x))\n" + " ()))\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function textureLod\n" - " (signature vec4\n" + "(function ceil\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float lod))\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ()))\n" + "(function min\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) int x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texelFetch\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) int P)\n" - " (declare (in) int lod))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) int P)\n" - " (declare (in) int lod))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) int P)\n" - " (declare (in) int lod))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) int y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) uint x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uint y))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) ivec2 P)\n" - " (declare (in) int lod))\n" - " ())\n" - " (signature vec4\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uint y))\n" + " ()))\n" + "(function max\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) ivec3 P)\n" - " (declare (in) int lod))\n" - " ()))\n" - "(function textureProjLod\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) int x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) int y))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) int y))\n" " ())\n" - " (signature uvec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uint x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature float\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uint y))\n" " ())\n" - " (signature float\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float lod))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uint y))\n" + " ())\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uint y))\n" " ()))\n" - "(function textureGrad\n" - " (signature vec4\n" + "(function clamp\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) float x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 minVal)\n" + " (declare (in) vec2 maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 minVal)\n" + " (declare (in) vec3 maxVal))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 minVal)\n" + " (declare (in) vec4 maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec2 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec3 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature int\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) int x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 minVal)\n" + " (declare (in) ivec2 maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 minVal)\n" + " (declare (in) ivec3 maxVal))\n" " ())\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 minVal)\n" + " (declare (in) ivec4 maxVal))\n" " ())\n" - " (signature uvec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature float\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) int minVal)\n" + " (declare (in) int maxVal))\n" " ())\n" - " (signature float\n" + " (signature uint\n" " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) uint x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 minVal)\n" + " (declare (in) uvec2 maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 minVal)\n" + " (declare (in) uvec3 maxVal))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 minVal)\n" + " (declare (in) uvec4 maxVal))\n" " ())\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ())\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" " ())\n" " (signature uvec4\n" " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uint minVal)\n" + " (declare (in) uint maxVal))\n" + " ()))\n" + "(function mix\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) float x)\n" + " (declare (in) float y)\n" + " (declare (in) float a))\n" " ())\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function textureProjGrad\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 a))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 a))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 a))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y)\n" + " (declare (in) float a))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y)\n" + " (declare (in) float a))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y)\n" + " (declare (in) float a))\n" + " ()))\n" + "(function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec2 edge)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) vec3 edge)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec4 edge)\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) float edge)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) float edge)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) float edge)\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) float x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec2 edge0)\n" + " (declare (in) vec2 edge1)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" + " (declare (in) vec3 edge0)\n" + " (declare (in) vec3 edge1)\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) vec4 edge0)\n" + " (declare (in) vec4 edge1)\n" + " (declare (in) vec4 x))\n" " ())\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec3 x))\n" " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function length\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" + " (declare (in) float x))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture1D\n" - " (signature vec4\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" + "(function distance\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord))\n" + " (declare (in) float p0)\n" + " (declare (in) float p1))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec2 p0)\n" + " (declare (in) vec2 p1))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 p0)\n" + " (declare (in) vec3 p1))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1DLod\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p0)\n" + " (declare (in) vec4 p1))\n" " ()))\n" - "(function texture1DProjLod\n" - " (signature vec4\n" + "(function dot\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" + "(function cross\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ()))\n" + "(function normalize\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec3 x))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function texture2DLod\n" + "(function ftransform\n" " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" + " (parameters)\n" " ()))\n" - "(function texture2DProjLod\n" - " (signature vec4\n" + "(function faceforward\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float N)\n" + " (declare (in) float I)\n" + " (declare (in) float Nref))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" + " (declare (in) vec2 N)\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 Nref))\n" + " ())\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec3 N)\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 Nref))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 N)\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 Nref))\n" " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" + "(function reflect\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) float I)\n" + " (declare (in) float N))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DLod\n" - " (signature vec4\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N))\n" + " ())\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N))\n" " ()))\n" - "(function textureCube\n" - " (signature vec4\n" + "(function refract\n" + " (signature float\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) float I)\n" + " (declare (in) float N)\n" + " (declare (in) float eta))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCubeLod\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N)\n" + " (declare (in) float eta))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N)\n" + " (declare (in) float eta))\n" " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" + "(function matrixCompMult\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) mat2 x)\n" + " (declare (in) mat2 y))\n" " ())\n" - " (signature vec4\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" + " (declare (in) mat3 x)\n" + " (declare (in) mat3 y))\n" + " ())\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) mat4 x)\n" + " (declare (in) mat4 y))\n" " ())\n" - " (signature vec4\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" + " (declare (in) mat2x3 x)\n" + " (declare (in) mat2x3 y))\n" + " ())\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) mat2x4 x)\n" + " (declare (in) mat2x4 y))\n" " ())\n" - " (signature vec4\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DLod\n" - " (signature vec4\n" + " (declare (in) mat3x2 x)\n" + " (declare (in) mat3x2 y))\n" + " ())\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DLod\n" - " (signature vec4\n" + " (declare (in) mat3x4 x)\n" + " (declare (in) mat3x4 y))\n" + " ())\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DProjLod\n" - " (signature vec4\n" + " (declare (in) mat4x2 x)\n" + " (declare (in) mat4x2 y))\n" + " ())\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) mat4x3 x)\n" + " (declare (in) mat4x3 y))\n" " ()))\n" - "(function shadow2DProjLod\n" - " (signature vec4\n" + "(function outerProduct\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function noise1\n" - " (signature float\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec3 r))\n" " ())\n" - " (signature float\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec4 r))\n" " ())\n" - " (signature float\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec2 r))\n" " ())\n" - " (signature float\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise2\n" - " (signature vec2\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec2 r))\n" " ())\n" - " (signature vec2\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec4 r))\n" " ())\n" - " (signature vec2\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec3 r))\n" " ())\n" - " (signature vec2\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec4 r))\n" " ()))\n" - "(function noise3\n" - " (signature vec3\n" + "(function transpose\n" + " (signature mat2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) mat2 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat3\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) mat3 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) mat4 m))\n" " ())\n" - " (signature vec3\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise4\n" - " (signature vec4\n" + " (declare (in) mat3x2 m))\n" + " ())\n" + " (signature mat3x2\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) mat2x3 m))\n" " ())\n" - " (signature vec4\n" + " (signature mat2x4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) mat4x2 m))\n" " ())\n" - " (signature vec4\n" + " (signature mat4x2\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) mat2x4 m))\n" " ())\n" - " (signature vec4\n" + " (signature mat3x4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ())))" -; -static const char *functions_for_130_vert [] = { - builtin_clamp, - builtin_shadow2DLod, - builtin_matrixCompMult, - builtin_textureProj, - builtin_noise2, - builtin_texture3DProjLod, - builtin_pow, - builtin_texture2DProj, - builtin_greaterThanEqual, - builtin_cosh, - builtin_texture3DProj, - builtin_textureProjLod, - builtin_texture, - builtin_texture2D, - builtin_equal, - builtin_faceforward, - builtin_tan, - builtin_shadow2DProj, - builtin_shadow1DProjLod, - builtin_any, - builtin_shadow1DProj, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, - builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_texture3DLod, - builtin_textureLod, - builtin_fract, - builtin_abs, - builtin_degrees, - builtin_shadow1DLod, - builtin_ftransform, - builtin_sin, - builtin_shadow2D, - builtin_noise3, - builtin_texture2DProjLod, - builtin_all, - builtin_log2, - builtin_textureGrad, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_transpose, - builtin_outerProduct, - builtin_ceil, - builtin_reflect, - builtin_textureCubeLod, - builtin_step, - builtin_texture1D, - builtin_greaterThan, - builtin_texture3D, - builtin_sinh, - builtin_shadow2DProjLod, - builtin_not, - builtin_sign, - builtin_inversesqrt, - builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, - builtin_noise1, - builtin_refract, - builtin_tanh, - builtin_texelFetch, - builtin_min, - builtin_radians, - builtin_smoothstep, - builtin_textureProjGrad, - builtin_texture1DProjLod, - builtin_textureCube, - builtin_length, - builtin_texture1DLod, - builtin_texture2DLod, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, -}; -static const char *prototypes_for_ARB_texture_rectangle_frag = - "(\n" - "(function texture2DRect\n" - " (signature vec4\n" + " (declare (in) mat4x3 m))\n" + " ())\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec2 coord))\n" + " (declare (in) mat3x4 m))\n" " ()))\n" - "(function texture2DRectProj\n" - " (signature vec4\n" + "(function lessThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 coord))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow2DRect\n" - " (signature vec4\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2DRectProj\n" - " (signature vec4\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_ARB_texture_rectangle_frag [] = { - builtin_texture2DRect, - builtin_shadow2DRectProj, - builtin_shadow2DRect, - builtin_texture2DRectProj, -}; -static const char *prototypes_for_120_frag = - "(\n" - "(function radians\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float degrees))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 degrees))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 degrees))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 degrees))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function degrees\n" - " (signature float\n" + "(function lessThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float radians))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 radians))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 radians))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 radians))\n" - " ()))\n" - "(function sin\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 angle))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function cos\n" - " (signature float\n" + "(function greaterThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 angle))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function tan\n" - " (signature float\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 angle))\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ()))\n" - "(function asin\n" - " (signature float\n" + "(function equal\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" + " ())\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) bvec2 x)\n" + " (declare (in) bvec2 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) bvec3 x)\n" + " (declare (in) bvec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 angle))\n" + " (declare (in) bvec4 x)\n" + " (declare (in) bvec4 y))\n" " ()))\n" - "(function acos\n" - " (signature float\n" + "(function notEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function atan\n" - " (signature float\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) float y)\n" - " (declare (in) float x))\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" + " (declare (in) uvec2 x)\n" + " (declare (in) uvec2 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" + " (declare (in) uvec3 x)\n" + " (declare (in) uvec3 y))\n" " ())\n" - " (signature float\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) float y_over_x))\n" + " (declare (in) uvec4 x)\n" + " (declare (in) uvec4 y))\n" " ())\n" - " (signature vec2\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 y_over_x))\n" + " (declare (in) bvec2 x)\n" + " (declare (in) bvec2 y))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 y_over_x))\n" + " (declare (in) bvec3 x)\n" + " (declare (in) bvec3 y))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 y_over_x))\n" + " (declare (in) bvec4 x)\n" + " (declare (in) bvec4 y))\n" " ()))\n" - "(function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" + "(function any\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) bvec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) bvec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) bvec4 x))\n" " ()))\n" - "(function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" + "(function all\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) bvec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) bvec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) bvec4 x))\n" " ()))\n" - "(function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" + "(function not\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) bvec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) bvec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) bvec4 x))\n" " ()))\n" - "(function exp2\n" - " (signature float\n" + "(function texture\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function abs\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) samplerCubeShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sign\n" - " (signature float\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P))\n" + " ())\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function floor\n" - " (signature float\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ceil\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function fract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function min\n" " (signature float\n" " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) samplerCubeShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function max\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function textureProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P))\n" " ())\n" " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ()))\n" - "(function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y)\n" - " (declare (in) float a))\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 a))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 a))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 a))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) float a))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) float a))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) float a))\n" - " ()))\n" - "(function step\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P))\n" + " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" + " ())\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function length\n" - " (signature float\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" + " ())\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" - " (signature float\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ())\n" " (signature float\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function distance\n" - " (signature float\n" + "(function textureLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ()))\n" - "(function dot\n" - " (signature float\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function cross\n" - " (signature vec3\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ()))\n" - "(function normalize\n" - " (signature float\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ()))\n" - "(function reflect\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function refract\n" - " (signature float\n" + "(function texelFetch\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) int P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) int P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) int P)\n" + " (declare (in) int lod))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat2x3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat2x4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat3x2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat3x4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat4x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ()))\n" - "(function outerProduct\n" - " (signature mat2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec2 r))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec3 r))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) ivec2 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec4 r))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat2x3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec2 r))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" " ())\n" - " (signature mat3x2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat2x4\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) ivec3 P)\n" + " (declare (in) int lod))\n" + " ()))\n" + "(function textureProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec2 r))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat4x2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec4 r))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat3x4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec3 r))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec4 r))\n" - " ()))\n" - "(function transpose\n" - " (signature mat2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat2 m))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat3 m))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat4 m))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat2x3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat3x2 m))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat3x2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat2x3 m))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat2x4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) mat4x2 m))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat4x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) mat2x4 m))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat3x4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) mat4x3 m))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat3x4 m))\n" - " ()))\n" - "(function lessThan\n" - " (signature bvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ())\n" - " (signature bvec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function lessThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" + "(function textureGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThan\n" - " (signature bvec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThanEqual\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function equal\n" - " (signature bvec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) samplerCubeShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" + " (declare (in) usampler2DArray sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ()))\n" - "(function notEqual\n" - " (signature bvec2\n" + "(function textureProjGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function any\n" - " (signature bool\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) bvec2 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bool\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec3 x))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bool\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function all\n" - " (signature bool\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) bvec2 x))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ())\n" - " (signature bool\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec3 x))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bool\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function not\n" - " (signature bvec2\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" + " ())\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) bvec2 x))\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec3 dPdx)\n" + " (declare (in) vec3 dPdy))\n" " ())\n" - " (signature bvec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) bvec3 x))\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) float dPdx)\n" + " (declare (in) float dPdy))\n" " ())\n" - " (signature bvec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) bvec4 x))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P)\n" + " (declare (in) vec2 dPdx)\n" + " (declare (in) vec2 dPdy))\n" " ()))\n" "(function texture1D\n" " (signature vec4\n" @@ -16452,6 +16211,26 @@ static const char *prototypes_for_120_frag = " (declare (in) vec4 coord)\n" " (declare (in) float bias))\n" " ()))\n" + "(function texture1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" "(function texture2D\n" " (signature vec4\n" " (parameters\n" @@ -16487,6 +16266,26 @@ static const char *prototypes_for_120_frag = " (declare (in) vec4 coord)\n" " (declare (in) float bias))\n" " ()))\n" + "(function texture2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" "(function texture3D\n" " (signature vec4\n" " (parameters\n" @@ -16511,6 +16310,20 @@ static const char *prototypes_for_120_frag = " (declare (in) vec4 coord)\n" " (declare (in) float bias))\n" " ()))\n" + "(function texture3DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture3DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" "(function textureCube\n" " (signature vec4\n" " (parameters\n" @@ -16523,6 +16336,13 @@ static const char *prototypes_for_120_frag = " (declare (in) vec3 coord)\n" " (declare (in) float bias))\n" " ()))\n" + "(function textureCubeLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" "(function shadow1D\n" " (signature vec4\n" " (parameters\n" @@ -16543,220 +16363,400 @@ static const char *prototypes_for_120_frag = " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) float lod))\n" " ()))\n" - "(function shadow1DProj\n" + "(function shadow2DLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1DProjLod\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) float lod))\n" " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())\n" + "(function shadow2DProjLod\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2DShadow sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) float lod))\n" " ()))\n" - "(function dFdx\n" + "(function noise1\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec2\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 p))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 p))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec4 p))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function dFdy\n" - " (signature float\n" + "(function noise2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) float p))\n" + " (declare (in) float x))\n" " ())\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" + " (declare (in) vec2 x))\n" " ())\n" - " (signature vec3\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) vec3 p))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) vec4 p))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function fwidth\n" - " (signature float\n" + "(function noise3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) float p))\n" + " (declare (in) float x))\n" " ())\n" - " (signature vec2\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec2 p))\n" + " (declare (in) vec2 x))\n" " ())\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" + " (declare (in) vec3 x))\n" " ())\n" - " (signature vec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) vec4 p))\n" + " (declare (in) vec4 x))\n" " ()))\n" - "(function noise1\n" - " (signature float\n" + "(function noise4\n" + " (signature vec4\n" " (parameters\n" " (declare (in) float x))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" " (declare (in) vec2 x))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ())))" +; +static const char *functions_for_130_vert [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, + builtin_clamp, + builtin_cos, + builtin_cosh, + builtin_cross, + builtin_degrees, + builtin_distance, + builtin_dot, + builtin_equal, + builtin_exp, + builtin_exp2, + builtin_faceforward, + builtin_floor, + builtin_fract, + builtin_ftransform, + builtin_greaterThan, + builtin_greaterThanEqual, + builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, + builtin_mod, + builtin_noise1, + builtin_noise2, + builtin_noise3, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_outerProduct, + builtin_pow, + builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, + builtin_sinh, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_tanh, + builtin_texelFetch, + builtin_texture, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, + builtin_texture1DProjLod, + builtin_texture2D, + builtin_texture2DLod, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, + builtin_textureCube, + builtin_textureCubeLod, + builtin_textureGrad, + builtin_textureLod, + builtin_textureProj, + builtin_textureProjGrad, + builtin_textureProjLod, + builtin_transpose, +}; +static const char *prototypes_for_ARB_texture_rectangle_frag = + "(\n" + "(function texture2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec2 coord))\n" + " ()))\n" + "(function texture2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function shadow2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ())))" +; +static const char *functions_for_ARB_texture_rectangle_frag [] = { + builtin_shadow2DRect, + builtin_shadow2DRectProj, + builtin_texture2DRect, + builtin_texture2DRectProj, +}; +static const char *prototypes_for_ARB_texture_rectangle_vert = + "(\n" + "(function texture2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec2 coord))\n" + " ()))\n" + "(function texture2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function shadow2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ())))" +; +static const char *functions_for_ARB_texture_rectangle_vert [] = { + builtin_shadow2DRect, + builtin_shadow2DRectProj, + builtin_texture2DRect, + builtin_texture2DRectProj, +}; +static const char *prototypes_for_EXT_texture_array_frag = + "(\n" + "(function texture1DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 coord))\n" " ())\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function noise2\n" - " (signature vec2\n" + "(function texture2DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec2\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" + " ()))\n" + "(function shadow1DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function noise3\n" - " (signature vec3\n" + "(function shadow2DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec3\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ())))" +; +static const char *functions_for_EXT_texture_array_frag [] = { + builtin_shadow1DArray, + builtin_shadow2DArray, + builtin_texture1DArray, + builtin_texture2DArray, +}; +static const char *prototypes_for_EXT_texture_array_vert = + "(\n" + "(function texture1DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 coord))\n" + " ()))\n" + "(function texture1DArrayLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec3\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 coord))\n" " ()))\n" - "(function noise4\n" + "(function texture2DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" - " ())\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow1DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 coord))\n" " ())))" ; -static const char *functions_for_120_frag [] = { - builtin_clamp, - builtin_matrixCompMult, - builtin_noise2, - builtin_pow, - builtin_texture2DProj, - builtin_fwidth, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, - builtin_equal, - builtin_faceforward, - builtin_tan, - builtin_any, - builtin_shadow1DProj, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, - builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_shadow2DProj, - builtin_fract, - builtin_abs, - builtin_degrees, - builtin_dFdx, - builtin_sin, - builtin_shadow2D, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_transpose, - builtin_outerProduct, - builtin_ceil, - builtin_reflect, - builtin_step, - builtin_texture1D, - builtin_greaterThan, - builtin_texture3D, - builtin_not, - builtin_inversesqrt, - builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, - builtin_noise1, - builtin_refract, - builtin_noise3, - builtin_min, - builtin_radians, - builtin_smoothstep, - builtin_textureCube, - builtin_length, - builtin_dFdy, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, +static const char *functions_for_EXT_texture_array_vert [] = { + builtin_shadow1DArray, + builtin_shadow1DArrayLod, + builtin_shadow2DArray, + builtin_texture1DArray, + builtin_texture1DArrayLod, + builtin_texture2DArray, + builtin_texture2DArrayLod, }; void *builtin_mem_ctx = NULL; @@ -16776,13 +16776,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link = 0; - if (state->target == vertex_shader && state->language_version == 120) { + if (state->target == fragment_shader && state->language_version == 110) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_120_vert, - functions_for_120_vert, - Elements(functions_for_120_vert )); + prototypes_for_110_frag, + functions_for_110_frag, + Elements(functions_for_110_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16792,13 +16792,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->EXT_texture_array_enable) { + if (state->target == vertex_shader && state->language_version == 110) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_EXT_texture_array_frag, - functions_for_EXT_texture_array_frag, - Elements(functions_for_EXT_texture_array_frag )); + prototypes_for_110_vert, + functions_for_110_vert, + Elements(functions_for_110_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16808,13 +16808,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->language_version == 110) { + if (state->target == fragment_shader && state->language_version == 120) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_110_vert, - functions_for_110_vert, - Elements(functions_for_110_vert )); + prototypes_for_120_frag, + functions_for_120_frag, + Elements(functions_for_120_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16824,13 +16824,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version == 110) { + if (state->target == vertex_shader && state->language_version == 120) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_110_frag, - functions_for_110_frag, - Elements(functions_for_110_frag )); + prototypes_for_120_vert, + functions_for_120_vert, + Elements(functions_for_120_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16840,13 +16840,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->EXT_texture_array_enable) { + if (state->target == fragment_shader && state->language_version == 130) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_EXT_texture_array_vert, - functions_for_EXT_texture_array_vert, - Elements(functions_for_EXT_texture_array_vert )); + prototypes_for_130_frag, + functions_for_130_frag, + Elements(functions_for_130_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16856,13 +16856,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version == 130) { + if (state->target == vertex_shader && state->language_version == 130) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_130_frag, - functions_for_130_frag, - Elements(functions_for_130_frag )); + prototypes_for_130_vert, + functions_for_130_vert, + Elements(functions_for_130_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16872,13 +16872,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->ARB_texture_rectangle_enable) { + if (state->target == fragment_shader && state->ARB_texture_rectangle_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_ARB_texture_rectangle_vert, - functions_for_ARB_texture_rectangle_vert, - Elements(functions_for_ARB_texture_rectangle_vert )); + prototypes_for_ARB_texture_rectangle_frag, + functions_for_ARB_texture_rectangle_frag, + Elements(functions_for_ARB_texture_rectangle_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16888,13 +16888,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->language_version == 130) { + if (state->target == vertex_shader && state->ARB_texture_rectangle_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_130_vert, - functions_for_130_vert, - Elements(functions_for_130_vert )); + prototypes_for_ARB_texture_rectangle_vert, + functions_for_ARB_texture_rectangle_vert, + Elements(functions_for_ARB_texture_rectangle_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16904,13 +16904,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->ARB_texture_rectangle_enable) { + if (state->target == fragment_shader && state->EXT_texture_array_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_ARB_texture_rectangle_frag, - functions_for_ARB_texture_rectangle_frag, - Elements(functions_for_ARB_texture_rectangle_frag )); + prototypes_for_EXT_texture_array_frag, + functions_for_EXT_texture_array_frag, + Elements(functions_for_EXT_texture_array_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16920,13 +16920,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version == 120) { + if (state->target == vertex_shader && state->EXT_texture_array_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_120_frag, - functions_for_120_frag, - Elements(functions_for_120_frag )); + prototypes_for_EXT_texture_array_vert, + functions_for_EXT_texture_array_vert, + Elements(functions_for_EXT_texture_array_vert )); talloc_steal(builtin_mem_ctx, sh); }