From 29285882676388aacff123e8bdf025904abf8ea9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Jun 2010 15:32:15 -0700 Subject: glsl2: Move the compiler to the subdirectory it will live in in Mesa. --- src/glsl/builtins/110/abs | 21 ++ src/glsl/builtins/110/all | 16 ++ src/glsl/builtins/110/any | 16 ++ src/glsl/builtins/110/asin | 112 ++++++++ src/glsl/builtins/110/atan | 154 +++++++++++ src/glsl/builtins/110/ceil | 21 ++ src/glsl/builtins/110/clamp | 62 +++++ src/glsl/builtins/110/cos | 21 ++ src/glsl/builtins/110/cross | 17 ++ src/glsl/builtins/110/degrees | 21 ++ src/glsl/builtins/110/distance | 33 +++ src/glsl/builtins/110/dot | 25 ++ src/glsl/builtins/110/equal | 61 +++++ src/glsl/builtins/110/exp | 21 ++ src/glsl/builtins/110/exp2 | 21 ++ src/glsl/builtins/110/faceforward | 37 +++ src/glsl/builtins/110/floor | 21 ++ src/glsl/builtins/110/fract | 34 +++ src/glsl/builtins/110/greaterThan | 61 +++++ src/glsl/builtins/110/greaterThanEqual | 61 +++++ src/glsl/builtins/110/inversesqrt | 21 ++ src/glsl/builtins/110/length | 21 ++ src/glsl/builtins/110/lessThan | 61 +++++ src/glsl/builtins/110/lessThanEqual | 61 +++++ src/glsl/builtins/110/log | 21 ++ src/glsl/builtins/110/log2 | 21 ++ src/glsl/builtins/110/matrixCompMult | 32 +++ src/glsl/builtins/110/max | 64 +++++ src/glsl/builtins/110/min | 64 +++++ src/glsl/builtins/110/mix | 50 ++++ src/glsl/builtins/110/mod | 64 +++++ src/glsl/builtins/110/noise_fake | 76 ++++++ src/glsl/builtins/110/normalize | 21 ++ src/glsl/builtins/110/not | 16 ++ src/glsl/builtins/110/notEqual | 61 +++++ src/glsl/builtins/110/pow | 25 ++ src/glsl/builtins/110/radians | 21 ++ src/glsl/builtins/110/reflect | 58 ++++ src/glsl/builtins/110/refract | 102 +++++++ src/glsl/builtins/110/sign | 34 +++ src/glsl/builtins/110/sin | 21 ++ src/glsl/builtins/110/smoothstep | 224 ++++++++++++++++ src/glsl/builtins/110/sqrt | 21 ++ src/glsl/builtins/110/step | 68 +++++ src/glsl/builtins/110/tan | 21 ++ src/glsl/builtins/110/textures | 213 +++++++++++++++ src/glsl/builtins/110_fs/derivatives | 73 +++++ src/glsl/builtins/110_fs/textures | 113 ++++++++ src/glsl/builtins/110_vs/ftransform | 7 + src/glsl/builtins/120/matrixCompMult | 61 +++++ src/glsl/builtins/120/outerProduct | 92 +++++++ src/glsl/builtins/120/transpose | 139 ++++++++++ src/glsl/builtins/130/clamp | 123 +++++++++ src/glsl/builtins/130/cosh | 30 +++ src/glsl/builtins/130/equal | 31 +++ src/glsl/builtins/130/greaterThan | 31 +++ src/glsl/builtins/130/greaterThanEqual | 31 +++ src/glsl/builtins/130/lessThan | 31 +++ src/glsl/builtins/130/lessThanEqual | 31 +++ src/glsl/builtins/130/max | 127 +++++++++ src/glsl/builtins/130/min | 127 +++++++++ src/glsl/builtins/130/notEqual | 31 +++ src/glsl/builtins/130/sign | 34 +++ src/glsl/builtins/130/sinh | 30 +++ src/glsl/builtins/130/tanh | 42 +++ src/glsl/builtins/130/texelFetch | 107 ++++++++ src/glsl/builtins/130/texture | 110 ++++++++ src/glsl/builtins/130/textureGrad | 147 ++++++++++ src/glsl/builtins/130/textureLod | 128 +++++++++ src/glsl/builtins/130/textureProj | 92 +++++++ src/glsl/builtins/130/textureProjGrad | 122 +++++++++ src/glsl/builtins/130/textureProjLod | 107 ++++++++ src/glsl/builtins/130_fs/texture | 128 +++++++++ src/glsl/builtins/130_fs/textureProj | 107 ++++++++ src/glsl/builtins/ARB_texture_rectangle/textures | 16 ++ src/glsl/builtins/EXT_texture_array/textures | 59 ++++ src/glsl/builtins/EXT_texture_array_fs/textures | 27 ++ src/glsl/builtins/tools/generate_builtins.pl | 123 +++++++++ .../builtins/tools/generate_matrixCompMultGLSL.py | 28 ++ .../builtins/tools/generate_outerProductGLSL.py | 23 ++ src/glsl/builtins/tools/generate_transposeGLSL.py | 28 ++ src/glsl/builtins/tools/texture_builtins.py | 298 +++++++++++++++++++++ 82 files changed, 5132 insertions(+) create mode 100644 src/glsl/builtins/110/abs create mode 100644 src/glsl/builtins/110/all create mode 100644 src/glsl/builtins/110/any create mode 100644 src/glsl/builtins/110/asin create mode 100644 src/glsl/builtins/110/atan create mode 100644 src/glsl/builtins/110/ceil create mode 100644 src/glsl/builtins/110/clamp create mode 100644 src/glsl/builtins/110/cos create mode 100644 src/glsl/builtins/110/cross create mode 100644 src/glsl/builtins/110/degrees create mode 100644 src/glsl/builtins/110/distance create mode 100644 src/glsl/builtins/110/dot create mode 100644 src/glsl/builtins/110/equal create mode 100644 src/glsl/builtins/110/exp create mode 100644 src/glsl/builtins/110/exp2 create mode 100644 src/glsl/builtins/110/faceforward create mode 100644 src/glsl/builtins/110/floor create mode 100644 src/glsl/builtins/110/fract create mode 100644 src/glsl/builtins/110/greaterThan create mode 100644 src/glsl/builtins/110/greaterThanEqual create mode 100644 src/glsl/builtins/110/inversesqrt create mode 100644 src/glsl/builtins/110/length create mode 100644 src/glsl/builtins/110/lessThan create mode 100644 src/glsl/builtins/110/lessThanEqual create mode 100644 src/glsl/builtins/110/log create mode 100644 src/glsl/builtins/110/log2 create mode 100644 src/glsl/builtins/110/matrixCompMult create mode 100644 src/glsl/builtins/110/max create mode 100644 src/glsl/builtins/110/min create mode 100644 src/glsl/builtins/110/mix create mode 100644 src/glsl/builtins/110/mod create mode 100644 src/glsl/builtins/110/noise_fake create mode 100644 src/glsl/builtins/110/normalize create mode 100644 src/glsl/builtins/110/not create mode 100644 src/glsl/builtins/110/notEqual create mode 100644 src/glsl/builtins/110/pow create mode 100644 src/glsl/builtins/110/radians create mode 100644 src/glsl/builtins/110/reflect create mode 100644 src/glsl/builtins/110/refract create mode 100644 src/glsl/builtins/110/sign create mode 100644 src/glsl/builtins/110/sin create mode 100644 src/glsl/builtins/110/smoothstep create mode 100644 src/glsl/builtins/110/sqrt create mode 100644 src/glsl/builtins/110/step create mode 100644 src/glsl/builtins/110/tan create mode 100644 src/glsl/builtins/110/textures create mode 100644 src/glsl/builtins/110_fs/derivatives create mode 100644 src/glsl/builtins/110_fs/textures create mode 100644 src/glsl/builtins/110_vs/ftransform create mode 100644 src/glsl/builtins/120/matrixCompMult create mode 100644 src/glsl/builtins/120/outerProduct create mode 100644 src/glsl/builtins/120/transpose create mode 100644 src/glsl/builtins/130/clamp create mode 100644 src/glsl/builtins/130/cosh create mode 100644 src/glsl/builtins/130/equal create mode 100644 src/glsl/builtins/130/greaterThan create mode 100644 src/glsl/builtins/130/greaterThanEqual create mode 100644 src/glsl/builtins/130/lessThan create mode 100644 src/glsl/builtins/130/lessThanEqual create mode 100644 src/glsl/builtins/130/max create mode 100644 src/glsl/builtins/130/min create mode 100644 src/glsl/builtins/130/notEqual create mode 100644 src/glsl/builtins/130/sign create mode 100644 src/glsl/builtins/130/sinh create mode 100644 src/glsl/builtins/130/tanh create mode 100644 src/glsl/builtins/130/texelFetch create mode 100644 src/glsl/builtins/130/texture create mode 100644 src/glsl/builtins/130/textureGrad create mode 100644 src/glsl/builtins/130/textureLod create mode 100644 src/glsl/builtins/130/textureProj create mode 100644 src/glsl/builtins/130/textureProjGrad create mode 100644 src/glsl/builtins/130/textureProjLod create mode 100644 src/glsl/builtins/130_fs/texture create mode 100644 src/glsl/builtins/130_fs/textureProj create mode 100644 src/glsl/builtins/ARB_texture_rectangle/textures create mode 100644 src/glsl/builtins/EXT_texture_array/textures create mode 100644 src/glsl/builtins/EXT_texture_array_fs/textures create mode 100755 src/glsl/builtins/tools/generate_builtins.pl create mode 100755 src/glsl/builtins/tools/generate_matrixCompMultGLSL.py create mode 100755 src/glsl/builtins/tools/generate_outerProductGLSL.py create mode 100755 src/glsl/builtins/tools/generate_transposeGLSL.py create mode 100755 src/glsl/builtins/tools/texture_builtins.py (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/110/abs b/src/glsl/builtins/110/abs new file mode 100644 index 00000000000..904845307c4 --- /dev/null +++ b/src/glsl/builtins/110/abs @@ -0,0 +1,21 @@ +((function abs + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 abs (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 abs (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 abs (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/all b/src/glsl/builtins/110/all new file mode 100644 index 00000000000..2cac0dfb684 --- /dev/null +++ b/src/glsl/builtins/110/all @@ -0,0 +1,16 @@ +((function all + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((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)))))) +)) diff --git a/src/glsl/builtins/110/any b/src/glsl/builtins/110/any new file mode 100644 index 00000000000..f10e8a7b478 --- /dev/null +++ b/src/glsl/builtins/110/any @@ -0,0 +1,16 @@ +((function any + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((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)))))) +)) diff --git a/src/glsl/builtins/110/asin b/src/glsl/builtins/110/asin new file mode 100644 index 00000000000..fe93337bffc --- /dev/null +++ b/src/glsl/builtins/110/asin @@ -0,0 +1,112 @@ +((function asin + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * + (expression float - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression float sqrt + (expression float - + (constant float (1.0)) + (expression float abs (var_ref x))))) + (expression float + + (constant float (1.5707288)) + (expression float * + (expression float abs (var_ref x)) + (expression float + + (constant float (-0.2121144)) + (expression float * + (constant float (0.0742610)) + (expression float abs (var_ref x)))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * + (expression float - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec2 sqrt + (expression vec2 - + (constant float (1.0)) + (expression vec2 abs (var_ref x))))) + (expression vec2 + + (constant float (1.5707288)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (expression vec2 + + (constant float (-0.2121144)) + (expression vec2 * + (constant float (0.0742610)) + (expression vec2 abs (var_ref x)))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * + (expression vec3 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec3 sqrt + (expression vec3 - + (constant float (1.0)) + (expression vec3 abs (var_ref x))))) + (expression vec3 + + (constant float (1.5707288)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (expression vec3 + + (constant float (-0.2121144)) + (expression vec3 * + (constant float (0.0742610)) + (expression vec3 abs (var_ref x)))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * + (expression vec4 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec4 sqrt + (expression vec4 - + (constant float (1.0)) + (expression vec4 abs (var_ref x))))) + (expression vec4 + + (constant float (1.5707288)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (expression vec4 + + (constant float (-0.2121144)) + (expression vec4 * + (constant float (0.0742610)) + (expression vec4 abs (var_ref x)))))))))) +) + + (function acos + (signature float + (parameters + (declare (in) float x)) + ((return (expression float - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) +)) diff --git a/src/glsl/builtins/110/atan b/src/glsl/builtins/110/atan new file mode 100644 index 00000000000..e5542350b51 --- /dev/null +++ b/src/glsl/builtins/110/atan @@ -0,0 +1,154 @@ +((function atan + (signature float + (parameters + (declare (in) float x)) + ((return (call asin ((expression float * + (var_ref x) + (expression float rsq + (expression float + + (expression float * + (var_ref x) + (var_ref x)) + (constant float (1.0)))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 y_over_x)) + ((return (call asin ((expression vec2 * + (var_ref y_over_x) + (expression vec2 rsq + (expression vec2 + + (expression vec2 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 y_over_x)) + ((return (call asin ((expression vec3 * + (var_ref y_over_x) + (expression vec3 rsq + (expression vec3 + + (expression vec3 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 y_over_x)) + ((return (call asin ((expression vec4 * + (var_ref y_over_x) + (expression vec4 rsq + (expression vec4 + + (expression vec4 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature float + (parameters + (declare (in) float y) + (declare (in) float x)) + ((declare () float r) + (if (expression bool > + (expression float abs (var_ref x)) + (constant float (.0001))) + ((assign (constant bool (1)) + (var_ref r) (call atan ((expression float / + (var_ref y) + (var_ref x))))) + (if (expression bool < + (var_ref x) + (constant float (0.0))) + ((assign (constant bool (1)) + (var_ref r) + (expression float + + (var_ref r) + (expression float * + (expression int sign (var_ref y)) + (constant float (3.1415926)))))) + ())) + ()) + (return (var_ref r)))) + + (signature vec2 + (parameters + (declare (in) vec2 y) + (declare (in) vec2 x)) + ((declare () vec2 r) + (if (expression bool > + (expression vec2 abs (var_ref x)) + (constant float (.0001))) + ((assign (constant bool (1)) + (var_ref r) (call atan ((expression vec2 / + (var_ref y) + (var_ref x))))) + (if (expression bool < + (var_ref x) + (constant float (0.0))) + ((assign (constant bool (1)) + (var_ref r) + (expression vec2 + + (var_ref r) + (expression vec2 * + (expression int sign (var_ref y)) + (constant float (3.1415926)))))) + ())) + ()) + (return (var_ref r)))) + + (signature vec3 + (parameters + (declare (in) vec3 y) + (declare (in) vec3 x)) + ((declare () vec3 r) + (if (expression bool > + (expression vec3 abs (var_ref x)) + (constant float (.0001))) + ((assign (constant bool (1)) + (var_ref r) (call atan ((expression vec3 / + (var_ref y) + (var_ref x))))) + (if (expression bool < + (var_ref x) + (constant float (0.0))) + ((assign (constant bool (1)) + (var_ref r) + (expression vec3 + + (var_ref r) + (expression vec3 * + (expression int sign (var_ref y)) + (constant float (3.1415926)))))) + ())) + ()) + (return (var_ref r)))) + + (signature vec4 + (parameters + (declare (in) vec4 y) + (declare (in) vec4 x)) + ((declare () vec4 r) + (if (expression bool > + (expression vec4 abs (var_ref x)) + (constant float (.0001))) + ((assign (constant bool (1)) + (var_ref r) (call atan ((expression vec4 / + (var_ref y) + (var_ref x))))) + (if (expression bool < + (var_ref x) + (constant float (0.0))) + ((assign (constant bool (1)) + (var_ref r) + (expression vec4 + + (var_ref r) + (expression vec4 * + (expression int sign (var_ref y)) + (constant float (3.1415926)))))) + ())) + ()) + (return (var_ref r)))) + +)) diff --git a/src/glsl/builtins/110/ceil b/src/glsl/builtins/110/ceil new file mode 100644 index 00000000000..a26a7750493 --- /dev/null +++ b/src/glsl/builtins/110/ceil @@ -0,0 +1,21 @@ +((function ceil + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float ceil (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 ceil (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 ceil (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 ceil (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/clamp b/src/glsl/builtins/110/clamp new file mode 100644 index 00000000000..94c8e5ed168 --- /dev/null +++ b/src/glsl/builtins/110/clamp @@ -0,0 +1,62 @@ +((function clamp + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((declare () vec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((declare () vec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) (expression vec4 max (expression vec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((declare () vec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) (expression vec4 max (expression vec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) (expression vec4 max (expression vec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/110/cos b/src/glsl/builtins/110/cos new file mode 100644 index 00000000000..88f266eccbe --- /dev/null +++ b/src/glsl/builtins/110/cos @@ -0,0 +1,21 @@ +((function cos + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float cos (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 cos (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 cos (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 cos (var_ref angle))))) +)) diff --git a/src/glsl/builtins/110/cross b/src/glsl/builtins/110/cross new file mode 100644 index 00000000000..deb2f952bfc --- /dev/null +++ b/src/glsl/builtins/110/cross @@ -0,0 +1,17 @@ +((function cross + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1))) + (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0))))) + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1))) + (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0))))) + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1))) + (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0))))) + (return (var_ref t)))) +)) diff --git a/src/glsl/builtins/110/degrees b/src/glsl/builtins/110/degrees new file mode 100644 index 00000000000..dc0d7b9e20d --- /dev/null +++ b/src/glsl/builtins/110/degrees @@ -0,0 +1,21 @@ +((function degrees + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) +)) diff --git a/src/glsl/builtins/110/distance b/src/glsl/builtins/110/distance new file mode 100644 index 00000000000..a2309c484f9 --- /dev/null +++ b/src/glsl/builtins/110/distance @@ -0,0 +1,33 @@ +((function distance + (signature float + (parameters + (declare (in) float p0) + (declare (in) float p1)) + ((declare () float p) + (assign (constant bool (1)) (var_ref p) (expression float - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec2 p0) + (declare (in) vec2 p1)) + ((declare () vec2 p) + (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec3 p0) + (declare (in) vec3 p1)) + ((declare () vec3 p) + (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec4 p0) + (declare (in) vec4 p1)) + ((declare () vec4 p) + (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) +)) diff --git a/src/glsl/builtins/110/dot b/src/glsl/builtins/110/dot new file mode 100644 index 00000000000..a91a6d2c56d --- /dev/null +++ b/src/glsl/builtins/110/dot @@ -0,0 +1,25 @@ +((function dot + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/110/equal b/src/glsl/builtins/110/equal new file mode 100644 index 00000000000..ae7ddc53bdc --- /dev/null +++ b/src/glsl/builtins/110/equal @@ -0,0 +1,61 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/110/exp b/src/glsl/builtins/110/exp new file mode 100644 index 00000000000..a73bd6a7f84 --- /dev/null +++ b/src/glsl/builtins/110/exp @@ -0,0 +1,21 @@ +((function exp + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/exp2 b/src/glsl/builtins/110/exp2 new file mode 100644 index 00000000000..a842d3fe65b --- /dev/null +++ b/src/glsl/builtins/110/exp2 @@ -0,0 +1,21 @@ +((function exp2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp2 (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/faceforward b/src/glsl/builtins/110/faceforward new file mode 100644 index 00000000000..d1703972388 --- /dev/null +++ b/src/glsl/builtins/110/faceforward @@ -0,0 +1,37 @@ +((function faceforward + (signature float + (parameters + (declare (in) float N) + (declare (in) float I) + (declare (in) float Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression float neg (var_ref N))))))) + + (signature vec2 + (parameters + (declare (in) vec2 N) + (declare (in) vec2 I) + (declare (in) vec2 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec2 neg (var_ref N))))))) + + (signature vec3 + (parameters + (declare (in) vec3 N) + (declare (in) vec3 I) + (declare (in) vec3 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec3 neg (var_ref N))))))) + + (signature vec4 + (parameters + (declare (in) vec4 N) + (declare (in) vec4 I) + (declare (in) vec4 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec4 neg (var_ref N))))))) +)) diff --git a/src/glsl/builtins/110/floor b/src/glsl/builtins/110/floor new file mode 100644 index 00000000000..8dd8052799b --- /dev/null +++ b/src/glsl/builtins/110/floor @@ -0,0 +1,21 @@ +((function floor + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float floor (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 floor (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 floor (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 floor (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/fract b/src/glsl/builtins/110/fract new file mode 100644 index 00000000000..3995bfaf3f9 --- /dev/null +++ b/src/glsl/builtins/110/fract @@ -0,0 +1,34 @@ +((function fract + (signature float + (parameters + (declare (in) float x)) + ((return (expression float - (var_ref x) (expression float floor (var_ref x)))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x))))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x))))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x))))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float - (swiz w (var_ref x)) (expression float floor (swiz w (var_ref x))))) + (return (var_ref t)))) +)) + diff --git a/src/glsl/builtins/110/greaterThan b/src/glsl/builtins/110/greaterThan new file mode 100644 index 00000000000..ae03030e495 --- /dev/null +++ b/src/glsl/builtins/110/greaterThan @@ -0,0 +1,61 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/110/greaterThanEqual b/src/glsl/builtins/110/greaterThanEqual new file mode 100644 index 00000000000..204d5fd1439 --- /dev/null +++ b/src/glsl/builtins/110/greaterThanEqual @@ -0,0 +1,61 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/110/inversesqrt b/src/glsl/builtins/110/inversesqrt new file mode 100644 index 00000000000..5b66d2b3695 --- /dev/null +++ b/src/glsl/builtins/110/inversesqrt @@ -0,0 +1,21 @@ +((function inversesqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float rsq (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 rsq (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 rsq (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 rsq (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/length b/src/glsl/builtins/110/length new file mode 100644 index 00000000000..89ff7f3ef12 --- /dev/null +++ b/src/glsl/builtins/110/length @@ -0,0 +1,21 @@ +((function length + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec2 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec3 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec4 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) +)) diff --git a/src/glsl/builtins/110/lessThan b/src/glsl/builtins/110/lessThan new file mode 100644 index 00000000000..5c4254165c7 --- /dev/null +++ b/src/glsl/builtins/110/lessThan @@ -0,0 +1,61 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/110/lessThanEqual b/src/glsl/builtins/110/lessThanEqual new file mode 100644 index 00000000000..ccb955b8a76 --- /dev/null +++ b/src/glsl/builtins/110/lessThanEqual @@ -0,0 +1,61 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/110/log b/src/glsl/builtins/110/log new file mode 100644 index 00000000000..d168abb5a73 --- /dev/null +++ b/src/glsl/builtins/110/log @@ -0,0 +1,21 @@ +((function log + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/log2 b/src/glsl/builtins/110/log2 new file mode 100644 index 00000000000..b96c6276f0a --- /dev/null +++ b/src/glsl/builtins/110/log2 @@ -0,0 +1,21 @@ +((function log2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log2 (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/matrixCompMult b/src/glsl/builtins/110/matrixCompMult new file mode 100644 index 00000000000..cb5a2cb1f7b --- /dev/null +++ b/src/glsl/builtins/110/matrixCompMult @@ -0,0 +1,32 @@ +((function matrixCompMult + (signature mat2 + (parameters + (declare (in) mat2 x) + (declare (in) mat2 y)) + ((declare () mat2 z) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat3 + (parameters + (declare (in) mat3 x) + (declare (in) mat3 y)) + ((declare () mat3 z) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat4 + (parameters + (declare (in) mat4 x) + (declare (in) mat4 y)) + ((declare () mat4 z) + (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))))) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) +)) + diff --git a/src/glsl/builtins/110/max b/src/glsl/builtins/110/max new file mode 100644 index 00000000000..c05545f3d93 --- /dev/null +++ b/src/glsl/builtins/110/max @@ -0,0 +1,64 @@ +((function max + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((declare () vec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float max (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((declare () vec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float max (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float max (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((declare () vec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float max (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float max (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression float max (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/110/min b/src/glsl/builtins/110/min new file mode 100644 index 00000000000..31e79489405 --- /dev/null +++ b/src/glsl/builtins/110/min @@ -0,0 +1,64 @@ +((function min + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((declare () vec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float min (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((declare () vec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float min (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float min (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((declare () vec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float min (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float min (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression float min (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/110/mix b/src/glsl/builtins/110/mix new file mode 100644 index 00000000000..032f29e5fa8 --- /dev/null +++ b/src/glsl/builtins/110/mix @@ -0,0 +1,50 @@ +((function mix + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((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)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) float arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) float arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) float arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) +)) diff --git a/src/glsl/builtins/110/mod b/src/glsl/builtins/110/mod new file mode 100644 index 00000000000..9e08bbc7ef4 --- /dev/null +++ b/src/glsl/builtins/110/mod @@ -0,0 +1,64 @@ +((function mod + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((declare () vec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float % (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((declare () vec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float % (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float % (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((declare () vec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression float % (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression float % (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression float % (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/110/noise_fake b/src/glsl/builtins/110/noise_fake new file mode 100644 index 00000000000..bcfb17b04b8 --- /dev/null +++ b/src/glsl/builtins/110/noise_fake @@ -0,0 +1,76 @@ +((function noise1 + (signature float + (parameters + (declare (in) float x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec2 x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec3 x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec4 x)) + ((return (constant float (0))))) + ) + + (function noise2 + (signature vec2 + (parameters + (declare (in) float x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec3 x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec4 x)) + ((return (constant vec2 (0 0))))) + ) + + (function noise3 + (signature vec3 + (parameters + (declare (in) float x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec2 x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec4 x)) + ((return (constant vec3 (0 0 0))))) + ) + + (function noise4 + (signature vec4 + (parameters + (declare (in) float x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec2 x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec3 x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (constant vec4 (0 0 0 0))))) + ) +) diff --git a/src/glsl/builtins/110/normalize b/src/glsl/builtins/110/normalize new file mode 100644 index 00000000000..be88a9830d1 --- /dev/null +++ b/src/glsl/builtins/110/normalize @@ -0,0 +1,21 @@ +((function normalize + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) +)) diff --git a/src/glsl/builtins/110/not b/src/glsl/builtins/110/not new file mode 100644 index 00000000000..b696b06557f --- /dev/null +++ b/src/glsl/builtins/110/not @@ -0,0 +1,16 @@ +((function not + (signature bvec2 + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bvec2 ! (var_ref arg0))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bvec3 ! (var_ref arg0))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bvec4 ! (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/notEqual b/src/glsl/builtins/110/notEqual new file mode 100644 index 00000000000..c87efa317f7 --- /dev/null +++ b/src/glsl/builtins/110/notEqual @@ -0,0 +1,61 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/110/pow b/src/glsl/builtins/110/pow new file mode 100644 index 00000000000..a61bc4418e3 --- /dev/null +++ b/src/glsl/builtins/110/pow @@ -0,0 +1,25 @@ +((function pow + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float pow (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/110/radians b/src/glsl/builtins/110/radians new file mode 100644 index 00000000000..6a0f5d2e219 --- /dev/null +++ b/src/glsl/builtins/110/radians @@ -0,0 +1,21 @@ +((function radians + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (0.017453)))))) +)) diff --git a/src/glsl/builtins/110/reflect b/src/glsl/builtins/110/reflect new file mode 100644 index 00000000000..8238fdc93fd --- /dev/null +++ b/src/glsl/builtins/110/reflect @@ -0,0 +1,58 @@ +((function reflect + (signature float + (parameters + (declare (in) float i) + (declare (in) float n)) + ((return (expression float - + (var_ref i) + (expression float * + (constant float (2.0)) + (expression float * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n)) + ((return (expression vec2 - + (var_ref i) + (expression vec2 * + (constant float (2.0)) + (expression vec2 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n)) + ((return (expression vec3 - + (var_ref i) + (expression vec3 * + (constant float (2.0)) + (expression vec3 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n)) + ((return (expression vec4 - + (var_ref i) + (expression vec4 * + (constant float (2.0)) + (expression vec4 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + +)) diff --git a/src/glsl/builtins/110/refract b/src/glsl/builtins/110/refract new file mode 100644 index 00000000000..e9b1475294a --- /dev/null +++ b/src/glsl/builtins/110/refract @@ -0,0 +1,102 @@ +((function refract + (signature float + (parameters + (declare (in) float i) + (declare (in) float n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant float (0.0)))) + ((return (expression float - + (expression float * (var_ref eta) (var_ref i)) + (expression float * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec2 (0.0 0.0)))) + ((return (expression vec2 - + (expression vec2 * (var_ref eta) (var_ref i)) + (expression vec2 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec3 (0.0 0.0)))) + ((return (expression vec3 - + (expression vec3 * (var_ref eta) (var_ref i)) + (expression vec3 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec4 (0.0 0.0)))) + ((return (expression vec4 - + (expression vec4 * (var_ref eta) (var_ref i)) + (expression vec4 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + +)) diff --git a/src/glsl/builtins/110/sign b/src/glsl/builtins/110/sign new file mode 100644 index 00000000000..7d540de405b --- /dev/null +++ b/src/glsl/builtins/110/sign @@ -0,0 +1,34 @@ +((function sign + (signature float + (parameters + (declare (in) float x)) + ((return (expression float sign (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x)))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x)))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x)))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float sign (swiz w (var_ref x)))) + (return (var_ref t)))) +)) + diff --git a/src/glsl/builtins/110/sin b/src/glsl/builtins/110/sin new file mode 100644 index 00000000000..e6009d8ef12 --- /dev/null +++ b/src/glsl/builtins/110/sin @@ -0,0 +1,21 @@ +((function sin + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float sin (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 sin (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 sin (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 sin (var_ref angle))))) +)) diff --git a/src/glsl/builtins/110/smoothstep b/src/glsl/builtins/110/smoothstep new file mode 100644 index 00000000000..b4255ba78f1 --- /dev/null +++ b/src/glsl/builtins/110/smoothstep @@ -0,0 +1,224 @@ +((function smoothstep + (signature float + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) float x)) + ((declare () float t) + + (assign (constant bool (1)) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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)))))))) + + (signature vec2 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec2 x)) + ((declare () vec2 t) + (declare () vec2 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + (signature vec3 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec3 x)) + ((declare () vec3 t) + (declare () vec3 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + + (signature vec4 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec4 x)) + ((declare () vec4 t) + (declare () vec4 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz w (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + (signature vec2 + (parameters + (declare (in) vec2 edge0) + (declare (in) vec2 edge1) + (declare (in) vec2 x)) + ((declare () vec2 t) + (declare () vec2 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + (signature vec3 + (parameters + (declare (in) vec3 edge0) + (declare (in) vec3 edge1) + (declare (in) vec3 x)) + ((declare () vec3 t) + (declare () vec3 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + + (signature vec4 + (parameters + (declare (in) vec4 edge0) + (declare (in) vec4 edge1) + (declare (in) vec4 x)) + ((declare () vec4 t) + (declare () vec4 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz w (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz w (var_ref x)) (swiz w (var_ref edge0))) (expression float - (swiz w (var_ref edge1)) (swiz w (var_ref edge0)))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + +)) + diff --git a/src/glsl/builtins/110/sqrt b/src/glsl/builtins/110/sqrt new file mode 100644 index 00000000000..0302d164ae5 --- /dev/null +++ b/src/glsl/builtins/110/sqrt @@ -0,0 +1,21 @@ +((function sqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 sqrt (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 sqrt (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 sqrt (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/110/step b/src/glsl/builtins/110/step new file mode 100644 index 00000000000..1cc2b51f8fb --- /dev/null +++ b/src/glsl/builtins/110/step @@ -0,0 +1,68 @@ +((function step + (signature float + (parameters + (declare (in) float edge) + (declare (in) float x)) + ((return (expression float b2f (expression bool < (var_ref x) (var_ref edge)))))) + + (signature vec2 + (parameters + (declare (in) float edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) float edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) float edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec2 + (parameters + (declare (in) vec2 edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge))))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) vec3 edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(swiz z (var_ref edge))))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) vec4 edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz z (var_ref edge))))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(swiz w (var_ref edge))))) + (return (var_ref t)))) +)) + diff --git a/src/glsl/builtins/110/tan b/src/glsl/builtins/110/tan new file mode 100644 index 00000000000..3e04892a76c --- /dev/null +++ b/src/glsl/builtins/110/tan @@ -0,0 +1,21 @@ +((function tan + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) +)) diff --git a/src/glsl/builtins/110/textures b/src/glsl/builtins/110/textures new file mode 100644 index 00000000000..c81b7e8ad49 --- /dev/null +++ b/src/glsl/builtins/110/textures @@ -0,0 +1,213 @@ +((function texture1D + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) + (function texture1DLod + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +) + (function texture1DProj + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + +) + (function texture1DProjLod + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + +) + (function texture2D + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) +(function texture2DLod + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +) + (function texture2DProj + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + +) + (function texture2DProjLod + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + +) + (function texture3D + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) + (function texture3DLod + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +) + (function texture3DProj + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + +) + (function texture3DProjLod + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + +) + (function textureCube + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) + (function textureCubeLod + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +) + (function shadow1D + (signature vec4 + (parameters + (declare (in) sampler1DShadow sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) + +) + (function shadow1DLod + (signature vec4 + (parameters + (declare (in) sampler1DShadow sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) + +) + (function shadow1DProj + (signature vec4 + (parameters + (declare (in) sampler1DShadow sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) )))) + +) + (function shadow1DProjLod + (signature vec4 + (parameters + (declare (in) sampler1DShadow sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((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) )))) + +) + (function shadow2D + (signature vec4 + (parameters + (declare (in) sampler2DShadow sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) + +) + (function shadow2DLod + (signature vec4 + (parameters + (declare (in) sampler2DShadow sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) + +) + (function shadow2DProj + (signature vec4 + (parameters + (declare (in) sampler2DShadow sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) )))) + +) + (function shadow2DProjLod + (signature vec4 + (parameters + (declare (in) sampler2DShadow sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((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) )))) + +)) diff --git a/src/glsl/builtins/110_fs/derivatives b/src/glsl/builtins/110_fs/derivatives new file mode 100644 index 00000000000..b79852ee1ff --- /dev/null +++ b/src/glsl/builtins/110_fs/derivatives @@ -0,0 +1,73 @@ +((function dFdx + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdx (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdx (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdx (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdx (var_ref p))))) + ) + + (function dFdy + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdy (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdy (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdy (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdy (var_ref p))))) + ) + + (function fwidth + (signature float + (parameters + (declare (in) float p)) + ((return (expression float + + (expression float abs (expression float dFdx (var_ref p))) + (expression float abs (expression float dFdy (var_ref p))))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 + + (expression vec2 abs (expression vec2 dFdx (var_ref p))) + (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 + + (expression vec3 abs (expression vec3 dFdx (var_ref p))) + (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 + + (expression vec4 abs (expression vec4 dFdx (var_ref p))) + (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) +)) diff --git a/src/glsl/builtins/110_fs/textures b/src/glsl/builtins/110_fs/textures new file mode 100644 index 00000000000..38f3787e9ef --- /dev/null +++ b/src/glsl/builtins/110_fs/textures @@ -0,0 +1,113 @@ +((function texture1D + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +) + (function texture1DProj + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + +) + (function texture2D + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +) + (function texture2DProj + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + +) + (function texture3D + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +) + (function texture3DProj + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + +) + (function textureCube + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +) + (function shadow1D + (signature vec4 + (parameters + (declare (in) sampler1DShadow sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) + +) + (function shadow1DProj + (signature vec4 + (parameters + (declare (in) sampler1DShadow sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((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) )))) + +) + (function shadow2D + (signature vec4 + (parameters + (declare (in) sampler2DShadow sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) + +) + (function shadow2DProj + (signature vec4 + (parameters + (declare (in) sampler2DShadow sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((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) )))) + +)) diff --git a/src/glsl/builtins/110_vs/ftransform b/src/glsl/builtins/110_vs/ftransform new file mode 100644 index 00000000000..3a5e8ccecfc --- /dev/null +++ b/src/glsl/builtins/110_vs/ftransform @@ -0,0 +1,7 @@ +((function ftransform + (signature vec4 + (parameters) + ((return (expression vec4 * + (var_ref gl_ModelViewProjectionMatrix) + (var_ref gl_Vertex))))) +)) diff --git a/src/glsl/builtins/120/matrixCompMult b/src/glsl/builtins/120/matrixCompMult new file mode 100644 index 00000000000..69331e26525 --- /dev/null +++ b/src/glsl/builtins/120/matrixCompMult @@ -0,0 +1,61 @@ +((function matrixCompMult + (signature mat2x3 + (parameters + (declare (in) mat2x3 x) + (declare (in) mat2x3 y)) + ((declare () mat2x3 z) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat3x2 + (parameters + (declare (in) mat3x2 x) + (declare (in) mat3x2 y)) + ((declare () mat3x2 z) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat2x4 + (parameters + (declare (in) mat2x4 x) + (declare (in) mat2x4 y)) + ((declare () mat2x4 z) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat4x2 + (parameters + (declare (in) mat4x2 x) + (declare (in) mat4x2 y)) + ((declare () mat4x2 z) + (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))))) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat3x4 + (parameters + (declare (in) mat3x4 x) + (declare (in) mat3x4 y)) + ((declare () mat3x4 z) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat4x3 + (parameters + (declare (in) mat4x3 x) + (declare (in) mat4x3 y)) + ((declare () mat4x3 z) + (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))))) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) +)) diff --git a/src/glsl/builtins/120/outerProduct b/src/glsl/builtins/120/outerProduct new file mode 100644 index 00000000000..b401ba02337 --- /dev/null +++ b/src/glsl/builtins/120/outerProduct @@ -0,0 +1,92 @@ +((function outerProduct + (signature mat2 + (parameters + (declare (in) vec2 u) + (declare (in) vec2 v)) + ((declare () mat2 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) +(return (var_ref m)))) + + (signature mat2x3 + (parameters + (declare (in) vec2 u) + (declare (in) vec3 v)) + ((declare () mat2x3 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) +(return (var_ref m)))) + + (signature mat2x4 + (parameters + (declare (in) vec2 u) + (declare (in) vec4 v)) + ((declare () mat2x4 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) +(return (var_ref m)))) + + (signature mat3x2 + (parameters + (declare (in) vec3 u) + (declare (in) vec2 v)) + ((declare () mat3x2 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref v) (swiz z (var_ref u)))) +(return (var_ref m)))) + + (signature mat3 + (parameters + (declare (in) vec3 u) + (declare (in) vec3 v)) + ((declare () mat3 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref v) (swiz z (var_ref u)))) +(return (var_ref m)))) + + (signature mat3x4 + (parameters + (declare (in) vec3 u) + (declare (in) vec4 v)) + ((declare () mat3x4 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref v) (swiz z (var_ref u)))) +(return (var_ref m)))) + + (signature mat4x2 + (parameters + (declare (in) vec4 u) + (declare (in) vec2 v)) + ((declare () mat4x2 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref v) (swiz z (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref v) (swiz w (var_ref u)))) +(return (var_ref m)))) + + (signature mat4x3 + (parameters + (declare (in) vec4 u) + (declare (in) vec3 v)) + ((declare () mat4x3 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref v) (swiz z (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref v) (swiz w (var_ref u)))) +(return (var_ref m)))) + + (signature mat4 + (parameters + (declare (in) vec4 u) + (declare (in) vec4 v)) + ((declare () mat4 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref v) (swiz x (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref v) (swiz z (var_ref u)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref v) (swiz w (var_ref u)))) +(return (var_ref m)))) +)) + diff --git a/src/glsl/builtins/120/transpose b/src/glsl/builtins/120/transpose new file mode 100644 index 00000000000..416a0ee4677 --- /dev/null +++ b/src/glsl/builtins/120/transpose @@ -0,0 +1,139 @@ +((function transpose + (signature mat2 + (parameters + (declare (in) mat2 m)) + ((declare () mat2 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat3x2 + (parameters + (declare (in) mat2x3 m)) + ((declare () mat3x2 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat4x2 + (parameters + (declare (in) mat2x4 m)) + ((declare () mat4x2 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat2x3 + (parameters + (declare (in) mat3x2 m)) + ((declare () mat2x3 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat3 + (parameters + (declare (in) mat3 m)) + ((declare () mat3 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat4x3 + (parameters + (declare (in) mat3x4 m)) + ((declare () mat4x3 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat2x4 + (parameters + (declare (in) mat4x2 m)) + ((declare () mat2x4 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat3x4 + (parameters + (declare (in) mat4x3 m)) + ((declare () mat3x4 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat4 + (parameters + (declare (in) mat4 m)) + ((declare () mat4 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) +) + +) + diff --git a/src/glsl/builtins/130/clamp b/src/glsl/builtins/130/clamp new file mode 100644 index 00000000000..3aed22c20df --- /dev/null +++ b/src/glsl/builtins/130/clamp @@ -0,0 +1,123 @@ +((function clamp + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1) + (declare (in) ivec2 arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1) + (declare (in) ivec3 arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1) + (declare (in) ivec4 arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((declare () ivec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((declare () ivec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((declare () ivec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1) + (declare (in) uvec2 arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1) + (declare (in) uvec3 arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1) + (declare (in) uvec4 arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((declare () uvec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((declare () uvec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((declare () uvec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/130/cosh b/src/glsl/builtins/130/cosh new file mode 100644 index 00000000000..45e0ae427d6 --- /dev/null +++ b/src/glsl/builtins/130/cosh @@ -0,0 +1,30 @@ +((function cosh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant vec2 (0.5)) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant vec3 (0.5)) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant vec4 (0.5)) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/130/equal b/src/glsl/builtins/130/equal new file mode 100644 index 00000000000..079c3e97fb2 --- /dev/null +++ b/src/glsl/builtins/130/equal @@ -0,0 +1,31 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/130/greaterThan b/src/glsl/builtins/130/greaterThan new file mode 100644 index 00000000000..a9fb7b3a43e --- /dev/null +++ b/src/glsl/builtins/130/greaterThan @@ -0,0 +1,31 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/130/greaterThanEqual b/src/glsl/builtins/130/greaterThanEqual new file mode 100644 index 00000000000..293c93c7cca --- /dev/null +++ b/src/glsl/builtins/130/greaterThanEqual @@ -0,0 +1,31 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/130/lessThan b/src/glsl/builtins/130/lessThan new file mode 100644 index 00000000000..d9f693fd63f --- /dev/null +++ b/src/glsl/builtins/130/lessThan @@ -0,0 +1,31 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/130/lessThanEqual b/src/glsl/builtins/130/lessThanEqual new file mode 100644 index 00000000000..494411b869a --- /dev/null +++ b/src/glsl/builtins/130/lessThanEqual @@ -0,0 +1,31 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/130/max b/src/glsl/builtins/130/max new file mode 100644 index 00000000000..45a6089c9f2 --- /dev/null +++ b/src/glsl/builtins/130/max @@ -0,0 +1,127 @@ +((function max + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((declare () ivec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression int max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression int max (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((declare () ivec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression int max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression int max (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression int max (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((declare () ivec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression int max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression int max (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression int max (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression int max (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((declare () uvec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression uint max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression uint max (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((declare () uvec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression uint max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression uint max (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression uint max (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((declare () uvec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression uint max (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression uint max (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression uint max (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression uint max (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/130/min b/src/glsl/builtins/130/min new file mode 100644 index 00000000000..d98ec1e79da --- /dev/null +++ b/src/glsl/builtins/130/min @@ -0,0 +1,127 @@ +((function min + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((declare () ivec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression int min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression int min (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((declare () ivec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression int min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression int min (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression int min (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((declare () ivec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression int min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression int min (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression int min (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression int min (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((declare () uvec2 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression uint min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression uint min (swiz y (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((declare () uvec3 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression uint min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression uint min (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression uint min (swiz z (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((declare () uvec4 result) + (assign (constant bool (1)) (swiz x (var_ref result)) + (expression uint min (swiz x (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz y (var_ref result)) + (expression uint min (swiz y (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz z (var_ref result)) + (expression uint min (swiz z (var_ref arg0)) (var_ref arg1))) + (assign (constant bool (1)) (swiz w (var_ref result)) + (expression uint min (swiz w (var_ref arg0)) (var_ref arg1))) + (return (var_ref result)))) +)) diff --git a/src/glsl/builtins/130/notEqual b/src/glsl/builtins/130/notEqual new file mode 100644 index 00000000000..81e6376bd9c --- /dev/null +++ b/src/glsl/builtins/130/notEqual @@ -0,0 +1,31 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/130/sign b/src/glsl/builtins/130/sign new file mode 100644 index 00000000000..0bdc0e09d25 --- /dev/null +++ b/src/glsl/builtins/130/sign @@ -0,0 +1,34 @@ +((function sign + (signature int + (parameters + (declare (in) int x)) + ((return (expression int / (var_ref x) (expression int abs (var_ref x)))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 x)) + ((declare () ivec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x)))) + (return (var_ref t)))) + + (signature ivec3 + (parameters + (declare (in) ivec3 x)) + ((declare () ivec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x)))) + (return (var_ref t)))) + + (signature ivec4 + (parameters + (declare (in) ivec4 x)) + ((declare () ivec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x)))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression int sign (swiz w (var_ref x)))) + (return (var_ref t)))) +)) + diff --git a/src/glsl/builtins/130/sinh b/src/glsl/builtins/130/sinh new file mode 100644 index 00000000000..7ad4f58e204 --- /dev/null +++ b/src/glsl/builtins/130/sinh @@ -0,0 +1,30 @@ +((function sinh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant vec2 (0.5)) + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant vec3 (0.5)) + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant vec4 (0.5)) + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/130/tanh b/src/glsl/builtins/130/tanh new file mode 100644 index 00000000000..3b7271bf779 --- /dev/null +++ b/src/glsl/builtins/130/tanh @@ -0,0 +1,42 @@ +((function tanh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float / + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 / + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 / + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 / + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/130/texelFetch b/src/glsl/builtins/130/texelFetch new file mode 100644 index 00000000000..d51ce65a897 --- /dev/null +++ b/src/glsl/builtins/130/texelFetch @@ -0,0 +1,107 @@ +((function texelFetch + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) int P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) int P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) int P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) ivec2 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) ivec2 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) ivec2 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) ivec3 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) ivec3 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) ivec3 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) ivec2 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1DArray sampler) + (declare (in) ivec2 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1DArray sampler) + (declare (in) ivec2 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) ivec3 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2DArray sampler) + (declare (in) ivec3 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2DArray sampler) + (declare (in) ivec3 P) + (declare (in) int lod) ) + ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) + +)) diff --git a/src/glsl/builtins/130/texture b/src/glsl/builtins/130/texture new file mode 100644 index 00000000000..b170b583094 --- /dev/null +++ b/src/glsl/builtins/130/texture @@ -0,0 +1,110 @@ +((function texture + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) float P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) float P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature ivec4 + (parameters + (declare (in) isamplerCube sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature uvec4 + (parameters + (declare (in) usamplerCube sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature ivec4 + (parameters + (declare (in) isampler1DArray sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature uvec4 + (parameters + (declare (in) usampler1DArray sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature ivec4 + (parameters + (declare (in) isampler2DArray sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + + (signature uvec4 + (parameters + (declare (in) usampler2DArray sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +)) diff --git a/src/glsl/builtins/130/textureGrad b/src/glsl/builtins/130/textureGrad new file mode 100644 index 00000000000..0ef428c224a --- /dev/null +++ b/src/glsl/builtins/130/textureGrad @@ -0,0 +1,147 @@ +((function textureGrad + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) float P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) float P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec2 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec2 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isamplerCube sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usamplerCube sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) + +) +) diff --git a/src/glsl/builtins/130/textureLod b/src/glsl/builtins/130/textureLod new file mode 100644 index 00000000000..7d7059d848c --- /dev/null +++ b/src/glsl/builtins/130/textureLod @@ -0,0 +1,128 @@ +((function textureLod + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) float P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) float P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isamplerCube sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usamplerCube sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +)) diff --git a/src/glsl/builtins/130/textureProj b/src/glsl/builtins/130/textureProj new file mode 100644 index 00000000000..40ea1c2af68 --- /dev/null +++ b/src/glsl/builtins/130/textureProj @@ -0,0 +1,92 @@ +((function textureProj + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) + +)) diff --git a/src/glsl/builtins/130/textureProjGrad b/src/glsl/builtins/130/textureProjGrad new file mode 100644 index 00000000000..a0142c5e683 --- /dev/null +++ b/src/glsl/builtins/130/textureProjGrad @@ -0,0 +1,122 @@ +((function textureLod + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec2 P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec2 P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec4 P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec4 P) + (declare (in) float dPdx) + (declare (in) float dPdy) ) + ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec3 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec3 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec4 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec4 P) + (declare (in) vec2 dPdx) + (declare (in) vec2 dPdy) ) + ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec4 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec4 P) + (declare (in) vec3 dPdx) + (declare (in) vec3 dPdy) ) + ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) + +)) diff --git a/src/glsl/builtins/130/textureProjLod b/src/glsl/builtins/130/textureProjLod new file mode 100644 index 00000000000..9f4ce1b493d --- /dev/null +++ b/src/glsl/builtins/130/textureProjLod @@ -0,0 +1,107 @@ +((function textureLod + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec4 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) + +)) diff --git a/src/glsl/builtins/130_fs/texture b/src/glsl/builtins/130_fs/texture new file mode 100644 index 00000000000..0de981397f0 --- /dev/null +++ b/src/glsl/builtins/130_fs/texture @@ -0,0 +1,128 @@ +((function texture + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) float P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) float P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) float P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) samplerCube sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isamplerCube sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usamplerCube sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +)) diff --git a/src/glsl/builtins/130_fs/textureProj b/src/glsl/builtins/130_fs/textureProj new file mode 100644 index 00000000000..b1d8f0a2f33 --- /dev/null +++ b/src/glsl/builtins/130_fs/textureProj @@ -0,0 +1,107 @@ +((function textureProj + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler1D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler1D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler1D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler2D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler2D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler2D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature vec4 + (parameters + (declare (in) sampler3D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature ivec4 + (parameters + (declare (in) isampler3D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + + (signature uvec4 + (parameters + (declare (in) usampler3D sampler) + (declare (in) vec4 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) + +)) diff --git a/src/glsl/builtins/ARB_texture_rectangle/textures b/src/glsl/builtins/ARB_texture_rectangle/textures new file mode 100644 index 00000000000..161d8c4a541 --- /dev/null +++ b/src/glsl/builtins/ARB_texture_rectangle/textures @@ -0,0 +1,16 @@ +((function texture2DRect + (signature vec4 + (parameters + (declare (in) sampler2DRect sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) + (function shadow2DRect + (signature vec4 + (parameters + (declare (in) sampler2DRectShadow sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) + +)) diff --git a/src/glsl/builtins/EXT_texture_array/textures b/src/glsl/builtins/EXT_texture_array/textures new file mode 100644 index 00000000000..8a91f901401 --- /dev/null +++ b/src/glsl/builtins/EXT_texture_array/textures @@ -0,0 +1,59 @@ +((function texture1DArray + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) + (function texture1DArrayLod + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +) + (function texture2DArray + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) + +) + (function texture2DArrayLod + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) + +) + (function shadow1DArray + (signature vec4 + (parameters + (declare (in) sampler1DArrayShadow sampler) + (declare (in) vec3 P) ) + ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) + +) + (function shadow1DArrayLod + (signature vec4 + (parameters + (declare (in) sampler1DArrayShadow sampler) + (declare (in) vec3 P) + (declare (in) float lod) ) + ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) + +) + (function shadow2DArray + (signature vec4 + (parameters + (declare (in) sampler2DArrayShadow sampler) + (declare (in) vec4 P) ) + ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) )))) + +)) diff --git a/src/glsl/builtins/EXT_texture_array_fs/textures b/src/glsl/builtins/EXT_texture_array_fs/textures new file mode 100644 index 00000000000..74e184387ac --- /dev/null +++ b/src/glsl/builtins/EXT_texture_array_fs/textures @@ -0,0 +1,27 @@ +((function texture1DArray + (signature vec4 + (parameters + (declare (in) sampler1DArray sampler) + (declare (in) vec2 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +) + (function texture2DArray + (signature vec4 + (parameters + (declare (in) sampler2DArray sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) + +) + (function shadow1DArray + (signature vec4 + (parameters + (declare (in) sampler1DArrayShadow sampler) + (declare (in) vec3 P) + (declare (in) float bias) ) + ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) + +)) diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl new file mode 100755 index 00000000000..8b640ab8ff9 --- /dev/null +++ b/src/glsl/builtins/tools/generate_builtins.pl @@ -0,0 +1,123 @@ +#!/usr/bin/env perl + +sub process_version { + my ($version) = @_; + my @vars; + print "/* $version builtins */\n\n"; + + my @files = ; + foreach $file (@files) { + push(@vars, process_file($file)); + } + + print "static const char *functions_for_$version [] = {\n"; + foreach $var (@vars) { + print " $var,\n"; + } + print "};\n\n" +} + +sub process_file { + my ($file) = @_; + + # Change from builtins/110/foo to builtins_110_foo + my $var = $file; $var =~ s!/!_!g; + + print "static const char *$var = {\n"; + open SRC, "<", "$file" or die $!; + while () { + s/\\/\\\\/g; + s/\"/\\\"/g; + s/\n/\\n/g; + print " \"$_\"\n"; + } + print "};\n\n"; + close SRC or die $!; + return $var; +} + +print << 'EOF'; +/* DO NOT MODIFY - automatically generated by generate_builtins.pl */ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +#include "glsl_parser_extras.h" +#include "ir_reader.h" + +void +read_builtins(_mesa_glsl_parse_state *st, exec_list *instructions, + const char **functions, unsigned count) +{ + if (st->error) + return; + + for (unsigned i = 0; i < count; i++) { + _mesa_glsl_read_ir(st, instructions, functions[i]); + + if (st->error) { + printf("error reading builtin: %.35s ...\n", functions[i]); + return; + } + } +} + +EOF + +@versions = sort(); +foreach $version (@versions) { + $version =~ s!builtins/!!g; + process_version($version); +} + +print << 'EOF'; +void +_mesa_glsl_initialize_functions(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ +EOF + +foreach $version_xs (@versions) { + $check = ""; + if ($version_xs =~ /_vs/) { + $check = "state->target == vertex_shader && "; + } elsif ($version_xs =~ /_fs/) { + $check = "state->target == fragment_shader && "; + } + $version = $version_xs; + $version =~ s/_[vf]s//g; + + if ($version =~ /^[1-9][0-9][0-9]/) { + $check = "${check}state->language_version >= $version"; + } else { + # Not a version...an extension name + $check = "${check}state->${version}_enable"; + } + print " if ($check)\n"; + print " read_builtins(state, instructions,\n"; + print " functions_for_$version_xs,\n"; + print " sizeof(functions_for_$version_xs) / "; + print "sizeof(const char *));\n\n" +} + +print "}\n"; diff --git a/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py b/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py new file mode 100755 index 00000000000..391ad110d37 --- /dev/null +++ b/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +def gen_matrix(x, y = 0): + if y == 0: + y = x + type = "mat" + str(x) + if x != y: + type = type + "x" + str(y) + print type + " matrixCompMult(" + type + " x, " + type + " y)\n{" + print " " + type + " z;" + + for i in range(x): + print " z[" + str(i) + "] = x[" + str(i) + "] * y[" + str(i) + "];" + print " return z;\n}" + +print "#version 120" +# 1.10 +gen_matrix(2) +gen_matrix(3) +gen_matrix(4) + +# 1.20 +gen_matrix(2,3) # mat2x3 means 2 columns, 3 rows +gen_matrix(3,2) +gen_matrix(2,4) +gen_matrix(4,2) +gen_matrix(3,4) +gen_matrix(4,3) diff --git a/src/glsl/builtins/tools/generate_outerProductGLSL.py b/src/glsl/builtins/tools/generate_outerProductGLSL.py new file mode 100755 index 00000000000..48fb72197c3 --- /dev/null +++ b/src/glsl/builtins/tools/generate_outerProductGLSL.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +def gen(x, y): + type = "mat" + str(x) + if x != y: + type = type + "x" + str(y) + print type + " outerProduct(vec" + str(x) + " u, vec" + str(y) + " v)\n{" + print " " + type + " m;" + + for i in range(x): + print " m[" + str(i) + "] = v * u[" + str(i) + "];" + print " return m;\n}" + +print "#version 120" +gen(2,2) +gen(2,3) # mat2x3 means 2 columns, 3 rows +gen(2,4) +gen(3,2) +gen(3,3) +gen(3,4) +gen(4,2) +gen(4,3) +gen(4,4) diff --git a/src/glsl/builtins/tools/generate_transposeGLSL.py b/src/glsl/builtins/tools/generate_transposeGLSL.py new file mode 100755 index 00000000000..8f669ce9839 --- /dev/null +++ b/src/glsl/builtins/tools/generate_transposeGLSL.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +def gen(x, y): + origtype = "mat" + str(x) + trantype = "mat" + str(y) + if x != y: + origtype = origtype + "x" + str(y) + trantype = trantype + "x" + str(x) + print trantype + " transpose(" + origtype + " m)\n{" + print " " + trantype + " t;" + + # The obvious implementation of transpose + for i in range(x): + for j in range(y): + print " t[" + str(j) + "][" + str(i) + "] =", + print "m[" + str(i) + "][" + str(j) + "];" + print " return t;\n}" + +print "#version 120" +gen(2,2) +gen(2,3) # mat2x3 means 2 columns, 3 rows +gen(2,4) +gen(3,2) +gen(3,3) +gen(3,4) +gen(4,2) +gen(4,3) +gen(4,4) diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py new file mode 100755 index 00000000000..23d53149161 --- /dev/null +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -0,0 +1,298 @@ +#!/usr/bin/python + +from os import path +import sys + +def vec_type(g, size): + if size == 1: + if g == "i": + return "int" + elif g == "u": + return "uint" + return "float" + return g + "vec" + str(size) + +# Get the base dimension - i.e. sampler3D gives 3 +# Array samplers also get +1 here since the layer is really an extra coordinate +def get_coord_dim(sampler_type): + if sampler_type[0].isdigit(): + coord_dim = int(sampler_type[0]) + elif sampler_type.startswith("Cube"): + coord_dim = 3 + else: + assert False ("coord_dim: invalid sampler_type: " + sampler_type) + + if sampler_type.find("Array") != -1: + coord_dim += 1 + return coord_dim + +# Get the number of extra vector components (i.e. shadow comparitor) +def get_extra_dim(sampler_type, use_proj, unused_fields): + extra_dim = unused_fields + if sampler_type.find("Shadow") != -1: + extra_dim += 1 + if use_proj: + extra_dim += 1 + return extra_dim + +def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0): + coord_dim = get_coord_dim(sampler_type) + extra_dim = get_extra_dim(sampler_type, use_proj, unused_fields) + + # Print parameters + print " (signature " + g + "vec4" + print " (parameters" + print " (declare (in) " + g + "sampler" + sampler_type + " sampler)" + print " (declare (in) " + vec_type("i" if tex_inst == "txf" else "", coord_dim + extra_dim) + " P)", + if tex_inst == "txb": + print "\n (declare (in) float bias)", + elif tex_inst == "txl": + print "\n (declare (in) float lod)", + elif tex_inst == "txf": + print "\n (declare (in) int lod)", + elif tex_inst == "txd": + grad_type = vec_type("", coord_dim) + print "\n (declare (in) " + grad_type + " dPdx)", + print "\n (declare (in) " + grad_type + " dPdy)", + + print ")\n ((return (" + tex_inst + " (var_ref sampler)", + + # Coordinate + if extra_dim > 0: + print "(swiz " + "xyzw"[:coord_dim] + " (var_ref P))", + else: + print "(var_ref P)", + + # Offset + print "(0 0 0)", + + if tex_inst != "txf": + # Projective divisor + if use_proj: + print "(swiz " + "xyzw"[coord_dim + extra_dim-1] + " (var_ref P))", + else: + print "1", + + # Shadow comparitor + if sampler_type == "2DArrayShadow": # a special case: + print "(swiz w (var_ref P))", # ...array layer is z; shadow is w + elif sampler_type.endswith("Shadow"): + print "(swiz z (var_ref P))", + else: + print "()", + + # Bias/explicit LOD/gradient: + if tex_inst == "txb": + print "(var_ref bias)", + elif tex_inst == "txl" or tex_inst == "txf": + print "(var_ref lod)", + elif tex_inst == "txd": + print "((var_ref dPdx) (var_ref dPdy))", + print "))))\n" + +def generate_fiu_sigs(tex_inst, sampler_type, use_proj = False, unused_fields = 0): + generate_sigs("", tex_inst, sampler_type, use_proj, unused_fields) + generate_sigs("i", tex_inst, sampler_type, use_proj, unused_fields) + generate_sigs("u", tex_inst, sampler_type, use_proj, unused_fields) + +builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") + +with open(path.join(builtins_dir, "130", "texture"), 'w') as sys.stdout: + print "((function texture" + generate_fiu_sigs("tex", "1D") + generate_fiu_sigs("tex", "2D") + generate_fiu_sigs("tex", "3D") + generate_fiu_sigs("tex", "Cube") + generate_fiu_sigs("tex", "1DArray") + generate_fiu_sigs("tex", "2DArray") + print "))" + +# txb variants are only allowed within a fragment shader (GLSL 1.30 p. 86) +with open(path.join(builtins_dir, "130_fs", "texture"), 'w') as sys.stdout: + print "((function texture" + generate_fiu_sigs("txb", "1D") + generate_fiu_sigs("txb", "2D") + generate_fiu_sigs("txb", "3D") + generate_fiu_sigs("txb", "Cube") + generate_fiu_sigs("txb", "1DArray") + generate_fiu_sigs("txb", "2DArray") + print "))" + +with open(path.join(builtins_dir, "130", "textureProj"), 'w') as sys.stdout: + print "((function textureProj" + generate_fiu_sigs("tex", "1D", True) + generate_fiu_sigs("tex", "1D", True, 2) + generate_fiu_sigs("tex", "2D", True) + generate_fiu_sigs("tex", "2D", True, 1) + generate_fiu_sigs("tex", "3D", True) + print "))" + +with open(path.join(builtins_dir, "130_fs", "textureProj"), 'w') as sys.stdout: + print "((function textureProj" + generate_fiu_sigs("txb", "1D", True) + generate_fiu_sigs("txb", "1D", True, 2) + generate_fiu_sigs("txb", "2D", True) + generate_fiu_sigs("txb", "2D", True, 1) + generate_fiu_sigs("txb", "3D", True) + print "))" + +with open(path.join(builtins_dir, "130", "textureLod"), 'w') as sys.stdout: + print "((function textureLod" + generate_fiu_sigs("txl", "1D") + generate_fiu_sigs("txl", "2D") + generate_fiu_sigs("txl", "3D") + generate_fiu_sigs("txl", "Cube") + generate_fiu_sigs("txl", "1DArray") + generate_fiu_sigs("txl", "2DArray") + print "))" + +with open(path.join(builtins_dir, "130", "texelFetch"), 'w') as sys.stdout: + print "((function texelFetch" + generate_fiu_sigs("txf", "1D") + generate_fiu_sigs("txf", "2D") + generate_fiu_sigs("txf", "3D") + generate_fiu_sigs("txf", "1DArray") + generate_fiu_sigs("txf", "2DArray") + print "))" + +with open(path.join(builtins_dir, "130", "textureProjLod"), 'w') as sys.stdout: + print "((function textureLod" + generate_fiu_sigs("txl", "1D", True) + generate_fiu_sigs("txl", "1D", True, 2) + generate_fiu_sigs("txl", "2D", True) + generate_fiu_sigs("txl", "2D", True, 1) + generate_fiu_sigs("txl", "3D", True) + print "))" + +with open(path.join(builtins_dir, "130", "textureGrad"), 'w') as sys.stdout: + print "((function textureGrad" + generate_fiu_sigs("txd", "1D") + generate_fiu_sigs("txd", "2D") + generate_fiu_sigs("txd", "3D") + generate_fiu_sigs("txd", "Cube") + generate_fiu_sigs("txd", "1DArray") + generate_fiu_sigs("txd", "2DArray") + print ")\n)" + +with open(path.join(builtins_dir, "130", "textureProjGrad"), 'w') as sys.stdout: + print "((function textureLod" + generate_fiu_sigs("txd", "1D", True) + generate_fiu_sigs("txd", "1D", True, 2) + generate_fiu_sigs("txd", "2D", True) + generate_fiu_sigs("txd", "2D", True, 1) + generate_fiu_sigs("txd", "3D", True) + print "))" + +# ARB_texture_rectangle extension +with open(path.join(builtins_dir, "ARB_texture_rectangle", "textures"), 'w') as sys.stdout: + print "((function texture2DRect" + generate_sigs("", "tex", "2DRect") + print ")\n (function shadow2DRect" + generate_sigs("", "tex", "2DRectShadow") + print "))" + +# EXT_texture_array extension +with open(path.join(builtins_dir, "EXT_texture_array", "textures"), 'w') as sys.stdout: + print "((function texture1DArray" + generate_sigs("", "tex", "1DArray") + print ")\n (function texture1DArrayLod" + generate_sigs("", "txl", "1DArray") + print ")\n (function texture2DArray" + generate_sigs("", "tex", "2DArray") + print ")\n (function texture2DArrayLod" + generate_sigs("", "txl", "2DArray") + print ")\n (function shadow1DArray" + generate_sigs("", "tex", "1DArrayShadow") + print ")\n (function shadow1DArrayLod" + generate_sigs("", "txl", "1DArrayShadow") + print ")\n (function shadow2DArray" + generate_sigs("", "tex", "2DArrayShadow") + print "))" + +with open(path.join(builtins_dir, "EXT_texture_array_fs", "textures"), 'w') as sys.stdout: + print "((function texture1DArray" + generate_sigs("", "txb", "1DArray") # MOVE TO _fs + print ")\n (function texture2DArray" + generate_sigs("", "txb", "2DArray") # MOVE TO _fs + print ")\n (function shadow1DArray" + generate_sigs("", "txb", "1DArrayShadow") + print "))" + +# Deprecated (110/120 style) functions with silly names: +with open(path.join(builtins_dir, "110", "textures"), 'w') as sys.stdout: + print "((function texture1D" + generate_sigs("", "tex", "1D") + print ")\n (function texture1DLod" + generate_sigs("", "txl", "1D") + print ")\n (function texture1DProj" + generate_sigs("", "tex", "1D", True) + generate_sigs("", "tex", "1D", True, 2) + print ")\n (function texture1DProjLod" + generate_sigs("", "txl", "1D", True) + generate_sigs("", "txl", "1D", True, 2) + print ")\n (function texture2D" + generate_sigs("", "tex", "2D") + print ")\n(function texture2DLod" + generate_sigs("", "txl", "2D") + print ")\n (function texture2DProj" + generate_sigs("", "tex", "2D", True) + generate_sigs("", "tex", "2D", True, 1) + print ")\n (function texture2DProjLod" + generate_sigs("", "txl", "2D", True) + generate_sigs("", "txl", "2D", True, 1) + print ")\n (function texture3D" + generate_sigs("", "tex", "3D") + print ")\n (function texture3DLod" + generate_sigs("", "txl", "3D") + print ")\n (function texture3DProj" + generate_sigs("", "tex", "3D", True) + print ")\n (function texture3DProjLod" + generate_sigs("", "txl", "3D", True) + print ")\n (function textureCube" + generate_sigs("", "tex", "Cube") + print ")\n (function textureCubeLod" + generate_sigs("", "txl", "Cube") + print ")\n (function shadow1D" + generate_sigs("", "tex", "1DShadow", False, 1) + print ")\n (function shadow1DLod" + generate_sigs("", "txl", "1DShadow", False, 1) + print ")\n (function shadow1DProj" + generate_sigs("", "tex", "1DShadow", True, 1) + print ")\n (function shadow1DProjLod" + generate_sigs("", "txl", "1DShadow", True, 1) + print ")\n (function shadow2D" + generate_sigs("", "tex", "2DShadow") + print ")\n (function shadow2DLod" + generate_sigs("", "txl", "2DShadow") + print ")\n (function shadow2DProj" + generate_sigs("", "tex", "2DShadow", True) + print ")\n (function shadow2DProjLod" + generate_sigs("", "txl", "2DShadow", True) + print "))" + +with open(path.join(builtins_dir, "110_fs", "textures"), 'w') as sys.stdout: + print "((function texture1D" + generate_sigs("", "txb", "1D") + print ")\n (function texture1DProj" + generate_sigs("", "txb", "1D", True) + generate_sigs("", "txb", "1D", True, 2) + print ")\n (function texture2D" + generate_sigs("", "txb", "2D") + print ")\n (function texture2DProj" + generate_sigs("", "txb", "2D", True) + generate_sigs("", "txb", "2D", True, 1) + print ")\n (function texture3D" + generate_sigs("", "txb", "3D") + print ")\n (function texture3DProj" + generate_sigs("", "txb", "3D", True) + print ")\n (function textureCube" + generate_sigs("", "txb", "Cube") + print ")\n (function shadow1D" + generate_sigs("", "txb", "1DShadow", False, 1) + print ")\n (function shadow1DProj" + generate_sigs("", "txb", "1DShadow", True, 1) + print ")\n (function shadow2D" + generate_sigs("", "txb", "2DShadow") + print ")\n (function shadow2DProj" + generate_sigs("", "txb", "2DShadow", True) + print "))" -- cgit v1.2.3 From 4e16a7b526bb4736cd11e512009cf6532b2d1dc5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Jun 2010 15:59:07 -0700 Subject: glsl2: Fix up the implementation of fract() for vector types. There's no need to split each vector component out, just do vector ops. --- src/glsl/builtin_function.cpp | 18 +++--------------- src/glsl/builtins/110/fract | 18 +++--------------- 2 files changed, 6 insertions(+), 30 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index d248388a1ab..626ba4e2bf3 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -786,29 +786,17 @@ static const char *builtins_110_fract = { " (signature vec2\n" " (parameters\n" " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec2 - (var_ref x) (expression vec2 floor (var_ref x))))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x)))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec3 - (var_ref x) (expression vec3 floor (var_ref x))))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x)))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x)))))\n" - " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float - (swiz w (var_ref x)) (expression float floor (swiz w (var_ref x)))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec4 - (var_ref x) (expression vec4 floor (var_ref x))))))\n" "))\n" "\n" }; diff --git a/src/glsl/builtins/110/fract b/src/glsl/builtins/110/fract index 3995bfaf3f9..46741bb3cb4 100644 --- a/src/glsl/builtins/110/fract +++ b/src/glsl/builtins/110/fract @@ -7,28 +7,16 @@ (signature vec2 (parameters (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x))))) - (return (var_ref t)))) + ((return (expression vec2 - (var_ref x) (expression vec2 floor (var_ref x)))))) (signature vec3 (parameters (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x))))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x))))) - (return (var_ref t)))) + ((return (expression vec3 - (var_ref x) (expression vec3 floor (var_ref x)))))) (signature vec4 (parameters (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float - (swiz x (var_ref x)) (expression float floor (swiz x (var_ref x))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float - (swiz y (var_ref x)) (expression float floor (swiz y (var_ref x))))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float - (swiz z (var_ref x)) (expression float floor (swiz z (var_ref x))))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression float - (swiz w (var_ref x)) (expression float floor (swiz w (var_ref x))))) - (return (var_ref t)))) + ((return (expression vec4 - (var_ref x) (expression vec4 floor (var_ref x)))))) )) -- cgit v1.2.3 From 02d615306eb930bd6de9f1503ddd54ee33d3b930 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Jun 2010 16:22:52 -0700 Subject: glsl2: Fix reversed value of step(). It's 0.0 if x < edge, not 1.0. Partial fix for glsl-fs-step. --- src/glsl/builtin_function.cpp | 38 +++++++++++++++++++------------------- src/glsl/builtins/110/step | 38 +++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 38 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 626ba4e2bf3..811c5b20ac3 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -2164,15 +2164,15 @@ static const char *builtins_110_step = { " (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" + " ((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" + " (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" @@ -2180,9 +2180,9 @@ static const char *builtins_110_step = { " (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" + " (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" @@ -2190,10 +2190,10 @@ static const char *builtins_110_step = { " (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" + " (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" @@ -2201,8 +2201,8 @@ static const char *builtins_110_step = { " (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" + " (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" @@ -2210,9 +2210,9 @@ static const char *builtins_110_step = { " (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" + " (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 vec4\n" @@ -2220,10 +2220,10 @@ static const char *builtins_110_step = { " (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" + " (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" diff --git a/src/glsl/builtins/110/step b/src/glsl/builtins/110/step index 1cc2b51f8fb..ce6f4354228 100644 --- a/src/glsl/builtins/110/step +++ b/src/glsl/builtins/110/step @@ -3,15 +3,15 @@ (parameters (declare (in) float edge) (declare (in) float x)) - ((return (expression float b2f (expression bool < (var_ref x) (var_ref edge)))))) + ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) (signature vec2 (parameters (declare (in) float edge) (declare (in) vec2 x)) ((declare () vec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) (return (var_ref t)))) (signature vec3 @@ -19,9 +19,9 @@ (declare (in) float edge) (declare (in) vec3 x)) ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) (return (var_ref t)))) (signature vec4 @@ -29,10 +29,10 @@ (declare (in) float edge) (declare (in) vec4 x)) ((declare () vec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) (return (var_ref t)))) (signature vec2 @@ -40,8 +40,8 @@ (declare (in) vec2 edge) (declare (in) vec2 x)) ((declare () vec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) (return (var_ref t)))) (signature vec3 @@ -49,9 +49,9 @@ (declare (in) vec3 edge) (declare (in) vec3 x)) ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz z (var_ref x))(swiz z (var_ref edge))))) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) (return (var_ref t)))) (signature vec4 @@ -59,10 +59,10 @@ (declare (in) vec4 edge) (declare (in) vec4 x)) ((declare () vec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool < (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool < (swiz y (var_ref x))(swiz z (var_ref edge))))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool < (swiz w (var_ref x))(swiz w (var_ref edge))))) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge))))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) (return (var_ref t)))) )) -- cgit v1.2.3 From f5b3b2a01a320d136df3cf1f8c6fa78685d164d1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Jun 2010 17:25:09 -0700 Subject: glsl2: Don't break sign() down by vector components. --- src/glsl/builtin_function.cpp | 19 +++---------------- src/glsl/builtins/110/sign | 19 +++---------------- 2 files changed, 6 insertions(+), 32 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 811c5b20ac3..b7dbc6b34f5 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -1856,31 +1856,18 @@ static const char *builtins_110_sign = { " (signature vec2\n" " (parameters\n" " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec2 sign (var_ref x)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec3 sign (var_ref x)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x))))\n" - " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float sign (swiz w (var_ref x))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec4 sign (var_ref x)))))\n" "))\n" - "\n" }; static const char *builtins_110_sin = { diff --git a/src/glsl/builtins/110/sign b/src/glsl/builtins/110/sign index 7d540de405b..fa475197cf5 100644 --- a/src/glsl/builtins/110/sign +++ b/src/glsl/builtins/110/sign @@ -7,28 +7,15 @@ (signature vec2 (parameters (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x)))) - (return (var_ref t)))) + ((return (expression vec2 sign (var_ref x))))) (signature vec3 (parameters (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x)))) - (return (var_ref t)))) + ((return (expression vec3 sign (var_ref x))))) (signature vec4 (parameters (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float sign (swiz x (var_ref x)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float sign (swiz y (var_ref x)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float sign (swiz z (var_ref x)))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression float sign (swiz w (var_ref x)))) - (return (var_ref t)))) + ((return (expression vec4 sign (var_ref x))))) )) - -- cgit v1.2.3 From d925c9173009e9e5d48df30b30aaef22753183aa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Jul 2010 10:37:11 -0700 Subject: glsl2: Add ir_unop_fract as an expression type. Most backends will prefer seeing this to seeing (a - floor(a)), so represent it explicitly. --- src/glsl/builtin_function.cpp | 8 ++++---- src/glsl/builtins/110/fract | 8 ++++---- src/glsl/ir.cpp | 2 ++ src/glsl/ir.h | 1 + src/glsl/ir_constant_expression.cpp | 18 ++++++++++++++++++ src/mesa/shader/ir_to_mesa.cpp | 4 ++++ 6 files changed, 33 insertions(+), 8 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index b7dbc6b34f5..30ba6a52677 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -781,22 +781,22 @@ static const char *builtins_110_fract = { " (signature float\n" " (parameters\n" " (declare (in) float x))\n" - " ((return (expression float - (var_ref x) (expression float floor (var_ref x))))))\n" + " ((return (expression float fract (var_ref x)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 x))\n" - " ((return (expression vec2 - (var_ref x) (expression vec2 floor (var_ref x))))))\n" + " ((return (expression vec2 fract (var_ref x)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 x))\n" - " ((return (expression vec3 - (var_ref x) (expression vec3 floor (var_ref x))))))\n" + " ((return (expression vec3 fract (var_ref x)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 x))\n" - " ((return (expression vec4 - (var_ref x) (expression vec4 floor (var_ref x))))))\n" + " ((return (expression vec4 fract (var_ref x)))))\n" "))\n" "\n" }; diff --git a/src/glsl/builtins/110/fract b/src/glsl/builtins/110/fract index 46741bb3cb4..3f0763d1b3e 100644 --- a/src/glsl/builtins/110/fract +++ b/src/glsl/builtins/110/fract @@ -2,21 +2,21 @@ (signature float (parameters (declare (in) float x)) - ((return (expression float - (var_ref x) (expression float floor (var_ref x)))))) + ((return (expression float fract (var_ref x))))) (signature vec2 (parameters (declare (in) vec2 x)) - ((return (expression vec2 - (var_ref x) (expression vec2 floor (var_ref x)))))) + ((return (expression vec2 fract (var_ref x))))) (signature vec3 (parameters (declare (in) vec3 x)) - ((return (expression vec3 - (var_ref x) (expression vec3 floor (var_ref x)))))) + ((return (expression vec3 fract (var_ref x))))) (signature vec4 (parameters (declare (in) vec4 x)) - ((return (expression vec4 - (var_ref x) (expression vec4 floor (var_ref x)))))) + ((return (expression vec4 fract (var_ref x))))) )) diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 60ee36d17cb..42578425839 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -72,6 +72,7 @@ ir_expression::get_num_operands(ir_expression_operation op) 1, /* ir_unop_trunc */ 1, /* ir_unop_ceil */ 1, /* ir_unop_floor */ + 1, /* ir_unop_fract */ 1, /* ir_unop_sin */ 1, /* ir_unop_cos */ @@ -137,6 +138,7 @@ static const char *const operator_strs[] = { "trunc", "ceil", "floor", + "fract", "sin", "cos", "dFdx", diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 00b0076c172..f47813786b5 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -528,6 +528,7 @@ enum ir_expression_operation { ir_unop_trunc, ir_unop_ceil, ir_unop_floor, + ir_unop_fract, /*@}*/ /** diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index c6348ac4347..548217cddd9 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -187,6 +187,24 @@ ir_constant_visitor::visit(ir_expression *ir) } break; + case ir_unop_fract: + for (c = 0; c < ir->operands[0]->type->components(); c++) { + switch (ir->type->base_type) { + case GLSL_TYPE_UINT: + data.u[c] = 0; + break; + case GLSL_TYPE_INT: + data.i[c] = 0; + break; + case GLSL_TYPE_FLOAT: + data.f[c] = op[0]->value.f[c] - floor(op[0]->value.f[c]); + break; + default: + assert(0); + } + } + break; + case ir_unop_neg: for (c = 0; c < ir->operands[0]->type->components(); c++) { switch (ir->type->base_type) { diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index b270e2da413..2f2096ef97b 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -782,6 +782,10 @@ ir_to_mesa_visitor::visit(ir_expression *ir) case ir_unop_floor: ir_to_mesa_emit_op1(ir, OPCODE_FLR, result_dst, op[0]); break; + case ir_unop_fract: + ir_to_mesa_emit_op1(ir, OPCODE_FRC, result_dst, op[0]); + break; + case ir_binop_min: ir_to_mesa_emit_op2(ir, OPCODE_MIN, result_dst, op[0], op[1]); break; -- cgit v1.2.3 From 9a7ac272fb7d87e56277ed88585f389446a4a1b9 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 2 Jul 2010 02:10:01 -0700 Subject: glsl2/builtins: Use vector ops in "smoothstep." --- src/glsl/builtins/110/smoothstep | 101 ++++++--------------------------------- 1 file changed, 15 insertions(+), 86 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/110/smoothstep b/src/glsl/builtins/110/smoothstep index b4255ba78f1..663eec63419 100644 --- a/src/glsl/builtins/110/smoothstep +++ b/src/glsl/builtins/110/smoothstep @@ -122,103 +122,32 @@ (declare (in) vec2 edge0) (declare (in) vec2 edge1) (declare (in) vec2 x)) - ((declare () vec2 t) - (declare () vec2 retval) - - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - (return (var_ref retval)) - )) + ((return (expression vec2 max + (expression vec2 min + (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) + (constant vec2 (1.0 1.0))) + (constant vec2 (0.0 0.0)))))) (signature vec3 (parameters (declare (in) vec3 edge0) (declare (in) vec3 edge1) (declare (in) vec3 x)) - ((declare () vec3 t) - (declare () vec3 retval) - - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz z (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - (return (var_ref retval)) - )) - + ((return (expression vec3 max + (expression vec3 min + (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) + (constant vec3 (1.0 1.0 1.0))) + (constant vec3 (0.0 0.0 0.0)))))) (signature vec4 (parameters (declare (in) vec4 edge0) (declare (in) vec4 edge1) (declare (in) vec4 x)) - ((declare () vec4 t) - (declare () vec4 retval) - - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz x (var_ref x)) (swiz x (var_ref edge0))) (expression float - (swiz x (var_ref edge1)) (swiz x (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz y (var_ref x)) (swiz y (var_ref edge0))) (expression float - (swiz y (var_ref edge1)) (swiz y (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz z (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz z (var_ref x)) (swiz z (var_ref edge0))) (expression float - (swiz z (var_ref edge1)) (swiz z (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz w (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz w (var_ref x)) (swiz w (var_ref edge0))) (expression float - (swiz w (var_ref edge1)) (swiz w (var_ref edge0)))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - (return (var_ref retval)) - )) - + ((return (expression vec4 max + (expression vec4 min + (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) + (constant vec4 (1.0 1.0 1.0 1.0))) + (constant vec4 (0.0 0.0 0.0 0.0)))))) )) -- cgit v1.2.3 From ddc3aa07832c3fa35382b57ce2539dbac5a6158d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 2 Jul 2010 02:12:34 -0700 Subject: glsl2/builtins: Use vector ops in the 130 version of "sign." --- src/glsl/builtins/130/sign | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/130/sign b/src/glsl/builtins/130/sign index 0bdc0e09d25..170795948b2 100644 --- a/src/glsl/builtins/130/sign +++ b/src/glsl/builtins/130/sign @@ -7,28 +7,16 @@ (signature ivec2 (parameters (declare (in) ivec2 x)) - ((declare () ivec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x)))) - (return (var_ref t)))) + ((return (expression ivec2 sign (var_ref x))))) (signature ivec3 (parameters (declare (in) ivec3 x)) - ((declare () ivec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x)))) - (return (var_ref t)))) + ((return (expression ivec3 sign (var_ref x))))) (signature ivec4 (parameters (declare (in) ivec4 x)) - ((declare () ivec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression int sign (swiz x (var_ref x)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression int sign (swiz y (var_ref x)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression int sign (swiz z (var_ref x)))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression int sign (swiz w (var_ref x)))) - (return (var_ref t)))) + ((return (expression ivec4 sign (var_ref x))))) )) -- cgit v1.2.3 From 0b74bbb3dcf07489e1dbd1976f07093ad7821e51 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 7 Jul 2010 14:53:43 -0700 Subject: glsl: Fix the setup of refract()'s output for vec3/vec4 and k < 0.0. caught by valgrind. --- src/glsl/builtin_function.cpp | 4 ++-- src/glsl/builtins/110/refract | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 40c85e7c989..5b3b49d3107 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -1808,7 +1808,7 @@ static const char *builtins_110_refract = { " (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))))\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" @@ -1833,7 +1833,7 @@ static const char *builtins_110_refract = { " (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))))\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" diff --git a/src/glsl/builtins/110/refract b/src/glsl/builtins/110/refract index e9b1475294a..522ab411734 100644 --- a/src/glsl/builtins/110/refract +++ b/src/glsl/builtins/110/refract @@ -64,7 +64,7 @@ (expression float dot (var_ref n) (var_ref i)) (expression float dot (var_ref n) (var_ref i)))))))) (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec3 (0.0 0.0)))) + ((return (constant vec3 (0.0 0.0 0.0)))) ((return (expression vec3 - (expression vec3 * (var_ref eta) (var_ref i)) (expression vec3 * @@ -89,7 +89,7 @@ (expression float dot (var_ref n) (var_ref i)) (expression float dot (var_ref n) (var_ref i)))))))) (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec4 (0.0 0.0)))) + ((return (constant vec4 (0.0 0.0 0.0 0.0)))) ((return (expression vec4 - (expression vec4 * (var_ref eta) (var_ref i)) (expression vec4 * -- cgit v1.2.3 From 8984203abb711d5b9e763afc6afc8f52cc4f7cc2 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 9 Jul 2010 12:12:41 -0700 Subject: glsl2/builtins: Rework min/max to use scalar/vector combinations. --- src/glsl/builtins/110/max | 27 +++--------------------- src/glsl/builtins/110/min | 27 +++--------------------- src/glsl/builtins/130/max | 54 ++++++----------------------------------------- src/glsl/builtins/130/min | 54 ++++++----------------------------------------- 4 files changed, 18 insertions(+), 144 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/110/max b/src/glsl/builtins/110/max index c05545f3d93..f91ae417e4b 100644 --- a/src/glsl/builtins/110/max +++ b/src/glsl/builtins/110/max @@ -27,38 +27,17 @@ (parameters (declare (in) vec2 arg0) (declare (in) float arg1)) - ((declare () vec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float max (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) (signature vec3 (parameters (declare (in) vec3 arg0) (declare (in) float arg1)) - ((declare () vec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float max (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression float max (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) (signature vec4 (parameters (declare (in) vec4 arg0) (declare (in) float arg1)) - ((declare () vec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float max (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression float max (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression float max (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) )) diff --git a/src/glsl/builtins/110/min b/src/glsl/builtins/110/min index 31e79489405..78fc44120af 100644 --- a/src/glsl/builtins/110/min +++ b/src/glsl/builtins/110/min @@ -27,38 +27,17 @@ (parameters (declare (in) vec2 arg0) (declare (in) float arg1)) - ((declare () vec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float min (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) (signature vec3 (parameters (declare (in) vec3 arg0) (declare (in) float arg1)) - ((declare () vec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float min (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression float min (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) (signature vec4 (parameters (declare (in) vec4 arg0) (declare (in) float arg1)) - ((declare () vec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float min (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression float min (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression float min (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) )) diff --git a/src/glsl/builtins/130/max b/src/glsl/builtins/130/max index 45a6089c9f2..0863e411a32 100644 --- a/src/glsl/builtins/130/max +++ b/src/glsl/builtins/130/max @@ -27,40 +27,19 @@ (parameters (declare (in) ivec2 arg0) (declare (in) int arg1)) - ((declare () ivec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression int max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression int max (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) (signature ivec3 (parameters (declare (in) ivec3 arg0) (declare (in) int arg1)) - ((declare () ivec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression int max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression int max (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression int max (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) (signature ivec4 (parameters (declare (in) ivec4 arg0) (declare (in) int arg1)) - ((declare () ivec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression int max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression int max (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression int max (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression int max (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) (signature uint (parameters @@ -90,38 +69,17 @@ (parameters (declare (in) uvec2 arg0) (declare (in) uint arg1)) - ((declare () uvec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression uint max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression uint max (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) (signature uvec3 (parameters (declare (in) uvec3 arg0) (declare (in) uint arg1)) - ((declare () uvec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression uint max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression uint max (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression uint max (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) (signature uvec4 (parameters (declare (in) uvec4 arg0) (declare (in) uint arg1)) - ((declare () uvec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression uint max (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression uint max (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression uint max (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression uint max (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) )) diff --git a/src/glsl/builtins/130/min b/src/glsl/builtins/130/min index d98ec1e79da..576546f6f20 100644 --- a/src/glsl/builtins/130/min +++ b/src/glsl/builtins/130/min @@ -27,40 +27,19 @@ (parameters (declare (in) ivec2 arg0) (declare (in) int arg1)) - ((declare () ivec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression int min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression int min (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) (signature ivec3 (parameters (declare (in) ivec3 arg0) (declare (in) int arg1)) - ((declare () ivec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression int min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression int min (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression int min (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) (signature ivec4 (parameters (declare (in) ivec4 arg0) (declare (in) int arg1)) - ((declare () ivec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression int min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression int min (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression int min (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression int min (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) (signature uint (parameters @@ -90,38 +69,17 @@ (parameters (declare (in) uvec2 arg0) (declare (in) uint arg1)) - ((declare () uvec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression uint min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression uint min (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) (signature uvec3 (parameters (declare (in) uvec3 arg0) (declare (in) uint arg1)) - ((declare () uvec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression uint min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression uint min (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression uint min (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) (signature uvec4 (parameters (declare (in) uvec4 arg0) (declare (in) uint arg1)) - ((declare () uvec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression uint min (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression uint min (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression uint min (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression uint min (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) )) -- cgit v1.2.3 From d5316aeb38865b3315a8a2b46f2c5bfd0d985d65 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 10 Jul 2010 12:54:41 -0700 Subject: glsl2/builtins: Rework clamp to use scalar/vector combinations. --- src/glsl/builtins/110/clamp | 18 +++--------------- src/glsl/builtins/130/clamp | 36 ++++++------------------------------ 2 files changed, 9 insertions(+), 45 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/110/clamp b/src/glsl/builtins/110/clamp index 94c8e5ed168..d05cc76dc23 100644 --- a/src/glsl/builtins/110/clamp +++ b/src/glsl/builtins/110/clamp @@ -32,31 +32,19 @@ (declare (in) vec2 arg0) (declare (in) float arg1) (declare (in) float arg2)) - ((declare () vec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature vec3 (parameters (declare (in) vec3 arg0) (declare (in) float arg1) (declare (in) float arg2)) - ((declare () vec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) (expression vec4 max (expression vec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature vec4 (parameters (declare (in) vec4 arg0) (declare (in) float arg1) (declare (in) float arg2)) - ((declare () vec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression vec4 max (expression vec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression vec4 max (expression vec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) (expression vec4 max (expression vec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) (expression vec4 max (expression vec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) )) diff --git a/src/glsl/builtins/130/clamp b/src/glsl/builtins/130/clamp index 3aed22c20df..e1aad5c8d98 100644 --- a/src/glsl/builtins/130/clamp +++ b/src/glsl/builtins/130/clamp @@ -32,33 +32,21 @@ (declare (in) ivec2 arg0) (declare (in) int arg1) (declare (in) int arg2)) - ((declare () ivec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature ivec3 (parameters (declare (in) ivec3 arg0) (declare (in) int arg1) (declare (in) int arg2)) - ((declare () ivec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature ivec4 (parameters (declare (in) ivec4 arg0) (declare (in) int arg1) (declare (in) int arg2)) - ((declare () ivec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) (expression ivec4 max (expression ivec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature uint (parameters @@ -93,31 +81,19 @@ (declare (in) uvec2 arg0) (declare (in) uint arg1) (declare (in) uint arg2)) - ((declare () uvec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature uvec3 (parameters (declare (in) uvec3 arg0) (declare (in) uint arg1) (declare (in) uint arg2)) - ((declare () uvec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) (signature uvec4 (parameters (declare (in) uvec4 arg0) (declare (in) uint arg1) (declare (in) uint arg2)) - ((declare () uvec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz x (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz y (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz z (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) (expression uvec4 max (expression uvec4 min (swiz w (var_ref arg0)) (var_ref arg2)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) )) -- cgit v1.2.3 From 9be7f638130f46a9df2bfbcd4a03b36de9e4f3aa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Jul 2010 15:37:57 -0700 Subject: glsl2: Make cross() be an expression operation. ARB_fp, ARB_vp, Mesa IR, and the 965 vertex shader all have instructions for cross. Shaves 12 Mesa instructions off of a 66-instruction shader I have. --- src/glsl/builtin_function.cpp | 12 +----------- src/glsl/builtins/110/cross | 12 +----------- src/glsl/ir.cpp | 2 ++ src/glsl/ir.h | 1 + src/glsl/ir_constant_expression.cpp | 11 +++++++++++ src/mesa/shader/ir_to_mesa.cpp | 5 +++++ 6 files changed, 21 insertions(+), 22 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 1cf88ada165..b3a283306df 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -486,17 +486,7 @@ static const char *builtins_110_cross = { " (parameters\n" " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" - " ((declare () vec3 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t))\n" - " (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1)))\n" - " (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0)))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1)))\n" - " (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0)))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t))\n" - " (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1)))\n" - " (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0)))))\n" - " (return (var_ref t))))\n" + " ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))\n" "))\n" }; diff --git a/src/glsl/builtins/110/cross b/src/glsl/builtins/110/cross index deb2f952bfc..24717a2183d 100644 --- a/src/glsl/builtins/110/cross +++ b/src/glsl/builtins/110/cross @@ -3,15 +3,5 @@ (parameters (declare (in) vec3 arg0) (declare (in) vec3 arg1)) - ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float - (expression float * (swiz y (var_ref arg0)) (swiz z (var_ref arg1))) - (expression float * (swiz y (var_ref arg1)) (swiz z (var_ref arg0))))) - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float - (expression float * (swiz z (var_ref arg0)) (swiz x (var_ref arg1))) - (expression float * (swiz z (var_ref arg1)) (swiz x (var_ref arg0))))) - (assign (constant bool (1)) (swiz z (var_ref t)) - (expression float - (expression float * (swiz x (var_ref arg0)) (swiz y (var_ref arg1))) - (expression float * (swiz x (var_ref arg1)) (swiz y (var_ref arg0))))) - (return (var_ref t)))) + ((return (expression vec3 cross (var_ref arg0) (var_ref arg1))))) )) diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 6d899132861..fcf5deced8d 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -104,6 +104,7 @@ ir_expression::get_num_operands(ir_expression_operation op) 2, /* ir_binop_logic_or */ 2, /* ir_binop_dot */ + 2, /* ir_binop_cross */ 2, /* ir_binop_min */ 2, /* ir_binop_max */ @@ -163,6 +164,7 @@ static const char *const operator_strs[] = { "^^", "||", "dot", + "cross", "min", "max", "pow", diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 790173ed6be..9d7af2dcabc 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -609,6 +609,7 @@ enum ir_expression_operation { ir_binop_logic_or, ir_binop_dot, + ir_binop_cross, ir_binop_min, ir_binop_max, diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index c0fe47067bd..ca834978f47 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -459,8 +459,19 @@ ir_constant_visitor::visit(ir_expression *ir) assert(0); } } + break; + case ir_binop_cross: + assert(op[0]->type == glsl_type::vec3_type); + assert(op[1]->type == glsl_type::vec3_type); + data.f[0] = (op[0]->value.f[1] * op[1]->value.f[2] - + op[1]->value.f[1] * op[0]->value.f[2]); + data.f[1] = (op[0]->value.f[2] * op[1]->value.f[0] - + op[1]->value.f[2] * op[0]->value.f[0]); + data.f[2] = (op[0]->value.f[0] * op[1]->value.f[1] - + op[1]->value.f[0] * op[0]->value.f[1]); break; + case ir_binop_add: assert(op[0]->type == op[1]->type || op0_scalar || op1_scalar); for (unsigned c = 0, c0 = 0, c1 = 0; diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index 6ecc6d317c7..f99a1fc4508 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -781,6 +781,11 @@ ir_to_mesa_visitor::visit(ir_expression *ir) op[0], op[1]); } break; + + case ir_binop_cross: + ir_to_mesa_emit_op2(ir, OPCODE_XPD, result_dst, op[0], op[1]); + break; + case ir_unop_sqrt: ir_to_mesa_emit_scalar_op1(ir, OPCODE_RSQ, result_dst, op[0]); ir_to_mesa_emit_scalar_op1(ir, OPCODE_RCP, result_dst, result_src); -- cgit v1.2.3 From 82d4b9593bd541b20771cddc1365add21dea6ba9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Jul 2010 10:31:03 -0700 Subject: glsl2: Fix the expression type for atan's pi * sign(y). Fixes CorrectFunction.vert. --- src/glsl/builtin_function.cpp | 8 ++++---- src/glsl/builtins/110/atan | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index b3a283306df..75e058c41c8 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -292,7 +292,7 @@ static const char *builtins_110_atan = { " (expression float +\n" " (var_ref r)\n" " (expression float *\n" - " (expression int sign (var_ref y))\n" + " (expression float sign (var_ref y))\n" " (constant float (3.1415926))))))\n" " ()))\n" " ())\n" @@ -318,7 +318,7 @@ static const char *builtins_110_atan = { " (expression vec2 +\n" " (var_ref r)\n" " (expression vec2 *\n" - " (expression int sign (var_ref y))\n" + " (expression float sign (var_ref y))\n" " (constant float (3.1415926))))))\n" " ()))\n" " ())\n" @@ -344,7 +344,7 @@ static const char *builtins_110_atan = { " (expression vec3 +\n" " (var_ref r)\n" " (expression vec3 *\n" - " (expression int sign (var_ref y))\n" + " (expression float sign (var_ref y))\n" " (constant float (3.1415926))))))\n" " ()))\n" " ())\n" @@ -370,7 +370,7 @@ static const char *builtins_110_atan = { " (expression vec4 +\n" " (var_ref r)\n" " (expression vec4 *\n" - " (expression int sign (var_ref y))\n" + " (expression float sign (var_ref y))\n" " (constant float (3.1415926))))))\n" " ()))\n" " ())\n" diff --git a/src/glsl/builtins/110/atan b/src/glsl/builtins/110/atan index e5542350b51..bcf75718e45 100644 --- a/src/glsl/builtins/110/atan +++ b/src/glsl/builtins/110/atan @@ -67,7 +67,7 @@ (expression float + (var_ref r) (expression float * - (expression int sign (var_ref y)) + (expression float sign (var_ref y)) (constant float (3.1415926)))))) ())) ()) @@ -93,7 +93,7 @@ (expression vec2 + (var_ref r) (expression vec2 * - (expression int sign (var_ref y)) + (expression float sign (var_ref y)) (constant float (3.1415926)))))) ())) ()) @@ -119,7 +119,7 @@ (expression vec3 + (var_ref r) (expression vec3 * - (expression int sign (var_ref y)) + (expression float sign (var_ref y)) (constant float (3.1415926)))))) ())) ()) @@ -145,7 +145,7 @@ (expression vec4 + (var_ref r) (expression vec4 * - (expression int sign (var_ref y)) + (expression float sign (var_ref y)) (constant float (3.1415926)))))) ())) ()) -- cgit v1.2.3 From b64e979971e764ec1df8800d31c755298e618ba0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 16 Jul 2010 15:31:23 -0700 Subject: glsl2: Use Elements macro --- src/glsl/builtin_function.cpp | 22 +++++++++++++--------- src/glsl/builtins/tools/generate_builtins.pl | 7 +++++-- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 75e058c41c8..fbb2638fc93 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -4748,6 +4748,10 @@ static const char *functions_for_EXT_texture_array_fs [] = { builtins_EXT_texture_array_fs_textures, }; +#ifndef Elements +#define Elements(x) (sizeof(x)/sizeof(*(x))) +#endif + void _mesa_glsl_initialize_functions(exec_list *instructions, struct _mesa_glsl_parse_state *state) @@ -4755,46 +4759,46 @@ _mesa_glsl_initialize_functions(exec_list *instructions, if (state->language_version >= 110) read_builtins(state, instructions, functions_for_110, - sizeof(functions_for_110) / sizeof(const char *)); + Elements(functions_for_110)); if (state->target == fragment_shader && state->language_version >= 110) read_builtins(state, instructions, functions_for_110_fs, - sizeof(functions_for_110_fs) / sizeof(const char *)); + Elements(functions_for_110_fs)); if (state->target == vertex_shader && state->language_version >= 110) read_builtins(state, instructions, functions_for_110_vs, - sizeof(functions_for_110_vs) / sizeof(const char *)); + Elements(functions_for_110_vs)); if (state->language_version >= 120) read_builtins(state, instructions, functions_for_120, - sizeof(functions_for_120) / sizeof(const char *)); + Elements(functions_for_120)); if (state->language_version >= 130) read_builtins(state, instructions, functions_for_130, - sizeof(functions_for_130) / sizeof(const char *)); + Elements(functions_for_130)); if (state->target == fragment_shader && state->language_version >= 130) read_builtins(state, instructions, functions_for_130_fs, - sizeof(functions_for_130_fs) / sizeof(const char *)); + Elements(functions_for_130_fs)); if (state->ARB_texture_rectangle_enable) read_builtins(state, instructions, functions_for_ARB_texture_rectangle, - sizeof(functions_for_ARB_texture_rectangle) / sizeof(const char *)); + Elements(functions_for_ARB_texture_rectangle)); if (state->EXT_texture_array_enable) read_builtins(state, instructions, functions_for_EXT_texture_array, - sizeof(functions_for_EXT_texture_array) / sizeof(const char *)); + Elements(functions_for_EXT_texture_array)); if (state->target == fragment_shader && state->EXT_texture_array_enable) read_builtins(state, instructions, functions_for_EXT_texture_array_fs, - sizeof(functions_for_EXT_texture_array_fs) / sizeof(const char *)); + Elements(functions_for_EXT_texture_array_fs)); } diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl index 8b640ab8ff9..a0b5c1f421c 100755 --- a/src/glsl/builtins/tools/generate_builtins.pl +++ b/src/glsl/builtins/tools/generate_builtins.pl @@ -91,6 +91,10 @@ foreach $version (@versions) { } print << 'EOF'; +#ifndef Elements +#define Elements(x) (sizeof(x)/sizeof(*(x))) +#endif + void _mesa_glsl_initialize_functions(exec_list *instructions, struct _mesa_glsl_parse_state *state) @@ -116,8 +120,7 @@ foreach $version_xs (@versions) { print " if ($check)\n"; print " read_builtins(state, instructions,\n"; print " functions_for_$version_xs,\n"; - print " sizeof(functions_for_$version_xs) / "; - print "sizeof(const char *));\n\n" + print " Elements(functions_for_$version_xs));\n\n" } print "}\n"; -- cgit v1.2.3 From 117d154b4d877e8c4d7880432af0a80b8f717dc6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Jul 2010 11:56:48 -0700 Subject: glsl2: notEqual() produces a boolean value, not the base type of the args. Fixes: glsl1-vector relational (bvec2 ==,!=) glsl1-vector relational (vec4 !=) --- src/glsl/builtin_function.cpp | 36 ++++++++++++++++++------------------ src/glsl/builtins/110/notEqual | 36 ++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 36 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index fbb2638fc93..be7a4f2c633 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -1507,8 +1507,8 @@ static const char *builtins_110_notEqual = { " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (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" @@ -1516,9 +1516,9 @@ static const char *builtins_110_notEqual = { " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (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" @@ -1526,10 +1526,10 @@ static const char *builtins_110_notEqual = { " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float != (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" @@ -1537,8 +1537,8 @@ static const char *builtins_110_notEqual = { " (declare (in) ivec2 arg0)\n" " (declare (in) ivec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (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" @@ -1546,9 +1546,9 @@ static const char *builtins_110_notEqual = { " (declare (in) ivec3 arg0)\n" " (declare (in) ivec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (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" @@ -1556,10 +1556,10 @@ static const char *builtins_110_notEqual = { " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int != (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" }; diff --git a/src/glsl/builtins/110/notEqual b/src/glsl/builtins/110/notEqual index c87efa317f7..ccdcaa3aafa 100644 --- a/src/glsl/builtins/110/notEqual +++ b/src/glsl/builtins/110/notEqual @@ -4,8 +4,8 @@ (declare (in) vec2 arg0) (declare (in) vec2 arg1)) ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) (return (var_ref temp)))) (signature bvec3 @@ -13,9 +13,9 @@ (declare (in) vec3 arg0) (declare (in) vec3 arg1)) ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) (return (var_ref temp)))) (signature bvec4 @@ -23,10 +23,10 @@ (declare (in) vec4 arg0) (declare (in) vec4 arg1)) ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression float != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression float != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression float != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression float != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) (return (var_ref temp)))) (signature bvec2 @@ -34,8 +34,8 @@ (declare (in) ivec2 arg0) (declare (in) ivec2 arg1)) ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) (return (var_ref temp)))) (signature bvec3 @@ -43,9 +43,9 @@ (declare (in) ivec3 arg0) (declare (in) ivec3 arg1)) ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) (return (var_ref temp)))) (signature bvec4 @@ -53,9 +53,9 @@ (declare (in) ivec4 arg0) (declare (in) ivec4 arg1)) ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression int != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression int != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression int != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression int != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) (return (var_ref temp)))) )) -- cgit v1.2.3 From 1245babe0c69846d227a78a11429584433e77a9e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Jul 2010 12:22:37 -0700 Subject: glsl2: Fix asin() implementation. I'd flipped around the order of two operations in paren-balancing adventures, and left out the multiply by sign(x) required for negative x. Fixes: glsl1-acos(vec4) function glsl1-asin(vec4) function glsl1-atan(vec4) function --- src/glsl/builtin_function.cpp | 130 ++++++++++++++++++++++-------------------- src/glsl/builtins/110/asin | 130 ++++++++++++++++++++++-------------------- 2 files changed, 138 insertions(+), 122 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index be7a4f2c633..967bcd0c40d 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -113,90 +113,98 @@ static const char *builtins_110_asin = { " (parameters\n" " (declare (in) float x))\n" " ((return (expression float *\n" - " (expression float -\n" - " (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 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" + " (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 vec2\n" " (parameters\n" " (declare (in) vec2 x))\n" " ((return (expression vec2 *\n" - " (expression float -\n" - " (expression float *\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 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" + " (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 -\n" - " (expression float *\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 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" + " (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 -\n" - " (expression float *\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 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" + " (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" "\n" " (function acos\n" " (signature float\n" diff --git a/src/glsl/builtins/110/asin b/src/glsl/builtins/110/asin index fe93337bffc..d26bde364b1 100644 --- a/src/glsl/builtins/110/asin +++ b/src/glsl/builtins/110/asin @@ -3,90 +3,98 @@ (parameters (declare (in) float x)) ((return (expression float * - (expression float - - (expression float * + (expression float sign (var_ref x)) + (expression float - + (expression float * (constant float (3.1415926)) (constant float (0.5))) - (expression float sqrt - (expression float - - (constant float (1.0)) - (expression float abs (var_ref x))))) - (expression float + - (constant float (1.5707288)) - (expression float * - (expression float abs (var_ref x)) - (expression float + - (constant float (-0.2121144)) - (expression float * - (constant float (0.0742610)) - (expression float abs (var_ref x)))))))))) + (expression float * + (expression float sqrt + (expression float - + (constant float (1.0)) + (expression float abs (var_ref x)))) + (expression float + + (constant float (1.5707288)) + (expression float * + (expression float abs (var_ref x)) + (expression float + + (constant float (-0.2121144)) + (expression float * + (constant float (0.0742610)) + (expression float abs (var_ref x)))))))))))) (signature vec2 (parameters (declare (in) vec2 x)) ((return (expression vec2 * - (expression float - - (expression float * + (expression vec2 sign (var_ref x)) + (expression vec2 - + (expression float * (constant float (3.1415926)) (constant float (0.5))) - (expression vec2 sqrt - (expression vec2 - - (constant float (1.0)) - (expression vec2 abs (var_ref x))))) - (expression vec2 + - (constant float (1.5707288)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (expression vec2 + - (constant float (-0.2121144)) - (expression vec2 * - (constant float (0.0742610)) - (expression vec2 abs (var_ref x)))))))))) + (expression vec2 * + (expression vec2 sqrt + (expression vec2 - + (constant float (1.0)) + (expression vec2 abs (var_ref x)))) + (expression vec2 + + (constant float (1.5707288)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (expression vec2 + + (constant float (-0.2121144)) + (expression vec2 * + (constant float (0.0742610)) + (expression vec2 abs (var_ref x)))))))))))) (signature vec3 (parameters (declare (in) vec3 x)) ((return (expression vec3 * - (expression vec3 - - (expression float * + (expression vec3 sign (var_ref x)) + (expression vec3 - + (expression float * (constant float (3.1415926)) (constant float (0.5))) - (expression vec3 sqrt - (expression vec3 - - (constant float (1.0)) - (expression vec3 abs (var_ref x))))) - (expression vec3 + - (constant float (1.5707288)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (expression vec3 + - (constant float (-0.2121144)) - (expression vec3 * - (constant float (0.0742610)) - (expression vec3 abs (var_ref x)))))))))) + (expression vec3 * + (expression vec3 sqrt + (expression vec3 - + (constant float (1.0)) + (expression vec3 abs (var_ref x)))) + (expression vec3 + + (constant float (1.5707288)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (expression vec3 + + (constant float (-0.2121144)) + (expression vec3 * + (constant float (0.0742610)) + (expression vec3 abs (var_ref x)))))))))))) (signature vec4 (parameters (declare (in) vec4 x)) ((return (expression vec4 * - (expression vec4 - - (expression float * + (expression vec4 sign (var_ref x)) + (expression vec4 - + (expression float * (constant float (3.1415926)) (constant float (0.5))) - (expression vec4 sqrt - (expression vec4 - - (constant float (1.0)) - (expression vec4 abs (var_ref x))))) - (expression vec4 + - (constant float (1.5707288)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (expression vec4 + - (constant float (-0.2121144)) - (expression vec4 * - (constant float (0.0742610)) - (expression vec4 abs (var_ref x)))))))))) -) + (expression vec4 * + (expression vec4 sqrt + (expression vec4 - + (constant float (1.0)) + (expression vec4 abs (var_ref x)))) + (expression vec4 + + (constant float (1.5707288)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (expression vec4 + + (constant float (-0.2121144)) + (expression vec4 * + (constant float (0.0742610)) + (expression vec4 abs (var_ref x))))))))))) +)) (function acos (signature float -- cgit v1.2.3 From d5be2acae379783c4aa31243e0a88a9e67e6ca7e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 20 Jul 2010 11:29:46 -0700 Subject: linker: Link built-in functions instead of including them in every shader This is an invasive set of changes. Each user shader tracks a set of other shaders that contain built-in functions. During compilation, function prototypes are imported from these shaders. During linking, the shaders are linked with these built-in-function shaders just like with any other shader. --- src/glsl/builtin_function.cpp | 218 ++++++++++++++++++++------- src/glsl/builtins/110_vs/ftransform | 4 +- src/glsl/builtins/tools/generate_builtins.pl | 63 ++++++-- src/glsl/glsl_parser_extras.h | 4 + src/glsl/ir.h | 3 + src/glsl/linker.cpp | 23 ++- src/glsl/main.cpp | 4 + src/mesa/main/mtypes.h | 4 + src/mesa/shader/ir_to_mesa.cpp | 3 + 9 files changed, 261 insertions(+), 65 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 967bcd0c40d..10e59e491e4 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -25,22 +25,41 @@ #include #include "glsl_parser_extras.h" #include "ir_reader.h" +#include "program.h" -void -read_builtins(_mesa_glsl_parse_state *st, exec_list *instructions, - const char **functions, unsigned count) +extern "C" struct gl_shader * +_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); + +gl_shader * +read_builtins(GLenum target, const char **functions, unsigned count) { - if (st->error) - return; + gl_shader *sh = _mesa_new_shader(NULL, 0, target); + struct _mesa_glsl_parse_state *st = + new(sh) _mesa_glsl_parse_state(NULL, target, sh); + + st->language_version = 130; + st->ARB_texture_rectangle_enable = true; + st->EXT_texture_array_enable = true; + _mesa_glsl_initialize_types(st); + + sh->ir = new(sh) exec_list; + sh->symbols = st->symbols; for (unsigned i = 0; i < count; i++) { - _mesa_glsl_read_ir(st, instructions, functions[i]); + _mesa_glsl_read_ir(st, sh->ir, functions[i]); if (st->error) { printf("error reading builtin: %.35s ...\n", functions[i]); - return; + delete st; + talloc_free(sh); + return NULL; } } + + reparent_ir(sh->ir, sh); + delete st; + + return sh; } /* 110 builtins */ @@ -2580,7 +2599,9 @@ static const char *functions_for_110_fs [] = { /* 110_vs builtins */ static const char *builtins_110_vs_ftransform = { - "((function ftransform\n" + "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" + " (declare (in) vec4 gl_Vertex)\n" + " (function ftransform\n" " (signature vec4\n" " (parameters)\n" " ((return (expression vec4 *\n" @@ -4760,53 +4781,146 @@ static const char *functions_for_EXT_texture_array_fs [] = { #define Elements(x) (sizeof(x)/sizeof(*(x))) #endif +void *builtin_mem_ctx = NULL; + +void +_mesa_glsl_release_functions(void) +{ + talloc_free(builtin_mem_ctx); +} + void _mesa_glsl_initialize_functions(exec_list *instructions, struct _mesa_glsl_parse_state *state) { - if (state->language_version >= 110) - read_builtins(state, instructions, - functions_for_110, - Elements(functions_for_110)); - - if (state->target == fragment_shader && state->language_version >= 110) - read_builtins(state, instructions, - functions_for_110_fs, - Elements(functions_for_110_fs)); - - if (state->target == vertex_shader && state->language_version >= 110) - read_builtins(state, instructions, - functions_for_110_vs, - Elements(functions_for_110_vs)); - - if (state->language_version >= 120) - read_builtins(state, instructions, - functions_for_120, - Elements(functions_for_120)); - - if (state->language_version >= 130) - read_builtins(state, instructions, - functions_for_130, - Elements(functions_for_130)); - - if (state->target == fragment_shader && state->language_version >= 130) - read_builtins(state, instructions, - functions_for_130_fs, - Elements(functions_for_130_fs)); - - if (state->ARB_texture_rectangle_enable) - read_builtins(state, instructions, - functions_for_ARB_texture_rectangle, - Elements(functions_for_ARB_texture_rectangle)); - - if (state->EXT_texture_array_enable) - read_builtins(state, instructions, - functions_for_EXT_texture_array, - Elements(functions_for_EXT_texture_array)); - - if (state->target == fragment_shader && state->EXT_texture_array_enable) - read_builtins(state, instructions, - functions_for_EXT_texture_array_fs, - Elements(functions_for_EXT_texture_array_fs)); + if (builtin_mem_ctx == NULL) + builtin_mem_ctx = talloc_init("GLSL built-in functions"); + + state->num_builtins_to_link = 0; + if (state->language_version >= 110) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_110, + Elements(functions_for_110)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->target == fragment_shader && state->language_version >= 110) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_110_fs, + Elements(functions_for_110_fs)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->target == vertex_shader && state->language_version >= 110) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_110_vs, + Elements(functions_for_110_vs)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->language_version >= 120) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_120, + Elements(functions_for_120)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->language_version >= 130) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_130, + Elements(functions_for_130)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->target == fragment_shader && state->language_version >= 130) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_130_fs, + Elements(functions_for_130_fs)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->ARB_texture_rectangle_enable) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_ARB_texture_rectangle, + Elements(functions_for_ARB_texture_rectangle)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->EXT_texture_array_enable) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_EXT_texture_array, + Elements(functions_for_EXT_texture_array)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } + + if (state->target == fragment_shader && state->EXT_texture_array_enable) { + static gl_shader *sh = NULL; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, functions_for_EXT_texture_array_fs, + Elements(functions_for_EXT_texture_array_fs)); + talloc_steal(builtin_mem_ctx, sh); + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; + } } diff --git a/src/glsl/builtins/110_vs/ftransform b/src/glsl/builtins/110_vs/ftransform index 3a5e8ccecfc..9ca63dc1e34 100644 --- a/src/glsl/builtins/110_vs/ftransform +++ b/src/glsl/builtins/110_vs/ftransform @@ -1,4 +1,6 @@ -((function ftransform +((declare (uniform) mat4 gl_ModelViewProjectionMatrix) + (declare (in) vec4 gl_Vertex) + (function ftransform (signature vec4 (parameters) ((return (expression vec4 * diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl index a0b5c1f421c..61d511da1d4 100755 --- a/src/glsl/builtins/tools/generate_builtins.pl +++ b/src/glsl/builtins/tools/generate_builtins.pl @@ -64,22 +64,41 @@ print << 'EOF'; #include #include "glsl_parser_extras.h" #include "ir_reader.h" +#include "program.h" -void -read_builtins(_mesa_glsl_parse_state *st, exec_list *instructions, - const char **functions, unsigned count) +extern "C" struct gl_shader * +_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); + +gl_shader * +read_builtins(GLenum target, const char **functions, unsigned count) { - if (st->error) - return; + gl_shader *sh = _mesa_new_shader(NULL, 0, target); + struct _mesa_glsl_parse_state *st = + new(sh) _mesa_glsl_parse_state(NULL, target, sh); + + st->language_version = 130; + st->ARB_texture_rectangle_enable = true; + st->EXT_texture_array_enable = true; + _mesa_glsl_initialize_types(st); + + sh->ir = new(sh) exec_list; + sh->symbols = st->symbols; for (unsigned i = 0; i < count; i++) { - _mesa_glsl_read_ir(st, instructions, functions[i]); + _mesa_glsl_read_ir(st, sh->ir, functions[i]); if (st->error) { printf("error reading builtin: %.35s ...\n", functions[i]); - return; + delete st; + talloc_free(sh); + return NULL; } } + + reparent_ir(sh->ir, sh); + delete st; + + return sh; } EOF @@ -95,10 +114,22 @@ print << 'EOF'; #define Elements(x) (sizeof(x)/sizeof(*(x))) #endif +void *builtin_mem_ctx = NULL; + +void +_mesa_glsl_release_functions(void) +{ + talloc_free(builtin_mem_ctx); +} + void _mesa_glsl_initialize_functions(exec_list *instructions, struct _mesa_glsl_parse_state *state) { + if (builtin_mem_ctx == NULL) + builtin_mem_ctx = talloc_init("GLSL built-in functions"); + + state->num_builtins_to_link = 0; EOF foreach $version_xs (@versions) { @@ -117,10 +148,20 @@ foreach $version_xs (@versions) { # Not a version...an extension name $check = "${check}state->${version}_enable"; } - print " if ($check)\n"; - print " read_builtins(state, instructions,\n"; - print " functions_for_$version_xs,\n"; - print " Elements(functions_for_$version_xs));\n\n" + print " if ($check) {\n"; + print " static gl_shader *sh = NULL;\n"; + print "\n"; + print " if (sh == NULL) {\n"; + print " sh = read_builtins(GL_VERTEX_SHADER, functions_for_$version_xs,\n"; + print " Elements(functions_for_$version_xs));\n"; + print " talloc_steal(builtin_mem_ctx, sh);\n"; + print " }\n"; + print "\n"; + print " import_prototypes(sh->ir, instructions, state->symbols, state);\n"; + print " state->builtins_to_link[state->num_builtins_to_link] = sh;\n"; + print " state->num_builtins_to_link++;\n"; + print " }\n"; + print "\n"; } print "}\n"; diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index b50d9eea676..56f6e18e0bd 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -125,6 +125,10 @@ struct _mesa_glsl_parse_state { /** Extensions supported by the OpenGL implementation. */ const struct gl_extensions *extensions; + + /** Shaders containing built-in functions that are used for linking. */ + struct gl_shader *builtins_to_link[16]; + unsigned num_builtins_to_link; }; typedef struct YYLTYPE { diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 38b10f5b06d..3a643fc5807 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -1315,6 +1315,9 @@ extern void _mesa_glsl_initialize_functions(exec_list *instructions, struct _mesa_glsl_parse_state *state); +extern void +_mesa_glsl_release_functions(void); + extern void reparent_ir(exec_list *list, void *mem_ctx); diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 640e6eee8e0..7c30a40a6ce 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -739,7 +739,28 @@ link_intrastage_shaders(struct gl_shader_program *prog, /* Resolve initializers for global variables in the linked shader. */ - link_function_calls(prog, linked, shader_list, num_shaders); + unsigned num_linking_shaders = num_shaders; + for (unsigned i = 0; i < num_shaders; i++) + num_linking_shaders += shader_list[i]->num_builtins_to_link; + + gl_shader **linking_shaders = + (gl_shader **) calloc(num_linking_shaders, sizeof(gl_shader *)); + + memcpy(linking_shaders, shader_list, + sizeof(linking_shaders[0]) * num_shaders); + + unsigned idx = num_shaders; + for (unsigned i = 0; i < num_shaders; i++) { + memcpy(&linking_shaders[idx], shader_list[i]->builtins_to_link, + sizeof(linking_shaders[0]) * shader_list[i]->num_builtins_to_link); + idx += shader_list[i]->num_builtins_to_link; + } + + assert(idx == num_linking_shaders); + + link_function_calls(prog, linked, linking_shaders, num_linking_shaders); + + free(linking_shaders); return linked; } diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index cf9a5157857..2ecf57f8ce2 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -219,6 +219,9 @@ compile_shader(struct gl_shader *shader) shader->symbols = state->symbols; shader->CompileStatus = !state->error; shader->Version = state->language_version; + memcpy(shader->builtins_to_link, state->builtins_to_link, + sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link); + shader->num_builtins_to_link = state->num_builtins_to_link; if (shader->InfoLog) talloc_free(shader->InfoLog); @@ -305,6 +308,7 @@ main(int argc, char **argv) talloc_free(whole_program); _mesa_glsl_release_types(); + _mesa_glsl_release_functions(); return status; } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 729c2eaf0fd..f8257d565bf 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1971,6 +1971,10 @@ struct gl_shader struct exec_list *ir; struct glsl_symbol_table *symbols; + + /** Shaders containing built-in functions that are used for linking. */ + struct gl_shader *builtins_to_link[16]; + unsigned num_builtins_to_link; }; diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index a2b2eb95c82..bfb8e3201ac 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -2207,6 +2207,9 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = !state->error; shader->InfoLog = state->info_log; shader->Version = state->language_version; + memcpy(shader->builtins_to_link, state->builtins_to_link, + sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link); + shader->num_builtins_to_link = state->num_builtins_to_link; /* Retain any live IR, but trash the rest. */ reparent_ir(shader->ir, shader); -- cgit v1.2.3 From e65dfa89eef86be127d788ecd5bd23c35c8fbbe4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 22 Jul 2010 14:25:26 -0700 Subject: glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float). Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0). Fixes: glsl1-mix(vec4) function --- src/glsl/builtin_function.cpp | 6 +++--- src/glsl/builtins/110/mix | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 10e59e491e4..ae0eabcf778 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -1320,21 +1320,21 @@ static const char *builtins_110_mix = { " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1)\n" " (declare (in) float arg2))\n" - " ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n" + " ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1)\n" " (declare (in) float arg2))\n" - " ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n" + " ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1)\n" " (declare (in) float arg2))\n" - " ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n" + " ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n" "))\n" }; diff --git a/src/glsl/builtins/110/mix b/src/glsl/builtins/110/mix index 032f29e5fa8..8638d06887c 100644 --- a/src/glsl/builtins/110/mix +++ b/src/glsl/builtins/110/mix @@ -32,19 +32,19 @@ (declare (in) vec2 arg0) (declare (in) vec2 arg1) (declare (in) float arg2)) - ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) (signature vec3 (parameters (declare (in) vec3 arg0) (declare (in) vec3 arg1) (declare (in) float arg2)) - ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) (signature vec4 (parameters (declare (in) vec4 arg0) (declare (in) vec4 arg1) (declare (in) float arg2)) - ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) )) -- cgit v1.2.3 From 63a92c975dd97445979c6aa1c5fef63d37bfc897 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 21 Jul 2010 17:17:44 -0700 Subject: glsl2/builtins: Fix "mod" builtin to use scalar/vector operations. --- src/glsl/builtins/110/mod | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/110/mod b/src/glsl/builtins/110/mod index 9e08bbc7ef4..aeaea240e2d 100644 --- a/src/glsl/builtins/110/mod +++ b/src/glsl/builtins/110/mod @@ -27,38 +27,17 @@ (parameters (declare (in) vec2 arg0) (declare (in) float arg1)) - ((declare () vec2 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float % (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) (signature vec3 (parameters (declare (in) vec3 arg0) (declare (in) float arg1)) - ((declare () vec3 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float % (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression float % (swiz z (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) (signature vec4 (parameters (declare (in) vec4 arg0) (declare (in) float arg1)) - ((declare () vec4 result) - (assign (constant bool (1)) (swiz x (var_ref result)) - (expression float % (swiz x (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz y (var_ref result)) - (expression float % (swiz y (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz z (var_ref result)) - (expression float % (swiz z (var_ref arg0)) (var_ref arg1))) - (assign (constant bool (1)) (swiz w (var_ref result)) - (expression float % (swiz w (var_ref arg0)) (var_ref arg1))) - (return (var_ref result)))) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) )) -- cgit v1.2.3 From 5304c251fcceca40096d69002efcf1a122df259d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 21 Jul 2010 17:25:49 -0700 Subject: glsl2/builtins: Fix 1.30 sign implementation for ints. --- src/glsl/builtins/130/sign | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/130/sign b/src/glsl/builtins/130/sign index 170795948b2..f86062a2443 100644 --- a/src/glsl/builtins/130/sign +++ b/src/glsl/builtins/130/sign @@ -2,7 +2,7 @@ (signature int (parameters (declare (in) int x)) - ((return (expression int / (var_ref x) (expression int abs (var_ref x)))))) + ((return (expression int sign (var_ref x))))) (signature ivec2 (parameters -- cgit v1.2.3 From 0b8e5f384c75b56bf2ee34c317bb9d06095c798b Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 22 Jul 2010 16:52:32 -0700 Subject: glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin. --- src/glsl/builtins/130/mix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/glsl/builtins/130/mix (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/130/mix b/src/glsl/builtins/130/mix new file mode 100644 index 00000000000..9a1fcd70ffa --- /dev/null +++ b/src/glsl/builtins/130/mix @@ -0,0 +1,39 @@ +((function mix + (signature float + (parameters + (declare (in) float v1) + (declare (in) float v2) + (declare (in) bool a)) + ((assign (var_ref a) (var_ref v1) (var_ref v2)) + (return (var_ref v1)))) + + (signature vec2 + (parameters + (declare (in) vec2 v1) + (declare (in) vec2 v2) + (declare (in) bvec2 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (return (var_ref v1)))) + + (signature vec3 + (parameters + (declare (in) vec3 v1) + (declare (in) vec3 v2) + (declare (in) bvec3 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) + (return (var_ref v1)))) + + (signature vec4 + (parameters + (declare (in) vec4 v1) + (declare (in) vec4 v2) + (declare (in) bvec4 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) + (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2))) + (return (var_ref v1)))) +)) -- cgit v1.2.3 From 56af4e56e3852363a810174c64650df6f0ae4f53 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 28 Jul 2010 11:58:27 -0700 Subject: glsl2: Fix outerProduct builtin. The type signatures were completely backwards. --- src/glsl/builtin_function.cpp | 98 +++++++++++----------- src/glsl/builtins/120/outerProduct | 98 +++++++++++----------- .../builtins/tools/generate_outerProductGLSL.py | 4 +- 3 files changed, 100 insertions(+), 100 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index cc957e4b661..3343cf5638b 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -2666,92 +2666,92 @@ static const char *builtins_120_outerProduct = { " (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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) \n" - "(return (var_ref 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 mat2x3\n" " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec3 v))\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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) \n" - "(return (var_ref 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 mat2x4\n" " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec4 v))\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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) \n" - "(return (var_ref 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 mat3x2\n" " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec2 v))\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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref v) (swiz z (var_ref u)))) \n" - "(return (var_ref 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) 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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref v) (swiz z (var_ref u)))) \n" - "(return (var_ref 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 mat3x4\n" " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec4 v))\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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref v) (swiz z (var_ref u)))) \n" - "(return (var_ref 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 mat4x2\n" " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec2 v))\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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref v) (swiz z (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref v) (swiz w (var_ref u)))) \n" - "(return (var_ref 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 mat4x3\n" " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec3 v))\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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref v) (swiz z (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref v) (swiz w (var_ref u)))) \n" - "(return (var_ref 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) 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 v) (swiz x (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref v) (swiz z (var_ref u)))) \n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref v) (swiz w (var_ref u)))) \n" - "(return (var_ref 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" - "\n" }; static const char *builtins_120_transpose = { diff --git a/src/glsl/builtins/120/outerProduct b/src/glsl/builtins/120/outerProduct index b401ba02337..69ae741e176 100644 --- a/src/glsl/builtins/120/outerProduct +++ b/src/glsl/builtins/120/outerProduct @@ -4,89 +4,89 @@ (declare (in) vec2 u) (declare (in) vec2 v)) ((declare () mat2 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) (signature mat2x3 (parameters - (declare (in) vec2 u) - (declare (in) vec3 v)) + (declare (in) vec3 u) + (declare (in) vec2 v)) ((declare () mat2x3 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) (signature mat2x4 (parameters - (declare (in) vec2 u) - (declare (in) vec4 v)) + (declare (in) vec4 u) + (declare (in) vec2 v)) ((declare () mat2x4 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) (signature mat3x2 (parameters - (declare (in) vec3 u) - (declare (in) vec2 v)) + (declare (in) vec2 u) + (declare (in) vec3 v)) ((declare () mat3x2 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref v) (swiz z (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)) + )) (signature mat3 (parameters (declare (in) vec3 u) (declare (in) vec3 v)) ((declare () mat3 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref v) (swiz z (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) (signature mat3x4 (parameters - (declare (in) vec3 u) - (declare (in) vec4 v)) + (declare (in) vec4 u) + (declare (in) vec3 v)) ((declare () mat3x4 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref v) (swiz z (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) (signature mat4x2 (parameters - (declare (in) vec4 u) - (declare (in) vec2 v)) + (declare (in) vec2 u) + (declare (in) vec4 v)) ((declare () mat4x2 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref v) (swiz y (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref v) (swiz z (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref v) (swiz w (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) (signature mat4x3 (parameters - (declare (in) vec4 u) - (declare (in) vec3 v)) + (declare (in) vec3 u) + (declare (in) vec4 v)) ((declare () mat4x3 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref v) (swiz y (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref v) (swiz z (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref v) (swiz w (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) (signature mat4 (parameters (declare (in) vec4 u) (declare (in) vec4 v)) ((declare () mat4 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref v) (swiz x (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref v) (swiz y (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref v) (swiz z (var_ref u)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref v) (swiz w (var_ref u)))) -(return (var_ref m)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) )) - diff --git a/src/glsl/builtins/tools/generate_outerProductGLSL.py b/src/glsl/builtins/tools/generate_outerProductGLSL.py index 48fb72197c3..c561cc3ba14 100755 --- a/src/glsl/builtins/tools/generate_outerProductGLSL.py +++ b/src/glsl/builtins/tools/generate_outerProductGLSL.py @@ -4,11 +4,11 @@ def gen(x, y): type = "mat" + str(x) if x != y: type = type + "x" + str(y) - print type + " outerProduct(vec" + str(x) + " u, vec" + str(y) + " v)\n{" + print type + " outerProduct(vec" + str(y) + " u, vec" + str(x) + " v)\n{" print " " + type + " m;" for i in range(x): - print " m[" + str(i) + "] = v * u[" + str(i) + "];" + print " m[" + str(i) + "] = u * v[" + str(i) + "];" print " return m;\n}" print "#version 120" -- cgit v1.2.3 From 3fa1b85196b7d57c6c139e62000ac519b1b2320c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jul 2010 10:20:34 -0700 Subject: glsl2: Fix the implementation of atan(y, x). So many problems here. One is that we can't do the quadrant handling for all the channels at the same time, so we call the float(y, x) version multiple times. I'd also left out the x == 0 handling. Also, the quadrant handling was broken for y == 0, so there was a funny discontinuity on the +x side if you plugged in obvious values to test. I generated the atan(float y, float x) code from a short segment of GLSL and pasted it in by hand. It would be nice to automate that somehow. Fixes: glsl-fs-atan-1 glsl-fs-atan-2 --- src/glsl/builtin_function.cpp | 166 +++++++++++++++++++++--------------------- src/glsl/builtins/110/atan | 166 +++++++++++++++++++++--------------------- 2 files changed, 166 insertions(+), 166 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 3343cf5638b..eade72ad3a5 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -299,56 +299,66 @@ static const char *builtins_110_atan = { " (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" - " ((declare () float r)\n" - " (if (expression bool >\n" - " (expression float abs (var_ref x))\n" - " (constant float (.0001)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r) (call atan ((expression float /\n" - " (var_ref y)\n" - " (var_ref x)))))\n" - " (if (expression bool <\n" - " (var_ref x)\n" - " (constant float (0.0)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r)\n" - " (expression float +\n" - " (var_ref r)\n" - " (expression float *\n" - " (expression float sign (var_ref y))\n" - " (constant float (3.1415926))))))\n" - " ()))\n" - " ())\n" - " (return (var_ref r))))\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" - " (if (expression bool >\n" - " (expression vec2 abs (var_ref x))\n" - " (constant float (.0001)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r) (call atan ((expression vec2 /\n" - " (var_ref y)\n" - " (var_ref x)))))\n" - " (if (expression bool <\n" - " (var_ref x)\n" - " (constant float (0.0)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r)\n" - " (expression vec2 +\n" - " (var_ref r)\n" - " (expression vec2 *\n" - " (expression float sign (var_ref y))\n" - " (constant float (3.1415926))))))\n" - " ()))\n" - " ())\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" @@ -356,25 +366,18 @@ static const char *builtins_110_atan = { " (declare (in) vec3 y)\n" " (declare (in) vec3 x))\n" " ((declare () vec3 r)\n" - " (if (expression bool >\n" - " (expression vec3 abs (var_ref x))\n" - " (constant float (.0001)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r) (call atan ((expression vec3 /\n" - " (var_ref y)\n" - " (var_ref x)))))\n" - " (if (expression bool <\n" - " (var_ref x)\n" - " (constant float (0.0)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r)\n" - " (expression vec3 +\n" - " (var_ref r)\n" - " (expression vec3 *\n" - " (expression float sign (var_ref y))\n" - " (constant float (3.1415926))))))\n" - " ()))\n" - " ())\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" @@ -382,26 +385,23 @@ static const char *builtins_110_atan = { " (declare (in) vec4 y)\n" " (declare (in) vec4 x))\n" " ((declare () vec4 r)\n" - " (if (expression bool >\n" - " (expression vec4 abs (var_ref x))\n" - " (constant float (.0001)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r) (call atan ((expression vec4 /\n" - " (var_ref y)\n" - " (var_ref x)))))\n" - " (if (expression bool <\n" - " (var_ref x)\n" - " (constant float (0.0)))\n" - " ((assign (constant bool (1))\n" - " (var_ref r)\n" - " (expression vec4 +\n" - " (var_ref r)\n" - " (expression vec4 *\n" - " (expression float sign (var_ref y))\n" - " (constant float (3.1415926))))))\n" - " ()))\n" - " ())\n" - " (return (var_ref 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" }; diff --git a/src/glsl/builtins/110/atan b/src/glsl/builtins/110/atan index bcf75718e45..84048293870 100644 --- a/src/glsl/builtins/110/atan +++ b/src/glsl/builtins/110/atan @@ -47,56 +47,66 @@ (var_ref y_over_x)) (constant float (1.0)))))))))) - (signature float - (parameters - (declare (in) float y) - (declare (in) float x)) - ((declare () float r) - (if (expression bool > - (expression float abs (var_ref x)) - (constant float (.0001))) - ((assign (constant bool (1)) - (var_ref r) (call atan ((expression float / - (var_ref y) - (var_ref x))))) - (if (expression bool < - (var_ref x) - (constant float (0.0))) - ((assign (constant bool (1)) - (var_ref r) - (expression float + - (var_ref r) - (expression float * - (expression float sign (var_ref y)) - (constant float (3.1415926)))))) - ())) - ()) - (return (var_ref r)))) + (signature float + (parameters + (declare (in ) float y) + (declare (in ) float x) + ) + ( + (declare () float r) + (declare ( ) float abs_retval) + (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) )) +) + (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) ( + (declare ( ) float atan_retval) + (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) )) +) + (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) ) + (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( + (declare ( ) float assignment_tmp) + (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) + (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) + ) + ( + (declare ( ) float assignment_tmp) + (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) + (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) + )) + + ) + ( + )) + + ) + ( + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( + (assign (constant bool (1)) (var_ref r) (constant float (1.570796)) ) + ) + ( + (assign (constant bool (1)) (var_ref r) (constant float (-1.570796)) ) + )) + + )) + + (return (var_ref r) ) + )) + + (signature vec2 (parameters (declare (in) vec2 y) (declare (in) vec2 x)) ((declare () vec2 r) - (if (expression bool > - (expression vec2 abs (var_ref x)) - (constant float (.0001))) - ((assign (constant bool (1)) - (var_ref r) (call atan ((expression vec2 / - (var_ref y) - (var_ref x))))) - (if (expression bool < - (var_ref x) - (constant float (0.0))) - ((assign (constant bool (1)) - (var_ref r) - (expression vec2 + - (var_ref r) - (expression vec2 * - (expression float sign (var_ref y)) - (constant float (3.1415926)))))) - ())) - ()) + (assign (constant bool (1)) + (swiz x (var_ref r)) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) + (swiz y (var_ref r)) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) (return (var_ref r)))) (signature vec3 @@ -104,25 +114,18 @@ (declare (in) vec3 y) (declare (in) vec3 x)) ((declare () vec3 r) - (if (expression bool > - (expression vec3 abs (var_ref x)) - (constant float (.0001))) - ((assign (constant bool (1)) - (var_ref r) (call atan ((expression vec3 / - (var_ref y) - (var_ref x))))) - (if (expression bool < - (var_ref x) - (constant float (0.0))) - ((assign (constant bool (1)) - (var_ref r) - (expression vec3 + - (var_ref r) - (expression vec3 * - (expression float sign (var_ref y)) - (constant float (3.1415926)))))) - ())) - ()) + (assign (constant bool (1)) + (swiz x (var_ref r)) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) + (swiz y (var_ref r)) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (constant bool (1)) + (swiz z (var_ref r)) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) (return (var_ref r)))) (signature vec4 @@ -130,25 +133,22 @@ (declare (in) vec4 y) (declare (in) vec4 x)) ((declare () vec4 r) - (if (expression bool > - (expression vec4 abs (var_ref x)) - (constant float (.0001))) - ((assign (constant bool (1)) - (var_ref r) (call atan ((expression vec4 / - (var_ref y) - (var_ref x))))) - (if (expression bool < - (var_ref x) - (constant float (0.0))) - ((assign (constant bool (1)) - (var_ref r) - (expression vec4 + - (var_ref r) - (expression vec4 * - (expression float sign (var_ref y)) - (constant float (3.1415926)))))) - ())) - ()) - (return (var_ref r)))) + (assign (constant bool (1)) + (swiz x (var_ref r)) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) + (swiz y (var_ref r)) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (constant bool (1)) + (swiz z (var_ref r)) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (assign (constant bool (1)) + (swiz w (var_ref r)) + (call atan ((swiz w (var_ref y)) + (swiz w (var_ref x))))) + (return (var_ref r))))) )) -- cgit v1.2.3 From eb7e120f0f342541716882c211eca115c2cd0d21 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 2 Aug 2010 12:28:38 -0700 Subject: glsl2: Fix expression type in builtin tan(). Fixes glsl-fs-tan-1. --- src/glsl/builtin_function.cpp | 6 +++--- src/glsl/builtins/110/tan | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index eade72ad3a5..a8acff47315 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -2097,17 +2097,17 @@ static const char *builtins_110_tan = { " (signature vec2\n" " (parameters\n" " (declare (in) vec2 angle))\n" - " ((return (expression float / (expression float sin (var_ref angle)) (expression vec2 cos (var_ref 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 angle))\n" - " ((return (expression float / (expression float sin (var_ref angle)) (expression vec3 cos (var_ref 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 angle))\n" - " ((return (expression float / (expression float sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n" + " ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n" "))\n" }; diff --git a/src/glsl/builtins/110/tan b/src/glsl/builtins/110/tan index 3e04892a76c..99798631859 100644 --- a/src/glsl/builtins/110/tan +++ b/src/glsl/builtins/110/tan @@ -7,15 +7,15 @@ (signature vec2 (parameters (declare (in) vec2 angle)) - ((return (expression float / (expression float sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) + ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) (signature vec3 (parameters (declare (in) vec3 angle)) - ((return (expression float / (expression float sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) + ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) (signature vec4 (parameters (declare (in) vec4 angle)) - ((return (expression float / (expression float sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) + ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) )) -- cgit v1.2.3 From 2eed82ebc0435da40dd5b588efc9bef0946e8497 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 7 Aug 2010 01:11:43 -0700 Subject: texture_builtins.py: Fix cut and paste errors in function names. Some signatures were being generated with the wrong function name. --- src/glsl/builtins/130/textureProjGrad | 2 +- src/glsl/builtins/130/textureProjLod | 2 +- src/glsl/builtins/tools/texture_builtins.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/130/textureProjGrad b/src/glsl/builtins/130/textureProjGrad index a0142c5e683..b4bfa58c123 100644 --- a/src/glsl/builtins/130/textureProjGrad +++ b/src/glsl/builtins/130/textureProjGrad @@ -1,4 +1,4 @@ -((function textureLod +((function textureProjGrad (signature vec4 (parameters (declare (in) sampler1D sampler) diff --git a/src/glsl/builtins/130/textureProjLod b/src/glsl/builtins/130/textureProjLod index 9f4ce1b493d..d242f7e40fc 100644 --- a/src/glsl/builtins/130/textureProjLod +++ b/src/glsl/builtins/130/textureProjLod @@ -1,4 +1,4 @@ -((function textureLod +((function textureProjLod (signature vec4 (parameters (declare (in) sampler1D sampler) diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py index 23d53149161..c4672ae8c12 100755 --- a/src/glsl/builtins/tools/texture_builtins.py +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -156,7 +156,7 @@ with open(path.join(builtins_dir, "130", "texelFetch"), 'w') as sys.stdout: print "))" with open(path.join(builtins_dir, "130", "textureProjLod"), 'w') as sys.stdout: - print "((function textureLod" + print "((function textureProjLod" generate_fiu_sigs("txl", "1D", True) generate_fiu_sigs("txl", "1D", True, 2) generate_fiu_sigs("txl", "2D", True) @@ -175,7 +175,7 @@ with open(path.join(builtins_dir, "130", "textureGrad"), 'w') as sys.stdout: print ")\n)" with open(path.join(builtins_dir, "130", "textureProjGrad"), 'w') as sys.stdout: - print "((function textureLod" + print "((function textureProjGrad" generate_fiu_sigs("txd", "1D", True) generate_fiu_sigs("txd", "1D", True, 2) generate_fiu_sigs("txd", "2D", True) -- cgit v1.2.3 From 64b408529aefe0fb5968471431ec0a1b0abd7697 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 9 Aug 2010 14:03:04 -0700 Subject: texture_builtins.py: Remove useless comments. --- src/glsl/builtins/tools/texture_builtins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py index c4672ae8c12..33d9642ef78 100755 --- a/src/glsl/builtins/tools/texture_builtins.py +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -211,9 +211,9 @@ with open(path.join(builtins_dir, "EXT_texture_array", "textures"), 'w') as sys. with open(path.join(builtins_dir, "EXT_texture_array_fs", "textures"), 'w') as sys.stdout: print "((function texture1DArray" - generate_sigs("", "txb", "1DArray") # MOVE TO _fs + generate_sigs("", "txb", "1DArray") print ")\n (function texture2DArray" - generate_sigs("", "txb", "2DArray") # MOVE TO _fs + generate_sigs("", "txb", "2DArray") print ")\n (function shadow1DArray" generate_sigs("", "txb", "1DArrayShadow") print "))" -- cgit v1.2.3 From 261bbc011d11ab9e390cd5fe9f5151821eefaffa Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 12 Aug 2010 15:05:39 -0700 Subject: glsl2: Use Elements from main/compiler.h instead of open-coding --- src/glsl/builtin_function.cpp | 5 +---- src/glsl/builtin_types.h | 4 ---- src/glsl/builtins/tools/generate_builtins.pl | 5 +---- src/glsl/glsl_types.cpp | 1 + src/glsl/ir_variable.cpp | 5 +---- src/mesa/program/ir_to_mesa.cpp | 1 + 6 files changed, 5 insertions(+), 16 deletions(-) (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 12e6909a287..1d9a58a5caf 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -23,6 +23,7 @@ */ #include +#include "main/compiler.h" #include "glsl_parser_extras.h" #include "ir_reader.h" #include "program.h" @@ -4799,10 +4800,6 @@ static const char *functions_for_EXT_texture_array_fs [] = { builtins_EXT_texture_array_fs_textures, }; -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - void *builtin_mem_ctx = NULL; void diff --git a/src/glsl/builtin_types.h b/src/glsl/builtin_types.h index bfa4f3f5408..7b94aac666b 100644 --- a/src/glsl/builtin_types.h +++ b/src/glsl/builtin_types.h @@ -21,10 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - const glsl_type glsl_type::_error_type = glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, ""); diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl index 61d511da1d4..91ef8917b0a 100755 --- a/src/glsl/builtins/tools/generate_builtins.pl +++ b/src/glsl/builtins/tools/generate_builtins.pl @@ -62,6 +62,7 @@ print << 'EOF'; */ #include +#include "main/compiler.h" #include "glsl_parser_extras.h" #include "ir_reader.h" #include "program.h" @@ -110,10 +111,6 @@ foreach $version (@versions) { } print << 'EOF'; -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - void *builtin_mem_ctx = NULL; void diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 2aba1e0ac1d..8e80cf99e96 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -23,6 +23,7 @@ #include #include +#include "main/compiler.h" #include "glsl_symbol_table.h" #include "glsl_parser_extras.h" #include "glsl_types.h" diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp index d88cb515b47..917c06743b4 100644 --- a/src/glsl/ir_variable.cpp +++ b/src/glsl/ir_variable.cpp @@ -21,15 +21,12 @@ * DEALINGS IN THE SOFTWARE. */ +#include "main/compiler.h" #include "ir.h" #include "glsl_parser_extras.h" #include "glsl_symbol_table.h" #include "builtin_variables.h" -#ifndef Elements -#define Elements(x) (sizeof(x)/sizeof(*(x))) -#endif - static void generate_ARB_draw_buffers_variables(exec_list *, struct _mesa_glsl_parse_state *, bool, _mesa_glsl_parser_targets); diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index a9a6f977c01..ecb13069cb7 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -31,6 +31,7 @@ */ #include +#include "main/compiler.h" #include "ir.h" #include "ir_visitor.h" #include "ir_print_visitor.h" -- cgit v1.2.3 From 43ff8f1a4b90554eae489cebb7e05f983dd9ad66 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 11 Aug 2010 16:53:52 -0700 Subject: glsl2: Rework builtin function generation. Each language version/extension and target now has a "profile" containing all of the available builtin function prototypes. These are written in GLSL, and come directly out of the GLSL spec (except for expanding genType). A new builtins/ir/ folder contains the hand-written IR for each builtin, regardless of what version includes it. Only those definitions that have prototypes in the profile will be included. The autogenerated IR for texture builtins is no longer written to disk, so there's no longer any confusion as to what's hand-written or generated. All scripts are now in python instead of perl. --- src/glsl/Makefile | 5 +- src/glsl/builtin_function.cpp | 17087 +++++++++++++++---- src/glsl/builtins/110/abs | 21 - src/glsl/builtins/110/all | 16 - src/glsl/builtins/110/any | 16 - src/glsl/builtins/110/asin | 120 - src/glsl/builtins/110/atan | 154 - src/glsl/builtins/110/ceil | 21 - src/glsl/builtins/110/clamp | 50 - src/glsl/builtins/110/cos | 21 - src/glsl/builtins/110/cross | 7 - src/glsl/builtins/110/degrees | 21 - src/glsl/builtins/110/distance | 33 - src/glsl/builtins/110/dot | 25 - src/glsl/builtins/110/equal | 61 - src/glsl/builtins/110/exp | 21 - src/glsl/builtins/110/exp2 | 21 - src/glsl/builtins/110/faceforward | 37 - src/glsl/builtins/110/floor | 21 - src/glsl/builtins/110/fract | 22 - src/glsl/builtins/110/greaterThan | 61 - src/glsl/builtins/110/greaterThanEqual | 61 - src/glsl/builtins/110/inversesqrt | 21 - src/glsl/builtins/110/length | 21 - src/glsl/builtins/110/lessThan | 61 - src/glsl/builtins/110/lessThanEqual | 61 - src/glsl/builtins/110/log | 21 - src/glsl/builtins/110/log2 | 21 - src/glsl/builtins/110/matrixCompMult | 32 - src/glsl/builtins/110/max | 43 - src/glsl/builtins/110/min | 43 - src/glsl/builtins/110/mix | 50 - src/glsl/builtins/110/mod | 43 - src/glsl/builtins/110/noise_fake | 76 - src/glsl/builtins/110/normalize | 21 - src/glsl/builtins/110/not | 16 - src/glsl/builtins/110/notEqual | 61 - src/glsl/builtins/110/pow | 25 - src/glsl/builtins/110/radians | 21 - src/glsl/builtins/110/reflect | 58 - src/glsl/builtins/110/refract | 102 - src/glsl/builtins/110/sign | 21 - src/glsl/builtins/110/sin | 21 - src/glsl/builtins/110/smoothstep | 153 - src/glsl/builtins/110/sqrt | 21 - src/glsl/builtins/110/step | 68 - src/glsl/builtins/110/tan | 21 - src/glsl/builtins/110/textures | 213 - src/glsl/builtins/110_fs/derivatives | 73 - src/glsl/builtins/110_fs/textures | 113 - src/glsl/builtins/110_vs/ftransform | 9 - src/glsl/builtins/120/matrixCompMult | 61 - src/glsl/builtins/120/outerProduct | 92 - src/glsl/builtins/120/transpose | 139 - src/glsl/builtins/130/clamp | 99 - src/glsl/builtins/130/cosh | 30 - src/glsl/builtins/130/equal | 31 - src/glsl/builtins/130/greaterThan | 31 - src/glsl/builtins/130/greaterThanEqual | 31 - src/glsl/builtins/130/lessThan | 31 - src/glsl/builtins/130/lessThanEqual | 31 - src/glsl/builtins/130/max | 85 - src/glsl/builtins/130/min | 85 - src/glsl/builtins/130/mix | 39 - src/glsl/builtins/130/notEqual | 31 - src/glsl/builtins/130/sign | 22 - src/glsl/builtins/130/sinh | 30 - src/glsl/builtins/130/tanh | 42 - src/glsl/builtins/130/texelFetch | 107 - src/glsl/builtins/130/texture | 110 - src/glsl/builtins/130/textureGrad | 147 - src/glsl/builtins/130/textureLod | 128 - src/glsl/builtins/130/textureProj | 92 - src/glsl/builtins/130/textureProjGrad | 122 - src/glsl/builtins/130/textureProjLod | 107 - src/glsl/builtins/130_fs/texture | 128 - src/glsl/builtins/130_fs/textureProj | 107 - src/glsl/builtins/ARB_texture_rectangle/textures | 16 - src/glsl/builtins/EXT_texture_array/textures | 59 - src/glsl/builtins/EXT_texture_array_fs/textures | 27 - src/glsl/builtins/ir/abs | 21 + src/glsl/builtins/ir/acos | 22 + src/glsl/builtins/ir/all | 16 + src/glsl/builtins/ir/any | 16 + src/glsl/builtins/ir/asin | 97 + src/glsl/builtins/ir/atan | 154 + src/glsl/builtins/ir/ceil | 21 + src/glsl/builtins/ir/clamp | 148 + src/glsl/builtins/ir/cos | 21 + src/glsl/builtins/ir/cosh | 30 + src/glsl/builtins/ir/cross | 7 + src/glsl/builtins/ir/dFdx | 21 + src/glsl/builtins/ir/dFdy | 21 + src/glsl/builtins/ir/degrees | 21 + src/glsl/builtins/ir/distance | 33 + src/glsl/builtins/ir/dot | 25 + src/glsl/builtins/ir/equal | 91 + src/glsl/builtins/ir/exp | 21 + src/glsl/builtins/ir/exp2 | 21 + src/glsl/builtins/ir/faceforward | 37 + src/glsl/builtins/ir/floor | 21 + src/glsl/builtins/ir/fract | 22 + src/glsl/builtins/ir/ftransform | 9 + src/glsl/builtins/ir/fwidth | 29 + src/glsl/builtins/ir/greaterThan | 91 + src/glsl/builtins/ir/greaterThanEqual | 91 + src/glsl/builtins/ir/inversesqrt | 21 + src/glsl/builtins/ir/length | 21 + src/glsl/builtins/ir/lessThan | 91 + src/glsl/builtins/ir/lessThanEqual | 91 + src/glsl/builtins/ir/log | 21 + src/glsl/builtins/ir/log2 | 21 + src/glsl/builtins/ir/matrixCompMult | 91 + src/glsl/builtins/ir/max | 127 + src/glsl/builtins/ir/min | 127 + src/glsl/builtins/ir/mix | 88 + src/glsl/builtins/ir/mod | 43 + src/glsl/builtins/ir/noise1 | 18 + src/glsl/builtins/ir/noise2 | 18 + src/glsl/builtins/ir/noise3 | 18 + src/glsl/builtins/ir/noise4 | 18 + src/glsl/builtins/ir/normalize | 21 + src/glsl/builtins/ir/not | 16 + src/glsl/builtins/ir/notEqual | 91 + src/glsl/builtins/ir/outerProduct | 92 + src/glsl/builtins/ir/pow | 25 + src/glsl/builtins/ir/radians | 21 + src/glsl/builtins/ir/reflect | 58 + src/glsl/builtins/ir/refract | 102 + src/glsl/builtins/ir/sign | 42 + src/glsl/builtins/ir/sin | 21 + src/glsl/builtins/ir/sinh | 30 + src/glsl/builtins/ir/smoothstep | 153 + src/glsl/builtins/ir/sqrt | 21 + src/glsl/builtins/ir/step | 68 + src/glsl/builtins/ir/tan | 21 + src/glsl/builtins/ir/tanh | 42 + src/glsl/builtins/ir/transpose | 139 + src/glsl/builtins/profiles/110.frag | 364 + src/glsl/builtins/profiles/110.vert | 351 + src/glsl/builtins/profiles/120.frag | 396 + src/glsl/builtins/profiles/120.vert | 383 + .../builtins/profiles/ARB_texture_rectangle.frag | 7 + .../builtins/profiles/ARB_texture_rectangle.vert | 7 + src/glsl/builtins/profiles/EXT_texture_array.frag | 11 + src/glsl/builtins/profiles/EXT_texture_array.vert | 11 + src/glsl/builtins/tools/builtin_function.cpp | 39 + src/glsl/builtins/tools/generate_builtins.pl | 164 - src/glsl/builtins/tools/generate_builtins.py | 207 + src/glsl/builtins/tools/texture_builtins.py | 261 +- src/glsl/ir_reader.cpp | 24 +- src/glsl/ir_reader.h | 2 +- 152 files changed, 18318 insertions(+), 8265 deletions(-) delete mode 100644 src/glsl/builtins/110/abs delete mode 100644 src/glsl/builtins/110/all delete mode 100644 src/glsl/builtins/110/any delete mode 100644 src/glsl/builtins/110/asin delete mode 100644 src/glsl/builtins/110/atan delete mode 100644 src/glsl/builtins/110/ceil delete mode 100644 src/glsl/builtins/110/clamp delete mode 100644 src/glsl/builtins/110/cos delete mode 100644 src/glsl/builtins/110/cross delete mode 100644 src/glsl/builtins/110/degrees delete mode 100644 src/glsl/builtins/110/distance delete mode 100644 src/glsl/builtins/110/dot delete mode 100644 src/glsl/builtins/110/equal delete mode 100644 src/glsl/builtins/110/exp delete mode 100644 src/glsl/builtins/110/exp2 delete mode 100644 src/glsl/builtins/110/faceforward delete mode 100644 src/glsl/builtins/110/floor delete mode 100644 src/glsl/builtins/110/fract delete mode 100644 src/glsl/builtins/110/greaterThan delete mode 100644 src/glsl/builtins/110/greaterThanEqual delete mode 100644 src/glsl/builtins/110/inversesqrt delete mode 100644 src/glsl/builtins/110/length delete mode 100644 src/glsl/builtins/110/lessThan delete mode 100644 src/glsl/builtins/110/lessThanEqual delete mode 100644 src/glsl/builtins/110/log delete mode 100644 src/glsl/builtins/110/log2 delete mode 100644 src/glsl/builtins/110/matrixCompMult delete mode 100644 src/glsl/builtins/110/max delete mode 100644 src/glsl/builtins/110/min delete mode 100644 src/glsl/builtins/110/mix delete mode 100644 src/glsl/builtins/110/mod delete mode 100644 src/glsl/builtins/110/noise_fake delete mode 100644 src/glsl/builtins/110/normalize delete mode 100644 src/glsl/builtins/110/not delete mode 100644 src/glsl/builtins/110/notEqual delete mode 100644 src/glsl/builtins/110/pow delete mode 100644 src/glsl/builtins/110/radians delete mode 100644 src/glsl/builtins/110/reflect delete mode 100644 src/glsl/builtins/110/refract delete mode 100644 src/glsl/builtins/110/sign delete mode 100644 src/glsl/builtins/110/sin delete mode 100644 src/glsl/builtins/110/smoothstep delete mode 100644 src/glsl/builtins/110/sqrt delete mode 100644 src/glsl/builtins/110/step delete mode 100644 src/glsl/builtins/110/tan delete mode 100644 src/glsl/builtins/110/textures delete mode 100644 src/glsl/builtins/110_fs/derivatives delete mode 100644 src/glsl/builtins/110_fs/textures delete mode 100644 src/glsl/builtins/110_vs/ftransform delete mode 100644 src/glsl/builtins/120/matrixCompMult delete mode 100644 src/glsl/builtins/120/outerProduct delete mode 100644 src/glsl/builtins/120/transpose delete mode 100644 src/glsl/builtins/130/clamp delete mode 100644 src/glsl/builtins/130/cosh delete mode 100644 src/glsl/builtins/130/equal delete mode 100644 src/glsl/builtins/130/greaterThan delete mode 100644 src/glsl/builtins/130/greaterThanEqual delete mode 100644 src/glsl/builtins/130/lessThan delete mode 100644 src/glsl/builtins/130/lessThanEqual delete mode 100644 src/glsl/builtins/130/max delete mode 100644 src/glsl/builtins/130/min delete mode 100644 src/glsl/builtins/130/mix delete mode 100644 src/glsl/builtins/130/notEqual delete mode 100644 src/glsl/builtins/130/sign delete mode 100644 src/glsl/builtins/130/sinh delete mode 100644 src/glsl/builtins/130/tanh delete mode 100644 src/glsl/builtins/130/texelFetch delete mode 100644 src/glsl/builtins/130/texture delete mode 100644 src/glsl/builtins/130/textureGrad delete mode 100644 src/glsl/builtins/130/textureLod delete mode 100644 src/glsl/builtins/130/textureProj delete mode 100644 src/glsl/builtins/130/textureProjGrad delete mode 100644 src/glsl/builtins/130/textureProjLod delete mode 100644 src/glsl/builtins/130_fs/texture delete mode 100644 src/glsl/builtins/130_fs/textureProj delete mode 100644 src/glsl/builtins/ARB_texture_rectangle/textures delete mode 100644 src/glsl/builtins/EXT_texture_array/textures delete mode 100644 src/glsl/builtins/EXT_texture_array_fs/textures create mode 100644 src/glsl/builtins/ir/abs create mode 100644 src/glsl/builtins/ir/acos create mode 100644 src/glsl/builtins/ir/all create mode 100644 src/glsl/builtins/ir/any create mode 100644 src/glsl/builtins/ir/asin create mode 100644 src/glsl/builtins/ir/atan create mode 100644 src/glsl/builtins/ir/ceil create mode 100644 src/glsl/builtins/ir/clamp create mode 100644 src/glsl/builtins/ir/cos create mode 100644 src/glsl/builtins/ir/cosh create mode 100644 src/glsl/builtins/ir/cross create mode 100644 src/glsl/builtins/ir/dFdx create mode 100644 src/glsl/builtins/ir/dFdy create mode 100644 src/glsl/builtins/ir/degrees create mode 100644 src/glsl/builtins/ir/distance create mode 100644 src/glsl/builtins/ir/dot create mode 100644 src/glsl/builtins/ir/equal create mode 100644 src/glsl/builtins/ir/exp create mode 100644 src/glsl/builtins/ir/exp2 create mode 100644 src/glsl/builtins/ir/faceforward create mode 100644 src/glsl/builtins/ir/floor create mode 100644 src/glsl/builtins/ir/fract create mode 100644 src/glsl/builtins/ir/ftransform create mode 100644 src/glsl/builtins/ir/fwidth create mode 100644 src/glsl/builtins/ir/greaterThan create mode 100644 src/glsl/builtins/ir/greaterThanEqual create mode 100644 src/glsl/builtins/ir/inversesqrt create mode 100644 src/glsl/builtins/ir/length create mode 100644 src/glsl/builtins/ir/lessThan create mode 100644 src/glsl/builtins/ir/lessThanEqual create mode 100644 src/glsl/builtins/ir/log create mode 100644 src/glsl/builtins/ir/log2 create mode 100644 src/glsl/builtins/ir/matrixCompMult create mode 100644 src/glsl/builtins/ir/max create mode 100644 src/glsl/builtins/ir/min create mode 100644 src/glsl/builtins/ir/mix create mode 100644 src/glsl/builtins/ir/mod create mode 100644 src/glsl/builtins/ir/noise1 create mode 100644 src/glsl/builtins/ir/noise2 create mode 100644 src/glsl/builtins/ir/noise3 create mode 100644 src/glsl/builtins/ir/noise4 create mode 100644 src/glsl/builtins/ir/normalize create mode 100644 src/glsl/builtins/ir/not create mode 100644 src/glsl/builtins/ir/notEqual create mode 100644 src/glsl/builtins/ir/outerProduct create mode 100644 src/glsl/builtins/ir/pow create mode 100644 src/glsl/builtins/ir/radians create mode 100644 src/glsl/builtins/ir/reflect create mode 100644 src/glsl/builtins/ir/refract create mode 100644 src/glsl/builtins/ir/sign create mode 100644 src/glsl/builtins/ir/sin create mode 100644 src/glsl/builtins/ir/sinh create mode 100644 src/glsl/builtins/ir/smoothstep create mode 100644 src/glsl/builtins/ir/sqrt create mode 100644 src/glsl/builtins/ir/step create mode 100644 src/glsl/builtins/ir/tan create mode 100644 src/glsl/builtins/ir/tanh create mode 100644 src/glsl/builtins/ir/transpose create mode 100644 src/glsl/builtins/profiles/110.frag create mode 100644 src/glsl/builtins/profiles/110.vert create mode 100644 src/glsl/builtins/profiles/120.frag create mode 100644 src/glsl/builtins/profiles/120.vert create mode 100644 src/glsl/builtins/profiles/ARB_texture_rectangle.frag create mode 100644 src/glsl/builtins/profiles/ARB_texture_rectangle.vert create mode 100644 src/glsl/builtins/profiles/EXT_texture_array.frag create mode 100644 src/glsl/builtins/profiles/EXT_texture_array.vert create mode 100644 src/glsl/builtins/tools/builtin_function.cpp delete mode 100755 src/glsl/builtins/tools/generate_builtins.pl create mode 100755 src/glsl/builtins/tools/generate_builtins.py (limited to 'src/glsl/builtins') diff --git a/src/glsl/Makefile b/src/glsl/Makefile index 110228e72a1..b13a612591b 100644 --- a/src/glsl/Makefile +++ b/src/glsl/Makefile @@ -164,7 +164,8 @@ glcpp/glcpp-lex.c: glcpp/glcpp-lex.l glcpp/glcpp-parse.c: glcpp/glcpp-parse.y bison -v -o "$@" --defines=glcpp/glcpp-parse.h $< -builtin_function.cpp: builtins/*/* - ./builtins/tools/generate_builtins.pl > builtin_function.cpp +builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py + cp builtins/tools/builtin_function.cpp . + ./builtins/tools/generate_builtins.py > builtin_function.cpp -include depend diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index 1d9a58a5caf..f2abea961d2 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -1,4 +1,4 @@ -/* DO NOT MODIFY - automatically generated by generate_builtins.pl */ +/* DO NOT MODIFY - automatically generated by generate_builtins.py */ /* * Copyright © 2010 Intel Corporation * @@ -27,12 +27,13 @@ #include "glsl_parser_extras.h" #include "ir_reader.h" #include "program.h" +#include "ast.h" extern "C" struct gl_shader * _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); gl_shader * -read_builtins(GLenum target, const char **functions, unsigned count) +read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) { gl_shader *sh = _mesa_new_shader(NULL, 0, target); struct _mesa_glsl_parse_state *st = @@ -46,13 +47,19 @@ read_builtins(GLenum target, const char **functions, unsigned count) sh->ir = new(sh) exec_list; sh->symbols = st->symbols; + /* Read the IR containing the prototypes */ + _mesa_glsl_read_ir(st, sh->ir, protos, true); + + /* Read ALL the function bodies, telling the IR reader not to scan for + * prototypes (we've already created them). The IR reader will skip any + * signature that does not already exist as a prototype. + */ for (unsigned i = 0; i < count; i++) { - _mesa_glsl_read_ir(st, sh->ir, functions[i]); + _mesa_glsl_read_ir(st, sh->ir, functions[i], false); if (st->error) { - printf("error reading builtin: %.35s ...\n", functions[i]); - delete st; - talloc_free(sh); + printf("error reading builtin: %.35s ...\n", functions[i]); + talloc_free(sh); return NULL; } } @@ -63,33 +70,7 @@ read_builtins(GLenum target, const char **functions, unsigned count) return sh; } -/* 110 builtins */ - -static const char *builtins_110_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 *builtins_110_all = { +static const char *builtin_all = "((function all\n" " (signature bool\n" " (parameters\n" @@ -106,2498 +87,2450 @@ static const char *builtins_110_all = { " (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 *builtins_110_any = { - "((function any\n" - " (signature bool\n" + "" +; +static const char *builtin_textureProj = + "((function textureProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bool || (swiz x (var_ref arg0))(swiz y (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 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) 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 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" - "))\n" -}; - -static const char *builtins_110_asin = { - "((function asin\n" - " (signature float\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" " (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) 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 vec2\n" + " (signature ivec4\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" + " (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 vec3\n" + " (signature uvec4\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" + " (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 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" + " (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" - " (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" + " (signature ivec4\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" + " (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) vec3 x))\n" - " ((return (expression vec3 - (constant float (1.5707963))\n" - " (call asin ((var_ref x)))))))\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" " (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 *builtins_110_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" + " (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 vec2\n" + " (signature ivec4\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" + " (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 vec3\n" + " (signature uvec4\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" + " (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) 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" + " (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 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" + " (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" - " ))\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" - " (return (var_ref r) )\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 vec2\n" + " (signature vec4\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" + " (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 vec3\n" + " (signature ivec4\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) 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 vec4\n" + " (signature uvec4\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) 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" -}; - -static const char *builtins_110_ceil = { - "((function ceil\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float ceil (var_ref arg0)))))\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 vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 ceil (var_ref arg0)))))\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 vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 ceil (var_ref arg0)))))\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 arg0))\n" - " ((return (expression vec4 ceil (var_ref arg0)))))\n" - "))\n" -}; - -static const char *builtins_110_clamp = { - "((function clamp\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) 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 vec2\n" + " (signature ivec4\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) 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 vec3\n" + " (signature uvec4\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) 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) 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) 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 vec2\n" + " (signature ivec4\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) 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 vec3\n" + " (signature uvec4\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) 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" - " (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" -}; - -static const char *builtins_110_cos = { - "((function cos\n" + "" +; +static const char *builtin_fwidth = + "((function fwidth\n" " (signature float\n" " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float cos (var_ref angle)))))\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 angle))\n" - " ((return (expression vec2 cos (var_ref angle)))))\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 angle))\n" - " ((return (expression vec3 cos (var_ref angle)))))\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 angle))\n" - " ((return (expression vec4 cos (var_ref angle)))))\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" -}; - -static const char *builtins_110_cross = { - "((function cross\n" - " (signature vec3\n" + "" +; +static const char *builtin_texture2DProj = + "((function texture2DProj\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" - "))\n" -}; - -static const char *builtins_110_degrees = { - "((function degrees\n" - " (signature float\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) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (57.295780))))))\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 vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (57.295780))))))\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 vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (57.295780))))))\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) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (57.295780))))))\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" + "\n" "))\n" -}; - -static const char *builtins_110_distance = { - "((function distance\n" - " (signature float\n" + "" +; +static const char *builtin_texture3DLod = + "((function texture3DLod\n" + " (signature vec4\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) 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" - " (signature float\n" + "))\n" + "" +; +static const char *builtin_textureCubeLod = + "((function textureCubeLod\n" + " (signature vec4\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) 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 float\n" + "))\n" + "" +; +static const char *builtin_texture = + "((function texture\n" + " (signature vec4\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) sampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature float\n" + " (signature ivec4\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" - "))\n" -}; - -static const char *builtins_110_dot = { - "((function dot\n" - " (signature float\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) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\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 float\n" + " (signature vec4\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) sampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature float\n" + " (signature ivec4\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) isampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature float\n" + " (signature uvec4\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 *builtins_110_equal = { - "((function equal\n" - " (signature bvec2\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) 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) sampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\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) isampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature bvec4\n" + " (signature uvec4\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) usampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature bvec2\n" + " (signature vec4\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) samplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\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) isamplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature bvec4\n" + " (signature uvec4\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" -}; - -static const char *builtins_110_exp = { - "((function exp\n" - " (signature float\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) float arg0))\n" - " ((return (expression float exp (var_ref arg0)))))\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 vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp (var_ref arg0)))))\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 vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp (var_ref arg0)))))\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) vec4 arg0))\n" - " ((return (expression vec4 exp (var_ref arg0)))))\n" - "))\n" -}; - -static const char *builtins_110_exp2 = { - "((function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float exp2 (var_ref arg0)))))\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 vec2\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp2 (var_ref arg0)))))\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" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp2 (var_ref arg0)))))\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) vec4 arg0))\n" - " ((return (expression vec4 exp2 (var_ref arg0)))))\n" - "))\n" -}; - -static const char *builtins_110_faceforward = { - "((function faceforward\n" - " (signature float\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" " (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) 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 vec2\n" + " (signature uvec4\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) 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 vec3\n" + " (signature vec4\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) 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" + " (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" + " (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" " (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" + " (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 ivec4\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" + "\n" + " (signature uvec4\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" + "\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" + " (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" + "\n" + " (signature ivec4\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" + "\n" + " (signature uvec4\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" + "\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" "))\n" -}; - -static const char *builtins_110_floor = { - "((function floor\n" + "" +; +static const char *builtin_degrees = + "((function degrees\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0))\n" - " ((return (expression float floor (var_ref arg0)))))\n" + " ((return (expression float * (var_ref arg0) (constant float (57.295780))))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 floor (var_ref arg0)))))\n" + " ((return (expression vec2 * (var_ref arg0) (constant float (57.295780))))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 floor (var_ref arg0)))))\n" + " ((return (expression vec3 * (var_ref arg0) (constant float (57.295780))))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 floor (var_ref arg0)))))\n" + " ((return (expression vec4 * (var_ref arg0) (constant float (57.295780))))))\n" "))\n" -}; - -static const char *builtins_110_fract = { - "((function fract\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" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float fract (var_ref x)))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float ceil (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 fract (var_ref x)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 ceil (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 fract (var_ref x)))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 ceil (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 fract (var_ref x)))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 ceil (var_ref arg0)))))\n" "))\n" - "\n" -}; - -static const char *builtins_110_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" + "" +; +static const char *builtin_texture1D = + "((function texture1D\n" + " (signature vec4\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) sampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\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) 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_not = + "((function not\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" + " (declare (in) bvec2 arg0))\n" + " ((return (expression bvec2 ! (var_ref arg0)))))\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" + " (declare (in) bvec3 arg0))\n" + " ((return (expression bvec3 ! (var_ref arg0)))))\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) bvec4 arg0))\n" + " ((return (expression bvec4 ! (var_ref arg0)))))\n" "))\n" -}; - -static const char *builtins_110_greaterThanEqual = { - "((function greaterThanEqual\n" - " (signature bvec2\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" + "\n" + " (signature vec4\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" + "\n" + "))\n" + "" +; +static const char *builtin_mod = + "((function mod\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" + "\n" + " (signature vec2\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" + " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec3\n" + " (signature vec3\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" + " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\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" + " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec2\n" + " (signature vec2\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) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature bvec3\n" + " (signature vec3\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) vec3 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\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) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" "))\n" -}; - -static const char *builtins_110_inversesqrt = { - "((function inversesqrt\n" + "" +; +static const char *builtin_radians = + "((function radians\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0))\n" - " ((return (expression float rsq (var_ref arg0)))))\n" + " ((return (expression float * (var_ref arg0) (constant float (0.017453))))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 rsq (var_ref arg0)))))\n" + " ((return (expression vec2 * (var_ref arg0) (constant float (0.017453))))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 rsq (var_ref arg0)))))\n" + " ((return (expression vec3 * (var_ref arg0) (constant float (0.017453))))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 rsq (var_ref arg0)))))\n" + " ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n" "))\n" -}; - -static const char *builtins_110_length = { - "((function length\n" + "" +; +static const char *builtin_smoothstep = + "((function smoothstep\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" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) float x))\n" + " ((declare () float t)\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" + " (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 float\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\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" - " (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 *builtins_110_lessThan = { - "((function lessThan\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" + " (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 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" + " (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 bvec4\n" + " (signature vec3\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) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec3 x))\n" + " ((declare () vec3 t)\n" + " (declare () vec3 retval)\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" + " (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 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" + " (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" - " (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" -}; - -static const char *builtins_110_lessThanEqual = { - "((function lessThanEqual\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" + " (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" - " (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" + " (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) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec4 x))\n" + " ((declare () vec4 t)\n" + " (declare () vec4 retval)\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" + " (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 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" + " (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" - " (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" -}; - -static const char *builtins_110_log = { - "((function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log (var_ref arg0)))))\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) vec2 arg0))\n" - " ((return (expression vec2 log (var_ref arg0)))))\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 vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 log (var_ref arg0)))))\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 vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 log (var_ref arg0)))))\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" -}; - -static const char *builtins_110_log2 = { - "((function log2\n" - " (signature float\n" + "\n" + "" +; +static const char *builtin_textureProjGrad = + "((function textureProjGrad\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log2 (var_ref arg0)))))\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" - " ((return (expression vec2 log2 (var_ref arg0)))))\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" - " ((return (expression vec3 log2 (var_ref arg0)))))\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" - " ((return (expression vec4 log2 (var_ref arg0)))))\n" - "))\n" -}; - -static const char *builtins_110_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" + " (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 mat3\n" + " (signature ivec4\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" + " (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 mat4\n" + " (signature uvec4\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" + " (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" -}; - -static const char *builtins_110_max = { - "((function max\n" - " (signature float\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) 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 vec2\n" + " (signature ivec4\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) 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 vec3\n" + " (signature uvec4\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) 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" " (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) 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 vec2\n" + " (signature ivec4\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) 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 vec3\n" + " (signature uvec4\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) 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 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" -}; - -static const char *builtins_110_min = { - "((function min\n" - " (signature float\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) 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 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) 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 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) 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 vec4\n" + "))\n" + "" +; +static const char *builtin_dFdx = + "((function dFdx\n" + " (signature float\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) float p))\n" + " ((return (expression float dFdx (var_ref p)))))\n" "\n" " (signature vec2\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) vec2 p))\n" + " ((return (expression vec2 dFdx (var_ref p)))))\n" "\n" " (signature vec3\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) vec3 p))\n" + " ((return (expression vec3 dFdx (var_ref p)))))\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) vec4 p))\n" + " ((return (expression vec4 dFdx (var_ref p)))))\n" "))\n" -}; - -static const char *builtins_110_mix = { - "((function mix\n" + "" +; +static const char *builtin_dFdy = + "((function dFdy\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" + " (declare (in) float p))\n" + " ((return (expression float dFdy (var_ref p)))))\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" + " (declare (in) vec2 p))\n" + " ((return (expression vec2 dFdy (var_ref p)))))\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" + " (declare (in) vec3 p))\n" + " ((return (expression vec3 dFdy (var_ref p)))))\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 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n" + " (declare (in) vec4 p))\n" + " ((return (expression vec4 dFdy (var_ref p)))))\n" + "))\n" + "" +; +static const char *builtin_textureGrad = + "((function textureGrad\n" + " (signature vec4\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" "\n" - " (signature vec2\n" + " (signature ivec4\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" + " (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 vec3\n" + " (signature uvec4\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) 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 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" - "))\n" -}; - -static const char *builtins_110_mod = { - "((function mod\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) 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 vec2\n" + " (signature ivec4\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) 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 vec3\n" + " (signature uvec4\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) 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 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) 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 vec2\n" + " (signature ivec4\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) 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 vec3\n" + " (signature uvec4\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) 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" " (parameters\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 *builtins_110_noise_fake = { - "((function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant float (0)))))\n" - " )\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" - " (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" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec2 (0 0)))))\n" - " )\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" - " (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" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " )\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" - " (function noise4\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" - " (signature vec4\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 ivec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" - " (signature vec4\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 uvec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\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 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" - " )\n" - ")\n" -}; - -static const char *builtins_110_normalize = { - "((function normalize\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" + " (signature ivec4\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" + "\n" + " (signature uvec4\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" + "))\n" + "" +; +static const char *builtin_clamp = + "((function clamp\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" + " (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 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" + " (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 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" + " (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) 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 *builtins_110_not = { - "((function not\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bvec2 ! (var_ref arg0)))))\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" - " (signature bvec3\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) bvec3 arg0))\n" - " ((return (expression bvec3 ! (var_ref arg0)))))\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" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bvec4 ! (var_ref arg0)))))\n" - "))\n" -}; - -static const char *builtins_110_notEqual = { - "((function notEqual\n" - " (signature bvec2\n" + " (signature vec3\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) 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" - " (signature bvec3\n" + " (signature vec4\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) 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 bvec4\n" + " (signature int\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) 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 bvec2\n" + " (signature ivec2\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) 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 bvec3\n" + " (signature ivec3\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) 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 bvec4\n" + " (signature ivec4\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" -}; - -static const char *builtins_110_pow = { - "((function pow\n" - " (signature float\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 ivec2\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) 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 vec2\n" + " (signature ivec3\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) 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 vec3\n" + " (signature ivec4\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) 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 vec4\n" + " (signature uint\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n" - "))\n" -}; - -static const char *builtins_110_radians = { - "((function radians\n" - " (signature float\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 uvec2\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (0.017453))))))\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 vec2\n" + " (signature uvec3\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (0.017453))))))\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 vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (0.017453))))))\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) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n" - "))\n" -}; - -static const char *builtins_110_reflect = { - "((function reflect\n" - " (signature float\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 uvec3\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" - "\n" - " (signature vec2\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) 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 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" - "\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) 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) 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 *builtins_110_refract = { - "((function refract\n" + "" +; +static const char *builtin_cosh = + "((function cosh\n" " (signature float\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" - "\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) 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" + " (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 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" + " (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 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) 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" + " (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" "\n" "))\n" -}; - -static const char *builtins_110_sign = { - "((function sign\n" + "" +; +static const char *builtin_asin = + "((function asin\n" " (signature float\n" " (parameters\n" " (declare (in) float x))\n" - " ((return (expression float sign (var_ref 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 vec2\n" " (parameters\n" " (declare (in) vec2 x))\n" - " ((return (expression vec2 sign (var_ref 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 sign (var_ref 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 sign (var_ref x)))))\n" - "))\n" -}; - -static const char *builtins_110_sin = { - "((function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float sin (var_ref angle)))))\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" "\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 sin (var_ref angle)))))\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 angle))\n" - " ((return (expression vec3 sin (var_ref angle)))))\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 angle))\n" - " ((return (expression vec4 sin (var_ref angle)))))\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 *builtins_110_smoothstep = { - "((function smoothstep\n" - " (signature float\n" + "" +; +static const char *builtin_lessThan = + "((function lessThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ((declare () float t)\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" - " (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" + " (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 vec2\n" + " (signature bvec4\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" + " (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" - " (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" + " (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" - " (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" + " (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 vec3\n" + " (signature bvec4\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" + " (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" - " (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" + " (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" - " (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" + " (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" - " (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" + " (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_shadow2DProj = + "((function shadow2DProj\n" + " (signature vec4\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" "\n" + " (signature vec4\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" "\n" + "))\n" + "" +; +static const char *builtin_textureLod = + "((function textureLod\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" + " (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" - " (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" + " (signature ivec4\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" - " (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" + " (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" - " (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" + " (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" - " (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" + " (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" "\n" - " (signature vec2\n" + " (signature uvec4\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) 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" "\n" - " (signature vec3\n" + " (signature vec4\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) 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" + " (signature ivec4\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" + "\n" + " (signature uvec4\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" "\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" - "))\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" -}; - -static const char *builtins_110_sqrt = { - "((function sqrt\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float sqrt (var_ref arg0)))))\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 vec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 sqrt (var_ref arg0)))))\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 vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 sqrt (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" + " (signature ivec4\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" + "\n" + " (signature uvec4\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" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 sqrt (var_ref arg0)))))\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" "))\n" -}; - -static const char *builtins_110_step = { - "((function step\n" + "" +; +static const char *builtin_faceforward = + "((function faceforward\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" + " (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) 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" + " (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) 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" + " (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) 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) 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" "\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" + " ((return (expression vec2 abs (var_ref arg0)))))\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" + " ((return (expression vec3 abs (var_ref arg0)))))\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" + " ((return (expression vec4 abs (var_ref arg0)))))\n" "))\n" - "\n" -}; - -static const char *builtins_110_tan = { - "((function tan\n" + "" +; +static const char *builtin_log2 = + "((function log2\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) float arg0))\n" + " ((return (expression float log2 (var_ref arg0)))))\n" "\n" " (signature vec2\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) vec2 arg0))\n" + " ((return (expression vec2 log2 (var_ref arg0)))))\n" "\n" " (signature vec3\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) vec3 arg0))\n" + " ((return (expression vec3 log2 (var_ref arg0)))))\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" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 log2 (var_ref arg0)))))\n" "))\n" -}; - -static const char *builtins_110_textures = { - "((function texture1D\n" + "" +; +static const char *builtin_shadow2DRect = + "((function shadow2DRect\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) 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" - " (function texture1DLod\n" - " (signature vec4\n" + "))\n" + "" +; +static const char *builtin_lessThanEqual = + "((function lessThanEqual\n" + " (signature bvec2\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) 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" - ")\n" - " (function texture1DProj\n" - " (signature vec4\n" + " (signature bvec3\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) 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 vec4\n" + " (signature bvec4\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) 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" - ")\n" - " (function texture1DProjLod\n" - " (signature vec4\n" + " (signature bvec2\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) 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 vec4\n" + " (signature bvec3\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) 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" - ")\n" - " (function texture2D\n" - " (signature vec4\n" + " (signature bvec4\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) 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" - ")\n" - "(function texture2DLod\n" - " (signature vec4\n" + " (signature bvec2\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) 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" - ")\n" - " (function texture2DProj\n" - " (signature vec4\n" + " (signature bvec3\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) 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 vec4\n" + " (signature bvec4\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" - "\n" - ")\n" - " (function texture2DProjLod\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_transpose = + "((function transpose\n" + " (signature mat2\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) 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 vec4\n" + " (signature mat3x2\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) 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" - ")\n" - " (function texture3D\n" - " (signature vec4\n" + " (signature mat4x2\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) 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" - ")\n" - " (function texture3DLod\n" - " (signature vec4\n" + " (signature mat2x3\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) 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" - ")\n" - " (function texture3DProj\n" - " (signature vec4\n" + " (signature mat3\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) 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" - " (function texture3DProjLod\n" - " (signature vec4\n" + " (signature mat4x3\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" + " (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" - ")\n" - " (function textureCube\n" - " (signature vec4\n" + " (signature mat2x4\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) 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" - ")\n" - " (function textureCubeLod\n" - " (signature vec4\n" + " (signature mat3x4\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) 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" - ")\n" - " (function shadow1D\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" - "\n" - ")\n" - " (function shadow1DLod\n" - " (signature vec4\n" + " (signature mat4\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" - "\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" - " (function shadow1DProj\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" "\n" ")\n" - " (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" "\n" - ")\n" - " (function shadow2D\n" - " (signature vec4\n" + "" +; +static const char *builtin_step = + "((function step\n" + " (signature float\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) float edge)\n" + " (declare (in) float x))\n" + " ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge))))))\n" "\n" - ")\n" - " (function shadow2DLod\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\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" + " (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" - ")\n" - " (function shadow2DProj\n" - " (signature vec4\n" + " (signature vec3\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) 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" - ")\n" - " (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 *functions_for_110 [] = { - builtins_110_abs, - builtins_110_all, - builtins_110_any, - builtins_110_asin, - builtins_110_atan, - builtins_110_ceil, - builtins_110_clamp, - builtins_110_cos, - builtins_110_cross, - builtins_110_degrees, - builtins_110_distance, - builtins_110_dot, - builtins_110_equal, - builtins_110_exp, - builtins_110_exp2, - builtins_110_faceforward, - builtins_110_floor, - builtins_110_fract, - builtins_110_greaterThan, - builtins_110_greaterThanEqual, - builtins_110_inversesqrt, - builtins_110_length, - builtins_110_lessThan, - builtins_110_lessThanEqual, - builtins_110_log, - builtins_110_log2, - builtins_110_matrixCompMult, - builtins_110_max, - builtins_110_min, - builtins_110_mix, - builtins_110_mod, - builtins_110_noise_fake, - builtins_110_normalize, - builtins_110_not, - builtins_110_notEqual, - builtins_110_pow, - builtins_110_radians, - builtins_110_reflect, - builtins_110_refract, - builtins_110_sign, - builtins_110_sin, - builtins_110_smoothstep, - builtins_110_sqrt, - builtins_110_step, - builtins_110_tan, - builtins_110_textures, -}; - -/* 110_fs builtins */ - -static const char *builtins_110_fs_derivatives = { - "((function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdx (var_ref p)))))\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 p))\n" - " ((return (expression vec2 dFdx (var_ref p)))))\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 p))\n" - " ((return (expression vec3 dFdx (var_ref p)))))\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 vec4\n" " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 dFdx (var_ref p)))))\n" - " )\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" - " (function dFdy\n" + "" +; +static const char *builtin_sinh = + "((function sinh\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdy (var_ref p)))))\n" - "\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) vec2 p))\n" - " ((return (expression vec2 dFdy (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 p))\n" - " ((return (expression vec3 dFdy (var_ref p)))))\n" - "\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 p))\n" - " ((return (expression vec4 dFdy (var_ref p)))))\n" - " )\n" - "\n" - " (function fwidth\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_cos = + "((function cos\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 angle))\n" + " ((return (expression float cos (var_ref angle)))))\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 angle))\n" + " ((return (expression vec2 cos (var_ref angle)))))\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 angle))\n" + " ((return (expression vec3 cos (var_ref angle)))))\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 angle))\n" + " ((return (expression vec4 cos (var_ref angle)))))\n" "))\n" -}; - -static const char *builtins_110_fs_textures = { - "((function texture1D\n" + "" +; +static const char *builtin_shadow2DProjLod = + "((function shadow2DProjLod\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" + " (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" - " (function texture1DProj\n" + "))\n" + "" +; +static const char *builtin_shadow2DArray = + "((function shadow2DArray\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" + " (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 vec4\n" + "))\n" + "" +; +static const char *builtin_equal = + "((function equal\n" + " (signature bvec2\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) 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" - ")\n" - " (function texture2D\n" - " (signature vec4\n" + " (signature bvec3\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" + " (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" - ")\n" - " (function texture2DProj\n" - " (signature vec4\n" + " (signature bvec4\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) 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) 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) 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" - " (function texture3D\n" - " (signature vec4\n" + " (signature bvec3\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) 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" - ")\n" - " (function texture3DProj\n" - " (signature vec4\n" + " (signature bvec4\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" + " (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" - ")\n" - " (function textureCube\n" - " (signature vec4\n" + " (signature bvec2\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" + " (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" - ")\n" - " (function shadow1D\n" - " (signature vec4\n" + " (signature bvec3\n" " (parameters\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" + " (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" - ")\n" - " (function shadow1DProj\n" - " (signature vec4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) sampler1DShadow 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)) (swiz z (var_ref P)) (var_ref bias) ))))\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" - ")\n" - " (function shadow2D\n" - " (signature vec4\n" + " (signature float\n" " (parameters\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" + " (declare (in) vec2 arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" "\n" - ")\n" - " (function shadow2DProj\n" - " (signature vec4\n" + " (signature float\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) 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 *functions_for_110_fs [] = { - builtins_110_fs_derivatives, - builtins_110_fs_textures, -}; - -/* 110_vs builtins */ - -static const char *builtins_110_vs_ftransform = { - "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" - " (declare (in) vec4 gl_Vertex)\n" - " (function ftransform\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" - " ((return (expression vec4 *\n" - " (var_ref gl_ModelViewProjectionMatrix)\n" - " (var_ref gl_Vertex)))))\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 *functions_for_110_vs [] = { - builtins_110_vs_ftransform, -}; - -/* 120 builtins */ - -static const char *builtins_120_matrixCompMult = { + "" +; +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" @@ -2658,533 +2591,593 @@ static const char *builtins_120_matrixCompMult = { " (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 *builtins_120_outerProduct = { - "((function outerProduct\n" - " (signature mat2\n" + "" +; +static const char *builtin_pow = + "((function pow\n" + " (signature float\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" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float pow (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature mat2x3\n" + " (signature vec2\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) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression vec2 pow (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature mat2x4\n" + " (signature vec3\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) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 pow (var_ref arg0) (var_ref arg1)))))\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" - "\n" - " (signature mat3\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n" + "))\n" + "" +; +static const char *builtin_texture2DProjLod = + "((function texture2DProjLod\n" + " (signature vec4\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) 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" "\n" - " (signature mat3x4\n" + " (signature vec4\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) 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 mat4x2\n" + "))\n" + "" +; +static const char *builtin_textureProjLod = + "((function textureProjLod\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) 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 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) 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 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 *builtins_120_transpose = { - "((function transpose\n" - " (signature mat2\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) 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) 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 mat3x2\n" + " (signature ivec4\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) 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 mat4x2\n" + " (signature uvec4\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) 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 mat2x3\n" + " (signature vec4\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) 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" "\n" - " (signature mat3\n" + " (signature ivec4\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) 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 mat4x3\n" + " (signature uvec4\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) usampler2D 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 mat2x4\n" + " (signature vec4\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) 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 mat3x4\n" + " (signature ivec4\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) 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 mat4\n" + " (signature uvec4\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" + " (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" - ")\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" -}; - -static const char *functions_for_120 [] = { - builtins_120_matrixCompMult, - builtins_120_outerProduct, - builtins_120_transpose, -}; - -/* 130 builtins */ - -static const char *builtins_130_clamp = { - "((function clamp\n" - " (signature int\n" + " (signature ivec4\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" + " (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 ivec2\n" + " (signature uvec4\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) 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 ivec3\n" + "))\n" + "" +; +static const char *builtin_log = + "((function log\n" + " (signature float\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) float arg0))\n" + " ((return (expression float log (var_ref arg0)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\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) vec2 arg0))\n" + " ((return (expression vec2 log (var_ref arg0)))))\n" "\n" - " (signature ivec2\n" + " (signature vec3\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) vec3 arg0))\n" + " ((return (expression vec3 log (var_ref arg0)))))\n" "\n" - " (signature ivec3\n" + " (signature vec4\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) vec4 arg0))\n" + " ((return (expression vec4 log (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 ivec4\n" + " (signature vec2\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) vec2 arg0))\n" + " ((return (expression vec2 exp2 (var_ref arg0)))))\n" "\n" - " (signature uint\n" + " (signature vec3\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) vec3 arg0))\n" + " ((return (expression vec3 exp2 (var_ref arg0)))))\n" "\n" - " (signature uvec2\n" + " (signature vec4\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) vec4 arg0))\n" + " ((return (expression vec4 exp2 (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_fract = + "((function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (expression float fract (var_ref x)))))\n" "\n" - " (signature uvec3\n" + " (signature vec2\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) vec2 x))\n" + " ((return (expression vec2 fract (var_ref x)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\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) vec3 x))\n" + " ((return (expression vec3 fract (var_ref x)))))\n" "\n" - " (signature uvec2\n" + " (signature vec4\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) vec4 x))\n" + " ((return (expression vec4 fract (var_ref x)))))\n" + "))\n" "\n" - " (signature uvec3\n" + "" +; +static const char *builtin_shadow1DLod = + "((function shadow1DLod\n" + " (signature vec4\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) 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" "\n" - " (signature uvec4\n" + "))\n" + "" +; +static const char *builtin_texture1DLod = + "((function texture1DLod\n" + " (signature vec4\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" + " (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 *builtins_130_cosh = { - "((function cosh\n" + "" +; +static const char *builtin_texture2DArray = + "((function texture2DArray\n" + " (signature vec4\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" + "\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" + "))\n" + "" +; +static const char *builtin_texture3DProj = + "((function texture3DProj\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" + "\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" + "))\n" + "" +; +static const char *builtin_sign = + "((function sign\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" + " ((return (expression float sign (var_ref x)))))\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" + " ((return (expression vec2 sign (var_ref x)))))\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" + " ((return (expression vec3 sign (var_ref x)))))\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" - "))\n" -}; - -static const char *builtins_130_equal = { - "((function equal\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" + " ((return (expression vec4 sign (var_ref x)))))\n" "\n" - " (signature bvec3\n" + " (signature int\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) int x))\n" + " ((return (expression int sign (var_ref x)))))\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 *builtins_130_greaterThan = { - "((function greaterThan\n" - " (signature bvec2\n" + " (signature ivec2\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) ivec2 x))\n" + " ((return (expression ivec2 sign (var_ref x)))))\n" "\n" - " (signature bvec3\n" + " (signature ivec3\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) ivec3 x))\n" + " ((return (expression ivec3 sign (var_ref x)))))\n" "\n" - " (signature bvec4\n" + " (signature ivec4\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" + " (declare (in) ivec4 x))\n" + " ((return (expression ivec4 sign (var_ref x)))))\n" "))\n" -}; - -static const char *builtins_130_greaterThanEqual = { - "((function greaterThanEqual\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" + "" +; +static const char *builtin_inversesqrt = + "((function inversesqrt\n" + " (signature float\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) float arg0))\n" + " ((return (expression float rsq (var_ref arg0)))))\n" "\n" - " (signature bvec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 rsq (var_ref arg0)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 rsq (var_ref arg0)))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 rsq (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_distance = + "((function distance\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" + "\n" + " (signature float\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" + "\n" + " (signature float\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" + "\n" + " (signature float\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" + "))\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_tanh = + "((function tanh\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ((return (expression float /\n" + " (expression float -\n" + " (expression float exp (var_ref x))\n" + " (expression float exp (expression float neg (var_ref x))))\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) vec2 x))\n" + " ((return (expression vec2 /\n" + " (expression vec2 -\n" + " (expression vec2 exp (var_ref x))\n" + " (expression vec2 exp (expression vec2 neg (var_ref x))))\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 /\n" + " (expression vec3 -\n" + " (expression vec3 exp (var_ref x))\n" + " (expression vec3 exp (expression vec3 neg (var_ref x))))\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 /\n" + " (expression vec4 -\n" + " (expression vec4 exp (var_ref x))\n" + " (expression vec4 exp (expression vec4 neg (var_ref x))))\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_texture1DProjLod = + "((function texture1DProjLod\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 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" + "))\n" + "" +; +static const char *builtin_texture1DArray = + "((function texture1DArray\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 vec4\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" + "\n" + "))\n" + "" +; +static const char *builtin_texture2D = + "((function texture2D\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 vec4\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" + "))\n" + "" +; +static const char *builtin_greaterThanEqual = + "((function greaterThanEqual\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" -}; - -static const char *builtins_130_lessThan = { - "((function lessThan\n" + "\n" " (signature bvec2\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\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" + " (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 (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" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\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" + " (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 *builtins_130_lessThanEqual = { - "((function lessThanEqual\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" + " (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" @@ -3192,9 +3185,9 @@ static const char *builtins_130_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" @@ -3202,192 +3195,220 @@ static const char *builtins_130_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 *builtins_130_max = { - "((function max\n" - " (signature int\n" + "" +; +static const char *builtin_texture3DProjLod = + "((function texture3DProjLod\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) 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 ivec2\n" + "))\n" + "" +; +static const char *builtin_tan = + "((function tan\n" + " (signature float\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) float angle))\n" + " ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n" "\n" - " (signature ivec3\n" + " (signature vec2\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) vec2 angle))\n" + " ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n" "\n" - " (signature ivec4\n" + " (signature vec3\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) vec3 angle))\n" + " ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n" "\n" - " (signature ivec2\n" + " (signature vec4\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" + " (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) ivec3 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\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) ivec4 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\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 uint\n" + " (signature bool\n" " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uint max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec2\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_normalize = + "((function normalize\n" + " (signature float\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) float arg0))\n" + " ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" "\n" - " (signature uvec3\n" + " (signature vec2\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) vec2 arg0))\n" + " ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\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) vec3 arg0))\n" + " ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\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" - "\n" - " (signature uvec3\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" + " (signature vec4\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) 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) uvec4 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1DShadow 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)) (swiz z (var_ref P)) (var_ref bias) ))))\n" + "\n" "))\n" -}; - -static const char *builtins_130_min = { - "((function min\n" - " (signature int\n" + "" +; +static const char *builtin_floor = + "((function floor\n" + " (signature float\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) float arg0))\n" + " ((return (expression float floor (var_ref arg0)))))\n" "\n" - " (signature ivec2\n" + " (signature vec2\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) vec2 arg0))\n" + " ((return (expression vec2 floor (var_ref arg0)))))\n" "\n" - " (signature ivec3\n" + " (signature vec3\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) vec3 arg0))\n" + " ((return (expression vec3 floor (var_ref arg0)))))\n" "\n" - " (signature ivec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec2\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 floor (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_cross = + "((function cross\n" + " (signature vec3\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) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))\n" + "))\n" + "" +; +static const char *builtin_sqrt = + "((function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0))\n" + " ((return (expression float sqrt (var_ref arg0)))))\n" "\n" - " (signature ivec3\n" + " (signature vec2\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) vec2 arg0))\n" + " ((return (expression vec2 sqrt (var_ref arg0)))))\n" "\n" - " (signature ivec4\n" + " (signature vec3\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) vec3 arg0))\n" + " ((return (expression vec3 sqrt (var_ref arg0)))))\n" "\n" - " (signature uint\n" + " (signature vec4\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) vec4 arg0))\n" + " ((return (expression vec4 sqrt (var_ref arg0)))))\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 uvec2\n" + " (signature vec2\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) 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 uvec3\n" + " (signature vec3\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) 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 uvec4\n" + " (signature vec4\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) 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 uvec2\n" + " (signature vec2\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) 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 uvec3\n" + " (signature vec3\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) 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 uvec4\n" + " (signature vec4\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 *builtins_130_mix = { - "((function mix\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 float\n" " (parameters\n" " (declare (in) float v1)\n" @@ -3426,1378 +3447,11231 @@ static const char *builtins_130_mix = { " (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 *builtins_130_notEqual = { - "((function notEqual\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" + "" +; +static const char *builtin_shadow1DArrayLod = + "((function shadow1DArrayLod\n" + " (signature vec4\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) 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) 1 (swiz z (var_ref P)) (var_ref lod) ))))\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 *builtins_130_sign = { - "((function sign\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x))\n" - " ((return (expression int sign (var_ref x)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\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 *builtins_130_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) 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" + "" +; +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" - " (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" + " (parameters)\n" + " ((return (expression vec4 *\n" + " (var_ref gl_ModelViewProjectionMatrix)\n" + " (var_ref gl_Vertex)))))\n" "))\n" -}; - -static const char *builtins_130_tanh = { - "((function tanh\n" + "" +; +static const char *builtin_sin = + "((function sin\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float /\n" - " (expression float -\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))\n" - " (expression float +\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))))))\n" + " (declare (in) float angle))\n" + " ((return (expression float sin (var_ref angle)))))\n" + "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 /\n" - " (expression vec2 -\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))\n" - " (expression vec2 +\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" + " (declare (in) vec2 angle))\n" + " ((return (expression vec2 sin (var_ref angle)))))\n" + "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 /\n" - " (expression vec3 -\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))\n" - " (expression vec3 +\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 sin (var_ref angle)))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 /\n" - " (expression vec4 -\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))\n" - " (expression vec4 +\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" + " (declare (in) vec4 angle))\n" + " ((return (expression vec4 sin (var_ref angle)))))\n" "))\n" -}; - -static const char *builtins_130_texelFetch = { - "((function texelFetch\n" + "" +; +static const char *builtin_shadow2D = + "((function shadow2D\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" - "\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" + " (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 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" + " (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_shadow2DLod = + "((function shadow2DLod\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" + " (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" + "))\n" + "" +; +static const char *builtin_shadow2DRectProj = + "((function shadow2DRectProj\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) 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" - " (signature ivec4\n" + "))\n" + "" +; +static const char *builtin_atan = + "((function atan\n" + " (signature float\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) 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 uvec4\n" + " (signature vec2\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 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 vec4\n" + " (signature vec3\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 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 ivec4\n" + " (signature vec4\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) 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 uvec4\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) 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) 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" "\n" - "))\n" -}; - -static const char *builtins_130_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 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" - " (signature ivec4\n" + "))\n" + "" +; +static const char *builtin_max = + "((function max\n" + " (signature float\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) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature vec2\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) 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) sampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\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) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\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) 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) sampler3D sampler)\n" - " (declare (in) vec3 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" + " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature int\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) int arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression int max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature ivec2\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) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec3\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) 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) isamplerCube 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) ivec4 arg1))\n" + " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature ivec2\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) ivec2 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec3\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) 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) isampler1DArray 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) int arg1))\n" + " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature uint\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" + " (declare (in) uint arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uint max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec2\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) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature uvec3\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) uvec3 arg0)\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) usampler2DArray 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" + " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" -}; - -static const char *builtins_130_textureGrad = { - "((function textureGrad\n" - " (signature vec4\n" + " (signature uvec2\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) uvec2 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature uvec3\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) 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) 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 vec4\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" " (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) 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 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" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\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 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" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\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) 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) 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 ivec4\n" + "))\n" + "" +; +static const char *builtin_texture3D = + "((function texture3D\n" + " (signature vec4\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) sampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature uvec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) usampler3D sampler)\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) 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_texelFetch = + "((function texelFetch\n" " (signature vec4\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) 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" "\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" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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" + " (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" - ")\n" - ")\n" -}; - -static const char *builtins_130_textureLod = { - "((function textureLod\n" " (signature vec4\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) 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) 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" + " (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) 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" + " (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) 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) 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) 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) 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) 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) 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_noise4 = + "((function noise4\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" - "\n" - " (signature ivec4\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" - "\n" - " (signature uvec4\n" + " (declare (in) float x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\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" - "\n" + " (declare (in) vec2 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\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" + " (declare (in) vec3 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\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" + " (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) 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) 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 vec4\n" + " (signature bvec3\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) 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 ivec4\n" + " (signature bvec4\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) 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 uvec4\n" + " (signature bvec2\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) 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 vec4\n" + " (signature bvec3\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" + " (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 ivec4\n" + " (signature bvec4\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" + " (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 uvec4\n" + " (signature bvec2\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" + " (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" - "))\n" -}; - -static const char *builtins_130_textureProj = { - "((function textureProj\n" - " (signature vec4\n" + " (signature bvec3\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) 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 ivec4\n" + " (signature bvec4\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" - "\n" - " (signature uvec4\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) 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" + " (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 vec4\n" + " (signature mat2x3\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) 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 ivec4\n" + " (signature mat2x4\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) 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 uvec4\n" + " (signature mat3x2\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) 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 vec4\n" + " (signature mat3\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) 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 ivec4\n" + " (signature mat3x4\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" + " (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 uvec4\n" + " (signature mat4x2\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" + " (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 vec4\n" + " (signature mat4x3\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) 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 ivec4\n" + " (signature mat4\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" - "\n" - " (signature uvec4\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" + " (signature vec4\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) 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) 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) 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" - " (signature ivec4\n" + "))\n" + "" +; +static const char *builtin_noise1 = + "((function noise1\n" + " (signature float\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" + " (declare (in) float x))\n" + " ((return (constant float (0)))))\n" + " (signature float\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" + " (declare (in) vec2 x))\n" + " ((return (constant float (0)))))\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (constant float (0)))))\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ((return (constant float (0)))))\n" "))\n" -}; - -static const char *builtins_130_textureProjGrad = { - "((function textureProjGrad\n" - " (signature vec4\n" + "" +; +static const char *builtin_refract = + "((function refract\n" + " (signature float\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) 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 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" - " ((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 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 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" - " ((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 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) 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) 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" - " (signature ivec4\n" + "))\n" + "" +; +static const char *builtin_noise3 = + "((function noise3\n" + " (signature vec3\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) 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_min = + "((function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature vec2\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) 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 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) 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) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\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" - " ((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) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\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" - " ((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) 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) 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) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature int\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) int arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature ivec2\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) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec3\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) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature ivec4\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) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature ivec2\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) ivec2 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" -}; - -static const char *builtins_130_textureProjLod = { - "((function textureProjLod\n" - " (signature vec4\n" + " (signature ivec3\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) ivec3 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\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" + " (declare (in) ivec4 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature uint\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" + " (declare (in) uint arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec2\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) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature uvec3\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" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\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" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec2\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) uvec2 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature uvec3\n" " (parameters\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" + " (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) usampler2D 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" + " (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) 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 ivec4\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" - "\n" - " (signature uvec4\n" - " (parameters\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" + " (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 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" + " (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" + "))\n" + "" +; +static const char *builtin_shadow1DArray = + "((function shadow1DArray\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) 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 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) sampler1DArrayShadow 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 *functions_for_130 [] = { - builtins_130_clamp, - builtins_130_cosh, - builtins_130_equal, - builtins_130_greaterThan, - builtins_130_greaterThanEqual, - builtins_130_lessThan, - builtins_130_lessThanEqual, - builtins_130_max, - builtins_130_min, - builtins_130_mix, - builtins_130_notEqual, - builtins_130_sign, - builtins_130_sinh, - builtins_130_tanh, - builtins_130_texelFetch, - builtins_130_texture, - builtins_130_textureGrad, - builtins_130_textureLod, - builtins_130_textureProj, - builtins_130_textureProjGrad, - builtins_130_textureProjLod, -}; - -/* 130_fs builtins */ - -static const char *builtins_130_fs_texture = { - "((function texture\n" - " (signature vec4\n" + "" +; +static const char *builtin_exp = + "((function exp\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) float arg0))\n" + " ((return (expression float exp (var_ref arg0)))))\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" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 exp (var_ref arg0)))))\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" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 exp (var_ref arg0)))))\n" "\n" " (signature vec4\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) 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) 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" + " (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 uvec4\n" + " (signature bvec3\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" + " (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 vec4\n" + " (signature bvec4\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) 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 ivec4\n" + " (signature bvec2\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) 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 uvec4\n" + " (signature bvec3\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) 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 vec4\n" + " (signature bvec4\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" + " (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 ivec4\n" + " (signature bvec2\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" + " (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 uvec4\n" + " (signature bvec3\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" + " (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_texture2DLod = + "((function texture2DLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\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" + " (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" + "))\n" + "" +; +static const char *builtin_dot = + "((function dot\n" + " (signature float\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) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature uvec4\n" + " (signature float\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) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature float\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) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature ivec4\n" + " (signature float\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" + " (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 *prototypes_for_120_vert = + "(\n" + "(function radians\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float degrees@0x22143e0)\n" + " )\n" + " (\n" + " ))\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" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 degrees@0x22147b0)\n" + " )\n" + " (\n" + " ))\n" "\n" - "))\n" -}; - -static const char *builtins_130_fs_textureProj = { - "((function textureProj\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" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 degrees@0x22149a0)\n" + " )\n" + " (\n" + " ))\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" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 degrees@0x2214b90)\n" + " )\n" + " (\n" + " ))\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" "\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" + "(function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float radians@0x2214d80)\n" + " )\n" + " (\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" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 radians@0x2215150)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 radians@0x2215340)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 radians@0x2215530)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x2215720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x2215ad0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x2215cb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x2215e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x2216070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x2216420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x2216600)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x22167e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function tan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x22169c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x2216d70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x2216f50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x2217130)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function asin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x2217310)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x22176c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x22178a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x2217a80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x2217c60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x2218010)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x22181f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x22183d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function atan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y@0x22185b0)\n" + " (declare (in ) float x@0x22186c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y@0x2218a70)\n" + " (declare (in ) vec2 x@0x2218b80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y@0x2218d60)\n" + " (declare (in ) vec3 x@0x2218e70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y@0x2219050)\n" + " (declare (in ) vec4 x@0x2219160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y_over_x@0x2219340)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y_over_x@0x2219530)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y_over_x@0x2219720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y_over_x@0x2219910)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function pow\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2219b00)\n" + " (declare (in ) float y@0x2219c10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2219fc0)\n" + " (declare (in ) vec2 y@0x221a0d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221a2b0)\n" + " (declare (in ) vec3 y@0x221a3c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221a5a0)\n" + " (declare (in ) vec4 y@0x221a6b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221a890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221ac40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221ae20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221b000)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221b1e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221b590)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221b770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221b950)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221bb30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221bee0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221c0c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221c2a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221c480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221c830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221ca10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221cbf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221cdd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221d180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221d360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221d540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function inversesqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221d720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221dae0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221dcc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221dea0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221e080)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221e430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221e610)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221e7f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sign\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221e9d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221ed80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221ef60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221f140)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221f320)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x221f6d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x221f8b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x221fa90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function ceil\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x221fc70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2220020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2220200)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x22203e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x22205c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2220970)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2220b50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2220d30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2220f10)\n" + " (declare (in ) float y@0x2221020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x22213d0)\n" + " (declare (in ) float y@0x22214e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x22216c0)\n" + " (declare (in ) float y@0x22217d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x22219b0)\n" + " (declare (in ) float y@0x2221ac0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2221ca0)\n" + " (declare (in ) vec2 y@0x2221db0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2221f90)\n" + " (declare (in ) vec3 y@0x22220a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2222280)\n" + " (declare (in ) vec4 y@0x2222390)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2222570)\n" + " (declare (in ) float y@0x2222680)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2222a30)\n" + " (declare (in ) vec2 y@0x2222b40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2222d20)\n" + " (declare (in ) vec3 y@0x2222e30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2223010)\n" + " (declare (in ) vec4 y@0x2223120)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2223300)\n" + " (declare (in ) float y@0x2223410)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x22235f0)\n" + " (declare (in ) float y@0x2223700)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x22238e0)\n" + " (declare (in ) float y@0x22239f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function max\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2223bd0)\n" + " (declare (in ) float y@0x2223ce0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2224090)\n" + " (declare (in ) vec2 y@0x22241a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2224380)\n" + " (declare (in ) vec3 y@0x2224490)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2224670)\n" + " (declare (in ) vec4 y@0x2224780)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2224960)\n" + " (declare (in ) float y@0x2224a70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2224c50)\n" + " (declare (in ) float y@0x2224d60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2224f40)\n" + " (declare (in ) float y@0x2225050)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function clamp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2225230)\n" + " (declare (in ) float minVal@0x2225340)\n" + " (declare (in ) float maxVal@0x2225450)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2225800)\n" + " (declare (in ) vec2 minVal@0x2225910)\n" + " (declare (in ) vec2 maxVal@0x2225a20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2225c00)\n" + " (declare (in ) vec3 minVal@0x2225d10)\n" + " (declare (in ) vec3 maxVal@0x2225e20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2226000)\n" + " (declare (in ) vec4 minVal@0x2226110)\n" + " (declare (in ) vec4 maxVal@0x2226220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2226400)\n" + " (declare (in ) float minVal@0x2226510)\n" + " (declare (in ) float maxVal@0x2226620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2226800)\n" + " (declare (in ) float minVal@0x2226910)\n" + " (declare (in ) float maxVal@0x2226a20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2226c00)\n" + " (declare (in ) float minVal@0x2226d10)\n" + " (declare (in ) float maxVal@0x2226e20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mix\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2227000)\n" + " (declare (in ) float y@0x2227110)\n" + " (declare (in ) float a@0x2227220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x22275d0)\n" + " (declare (in ) vec2 y@0x22276e0)\n" + " (declare (in ) vec2 a@0x22277f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x22279d0)\n" + " (declare (in ) vec3 y@0x2227ae0)\n" + " (declare (in ) vec3 a@0x2227bf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2227dd0)\n" + " (declare (in ) vec4 y@0x2227ee0)\n" + " (declare (in ) vec4 a@0x2227ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x22281d0)\n" + " (declare (in ) vec2 y@0x22282e0)\n" + " (declare (in ) float a@0x22283f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x22285d0)\n" + " (declare (in ) vec3 y@0x22286e0)\n" + " (declare (in ) float a@0x22287f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x22289d0)\n" + " (declare (in ) vec4 y@0x2228ae0)\n" + " (declare (in ) float a@0x2228bf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge@0x2228dd0)\n" + " (declare (in ) float x@0x2228ee0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge@0x2229290)\n" + " (declare (in ) vec2 x@0x22293a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge@0x2229580)\n" + " (declare (in ) vec3 x@0x2229690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge@0x2229870)\n" + " (declare (in ) vec4 x@0x2229980)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge@0x2229b60)\n" + " (declare (in ) vec2 x@0x2229c70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge@0x2229e50)\n" + " (declare (in ) vec3 x@0x2229f60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge@0x222a140)\n" + " (declare (in ) vec4 x@0x222a250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge0@0x222a430)\n" + " (declare (in ) float edge1@0x222a540)\n" + " (declare (in ) float x@0x222a650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge0@0x222aa10)\n" + " (declare (in ) vec2 edge1@0x222ab20)\n" + " (declare (in ) vec2 x@0x222ac30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge0@0x222ae10)\n" + " (declare (in ) vec3 edge1@0x222af20)\n" + " (declare (in ) vec3 x@0x222b030)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge0@0x222b210)\n" + " (declare (in ) vec4 edge1@0x222b320)\n" + " (declare (in ) vec4 x@0x222b430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge0@0x222b610)\n" + " (declare (in ) float edge1@0x222b720)\n" + " (declare (in ) vec2 x@0x222b830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge0@0x222ba10)\n" + " (declare (in ) float edge1@0x222bb20)\n" + " (declare (in ) vec3 x@0x222bc30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge0@0x222be10)\n" + " (declare (in ) float edge1@0x222bf20)\n" + " (declare (in ) vec4 x@0x222c030)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function length\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x222c210)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x222c5c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x222c7a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x222c980)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function distance\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p0@0x222cb60)\n" + " (declare (in ) float p1@0x222cc70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 p0@0x222d030)\n" + " (declare (in ) vec2 p1@0x222d140)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 p0@0x222d320)\n" + " (declare (in ) vec3 p1@0x222d430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 p0@0x222d610)\n" + " (declare (in ) vec4 p1@0x222d720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dot\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x222d900)\n" + " (declare (in ) float y@0x222da10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x222ddc0)\n" + " (declare (in ) vec2 y@0x222ded0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x222e0b0)\n" + " (declare (in ) vec3 y@0x222e1c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x222e3a0)\n" + " (declare (in ) vec4 y@0x222e4b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cross\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x222e690)\n" + " (declare (in ) vec3 y@0x222e7a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function normalize\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x222eb50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x222ef10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x222f0f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x222f2d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function ftransform\n" + " (signature vec4\n" + " (parameters\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function faceforward\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float N@0x222f760)\n" + " (declare (in ) float I@0x222f870)\n" + " (declare (in ) float Nref@0x222f980)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 N@0x222fd40)\n" + " (declare (in ) vec2 I@0x222fe50)\n" + " (declare (in ) vec2 Nref@0x222ff60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 N@0x2230140)\n" + " (declare (in ) vec3 I@0x2230250)\n" + " (declare (in ) vec3 Nref@0x2230360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 N@0x2230540)\n" + " (declare (in ) vec4 I@0x2230650)\n" + " (declare (in ) vec4 Nref@0x2230760)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function reflect\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0x2230940)\n" + " (declare (in ) float N@0x2230a50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0x2230e10)\n" + " (declare (in ) vec2 N@0x2230f20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0x2231100)\n" + " (declare (in ) vec3 N@0x2231210)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0x22313f0)\n" + " (declare (in ) vec4 N@0x2231500)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function refract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0x22316e0)\n" + " (declare (in ) float N@0x22317f0)\n" + " (declare (in ) float eta@0x2231900)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0x2231cc0)\n" + " (declare (in ) vec2 N@0x2231dd0)\n" + " (declare (in ) float eta@0x2231ee0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0x22320c0)\n" + " (declare (in ) vec3 N@0x22321d0)\n" + " (declare (in ) float eta@0x22322e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0x22324c0)\n" + " (declare (in ) vec4 N@0x22325d0)\n" + " (declare (in ) float eta@0x22326e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function matrixCompMult\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) mat2 x@0x22328c0)\n" + " (declare (in ) mat2 y@0x22329d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) mat3 x@0x2232d90)\n" + " (declare (in ) mat3 y@0x2232ea0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) mat4 x@0x2233080)\n" + " (declare (in ) mat4 y@0x2233190)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in ) mat2x3 x@0x2233370)\n" + " (declare (in ) mat2x3 y@0x2233480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in ) mat2x4 x@0x2233660)\n" + " (declare (in ) mat2x4 y@0x2233770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in ) mat3x2 x@0x2233950)\n" + " (declare (in ) mat3x2 y@0x2233a60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in ) mat3x4 x@0x2233c40)\n" + " (declare (in ) mat3x4 y@0x2233d50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in ) mat4x2 x@0x2233f30)\n" + " (declare (in ) mat4x2 y@0x2234040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in ) mat4x3 x@0x2234220)\n" + " (declare (in ) mat4x3 y@0x2234330)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function outerProduct\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) vec2 c@0x2234510)\n" + " (declare (in ) vec2 r@0x2234620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) vec3 c@0x22349e0)\n" + " (declare (in ) vec3 r@0x2234af0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) vec4 c@0x2234cd0)\n" + " (declare (in ) vec4 r@0x2234de0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in ) vec3 c@0x2234fc0)\n" + " (declare (in ) vec2 r@0x22350d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in ) vec2 c@0x22352b0)\n" + " (declare (in ) vec3 r@0x22353c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in ) vec4 c@0x22355a0)\n" + " (declare (in ) vec2 r@0x22356b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in ) vec2 c@0x2235890)\n" + " (declare (in ) vec4 r@0x22359a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in ) vec4 c@0x2235b80)\n" + " (declare (in ) vec3 r@0x2235c90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in ) vec3 c@0x2235e70)\n" + " (declare (in ) vec4 r@0x2235f80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function transpose\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) mat2 m@0x2236160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) mat3 m@0x2236520)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) mat4 m@0x2236700)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in ) mat3x2 m@0x22368e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in ) mat2x3 m@0x2236ac0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in ) mat4x2 m@0x2236ca0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in ) mat2x4 m@0x2236e80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in ) mat4x3 m@0x2237060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in ) mat3x4 m@0x2237240)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2237420)\n" + " (declare (in ) vec2 y@0x2237530)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x22378f0)\n" + " (declare (in ) vec3 y@0x2237a00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2237be0)\n" + " (declare (in ) vec4 y@0x2237cf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x2237ed0)\n" + " (declare (in ) ivec2 y@0x2237fe0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x22381c0)\n" + " (declare (in ) ivec3 y@0x22382d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x22384b0)\n" + " (declare (in ) ivec4 y@0x22385c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x22387a0)\n" + " (declare (in ) vec2 y@0x22388b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2238c70)\n" + " (declare (in ) vec3 y@0x2238d80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2238f60)\n" + " (declare (in ) vec4 y@0x2239070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x2239250)\n" + " (declare (in ) ivec2 y@0x2239360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x2239540)\n" + " (declare (in ) ivec3 y@0x2239650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x2239830)\n" + " (declare (in ) ivec4 y@0x2239940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x2239b20)\n" + " (declare (in ) vec2 y@0x2239c30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2239ff0)\n" + " (declare (in ) vec3 y@0x223a100)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x223a2e0)\n" + " (declare (in ) vec4 y@0x223a3f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x223a5d0)\n" + " (declare (in ) ivec2 y@0x223a6e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x223a8c0)\n" + " (declare (in ) ivec3 y@0x223a9d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x223abb0)\n" + " (declare (in ) ivec4 y@0x223acc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x223aea0)\n" + " (declare (in ) vec2 y@0x223afb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x223b370)\n" + " (declare (in ) vec3 y@0x223b480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x223b660)\n" + " (declare (in ) vec4 y@0x223b770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x223b950)\n" + " (declare (in ) ivec2 y@0x223ba60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x223bc40)\n" + " (declare (in ) ivec3 y@0x223bd50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x223bf30)\n" + " (declare (in ) ivec4 y@0x223c040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function equal\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x223c220)\n" + " (declare (in ) vec2 y@0x223c330)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x223c6e0)\n" + " (declare (in ) vec3 y@0x223c7f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x223c9d0)\n" + " (declare (in ) vec4 y@0x223cae0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x223ccc0)\n" + " (declare (in ) ivec2 y@0x223cdd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x223cfb0)\n" + " (declare (in ) ivec3 y@0x223d0c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x223d2a0)\n" + " (declare (in ) ivec4 y@0x223d3b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x223d590)\n" + " (declare (in ) bvec2 y@0x223d6a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x223d880)\n" + " (declare (in ) bvec3 y@0x223d990)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x223db70)\n" + " (declare (in ) bvec4 y@0x223dc80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function notEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x223de60)\n" + " (declare (in ) vec2 y@0x223df70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x223e330)\n" + " (declare (in ) vec3 y@0x223e440)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x223e620)\n" + " (declare (in ) vec4 y@0x223e730)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x223e910)\n" + " (declare (in ) ivec2 y@0x223ea20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x223ec00)\n" + " (declare (in ) ivec3 y@0x223ed10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x223eef0)\n" + " (declare (in ) ivec4 y@0x223f000)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x223f1e0)\n" + " (declare (in ) bvec2 y@0x223f2f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x223f4d0)\n" + " (declare (in ) bvec3 y@0x223f5e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x223f7c0)\n" + " (declare (in ) bvec4 y@0x223f8d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function any\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x223fab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x223fe60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x2240040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function all\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x2240220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x22405d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x22407b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function not\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x2240990)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x2240d40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x2240f20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x2241100)\n" + " (declare (in ) float coord@0x2241220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x22415e0)\n" + " (declare (in ) vec2 coord@0x2241700)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x2241ac0)\n" + " (declare (in ) vec4 coord@0x2241be0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x2241dc0)\n" + " (declare (in ) float coord@0x2241ee0)\n" + " (declare (in ) float lod@0x2241ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x22423b0)\n" + " (declare (in ) vec2 coord@0x22424d0)\n" + " (declare (in ) float lod@0x22425e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x22429a0)\n" + " (declare (in ) vec4 coord@0x2242ac0)\n" + " (declare (in ) float lod@0x2242bd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x2242db0)\n" + " (declare (in ) vec2 coord@0x2242ed0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x2243290)\n" + " (declare (in ) vec3 coord@0x22433b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x2243770)\n" + " (declare (in ) vec4 coord@0x2243890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x2243a70)\n" + " (declare (in ) vec2 coord@0x2243b90)\n" + " (declare (in ) float lod@0x2243ca0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x2244060)\n" + " (declare (in ) vec3 coord@0x2244180)\n" + " (declare (in ) float lod@0x2244290)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x2244650)\n" + " (declare (in ) vec4 coord@0x2244770)\n" + " (declare (in ) float lod@0x2244880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x2244a60)\n" + " (declare (in ) vec3 coord@0x2244b80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x2244f40)\n" + " (declare (in ) vec4 coord@0x2245060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x2245420)\n" + " (declare (in ) vec3 coord@0x2245540)\n" + " (declare (in ) float lod@0x2245650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x2245a10)\n" + " (declare (in ) vec4 coord@0x2245b30)\n" + " (declare (in ) float lod@0x2245c40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function textureCube\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0x2246000)\n" + " (declare (in ) vec3 coord@0x2246120)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function textureCubeLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0x22464e0)\n" + " (declare (in ) vec3 coord@0x2246600)\n" + " (declare (in ) float lod@0x2246710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x2246ad0)\n" + " (declare (in ) vec3 coord@0x2246bf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x2246fb0)\n" + " (declare (in ) vec3 coord@0x22470d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x2247490)\n" + " (declare (in ) vec4 coord@0x22475b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x2247970)\n" + " (declare (in ) vec4 coord@0x2247a90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x2247e50)\n" + " (declare (in ) vec3 coord@0x2247f70)\n" + " (declare (in ) float lod@0x2248080)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x2248440)\n" + " (declare (in ) vec3 coord@0x2248560)\n" + " (declare (in ) float lod@0x2248670)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x2248a30)\n" + " (declare (in ) vec4 coord@0x2248b50)\n" + " (declare (in ) float lod@0x2248c60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x2249020)\n" + " (declare (in ) vec4 coord@0x2249140)\n" + " (declare (in ) float lod@0x2249250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise1\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x2249610)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x22499c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x2249ba0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x2249d80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float x@0x2249f60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x224a310)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec3 x@0x224a4f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec4 x@0x224a6d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float x@0x224a8b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec2 x@0x224ac60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x224ae40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec4 x@0x224b020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float x@0x224b200)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec2 x@0x224b5b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec3 x@0x224b790)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x224b970)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\n" + ")" +; +static const char *functions_for_120_vert [] = { + builtin_clamp, + builtin_matrixCompMult, + builtin_shadow2DProjLod, + builtin_noise2, + builtin_texture3DProjLod, + builtin_pow, + builtin_texture2DProj, + builtin_greaterThanEqual, + builtin_sign, + builtin_texture3DProj, + 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_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_greaterThan, + builtin_texture3D, + builtin_not, + builtin_texture2DProjLod, + builtin_inversesqrt, + builtin_mod, + builtin_noise4, + builtin_distance, + builtin_cos, + builtin_shadow1D, + builtin_noise1, + builtin_refract, + builtin_noise3, + builtin_texture2DLod, + builtin_min, + 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@0xb9bd60)\n" + " (declare (in ) vec2 coord@0xb9be80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0xb9c240)\n" + " (declare (in ) vec2 coord@0xb9c360)\n" + " (declare (in ) float bias@0xb9c470)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0xb9c650)\n" + " (declare (in ) vec2 coord@0xb9c770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0xb9cb30)\n" + " (declare (in ) vec2 coord@0xb9cc50)\n" + " (declare (in ) float bias@0xb9cd60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArrayShadow sampler@0xb9cf40)\n" + " (declare (in ) vec3 coord@0xb9d060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArrayShadow sampler@0xb9d420)\n" + " (declare (in ) vec3 coord@0xb9d540)\n" + " (declare (in ) float bias@0xb9d650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DArrayShadow sampler@0xb9d830)\n" + " (declare (in ) vec4 coord@0xb9d950)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\n" + ")" +; +static const char *functions_for_EXT_texture_array_frag [] = { + builtin_shadow2DArray, + builtin_shadow1DArray, + builtin_texture1DArray, + builtin_texture2DArray, +}; +static const char *prototypes_for_110_vert = + "(\n" + "(function radians\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float degrees@0x9e3c50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 degrees@0x9e4020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 degrees@0x9e4210)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 degrees@0x9e4400)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float radians@0x9e45f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 radians@0x9e49c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 radians@0x9e4bb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 radians@0x9e4da0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x9e4f90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x9e5340)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x9e5520)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x9e5700)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x9e58e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x9e5c90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x9e5e70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x9e6050)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function tan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x9e6230)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x9e65e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x9e67c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x9e69a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function asin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x9e6b80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x9e6f30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x9e7110)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x9e72f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x9e74d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x9e7880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x9e7a60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x9e7c40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function atan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y@0x9e7e20)\n" + " (declare (in ) float x@0x9e7f30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y@0x9e82e0)\n" + " (declare (in ) vec2 x@0x9e83f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y@0x9e85d0)\n" + " (declare (in ) vec3 x@0x9e86e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y@0x9e88c0)\n" + " (declare (in ) vec4 x@0x9e89d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y_over_x@0x9e8bb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y_over_x@0x9e8da0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y_over_x@0x9e8f90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y_over_x@0x9e9180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function pow\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9e9370)\n" + " (declare (in ) float y@0x9e9480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9e9830)\n" + " (declare (in ) vec2 y@0x9e9940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9e9b20)\n" + " (declare (in ) vec3 y@0x9e9c30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9e9e10)\n" + " (declare (in ) vec4 y@0x9e9f20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ea100)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9ea4b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ea690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ea870)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9eaa50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9eae00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9eafe0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9eb1c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9eb3a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9eb750)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9eb930)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ebb10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ebcf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9ec0a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ec280)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ec460)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ec640)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9ec9f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ecbd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ecdb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function inversesqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ecf90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9ed350)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ed530)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ed710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ed8f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9edca0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ede80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ee060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sign\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ee240)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9ee5f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ee7d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ee9b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9eeb90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9eef40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9ef120)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9ef300)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function ceil\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9ef4e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9ef890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9efa70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9efc50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9efe30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f01e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f03c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f05a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9f0780)\n" + " (declare (in ) float y@0x9f0890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f0c40)\n" + " (declare (in ) float y@0x9f0d50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f0f30)\n" + " (declare (in ) float y@0x9f1040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f1220)\n" + " (declare (in ) float y@0x9f1330)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f1510)\n" + " (declare (in ) vec2 y@0x9f1620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f1800)\n" + " (declare (in ) vec3 y@0x9f1910)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f1af0)\n" + " (declare (in ) vec4 y@0x9f1c00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9f1de0)\n" + " (declare (in ) float y@0x9f1ef0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f22a0)\n" + " (declare (in ) vec2 y@0x9f23b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f2590)\n" + " (declare (in ) vec3 y@0x9f26a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f2880)\n" + " (declare (in ) vec4 y@0x9f2990)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f2b70)\n" + " (declare (in ) float y@0x9f2c80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f2e60)\n" + " (declare (in ) float y@0x9f2f70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f3150)\n" + " (declare (in ) float y@0x9f3260)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function max\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9f3440)\n" + " (declare (in ) float y@0x9f3550)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f3900)\n" + " (declare (in ) vec2 y@0x9f3a10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f3bf0)\n" + " (declare (in ) vec3 y@0x9f3d00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f3ee0)\n" + " (declare (in ) vec4 y@0x9f3ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f41d0)\n" + " (declare (in ) float y@0x9f42e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f44c0)\n" + " (declare (in ) float y@0x9f45d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f47b0)\n" + " (declare (in ) float y@0x9f48c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function clamp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9f4aa0)\n" + " (declare (in ) float minVal@0x9f4bb0)\n" + " (declare (in ) float maxVal@0x9f4cc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f5070)\n" + " (declare (in ) vec2 minVal@0x9f5180)\n" + " (declare (in ) vec2 maxVal@0x9f5290)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f5470)\n" + " (declare (in ) vec3 minVal@0x9f5580)\n" + " (declare (in ) vec3 maxVal@0x9f5690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f5870)\n" + " (declare (in ) vec4 minVal@0x9f5980)\n" + " (declare (in ) vec4 maxVal@0x9f5a90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f5c70)\n" + " (declare (in ) float minVal@0x9f5d80)\n" + " (declare (in ) float maxVal@0x9f5e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f6070)\n" + " (declare (in ) float minVal@0x9f6180)\n" + " (declare (in ) float maxVal@0x9f6290)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f6470)\n" + " (declare (in ) float minVal@0x9f6580)\n" + " (declare (in ) float maxVal@0x9f6690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mix\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9f6870)\n" + " (declare (in ) float y@0x9f6980)\n" + " (declare (in ) float a@0x9f6a90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f6e40)\n" + " (declare (in ) vec2 y@0x9f6f50)\n" + " (declare (in ) vec2 a@0x9f7060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f7240)\n" + " (declare (in ) vec3 y@0x9f7350)\n" + " (declare (in ) vec3 a@0x9f7460)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f7640)\n" + " (declare (in ) vec4 y@0x9f7750)\n" + " (declare (in ) vec4 a@0x9f7860)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9f7a40)\n" + " (declare (in ) vec2 y@0x9f7b50)\n" + " (declare (in ) float a@0x9f7c60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9f7e40)\n" + " (declare (in ) vec3 y@0x9f7f50)\n" + " (declare (in ) float a@0x9f8060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9f8240)\n" + " (declare (in ) vec4 y@0x9f8350)\n" + " (declare (in ) float a@0x9f8460)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge@0x9f8640)\n" + " (declare (in ) float x@0x9f8750)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge@0x9f8b00)\n" + " (declare (in ) vec2 x@0x9f8c10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge@0x9f8df0)\n" + " (declare (in ) vec3 x@0x9f8f00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge@0x9f90e0)\n" + " (declare (in ) vec4 x@0x9f91f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge@0x9f93d0)\n" + " (declare (in ) vec2 x@0x9f94e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge@0x9f96c0)\n" + " (declare (in ) vec3 x@0x9f97d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge@0x9f99b0)\n" + " (declare (in ) vec4 x@0x9f9ac0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge0@0x9f9ca0)\n" + " (declare (in ) float edge1@0x9f9db0)\n" + " (declare (in ) float x@0x9f9ec0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge0@0x9fa280)\n" + " (declare (in ) vec2 edge1@0x9fa390)\n" + " (declare (in ) vec2 x@0x9fa4a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge0@0x9fa680)\n" + " (declare (in ) vec3 edge1@0x9fa790)\n" + " (declare (in ) vec3 x@0x9fa8a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge0@0x9faa80)\n" + " (declare (in ) vec4 edge1@0x9fab90)\n" + " (declare (in ) vec4 x@0x9faca0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge0@0x9fae80)\n" + " (declare (in ) float edge1@0x9faf90)\n" + " (declare (in ) vec2 x@0x9fb0a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge0@0x9fb280)\n" + " (declare (in ) float edge1@0x9fb390)\n" + " (declare (in ) vec3 x@0x9fb4a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge0@0x9fb680)\n" + " (declare (in ) float edge1@0x9fb790)\n" + " (declare (in ) vec4 x@0x9fb8a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function length\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9fba80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9fbe30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9fc010)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9fc1f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function distance\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p0@0x9fc3d0)\n" + " (declare (in ) float p1@0x9fc4e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 p0@0x9fc8a0)\n" + " (declare (in ) vec2 p1@0x9fc9b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 p0@0x9fcb90)\n" + " (declare (in ) vec3 p1@0x9fcca0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 p0@0x9fce80)\n" + " (declare (in ) vec4 p1@0x9fcf90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dot\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9fd170)\n" + " (declare (in ) float y@0x9fd280)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9fd630)\n" + " (declare (in ) vec2 y@0x9fd740)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9fd920)\n" + " (declare (in ) vec3 y@0x9fda30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9fdc10)\n" + " (declare (in ) vec4 y@0x9fdd20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cross\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9fdf00)\n" + " (declare (in ) vec3 y@0x9fe010)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function normalize\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x9fe3c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x9fe780)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x9fe960)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x9feb40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function ftransform\n" + " (signature vec4\n" + " (parameters\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function faceforward\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float N@0x9fefd0)\n" + " (declare (in ) float I@0x9ff0e0)\n" + " (declare (in ) float Nref@0x9ff1f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 N@0x9ff5b0)\n" + " (declare (in ) vec2 I@0x9ff6c0)\n" + " (declare (in ) vec2 Nref@0x9ff7d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 N@0x9ff9b0)\n" + " (declare (in ) vec3 I@0x9ffac0)\n" + " (declare (in ) vec3 Nref@0x9ffbd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 N@0x9ffdb0)\n" + " (declare (in ) vec4 I@0x9ffec0)\n" + " (declare (in ) vec4 Nref@0x9fffd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function reflect\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0xa001b0)\n" + " (declare (in ) float N@0xa002c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0xa00680)\n" + " (declare (in ) vec2 N@0xa00790)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0xa00970)\n" + " (declare (in ) vec3 N@0xa00a80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0xa00c60)\n" + " (declare (in ) vec4 N@0xa00d70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function refract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0xa00f50)\n" + " (declare (in ) float N@0xa01060)\n" + " (declare (in ) float eta@0xa01170)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0xa01530)\n" + " (declare (in ) vec2 N@0xa01640)\n" + " (declare (in ) float eta@0xa01750)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0xa01930)\n" + " (declare (in ) vec3 N@0xa01a40)\n" + " (declare (in ) float eta@0xa01b50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0xa01d30)\n" + " (declare (in ) vec4 N@0xa01e40)\n" + " (declare (in ) float eta@0xa01f50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function matrixCompMult\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) mat2 x@0xa02130)\n" + " (declare (in ) mat2 y@0xa02240)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) mat3 x@0xa02600)\n" + " (declare (in ) mat3 y@0xa02710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) mat4 x@0xa028f0)\n" + " (declare (in ) mat4 y@0xa02a00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa02be0)\n" + " (declare (in ) vec2 y@0xa02cf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa030b0)\n" + " (declare (in ) vec3 y@0xa031c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa033a0)\n" + " (declare (in ) vec4 y@0xa034b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0xa03690)\n" + " (declare (in ) ivec2 y@0xa037a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0xa03980)\n" + " (declare (in ) ivec3 y@0xa03a90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0xa03c70)\n" + " (declare (in ) ivec4 y@0xa03d80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa03f60)\n" + " (declare (in ) vec2 y@0xa04070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa04430)\n" + " (declare (in ) vec3 y@0xa04540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa04720)\n" + " (declare (in ) vec4 y@0xa04830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0xa04a10)\n" + " (declare (in ) ivec2 y@0xa04b20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0xa04d00)\n" + " (declare (in ) ivec3 y@0xa04e10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0xa04ff0)\n" + " (declare (in ) ivec4 y@0xa05100)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa052e0)\n" + " (declare (in ) vec2 y@0xa053f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa057b0)\n" + " (declare (in ) vec3 y@0xa058c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa05aa0)\n" + " (declare (in ) vec4 y@0xa05bb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0xa05d90)\n" + " (declare (in ) ivec2 y@0xa05ea0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0xa06080)\n" + " (declare (in ) ivec3 y@0xa06190)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0xa06370)\n" + " (declare (in ) ivec4 y@0xa06480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa06660)\n" + " (declare (in ) vec2 y@0xa06770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa06b30)\n" + " (declare (in ) vec3 y@0xa06c40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa06e20)\n" + " (declare (in ) vec4 y@0xa06f30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0xa07110)\n" + " (declare (in ) ivec2 y@0xa07220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0xa07400)\n" + " (declare (in ) ivec3 y@0xa07510)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0xa076f0)\n" + " (declare (in ) ivec4 y@0xa07800)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function equal\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa079e0)\n" + " (declare (in ) vec2 y@0xa07af0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa07ea0)\n" + " (declare (in ) vec3 y@0xa07fb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa08190)\n" + " (declare (in ) vec4 y@0xa082a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0xa08480)\n" + " (declare (in ) ivec2 y@0xa08590)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0xa08770)\n" + " (declare (in ) ivec3 y@0xa08880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0xa08a60)\n" + " (declare (in ) ivec4 y@0xa08b70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0xa08d50)\n" + " (declare (in ) bvec2 y@0xa08e60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0xa09040)\n" + " (declare (in ) bvec3 y@0xa09150)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0xa09330)\n" + " (declare (in ) bvec4 y@0xa09440)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function notEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa09620)\n" + " (declare (in ) vec2 y@0xa09730)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa09af0)\n" + " (declare (in ) vec3 y@0xa09c00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa09de0)\n" + " (declare (in ) vec4 y@0xa09ef0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0xa0a0d0)\n" + " (declare (in ) ivec2 y@0xa0a1e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0xa0a3c0)\n" + " (declare (in ) ivec3 y@0xa0a4d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0xa0a6b0)\n" + " (declare (in ) ivec4 y@0xa0a7c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0xa0a9a0)\n" + " (declare (in ) bvec2 y@0xa0aab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0xa0ac90)\n" + " (declare (in ) bvec3 y@0xa0ada0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0xa0af80)\n" + " (declare (in ) bvec4 y@0xa0b090)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function any\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0xa0b270)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0xa0b620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0xa0b800)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function all\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0xa0b9e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0xa0bd90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0xa0bf70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function not\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0xa0c150)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0xa0c500)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0xa0c6e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0xa0c8c0)\n" + " (declare (in ) float coord@0xa0c9e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0xa0cda0)\n" + " (declare (in ) vec2 coord@0xa0cec0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0xa0d280)\n" + " (declare (in ) vec4 coord@0xa0d3a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0xa0d580)\n" + " (declare (in ) float coord@0xa0d6a0)\n" + " (declare (in ) float lod@0xa0d7b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0xa0db70)\n" + " (declare (in ) vec2 coord@0xa0dc90)\n" + " (declare (in ) float lod@0xa0dda0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0xa0e160)\n" + " (declare (in ) vec4 coord@0xa0e280)\n" + " (declare (in ) float lod@0xa0e390)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0xa0e570)\n" + " (declare (in ) vec2 coord@0xa0e690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0xa0ea50)\n" + " (declare (in ) vec3 coord@0xa0eb70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0xa0ef30)\n" + " (declare (in ) vec4 coord@0xa0f050)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0xa0f230)\n" + " (declare (in ) vec2 coord@0xa0f350)\n" + " (declare (in ) float lod@0xa0f460)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0xa0f820)\n" + " (declare (in ) vec3 coord@0xa0f940)\n" + " (declare (in ) float lod@0xa0fa50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0xa0fe10)\n" + " (declare (in ) vec4 coord@0xa0ff30)\n" + " (declare (in ) float lod@0xa10040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0xa10220)\n" + " (declare (in ) vec3 coord@0xa10340)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0xa10700)\n" + " (declare (in ) vec4 coord@0xa10820)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0xa10be0)\n" + " (declare (in ) vec3 coord@0xa10d00)\n" + " (declare (in ) float lod@0xa10e10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0xa111d0)\n" + " (declare (in ) vec4 coord@0xa112f0)\n" + " (declare (in ) float lod@0xa11400)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function textureCube\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0xa117c0)\n" + " (declare (in ) vec3 coord@0xa118e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function textureCubeLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0xa11ca0)\n" + " (declare (in ) vec3 coord@0xa11dc0)\n" + " (declare (in ) float lod@0xa11ed0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0xa12290)\n" + " (declare (in ) vec3 coord@0xa123b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0xa12770)\n" + " (declare (in ) vec3 coord@0xa12890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0xa12c50)\n" + " (declare (in ) vec4 coord@0xa12d70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0xa13130)\n" + " (declare (in ) vec4 coord@0xa13250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0xa13610)\n" + " (declare (in ) vec3 coord@0xa13730)\n" + " (declare (in ) float lod@0xa13840)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0xa13c00)\n" + " (declare (in ) vec3 coord@0xa13d20)\n" + " (declare (in ) float lod@0xa13e30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0xa141f0)\n" + " (declare (in ) vec4 coord@0xa14310)\n" + " (declare (in ) float lod@0xa14420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0xa147e0)\n" + " (declare (in ) vec4 coord@0xa14900)\n" + " (declare (in ) float lod@0xa14a10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise1\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0xa14dd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa15180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa15360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa15540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float x@0xa15720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa15ad0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa15cb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa15e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float x@0xa16070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa16420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa16600)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa167e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float x@0xa169c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec2 x@0xa16d70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec3 x@0xa16f50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0xa17130)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\n" + ")" +; +static const char *functions_for_110_vert [] = { + builtin_clamp, + builtin_matrixCompMult, + builtin_shadow2DProjLod, + builtin_noise2, + builtin_texture3DProjLod, + builtin_pow, + builtin_texture2DProj, + builtin_greaterThanEqual, + builtin_sign, + builtin_texture3DProj, + builtin_texture2D, + builtin_equal, + 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_inversesqrt, + builtin_mod, + builtin_noise4, + builtin_distance, + builtin_cos, + builtin_shadow1D, + builtin_noise1, + builtin_refract, + builtin_noise3, + builtin_texture2DLod, + builtin_min, + 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_110_frag = + "(\n" + "(function radians\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float degrees@0x151ee40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 degrees@0x151f210)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 degrees@0x151f400)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 degrees@0x151f5f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float radians@0x151f7e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 radians@0x151fbb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 radians@0x151fda0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 radians@0x151ff90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x1520180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x1520530)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x1520710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x15208f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x1520ad0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x1520e80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x1521060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x1521240)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function tan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x1521420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x15217d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x15219b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x1521b90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function asin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x1521d70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x1522120)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x1522300)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x15224e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x15226c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x1522a70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x1522c50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x1522e30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function atan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y@0x1523010)\n" + " (declare (in ) float x@0x1523120)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y@0x15234d0)\n" + " (declare (in ) vec2 x@0x15235e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y@0x15237c0)\n" + " (declare (in ) vec3 x@0x15238d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y@0x1523ab0)\n" + " (declare (in ) vec4 x@0x1523bc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y_over_x@0x1523da0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y_over_x@0x1523f90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y_over_x@0x1524180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y_over_x@0x1524370)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function pow\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1524560)\n" + " (declare (in ) float y@0x1524670)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1524a20)\n" + " (declare (in ) vec2 y@0x1524b30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1524d10)\n" + " (declare (in ) vec3 y@0x1524e20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1525000)\n" + " (declare (in ) vec4 y@0x1525110)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x15252f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x15256a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1525880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1525a60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1525c40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1525ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x15261d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x15263b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1526590)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1526940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1526b20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1526d00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1526ee0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1527290)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1527470)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1527650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1527830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1527be0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1527dc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1527fa0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function inversesqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1528180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1528540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1528720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1528900)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1528ae0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1528e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1529070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1529250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sign\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1529430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x15297e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x15299c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1529ba0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1529d80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152a130)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152a310)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152a4f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function ceil\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x152a6d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152aa80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152ac60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152ae40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x152b020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152b3d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152b5b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152b790)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x152b970)\n" + " (declare (in ) float y@0x152ba80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152be30)\n" + " (declare (in ) float y@0x152bf40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152c120)\n" + " (declare (in ) float y@0x152c230)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152c410)\n" + " (declare (in ) float y@0x152c520)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152c700)\n" + " (declare (in ) vec2 y@0x152c810)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152c9f0)\n" + " (declare (in ) vec3 y@0x152cb00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152cce0)\n" + " (declare (in ) vec4 y@0x152cdf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x152cfd0)\n" + " (declare (in ) float y@0x152d0e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152d490)\n" + " (declare (in ) vec2 y@0x152d5a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152d780)\n" + " (declare (in ) vec3 y@0x152d890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152da70)\n" + " (declare (in ) vec4 y@0x152db80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152dd60)\n" + " (declare (in ) float y@0x152de70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152e050)\n" + " (declare (in ) float y@0x152e160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152e340)\n" + " (declare (in ) float y@0x152e450)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function max\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x152e630)\n" + " (declare (in ) float y@0x152e740)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152eaf0)\n" + " (declare (in ) vec2 y@0x152ec00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152ede0)\n" + " (declare (in ) vec3 y@0x152eef0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152f0d0)\n" + " (declare (in ) vec4 y@0x152f1e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x152f3c0)\n" + " (declare (in ) float y@0x152f4d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x152f6b0)\n" + " (declare (in ) float y@0x152f7c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x152f9a0)\n" + " (declare (in ) float y@0x152fab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function clamp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x152fc90)\n" + " (declare (in ) float minVal@0x152fda0)\n" + " (declare (in ) float maxVal@0x152feb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1530260)\n" + " (declare (in ) vec2 minVal@0x1530370)\n" + " (declare (in ) vec2 maxVal@0x1530480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1530660)\n" + " (declare (in ) vec3 minVal@0x1530770)\n" + " (declare (in ) vec3 maxVal@0x1530880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1530a60)\n" + " (declare (in ) vec4 minVal@0x1530b70)\n" + " (declare (in ) vec4 maxVal@0x1530c80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1530e60)\n" + " (declare (in ) float minVal@0x1530f70)\n" + " (declare (in ) float maxVal@0x1531080)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1531260)\n" + " (declare (in ) float minVal@0x1531370)\n" + " (declare (in ) float maxVal@0x1531480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1531660)\n" + " (declare (in ) float minVal@0x1531770)\n" + " (declare (in ) float maxVal@0x1531880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mix\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1531a60)\n" + " (declare (in ) float y@0x1531b70)\n" + " (declare (in ) float a@0x1531c80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1532030)\n" + " (declare (in ) vec2 y@0x1532140)\n" + " (declare (in ) vec2 a@0x1532250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1532430)\n" + " (declare (in ) vec3 y@0x1532540)\n" + " (declare (in ) vec3 a@0x1532650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1532830)\n" + " (declare (in ) vec4 y@0x1532940)\n" + " (declare (in ) vec4 a@0x1532a50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1532c30)\n" + " (declare (in ) vec2 y@0x1532d40)\n" + " (declare (in ) float a@0x1532e50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1533030)\n" + " (declare (in ) vec3 y@0x1533140)\n" + " (declare (in ) float a@0x1533250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1533430)\n" + " (declare (in ) vec4 y@0x1533540)\n" + " (declare (in ) float a@0x1533650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge@0x1533830)\n" + " (declare (in ) float x@0x1533940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge@0x1533cf0)\n" + " (declare (in ) vec2 x@0x1533e00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge@0x1533fe0)\n" + " (declare (in ) vec3 x@0x15340f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge@0x15342d0)\n" + " (declare (in ) vec4 x@0x15343e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge@0x15345c0)\n" + " (declare (in ) vec2 x@0x15346d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge@0x15348b0)\n" + " (declare (in ) vec3 x@0x15349c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge@0x1534ba0)\n" + " (declare (in ) vec4 x@0x1534cb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge0@0x1534e90)\n" + " (declare (in ) float edge1@0x1534fa0)\n" + " (declare (in ) float x@0x15350b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge0@0x1535470)\n" + " (declare (in ) vec2 edge1@0x1535580)\n" + " (declare (in ) vec2 x@0x1535690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge0@0x1535870)\n" + " (declare (in ) vec3 edge1@0x1535980)\n" + " (declare (in ) vec3 x@0x1535a90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge0@0x1535c70)\n" + " (declare (in ) vec4 edge1@0x1535d80)\n" + " (declare (in ) vec4 x@0x1535e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge0@0x1536070)\n" + " (declare (in ) float edge1@0x1536180)\n" + " (declare (in ) vec2 x@0x1536290)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge0@0x1536470)\n" + " (declare (in ) float edge1@0x1536580)\n" + " (declare (in ) vec3 x@0x1536690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge0@0x1536870)\n" + " (declare (in ) float edge1@0x1536980)\n" + " (declare (in ) vec4 x@0x1536a90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function length\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1536c70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1537020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1537200)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x15373e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function distance\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p0@0x15375c0)\n" + " (declare (in ) float p1@0x15376d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 p0@0x1537a90)\n" + " (declare (in ) vec2 p1@0x1537ba0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 p0@0x1537d80)\n" + " (declare (in ) vec3 p1@0x1537e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 p0@0x1538070)\n" + " (declare (in ) vec4 p1@0x1538180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dot\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1538360)\n" + " (declare (in ) float y@0x1538470)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1538820)\n" + " (declare (in ) vec2 y@0x1538930)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1538b10)\n" + " (declare (in ) vec3 y@0x1538c20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1538e00)\n" + " (declare (in ) vec4 y@0x1538f10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cross\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x15390f0)\n" + " (declare (in ) vec3 y@0x1539200)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function normalize\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x15395b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1539970)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1539b50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1539d30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function faceforward\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float N@0x1539f10)\n" + " (declare (in ) float I@0x153a020)\n" + " (declare (in ) float Nref@0x153a130)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 N@0x153a4f0)\n" + " (declare (in ) vec2 I@0x153a600)\n" + " (declare (in ) vec2 Nref@0x153a710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 N@0x153a8f0)\n" + " (declare (in ) vec3 I@0x153aa00)\n" + " (declare (in ) vec3 Nref@0x153ab10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 N@0x153acf0)\n" + " (declare (in ) vec4 I@0x153ae00)\n" + " (declare (in ) vec4 Nref@0x153af10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function reflect\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0x153b0f0)\n" + " (declare (in ) float N@0x153b200)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0x153b5c0)\n" + " (declare (in ) vec2 N@0x153b6d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0x153b8b0)\n" + " (declare (in ) vec3 N@0x153b9c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0x153bba0)\n" + " (declare (in ) vec4 N@0x153bcb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function refract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0x153be90)\n" + " (declare (in ) float N@0x153bfa0)\n" + " (declare (in ) float eta@0x153c0b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0x153c470)\n" + " (declare (in ) vec2 N@0x153c580)\n" + " (declare (in ) float eta@0x153c690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0x153c870)\n" + " (declare (in ) vec3 N@0x153c980)\n" + " (declare (in ) float eta@0x153ca90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0x153cc70)\n" + " (declare (in ) vec4 N@0x153cd80)\n" + " (declare (in ) float eta@0x153ce90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function matrixCompMult\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) mat2 x@0x153d070)\n" + " (declare (in ) mat2 y@0x153d180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) mat3 x@0x153d540)\n" + " (declare (in ) mat3 y@0x153d650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) mat4 x@0x153d830)\n" + " (declare (in ) mat4 y@0x153d940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x153db20)\n" + " (declare (in ) vec2 y@0x153dc30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x153dff0)\n" + " (declare (in ) vec3 y@0x153e100)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x153e2e0)\n" + " (declare (in ) vec4 y@0x153e3f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x153e5d0)\n" + " (declare (in ) ivec2 y@0x153e6e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x153e8c0)\n" + " (declare (in ) ivec3 y@0x153e9d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x153ebb0)\n" + " (declare (in ) ivec4 y@0x153ecc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x153eea0)\n" + " (declare (in ) vec2 y@0x153efb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x153f370)\n" + " (declare (in ) vec3 y@0x153f480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x153f660)\n" + " (declare (in ) vec4 y@0x153f770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x153f950)\n" + " (declare (in ) ivec2 y@0x153fa60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x153fc40)\n" + " (declare (in ) ivec3 y@0x153fd50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x153ff30)\n" + " (declare (in ) ivec4 y@0x1540040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1540220)\n" + " (declare (in ) vec2 y@0x1540330)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x15406f0)\n" + " (declare (in ) vec3 y@0x1540800)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x15409e0)\n" + " (declare (in ) vec4 y@0x1540af0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x1540cd0)\n" + " (declare (in ) ivec2 y@0x1540de0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x1540fc0)\n" + " (declare (in ) ivec3 y@0x15410d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x15412b0)\n" + " (declare (in ) ivec4 y@0x15413c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x15415a0)\n" + " (declare (in ) vec2 y@0x15416b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1541a70)\n" + " (declare (in ) vec3 y@0x1541b80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1541d60)\n" + " (declare (in ) vec4 y@0x1541e70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x1542050)\n" + " (declare (in ) ivec2 y@0x1542160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x1542340)\n" + " (declare (in ) ivec3 y@0x1542450)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x1542630)\n" + " (declare (in ) ivec4 y@0x1542740)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function equal\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1542920)\n" + " (declare (in ) vec2 y@0x1542a30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1542de0)\n" + " (declare (in ) vec3 y@0x1542ef0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x15430d0)\n" + " (declare (in ) vec4 y@0x15431e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x15433c0)\n" + " (declare (in ) ivec2 y@0x15434d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x15436b0)\n" + " (declare (in ) ivec3 y@0x15437c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x15439a0)\n" + " (declare (in ) ivec4 y@0x1543ab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x1543c90)\n" + " (declare (in ) bvec2 y@0x1543da0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x1543f80)\n" + " (declare (in ) bvec3 y@0x1544090)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x1544270)\n" + " (declare (in ) bvec4 y@0x1544380)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function notEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1544560)\n" + " (declare (in ) vec2 y@0x1544670)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1544a30)\n" + " (declare (in ) vec3 y@0x1544b40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1544d20)\n" + " (declare (in ) vec4 y@0x1544e30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x1545010)\n" + " (declare (in ) ivec2 y@0x1545120)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x1545300)\n" + " (declare (in ) ivec3 y@0x1545410)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x15455f0)\n" + " (declare (in ) ivec4 y@0x1545700)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x15458e0)\n" + " (declare (in ) bvec2 y@0x15459f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x1545bd0)\n" + " (declare (in ) bvec3 y@0x1545ce0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x1545ec0)\n" + " (declare (in ) bvec4 y@0x1545fd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function any\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x15461b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x1546560)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x1546740)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function all\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x1546920)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x1546cd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x1546eb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function not\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x1547090)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x1547440)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x1547620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x1547800)\n" + " (declare (in ) float coord@0x1547920)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x15484c0)\n" + " (declare (in ) float coord@0x15485e0)\n" + " (declare (in ) float bias@0x15486f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x1547ce0)\n" + " (declare (in ) vec2 coord@0x1547e00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x15481c0)\n" + " (declare (in ) vec4 coord@0x15482e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x15488d0)\n" + " (declare (in ) vec2 coord@0x15489f0)\n" + " (declare (in ) float bias@0x1548b00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x1548ce0)\n" + " (declare (in ) vec4 coord@0x1548e00)\n" + " (declare (in ) float bias@0x1548f10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x15490f0)\n" + " (declare (in ) vec2 coord@0x1549210)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x1549db0)\n" + " (declare (in ) vec2 coord@0x1549ed0)\n" + " (declare (in ) float bias@0x1549fe0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x15495d0)\n" + " (declare (in ) vec3 coord@0x15496f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x1549ab0)\n" + " (declare (in ) vec4 coord@0x1549bd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x154a1c0)\n" + " (declare (in ) vec3 coord@0x154a2e0)\n" + " (declare (in ) float bias@0x154a3f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x154a5d0)\n" + " (declare (in ) vec4 coord@0x154a6f0)\n" + " (declare (in ) float bias@0x154a800)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x154a9e0)\n" + " (declare (in ) vec3 coord@0x154ab00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x154b3a0)\n" + " (declare (in ) vec3 coord@0x154b4c0)\n" + " (declare (in ) float bias@0x154b5d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x154aec0)\n" + " (declare (in ) vec4 coord@0x154afe0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x154b7b0)\n" + " (declare (in ) vec4 coord@0x154b8d0)\n" + " (declare (in ) float bias@0x154b9e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function textureCube\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0x154bbc0)\n" + " (declare (in ) vec3 coord@0x154bce0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0x154c0a0)\n" + " (declare (in ) vec3 coord@0x154c1c0)\n" + " (declare (in ) float bias@0x154c2d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x154c4b0)\n" + " (declare (in ) vec3 coord@0x154c5d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x154d830)\n" + " (declare (in ) vec3 coord@0x154d950)\n" + " (declare (in ) float bias@0x154da60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x154c990)\n" + " (declare (in ) vec3 coord@0x154cab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x154dc40)\n" + " (declare (in ) vec3 coord@0x154dd60)\n" + " (declare (in ) float bias@0x154de70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x154ce70)\n" + " (declare (in ) vec4 coord@0x154cf90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x154e050)\n" + " (declare (in ) vec4 coord@0x154e170)\n" + " (declare (in ) float bias@0x154e280)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x154d350)\n" + " (declare (in ) vec4 coord@0x154d470)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x154e460)\n" + " (declare (in ) vec4 coord@0x154e580)\n" + " (declare (in ) float bias@0x154e690)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dFdx\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p@0x154e870)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 p@0x154ec20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 p@0x154ee00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 p@0x154efe0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dFdy\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p@0x154f1c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 p@0x154f570)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 p@0x154f750)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 p@0x154f930)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function fwidth\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p@0x154fb10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 p@0x154fec0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 p@0x15500a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 p@0x1550280)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise1\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x1550460)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1550810)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x15509f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1550bd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float x@0x1550db0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1551160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1551340)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1551520)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float x@0x1551700)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1551ab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x1551c90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec4 x@0x1551e70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float x@0x1552050)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec2 x@0x1552400)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec3 x@0x15525e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x15527c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\n" + ")" +; +static const char *functions_for_110_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_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_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 *prototypes_for_EXT_texture_array_vert = + "(\n" + "(function texture1DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0x25ee5c0)\n" + " (declare (in ) vec2 coord@0x25ee6e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DArrayLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0x25eeaa0)\n" + " (declare (in ) vec2 coord@0x25eebc0)\n" + " (declare (in ) float lod@0x25eecd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0x25ef090)\n" + " (declare (in ) vec2 coord@0x25ef1b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DArrayLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArray sampler@0x25ef570)\n" + " (declare (in ) vec2 coord@0x25ef690)\n" + " (declare (in ) float lod@0x25ef7a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArrayShadow sampler@0x25efb60)\n" + " (declare (in ) vec3 coord@0x25efc80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DArrayLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DArrayShadow sampler@0x25f0040)\n" + " (declare (in ) vec3 coord@0x25f0160)\n" + " (declare (in ) float lod@0x25f0270)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DArrayShadow sampler@0x25f0630)\n" + " (declare (in ) vec4 coord@0x25f0750)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\n" + ")" +; +static const char *functions_for_EXT_texture_array_vert [] = { + builtin_texture1DArrayLod, + builtin_shadow2DArray, + builtin_texture2DArrayLod, + builtin_shadow1DArrayLod, + builtin_shadow1DArray, + builtin_texture2DArray, + builtin_texture1DArray, +}; +static const char *prototypes_for_ARB_texture_rectangle_vert = + "(\n" + "(function texture2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRect sampler@0x1cc28a0)\n" + " (declare (in ) vec2 coord@0x1cc29c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRect sampler@0x1cc2d80)\n" + " (declare (in ) vec3 coord@0x1cc2ea0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRect sampler@0x1cc3260)\n" + " (declare (in ) vec4 coord@0x1cc3380)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRectShadow sampler@0x1cc3560)\n" + " (declare (in ) vec3 coord@0x1cc3680)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRectShadow sampler@0x1cc3a40)\n" + " (declare (in ) vec4 coord@0x1cc3b60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\n" + ")" +; +static const char *functions_for_ARB_texture_rectangle_vert [] = { + builtin_texture2DRect, + builtin_shadow2DRectProj, + builtin_shadow2DRect, + builtin_texture2DRectProj, +}; +static const char *prototypes_for_ARB_texture_rectangle_frag = + "(\n" + "(function texture2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRect sampler@0x13d0040)\n" + " (declare (in ) vec2 coord@0x13d0160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRect sampler@0x13d0520)\n" + " (declare (in ) vec3 coord@0x13d0640)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRect sampler@0x13d0a00)\n" + " (declare (in ) vec4 coord@0x13d0b20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DRect\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRectShadow sampler@0x13d0d00)\n" + " (declare (in ) vec3 coord@0x13d0e20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DRectProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DRectShadow sampler@0x13d11e0)\n" + " (declare (in ) vec4 coord@0x13d1300)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "\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" + " (parameters\n" + " (declare (in ) float degrees@0x8b57e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 degrees@0x8b5bb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 degrees@0x8b5da0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 degrees@0x8b5f90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float radians@0x8b6180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 radians@0x8b6550)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 radians@0x8b6740)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 radians@0x8b6930)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x8b6b20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x8b6ed0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x8b70b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x8b7290)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x8b7470)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x8b7820)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x8b7a00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x8b7be0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function tan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x8b7dc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x8b8170)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x8b8350)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x8b8530)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function asin\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x8b8710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x8b8ac0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x8b8ca0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x8b8e80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float angle@0x8b9060)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 angle@0x8b9410)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 angle@0x8b95f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 angle@0x8b97d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function atan\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y@0x8b99b0)\n" + " (declare (in ) float x@0x8b9ac0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y@0x8b9e70)\n" + " (declare (in ) vec2 x@0x8b9f80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y@0x8ba160)\n" + " (declare (in ) vec3 x@0x8ba270)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y@0x8ba450)\n" + " (declare (in ) vec4 x@0x8ba560)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float y_over_x@0x8ba740)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 y_over_x@0x8ba930)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 y_over_x@0x8bab20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 y_over_x@0x8bad10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function pow\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8baf00)\n" + " (declare (in ) float y@0x8bb010)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8bb3c0)\n" + " (declare (in ) vec2 y@0x8bb4d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bb6b0)\n" + " (declare (in ) vec3 y@0x8bb7c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bb9a0)\n" + " (declare (in ) vec4 y@0x8bbab0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8bbc90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8bc040)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bc220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bc400)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8bc5e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8bc990)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bcb70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bcd50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8bcf30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8bd2e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bd4c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bd6a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8bd880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8bdc30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bde10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bdff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8be1d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8be580)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8be760)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8be940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function inversesqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8beb20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8beee0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bf0c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bf2a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8bf480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8bf830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8bfa10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8bfbf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function sign\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8bfdd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c0180)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c0360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c0540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c0720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c0ad0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c0cb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c0e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function ceil\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c1070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c1420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c1600)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c17e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c19c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c1d70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c1f50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c2130)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c2310)\n" + " (declare (in ) float y@0x8c2420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c27d0)\n" + " (declare (in ) float y@0x8c28e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c2ac0)\n" + " (declare (in ) float y@0x8c2bd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c2db0)\n" + " (declare (in ) float y@0x8c2ec0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c30a0)\n" + " (declare (in ) vec2 y@0x8c31b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c3390)\n" + " (declare (in ) vec3 y@0x8c34a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c3680)\n" + " (declare (in ) vec4 y@0x8c3790)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c3970)\n" + " (declare (in ) float y@0x8c3a80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c3e30)\n" + " (declare (in ) vec2 y@0x8c3f40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c4120)\n" + " (declare (in ) vec3 y@0x8c4230)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c4410)\n" + " (declare (in ) vec4 y@0x8c4520)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c4700)\n" + " (declare (in ) float y@0x8c4810)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c49f0)\n" + " (declare (in ) float y@0x8c4b00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c4ce0)\n" + " (declare (in ) float y@0x8c4df0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function max\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c4fd0)\n" + " (declare (in ) float y@0x8c50e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c5490)\n" + " (declare (in ) vec2 y@0x8c55a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c5780)\n" + " (declare (in ) vec3 y@0x8c5890)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c5a70)\n" + " (declare (in ) vec4 y@0x8c5b80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c5d60)\n" + " (declare (in ) float y@0x8c5e70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c6050)\n" + " (declare (in ) float y@0x8c6160)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c6340)\n" + " (declare (in ) float y@0x8c6450)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function clamp\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c6630)\n" + " (declare (in ) float minVal@0x8c6740)\n" + " (declare (in ) float maxVal@0x8c6850)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c6c00)\n" + " (declare (in ) vec2 minVal@0x8c6d10)\n" + " (declare (in ) vec2 maxVal@0x8c6e20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c7000)\n" + " (declare (in ) vec3 minVal@0x8c7110)\n" + " (declare (in ) vec3 maxVal@0x8c7220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c7400)\n" + " (declare (in ) vec4 minVal@0x8c7510)\n" + " (declare (in ) vec4 maxVal@0x8c7620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c7800)\n" + " (declare (in ) float minVal@0x8c7910)\n" + " (declare (in ) float maxVal@0x8c7a20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c7c00)\n" + " (declare (in ) float minVal@0x8c7d10)\n" + " (declare (in ) float maxVal@0x8c7e20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c8000)\n" + " (declare (in ) float minVal@0x8c8110)\n" + " (declare (in ) float maxVal@0x8c8220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function mix\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8c8400)\n" + " (declare (in ) float y@0x8c8510)\n" + " (declare (in ) float a@0x8c8620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c89d0)\n" + " (declare (in ) vec2 y@0x8c8ae0)\n" + " (declare (in ) vec2 a@0x8c8bf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c8dd0)\n" + " (declare (in ) vec3 y@0x8c8ee0)\n" + " (declare (in ) vec3 a@0x8c8ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c91d0)\n" + " (declare (in ) vec4 y@0x8c92e0)\n" + " (declare (in ) vec4 a@0x8c93f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8c95d0)\n" + " (declare (in ) vec2 y@0x8c96e0)\n" + " (declare (in ) float a@0x8c97f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8c99d0)\n" + " (declare (in ) vec3 y@0x8c9ae0)\n" + " (declare (in ) float a@0x8c9bf0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8c9dd0)\n" + " (declare (in ) vec4 y@0x8c9ee0)\n" + " (declare (in ) float a@0x8c9ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge@0x8ca1d0)\n" + " (declare (in ) float x@0x8ca2e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge@0x8ca690)\n" + " (declare (in ) vec2 x@0x8ca7a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge@0x8ca980)\n" + " (declare (in ) vec3 x@0x8caa90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge@0x8cac70)\n" + " (declare (in ) vec4 x@0x8cad80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge@0x8caf60)\n" + " (declare (in ) vec2 x@0x8cb070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge@0x8cb250)\n" + " (declare (in ) vec3 x@0x8cb360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge@0x8cb540)\n" + " (declare (in ) vec4 x@0x8cb650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float edge0@0x8cb830)\n" + " (declare (in ) float edge1@0x8cb940)\n" + " (declare (in ) float x@0x8cba50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 edge0@0x8cbe10)\n" + " (declare (in ) vec2 edge1@0x8cbf20)\n" + " (declare (in ) vec2 x@0x8cc030)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 edge0@0x8cc210)\n" + " (declare (in ) vec3 edge1@0x8cc320)\n" + " (declare (in ) vec3 x@0x8cc430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 edge0@0x8cc610)\n" + " (declare (in ) vec4 edge1@0x8cc720)\n" + " (declare (in ) vec4 x@0x8cc830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float edge0@0x8cca10)\n" + " (declare (in ) float edge1@0x8ccb20)\n" + " (declare (in ) vec2 x@0x8ccc30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float edge0@0x8cce10)\n" + " (declare (in ) float edge1@0x8ccf20)\n" + " (declare (in ) vec3 x@0x8cd030)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float edge0@0x8cd210)\n" + " (declare (in ) float edge1@0x8cd320)\n" + " (declare (in ) vec4 x@0x8cd430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function length\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8cd610)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8cd9c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8cdba0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8cdd80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function distance\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p0@0x8cdf60)\n" + " (declare (in ) float p1@0x8ce070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 p0@0x8ce430)\n" + " (declare (in ) vec2 p1@0x8ce540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 p0@0x8ce720)\n" + " (declare (in ) vec3 p1@0x8ce830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 p0@0x8cea10)\n" + " (declare (in ) vec4 p1@0x8ceb20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dot\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8ced00)\n" + " (declare (in ) float y@0x8cee10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8cf1c0)\n" + " (declare (in ) vec2 y@0x8cf2d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8cf4b0)\n" + " (declare (in ) vec3 y@0x8cf5c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8cf7a0)\n" + " (declare (in ) vec4 y@0x8cf8b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function cross\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8cfa90)\n" + " (declare (in ) vec3 y@0x8cfba0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function normalize\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8cff50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8d0310)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8d04f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8d06d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function faceforward\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float N@0x8d08b0)\n" + " (declare (in ) float I@0x8d09c0)\n" + " (declare (in ) float Nref@0x8d0ad0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 N@0x8d0e90)\n" + " (declare (in ) vec2 I@0x8d0fa0)\n" + " (declare (in ) vec2 Nref@0x8d10b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 N@0x8d1290)\n" + " (declare (in ) vec3 I@0x8d13a0)\n" + " (declare (in ) vec3 Nref@0x8d14b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 N@0x8d1690)\n" + " (declare (in ) vec4 I@0x8d17a0)\n" + " (declare (in ) vec4 Nref@0x8d18b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function reflect\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0x8d1a90)\n" + " (declare (in ) float N@0x8d1ba0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0x8d1f60)\n" + " (declare (in ) vec2 N@0x8d2070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0x8d2250)\n" + " (declare (in ) vec3 N@0x8d2360)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0x8d2540)\n" + " (declare (in ) vec4 N@0x8d2650)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function refract\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float I@0x8d2830)\n" + " (declare (in ) float N@0x8d2940)\n" + " (declare (in ) float eta@0x8d2a50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 I@0x8d2e10)\n" + " (declare (in ) vec2 N@0x8d2f20)\n" + " (declare (in ) float eta@0x8d3030)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 I@0x8d3210)\n" + " (declare (in ) vec3 N@0x8d3320)\n" + " (declare (in ) float eta@0x8d3430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 I@0x8d3610)\n" + " (declare (in ) vec4 N@0x8d3720)\n" + " (declare (in ) float eta@0x8d3830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function matrixCompMult\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) mat2 x@0x8d3a10)\n" + " (declare (in ) mat2 y@0x8d3b20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) mat3 x@0x8d3ee0)\n" + " (declare (in ) mat3 y@0x8d3ff0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) mat4 x@0x8d41d0)\n" + " (declare (in ) mat4 y@0x8d42e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in ) mat2x3 x@0x8d44c0)\n" + " (declare (in ) mat2x3 y@0x8d45d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in ) mat2x4 x@0x8d47b0)\n" + " (declare (in ) mat2x4 y@0x8d48c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in ) mat3x2 x@0x8d4aa0)\n" + " (declare (in ) mat3x2 y@0x8d4bb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in ) mat3x4 x@0x8d4d90)\n" + " (declare (in ) mat3x4 y@0x8d4ea0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in ) mat4x2 x@0x8d5080)\n" + " (declare (in ) mat4x2 y@0x8d5190)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in ) mat4x3 x@0x8d5370)\n" + " (declare (in ) mat4x3 y@0x8d5480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function outerProduct\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) vec2 c@0x8d5660)\n" + " (declare (in ) vec2 r@0x8d5770)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) vec3 c@0x8d5b30)\n" + " (declare (in ) vec3 r@0x8d5c40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) vec4 c@0x8d5e20)\n" + " (declare (in ) vec4 r@0x8d5f30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in ) vec3 c@0x8d6110)\n" + " (declare (in ) vec2 r@0x8d6220)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in ) vec2 c@0x8d6400)\n" + " (declare (in ) vec3 r@0x8d6510)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in ) vec4 c@0x8d66f0)\n" + " (declare (in ) vec2 r@0x8d6800)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in ) vec2 c@0x8d69e0)\n" + " (declare (in ) vec4 r@0x8d6af0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in ) vec4 c@0x8d6cd0)\n" + " (declare (in ) vec3 r@0x8d6de0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in ) vec3 c@0x8d6fc0)\n" + " (declare (in ) vec4 r@0x8d70d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function transpose\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in ) mat2 m@0x8d72b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in ) mat3 m@0x8d7670)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in ) mat4 m@0x8d7850)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in ) mat3x2 m@0x8d7a30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in ) mat2x3 m@0x8d7c10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in ) mat4x2 m@0x8d7df0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in ) mat2x4 m@0x8d7fd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in ) mat4x3 m@0x8d81b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in ) mat3x4 m@0x8d8390)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8d8570)\n" + " (declare (in ) vec2 y@0x8d8680)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8d8a40)\n" + " (declare (in ) vec3 y@0x8d8b50)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8d8d30)\n" + " (declare (in ) vec4 y@0x8d8e40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x8d9020)\n" + " (declare (in ) ivec2 y@0x8d9130)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x8d9310)\n" + " (declare (in ) ivec3 y@0x8d9420)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x8d9600)\n" + " (declare (in ) ivec4 y@0x8d9710)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function lessThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8d98f0)\n" + " (declare (in ) vec2 y@0x8d9a00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8d9dc0)\n" + " (declare (in ) vec3 y@0x8d9ed0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8da0b0)\n" + " (declare (in ) vec4 y@0x8da1c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x8da3a0)\n" + " (declare (in ) ivec2 y@0x8da4b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x8da690)\n" + " (declare (in ) ivec3 y@0x8da7a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x8da980)\n" + " (declare (in ) ivec4 y@0x8daa90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8dac70)\n" + " (declare (in ) vec2 y@0x8dad80)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8db140)\n" + " (declare (in ) vec3 y@0x8db250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8db430)\n" + " (declare (in ) vec4 y@0x8db540)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x8db720)\n" + " (declare (in ) ivec2 y@0x8db830)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x8dba10)\n" + " (declare (in ) ivec3 y@0x8dbb20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x8dbd00)\n" + " (declare (in ) ivec4 y@0x8dbe10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8dbff0)\n" + " (declare (in ) vec2 y@0x8dc100)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8dc4c0)\n" + " (declare (in ) vec3 y@0x8dc5d0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8dc7b0)\n" + " (declare (in ) vec4 y@0x8dc8c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x8dcaa0)\n" + " (declare (in ) ivec2 y@0x8dcbb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x8dcd90)\n" + " (declare (in ) ivec3 y@0x8dcea0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x8dd080)\n" + " (declare (in ) ivec4 y@0x8dd190)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function equal\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8dd370)\n" + " (declare (in ) vec2 y@0x8dd480)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8dd830)\n" + " (declare (in ) vec3 y@0x8dd940)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8ddb20)\n" + " (declare (in ) vec4 y@0x8ddc30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x8dde10)\n" + " (declare (in ) ivec2 y@0x8ddf20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x8de100)\n" + " (declare (in ) ivec3 y@0x8de210)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x8de3f0)\n" + " (declare (in ) ivec4 y@0x8de500)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x8de6e0)\n" + " (declare (in ) bvec2 y@0x8de7f0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x8de9d0)\n" + " (declare (in ) bvec3 y@0x8deae0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x8decc0)\n" + " (declare (in ) bvec4 y@0x8dedd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function notEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8defb0)\n" + " (declare (in ) vec2 y@0x8df0c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8df480)\n" + " (declare (in ) vec3 y@0x8df590)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8df770)\n" + " (declare (in ) vec4 y@0x8df880)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) ivec2 x@0x8dfa60)\n" + " (declare (in ) ivec2 y@0x8dfb70)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) ivec3 x@0x8dfd50)\n" + " (declare (in ) ivec3 y@0x8dfe60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) ivec4 x@0x8e0040)\n" + " (declare (in ) ivec4 y@0x8e0150)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x8e0330)\n" + " (declare (in ) bvec2 y@0x8e0440)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x8e0620)\n" + " (declare (in ) bvec3 y@0x8e0730)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x8e0910)\n" + " (declare (in ) bvec4 y@0x8e0a20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function any\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x8e0c00)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x8e0fb0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x8e1190)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function all\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x8e1370)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x8e1720)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bool\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x8e1900)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function not\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in ) bvec2 x@0x8e1ae0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in ) bvec3 x@0x8e1e90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in ) bvec4 x@0x8e2070)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x8e2250)\n" + " (declare (in ) float coord@0x8e2370)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x8e2f10)\n" + " (declare (in ) float coord@0x8e3030)\n" + " (declare (in ) float bias@0x8e3140)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x8e2730)\n" + " (declare (in ) vec2 coord@0x8e2850)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x8e2c10)\n" + " (declare (in ) vec4 coord@0x8e2d30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x8e3320)\n" + " (declare (in ) vec2 coord@0x8e3440)\n" + " (declare (in ) float bias@0x8e3550)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1D sampler@0x8e3730)\n" + " (declare (in ) vec4 coord@0x8e3850)\n" + " (declare (in ) float bias@0x8e3960)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x8e3b40)\n" + " (declare (in ) vec2 coord@0x8e3c60)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x8e4800)\n" + " (declare (in ) vec2 coord@0x8e4920)\n" + " (declare (in ) float bias@0x8e4a30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x8e4020)\n" + " (declare (in ) vec3 coord@0x8e4140)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x8e4500)\n" + " (declare (in ) vec4 coord@0x8e4620)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x8e4c10)\n" + " (declare (in ) vec3 coord@0x8e4d30)\n" + " (declare (in ) float bias@0x8e4e40)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2D sampler@0x8e5020)\n" + " (declare (in ) vec4 coord@0x8e5140)\n" + " (declare (in ) float bias@0x8e5250)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x8e5430)\n" + " (declare (in ) vec3 coord@0x8e5550)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x8e5df0)\n" + " (declare (in ) vec3 coord@0x8e5f10)\n" + " (declare (in ) float bias@0x8e6020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function texture3DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x8e5910)\n" + " (declare (in ) vec4 coord@0x8e5a30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler3D sampler@0x8e6200)\n" + " (declare (in ) vec4 coord@0x8e6320)\n" + " (declare (in ) float bias@0x8e6430)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function textureCube\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0x8e6610)\n" + " (declare (in ) vec3 coord@0x8e6730)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) samplerCube sampler@0x8e6af0)\n" + " (declare (in ) vec3 coord@0x8e6c10)\n" + " (declare (in ) float bias@0x8e6d20)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x8e6f00)\n" + " (declare (in ) vec3 coord@0x8e7020)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x8e8280)\n" + " (declare (in ) vec3 coord@0x8e83a0)\n" + " (declare (in ) float bias@0x8e84b0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x8e73e0)\n" + " (declare (in ) vec3 coord@0x8e7500)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x8e8690)\n" + " (declare (in ) vec3 coord@0x8e87b0)\n" + " (declare (in ) float bias@0x8e88c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x8e78c0)\n" + " (declare (in ) vec4 coord@0x8e79e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler1DShadow sampler@0x8e8aa0)\n" + " (declare (in ) vec4 coord@0x8e8bc0)\n" + " (declare (in ) float bias@0x8e8cd0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x8e7da0)\n" + " (declare (in ) vec4 coord@0x8e7ec0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) sampler2DShadow sampler@0x8e8eb0)\n" + " (declare (in ) vec4 coord@0x8e8fd0)\n" + " (declare (in ) float bias@0x8e90e0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dFdx\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p@0x8e92c0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 p@0x8e9670)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 p@0x8e9850)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 p@0x8e9a30)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function dFdy\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p@0x8e9c10)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 p@0x8e9fc0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 p@0x8ea1a0)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 p@0x8ea380)\n" + " )\n" + " (\n" + " ))\n" + "\n" + ")\n" + "\n" + "(function fwidth\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float p@0x8ea560)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 p@0x8ea910)\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" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 p@0x8eaaf0)\n" + " )\n" + " (\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" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 p@0x8eacd0)\n" + " )\n" + " (\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" + ")\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" + "(function noise1\n" + " (signature float\n" + " (parameters\n" + " (declare (in ) float x@0x8eaeb0)\n" + " )\n" + " (\n" + " ))\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" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8eb260)\n" + " )\n" + " (\n" + " ))\n" "\n" - " (signature ivec4\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" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8eb440)\n" + " )\n" + " (\n" + " ))\n" "\n" - " (signature uvec4\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" + " (signature float\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8eb620)\n" + " )\n" + " (\n" + " ))\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" "\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" + "(function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) float x@0x8eb800)\n" + " )\n" + " (\n" + " ))\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" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8ebbb0)\n" + " )\n" + " (\n" + " ))\n" "\n" - "))\n" -}; - -static const char *functions_for_130_fs [] = { - builtins_130_fs_texture, - builtins_130_fs_textureProj, -}; - -/* ARB_texture_rectangle builtins */ - -static const char *builtins_ARB_texture_rectangle_textures = { - "((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" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8ebd90)\n" + " )\n" + " (\n" + " ))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8ebf70)\n" + " )\n" + " (\n" + " ))\n" "\n" ")\n" - " (function shadow2DRect\n" - " (signature vec4\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" - "))\n" -}; - -static const char *functions_for_ARB_texture_rectangle [] = { - builtins_ARB_texture_rectangle_textures, -}; - -/* EXT_texture_array builtins */ - -static const char *builtins_EXT_texture_array_textures = { - "((function texture1DArray\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" + "(function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) float x@0x8ec150)\n" + " )\n" + " (\n" + " ))\n" "\n" - ")\n" - " (function texture1DArrayLod\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" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8ec500)\n" + " )\n" + " (\n" + " ))\n" "\n" - ")\n" - " (function texture2DArray\n" - " (signature vec4\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" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8ec6e0)\n" + " )\n" + " (\n" + " ))\n" "\n" - ")\n" - " (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" + " (signature vec3\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8ec8c0)\n" + " )\n" + " (\n" + " ))\n" "\n" ")\n" - " (function shadow1DArray\n" - " (signature vec4\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" "\n" - ")\n" - " (function shadow1DArrayLod\n" - " (signature vec4\n" - " (parameters\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) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) float x@0x8ecaa0)\n" + " )\n" + " (\n" + " ))\n" "\n" - ")\n" - " (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" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec2 x@0x8ece50)\n" + " )\n" + " (\n" + " ))\n" "\n" - "))\n" -}; - -static const char *functions_for_EXT_texture_array [] = { - builtins_EXT_texture_array_textures, -}; - -/* EXT_texture_array_fs builtins */ - -static const char *builtins_EXT_texture_array_fs_textures = { - "((function texture1DArray\n" - " (signature vec4\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" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec3 x@0x8ed030)\n" + " )\n" + " (\n" + " ))\n" "\n" - ")\n" - " (function texture2DArray\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" + " (signature vec4\n" + " (parameters\n" + " (declare (in ) vec4 x@0x8ed210)\n" + " )\n" + " (\n" + " ))\n" "\n" ")\n" - " (function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow 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 *functions_for_EXT_texture_array_fs [] = { - builtins_EXT_texture_array_fs_textures, + "\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, }; void *builtin_mem_ctx = NULL; @@ -4810,134 +14684,137 @@ _mesa_glsl_release_functions(void) void _mesa_glsl_initialize_functions(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (builtin_mem_ctx == NULL) builtin_mem_ctx = talloc_init("GLSL built-in functions"); state->num_builtins_to_link = 0; - if (state->language_version >= 110) { - static gl_shader *sh = NULL; - - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_110, - Elements(functions_for_110)); - talloc_steal(builtin_mem_ctx, sh); - } - - import_prototypes(sh->ir, instructions, state->symbols, state); - state->builtins_to_link[state->num_builtins_to_link] = sh; - 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, functions_for_110_fs, - Elements(functions_for_110_fs)); - talloc_steal(builtin_mem_ctx, sh); + sh = read_builtins(GL_VERTEX_SHADER, + prototypes_for_120_vert, + functions_for_120_vert, + Elements(functions_for_120_vert )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->language_version >= 110) { + if (state->target == fragment_shader && state->EXT_texture_array_enable) { static gl_shader *sh = NULL; - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_110_vs, - Elements(functions_for_110_vs)); - talloc_steal(builtin_mem_ctx, sh); + 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 )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->language_version >= 120) { + if (state->target == vertex_shader && state->language_version == 110) { static gl_shader *sh = NULL; - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_120, - Elements(functions_for_120)); - talloc_steal(builtin_mem_ctx, sh); + sh = read_builtins(GL_VERTEX_SHADER, + prototypes_for_110_vert, + functions_for_110_vert, + Elements(functions_for_110_vert )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->language_version >= 130) { + if (state->target == fragment_shader && state->language_version == 110) { static gl_shader *sh = NULL; - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_130, - Elements(functions_for_130)); - talloc_steal(builtin_mem_ctx, sh); + sh = read_builtins(GL_VERTEX_SHADER, + prototypes_for_110_frag, + functions_for_110_frag, + Elements(functions_for_110_frag )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version >= 130) { + if (state->target == vertex_shader && state->EXT_texture_array_enable) { static gl_shader *sh = NULL; - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_130_fs, - Elements(functions_for_130_fs)); - talloc_steal(builtin_mem_ctx, sh); + 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 )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->ARB_texture_rectangle_enable) { + if (state->target == vertex_shader && state->ARB_texture_rectangle_enable) { static gl_shader *sh = NULL; - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_ARB_texture_rectangle, - Elements(functions_for_ARB_texture_rectangle)); - talloc_steal(builtin_mem_ctx, sh); + 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 )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->EXT_texture_array_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, functions_for_EXT_texture_array, - Elements(functions_for_EXT_texture_array)); - talloc_steal(builtin_mem_ctx, sh); + 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 )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->EXT_texture_array_enable) { + if (state->target == fragment_shader && state->language_version == 120) { static gl_shader *sh = NULL; - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, functions_for_EXT_texture_array_fs, - Elements(functions_for_EXT_texture_array_fs)); - talloc_steal(builtin_mem_ctx, sh); + sh = read_builtins(GL_VERTEX_SHADER, + prototypes_for_120_frag, + functions_for_120_frag, + Elements(functions_for_120_frag )); + talloc_steal(builtin_mem_ctx, sh); } - import_prototypes(sh->ir, instructions, state->symbols, state); + import_prototypes(sh->ir, instructions, state->symbols, + state); state->builtins_to_link[state->num_builtins_to_link] = sh; state->num_builtins_to_link++; } diff --git a/src/glsl/builtins/110/abs b/src/glsl/builtins/110/abs deleted file mode 100644 index 904845307c4..00000000000 --- a/src/glsl/builtins/110/abs +++ /dev/null @@ -1,21 +0,0 @@ -((function abs - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float abs (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 abs (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 abs (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 abs (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/all b/src/glsl/builtins/110/all deleted file mode 100644 index 2cac0dfb684..00000000000 --- a/src/glsl/builtins/110/all +++ /dev/null @@ -1,16 +0,0 @@ -((function all - (signature bool - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec4 arg0)) - ((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)))))) -)) diff --git a/src/glsl/builtins/110/any b/src/glsl/builtins/110/any deleted file mode 100644 index f10e8a7b478..00000000000 --- a/src/glsl/builtins/110/any +++ /dev/null @@ -1,16 +0,0 @@ -((function any - (signature bool - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec4 arg0)) - ((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)))))) -)) diff --git a/src/glsl/builtins/110/asin b/src/glsl/builtins/110/asin deleted file mode 100644 index d26bde364b1..00000000000 --- a/src/glsl/builtins/110/asin +++ /dev/null @@ -1,120 +0,0 @@ -((function asin - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * - (expression float sign (var_ref x)) - (expression float - - (expression float * - (constant float (3.1415926)) - (constant float (0.5))) - (expression float * - (expression float sqrt - (expression float - - (constant float (1.0)) - (expression float abs (var_ref x)))) - (expression float + - (constant float (1.5707288)) - (expression float * - (expression float abs (var_ref x)) - (expression float + - (constant float (-0.2121144)) - (expression float * - (constant float (0.0742610)) - (expression float abs (var_ref x)))))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * - (expression vec2 sign (var_ref x)) - (expression vec2 - - (expression float * - (constant float (3.1415926)) - (constant float (0.5))) - (expression vec2 * - (expression vec2 sqrt - (expression vec2 - - (constant float (1.0)) - (expression vec2 abs (var_ref x)))) - (expression vec2 + - (constant float (1.5707288)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (expression vec2 + - (constant float (-0.2121144)) - (expression vec2 * - (constant float (0.0742610)) - (expression vec2 abs (var_ref x)))))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * - (expression vec3 sign (var_ref x)) - (expression vec3 - - (expression float * - (constant float (3.1415926)) - (constant float (0.5))) - (expression vec3 * - (expression vec3 sqrt - (expression vec3 - - (constant float (1.0)) - (expression vec3 abs (var_ref x)))) - (expression vec3 + - (constant float (1.5707288)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (expression vec3 + - (constant float (-0.2121144)) - (expression vec3 * - (constant float (0.0742610)) - (expression vec3 abs (var_ref x)))))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * - (expression vec4 sign (var_ref x)) - (expression vec4 - - (expression float * - (constant float (3.1415926)) - (constant float (0.5))) - (expression vec4 * - (expression vec4 sqrt - (expression vec4 - - (constant float (1.0)) - (expression vec4 abs (var_ref x)))) - (expression vec4 + - (constant float (1.5707288)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (expression vec4 + - (constant float (-0.2121144)) - (expression vec4 * - (constant float (0.0742610)) - (expression vec4 abs (var_ref x))))))))))) -)) - - (function acos - (signature float - (parameters - (declare (in) float x)) - ((return (expression float - (constant float (1.5707963)) - (call asin ((var_ref x))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 - (constant float (1.5707963)) - (call asin ((var_ref x))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 - (constant float (1.5707963)) - (call asin ((var_ref x))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 - (constant float (1.5707963)) - (call asin ((var_ref x))))))) -)) diff --git a/src/glsl/builtins/110/atan b/src/glsl/builtins/110/atan deleted file mode 100644 index 84048293870..00000000000 --- a/src/glsl/builtins/110/atan +++ /dev/null @@ -1,154 +0,0 @@ -((function atan - (signature float - (parameters - (declare (in) float x)) - ((return (call asin ((expression float * - (var_ref x) - (expression float rsq - (expression float + - (expression float * - (var_ref x) - (var_ref x)) - (constant float (1.0)))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 y_over_x)) - ((return (call asin ((expression vec2 * - (var_ref y_over_x) - (expression vec2 rsq - (expression vec2 + - (expression vec2 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 y_over_x)) - ((return (call asin ((expression vec3 * - (var_ref y_over_x) - (expression vec3 rsq - (expression vec3 + - (expression vec3 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 y_over_x)) - ((return (call asin ((expression vec4 * - (var_ref y_over_x) - (expression vec4 rsq - (expression vec4 + - (expression vec4 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature float - (parameters - (declare (in ) float y) - (declare (in ) float x) - ) - ( - (declare () float r) - (declare ( ) float abs_retval) - (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) )) -) - (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) ( - (declare ( ) float atan_retval) - (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) )) -) - (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) ) - (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( - (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( - (declare ( ) float assignment_tmp) - (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) - (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) - ) - ( - (declare ( ) float assignment_tmp) - (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) - (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) - )) - - ) - ( - )) - - ) - ( - (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( - (assign (constant bool (1)) (var_ref r) (constant float (1.570796)) ) - ) - ( - (assign (constant bool (1)) (var_ref r) (constant float (-1.570796)) ) - )) - - )) - - (return (var_ref r) ) - )) - - - - (signature vec2 - (parameters - (declare (in) vec2 y) - (declare (in) vec2 x)) - ((declare () vec2 r) - (assign (constant bool (1)) - (swiz x (var_ref r)) - (call atan ((swiz x (var_ref y)) - (swiz x (var_ref x))))) - (assign (constant bool (1)) - (swiz y (var_ref r)) - (call atan ((swiz y (var_ref y)) - (swiz y (var_ref x))))) - (return (var_ref r)))) - - (signature vec3 - (parameters - (declare (in) vec3 y) - (declare (in) vec3 x)) - ((declare () vec3 r) - (assign (constant bool (1)) - (swiz x (var_ref r)) - (call atan ((swiz x (var_ref y)) - (swiz x (var_ref x))))) - (assign (constant bool (1)) - (swiz y (var_ref r)) - (call atan ((swiz y (var_ref y)) - (swiz y (var_ref x))))) - (assign (constant bool (1)) - (swiz z (var_ref r)) - (call atan ((swiz z (var_ref y)) - (swiz z (var_ref x))))) - (return (var_ref r)))) - - (signature vec4 - (parameters - (declare (in) vec4 y) - (declare (in) vec4 x)) - ((declare () vec4 r) - (assign (constant bool (1)) - (swiz x (var_ref r)) - (call atan ((swiz x (var_ref y)) - (swiz x (var_ref x))))) - (assign (constant bool (1)) - (swiz y (var_ref r)) - (call atan ((swiz y (var_ref y)) - (swiz y (var_ref x))))) - (assign (constant bool (1)) - (swiz z (var_ref r)) - (call atan ((swiz z (var_ref y)) - (swiz z (var_ref x))))) - (assign (constant bool (1)) - (swiz w (var_ref r)) - (call atan ((swiz w (var_ref y)) - (swiz w (var_ref x))))) - (return (var_ref r))))) - -)) diff --git a/src/glsl/builtins/110/ceil b/src/glsl/builtins/110/ceil deleted file mode 100644 index a26a7750493..00000000000 --- a/src/glsl/builtins/110/ceil +++ /dev/null @@ -1,21 +0,0 @@ -((function ceil - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float ceil (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 ceil (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 ceil (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 ceil (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/clamp b/src/glsl/builtins/110/clamp deleted file mode 100644 index d05cc76dc23..00000000000 --- a/src/glsl/builtins/110/clamp +++ /dev/null @@ -1,50 +0,0 @@ -((function clamp - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) vec2 arg2)) - ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) vec3 arg2)) - ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) vec4 arg2)) - ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/cos b/src/glsl/builtins/110/cos deleted file mode 100644 index 88f266eccbe..00000000000 --- a/src/glsl/builtins/110/cos +++ /dev/null @@ -1,21 +0,0 @@ -((function cos - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float cos (var_ref angle))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 cos (var_ref angle))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 cos (var_ref angle))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 cos (var_ref angle))))) -)) diff --git a/src/glsl/builtins/110/cross b/src/glsl/builtins/110/cross deleted file mode 100644 index 24717a2183d..00000000000 --- a/src/glsl/builtins/110/cross +++ /dev/null @@ -1,7 +0,0 @@ -((function cross - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 cross (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/degrees b/src/glsl/builtins/110/degrees deleted file mode 100644 index dc0d7b9e20d..00000000000 --- a/src/glsl/builtins/110/degrees +++ /dev/null @@ -1,21 +0,0 @@ -((function degrees - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) -)) diff --git a/src/glsl/builtins/110/distance b/src/glsl/builtins/110/distance deleted file mode 100644 index a2309c484f9..00000000000 --- a/src/glsl/builtins/110/distance +++ /dev/null @@ -1,33 +0,0 @@ -((function distance - (signature float - (parameters - (declare (in) float p0) - (declare (in) float p1)) - ((declare () float p) - (assign (constant bool (1)) (var_ref p) (expression float - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec2 p0) - (declare (in) vec2 p1)) - ((declare () vec2 p) - (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec3 p0) - (declare (in) vec3 p1)) - ((declare () vec3 p) - (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec4 p0) - (declare (in) vec4 p1)) - ((declare () vec4 p) - (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) -)) diff --git a/src/glsl/builtins/110/dot b/src/glsl/builtins/110/dot deleted file mode 100644 index a91a6d2c56d..00000000000 --- a/src/glsl/builtins/110/dot +++ /dev/null @@ -1,25 +0,0 @@ -((function dot - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/equal b/src/glsl/builtins/110/equal deleted file mode 100644 index ae7ddc53bdc..00000000000 --- a/src/glsl/builtins/110/equal +++ /dev/null @@ -1,61 +0,0 @@ -((function equal - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/110/exp b/src/glsl/builtins/110/exp deleted file mode 100644 index a73bd6a7f84..00000000000 --- a/src/glsl/builtins/110/exp +++ /dev/null @@ -1,21 +0,0 @@ -((function exp - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float exp (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 exp (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 exp (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 exp (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/exp2 b/src/glsl/builtins/110/exp2 deleted file mode 100644 index a842d3fe65b..00000000000 --- a/src/glsl/builtins/110/exp2 +++ /dev/null @@ -1,21 +0,0 @@ -((function exp2 - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float exp2 (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 exp2 (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 exp2 (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 exp2 (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/faceforward b/src/glsl/builtins/110/faceforward deleted file mode 100644 index d1703972388..00000000000 --- a/src/glsl/builtins/110/faceforward +++ /dev/null @@ -1,37 +0,0 @@ -((function faceforward - (signature float - (parameters - (declare (in) float N) - (declare (in) float I) - (declare (in) float Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression float neg (var_ref N))))))) - - (signature vec2 - (parameters - (declare (in) vec2 N) - (declare (in) vec2 I) - (declare (in) vec2 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec2 neg (var_ref N))))))) - - (signature vec3 - (parameters - (declare (in) vec3 N) - (declare (in) vec3 I) - (declare (in) vec3 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec3 neg (var_ref N))))))) - - (signature vec4 - (parameters - (declare (in) vec4 N) - (declare (in) vec4 I) - (declare (in) vec4 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec4 neg (var_ref N))))))) -)) diff --git a/src/glsl/builtins/110/floor b/src/glsl/builtins/110/floor deleted file mode 100644 index 8dd8052799b..00000000000 --- a/src/glsl/builtins/110/floor +++ /dev/null @@ -1,21 +0,0 @@ -((function floor - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float floor (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 floor (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 floor (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 floor (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/fract b/src/glsl/builtins/110/fract deleted file mode 100644 index 3f0763d1b3e..00000000000 --- a/src/glsl/builtins/110/fract +++ /dev/null @@ -1,22 +0,0 @@ -((function fract - (signature float - (parameters - (declare (in) float x)) - ((return (expression float fract (var_ref x))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 fract (var_ref x))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 fract (var_ref x))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 fract (var_ref x))))) -)) - diff --git a/src/glsl/builtins/110/greaterThan b/src/glsl/builtins/110/greaterThan deleted file mode 100644 index ae03030e495..00000000000 --- a/src/glsl/builtins/110/greaterThan +++ /dev/null @@ -1,61 +0,0 @@ -((function greaterThan - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/110/greaterThanEqual b/src/glsl/builtins/110/greaterThanEqual deleted file mode 100644 index 204d5fd1439..00000000000 --- a/src/glsl/builtins/110/greaterThanEqual +++ /dev/null @@ -1,61 +0,0 @@ -((function greaterThanEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/110/inversesqrt b/src/glsl/builtins/110/inversesqrt deleted file mode 100644 index 5b66d2b3695..00000000000 --- a/src/glsl/builtins/110/inversesqrt +++ /dev/null @@ -1,21 +0,0 @@ -((function inversesqrt - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float rsq (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 rsq (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 rsq (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 rsq (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/length b/src/glsl/builtins/110/length deleted file mode 100644 index 89ff7f3ef12..00000000000 --- a/src/glsl/builtins/110/length +++ /dev/null @@ -1,21 +0,0 @@ -((function length - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec2 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec3 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec4 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) -)) diff --git a/src/glsl/builtins/110/lessThan b/src/glsl/builtins/110/lessThan deleted file mode 100644 index 5c4254165c7..00000000000 --- a/src/glsl/builtins/110/lessThan +++ /dev/null @@ -1,61 +0,0 @@ -((function lessThan - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/110/lessThanEqual b/src/glsl/builtins/110/lessThanEqual deleted file mode 100644 index ccb955b8a76..00000000000 --- a/src/glsl/builtins/110/lessThanEqual +++ /dev/null @@ -1,61 +0,0 @@ -((function lessThanEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/110/log b/src/glsl/builtins/110/log deleted file mode 100644 index d168abb5a73..00000000000 --- a/src/glsl/builtins/110/log +++ /dev/null @@ -1,21 +0,0 @@ -((function log - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float log (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 log (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 log (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 log (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/log2 b/src/glsl/builtins/110/log2 deleted file mode 100644 index b96c6276f0a..00000000000 --- a/src/glsl/builtins/110/log2 +++ /dev/null @@ -1,21 +0,0 @@ -((function log2 - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float log2 (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 log2 (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 log2 (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 log2 (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/matrixCompMult b/src/glsl/builtins/110/matrixCompMult deleted file mode 100644 index cb5a2cb1f7b..00000000000 --- a/src/glsl/builtins/110/matrixCompMult +++ /dev/null @@ -1,32 +0,0 @@ -((function matrixCompMult - (signature mat2 - (parameters - (declare (in) mat2 x) - (declare (in) mat2 y)) - ((declare () mat2 z) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat3 - (parameters - (declare (in) mat3 x) - (declare (in) mat3 y)) - ((declare () mat3 z) - (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))))) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat4 - (parameters - (declare (in) mat4 x) - (declare (in) mat4 y)) - ((declare () mat4 z) - (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))))) - (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))))) - (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))))) - (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))))) -(return (var_ref z)))) -)) - diff --git a/src/glsl/builtins/110/max b/src/glsl/builtins/110/max deleted file mode 100644 index f91ae417e4b..00000000000 --- a/src/glsl/builtins/110/max +++ /dev/null @@ -1,43 +0,0 @@ -((function max - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float max (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/min b/src/glsl/builtins/110/min deleted file mode 100644 index 78fc44120af..00000000000 --- a/src/glsl/builtins/110/min +++ /dev/null @@ -1,43 +0,0 @@ -((function min - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float min (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/mix b/src/glsl/builtins/110/mix deleted file mode 100644 index 8638d06887c..00000000000 --- a/src/glsl/builtins/110/mix +++ /dev/null @@ -1,50 +0,0 @@ -((function mix - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((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)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) vec2 arg2)) - ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) vec3 arg2)) - ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) vec4 arg2)) - ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) float arg2)) - ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) float arg2)) - ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) float arg2)) - ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) -)) diff --git a/src/glsl/builtins/110/mod b/src/glsl/builtins/110/mod deleted file mode 100644 index aeaea240e2d..00000000000 --- a/src/glsl/builtins/110/mod +++ /dev/null @@ -1,43 +0,0 @@ -((function mod - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float % (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/noise_fake b/src/glsl/builtins/110/noise_fake deleted file mode 100644 index bcfb17b04b8..00000000000 --- a/src/glsl/builtins/110/noise_fake +++ /dev/null @@ -1,76 +0,0 @@ -((function noise1 - (signature float - (parameters - (declare (in) float x)) - ((return (constant float (0))))) - (signature float - (parameters - (declare (in) vec2 x)) - ((return (constant float (0))))) - (signature float - (parameters - (declare (in) vec3 x)) - ((return (constant float (0))))) - (signature float - (parameters - (declare (in) vec4 x)) - ((return (constant float (0))))) - ) - - (function noise2 - (signature vec2 - (parameters - (declare (in) float x)) - ((return (constant vec2 (0 0))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (constant vec2 (0 0))))) - (signature vec2 - (parameters - (declare (in) vec3 x)) - ((return (constant vec2 (0 0))))) - (signature vec2 - (parameters - (declare (in) vec4 x)) - ((return (constant vec2 (0 0))))) - ) - - (function noise3 - (signature vec3 - (parameters - (declare (in) float x)) - ((return (constant vec3 (0 0 0))))) - (signature vec3 - (parameters - (declare (in) vec2 x)) - ((return (constant vec3 (0 0 0))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (constant vec3 (0 0 0))))) - (signature vec3 - (parameters - (declare (in) vec4 x)) - ((return (constant vec3 (0 0 0))))) - ) - - (function noise4 - (signature vec4 - (parameters - (declare (in) float x)) - ((return (constant vec4 (0 0 0 0))))) - (signature vec4 - (parameters - (declare (in) vec2 x)) - ((return (constant vec4 (0 0 0 0))))) - (signature vec4 - (parameters - (declare (in) vec3 x)) - ((return (constant vec4 (0 0 0 0))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (constant vec4 (0 0 0 0))))) - ) -) diff --git a/src/glsl/builtins/110/normalize b/src/glsl/builtins/110/normalize deleted file mode 100644 index be88a9830d1..00000000000 --- a/src/glsl/builtins/110/normalize +++ /dev/null @@ -1,21 +0,0 @@ -((function normalize - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) -)) diff --git a/src/glsl/builtins/110/not b/src/glsl/builtins/110/not deleted file mode 100644 index b696b06557f..00000000000 --- a/src/glsl/builtins/110/not +++ /dev/null @@ -1,16 +0,0 @@ -((function not - (signature bvec2 - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bvec2 ! (var_ref arg0))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bvec3 ! (var_ref arg0))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bvec4 ! (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/notEqual b/src/glsl/builtins/110/notEqual deleted file mode 100644 index ccdcaa3aafa..00000000000 --- a/src/glsl/builtins/110/notEqual +++ /dev/null @@ -1,61 +0,0 @@ -((function notEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/110/pow b/src/glsl/builtins/110/pow deleted file mode 100644 index a61bc4418e3..00000000000 --- a/src/glsl/builtins/110/pow +++ /dev/null @@ -1,25 +0,0 @@ -((function pow - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float pow (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/radians b/src/glsl/builtins/110/radians deleted file mode 100644 index 6a0f5d2e219..00000000000 --- a/src/glsl/builtins/110/radians +++ /dev/null @@ -1,21 +0,0 @@ -((function radians - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (constant float (0.017453)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (constant float (0.017453)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (constant float (0.017453)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (constant float (0.017453)))))) -)) diff --git a/src/glsl/builtins/110/reflect b/src/glsl/builtins/110/reflect deleted file mode 100644 index 8238fdc93fd..00000000000 --- a/src/glsl/builtins/110/reflect +++ /dev/null @@ -1,58 +0,0 @@ -((function reflect - (signature float - (parameters - (declare (in) float i) - (declare (in) float n)) - ((return (expression float - - (var_ref i) - (expression float * - (constant float (2.0)) - (expression float * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec2 - (parameters - (declare (in) vec2 i) - (declare (in) vec2 n)) - ((return (expression vec2 - - (var_ref i) - (expression vec2 * - (constant float (2.0)) - (expression vec2 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec3 - (parameters - (declare (in) vec3 i) - (declare (in) vec3 n)) - ((return (expression vec3 - - (var_ref i) - (expression vec3 * - (constant float (2.0)) - (expression vec3 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec4 - (parameters - (declare (in) vec4 i) - (declare (in) vec4 n)) - ((return (expression vec4 - - (var_ref i) - (expression vec4 * - (constant float (2.0)) - (expression vec4 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - -)) diff --git a/src/glsl/builtins/110/refract b/src/glsl/builtins/110/refract deleted file mode 100644 index 522ab411734..00000000000 --- a/src/glsl/builtins/110/refract +++ /dev/null @@ -1,102 +0,0 @@ -((function refract - (signature float - (parameters - (declare (in) float i) - (declare (in) float n) - (declare (in) float eta)) - ((declare () float k) - (assign (constant bool (1)) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant float (0.0)))) - ((return (expression float - - (expression float * (var_ref eta) (var_ref i)) - (expression float * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 i) - (declare (in) vec2 n) - (declare (in) float eta)) - ((declare () float k) - (assign (constant bool (1)) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec2 (0.0 0.0)))) - ((return (expression vec2 - - (expression vec2 * (var_ref eta) (var_ref i)) - (expression vec2 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 i) - (declare (in) vec3 n) - (declare (in) float eta)) - ((declare () float k) - (assign (constant bool (1)) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec3 (0.0 0.0 0.0)))) - ((return (expression vec3 - - (expression vec3 * (var_ref eta) (var_ref i)) - (expression vec3 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 i) - (declare (in) vec4 n) - (declare (in) float eta)) - ((declare () float k) - (assign (constant bool (1)) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec4 (0.0 0.0 0.0 0.0)))) - ((return (expression vec4 - - (expression vec4 * (var_ref eta) (var_ref i)) - (expression vec4 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - -)) diff --git a/src/glsl/builtins/110/sign b/src/glsl/builtins/110/sign deleted file mode 100644 index fa475197cf5..00000000000 --- a/src/glsl/builtins/110/sign +++ /dev/null @@ -1,21 +0,0 @@ -((function sign - (signature float - (parameters - (declare (in) float x)) - ((return (expression float sign (var_ref x))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 sign (var_ref x))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 sign (var_ref x))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 sign (var_ref x))))) -)) diff --git a/src/glsl/builtins/110/sin b/src/glsl/builtins/110/sin deleted file mode 100644 index e6009d8ef12..00000000000 --- a/src/glsl/builtins/110/sin +++ /dev/null @@ -1,21 +0,0 @@ -((function sin - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float sin (var_ref angle))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 sin (var_ref angle))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 sin (var_ref angle))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 sin (var_ref angle))))) -)) diff --git a/src/glsl/builtins/110/smoothstep b/src/glsl/builtins/110/smoothstep deleted file mode 100644 index 663eec63419..00000000000 --- a/src/glsl/builtins/110/smoothstep +++ /dev/null @@ -1,153 +0,0 @@ -((function smoothstep - (signature float - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) float x)) - ((declare () float t) - - (assign (constant bool (1)) (var_ref t) - (expression float max - (expression float min - (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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)))))))) - - (signature vec2 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec2 x)) - ((declare () vec2 t) - (declare () vec2 retval) - - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - (return (var_ref retval)) - )) - - (signature vec3 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec3 x)) - ((declare () vec3 t) - (declare () vec3 retval) - - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz z (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - (return (var_ref retval)) - )) - - - (signature vec4 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec4 x)) - ((declare () vec4 t) - (declare () vec4 retval) - - (assign (constant bool (1)) (swiz x (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz y (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz z (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - - (assign (constant bool (1)) (swiz w (var_ref t)) - (expression float max - (expression float min - (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (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))))))) - (return (var_ref retval)) - )) - - (signature vec2 - (parameters - (declare (in) vec2 edge0) - (declare (in) vec2 edge1) - (declare (in) vec2 x)) - ((return (expression vec2 max - (expression vec2 min - (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) - (constant vec2 (1.0 1.0))) - (constant vec2 (0.0 0.0)))))) - - (signature vec3 - (parameters - (declare (in) vec3 edge0) - (declare (in) vec3 edge1) - (declare (in) vec3 x)) - ((return (expression vec3 max - (expression vec3 min - (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) - (constant vec3 (1.0 1.0 1.0))) - (constant vec3 (0.0 0.0 0.0)))))) - - (signature vec4 - (parameters - (declare (in) vec4 edge0) - (declare (in) vec4 edge1) - (declare (in) vec4 x)) - ((return (expression vec4 max - (expression vec4 min - (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) - (constant vec4 (1.0 1.0 1.0 1.0))) - (constant vec4 (0.0 0.0 0.0 0.0)))))) -)) - diff --git a/src/glsl/builtins/110/sqrt b/src/glsl/builtins/110/sqrt deleted file mode 100644 index 0302d164ae5..00000000000 --- a/src/glsl/builtins/110/sqrt +++ /dev/null @@ -1,21 +0,0 @@ -((function sqrt - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float sqrt (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 sqrt (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 sqrt (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 sqrt (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/110/step b/src/glsl/builtins/110/step deleted file mode 100644 index ce6f4354228..00000000000 --- a/src/glsl/builtins/110/step +++ /dev/null @@ -1,68 +0,0 @@ -((function step - (signature float - (parameters - (declare (in) float edge) - (declare (in) float x)) - ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) - - (signature vec2 - (parameters - (declare (in) float edge) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec3 - (parameters - (declare (in) float edge) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec4 - (parameters - (declare (in) float edge) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec2 - (parameters - (declare (in) vec2 edge) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (return (var_ref t)))) - - (signature vec3 - (parameters - (declare (in) vec3 edge) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) - (return (var_ref t)))) - - (signature vec4 - (parameters - (declare (in) vec4 edge) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge))))) - (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) - (return (var_ref t)))) -)) - diff --git a/src/glsl/builtins/110/tan b/src/glsl/builtins/110/tan deleted file mode 100644 index 99798631859..00000000000 --- a/src/glsl/builtins/110/tan +++ /dev/null @@ -1,21 +0,0 @@ -((function tan - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) -)) diff --git a/src/glsl/builtins/110/textures b/src/glsl/builtins/110/textures deleted file mode 100644 index c81b7e8ad49..00000000000 --- a/src/glsl/builtins/110/textures +++ /dev/null @@ -1,213 +0,0 @@ -((function texture1D - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture1DLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture1DProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -) - (function texture1DProjLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -) - (function texture2D - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) -(function texture2DLod - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture2DProj - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -) - (function texture2DProjLod - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -) - (function texture3D - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture3DLod - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture3DProj - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -) - (function texture3DProjLod - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -) - (function textureCube - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function textureCubeLod - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function shadow1D - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -) - (function shadow1DLod - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow1DProj - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) )))) - -) - (function shadow1DProjLod - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((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) )))) - -) - (function shadow2D - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -) - (function shadow2DLod - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow2DProj - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) )))) - -) - (function shadow2DProjLod - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((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) )))) - -)) diff --git a/src/glsl/builtins/110_fs/derivatives b/src/glsl/builtins/110_fs/derivatives deleted file mode 100644 index b79852ee1ff..00000000000 --- a/src/glsl/builtins/110_fs/derivatives +++ /dev/null @@ -1,73 +0,0 @@ -((function dFdx - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdx (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdx (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdx (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdx (var_ref p))))) - ) - - (function dFdy - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdy (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdy (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdy (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdy (var_ref p))))) - ) - - (function fwidth - (signature float - (parameters - (declare (in) float p)) - ((return (expression float + - (expression float abs (expression float dFdx (var_ref p))) - (expression float abs (expression float dFdy (var_ref p))))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 + - (expression vec2 abs (expression vec2 dFdx (var_ref p))) - (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 + - (expression vec3 abs (expression vec3 dFdx (var_ref p))) - (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 + - (expression vec4 abs (expression vec4 dFdx (var_ref p))) - (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) -)) diff --git a/src/glsl/builtins/110_fs/textures b/src/glsl/builtins/110_fs/textures deleted file mode 100644 index 38f3787e9ef..00000000000 --- a/src/glsl/builtins/110_fs/textures +++ /dev/null @@ -1,113 +0,0 @@ -((function texture1D - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture1DProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -) - (function texture2D - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture2DProj - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -) - (function texture3D - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture3DProj - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -) - (function textureCube - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function shadow1D - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) - -) - (function shadow1DProj - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((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) )))) - -) - (function shadow2D - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) - -) - (function shadow2DProj - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((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) )))) - -)) diff --git a/src/glsl/builtins/110_vs/ftransform b/src/glsl/builtins/110_vs/ftransform deleted file mode 100644 index 9ca63dc1e34..00000000000 --- a/src/glsl/builtins/110_vs/ftransform +++ /dev/null @@ -1,9 +0,0 @@ -((declare (uniform) mat4 gl_ModelViewProjectionMatrix) - (declare (in) vec4 gl_Vertex) - (function ftransform - (signature vec4 - (parameters) - ((return (expression vec4 * - (var_ref gl_ModelViewProjectionMatrix) - (var_ref gl_Vertex))))) -)) diff --git a/src/glsl/builtins/120/matrixCompMult b/src/glsl/builtins/120/matrixCompMult deleted file mode 100644 index 69331e26525..00000000000 --- a/src/glsl/builtins/120/matrixCompMult +++ /dev/null @@ -1,61 +0,0 @@ -((function matrixCompMult - (signature mat2x3 - (parameters - (declare (in) mat2x3 x) - (declare (in) mat2x3 y)) - ((declare () mat2x3 z) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat3x2 - (parameters - (declare (in) mat3x2 x) - (declare (in) mat3x2 y)) - ((declare () mat3x2 z) - (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))))) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat2x4 - (parameters - (declare (in) mat2x4 x) - (declare (in) mat2x4 y)) - ((declare () mat2x4 z) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat4x2 - (parameters - (declare (in) mat4x2 x) - (declare (in) mat4x2 y)) - ((declare () mat4x2 z) - (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))))) - (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))))) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat3x4 - (parameters - (declare (in) mat3x4 x) - (declare (in) mat3x4 y)) - ((declare () mat3x4 z) - (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))))) - (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))))) - (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))))) -(return (var_ref z)))) - - (signature mat4x3 - (parameters - (declare (in) mat4x3 x) - (declare (in) mat4x3 y)) - ((declare () mat4x3 z) - (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))))) - (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))))) - (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))))) - (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))))) -(return (var_ref z)))) -)) diff --git a/src/glsl/builtins/120/outerProduct b/src/glsl/builtins/120/outerProduct deleted file mode 100644 index 69ae741e176..00000000000 --- a/src/glsl/builtins/120/outerProduct +++ /dev/null @@ -1,92 +0,0 @@ -((function outerProduct - (signature mat2 - (parameters - (declare (in) vec2 u) - (declare (in) vec2 v)) - ((declare () mat2 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat2x3 - (parameters - (declare (in) vec3 u) - (declare (in) vec2 v)) - ((declare () mat2x3 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat2x4 - (parameters - (declare (in) vec4 u) - (declare (in) vec2 v)) - ((declare () mat2x4 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat3x2 - (parameters - (declare (in) vec2 u) - (declare (in) vec3 v)) - ((declare () mat3x2 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)) - )) - - (signature mat3 - (parameters - (declare (in) vec3 u) - (declare (in) vec3 v)) - ((declare () mat3 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)))) - - (signature mat3x4 - (parameters - (declare (in) vec4 u) - (declare (in) vec3 v)) - ((declare () mat3x4 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)))) - - (signature mat4x2 - (parameters - (declare (in) vec2 u) - (declare (in) vec4 v)) - ((declare () mat4x2 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) - - (signature mat4x3 - (parameters - (declare (in) vec3 u) - (declare (in) vec4 v)) - ((declare () mat4x3 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) - - (signature mat4 - (parameters - (declare (in) vec4 u) - (declare (in) vec4 v)) - ((declare () mat4 m) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) - (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) -)) diff --git a/src/glsl/builtins/120/transpose b/src/glsl/builtins/120/transpose deleted file mode 100644 index 416a0ee4677..00000000000 --- a/src/glsl/builtins/120/transpose +++ /dev/null @@ -1,139 +0,0 @@ -((function transpose - (signature mat2 - (parameters - (declare (in) mat2 m)) - ((declare () mat2 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat3x2 - (parameters - (declare (in) mat2x3 m)) - ((declare () mat3x2 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat4x2 - (parameters - (declare (in) mat2x4 m)) - ((declare () mat4x2 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat2x3 - (parameters - (declare (in) mat3x2 m)) - ((declare () mat2x3 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat3 - (parameters - (declare (in) mat3 m)) - ((declare () mat3 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat4x3 - (parameters - (declare (in) mat3x4 m)) - ((declare () mat4x3 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat2x4 - (parameters - (declare (in) mat4x2 m)) - ((declare () mat2x4 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) - - (signature mat3x4 - (parameters - (declare (in) mat4x3 m)) - ((declare () mat3x4 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) - - (signature mat4 - (parameters - (declare (in) mat4 m)) - ((declare () mat4 t) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) - (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) -) - -) - diff --git a/src/glsl/builtins/130/clamp b/src/glsl/builtins/130/clamp deleted file mode 100644 index e1aad5c8d98..00000000000 --- a/src/glsl/builtins/130/clamp +++ /dev/null @@ -1,99 +0,0 @@ -((function clamp - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1) - (declare (in) ivec2 arg2)) - ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1) - (declare (in) ivec3 arg2)) - ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1) - (declare (in) ivec4 arg2)) - ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1) - (declare (in) uvec2 arg2)) - ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1) - (declare (in) uvec3 arg2)) - ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1) - (declare (in) uvec4 arg2)) - ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/130/cosh b/src/glsl/builtins/130/cosh deleted file mode 100644 index 45e0ae427d6..00000000000 --- a/src/glsl/builtins/130/cosh +++ /dev/null @@ -1,30 +0,0 @@ -((function cosh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float + - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant vec2 (0.5)) - (expression vec2 + - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant vec3 (0.5)) - (expression vec3 + - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant vec4 (0.5)) - (expression vec4 + - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/130/equal b/src/glsl/builtins/130/equal deleted file mode 100644 index 079c3e97fb2..00000000000 --- a/src/glsl/builtins/130/equal +++ /dev/null @@ -1,31 +0,0 @@ -((function equal - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/greaterThan b/src/glsl/builtins/130/greaterThan deleted file mode 100644 index a9fb7b3a43e..00000000000 --- a/src/glsl/builtins/130/greaterThan +++ /dev/null @@ -1,31 +0,0 @@ -((function greaterThan - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/greaterThanEqual b/src/glsl/builtins/130/greaterThanEqual deleted file mode 100644 index 293c93c7cca..00000000000 --- a/src/glsl/builtins/130/greaterThanEqual +++ /dev/null @@ -1,31 +0,0 @@ -((function greaterThanEqual - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/lessThan b/src/glsl/builtins/130/lessThan deleted file mode 100644 index d9f693fd63f..00000000000 --- a/src/glsl/builtins/130/lessThan +++ /dev/null @@ -1,31 +0,0 @@ -((function lessThan - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/lessThanEqual b/src/glsl/builtins/130/lessThanEqual deleted file mode 100644 index 494411b869a..00000000000 --- a/src/glsl/builtins/130/lessThanEqual +++ /dev/null @@ -1,31 +0,0 @@ -((function lessThanEqual - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/max b/src/glsl/builtins/130/max deleted file mode 100644 index 0863e411a32..00000000000 --- a/src/glsl/builtins/130/max +++ /dev/null @@ -1,85 +0,0 @@ -((function max - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1)) - ((return (expression int max (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1)) - ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1)) - ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1)) - ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1)) - ((return (expression uint max (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1)) - ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1)) - ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1)) - ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/130/min b/src/glsl/builtins/130/min deleted file mode 100644 index 576546f6f20..00000000000 --- a/src/glsl/builtins/130/min +++ /dev/null @@ -1,85 +0,0 @@ -((function min - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1)) - ((return (expression int min (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1)) - ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1)) - ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1)) - ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1)) - ((return (expression uint min (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1)) - ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1)) - ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1)) - ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/130/mix b/src/glsl/builtins/130/mix deleted file mode 100644 index 9a1fcd70ffa..00000000000 --- a/src/glsl/builtins/130/mix +++ /dev/null @@ -1,39 +0,0 @@ -((function mix - (signature float - (parameters - (declare (in) float v1) - (declare (in) float v2) - (declare (in) bool a)) - ((assign (var_ref a) (var_ref v1) (var_ref v2)) - (return (var_ref v1)))) - - (signature vec2 - (parameters - (declare (in) vec2 v1) - (declare (in) vec2 v2) - (declare (in) bvec2 a)) - ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) - (return (var_ref v1)))) - - (signature vec3 - (parameters - (declare (in) vec3 v1) - (declare (in) vec3 v2) - (declare (in) bvec3 a)) - ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) - (return (var_ref v1)))) - - (signature vec4 - (parameters - (declare (in) vec4 v1) - (declare (in) vec4 v2) - (declare (in) bvec4 a)) - ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) - (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2))) - (return (var_ref v1)))) -)) diff --git a/src/glsl/builtins/130/notEqual b/src/glsl/builtins/130/notEqual deleted file mode 100644 index 81e6376bd9c..00000000000 --- a/src/glsl/builtins/130/notEqual +++ /dev/null @@ -1,31 +0,0 @@ -((function notEqual - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/sign b/src/glsl/builtins/130/sign deleted file mode 100644 index f86062a2443..00000000000 --- a/src/glsl/builtins/130/sign +++ /dev/null @@ -1,22 +0,0 @@ -((function sign - (signature int - (parameters - (declare (in) int x)) - ((return (expression int sign (var_ref x))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 x)) - ((return (expression ivec2 sign (var_ref x))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 x)) - ((return (expression ivec3 sign (var_ref x))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 x)) - ((return (expression ivec4 sign (var_ref x))))) -)) - diff --git a/src/glsl/builtins/130/sinh b/src/glsl/builtins/130/sinh deleted file mode 100644 index 7ad4f58e204..00000000000 --- a/src/glsl/builtins/130/sinh +++ /dev/null @@ -1,30 +0,0 @@ -((function sinh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float - - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant vec2 (0.5)) - (expression vec2 - - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant vec3 (0.5)) - (expression vec3 - - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant vec4 (0.5)) - (expression vec4 - - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/130/tanh b/src/glsl/builtins/130/tanh deleted file mode 100644 index 3b7271bf779..00000000000 --- a/src/glsl/builtins/130/tanh +++ /dev/null @@ -1,42 +0,0 @@ -((function tanh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float / - (expression float - - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))) - (expression float + - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 / - (expression vec2 - - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))) - (expression vec2 + - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 / - (expression vec3 - - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))) - (expression vec3 + - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 / - (expression vec4 - - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))) - (expression vec4 + - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/130/texelFetch b/src/glsl/builtins/130/texelFetch deleted file mode 100644 index d51ce65a897..00000000000 --- a/src/glsl/builtins/130/texelFetch +++ /dev/null @@ -1,107 +0,0 @@ -((function texelFetch - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) int P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) int P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) int P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/130/texture b/src/glsl/builtins/130/texture deleted file mode 100644 index b170b583094..00000000000 --- a/src/glsl/builtins/130/texture +++ /dev/null @@ -1,110 +0,0 @@ -((function texture - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -)) diff --git a/src/glsl/builtins/130/textureGrad b/src/glsl/builtins/130/textureGrad deleted file mode 100644 index 0ef428c224a..00000000000 --- a/src/glsl/builtins/130/textureGrad +++ /dev/null @@ -1,147 +0,0 @@ -((function textureGrad - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - -) -) diff --git a/src/glsl/builtins/130/textureLod b/src/glsl/builtins/130/textureLod deleted file mode 100644 index 7d7059d848c..00000000000 --- a/src/glsl/builtins/130/textureLod +++ /dev/null @@ -1,128 +0,0 @@ -((function textureLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/130/textureProj b/src/glsl/builtins/130/textureProj deleted file mode 100644 index 40ea1c2af68..00000000000 --- a/src/glsl/builtins/130/textureProj +++ /dev/null @@ -1,92 +0,0 @@ -((function textureProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -)) diff --git a/src/glsl/builtins/130/textureProjGrad b/src/glsl/builtins/130/textureProjGrad deleted file mode 100644 index b4bfa58c123..00000000000 --- a/src/glsl/builtins/130/textureProjGrad +++ /dev/null @@ -1,122 +0,0 @@ -((function textureProjGrad - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - -)) diff --git a/src/glsl/builtins/130/textureProjLod b/src/glsl/builtins/130/textureProjLod deleted file mode 100644 index d242f7e40fc..00000000000 --- a/src/glsl/builtins/130/textureProjLod +++ /dev/null @@ -1,107 +0,0 @@ -((function textureProjLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/130_fs/texture b/src/glsl/builtins/130_fs/texture deleted file mode 100644 index 0de981397f0..00000000000 --- a/src/glsl/builtins/130_fs/texture +++ /dev/null @@ -1,128 +0,0 @@ -((function texture - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/130_fs/textureProj b/src/glsl/builtins/130_fs/textureProj deleted file mode 100644 index b1d8f0a2f33..00000000000 --- a/src/glsl/builtins/130_fs/textureProj +++ /dev/null @@ -1,107 +0,0 @@ -((function textureProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/ARB_texture_rectangle/textures b/src/glsl/builtins/ARB_texture_rectangle/textures deleted file mode 100644 index 161d8c4a541..00000000000 --- a/src/glsl/builtins/ARB_texture_rectangle/textures +++ /dev/null @@ -1,16 +0,0 @@ -((function texture2DRect - (signature vec4 - (parameters - (declare (in) sampler2DRect sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function shadow2DRect - (signature vec4 - (parameters - (declare (in) sampler2DRectShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -)) diff --git a/src/glsl/builtins/EXT_texture_array/textures b/src/glsl/builtins/EXT_texture_array/textures deleted file mode 100644 index 8a91f901401..00000000000 --- a/src/glsl/builtins/EXT_texture_array/textures +++ /dev/null @@ -1,59 +0,0 @@ -((function texture1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture1DArrayLod - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture2DArray - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture2DArrayLod - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function shadow1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArrayShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -) - (function shadow1DArrayLod - (signature vec4 - (parameters - (declare (in) sampler1DArrayShadow sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow2DArray - (signature vec4 - (parameters - (declare (in) sampler2DArrayShadow sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) )))) - -)) diff --git a/src/glsl/builtins/EXT_texture_array_fs/textures b/src/glsl/builtins/EXT_texture_array_fs/textures deleted file mode 100644 index 74e184387ac..00000000000 --- a/src/glsl/builtins/EXT_texture_array_fs/textures +++ /dev/null @@ -1,27 +0,0 @@ -((function texture1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture2DArray - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function shadow1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArrayShadow sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/ir/abs b/src/glsl/builtins/ir/abs new file mode 100644 index 00000000000..904845307c4 --- /dev/null +++ b/src/glsl/builtins/ir/abs @@ -0,0 +1,21 @@ +((function abs + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 abs (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 abs (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 abs (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/acos b/src/glsl/builtins/ir/acos new file mode 100644 index 00000000000..d1cfebeff8a --- /dev/null +++ b/src/glsl/builtins/ir/acos @@ -0,0 +1,22 @@ +((function acos + (signature float + (parameters + (declare (in) float x)) + ((return (expression float - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) +)) diff --git a/src/glsl/builtins/ir/all b/src/glsl/builtins/ir/all new file mode 100644 index 00000000000..2cac0dfb684 --- /dev/null +++ b/src/glsl/builtins/ir/all @@ -0,0 +1,16 @@ +((function all + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((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)))))) +)) diff --git a/src/glsl/builtins/ir/any b/src/glsl/builtins/ir/any new file mode 100644 index 00000000000..f10e8a7b478 --- /dev/null +++ b/src/glsl/builtins/ir/any @@ -0,0 +1,16 @@ +((function any + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((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)))))) +)) diff --git a/src/glsl/builtins/ir/asin b/src/glsl/builtins/ir/asin new file mode 100644 index 00000000000..e230ad614ee --- /dev/null +++ b/src/glsl/builtins/ir/asin @@ -0,0 +1,97 @@ +((function asin + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * + (expression float sign (var_ref x)) + (expression float - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression float * + (expression float sqrt + (expression float - + (constant float (1.0)) + (expression float abs (var_ref x)))) + (expression float + + (constant float (1.5707288)) + (expression float * + (expression float abs (var_ref x)) + (expression float + + (constant float (-0.2121144)) + (expression float * + (constant float (0.0742610)) + (expression float abs (var_ref x)))))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * + (expression vec2 sign (var_ref x)) + (expression vec2 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec2 * + (expression vec2 sqrt + (expression vec2 - + (constant float (1.0)) + (expression vec2 abs (var_ref x)))) + (expression vec2 + + (constant float (1.5707288)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (expression vec2 + + (constant float (-0.2121144)) + (expression vec2 * + (constant float (0.0742610)) + (expression vec2 abs (var_ref x)))))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * + (expression vec3 sign (var_ref x)) + (expression vec3 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec3 * + (expression vec3 sqrt + (expression vec3 - + (constant float (1.0)) + (expression vec3 abs (var_ref x)))) + (expression vec3 + + (constant float (1.5707288)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (expression vec3 + + (constant float (-0.2121144)) + (expression vec3 * + (constant float (0.0742610)) + (expression vec3 abs (var_ref x)))))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * + (expression vec4 sign (var_ref x)) + (expression vec4 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec4 * + (expression vec4 sqrt + (expression vec4 - + (constant float (1.0)) + (expression vec4 abs (var_ref x)))) + (expression vec4 + + (constant float (1.5707288)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (expression vec4 + + (constant float (-0.2121144)) + (expression vec4 * + (constant float (0.0742610)) + (expression vec4 abs (var_ref x)))))))))))) +)) diff --git a/src/glsl/builtins/ir/atan b/src/glsl/builtins/ir/atan new file mode 100644 index 00000000000..84048293870 --- /dev/null +++ b/src/glsl/builtins/ir/atan @@ -0,0 +1,154 @@ +((function atan + (signature float + (parameters + (declare (in) float x)) + ((return (call asin ((expression float * + (var_ref x) + (expression float rsq + (expression float + + (expression float * + (var_ref x) + (var_ref x)) + (constant float (1.0)))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 y_over_x)) + ((return (call asin ((expression vec2 * + (var_ref y_over_x) + (expression vec2 rsq + (expression vec2 + + (expression vec2 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 y_over_x)) + ((return (call asin ((expression vec3 * + (var_ref y_over_x) + (expression vec3 rsq + (expression vec3 + + (expression vec3 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 y_over_x)) + ((return (call asin ((expression vec4 * + (var_ref y_over_x) + (expression vec4 rsq + (expression vec4 + + (expression vec4 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature float + (parameters + (declare (in ) float y) + (declare (in ) float x) + ) + ( + (declare () float r) + (declare ( ) float abs_retval) + (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) )) +) + (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) ( + (declare ( ) float atan_retval) + (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) )) +) + (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) ) + (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( + (declare ( ) float assignment_tmp) + (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) + (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) + ) + ( + (declare ( ) float assignment_tmp) + (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) + (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) + )) + + ) + ( + )) + + ) + ( + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( + (assign (constant bool (1)) (var_ref r) (constant float (1.570796)) ) + ) + ( + (assign (constant bool (1)) (var_ref r) (constant float (-1.570796)) ) + )) + + )) + + (return (var_ref r) ) + )) + + + + (signature vec2 + (parameters + (declare (in) vec2 y) + (declare (in) vec2 x)) + ((declare () vec2 r) + (assign (constant bool (1)) + (swiz x (var_ref r)) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) + (swiz y (var_ref r)) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (return (var_ref r)))) + + (signature vec3 + (parameters + (declare (in) vec3 y) + (declare (in) vec3 x)) + ((declare () vec3 r) + (assign (constant bool (1)) + (swiz x (var_ref r)) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) + (swiz y (var_ref r)) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (constant bool (1)) + (swiz z (var_ref r)) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (return (var_ref r)))) + + (signature vec4 + (parameters + (declare (in) vec4 y) + (declare (in) vec4 x)) + ((declare () vec4 r) + (assign (constant bool (1)) + (swiz x (var_ref r)) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) + (swiz y (var_ref r)) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (constant bool (1)) + (swiz z (var_ref r)) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (assign (constant bool (1)) + (swiz w (var_ref r)) + (call atan ((swiz w (var_ref y)) + (swiz w (var_ref x))))) + (return (var_ref r))))) + +)) diff --git a/src/glsl/builtins/ir/ceil b/src/glsl/builtins/ir/ceil new file mode 100644 index 00000000000..a26a7750493 --- /dev/null +++ b/src/glsl/builtins/ir/ceil @@ -0,0 +1,21 @@ +((function ceil + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float ceil (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 ceil (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 ceil (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 ceil (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/clamp b/src/glsl/builtins/ir/clamp new file mode 100644 index 00000000000..2bdc466b269 --- /dev/null +++ b/src/glsl/builtins/ir/clamp @@ -0,0 +1,148 @@ +((function clamp + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1) + (declare (in) ivec2 arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1) + (declare (in) ivec3 arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1) + (declare (in) ivec4 arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1) + (declare (in) uvec2 arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1) + (declare (in) uvec3 arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1) + (declare (in) uvec4 arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/cos b/src/glsl/builtins/ir/cos new file mode 100644 index 00000000000..88f266eccbe --- /dev/null +++ b/src/glsl/builtins/ir/cos @@ -0,0 +1,21 @@ +((function cos + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float cos (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 cos (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 cos (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 cos (var_ref angle))))) +)) diff --git a/src/glsl/builtins/ir/cosh b/src/glsl/builtins/ir/cosh new file mode 100644 index 00000000000..45e0ae427d6 --- /dev/null +++ b/src/glsl/builtins/ir/cosh @@ -0,0 +1,30 @@ +((function cosh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant vec2 (0.5)) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant vec3 (0.5)) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant vec4 (0.5)) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/cross b/src/glsl/builtins/ir/cross new file mode 100644 index 00000000000..24717a2183d --- /dev/null +++ b/src/glsl/builtins/ir/cross @@ -0,0 +1,7 @@ +((function cross + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 cross (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/dFdx b/src/glsl/builtins/ir/dFdx new file mode 100644 index 00000000000..30594d33c74 --- /dev/null +++ b/src/glsl/builtins/ir/dFdx @@ -0,0 +1,21 @@ +((function dFdx + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdx (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdx (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdx (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdx (var_ref p))))) +)) diff --git a/src/glsl/builtins/ir/dFdy b/src/glsl/builtins/ir/dFdy new file mode 100644 index 00000000000..fb5798d3cbe --- /dev/null +++ b/src/glsl/builtins/ir/dFdy @@ -0,0 +1,21 @@ +((function dFdy + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdy (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdy (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdy (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdy (var_ref p))))) +)) diff --git a/src/glsl/builtins/ir/degrees b/src/glsl/builtins/ir/degrees new file mode 100644 index 00000000000..dc0d7b9e20d --- /dev/null +++ b/src/glsl/builtins/ir/degrees @@ -0,0 +1,21 @@ +((function degrees + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) +)) diff --git a/src/glsl/builtins/ir/distance b/src/glsl/builtins/ir/distance new file mode 100644 index 00000000000..a2309c484f9 --- /dev/null +++ b/src/glsl/builtins/ir/distance @@ -0,0 +1,33 @@ +((function distance + (signature float + (parameters + (declare (in) float p0) + (declare (in) float p1)) + ((declare () float p) + (assign (constant bool (1)) (var_ref p) (expression float - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec2 p0) + (declare (in) vec2 p1)) + ((declare () vec2 p) + (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec3 p0) + (declare (in) vec3 p1)) + ((declare () vec3 p) + (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec4 p0) + (declare (in) vec4 p1)) + ((declare () vec4 p) + (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) +)) diff --git a/src/glsl/builtins/ir/dot b/src/glsl/builtins/ir/dot new file mode 100644 index 00000000000..a91a6d2c56d --- /dev/null +++ b/src/glsl/builtins/ir/dot @@ -0,0 +1,25 @@ +((function dot + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/equal b/src/glsl/builtins/ir/equal new file mode 100644 index 00000000000..d7a4bc6063f --- /dev/null +++ b/src/glsl/builtins/ir/equal @@ -0,0 +1,91 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/ir/exp b/src/glsl/builtins/ir/exp new file mode 100644 index 00000000000..a73bd6a7f84 --- /dev/null +++ b/src/glsl/builtins/ir/exp @@ -0,0 +1,21 @@ +((function exp + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/exp2 b/src/glsl/builtins/ir/exp2 new file mode 100644 index 00000000000..a842d3fe65b --- /dev/null +++ b/src/glsl/builtins/ir/exp2 @@ -0,0 +1,21 @@ +((function exp2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp2 (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/faceforward b/src/glsl/builtins/ir/faceforward new file mode 100644 index 00000000000..d1703972388 --- /dev/null +++ b/src/glsl/builtins/ir/faceforward @@ -0,0 +1,37 @@ +((function faceforward + (signature float + (parameters + (declare (in) float N) + (declare (in) float I) + (declare (in) float Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression float neg (var_ref N))))))) + + (signature vec2 + (parameters + (declare (in) vec2 N) + (declare (in) vec2 I) + (declare (in) vec2 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec2 neg (var_ref N))))))) + + (signature vec3 + (parameters + (declare (in) vec3 N) + (declare (in) vec3 I) + (declare (in) vec3 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec3 neg (var_ref N))))))) + + (signature vec4 + (parameters + (declare (in) vec4 N) + (declare (in) vec4 I) + (declare (in) vec4 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec4 neg (var_ref N))))))) +)) diff --git a/src/glsl/builtins/ir/floor b/src/glsl/builtins/ir/floor new file mode 100644 index 00000000000..8dd8052799b --- /dev/null +++ b/src/glsl/builtins/ir/floor @@ -0,0 +1,21 @@ +((function floor + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float floor (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 floor (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 floor (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 floor (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/fract b/src/glsl/builtins/ir/fract new file mode 100644 index 00000000000..3f0763d1b3e --- /dev/null +++ b/src/glsl/builtins/ir/fract @@ -0,0 +1,22 @@ +((function fract + (signature float + (parameters + (declare (in) float x)) + ((return (expression float fract (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 fract (var_ref x))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 fract (var_ref x))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 fract (var_ref x))))) +)) + diff --git a/src/glsl/builtins/ir/ftransform b/src/glsl/builtins/ir/ftransform new file mode 100644 index 00000000000..9ca63dc1e34 --- /dev/null +++ b/src/glsl/builtins/ir/ftransform @@ -0,0 +1,9 @@ +((declare (uniform) mat4 gl_ModelViewProjectionMatrix) + (declare (in) vec4 gl_Vertex) + (function ftransform + (signature vec4 + (parameters) + ((return (expression vec4 * + (var_ref gl_ModelViewProjectionMatrix) + (var_ref gl_Vertex))))) +)) diff --git a/src/glsl/builtins/ir/fwidth b/src/glsl/builtins/ir/fwidth new file mode 100644 index 00000000000..385e05d6a1a --- /dev/null +++ b/src/glsl/builtins/ir/fwidth @@ -0,0 +1,29 @@ +((function fwidth + (signature float + (parameters + (declare (in) float p)) + ((return (expression float + + (expression float abs (expression float dFdx (var_ref p))) + (expression float abs (expression float dFdy (var_ref p))))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 + + (expression vec2 abs (expression vec2 dFdx (var_ref p))) + (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 + + (expression vec3 abs (expression vec3 dFdx (var_ref p))) + (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 + + (expression vec4 abs (expression vec4 dFdx (var_ref p))) + (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) +)) diff --git a/src/glsl/builtins/ir/greaterThan b/src/glsl/builtins/ir/greaterThan new file mode 100644 index 00000000000..ce7bd29bed8 --- /dev/null +++ b/src/glsl/builtins/ir/greaterThan @@ -0,0 +1,91 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/ir/greaterThanEqual b/src/glsl/builtins/ir/greaterThanEqual new file mode 100644 index 00000000000..de1a9f9516e --- /dev/null +++ b/src/glsl/builtins/ir/greaterThanEqual @@ -0,0 +1,91 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/ir/inversesqrt b/src/glsl/builtins/ir/inversesqrt new file mode 100644 index 00000000000..5b66d2b3695 --- /dev/null +++ b/src/glsl/builtins/ir/inversesqrt @@ -0,0 +1,21 @@ +((function inversesqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float rsq (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 rsq (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 rsq (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 rsq (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/length b/src/glsl/builtins/ir/length new file mode 100644 index 00000000000..89ff7f3ef12 --- /dev/null +++ b/src/glsl/builtins/ir/length @@ -0,0 +1,21 @@ +((function length + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec2 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec3 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec4 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) +)) diff --git a/src/glsl/builtins/ir/lessThan b/src/glsl/builtins/ir/lessThan new file mode 100644 index 00000000000..52113b70466 --- /dev/null +++ b/src/glsl/builtins/ir/lessThan @@ -0,0 +1,91 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/ir/lessThanEqual b/src/glsl/builtins/ir/lessThanEqual new file mode 100644 index 00000000000..4b240be5d19 --- /dev/null +++ b/src/glsl/builtins/ir/lessThanEqual @@ -0,0 +1,91 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/ir/log b/src/glsl/builtins/ir/log new file mode 100644 index 00000000000..d168abb5a73 --- /dev/null +++ b/src/glsl/builtins/ir/log @@ -0,0 +1,21 @@ +((function log + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/log2 b/src/glsl/builtins/ir/log2 new file mode 100644 index 00000000000..b96c6276f0a --- /dev/null +++ b/src/glsl/builtins/ir/log2 @@ -0,0 +1,21 @@ +((function log2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log2 (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/matrixCompMult b/src/glsl/builtins/ir/matrixCompMult new file mode 100644 index 00000000000..538da18a794 --- /dev/null +++ b/src/glsl/builtins/ir/matrixCompMult @@ -0,0 +1,91 @@ +((function matrixCompMult + (signature mat2 + (parameters + (declare (in) mat2 x) + (declare (in) mat2 y)) + ((declare () mat2 z) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat3 + (parameters + (declare (in) mat3 x) + (declare (in) mat3 y)) + ((declare () mat3 z) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat4 + (parameters + (declare (in) mat4 x) + (declare (in) mat4 y)) + ((declare () mat4 z) + (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))))) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat2x3 + (parameters + (declare (in) mat2x3 x) + (declare (in) mat2x3 y)) + ((declare () mat2x3 z) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat3x2 + (parameters + (declare (in) mat3x2 x) + (declare (in) mat3x2 y)) + ((declare () mat3x2 z) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat2x4 + (parameters + (declare (in) mat2x4 x) + (declare (in) mat2x4 y)) + ((declare () mat2x4 z) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat4x2 + (parameters + (declare (in) mat4x2 x) + (declare (in) mat4x2 y)) + ((declare () mat4x2 z) + (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))))) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat3x4 + (parameters + (declare (in) mat3x4 x) + (declare (in) mat3x4 y)) + ((declare () mat3x4 z) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) + + (signature mat4x3 + (parameters + (declare (in) mat4x3 x) + (declare (in) mat4x3 y)) + ((declare () mat4x3 z) + (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))))) + (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))))) + (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))))) + (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))))) +(return (var_ref z)))) +)) diff --git a/src/glsl/builtins/ir/max b/src/glsl/builtins/ir/max new file mode 100644 index 00000000000..2b5a02868cc --- /dev/null +++ b/src/glsl/builtins/ir/max @@ -0,0 +1,127 @@ +((function max + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/min b/src/glsl/builtins/ir/min new file mode 100644 index 00000000000..2deef1118a7 --- /dev/null +++ b/src/glsl/builtins/ir/min @@ -0,0 +1,127 @@ +((function min + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/mix b/src/glsl/builtins/ir/mix new file mode 100644 index 00000000000..6bc6f0a43e8 --- /dev/null +++ b/src/glsl/builtins/ir/mix @@ -0,0 +1,88 @@ +((function mix + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((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)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) float arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) float arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) float arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature float + (parameters + (declare (in) float v1) + (declare (in) float v2) + (declare (in) bool a)) + ((assign (var_ref a) (var_ref v1) (var_ref v2)) + (return (var_ref v1)))) + + (signature vec2 + (parameters + (declare (in) vec2 v1) + (declare (in) vec2 v2) + (declare (in) bvec2 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (return (var_ref v1)))) + + (signature vec3 + (parameters + (declare (in) vec3 v1) + (declare (in) vec3 v2) + (declare (in) bvec3 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) + (return (var_ref v1)))) + + (signature vec4 + (parameters + (declare (in) vec4 v1) + (declare (in) vec4 v2) + (declare (in) bvec4 a)) + ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) + (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2))) + (return (var_ref v1)))) +)) diff --git a/src/glsl/builtins/ir/mod b/src/glsl/builtins/ir/mod new file mode 100644 index 00000000000..aeaea240e2d --- /dev/null +++ b/src/glsl/builtins/ir/mod @@ -0,0 +1,43 @@ +((function mod + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/noise1 b/src/glsl/builtins/ir/noise1 new file mode 100644 index 00000000000..eb7be358575 --- /dev/null +++ b/src/glsl/builtins/ir/noise1 @@ -0,0 +1,18 @@ +((function noise1 + (signature float + (parameters + (declare (in) float x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec2 x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec3 x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec4 x)) + ((return (constant float (0))))) +)) diff --git a/src/glsl/builtins/ir/noise2 b/src/glsl/builtins/ir/noise2 new file mode 100644 index 00000000000..ae4443a704a --- /dev/null +++ b/src/glsl/builtins/ir/noise2 @@ -0,0 +1,18 @@ +((function noise2 + (signature vec2 + (parameters + (declare (in) float x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec3 x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec4 x)) + ((return (constant vec2 (0 0))))) +)) diff --git a/src/glsl/builtins/ir/noise3 b/src/glsl/builtins/ir/noise3 new file mode 100644 index 00000000000..30d9681890e --- /dev/null +++ b/src/glsl/builtins/ir/noise3 @@ -0,0 +1,18 @@ +((function noise3 + (signature vec3 + (parameters + (declare (in) float x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec2 x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec4 x)) + ((return (constant vec3 (0 0 0))))) +)) diff --git a/src/glsl/builtins/ir/noise4 b/src/glsl/builtins/ir/noise4 new file mode 100644 index 00000000000..913bef2aa1b --- /dev/null +++ b/src/glsl/builtins/ir/noise4 @@ -0,0 +1,18 @@ +((function noise4 + (signature vec4 + (parameters + (declare (in) float x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec2 x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec3 x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (constant vec4 (0 0 0 0))))) +)) diff --git a/src/glsl/builtins/ir/normalize b/src/glsl/builtins/ir/normalize new file mode 100644 index 00000000000..be88a9830d1 --- /dev/null +++ b/src/glsl/builtins/ir/normalize @@ -0,0 +1,21 @@ +((function normalize + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) +)) diff --git a/src/glsl/builtins/ir/not b/src/glsl/builtins/ir/not new file mode 100644 index 00000000000..b696b06557f --- /dev/null +++ b/src/glsl/builtins/ir/not @@ -0,0 +1,16 @@ +((function not + (signature bvec2 + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bvec2 ! (var_ref arg0))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bvec3 ! (var_ref arg0))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bvec4 ! (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/notEqual b/src/glsl/builtins/ir/notEqual new file mode 100644 index 00000000000..bcc7339bb6e --- /dev/null +++ b/src/glsl/builtins/ir/notEqual @@ -0,0 +1,91 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((declare () bvec2 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((declare () bvec3 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (return (var_ref temp)))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((declare () bvec4 temp) + (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) + (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) + (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) + (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) + (return (var_ref temp)))) +)) diff --git a/src/glsl/builtins/ir/outerProduct b/src/glsl/builtins/ir/outerProduct new file mode 100644 index 00000000000..69ae741e176 --- /dev/null +++ b/src/glsl/builtins/ir/outerProduct @@ -0,0 +1,92 @@ +((function outerProduct + (signature mat2 + (parameters + (declare (in) vec2 u) + (declare (in) vec2 v)) + ((declare () mat2 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat2x3 + (parameters + (declare (in) vec3 u) + (declare (in) vec2 v)) + ((declare () mat2x3 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat2x4 + (parameters + (declare (in) vec4 u) + (declare (in) vec2 v)) + ((declare () mat2x4 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat3x2 + (parameters + (declare (in) vec2 u) + (declare (in) vec3 v)) + ((declare () mat3x2 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)) + )) + + (signature mat3 + (parameters + (declare (in) vec3 u) + (declare (in) vec3 v)) + ((declare () mat3 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) + + (signature mat3x4 + (parameters + (declare (in) vec4 u) + (declare (in) vec3 v)) + ((declare () mat3x4 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) + + (signature mat4x2 + (parameters + (declare (in) vec2 u) + (declare (in) vec4 v)) + ((declare () mat4x2 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) + + (signature mat4x3 + (parameters + (declare (in) vec3 u) + (declare (in) vec4 v)) + ((declare () mat4x3 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) + + (signature mat4 + (parameters + (declare (in) vec4 u) + (declare (in) vec4 v)) + ((declare () mat4 m) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) +)) diff --git a/src/glsl/builtins/ir/pow b/src/glsl/builtins/ir/pow new file mode 100644 index 00000000000..a61bc4418e3 --- /dev/null +++ b/src/glsl/builtins/ir/pow @@ -0,0 +1,25 @@ +((function pow + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float pow (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/radians b/src/glsl/builtins/ir/radians new file mode 100644 index 00000000000..6a0f5d2e219 --- /dev/null +++ b/src/glsl/builtins/ir/radians @@ -0,0 +1,21 @@ +((function radians + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (0.017453)))))) +)) diff --git a/src/glsl/builtins/ir/reflect b/src/glsl/builtins/ir/reflect new file mode 100644 index 00000000000..8238fdc93fd --- /dev/null +++ b/src/glsl/builtins/ir/reflect @@ -0,0 +1,58 @@ +((function reflect + (signature float + (parameters + (declare (in) float i) + (declare (in) float n)) + ((return (expression float - + (var_ref i) + (expression float * + (constant float (2.0)) + (expression float * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n)) + ((return (expression vec2 - + (var_ref i) + (expression vec2 * + (constant float (2.0)) + (expression vec2 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n)) + ((return (expression vec3 - + (var_ref i) + (expression vec3 * + (constant float (2.0)) + (expression vec3 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n)) + ((return (expression vec4 - + (var_ref i) + (expression vec4 * + (constant float (2.0)) + (expression vec4 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + +)) diff --git a/src/glsl/builtins/ir/refract b/src/glsl/builtins/ir/refract new file mode 100644 index 00000000000..522ab411734 --- /dev/null +++ b/src/glsl/builtins/ir/refract @@ -0,0 +1,102 @@ +((function refract + (signature float + (parameters + (declare (in) float i) + (declare (in) float n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant float (0.0)))) + ((return (expression float - + (expression float * (var_ref eta) (var_ref i)) + (expression float * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec2 (0.0 0.0)))) + ((return (expression vec2 - + (expression vec2 * (var_ref eta) (var_ref i)) + (expression vec2 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec3 (0.0 0.0 0.0)))) + ((return (expression vec3 - + (expression vec3 * (var_ref eta) (var_ref i)) + (expression vec3 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec4 (0.0 0.0 0.0 0.0)))) + ((return (expression vec4 - + (expression vec4 * (var_ref eta) (var_ref i)) + (expression vec4 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + +)) diff --git a/src/glsl/builtins/ir/sign b/src/glsl/builtins/ir/sign new file mode 100644 index 00000000000..1f51718dab1 --- /dev/null +++ b/src/glsl/builtins/ir/sign @@ -0,0 +1,42 @@ +((function sign + (signature float + (parameters + (declare (in) float x)) + ((return (expression float sign (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 sign (var_ref x))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 sign (var_ref x))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 sign (var_ref x))))) + + (signature int + (parameters + (declare (in) int x)) + ((return (expression int sign (var_ref x))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 x)) + ((return (expression ivec2 sign (var_ref x))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 x)) + ((return (expression ivec3 sign (var_ref x))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 x)) + ((return (expression ivec4 sign (var_ref x))))) +)) + diff --git a/src/glsl/builtins/ir/sin b/src/glsl/builtins/ir/sin new file mode 100644 index 00000000000..e6009d8ef12 --- /dev/null +++ b/src/glsl/builtins/ir/sin @@ -0,0 +1,21 @@ +((function sin + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float sin (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 sin (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 sin (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 sin (var_ref angle))))) +)) diff --git a/src/glsl/builtins/ir/sinh b/src/glsl/builtins/ir/sinh new file mode 100644 index 00000000000..7ad4f58e204 --- /dev/null +++ b/src/glsl/builtins/ir/sinh @@ -0,0 +1,30 @@ +((function sinh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant vec2 (0.5)) + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant vec3 (0.5)) + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant vec4 (0.5)) + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/smoothstep b/src/glsl/builtins/ir/smoothstep new file mode 100644 index 00000000000..663eec63419 --- /dev/null +++ b/src/glsl/builtins/ir/smoothstep @@ -0,0 +1,153 @@ +((function smoothstep + (signature float + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) float x)) + ((declare () float t) + + (assign (constant bool (1)) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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)))))))) + + (signature vec2 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec2 x)) + ((declare () vec2 t) + (declare () vec2 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + (signature vec3 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec3 x)) + ((declare () vec3 t) + (declare () vec3 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + + (signature vec4 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec4 x)) + ((declare () vec4 t) + (declare () vec4 retval) + + (assign (constant bool (1)) (swiz x (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz y (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz z (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + + (assign (constant bool (1)) (swiz w (var_ref t)) + (expression float max + (expression float min + (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (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))))))) + (return (var_ref retval)) + )) + + (signature vec2 + (parameters + (declare (in) vec2 edge0) + (declare (in) vec2 edge1) + (declare (in) vec2 x)) + ((return (expression vec2 max + (expression vec2 min + (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) + (constant vec2 (1.0 1.0))) + (constant vec2 (0.0 0.0)))))) + + (signature vec3 + (parameters + (declare (in) vec3 edge0) + (declare (in) vec3 edge1) + (declare (in) vec3 x)) + ((return (expression vec3 max + (expression vec3 min + (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) + (constant vec3 (1.0 1.0 1.0))) + (constant vec3 (0.0 0.0 0.0)))))) + + (signature vec4 + (parameters + (declare (in) vec4 edge0) + (declare (in) vec4 edge1) + (declare (in) vec4 x)) + ((return (expression vec4 max + (expression vec4 min + (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) + (constant vec4 (1.0 1.0 1.0 1.0))) + (constant vec4 (0.0 0.0 0.0 0.0)))))) +)) + diff --git a/src/glsl/builtins/ir/sqrt b/src/glsl/builtins/ir/sqrt new file mode 100644 index 00000000000..0302d164ae5 --- /dev/null +++ b/src/glsl/builtins/ir/sqrt @@ -0,0 +1,21 @@ +((function sqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 sqrt (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 sqrt (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 sqrt (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/step b/src/glsl/builtins/ir/step new file mode 100644 index 00000000000..ce6f4354228 --- /dev/null +++ b/src/glsl/builtins/ir/step @@ -0,0 +1,68 @@ +((function step + (signature float + (parameters + (declare (in) float edge) + (declare (in) float x)) + ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) + + (signature vec2 + (parameters + (declare (in) float edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) float edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) float edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec2 + (parameters + (declare (in) vec2 edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) vec3 edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) vec4 edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge))))) + (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) + (return (var_ref t)))) +)) + diff --git a/src/glsl/builtins/ir/tan b/src/glsl/builtins/ir/tan new file mode 100644 index 00000000000..99798631859 --- /dev/null +++ b/src/glsl/builtins/ir/tan @@ -0,0 +1,21 @@ +((function tan + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) +)) diff --git a/src/glsl/builtins/ir/tanh b/src/glsl/builtins/ir/tanh new file mode 100644 index 00000000000..3b7271bf779 --- /dev/null +++ b/src/glsl/builtins/ir/tanh @@ -0,0 +1,42 @@ +((function tanh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float / + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 / + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 / + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 / + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/transpose b/src/glsl/builtins/ir/transpose new file mode 100644 index 00000000000..416a0ee4677 --- /dev/null +++ b/src/glsl/builtins/ir/transpose @@ -0,0 +1,139 @@ +((function transpose + (signature mat2 + (parameters + (declare (in) mat2 m)) + ((declare () mat2 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat3x2 + (parameters + (declare (in) mat2x3 m)) + ((declare () mat3x2 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat4x2 + (parameters + (declare (in) mat2x4 m)) + ((declare () mat4x2 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat2x3 + (parameters + (declare (in) mat3x2 m)) + ((declare () mat2x3 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat3 + (parameters + (declare (in) mat3 m)) + ((declare () mat3 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat4x3 + (parameters + (declare (in) mat3x4 m)) + ((declare () mat4x3 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat2x4 + (parameters + (declare (in) mat4x2 m)) + ((declare () mat2x4 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat3x4 + (parameters + (declare (in) mat4x3 m)) + ((declare () mat3x4 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat4 + (parameters + (declare (in) mat4 m)) + ((declare () mat4 t) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) +) + +) + diff --git a/src/glsl/builtins/profiles/110.frag b/src/glsl/builtins/profiles/110.frag new file mode 100644 index 00000000000..25bc62c093c --- /dev/null +++ b/src/glsl/builtins/profiles/110.frag @@ -0,0 +1,364 @@ +#version 110 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); + + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/110.vert b/src/glsl/builtins/profiles/110.vert new file mode 100644 index 00000000000..545e59c5397 --- /dev/null +++ b/src/glsl/builtins/profiles/110.vert @@ -0,0 +1,351 @@ +#version 110 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/120.frag b/src/glsl/builtins/profiles/120.frag new file mode 100644 index 00000000000..a207435f337 --- /dev/null +++ b/src/glsl/builtins/profiles/120.frag @@ -0,0 +1,396 @@ +#version 120 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); + + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/120.vert b/src/glsl/builtins/profiles/120.vert new file mode 100644 index 00000000000..e14c931647f --- /dev/null +++ b/src/glsl/builtins/profiles/120.vert @@ -0,0 +1,383 @@ +#version 120 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/ARB_texture_rectangle.frag b/src/glsl/builtins/profiles/ARB_texture_rectangle.frag new file mode 100644 index 00000000000..8938aa3e97c --- /dev/null +++ b/src/glsl/builtins/profiles/ARB_texture_rectangle.frag @@ -0,0 +1,7 @@ +#extension GL_ARB_texture_rectangle : enable +vec4 texture2DRect(sampler2DRect sampler, vec2 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); + +vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); +vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/profiles/ARB_texture_rectangle.vert b/src/glsl/builtins/profiles/ARB_texture_rectangle.vert new file mode 100644 index 00000000000..8938aa3e97c --- /dev/null +++ b/src/glsl/builtins/profiles/ARB_texture_rectangle.vert @@ -0,0 +1,7 @@ +#extension GL_ARB_texture_rectangle : enable +vec4 texture2DRect(sampler2DRect sampler, vec2 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); + +vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); +vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/profiles/EXT_texture_array.frag b/src/glsl/builtins/profiles/EXT_texture_array.frag new file mode 100644 index 00000000000..d133132191b --- /dev/null +++ b/src/glsl/builtins/profiles/EXT_texture_array.frag @@ -0,0 +1,11 @@ +#extension GL_EXT_texture_array : enable +vec4 texture1DArray(sampler1DArray sampler, vec2 coord); +vec4 texture1DArray(sampler1DArray sampler, vec2 coord, float bias); + +vec4 texture2DArray(sampler1DArray sampler, vec2 coord); +vec4 texture2DArray(sampler1DArray sampler, vec2 coord, float bias); + +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord, float bias); + +vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/profiles/EXT_texture_array.vert b/src/glsl/builtins/profiles/EXT_texture_array.vert new file mode 100644 index 00000000000..4f7b2b5f8b1 --- /dev/null +++ b/src/glsl/builtins/profiles/EXT_texture_array.vert @@ -0,0 +1,11 @@ +#extension GL_EXT_texture_array : enable +vec4 texture1DArray(sampler1DArray sampler, vec2 coord); +vec4 texture1DArrayLod(sampler1DArray sampler, vec2 coord, float lod); + +vec4 texture2DArray(sampler1DArray sampler, vec2 coord); +vec4 texture2DArrayLod(sampler1DArray sampler, vec2 coord, float lod); + +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); +vec4 shadow1DArrayLod(sampler1DArrayShadow sampler, vec3 coord, float lod); + +vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/tools/builtin_function.cpp b/src/glsl/builtins/tools/builtin_function.cpp new file mode 100644 index 00000000000..c44804f2ef7 --- /dev/null +++ b/src/glsl/builtins/tools/builtin_function.cpp @@ -0,0 +1,39 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +#include "glsl_parser_extras.h" + +/* A dummy file. When compiling prototypes, we don't care about builtins. + * We really don't want to half-compile builtin_functions.cpp and fail, though. + */ +void +_mesa_glsl_release_functions(void) +{ +} + +void +_mesa_glsl_initialize_functions(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ +} diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl deleted file mode 100755 index 91ef8917b0a..00000000000 --- a/src/glsl/builtins/tools/generate_builtins.pl +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env perl - -sub process_version { - my ($version) = @_; - my @vars; - print "/* $version builtins */\n\n"; - - my @files = ; - foreach $file (@files) { - push(@vars, process_file($file)); - } - - print "static const char *functions_for_$version [] = {\n"; - foreach $var (@vars) { - print " $var,\n"; - } - print "};\n\n" -} - -sub process_file { - my ($file) = @_; - - # Change from builtins/110/foo to builtins_110_foo - my $var = $file; $var =~ s!/!_!g; - - print "static const char *$var = {\n"; - open SRC, "<", "$file" or die $!; - while () { - s/\\/\\\\/g; - s/\"/\\\"/g; - s/\n/\\n/g; - print " \"$_\"\n"; - } - print "};\n\n"; - close SRC or die $!; - return $var; -} - -print << 'EOF'; -/* DO NOT MODIFY - automatically generated by generate_builtins.pl */ -/* - * Copyright © 2010 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include "main/compiler.h" -#include "glsl_parser_extras.h" -#include "ir_reader.h" -#include "program.h" - -extern "C" struct gl_shader * -_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); - -gl_shader * -read_builtins(GLenum target, const char **functions, unsigned count) -{ - gl_shader *sh = _mesa_new_shader(NULL, 0, target); - struct _mesa_glsl_parse_state *st = - new(sh) _mesa_glsl_parse_state(NULL, target, sh); - - st->language_version = 130; - st->ARB_texture_rectangle_enable = true; - st->EXT_texture_array_enable = true; - _mesa_glsl_initialize_types(st); - - sh->ir = new(sh) exec_list; - sh->symbols = st->symbols; - - for (unsigned i = 0; i < count; i++) { - _mesa_glsl_read_ir(st, sh->ir, functions[i]); - - if (st->error) { - printf("error reading builtin: %.35s ...\n", functions[i]); - delete st; - talloc_free(sh); - return NULL; - } - } - - reparent_ir(sh->ir, sh); - delete st; - - return sh; -} - -EOF - -@versions = sort(); -foreach $version (@versions) { - $version =~ s!builtins/!!g; - process_version($version); -} - -print << 'EOF'; -void *builtin_mem_ctx = NULL; - -void -_mesa_glsl_release_functions(void) -{ - talloc_free(builtin_mem_ctx); -} - -void -_mesa_glsl_initialize_functions(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - if (builtin_mem_ctx == NULL) - builtin_mem_ctx = talloc_init("GLSL built-in functions"); - - state->num_builtins_to_link = 0; -EOF - -foreach $version_xs (@versions) { - $check = ""; - if ($version_xs =~ /_vs/) { - $check = "state->target == vertex_shader && "; - } elsif ($version_xs =~ /_fs/) { - $check = "state->target == fragment_shader && "; - } - $version = $version_xs; - $version =~ s/_[vf]s//g; - - if ($version =~ /^[1-9][0-9][0-9]/) { - $check = "${check}state->language_version >= $version"; - } else { - # Not a version...an extension name - $check = "${check}state->${version}_enable"; - } - print " if ($check) {\n"; - print " static gl_shader *sh = NULL;\n"; - print "\n"; - print " if (sh == NULL) {\n"; - print " sh = read_builtins(GL_VERTEX_SHADER, functions_for_$version_xs,\n"; - print " Elements(functions_for_$version_xs));\n"; - print " talloc_steal(builtin_mem_ctx, sh);\n"; - print " }\n"; - print "\n"; - print " import_prototypes(sh->ir, instructions, state->symbols, state);\n"; - print " state->builtins_to_link[state->num_builtins_to_link] = sh;\n"; - print " state->num_builtins_to_link++;\n"; - print " }\n"; - print "\n"; -} - -print "}\n"; diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py new file mode 100755 index 00000000000..2eb67e398a6 --- /dev/null +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -0,0 +1,207 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import re, glob, sys +from os import path +from subprocess import Popen, PIPE + +# Local module: generator for texture lookup builtins +from texture_builtins import generate_texture_functions + +builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") + +# Read the files in builtins/ir/*...add them to the supplied dictionary. +def read_ir_files(fs): + for filename in glob.glob(path.join(path.join(builtins_dir, 'ir'), '*')): + with open(filename) as f: + fs[path.basename(filename)] = f.read() + +# Return a dictionary containing all builtin definitions (even generated) +def get_builtin_definitions(): + fs = {} + generate_texture_functions(fs) + read_ir_files(fs) + return fs + +def stringify(s): + t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "') + return ' "' + t + '"\n' + +def write_function_definitions(): + fs = get_builtin_definitions() + for k, v in fs.iteritems(): + print 'static const char *builtin_' + k + ' =' + print stringify(v), ';' + +def run_compiler(args): + compiler_path = path.join(path.join(builtins_dir, '..'), 'glsl_compiler') + command = [compiler_path, '--dump-lir'] + args + p = Popen(command, 1, stdout=PIPE, shell=False) + output = p.communicate()[0] + return (output, p.returncode) + +def write_profile(filename, profile): + (proto_ir, returncode) = run_compiler([filename]) + + if returncode != 0: + print '#error builtins profile', profile, 'failed to compile' + return + + # Kill any global variable declarations. We don't want them. + kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE); + proto_ir = kill_globals.sub('', proto_ir) + + print 'static const char *prototypes_for_' + profile + ' =' + print stringify(proto_ir), ';' + + # Print a table of all the functions (not signatures) referenced. + # This is done so we can avoid bothering with a hash table in the C++ code. + + function_names = set() + for func in re.finditer(r'\(function (.+)\n', proto_ir): + function_names.add(func.group(1)) + + print 'static const char *functions_for_' + profile + ' [] = {' + for func in function_names: + print ' builtin_' + func + ',' + print '};' + +def write_profiles(): + profiles = get_profile_list() + for (filename, profile) in profiles: + write_profile(filename, profile) + +def get_profile_list(): + profiles = [] + for pfile in glob.glob(path.join(path.join(builtins_dir, 'profiles'), '*')): + profiles.append((pfile, path.basename(pfile).replace('.', '_'))) + return profiles + +if __name__ == "__main__": + print """/* DO NOT MODIFY - automatically generated by generate_builtins.py */ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +#include "main/compiler.h" +#include "glsl_parser_extras.h" +#include "ir_reader.h" +#include "program.h" +#include "ast.h" + +extern "C" struct gl_shader * +_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); + +gl_shader * +read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) +{ + gl_shader *sh = _mesa_new_shader(NULL, 0, target); + struct _mesa_glsl_parse_state *st = + new(sh) _mesa_glsl_parse_state(NULL, target, sh); + + st->language_version = 130; + st->ARB_texture_rectangle_enable = true; + st->EXT_texture_array_enable = true; + _mesa_glsl_initialize_types(st); + + sh->ir = new(sh) exec_list; + sh->symbols = st->symbols; + + /* Read the IR containing the prototypes */ + _mesa_glsl_read_ir(st, sh->ir, protos, true); + + /* Read ALL the function bodies, telling the IR reader not to scan for + * prototypes (we've already created them). The IR reader will skip any + * signature that does not already exist as a prototype. + */ + for (unsigned i = 0; i < count; i++) { + _mesa_glsl_read_ir(st, sh->ir, functions[i], false); + + if (st->error) { + printf("error reading builtin: %.35s ...\\n", functions[i]); + talloc_free(sh); + return NULL; + } + } + + reparent_ir(sh->ir, sh); + delete st; + + return sh; +} +""" + + write_function_definitions() + write_profiles() + + print """ +void *builtin_mem_ctx = NULL; + +void +_mesa_glsl_release_functions(void) +{ + talloc_free(builtin_mem_ctx); +} + +void +_mesa_glsl_initialize_functions(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + if (builtin_mem_ctx == NULL) + builtin_mem_ctx = talloc_init("GLSL built-in functions"); + + state->num_builtins_to_link = 0; +""" + + profiles = get_profile_list() + for (filename, profile) in profiles: + if profile.endswith('_vert'): + check = 'state->target == vertex_shader && ' + elif profile.endswith('_frag'): + check = 'state->target == fragment_shader && ' + + version = re.sub(r'_(vert|frag)$', '', profile) + if version.isdigit(): + check += 'state->language_version == ' + version + else: # an extension name + check += 'state->' + version + '_enable' + + print ' if (' + check + ') {' + print ' static gl_shader *sh = NULL;' + print ' if (sh == NULL) {' + print ' sh = read_builtins(GL_VERTEX_SHADER,' + print ' prototypes_for_' + profile + ',' + print ' functions_for_' + profile + ',' + print ' Elements(functions_for_' + profile, + print '));' + print ' talloc_steal(builtin_mem_ctx, sh);' + print ' }' + print + print ' import_prototypes(sh->ir, instructions, state->symbols,' + print ' state);' + print ' state->builtins_to_link[state->num_builtins_to_link] = sh;' + print ' state->num_builtins_to_link++;' + print ' }' + print + print '}' + diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py index 33d9642ef78..8bf708b5aac 100755 --- a/src/glsl/builtins/tools/texture_builtins.py +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -1,7 +1,7 @@ #!/usr/bin/python -from os import path import sys +import StringIO def vec_type(g, size): if size == 1: @@ -95,204 +95,255 @@ def generate_fiu_sigs(tex_inst, sampler_type, use_proj = False, unused_fields = generate_sigs("i", tex_inst, sampler_type, use_proj, unused_fields) generate_sigs("u", tex_inst, sampler_type, use_proj, unused_fields) -builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") +def start_function(name): + sys.stdout = StringIO.StringIO() + print "((function " + name -with open(path.join(builtins_dir, "130", "texture"), 'w') as sys.stdout: - print "((function texture" +def end_function(fs, name): + print "))" + fs[name] = sys.stdout.getvalue(); + sys.stdout.close() + +# Generate all the functions and store them in the supplied dictionary. +# This is better than writing them to actual files since they should never be +# edited; it'd also be easy to confuse them with the many hand-generated files. +# +# Takes a dictionary as an argument. +def generate_texture_functions(fs): + start_function("texture") generate_fiu_sigs("tex", "1D") generate_fiu_sigs("tex", "2D") generate_fiu_sigs("tex", "3D") generate_fiu_sigs("tex", "Cube") generate_fiu_sigs("tex", "1DArray") generate_fiu_sigs("tex", "2DArray") - print "))" -# txb variants are only allowed within a fragment shader (GLSL 1.30 p. 86) -with open(path.join(builtins_dir, "130_fs", "texture"), 'w') as sys.stdout: - print "((function texture" generate_fiu_sigs("txb", "1D") generate_fiu_sigs("txb", "2D") generate_fiu_sigs("txb", "3D") generate_fiu_sigs("txb", "Cube") generate_fiu_sigs("txb", "1DArray") generate_fiu_sigs("txb", "2DArray") - print "))" + end_function(fs, "texture") -with open(path.join(builtins_dir, "130", "textureProj"), 'w') as sys.stdout: - print "((function textureProj" + start_function("textureProj") generate_fiu_sigs("tex", "1D", True) generate_fiu_sigs("tex", "1D", True, 2) generate_fiu_sigs("tex", "2D", True) generate_fiu_sigs("tex", "2D", True, 1) generate_fiu_sigs("tex", "3D", True) - print "))" -with open(path.join(builtins_dir, "130_fs", "textureProj"), 'w') as sys.stdout: - print "((function textureProj" generate_fiu_sigs("txb", "1D", True) generate_fiu_sigs("txb", "1D", True, 2) generate_fiu_sigs("txb", "2D", True) generate_fiu_sigs("txb", "2D", True, 1) generate_fiu_sigs("txb", "3D", True) - print "))" + end_function(fs, "textureProj") -with open(path.join(builtins_dir, "130", "textureLod"), 'w') as sys.stdout: - print "((function textureLod" + start_function("textureLod") generate_fiu_sigs("txl", "1D") generate_fiu_sigs("txl", "2D") generate_fiu_sigs("txl", "3D") generate_fiu_sigs("txl", "Cube") generate_fiu_sigs("txl", "1DArray") generate_fiu_sigs("txl", "2DArray") - print "))" + end_function(fs, "textureLod") -with open(path.join(builtins_dir, "130", "texelFetch"), 'w') as sys.stdout: - print "((function texelFetch" + start_function("texelFetch") generate_fiu_sigs("txf", "1D") generate_fiu_sigs("txf", "2D") generate_fiu_sigs("txf", "3D") generate_fiu_sigs("txf", "1DArray") generate_fiu_sigs("txf", "2DArray") - print "))" + end_function(fs, "texelFetch") -with open(path.join(builtins_dir, "130", "textureProjLod"), 'w') as sys.stdout: - print "((function textureProjLod" + start_function("textureProjLod") generate_fiu_sigs("txl", "1D", True) generate_fiu_sigs("txl", "1D", True, 2) generate_fiu_sigs("txl", "2D", True) generate_fiu_sigs("txl", "2D", True, 1) generate_fiu_sigs("txl", "3D", True) - print "))" + end_function(fs, "textureProjLod") -with open(path.join(builtins_dir, "130", "textureGrad"), 'w') as sys.stdout: - print "((function textureGrad" + start_function("textureGrad") generate_fiu_sigs("txd", "1D") generate_fiu_sigs("txd", "2D") generate_fiu_sigs("txd", "3D") generate_fiu_sigs("txd", "Cube") generate_fiu_sigs("txd", "1DArray") generate_fiu_sigs("txd", "2DArray") - print ")\n)" + end_function(fs, "textureGrad") -with open(path.join(builtins_dir, "130", "textureProjGrad"), 'w') as sys.stdout: - print "((function textureProjGrad" + start_function("textureProjGrad") generate_fiu_sigs("txd", "1D", True) generate_fiu_sigs("txd", "1D", True, 2) generate_fiu_sigs("txd", "2D", True) generate_fiu_sigs("txd", "2D", True, 1) generate_fiu_sigs("txd", "3D", True) - print "))" + end_function(fs, "textureProjGrad") -# ARB_texture_rectangle extension -with open(path.join(builtins_dir, "ARB_texture_rectangle", "textures"), 'w') as sys.stdout: - print "((function texture2DRect" + # ARB_texture_rectangle extension + start_function("texture2DRect") generate_sigs("", "tex", "2DRect") - print ")\n (function shadow2DRect" + end_function(fs, "texture2DRect") + + start_function("texture2DRectProj") + generate_sigs("", "tex", "2DRect", True) + generate_sigs("", "tex", "2DRect", True, 1) + end_function(fs, "texture2DRectProj") + + start_function("shadow2DRect") generate_sigs("", "tex", "2DRectShadow") - print "))" + end_function(fs, "shadow2DRect") -# EXT_texture_array extension -with open(path.join(builtins_dir, "EXT_texture_array", "textures"), 'w') as sys.stdout: - print "((function texture1DArray" + start_function("shadow2DRectProj") + generate_sigs("", "tex", "2DRectShadow", True) + end_function(fs, "shadow2DRectProj") + + # EXT_texture_array extension + start_function("texture1DArray") generate_sigs("", "tex", "1DArray") - print ")\n (function texture1DArrayLod" + generate_sigs("", "txb", "1DArray") + end_function(fs, "texture1DArray") + + start_function("texture1DArrayLod") generate_sigs("", "txl", "1DArray") - print ")\n (function texture2DArray" + end_function(fs, "texture1DArrayLod") + + start_function("texture2DArray") generate_sigs("", "tex", "2DArray") - print ")\n (function texture2DArrayLod" + generate_sigs("", "txb", "2DArray") + end_function(fs, "texture2DArray") + + start_function("texture2DArrayLod") generate_sigs("", "txl", "2DArray") - print ")\n (function shadow1DArray" + end_function(fs, "texture2DArrayLod") + + start_function("shadow1DArray") generate_sigs("", "tex", "1DArrayShadow") - print ")\n (function shadow1DArrayLod" + generate_sigs("", "txb", "1DArrayShadow") + end_function(fs, "shadow1DArray") + + start_function("shadow1DArrayLod") generate_sigs("", "txl", "1DArrayShadow") - print ")\n (function shadow2DArray" - generate_sigs("", "tex", "2DArrayShadow") - print "))" + end_function(fs, "shadow1DArrayLod") -with open(path.join(builtins_dir, "EXT_texture_array_fs", "textures"), 'w') as sys.stdout: - print "((function texture1DArray" - generate_sigs("", "txb", "1DArray") - print ")\n (function texture2DArray" - generate_sigs("", "txb", "2DArray") - print ")\n (function shadow1DArray" - generate_sigs("", "txb", "1DArrayShadow") - print "))" + start_function("shadow2DArray") + generate_sigs("", "tex", "2DArrayShadow") + end_function(fs, "shadow2DArray") -# Deprecated (110/120 style) functions with silly names: -with open(path.join(builtins_dir, "110", "textures"), 'w') as sys.stdout: - print "((function texture1D" + # Deprecated (110/120 style) functions with silly names: + start_function("texture1D") generate_sigs("", "tex", "1D") - print ")\n (function texture1DLod" + generate_sigs("", "txb", "1D") + end_function(fs, "texture1D") + + start_function("texture1DLod") generate_sigs("", "txl", "1D") - print ")\n (function texture1DProj" + end_function(fs, "texture1DLod") + + start_function("texture1DProj") generate_sigs("", "tex", "1D", True) generate_sigs("", "tex", "1D", True, 2) - print ")\n (function texture1DProjLod" + generate_sigs("", "txb", "1D", True) + generate_sigs("", "txb", "1D", True, 2) + end_function(fs, "texture1DProj") + + start_function("texture1DProjLod") generate_sigs("", "txl", "1D", True) generate_sigs("", "txl", "1D", True, 2) - print ")\n (function texture2D" + end_function(fs, "texture1DProjLod") + + start_function("texture2D") generate_sigs("", "tex", "2D") - print ")\n(function texture2DLod" + generate_sigs("", "txb", "2D") + end_function(fs, "texture2D") + + start_function("texture2DLod") generate_sigs("", "txl", "2D") - print ")\n (function texture2DProj" + end_function(fs, "texture2DLod") + + start_function("texture2DProj") generate_sigs("", "tex", "2D", True) generate_sigs("", "tex", "2D", True, 1) - print ")\n (function texture2DProjLod" + generate_sigs("", "txb", "2D", True) + generate_sigs("", "txb", "2D", True, 1) + end_function(fs, "texture2DProj") + + start_function("texture2DProjLod") generate_sigs("", "txl", "2D", True) generate_sigs("", "txl", "2D", True, 1) - print ")\n (function texture3D" + end_function(fs, "texture2DProjLod") + + start_function("texture3D") generate_sigs("", "tex", "3D") - print ")\n (function texture3DLod" + generate_sigs("", "txb", "3D") + end_function(fs, "texture3D") + + start_function("texture3DLod") generate_sigs("", "txl", "3D") - print ")\n (function texture3DProj" + end_function(fs, "texture3DLod") + + start_function("texture3DProj") generate_sigs("", "tex", "3D", True) - print ")\n (function texture3DProjLod" + generate_sigs("", "txb", "3D", True) + end_function(fs, "texture3DProj") + + start_function("texture3DProjLod") generate_sigs("", "txl", "3D", True) - print ")\n (function textureCube" + end_function(fs, "texture3DProjLod") + + start_function("textureCube") generate_sigs("", "tex", "Cube") - print ")\n (function textureCubeLod" + generate_sigs("", "txb", "Cube") + end_function(fs, "textureCube") + + start_function("textureCubeLod") generate_sigs("", "txl", "Cube") - print ")\n (function shadow1D" + end_function(fs, "textureCubeLod") + + start_function("shadow1D") generate_sigs("", "tex", "1DShadow", False, 1) - print ")\n (function shadow1DLod" + generate_sigs("", "txb", "1DShadow", False, 1) + end_function(fs, "shadow1D") + + start_function("shadow1DLod") generate_sigs("", "txl", "1DShadow", False, 1) - print ")\n (function shadow1DProj" + end_function(fs, "shadow1DLod") + + start_function("shadow1DProj") generate_sigs("", "tex", "1DShadow", True, 1) - print ")\n (function shadow1DProjLod" + generate_sigs("", "txb", "1DShadow", True, 1) + end_function(fs, "shadow1DProj") + + start_function("shadow1DProjLod") generate_sigs("", "txl", "1DShadow", True, 1) - print ")\n (function shadow2D" + end_function(fs, "shadow1DProjLod") + + start_function("shadow2D") generate_sigs("", "tex", "2DShadow") - print ")\n (function shadow2DLod" + generate_sigs("", "txb", "2DShadow") + end_function(fs, "shadow2D") + + start_function("shadow2DLod") generate_sigs("", "txl", "2DShadow") - print ")\n (function shadow2DProj" + end_function(fs, "shadow2DLod") + + start_function("shadow2DProj") generate_sigs("", "tex", "2DShadow", True) - print ")\n (function shadow2DProjLod" + generate_sigs("", "txb", "2DShadow", True) + end_function(fs, "shadow2DProj") + + start_function("shadow2DProjLod") generate_sigs("", "txl", "2DShadow", True) - print "))" + end_function(fs, "shadow2DProjLod") -with open(path.join(builtins_dir, "110_fs", "textures"), 'w') as sys.stdout: - print "((function texture1D" - generate_sigs("", "txb", "1D") - print ")\n (function texture1DProj" - generate_sigs("", "txb", "1D", True) - generate_sigs("", "txb", "1D", True, 2) - print ")\n (function texture2D" - generate_sigs("", "txb", "2D") - print ")\n (function texture2DProj" - generate_sigs("", "txb", "2D", True) - generate_sigs("", "txb", "2D", True, 1) - print ")\n (function texture3D" - generate_sigs("", "txb", "3D") - print ")\n (function texture3DProj" - generate_sigs("", "txb", "3D", True) - print ")\n (function textureCube" - generate_sigs("", "txb", "Cube") - print ")\n (function shadow1D" - generate_sigs("", "txb", "1DShadow", False, 1) - print ")\n (function shadow1DProj" - generate_sigs("", "txb", "1DShadow", True, 1) - print ")\n (function shadow2D" - generate_sigs("", "txb", "2DShadow") - print ")\n (function shadow2DProj" - generate_sigs("", "txb", "2DShadow", True) - print "))" + sys.stdout = sys.__stdout__ + return fs + +# If you actually run this script, it'll print out all the functions. +if __name__ == "__main__": + fs = {} + generate_texture_functions(fs); + for k, v in fs.iteritems(): + print v diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index 2def3efff56..3e221c0e5ff 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -68,7 +68,7 @@ static ir_dereference *read_record_ref(_mesa_glsl_parse_state *, s_list *); void _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, - const char *src) + const char *src, bool scan_for_protos) { s_expression *expr = s_expression::read_expression(state, src); if (expr == NULL) { @@ -76,9 +76,11 @@ _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, return; } - scan_for_prototypes(state, instructions, expr); - if (state->error) - return; + if (scan_for_protos) { + scan_for_prototypes(state, instructions, expr); + if (state->error) + return; + } read_instructions(state, instructions, expr, NULL); talloc_free(expr); @@ -276,7 +278,12 @@ read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list, } ir_function_signature *sig = f->exact_matching_signature(&hir_parameters); - if (sig != NULL) { + if (sig == NULL && skip_body) { + /* If scanning for prototypes, generate a new signature. */ + sig = new(ctx) ir_function_signature(return_type); + sig->is_built_in = true; + f->add_signature(sig); + } else if (sig != NULL) { const char *badvar = sig->qualifiers_match(&hir_parameters); if (badvar != NULL) { ir_read_error(st, list, "function `%s' parameter `%s' qualifiers " @@ -290,10 +297,11 @@ read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list, return; } } else { - sig = new(ctx) ir_function_signature(return_type); - sig->is_built_in = true; - f->add_signature(sig); + /* No prototype for this body exists - skip it. */ + st->symbols->pop_scope(); + return; } + assert(sig != NULL); sig->replace_parameters(&hir_parameters); diff --git a/src/glsl/ir_reader.h b/src/glsl/ir_reader.h index b6afdc81ab1..aef2ca23bd2 100644 --- a/src/glsl/ir_reader.h +++ b/src/glsl/ir_reader.h @@ -29,6 +29,6 @@ #include "ir.h" void _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, - const char *src); + const char *src, bool scan_for_prototypes); #endif /* IR_READER_H */ -- cgit v1.2.3 From 2f9ecc818d67b8ea7496fd1dd0cb8bc7b9f8f8a4 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 16 Aug 2010 15:14:04 -0700 Subject: glsl2: Add builtins profile for GLSL 1.30. Many functions are currently wrapped with #if 0 since we haven't implemented them yet. --- src/glsl/builtins/profiles/130.frag | 999 ++++++++++++++++++++++++++++++++++++ src/glsl/builtins/profiles/130.vert | 987 +++++++++++++++++++++++++++++++++++ 2 files changed, 1986 insertions(+) create mode 100644 src/glsl/builtins/profiles/130.frag create mode 100644 src/glsl/builtins/profiles/130.vert (limited to 'src/glsl/builtins') diff --git a/src/glsl/builtins/profiles/130.frag b/src/glsl/builtins/profiles/130.frag new file mode 100644 index 00000000000..39c73c4eefa --- /dev/null +++ b/src/glsl/builtins/profiles/130.frag @@ -0,0 +1,999 @@ +#version 130 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); +int abs(int x); +ivec2 abs(ivec2 x); +ivec3 abs(ivec3 x); +ivec4 abs(ivec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); +int sign(int x); +ivec2 sign(ivec2 x); +ivec3 sign(ivec3 x); +ivec4 sign(ivec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +int min(int x, int y); +ivec2 min(ivec2 x, ivec2 y); +ivec3 min(ivec3 x, ivec3 y); +ivec4 min(ivec4 x, ivec4 y); + +ivec2 min(ivec2 x, int y); +ivec3 min(ivec3 x, int y); +ivec4 min(ivec4 x, int y); + +uint min(uint x, uint y); +uvec2 min(uvec2 x, uvec2 y); +uvec3 min(uvec3 x, uvec3 y); +uvec4 min(uvec4 x, uvec4 y); + +uvec2 min(uvec2 x, uint y); +uvec3 min(uvec3 x, uint y); +uvec4 min(uvec4 x, uint y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +int max(int x, int y); +ivec2 max(ivec2 x, ivec2 y); +ivec3 max(ivec3 x, ivec3 y); +ivec4 max(ivec4 x, ivec4 y); + +ivec2 max(ivec2 x, int y); +ivec3 max(ivec3 x, int y); +ivec4 max(ivec4 x, int y); + +uint max(uint x, uint y); +uvec2 max(uvec2 x, uvec2 y); +uvec3 max(uvec3 x, uvec3 y); +uvec4 max(uvec4 x, uvec4 y); + +uvec2 max(uvec2 x, uint y); +uvec3 max(uvec3 x, uint y); +uvec4 max(uvec4 x, uint y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +int clamp(int x, int minVal, int maxVal); +ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal); +ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal); +ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal); + +ivec2 clamp(ivec2 x, int minVal, int maxVal); +ivec3 clamp(ivec3 x, int minVal, int maxVal); +ivec4 clamp(ivec4 x, int minVal, int maxVal); + +uint clamp(uint x, uint minVal, uint maxVal); +uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal); +uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal); +uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal); + +uvec2 clamp(uvec2 x, uint minVal, uint maxVal); +uvec3 clamp(uvec3 x, uint minVal, uint maxVal); +uvec4 clamp(uvec4 x, uint minVal, uint maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +#if 0 +bool isnan(float x); +bvec2 isnan(vec2 x); +bvec3 isnan(vec3 x); +bvec4 isnan(vec4 x); + +bool isinf(float x); +bvec2 isinf(vec2 x); +bvec3 isinf(vec3 x); +bvec4 isinf(vec4 x); +#endif + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); +bvec2 lessThan(uvec2 x, uvec2 y); +bvec3 lessThan(uvec3 x, uvec3 y); +bvec4 lessThan(uvec4 x, uvec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); +bvec2 lessThanEqual(uvec2 x, uvec2 y); +bvec3 lessThanEqual(uvec3 x, uvec3 y); +bvec4 lessThanEqual(uvec4 x, uvec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); +bvec2 greaterThan(uvec2 x, uvec2 y); +bvec3 greaterThan(uvec3 x, uvec3 y); +bvec4 greaterThan(uvec4 x, uvec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); +bvec2 greaterThanEqual(uvec2 x, uvec2 y); +bvec3 greaterThanEqual(uvec3 x, uvec3 y); +bvec4 greaterThanEqual(uvec4 x, uvec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(uvec2 x, uvec2 y); +bvec3 equal(uvec3 x, uvec3 y); +bvec4 equal(uvec4 x, uvec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(uvec2 x, uvec2 y); +bvec3 notEqual(uvec3 x, uvec3 y); +bvec4 notEqual(uvec4 x, uvec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ + +#if 0 +/* textureSize */ +int textureSize( sampler1D sampler, int lod); +int textureSize(isampler1D sampler, int lod); +int textureSize(usampler1D sampler, int lod); + +ivec2 textureSize( sampler2D sampler, int lod); +ivec2 textureSize(isampler2D sampler, int lod); +ivec2 textureSize(usampler2D sampler, int lod); + +ivec3 textureSize( sampler3D sampler, int lod); +ivec3 textureSize(isampler3D sampler, int lod); +ivec3 textureSize(usampler3D sampler, int lod); + +ivec2 textureSize( samplerCube sampler, int lod); +ivec2 textureSize(isamplerCube sampler, int lod); +ivec2 textureSize(usamplerCube sampler, int lod); + +int textureSize(sampler1DShadow sampler, int lod); +ivec2 textureSize(sampler2DShadow sampler, int lod); +ivec2 textureSize(samplerCubeShadow sampler, int lod); + +ivec2 textureSize( sampler1DArray sampler, int lod); +ivec2 textureSize(isampler1DArray sampler, int lod); +ivec2 textureSize(usampler1DArray sampler, int lod); +ivec3 textureSize( sampler2DArray sampler, int lod); +ivec2 textureSize(isampler2DArray sampler, int lod); +ivec2 textureSize(usampler2DArray sampler, int lod); + +ivec2 textureSize(sampler1DArrayShadow sampler, int lod); +ivec3 textureSize(sampler2DArrayShadow sampler, int lod); +#endif + +/* texture - no bias */ + vec4 texture( sampler1D sampler, float P); +ivec4 texture(isampler1D sampler, float P); +uvec4 texture(usampler1D sampler, float P); + + vec4 texture( sampler2D sampler, vec2 P); +ivec4 texture(isampler2D sampler, vec2 P); +uvec4 texture(usampler2D sampler, vec2 P); + + vec4 texture( sampler3D sampler, vec3 P); +ivec4 texture(isampler3D sampler, vec3 P); +uvec4 texture(usampler3D sampler, vec3 P); + + vec4 texture( samplerCube sampler, vec3 P); +ivec4 texture(isamplerCube sampler, vec3 P); +uvec4 texture(usamplerCube sampler, vec3 P); + +float texture(sampler1DShadow sampler, vec3 P); +float texture(sampler2DShadow sampler, vec3 P); +float texture(samplerCubeShadow sampler, vec4 P); + + vec4 texture( sampler1DArray sampler, vec2 P); +ivec4 texture(isampler1DArray sampler, vec2 P); +uvec4 texture(usampler1DArray sampler, vec2 P); + + vec4 texture( sampler2DArray sampler, vec3 P); +ivec4 texture(isampler2DArray sampler, vec3 P); +uvec4 texture(usampler2DArray sampler, vec3 P); + +float texture(sampler1DArrayShadow sampler, vec3 P); +float texture(sampler2DArrayShadow sampler, vec4 P); + +/* texture - bias variants */ + vec4 texture( sampler1D sampler, float P, float bias); +ivec4 texture(isampler1D sampler, float P, float bias); +uvec4 texture(usampler1D sampler, float P, float bias); + + vec4 texture( sampler2D sampler, vec2 P, float bias); +ivec4 texture(isampler2D sampler, vec2 P, float bias); +uvec4 texture(usampler2D sampler, vec2 P, float bias); + + vec4 texture( sampler3D sampler, vec3 P, float bias); +ivec4 texture(isampler3D sampler, vec3 P, float bias); +uvec4 texture(usampler3D sampler, vec3 P, float bias); + + vec4 texture( samplerCube sampler, vec3 P, float bias); +ivec4 texture(isamplerCube sampler, vec3 P, float bias); +uvec4 texture(usamplerCube sampler, vec3 P, float bias); + +float texture(sampler1DShadow sampler, vec3 P, float bias); +float texture(sampler2DShadow sampler, vec3 P, float bias); +float texture(samplerCubeShadow sampler, vec4 P, float bias); + + vec4 texture( sampler1DArray sampler, vec2 P, float bias); +ivec4 texture(isampler1DArray sampler, vec2 P, float bias); +uvec4 texture(usampler1DArray sampler, vec2 P, float bias); + + vec4 texture( sampler2DArray sampler, vec3 P, float bias); +ivec4 texture(isampler2DArray sampler, vec3 P, float bias); +uvec4 texture(usampler2DArray sampler, vec3 P, float bias); + +float texture(sampler1DArrayShadow sampler, vec3 P, float bias); + +/* textureProj - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P); +ivec4 textureProj(isampler1D sampler, vec2 P); +uvec4 textureProj(usampler1D sampler, vec2 P); + vec4 textureProj( sampler1D sampler, vec4 P); +ivec4 textureProj(isampler1D sampler, vec4 P); +uvec4 textureProj(usampler1D sampler, vec4 P); + + vec4 textureProj( sampler2D sampler, vec3 P); +ivec4 textureProj(isampler2D sampler, vec3 P); +uvec4 textureProj(usampler2D sampler, vec3 P); + vec4 textureProj( sampler2D sampler, vec4 P); +ivec4 textureProj(isampler2D sampler, vec4 P); +uvec4 textureProj(usampler2D sampler, vec4 P); + + vec4 textureProj( sampler3D sampler, vec4 P); +ivec4 textureProj(isampler3D sampler, vec4 P); +uvec4 textureProj(usampler3D sampler, vec4 P); + +float textureProj(sampler1DShadow sampler, vec4 P); +float textureProj(sampler2DShadow sampler, vec4 P); + +/* textureProj - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, float bias); + +/* textureLod */ + vec4 textureLod( sampler1D sampler, float P, float lod); +ivec4 textureLod(isampler1D sampler, float P, float lod); +uvec4 textureLod(usampler1D sampler, float P, float lod); + + vec4 textureLod( sampler2D sampler, vec2 P, float lod); +ivec4 textureLod(isampler2D sampler, vec2 P, float lod); +uvec4 textureLod(usampler2D sampler, vec2 P, float lod); + + vec4 textureLod( sampler3D sampler, vec3 P, float lod); +ivec4 textureLod(isampler3D sampler, vec3 P, float lod); +uvec4 textureLod(usampler3D sampler, vec3 P, float lod); + + vec4 textureLod( samplerCube sampler, vec3 P, float lod); +ivec4 textureLod(isamplerCube sampler, vec3 P, float lod); +uvec4 textureLod(usamplerCube sampler, vec3 P, float lod); + +float textureLod(sampler1DShadow sampler, vec3 P, float lod); +float textureLod(sampler2DShadow sampler, vec3 P, float lod); + + vec4 textureLod( sampler1DArray sampler, vec2 P, float lod); +ivec4 textureLod(isampler1DArray sampler, vec2 P, float lod); +uvec4 textureLod(usampler1DArray sampler, vec2 P, float lod); + + vec4 textureLod( sampler2DArray sampler, vec3 P, float lod); +ivec4 textureLod(isampler2DArray sampler, vec3 P, float lod); +uvec4 textureLod(usampler2DArray sampler, vec3 P, float lod); + +float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod); + +#if 0 +/* textureOffset - no bias */ + vec4 textureOffset( sampler1D sampler, float P, int offset); +ivec4 textureOffset(isampler1D sampler, float P, int offset); +uvec4 textureOffset(usampler1D sampler, float P, int offset); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset); + +float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset); + +/* textureOffset - bias variants */ + vec4 textureOffset( sampler1D sampler, float P, int offset, float bias); +ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias); +uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset, float bias); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset, float bias); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset, float bias); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset, float bias); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset, float bias); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset, float bias); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset, float bias); + +float textureOffset(sampler1DArrayShadow samp, vec3 P, int offset, float bias); +#endif + +/* texelFetch */ + vec4 texelFetch( sampler1D sampler, int P, int lod); +ivec4 texelFetch(isampler1D sampler, int P, int lod); +uvec4 texelFetch(usampler1D sampler, int P, int lod); + + vec4 texelFetch( sampler2D sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler2D sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler2D sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler3D sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler3D sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler3D sampler, ivec3 P, int lod); + + vec4 texelFetch( sampler1DArray sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler1DArray sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler1DArray sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler2DArray sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler2DArray sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler2DArray sampler, ivec3 P, int lod); + +#if 0 +/* texelFetchOffset */ + vec4 texelFetchOffset( sampler1D sampler, int P, int lod, int offset); +ivec4 texelFetchOffset(isampler1D sampler, int P, int lod, int offset); +uvec4 texelFetchOffset(usampler1D sampler, int P, int lod, int offset); + + vec4 texelFetchOffset( sampler2D sampler, ivec2 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2D sampler, ivec2 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2D sampler, ivec2 P, int lod, ivec2 offset); + + vec4 texelFetchOffset( sampler3D sampler, ivec3 P, int lod, ivec3 offset); +ivec4 texelFetchOffset(isampler3D sampler, ivec3 P, int lod, ivec3 offset); +uvec4 texelFetchOffset(usampler3D sampler, ivec3 P, int lod, ivec3 offset); + + vec4 texelFetchOffset( sampler1DArray sampler, ivec2 P, int lod, int offset); +ivec4 texelFetchOffset(isampler1DArray sampler, ivec2 P, int lod, int offset); +uvec4 texelFetchOffset(usampler1DArray sampler, ivec2 P, int lod, int offset); + + vec4 texelFetchOffset( sampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2DArray sampler, ivec3 P, int lod, ivec2 offset); + +/* textureProjOffset - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset); + vec4 textureProj( sampler1D sampler, vec4 P, int offset); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset); + +/* textureProjOffset - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset, float bias); + +/* textureLodOffset */ + vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); +ivec4 textureLodOffset(isampler1D sampler, float P, float lod, int offset); +uvec4 textureLodOffset(usampler1D sampler, float P, float lod, int offset); + + vec4 textureLodOffset( sampler2D sampler, vec2 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2D sampler, vec2 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2D sampler, vec2 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler3D sampler, vec3 P, float lod, ivec3 offset); +ivec4 textureLodOffset(isampler3D sampler, vec3 P, float lod, ivec3 offset); +uvec4 textureLodOffset(usampler3D sampler, vec3 P, float lod, ivec3 offset); + +float textureLodOffset(sampler1DShadow samp, vec3 P, float lod, int offset); +float textureLodOffset(sampler2DShadow samp, vec3 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler1DArray sampler, vec2 P, float lod, int offset); +ivec4 textureLodOffset(isampler1DArray sampler, vec2 P, float lod, int offset); +uvec4 textureLodOffset(usampler1DArray sampler, vec2 P, float lod, int offset); + + vec4 textureLodOffset( sampler2DArray samp, vec3 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2DArray samp, vec3 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2DArray samp, vec3 P, float lod, ivec2 offset); + +float textureLodOffset(sampler1DArrayShadow s, vec3 P, float lod, int offset); +#endif + +/* textureProjLod */ + vec4 textureProjLod( sampler1D sampler, vec2 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec2 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec2 P, float lod); + vec4 textureProjLod( sampler1D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler2D sampler, vec3 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec3 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec3 P, float lod); + vec4 textureProjLod( sampler2D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler3D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler3D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler3D sampler, vec4 P, float lod); + +float textureProjLod(sampler1DShadow sampler, vec4 P, float lod); +float textureProjLod(sampler2DShadow sampler, vec4 P, float lod); + +#if 0 +/* textureProjLodOffset */ + vec4 textureProjLodOffset( sampler1D sampler, vec2 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec2 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec2 P, float lod, int offset); + vec4 textureProjLodOffset( sampler1D sampler, vec4 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec4 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec4 P, float lod, int offset); + + vec4 textureProjLodOffset( sampler2D sampler, vec3 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec3 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec3 P, float lod, ivec2 offset); + vec4 textureProjLodOffset( sampler2D sampler, vec4 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec4 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec4 P, float lod, ivec2 offset); + + vec4 textureProjLodOffset( sampler3D sampler, vec4 P, float lod, ivec3 offset); +ivec4 textureProjLodOffset(isampler3D sampler, vec4 P, float lod, ivec3 offset); +uvec4 textureProjLodOffset(usampler3D sampler, vec4 P, float lod, ivec3 offset); + +float textureProjLodOffset(sampler1DShadow s, vec4 P, float lod, int offset); +float textureProjLodOffset(sampler2DShadow s, vec4 P, float lod, ivec2 offset); +#endif + +/* textureGrad */ + vec4 textureGrad( sampler1D sampler, float P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1D sampler, float P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1D sampler, float P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); + + vec4 textureGrad( sampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( samplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); + +float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); +float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( sampler1DArray sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1DArray sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1DArray sampler, vec2 P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); + +float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureGradOffset */ + vec4 textureGradOffset( sampler1D s, float P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1D s, float P, float dx, float dy, int offset); +uvec4 textureGradOffset(usampler1D s, float P, float dx, float dy, int offset); + + vec4 textureGradOffset( sampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +ivec4 textureGradOffset(isampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +uvec4 textureGradOffset(usampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); + + vec4 textureGradOffset( sampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + + vec4 textureGradOffset( samplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + +float textureGradOffset(sampler1DShadow s, vec3 P, float dx, float dy, int off); +float textureGradOffset(sampler2DShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureGradOffset( sampler1DArray s, vec2 P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1DArray s, vec2 P, float dx, float dy, int off); +uvec4 textureGradOffset(usampler1DArray s, vec2 P, float dx, float dy, int off); + + vec4 textureGradOffset( sampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureGradOffset(isampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureGradOffset(usampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + +float textureGradOffset(sampler1DArrayShadow s, vec3 P, float dx, float dy, int o); +float textureGradOffset(sampler2DArrayShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); +#endif + +/* textureProjGrad */ + vec4 textureProjGrad( sampler1D sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec2 P, float dPdx, float dPdy); + vec4 textureProjGrad( sampler1D sampler, vec4 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec4 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec4 P, float dPdx, float dPdy); + + vec4 textureProjGrad( sampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); + vec4 textureProjGrad( sampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); + + vec4 textureProjGrad( sampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +ivec4 textureProjGrad(isampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +uvec4 textureProjGrad(usampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); + +float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy); +float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureProjGradOffset */ + vec4 textureProjGradOffset( sampler1D s, vec2 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec2 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec2 P, float dx, float dy, int off); + vec4 textureProjGradOffset( sampler1D s, vec4 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec4 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec4 P, float dx, float dy, int off); + + vec4 textureProjGradOffset( sampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + vec4 textureProjGradOffset( sampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); + +float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o); +float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o); +#endif + +/* + * The following texture functions are deprecated: + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/130.vert b/src/glsl/builtins/profiles/130.vert new file mode 100644 index 00000000000..1aaad190d59 --- /dev/null +++ b/src/glsl/builtins/profiles/130.vert @@ -0,0 +1,987 @@ +#version 130 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); +int abs(int x); +ivec2 abs(ivec2 x); +ivec3 abs(ivec3 x); +ivec4 abs(ivec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); +int sign(int x); +ivec2 sign(ivec2 x); +ivec3 sign(ivec3 x); +ivec4 sign(ivec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +int min(int x, int y); +ivec2 min(ivec2 x, ivec2 y); +ivec3 min(ivec3 x, ivec3 y); +ivec4 min(ivec4 x, ivec4 y); + +ivec2 min(ivec2 x, int y); +ivec3 min(ivec3 x, int y); +ivec4 min(ivec4 x, int y); + +uint min(uint x, uint y); +uvec2 min(uvec2 x, uvec2 y); +uvec3 min(uvec3 x, uvec3 y); +uvec4 min(uvec4 x, uvec4 y); + +uvec2 min(uvec2 x, uint y); +uvec3 min(uvec3 x, uint y); +uvec4 min(uvec4 x, uint y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +int max(int x, int y); +ivec2 max(ivec2 x, ivec2 y); +ivec3 max(ivec3 x, ivec3 y); +ivec4 max(ivec4 x, ivec4 y); + +ivec2 max(ivec2 x, int y); +ivec3 max(ivec3 x, int y); +ivec4 max(ivec4 x, int y); + +uint max(uint x, uint y); +uvec2 max(uvec2 x, uvec2 y); +uvec3 max(uvec3 x, uvec3 y); +uvec4 max(uvec4 x, uvec4 y); + +uvec2 max(uvec2 x, uint y); +uvec3 max(uvec3 x, uint y); +uvec4 max(uvec4 x, uint y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +int clamp(int x, int minVal, int maxVal); +ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal); +ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal); +ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal); + +ivec2 clamp(ivec2 x, int minVal, int maxVal); +ivec3 clamp(ivec3 x, int minVal, int maxVal); +ivec4 clamp(ivec4 x, int minVal, int maxVal); + +uint clamp(uint x, uint minVal, uint maxVal); +uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal); +uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal); +uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal); + +uvec2 clamp(uvec2 x, uint minVal, uint maxVal); +uvec3 clamp(uvec3 x, uint minVal, uint maxVal); +uvec4 clamp(uvec4 x, uint minVal, uint maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +#if 0 +bool isnan(float x); +bvec2 isnan(vec2 x); +bvec3 isnan(vec3 x); +bvec4 isnan(vec4 x); + +bool isinf(float x); +bvec2 isinf(vec2 x); +bvec3 isinf(vec3 x); +bvec4 isinf(vec4 x); +#endif + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); +bvec2 lessThan(uvec2 x, uvec2 y); +bvec3 lessThan(uvec3 x, uvec3 y); +bvec4 lessThan(uvec4 x, uvec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); +bvec2 lessThanEqual(uvec2 x, uvec2 y); +bvec3 lessThanEqual(uvec3 x, uvec3 y); +bvec4 lessThanEqual(uvec4 x, uvec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); +bvec2 greaterThan(uvec2 x, uvec2 y); +bvec3 greaterThan(uvec3 x, uvec3 y); +bvec4 greaterThan(uvec4 x, uvec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); +bvec2 greaterThanEqual(uvec2 x, uvec2 y); +bvec3 greaterThanEqual(uvec3 x, uvec3 y); +bvec4 greaterThanEqual(uvec4 x, uvec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(uvec2 x, uvec2 y); +bvec3 equal(uvec3 x, uvec3 y); +bvec4 equal(uvec4 x, uvec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(uvec2 x, uvec2 y); +bvec3 notEqual(uvec3 x, uvec3 y); +bvec4 notEqual(uvec4 x, uvec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ + +#if 0 +/* textureSize */ +int textureSize( sampler1D sampler, int lod); +int textureSize(isampler1D sampler, int lod); +int textureSize(usampler1D sampler, int lod); + +ivec2 textureSize( sampler2D sampler, int lod); +ivec2 textureSize(isampler2D sampler, int lod); +ivec2 textureSize(usampler2D sampler, int lod); + +ivec3 textureSize( sampler3D sampler, int lod); +ivec3 textureSize(isampler3D sampler, int lod); +ivec3 textureSize(usampler3D sampler, int lod); + +ivec2 textureSize( samplerCube sampler, int lod); +ivec2 textureSize(isamplerCube sampler, int lod); +ivec2 textureSize(usamplerCube sampler, int lod); + +int textureSize(sampler1DShadow sampler, int lod); +ivec2 textureSize(sampler2DShadow sampler, int lod); +ivec2 textureSize(samplerCubeShadow sampler, int lod); + +ivec2 textureSize( sampler1DArray sampler, int lod); +ivec2 textureSize(isampler1DArray sampler, int lod); +ivec2 textureSize(usampler1DArray sampler, int lod); +ivec3 textureSize( sampler2DArray sampler, int lod); +ivec2 textureSize(isampler2DArray sampler, int lod); +ivec2 textureSize(usampler2DArray sampler, int lod); + +ivec2 textureSize(sampler1DArrayShadow sampler, int lod); +ivec3 textureSize(sampler2DArrayShadow sampler, int lod); +#endif + +/* texture - no bias */ + vec4 texture( sampler1D sampler, float P); +ivec4 texture(isampler1D sampler, float P); +uvec4 texture(usampler1D sampler, float P); + + vec4 texture( sampler2D sampler, vec2 P); +ivec4 texture(isampler2D sampler, vec2 P); +uvec4 texture(usampler2D sampler, vec2 P); + + vec4 texture( sampler3D sampler, vec3 P); +ivec4 texture(isampler3D sampler, vec3 P); +uvec4 texture(usampler3D sampler, vec3 P); + + vec4 texture( samplerCube sampler, vec3 P); +ivec4 texture(isamplerCube sampler, vec3 P); +uvec4 texture(usamplerCube sampler, vec3 P); + +float texture(sampler1DShadow sampler, vec3 P); +float texture(sampler2DShadow sampler, vec3 P); +float texture(samplerCubeShadow sampler, vec4 P); + + vec4 texture( sampler1DArray sampler, vec2 P); +ivec4 texture(isampler1DArray sampler, vec2 P); +uvec4 texture(usampler1DArray sampler, vec2 P); + + vec4 texture( sampler2DArray sampler, vec3 P); +ivec4 texture(isampler2DArray sampler, vec3 P); +uvec4 texture(usampler2DArray sampler, vec3 P); + +float texture(sampler1DArrayShadow sampler, vec3 P); +float texture(sampler2DArrayShadow sampler, vec4 P); + +/* texture - bias variants */ + vec4 texture( sampler1D sampler, float P, float bias); +ivec4 texture(isampler1D sampler, float P, float bias); +uvec4 texture(usampler1D sampler, float P, float bias); + + vec4 texture( sampler2D sampler, vec2 P, float bias); +ivec4 texture(isampler2D sampler, vec2 P, float bias); +uvec4 texture(usampler2D sampler, vec2 P, float bias); + + vec4 texture( sampler3D sampler, vec3 P, float bias); +ivec4 texture(isampler3D sampler, vec3 P, float bias); +uvec4 texture(usampler3D sampler, vec3 P, float bias); + + vec4 texture( samplerCube sampler, vec3 P, float bias); +ivec4 texture(isamplerCube sampler, vec3 P, float bias); +uvec4 texture(usamplerCube sampler, vec3 P, float bias); + +float texture(sampler1DShadow sampler, vec3 P, float bias); +float texture(sampler2DShadow sampler, vec3 P, float bias); +float texture(samplerCubeShadow sampler, vec4 P, float bias); + + vec4 texture( sampler1DArray sampler, vec2 P, float bias); +ivec4 texture(isampler1DArray sampler, vec2 P, float bias); +uvec4 texture(usampler1DArray sampler, vec2 P, float bias); + + vec4 texture( sampler2DArray sampler, vec3 P, float bias); +ivec4 texture(isampler2DArray sampler, vec3 P, float bias); +uvec4 texture(usampler2DArray sampler, vec3 P, float bias); + +float texture(sampler1DArrayShadow sampler, vec3 P, float bias); + +/* textureProj - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P); +ivec4 textureProj(isampler1D sampler, vec2 P); +uvec4 textureProj(usampler1D sampler, vec2 P); + vec4 textureProj( sampler1D sampler, vec4 P); +ivec4 textureProj(isampler1D sampler, vec4 P); +uvec4 textureProj(usampler1D sampler, vec4 P); + + vec4 textureProj( sampler2D sampler, vec3 P); +ivec4 textureProj(isampler2D sampler, vec3 P); +uvec4 textureProj(usampler2D sampler, vec3 P); + vec4 textureProj( sampler2D sampler, vec4 P); +ivec4 textureProj(isampler2D sampler, vec4 P); +uvec4 textureProj(usampler2D sampler, vec4 P); + + vec4 textureProj( sampler3D sampler, vec4 P); +ivec4 textureProj(isampler3D sampler, vec4 P); +uvec4 textureProj(usampler3D sampler, vec4 P); + +float textureProj(sampler1DShadow sampler, vec4 P); +float textureProj(sampler2DShadow sampler, vec4 P); + +/* textureProj - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, float bias); + +/* textureLod */ + vec4 textureLod( sampler1D sampler, float P, float lod); +ivec4 textureLod(isampler1D sampler, float P, float lod); +uvec4 textureLod(usampler1D sampler, float P, float lod); + + vec4 textureLod( sampler2D sampler, vec2 P, float lod); +ivec4 textureLod(isampler2D sampler, vec2 P, float lod); +uvec4 textureLod(usampler2D sampler, vec2 P, float lod); + + vec4 textureLod( sampler3D sampler, vec3 P, float lod); +ivec4 textureLod(isampler3D sampler, vec3 P, float lod); +uvec4 textureLod(usampler3D sampler, vec3 P, float lod); + + vec4 textureLod( samplerCube sampler, vec3 P, float lod); +ivec4 textureLod(isamplerCube sampler, vec3 P, float lod); +uvec4 textureLod(usamplerCube sampler, vec3 P, float lod); + +float textureLod(sampler1DShadow sampler, vec3 P, float lod); +float textureLod(sampler2DShadow sampler, vec3 P, float lod); + + vec4 textureLod( sampler1DArray sampler, vec2 P, float lod); +ivec4 textureLod(isampler1DArray sampler, vec2 P, float lod); +uvec4 textureLod(usampler1DArray sampler, vec2 P, float lod); + + vec4 textureLod( sampler2DArray sampler, vec3 P, float lod); +ivec4 textureLod(isampler2DArray sampler, vec3 P, float lod); +uvec4 textureLod(usampler2DArray sampler, vec3 P, float lod); + +float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod); + +#if 0 +/* textureOffset - no bias */ + vec4 textureOffset( sampler1D sampler, float P, int offset); +ivec4 textureOffset(isampler1D sampler, float P, int offset); +uvec4 textureOffset(usampler1D sampler, float P, int offset); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset); + +float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset); + +/* textureOffset - bias variants */ + vec4 textureOffset( sampler1D sampler, float P, int offset, float bias); +ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias); +uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset, float bias); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset, float bias); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset, float bias); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset, float bias); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset, float bias); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset, float bias); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset, float bias); + +float textureOffset(sampler1DArrayShadow samp, vec3 P, int offset, float bias); +#endif + +/* texelFetch */ + vec4 texelFetch( sampler1D sampler, int P, int lod); +ivec4 texelFetch(isampler1D sampler, int P, int lod); +uvec4 texelFetch(usampler1D sampler, int P, int lod); + + vec4 texelFetch( sampler2D sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler2D sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler2D sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler3D sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler3D sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler3D sampler, ivec3 P, int lod); + + vec4 texelFetch( sampler1DArray sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler1DArray sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler1DArray sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler2DArray sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler2DArray sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler2DArray sampler, ivec3 P, int lod); + +#if 0 +/* texelFetchOffset */ + vec4 texelFetchOffset( sampler1D sampler, int P, int lod, int offset); +ivec4 texelFetchOffset(isampler1D sampler, int P, int lod, int offset); +uvec4 texelFetchOffset(usampler1D sampler, int P, int lod, int offset); + + vec4 texelFetchOffset( sampler2D sampler, ivec2 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2D sampler, ivec2 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2D sampler, ivec2 P, int lod, ivec2 offset); + + vec4 texelFetchOffset( sampler3D sampler, ivec3 P, int lod, ivec3 offset); +ivec4 texelFetchOffset(isampler3D sampler, ivec3 P, int lod, ivec3 offset); +uvec4 texelFetchOffset(usampler3D sampler, ivec3 P, int lod, ivec3 offset); + + vec4 texelFetchOffset( sampler1DArray sampler, ivec2 P, int lod, int offset); +ivec4 texelFetchOffset(isampler1DArray sampler, ivec2 P, int lod, int offset); +uvec4 texelFetchOffset(usampler1DArray sampler, ivec2 P, int lod, int offset); + + vec4 texelFetchOffset( sampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2DArray sampler, ivec3 P, int lod, ivec2 offset); + +/* textureProjOffset - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset); + vec4 textureProj( sampler1D sampler, vec4 P, int offset); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset); + +/* textureProjOffset - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset, float bias); + +/* textureLodOffset */ + vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); +ivec4 textureLodOffset(isampler1D sampler, float P, float lod, int offset); +uvec4 textureLodOffset(usampler1D sampler, float P, float lod, int offset); + + vec4 textureLodOffset( sampler2D sampler, vec2 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2D sampler, vec2 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2D sampler, vec2 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler3D sampler, vec3 P, float lod, ivec3 offset); +ivec4 textureLodOffset(isampler3D sampler, vec3 P, float lod, ivec3 offset); +uvec4 textureLodOffset(usampler3D sampler, vec3 P, float lod, ivec3 offset); + +float textureLodOffset(sampler1DShadow samp, vec3 P, float lod, int offset); +float textureLodOffset(sampler2DShadow samp, vec3 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler1DArray sampler, vec2 P, float lod, int offset); +ivec4 textureLodOffset(isampler1DArray sampler, vec2 P, float lod, int offset); +uvec4 textureLodOffset(usampler1DArray sampler, vec2 P, float lod, int offset); + + vec4 textureLodOffset( sampler2DArray samp, vec3 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2DArray samp, vec3 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2DArray samp, vec3 P, float lod, ivec2 offset); + +float textureLodOffset(sampler1DArrayShadow s, vec3 P, float lod, int offset); +#endif + +/* textureProjLod */ + vec4 textureProjLod( sampler1D sampler, vec2 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec2 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec2 P, float lod); + vec4 textureProjLod( sampler1D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler2D sampler, vec3 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec3 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec3 P, float lod); + vec4 textureProjLod( sampler2D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler3D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler3D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler3D sampler, vec4 P, float lod); + +float textureProjLod(sampler1DShadow sampler, vec4 P, float lod); +float textureProjLod(sampler2DShadow sampler, vec4 P, float lod); + +#if 0 +/* textureProjLodOffset */ + vec4 textureProjLodOffset( sampler1D sampler, vec2 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec2 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec2 P, float lod, int offset); + vec4 textureProjLodOffset( sampler1D sampler, vec4 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec4 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec4 P, float lod, int offset); + + vec4 textureProjLodOffset( sampler2D sampler, vec3 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec3 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec3 P, float lod, ivec2 offset); + vec4 textureProjLodOffset( sampler2D sampler, vec4 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec4 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec4 P, float lod, ivec2 offset); + + vec4 textureProjLodOffset( sampler3D sampler, vec4 P, float lod, ivec3 offset); +ivec4 textureProjLodOffset(isampler3D sampler, vec4 P, float lod, ivec3 offset); +uvec4 textureProjLodOffset(usampler3D sampler, vec4 P, float lod, ivec3 offset); + +float textureProjLodOffset(sampler1DShadow s, vec4 P, float lod, int offset); +float textureProjLodOffset(sampler2DShadow s, vec4 P, float lod, ivec2 offset); +#endif + +/* textureGrad */ + vec4 textureGrad( sampler1D sampler, float P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1D sampler, float P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1D sampler, float P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); + + vec4 textureGrad( sampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( samplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); + +float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); +float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( sampler1DArray sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1DArray sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1DArray sampler, vec2 P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); + +float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureGradOffset */ + vec4 textureGradOffset( sampler1D s, float P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1D s, float P, float dx, float dy, int offset); +uvec4 textureGradOffset(usampler1D s, float P, float dx, float dy, int offset); + + vec4 textureGradOffset( sampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +ivec4 textureGradOffset(isampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +uvec4 textureGradOffset(usampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); + + vec4 textureGradOffset( sampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + + vec4 textureGradOffset( samplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + +float textureGradOffset(sampler1DShadow s, vec3 P, float dx, float dy, int off); +float textureGradOffset(sampler2DShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureGradOffset( sampler1DArray s, vec2 P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1DArray s, vec2 P, float dx, float dy, int off); +uvec4 textureGradOffset(usampler1DArray s, vec2 P, float dx, float dy, int off); + + vec4 textureGradOffset( sampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureGradOffset(isampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureGradOffset(usampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + +float textureGradOffset(sampler1DArrayShadow s, vec3 P, float dx, float dy, int o); +float textureGradOffset(sampler2DArrayShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); +#endif + +/* textureProjGrad */ + vec4 textureProjGrad( sampler1D sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec2 P, float dPdx, float dPdy); + vec4 textureProjGrad( sampler1D sampler, vec4 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec4 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec4 P, float dPdx, float dPdy); + + vec4 textureProjGrad( sampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); + vec4 textureProjGrad( sampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); + + vec4 textureProjGrad( sampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +ivec4 textureProjGrad(isampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +uvec4 textureProjGrad(usampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); + +float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy); +float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureProjGradOffset */ + vec4 textureProjGradOffset( sampler1D s, vec2 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec2 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec2 P, float dx, float dy, int off); + vec4 textureProjGradOffset( sampler1D s, vec4 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec4 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec4 P, float dx, float dy, int off); + + vec4 textureProjGradOffset( sampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + vec4 textureProjGradOffset( sampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); + +float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o); +float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o); +#endif + +/* + * The following texture functions are deprecated: + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); -- cgit v1.2.3