diff options
author | Eric Anholt <[email protected]> | 2010-08-23 12:39:35 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-08-23 12:58:07 -0700 |
commit | 47003a8f653db881fbafc96fca93aba38ea3ebc2 (patch) | |
tree | 6397c7f628a341f4870a01affad95e7c0f8e9ab2 /src/glsl | |
parent | 66afcb560771b6ba6ad668156e9f442e86b9a7a2 (diff) |
glsl: Regenerate builtins with the new sorting.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/builtin_function.cpp | 10178 |
1 files changed, 5089 insertions, 5089 deletions
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp index b4138d0af76..517a6ad86d2 100644 --- a/src/glsl/builtin_function.cpp +++ b/src/glsl/builtin_function.cpp @@ -70,1222 +70,371 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne return sh; } -static const char *builtin_all = - "((function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n" - "\n" - " (signature bool\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" - "\n" - " (signature bool\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 *builtin_textureProj = - "((function textureProj\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 ivec4\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" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" - " (signature ivec4\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" - "\n" - " (signature uvec4\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" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" - " (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" - " (signature ivec4\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" - " (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" - "\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 ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (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" - "\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" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_fwidth = - "((function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float +\n" - " (expression float abs (expression float dFdx (var_ref p)))\n" - " (expression float abs (expression float dFdy (var_ref p)))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 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 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 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 *builtin_texture2DProj = - "((function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) 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 vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_shadow1DProjLod = - "((function shadow1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char *builtin_texture3DLod = - "((function texture3DLod\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" - "))\n" - "" -; -static const char *builtin_textureCubeLod = - "((function textureCubeLod\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" - "))\n" - "" -; -static const char *builtin_texture = - "((function texture\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" - " (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" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (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) 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 *builtin_degrees = - "((function degrees\n" +static const char *builtin_abs = + "((function abs\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (57.295780))))))\n" + " ((return (expression float abs (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (57.295780))))))\n" + " ((return (expression vec2 abs (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (57.295780))))))\n" + " ((return (expression vec3 abs (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (57.295780))))))\n" - "))\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" + " ((return (expression vec4 abs (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_ceil = - "((function ceil\n" +static const char *builtin_acos = + "((function acos\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float ceil (var_ref arg0)))))\n" - "\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 arg0))\n" - " ((return (expression vec2 ceil (var_ref arg0)))))\n" - "\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 arg0))\n" - " ((return (expression vec3 ceil (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 ceil (var_ref arg0)))))\n" - "))\n" - "" -; -static const char *builtin_texture1D = - "((function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 - (constant float (1.5707963))\n" + " (call asin ((var_ref x)))))))\n" " (signature vec4\n" " (parameters\n" - " (declare (in) 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" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 - (constant float (1.5707963))\n" + " (call asin ((var_ref x)))))))\n" "))\n" "" ; -static const char *builtin_not = - "((function not\n" - " (signature bvec2\n" +static const char *builtin_all = + "((function all\n" + " (signature bool\n" " (parameters\n" " (declare (in) bvec2 arg0))\n" - " ((return (expression bvec2 ! (var_ref arg0)))))\n" + " ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n" "\n" - " (signature bvec3\n" + " (signature bool\n" " (parameters\n" " (declare (in) bvec3 arg0))\n" - " ((return (expression bvec3 ! (var_ref 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 bvec4\n" + " (signature bool\n" " (parameters\n" " (declare (in) bvec4 arg0))\n" - " ((return (expression bvec4 ! (var_ref 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_texture2DRectProj = - "((function texture2DRectProj\n" - " (signature vec4\n" +static const char *builtin_any = + "((function any\n" + " (signature bool\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" + " (declare (in) bvec2 arg0))\n" + " ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n" "\n" - " (signature vec4\n" + " (signature bool\n" " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + " (declare (in) 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 bool\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 *builtin_mod = - "((function mod\n" +static const char *builtin_asin = + "((function asin\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" - " ((return (expression vec2 % (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 % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) float x))\n" + " ((return (expression float *\n" + " (expression float sign (var_ref x))\n" + " (expression float -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression float *\n" + " (expression float sqrt\n" + " (expression float -\n" + " (constant float (1.0))\n" + " (expression float abs (var_ref x))))\n" + " (expression float +\n" + " (constant float (1.5707288))\n" + " (expression float *\n" + " (expression float abs (var_ref x))\n" + " (expression float +\n" + " (constant float (-0.2121144))\n" + " (expression float *\n" + " (constant float (0.0742610))\n" + " (expression float abs (var_ref x))))))))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec2 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 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 *\n" + " (expression vec3 sign (var_ref x))\n" + " (expression vec3 -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression vec3 *\n" + " (expression vec3 sqrt\n" + " (expression vec3 -\n" + " (constant float (1.0))\n" + " (expression vec3 abs (var_ref x))))\n" + " (expression vec3 +\n" + " (constant float (1.5707288))\n" + " (expression vec3 *\n" + " (expression vec3 abs (var_ref x))\n" + " (expression vec3 +\n" + " (constant float (-0.2121144))\n" + " (expression vec3 *\n" + " (constant float (0.0742610))\n" + " (expression vec3 abs (var_ref x))))))))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 *\n" + " (expression vec4 sign (var_ref x))\n" + " (expression vec4 -\n" + " (expression float *\n" + " (constant float (3.1415926))\n" + " (constant float (0.5)))\n" + " (expression vec4 *\n" + " (expression vec4 sqrt\n" + " (expression vec4 -\n" + " (constant float (1.0))\n" + " (expression vec4 abs (var_ref x))))\n" + " (expression vec4 +\n" + " (constant float (1.5707288))\n" + " (expression vec4 *\n" + " (expression vec4 abs (var_ref x))\n" + " (expression vec4 +\n" + " (constant float (-0.2121144))\n" + " (expression vec4 *\n" + " (constant float (0.0742610))\n" + " (expression vec4 abs (var_ref x))))))))))))\n" "))\n" "" ; -static const char *builtin_radians = - "((function radians\n" +static const char *builtin_atan = + "((function atan\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (0.017453))))))\n" + " (declare (in) float x))\n" + " ((return (call asin ((expression float *\n" + " (var_ref x)\n" + " (expression float rsq\n" + " (expression float +\n" + " (expression float *\n" + " (var_ref x)\n" + " (var_ref x))\n" + " (constant float (1.0))))))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (0.017453))))))\n" + " (declare (in) vec2 y_over_x))\n" + " ((return (call asin ((expression vec2 *\n" + " (var_ref y_over_x)\n" + " (expression vec2 rsq\n" + " (expression vec2 +\n" + " (expression vec2 *\n" + " (var_ref y_over_x)\n" + " (var_ref y_over_x))\n" + " (constant float (1.0))))))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (0.017453))))))\n" + " (declare (in) vec3 y_over_x))\n" + " ((return (call asin ((expression vec3 *\n" + " (var_ref y_over_x)\n" + " (expression vec3 rsq\n" + " (expression vec3 +\n" + " (expression vec3 *\n" + " (var_ref y_over_x)\n" + " (var_ref y_over_x))\n" + " (constant float (1.0))))))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n" - "))\n" - "" -; -static const char *builtin_smoothstep = - "((function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ((declare () float t)\n" - "\n" - " (assign (constant bool (1)) (var_ref t)\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (declare () vec2 retval)\n" - "\n" - " (assign (constant bool (1)) (swiz x (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" - " (return (var_ref retval))\n" - " ))\n" + " (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 vec3\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (declare () vec3 retval)\n" + " (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" - " (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" + " (\n" + " ))\n" "\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + " )\n" + " (\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" - " (assign (constant bool (1)) (swiz z (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" - " (return (var_ref retval))\n" " ))\n" "\n" + " (return (var_ref r) )\n" + " ))\n" "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (declare () vec4 retval)\n" - "\n" - " (assign (constant bool (1)) (swiz x (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz y (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" - "\n" - " (assign (constant bool (1)) (swiz z (var_ref t))\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" "\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 edge0)\n" - " (declare (in) vec2 edge1)\n" + " (declare (in) vec2 y)\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 () 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 edge0)\n" - " (declare (in) vec3 edge1)\n" + " (declare (in) vec3 y)\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 () vec3 r)\n" + " (assign (constant bool (1))\n" + " (swiz x (var_ref r))\n" + " (call atan ((swiz x (var_ref y))\n" + " (swiz x (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz y (var_ref r))\n" + " (call atan ((swiz y (var_ref y))\n" + " (swiz y (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz z (var_ref r))\n" + " (call atan ((swiz z (var_ref y))\n" + " (swiz z (var_ref x)))))\n" + " (return (var_ref r))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" + " (declare (in) vec4 y)\n" " (declare (in) vec4 x))\n" - " ((return (expression vec4 max\n" - " (expression vec4 min\n" - " (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))\n" - " (constant vec4 (1.0 1.0 1.0 1.0)))\n" - " (constant vec4 (0.0 0.0 0.0 0.0))))))\n" - "))\n" - "\n" - "" -; -static const char *builtin_textureProjGrad = - "((function textureProjGrad\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((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 ivec4\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" - "\n" - " (signature uvec4\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" - "\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" - "\n" - " (signature ivec4\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" - "\n" - " (signature uvec4\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" - "\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" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((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 uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (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" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((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 uvec4\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" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) 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 uvec4\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 () vec4 r)\n" + " (assign (constant bool (1))\n" + " (swiz x (var_ref r))\n" + " (call atan ((swiz x (var_ref y))\n" + " (swiz x (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz y (var_ref r))\n" + " (call atan ((swiz y (var_ref y))\n" + " (swiz y (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz z (var_ref r))\n" + " (call atan ((swiz z (var_ref y))\n" + " (swiz z (var_ref x)))))\n" + " (assign (constant bool (1))\n" + " (swiz w (var_ref r))\n" + " (call atan ((swiz w (var_ref y))\n" + " (swiz w (var_ref x)))))\n" + " (return (var_ref r)))))\n" "\n" "))\n" "" ; -static const char *builtin_dFdx = - "((function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdx (var_ref p)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 dFdx (var_ref p)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 dFdx (var_ref p)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 dFdx (var_ref p)))))\n" - "))\n" - "" -; -static const char *builtin_dFdy = - "((function dFdy\n" +static const char *builtin_ceil = + "((function ceil\n" " (signature float\n" " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdy (var_ref p)))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float ceil (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 dFdy (var_ref p)))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 ceil (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 dFdy (var_ref p)))))\n" - "\n" - " (signature vec4\n" - " (parameters\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 ivec4\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" - "\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" - " (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" - "\n" - " (signature ivec4\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" - "\n" - " (signature uvec4\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" - "\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" - "\n" - " (signature ivec4\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" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (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" - "\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" - "\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" - "\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" - "\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" - "\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) vec3 arg0))\n" + " ((return (expression vec3 ceil (var_ref arg0)))))\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" - "\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" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 ceil (var_ref arg0)))))\n" "))\n" "" ; @@ -1440,14 +589,27 @@ static const char *builtin_clamp = "))\n" "" ; -static const char *builtin_texture2DRect = - "((function texture2DRect\n" - " (signature vec4\n" +static const char *builtin_cos = + "((function cos\n" + " (signature float\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" + " (declare (in) float angle))\n" + " ((return (expression float cos (var_ref angle)))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 angle))\n" + " ((return (expression vec2 cos (var_ref angle)))))\n" "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 cos (var_ref angle)))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ((return (expression vec4 cos (var_ref angle)))))\n" "))\n" "" ; @@ -1484,158 +646,161 @@ static const char *builtin_cosh = "))\n" "" ; -static const char *builtin_texture1DArrayLod = - "((function texture1DArrayLod\n" - " (signature vec4\n" +static const char *builtin_cross = + "((function cross\n" + " (signature vec3\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" + " (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_asin = - "((function asin\n" +static const char *builtin_dFdx = + "((function dFdx\n" " (signature float\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) float p))\n" + " ((return (expression float dFdx (var_ref p)))))\n" "\n" " (signature vec2\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) vec2 p))\n" + " ((return (expression vec2 dFdx (var_ref p)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 *\n" - " (expression vec3 sign (var_ref x))\n" - " (expression vec3 -\n" - " (expression float *\n" - " (constant float (3.1415926))\n" - " (constant float (0.5)))\n" - " (expression vec3 *\n" - " (expression vec3 sqrt\n" - " (expression vec3 -\n" - " (constant float (1.0))\n" - " (expression vec3 abs (var_ref x))))\n" - " (expression vec3 +\n" - " (constant float (1.5707288))\n" - " (expression vec3 *\n" - " (expression vec3 abs (var_ref x))\n" - " (expression vec3 +\n" - " (constant float (-0.2121144))\n" - " (expression vec3 *\n" - " (constant float (0.0742610))\n" - " (expression vec3 abs (var_ref x))))))))))))\n" + " (declare (in) vec3 p))\n" + " ((return (expression vec3 dFdx (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" + " (declare (in) vec4 p))\n" + " ((return (expression vec4 dFdx (var_ref p)))))\n" "))\n" "" ; -static const char *builtin_texture1DProj = - "((function texture1DProj\n" - " (signature vec4\n" +static const char *builtin_dFdy = + "((function dFdy\n" + " (signature float\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) float p))\n" + " ((return (expression float dFdy (var_ref p)))))\n" "\n" - " (signature vec4\n" + " (signature vec2\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) vec2 p))\n" + " ((return (expression vec2 dFdy (var_ref p)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ((return (expression vec3 dFdy (var_ref p)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + " (declare (in) vec4 p))\n" + " ((return (expression vec4 dFdy (var_ref p)))))\n" + "))\n" + "" +; +static const char *builtin_degrees = + "((function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float 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 * (var_ref arg0) (constant float (57.295780))))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 * (var_ref arg0) (constant float (57.295780))))))\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" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 * (var_ref arg0) (constant float (57.295780))))))\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_dot = + "((function dot\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_lessThan = - "((function lessThan\n" +static const char *builtin_equal = + "((function equal\n" " (signature bvec2\n" " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (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" @@ -1643,9 +808,9 @@ static const char *builtin_lessThan = " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -1653,10 +818,10 @@ static const char *builtin_lessThan = " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -1664,8 +829,8 @@ static const char *builtin_lessThan = " (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" @@ -1673,9 +838,9 @@ static const char *builtin_lessThan = " (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" @@ -1683,10 +848,10 @@ static const char *builtin_lessThan = " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -1694,8 +859,8 @@ static const char *builtin_lessThan = " (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" @@ -1703,9 +868,9 @@ static const char *builtin_lessThan = " (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" @@ -1713,160 +878,59 @@ static const char *builtin_lessThan = " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_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) 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" - " (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" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\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" - "\n" - " (signature vec4\n" +static const char *builtin_exp = + "((function exp\n" + " (signature float\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) float arg0))\n" + " ((return (expression float exp (var_ref arg0)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 exp (var_ref arg0)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 exp (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 exp (var_ref arg0)))))\n" + "))\n" + "" +; +static const char *builtin_exp2 = + "((function exp2\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float exp2 (var_ref arg0)))))\n" "\n" - " (signature ivec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 exp2 (var_ref arg0)))))\n" "\n" - " (signature uvec4\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 exp2 (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" - "\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 exp2 (var_ref arg0)))))\n" "))\n" "" ; @@ -1910,74 +974,108 @@ static const char *builtin_faceforward = "))\n" "" ; -static const char *builtin_abs = - "((function abs\n" +static const char *builtin_floor = + "((function floor\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0))\n" - " ((return (expression float abs (var_ref arg0)))))\n" + " ((return (expression float floor (var_ref arg0)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 abs (var_ref arg0)))))\n" + " ((return (expression vec2 floor (var_ref arg0)))))\n" "\n" " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 abs (var_ref arg0)))))\n" + " ((return (expression vec3 floor (var_ref arg0)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 abs (var_ref arg0)))))\n" + " ((return (expression vec4 floor (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_log2 = - "((function log2\n" +static const char *builtin_fract = + "((function fract\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log2 (var_ref arg0)))))\n" + " (declare (in) float x))\n" + " ((return (expression float fract (var_ref x)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 log2 (var_ref arg0)))))\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 fract (var_ref x)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 log2 (var_ref arg0)))))\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 fract (var_ref x)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 log2 (var_ref arg0)))))\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 fract (var_ref x)))))\n" "))\n" + "\n" "" ; -static const char *builtin_shadow2DRect = - "((function shadow2DRect\n" +static const char *builtin_ftransform = + "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" + " (declare (in) vec4 gl_Vertex)\n" + " (function ftransform\n" " (signature vec4\n" + " (parameters)\n" + " ((return (expression vec4 *\n" + " (var_ref gl_ModelViewProjectionMatrix)\n" + " (var_ref gl_Vertex)))))\n" + "))\n" + "" +; +static const char *builtin_fwidth = + "((function fwidth\n" + " (signature float\n" " (parameters\n" - " (declare (in) 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" + " (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 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 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 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 *builtin_lessThanEqual = - "((function lessThanEqual\n" +static const char *builtin_greaterThan = + "((function greaterThan\n" " (signature bvec2\n" " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -1985,9 +1083,9 @@ static const char *builtin_lessThanEqual = " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -1995,10 +1093,10 @@ static const char *builtin_lessThanEqual = " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -2006,8 +1104,8 @@ static const char *builtin_lessThanEqual = " (declare (in) ivec2 arg0)\n" " (declare (in) ivec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -2015,9 +1113,9 @@ static const char *builtin_lessThanEqual = " (declare (in) ivec3 arg0)\n" " (declare (in) ivec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -2025,10 +1123,10 @@ static const char *builtin_lessThanEqual = " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -2036,8 +1134,8 @@ static const char *builtin_lessThanEqual = " (declare (in) uvec2 arg0)\n" " (declare (in) uvec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -2045,9 +1143,9 @@ static const char *builtin_lessThanEqual = " (declare (in) uvec3 arg0)\n" " (declare (in) uvec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -2055,316 +1153,259 @@ static const char *builtin_lessThanEqual = " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_transpose = - "((function transpose\n" - " (signature mat2\n" +static const char *builtin_greaterThanEqual = + "((function greaterThanEqual\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) mat2 m))\n" - " ((declare () mat2 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec2 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 mat3x2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ((declare () mat3x2 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec3 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 mat4x2\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ((declare () mat4x2 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" - "(return (var_ref t))))\n" + " (declare (in) vec4 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 mat2x3\n" + " (signature bvec2\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) 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 mat3\n" + " (signature bvec3\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) 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 mat4x3\n" + " (signature bvec4\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) 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 mat2x4\n" + " (signature bvec2\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) 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 mat3x4\n" + " (signature bvec3\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) 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 mat4\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) mat4 m))\n" - " ((declare () mat4 t)\n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n" - " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) \n" - "(return (var_ref t))))\n" - ")\n" - "\n" - ")\n" - "\n" + " (declare (in) 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_step = - "((function step\n" +static const char *builtin_inversesqrt = + "((function inversesqrt\n" " (signature float\n" " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" - " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" + " (declare (in) float arg0))\n" + " ((return (expression float rsq (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 rsq (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 rsq (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 rsq (var_ref arg0)))))\n" "))\n" - "\n" "" ; -static const char *builtin_sinh = - "((function sinh\n" +static const char *builtin_length = + "((function length\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" + " (declare (in) float arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" + "\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec2 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" + " (declare (in) vec2 arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" + "\n" + " (signature float\n" " (parameters\n" - " (declare (in) vec3 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" + " (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 x))\n" - " ((return (expression vec4 * (constant vec4 (0.5))\n" - " (expression vec4 -\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" "))\n" "" ; -static const char *builtin_cos = - "((function cos\n" - " (signature float\n" +static const char *builtin_lessThan = + "((function lessThan\n" + " (signature bvec2\n" " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float cos (var_ref angle)))))\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 vec2\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 cos (var_ref angle)))))\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 vec3\n" + " (signature bvec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 cos (var_ref angle)))))\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) vec4 angle))\n" - " ((return (expression vec4 cos (var_ref angle)))))\n" - "))\n" - "" -; -static const char *builtin_shadow2DProjLod = - "((function shadow2DProjLod\n" - " (signature vec4\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec3\n" " (parameters\n" - " (declare (in) 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" + " (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" - "" -; -static const char *builtin_shadow2DArray = - "((function shadow2DArray\n" - " (signature vec4\n" + " (signature bvec4\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" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((declare () bvec2 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uvec3 arg1))\n" + " ((declare () bvec3 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" + "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((declare () bvec4 temp)\n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_equal = - "((function equal\n" +static const char *builtin_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" + " (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" @@ -2372,9 +1413,9 @@ static const char *builtin_equal = " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -2382,10 +1423,10 @@ static const char *builtin_equal = " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -2393,8 +1434,8 @@ static const char *builtin_equal = " (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" @@ -2402,9 +1443,9 @@ static const char *builtin_equal = " (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" @@ -2412,10 +1453,10 @@ static const char *builtin_equal = " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -2423,8 +1464,8 @@ static const char *builtin_equal = " (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" @@ -2432,9 +1473,9 @@ static const char *builtin_equal = " (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" @@ -2442,60 +1483,59 @@ static const char *builtin_equal = " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_length = - "((function length\n" +static const char *builtin_log = + "((function log\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" + " ((return (expression float log (var_ref arg0)))))\n" "\n" - " (signature float\n" + " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" + " ((return (expression vec2 log (var_ref arg0)))))\n" "\n" - " (signature float\n" + " (signature vec3\n" " (parameters\n" " (declare (in) vec3 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" + " ((return (expression vec3 log (var_ref arg0)))))\n" "\n" - " (signature float\n" + " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" + " ((return (expression vec4 log (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_acos = - "((function acos\n" +static const char *builtin_log2 = + "((function log2\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" + " (declare (in) float arg0))\n" + " ((return (expression float log2 (var_ref arg0)))))\n" + "\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" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 log2 (var_ref arg0)))))\n" + "\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" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 log2 (var_ref arg0)))))\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" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 log2 (var_ref arg0)))))\n" "))\n" "" ; @@ -2593,398 +1633,421 @@ static const char *builtin_matrixCompMult = "))\n" "" ; -static const char *builtin_pow = - "((function pow\n" +static const char *builtin_max = + "((function max\n" " (signature float\n" " (parameters\n" " (declare (in) float arg0)\n" " (declare (in) float arg1))\n" - " ((return (expression float pow (var_ref arg0) (var_ref arg1)))))\n" + " ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec2\n" " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 pow (var_ref arg0) (var_ref 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 pow (var_ref arg0) (var_ref arg1)))))\n" + " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char *builtin_texture2DProjLod = - "((function texture2DProjLod\n" - " (signature vec4\n" + " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec2\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) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature vec3\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) vec3 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_textureProjLod = - "((function textureProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" + " (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) 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) 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) 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) 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) 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" + " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (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) 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) 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) 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) 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) 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) 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) 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" + " (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) 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) 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) isampler2D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + " (declare (in) 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) 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) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec2\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\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) 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) 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) 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" + " (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_log = - "((function log\n" +static const char *builtin_min = + "((function min\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log (var_ref arg0)))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 log (var_ref arg0)))))\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" - " ((return (expression vec3 log (var_ref arg0)))))\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) 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" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp2 (var_ref arg0)))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp2 (var_ref arg0)))))\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) vec4 arg0))\n" - " ((return (expression vec4 exp2 (var_ref arg0)))))\n" - "))\n" - "" -; -static const char *builtin_fract = - "((function fract\n" - " (signature float\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature int\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float fract (var_ref x)))))\n" + " (declare (in) int arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec2\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 fract (var_ref x)))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) ivec2 arg1))\n" + " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec3\n" + " (signature ivec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 fract (var_ref x)))))\n" + " (declare (in) ivec3 arg0)\n" + " (declare (in) ivec3 arg1))\n" + " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 fract (var_ref x)))))\n" - "))\n" + " (declare (in) ivec4 arg0)\n" + " (declare (in) ivec4 arg1))\n" + " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "" -; -static const char *builtin_shadow1DLod = - "((function shadow1DLod\n" - " (signature vec4\n" + " (signature ivec2\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))\n" + " (declare (in) ivec2 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture1DLod = - "((function texture1DLod\n" - " (signature vec4\n" + " (signature ivec3\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) ivec3 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture2DArray = - "((function texture2DArray\n" - " (signature vec4\n" + " (signature ivec4\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) ivec4 arg0)\n" + " (declare (in) int arg1))\n" + " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uint\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) uint arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n" "\n" - "))\n" - "" -; -static const char *builtin_texture3DProj = - "((function texture3DProj\n" - " (signature vec4\n" + " (signature uvec2\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) uvec2 arg0)\n" + " (declare (in) uvec2 arg1))\n" + " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" "\n" - " (signature vec4\n" + " (signature uvec3\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) 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) uvec4 arg0)\n" + " (declare (in) uvec4 arg1))\n" + " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" "\n" + " (signature uvec2\n" + " (parameters\n" + " (declare (in) uvec2 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature uvec3\n" + " (parameters\n" + " (declare (in) uvec3 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) uvec4 arg0)\n" + " (declare (in) uint arg1))\n" + " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_sign = - "((function sign\n" +static const char *builtin_mix = + "((function mix\n" " (signature float\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float sign (var_ref x)))))\n" + " (declare (in) float arg0)\n" + " (declare (in) float arg1)\n" + " (declare (in) float arg2))\n" + " ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 sign (var_ref x)))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1)\n" + " (declare (in) vec2 arg2))\n" + " ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 sign (var_ref x)))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1)\n" + " (declare (in) vec3 arg2))\n" + " ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 sign (var_ref x)))))\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 int\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) int x))\n" - " ((return (expression int sign (var_ref x)))))\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 ivec2\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) ivec2 x))\n" - " ((return (expression ivec2 sign (var_ref x)))))\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 ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 x))\n" - " ((return (expression ivec3 sign (var_ref x)))))\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 ivec4\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec4 x))\n" - " ((return (expression ivec4 sign (var_ref x)))))\n" - "))\n" + " (declare (in) float v1)\n" + " (declare (in) float v2)\n" + " (declare (in) bool a))\n" + " ((assign (var_ref a) (var_ref v1) (var_ref v2))\n" + " (return (var_ref v1))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 v1)\n" + " (declare (in) vec2 v2)\n" + " (declare (in) bvec2 a))\n" + " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" + " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" + " (return (var_ref v1))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 v1)\n" + " (declare (in) vec3 v2)\n" + " (declare (in) bvec3 a))\n" + " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" + " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" + " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" + " (return (var_ref v1))))\n" "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 v1)\n" + " (declare (in) vec4 v2)\n" + " (declare (in) bvec4 a))\n" + " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" + " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" + " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" + " (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))\n" + " (return (var_ref v1))))\n" + "))\n" "" ; -static const char *builtin_inversesqrt = - "((function inversesqrt\n" +static const char *builtin_mod = + "((function mod\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float rsq (var_ref arg0)))))\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" - " ((return (expression vec2 rsq (var_ref arg0)))))\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) vec2 arg1))\n" + " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 rsq (var_ref arg0)))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 rsq (var_ref arg0)))))\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) vec4 arg1))\n" + " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0)\n" + " (declare (in) float arg1))\n" + " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" "))\n" "" ; -static const char *builtin_distance = - "((function distance\n" +static const char *builtin_noise1 = + "((function noise1\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" + " (declare (in) float x))\n" + " ((return (constant float (0)))))\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" + " (declare (in) vec2 x))\n" + " ((return (constant float (0)))))\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" + " (declare (in) vec3 x))\n" + " ((return (constant float (0)))))\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" + " (declare (in) vec4 x))\n" + " ((return (constant float (0)))))\n" "))\n" "" ; @@ -3009,115 +2072,100 @@ static const char *builtin_noise2 = "))\n" "" ; -static const char *builtin_tanh = - "((function tanh\n" - " (signature float\n" +static const char *builtin_noise3 = + "((function noise3\n" + " (signature vec3\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" + " ((return (constant vec3 (0 0 0)))))\n" + " (signature vec3\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" + " ((return (constant vec3 (0 0 0)))))\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" + " ((return (constant vec3 (0 0 0)))))\n" + " (signature vec3\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" + " ((return (constant vec3 (0 0 0)))))\n" "))\n" "" ; -static const char *builtin_texture1DProjLod = - "((function texture1DProjLod\n" +static const char *builtin_noise4 = + "((function noise4\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" + " (declare (in) float x))\n" + " ((return (constant vec4 (0 0 0 0)))))\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" + " (declare (in) vec2 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ((return (constant vec4 (0 0 0 0)))))\n" "))\n" "" ; -static const char *builtin_texture1DArray = - "((function texture1DArray\n" - " (signature vec4\n" +static const char *builtin_normalize = + "((function normalize\n" + " (signature float\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) float arg0))\n" + " ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" "\n" - " (signature vec4\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + " (declare (in) vec2 arg0))\n" + " ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" "\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 arg0))\n" + " ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 arg0))\n" + " ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" "))\n" "" ; -static const char *builtin_texture2D = - "((function texture2D\n" - " (signature vec4\n" +static const char *builtin_not = + "((function not\n" + " (signature bvec2\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) bvec2 arg0))\n" + " ((return (expression bvec2 ! (var_ref arg0)))))\n" "\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) bvec3 arg0))\n" + " ((return (expression bvec3 ! (var_ref arg0)))))\n" "\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) bvec4 arg0))\n" + " ((return (expression bvec4 ! (var_ref arg0)))))\n" "))\n" "" ; -static const char *builtin_greaterThanEqual = - "((function greaterThanEqual\n" +static const char *builtin_notEqual = + "((function notEqual\n" " (signature bvec2\n" " (parameters\n" " (declare (in) vec2 arg0)\n" " (declare (in) vec2 arg1))\n" " ((declare () bvec2 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec3\n" @@ -3125,9 +2173,9 @@ static const char *builtin_greaterThanEqual = " (declare (in) vec3 arg0)\n" " (declare (in) vec3 arg1))\n" " ((declare () bvec3 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec4\n" @@ -3135,10 +2183,10 @@ static const char *builtin_greaterThanEqual = " (declare (in) vec4 arg0)\n" " (declare (in) vec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -3146,8 +2194,8 @@ static const char *builtin_greaterThanEqual = " (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" @@ -3155,9 +2203,9 @@ static const char *builtin_greaterThanEqual = " (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" @@ -3165,10 +2213,10 @@ static const char *builtin_greaterThanEqual = " (declare (in) ivec4 arg0)\n" " (declare (in) ivec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n" " (return (var_ref temp))))\n" "\n" " (signature bvec2\n" @@ -3176,8 +2224,8 @@ static const char *builtin_greaterThanEqual = " (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" @@ -3185,9 +2233,9 @@ static const char *builtin_greaterThanEqual = " (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" @@ -3195,257 +2243,360 @@ static const char *builtin_greaterThanEqual = " (declare (in) uvec4 arg0)\n" " (declare (in) uvec4 arg1))\n" " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" + " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" " (return (var_ref temp))))\n" "))\n" "" ; -static const char *builtin_texture3DProjLod = - "((function texture3DProjLod\n" - " (signature vec4\n" +static const char *builtin_outerProduct = + "((function outerProduct\n" + " (signature mat2\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) 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" - "))\n" - "" -; -static const char *builtin_tan = - "((function tan\n" - " (signature float\n" + " (signature mat2x3\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) 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 vec2\n" + " (signature mat2x4\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) 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 vec3\n" + " (signature mat3x2\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) 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) 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" + " (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 mat3x4\n" " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\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 bool\n" + " (signature mat4x2\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) 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 bool\n" + " (signature mat4x3\n" " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bool || (expression bool || (expression bool || (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0))))))\n" + " (declare (in) vec3 u)\n" + " (declare (in) vec4 v))\n" + " ((declare () mat4x3 m)\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" + " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))\n" + " (return (var_ref m))))\n" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) 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_normalize = - "((function normalize\n" +static const char *builtin_pow = + "((function pow\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" + " ((return (expression float pow (var_ref arg0) (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" + " ((return (expression vec2 pow (var_ref arg0) (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" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n" - "))\n" - "" -; -static const char *builtin_shadow1DProj = - "((function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P) )\n" - " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))\n" + " (declare (in) vec3 arg0)\n" + " (declare (in) vec3 arg1))\n" + " ((return (expression vec3 pow (var_ref arg0) (var_ref arg1)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) 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" + " (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_floor = - "((function floor\n" +static const char *builtin_radians = + "((function radians\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 (0.017453))))))\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 (0.017453))))))\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 (0.017453))))))\n" "\n" " (signature vec4\n" " (parameters\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) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 cross (var_ref arg0) (var_ref arg1)))))\n" + " ((return (expression vec4 * (var_ref arg0) (constant float (0.017453))))))\n" "))\n" "" ; -static const char *builtin_sqrt = - "((function sqrt\n" +static const char *builtin_reflect = + "((function reflect\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float sqrt (var_ref arg0)))))\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 arg0))\n" - " ((return (expression vec2 sqrt (var_ref arg0)))))\n" + " (declare (in) vec2 i)\n" + " (declare (in) vec2 n))\n" + " ((return (expression vec2 -\n" + " (var_ref i)\n" + " (expression vec2 *\n" + " (constant float (2.0))\n" + " (expression vec2 *\n" + " (expression float dot\n" + " (var_ref n)\n" + " (var_ref i))\n" + " (var_ref n)))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 sqrt (var_ref arg0)))))\n" + " (declare (in) vec3 i)\n" + " (declare (in) vec3 n))\n" + " ((return (expression vec3 -\n" + " (var_ref i)\n" + " (expression vec3 *\n" + " (constant float (2.0))\n" + " (expression vec3 *\n" + " (expression float dot\n" + " (var_ref n)\n" + " (var_ref i))\n" + " (var_ref n)))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 sqrt (var_ref arg0)))))\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" "))\n" "" ; -static const char *builtin_mix = - "((function mix\n" +static const char *builtin_refract = + "((function refract\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 i)\n" + " (declare (in) float n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (expression float * (var_ref eta)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * \n" + " (expression float dot (var_ref n) (var_ref i))\n" + " (expression float dot (var_ref n) (var_ref i))))))))\n" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant float (0.0))))\n" + " ((return (expression float -\n" + " (expression float * (var_ref eta) (var_ref i))\n" + " (expression float *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1)\n" - " (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 i)\n" + " (declare (in) vec2 n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (expression float * (var_ref eta)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * \n" + " (expression float dot (var_ref n) (var_ref i))\n" + " (expression float dot (var_ref n) (var_ref i))))))))\n" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant vec2 (0.0 0.0))))\n" + " ((return (expression vec2 -\n" + " (expression vec2 * (var_ref eta) (var_ref i))\n" + " (expression vec2 *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1)\n" - " (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 i)\n" + " (declare (in) vec3 n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (expression float * (var_ref eta)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * \n" + " (expression float dot (var_ref n) (var_ref i))\n" + " (expression float dot (var_ref n) (var_ref i))))))))\n" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant vec3 (0.0 0.0 0.0))))\n" + " ((return (expression vec3 -\n" + " (expression vec3 * (var_ref eta) (var_ref i))\n" + " (expression vec3 *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1)\n" - " (declare (in) vec4 arg2))\n" - " ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2))))))\n" + " (declare (in) vec4 i)\n" + " (declare (in) vec4 n)\n" + " (declare (in) float eta))\n" + " ((declare () float k)\n" + " (assign (constant bool (1)) (var_ref k)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * (var_ref eta)\n" + " (expression float * (var_ref eta)\n" + " (expression float - (constant float (1.0))\n" + " (expression float * \n" + " (expression float dot (var_ref n) (var_ref i))\n" + " (expression float dot (var_ref n) (var_ref i))))))))\n" + " (if (expression bool < (var_ref k) (constant float (0.0)))\n" + " ((return (constant vec4 (0.0 0.0 0.0 0.0))))\n" + " ((return (expression vec4 -\n" + " (expression vec4 * (var_ref eta) (var_ref i))\n" + " (expression vec4 *\n" + " (expression float +\n" + " (expression float * (var_ref eta)\n" + " (expression float dot (var_ref n) (var_ref i)))\n" + " (expression float sqrt (var_ref k)))\n" + " (var_ref n))))))))\n" "\n" + "))\n" + "" +; +static const char *builtin_shadow1D = + "((function shadow1D\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" - " (signature float\n" - " (parameters\n" - " (declare (in) float v1)\n" - " (declare (in) float v2)\n" - " (declare (in) bool a))\n" - " ((assign (var_ref a) (var_ref v1) (var_ref v2))\n" - " (return (var_ref v1))))\n" + " (declare (in) 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 vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 v1)\n" - " (declare (in) vec2 v2)\n" - " (declare (in) bvec2 a))\n" - " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" - " (return (var_ref v1))))\n" + " (declare (in) 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 vec3\n" + "))\n" + "" +; +static const char *builtin_shadow1DArray = + "((function shadow1DArray\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 v1)\n" - " (declare (in) vec3 v2)\n" - " (declare (in) bvec3 a))\n" - " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" - " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" - " (return (var_ref v1))))\n" + " (declare (in) 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 vec4\n" " (parameters\n" - " (declare (in) vec4 v1)\n" - " (declare (in) vec4 v2)\n" - " (declare (in) bvec4 a))\n" - " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n" - " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n" - " (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))\n" - " (return (var_ref v1))))\n" + " (declare (in) 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" "" ; @@ -3461,39 +2612,45 @@ static const char *builtin_shadow1DArrayLod = "))\n" "" ; -static const char *builtin_ftransform = - "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" - " (declare (in) vec4 gl_Vertex)\n" - " (function ftransform\n" +static const char *builtin_shadow1DLod = + "((function shadow1DLod\n" " (signature vec4\n" - " (parameters)\n" - " ((return (expression vec4 *\n" - " (var_ref gl_ModelViewProjectionMatrix)\n" - " (var_ref gl_Vertex)))))\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" "))\n" "" ; -static const char *builtin_sin = - "((function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float sin (var_ref angle)))))\n" - "\n" - " (signature vec2\n" +static const char *builtin_shadow1DProj = + "((function shadow1DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 sin (var_ref angle)))))\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 vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 sin (var_ref angle)))))\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 *builtin_shadow1DProjLod = + "((function shadow1DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 sin (var_ref angle)))))\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" "" ; @@ -3515,6 +2672,17 @@ static const char *builtin_shadow2D = "))\n" "" ; +static const char *builtin_shadow2DArray = + "((function shadow2DArray\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) ))))\n" + "\n" + "))\n" + "" +; static const char *builtin_shadow2DLod = "((function shadow2DLod\n" " (signature vec4\n" @@ -3527,6 +2695,47 @@ static const char *builtin_shadow2DLod = "))\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_shadow2DProjLod = + "((function shadow2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))\n" + "\n" + "))\n" + "" +; +static const char *builtin_shadow2DRect = + "((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 *builtin_shadow2DRectProj = "((function shadow2DRectProj\n" " (signature vec4\n" @@ -3538,369 +2747,425 @@ static const char *builtin_shadow2DRectProj = "))\n" "" ; -static const char *builtin_atan = - "((function atan\n" +static const char *builtin_sign = + "((function sign\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" + " ((return (expression float sign (var_ref x)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ((return (call asin ((expression vec2 *\n" - " (var_ref y_over_x)\n" - " (expression vec2 rsq\n" - " (expression vec2 +\n" - " (expression vec2 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0))))))))))\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 sign (var_ref x)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ((return (call asin ((expression vec3 *\n" - " (var_ref y_over_x)\n" - " (expression vec3 rsq\n" - " (expression vec3 +\n" - " (expression vec3 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0))))))))))\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 sign (var_ref x)))))\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" - "\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" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 sign (var_ref x)))))\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 int\n" + " (parameters\n" + " (declare (in) int x))\n" + " ((return (expression int sign (var_ref x)))))\n" "\n" - " ))\n" + " (signature ivec2\n" + " (parameters\n" + " (declare (in) ivec2 x))\n" + " ((return (expression ivec2 sign (var_ref x)))))\n" "\n" - " (return (var_ref r) )\n" - " ))\n" + " (signature ivec3\n" + " (parameters\n" + " (declare (in) ivec3 x))\n" + " ((return (expression ivec3 sign (var_ref x)))))\n" "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) ivec4 x))\n" + " ((return (expression ivec4 sign (var_ref x)))))\n" + "))\n" "\n" + "" +; +static const char *builtin_sin = + "((function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" + " ((return (expression float sin (var_ref angle)))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 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) vec2 angle))\n" + " ((return (expression vec2 sin (var_ref angle)))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 r)\n" - " (assign (constant bool (1))\n" - " (swiz x (var_ref r))\n" - " (call atan ((swiz x (var_ref y))\n" - " (swiz x (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz y (var_ref r))\n" - " (call atan ((swiz y (var_ref y))\n" - " (swiz y (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz z (var_ref r))\n" - " (call atan ((swiz z (var_ref y))\n" - " (swiz z (var_ref x)))))\n" - " (return (var_ref r))))\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 sin (var_ref angle)))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 r)\n" - " (assign (constant bool (1))\n" - " (swiz x (var_ref r))\n" - " (call atan ((swiz x (var_ref y))\n" - " (swiz x (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz y (var_ref r))\n" - " (call atan ((swiz y (var_ref y))\n" - " (swiz y (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz z (var_ref r))\n" - " (call atan ((swiz z (var_ref y))\n" - " (swiz z (var_ref x)))))\n" - " (assign (constant bool (1))\n" - " (swiz w (var_ref r))\n" - " (call atan ((swiz w (var_ref y))\n" - " (swiz w (var_ref x)))))\n" - " (return (var_ref r)))))\n" - "\n" + " (declare (in) vec4 angle))\n" + " ((return (expression vec4 sin (var_ref angle)))))\n" "))\n" "" ; -static const char *builtin_max = - "((function max\n" +static const char *builtin_sinh = + "((function sinh\n" " (signature float\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n" - "\n" + " (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 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\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 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\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 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\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_smoothstep = + "((function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) float x))\n" + " ((declare () float t)\n" + "\n" + " (assign (constant bool (1)) (var_ref t)\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t))))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec2 x))\n" + " ((declare () vec2 t)\n" + " (declare () vec2 retval)\n" + "\n" + " (assign (constant bool (1)) (swiz x (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz y (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + " (return (var_ref retval))\n" + " ))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec3 x))\n" + " ((declare () vec3 t)\n" + " (declare () vec3 retval)\n" + "\n" + " (assign (constant bool (1)) (swiz x (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz y (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz z (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" + " (return (var_ref retval))\n" + " ))\n" + "\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec4 x))\n" + " ((declare () vec4 t)\n" + " (declare () vec4 retval)\n" "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression int max (var_ref arg0) (var_ref arg1)))))\n" + " (assign (constant bool (1)) (swiz x (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n" "\n" - " (signature ivec2\n" + " (assign (constant bool (1)) (swiz y (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz z (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n" + "\n" + " (assign (constant bool (1)) (swiz w (var_ref t))\n" + " (expression float max\n" + " (expression float min\n" + " (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" + " (constant float (1.0)))\n" + " (constant float (0.0))))\n" + " (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n" + " (return (var_ref retval))\n" + " ))\n" + "\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec2 edge0)\n" + " (declare (in) vec2 edge1)\n" + " (declare (in) vec2 x))\n" + " ((return (expression vec2 max\n" + " (expression vec2 min\n" + " (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))\n" + " (constant vec2 (1.0 1.0)))\n" + " (constant vec2 (0.0 0.0))))))\n" "\n" - " (signature ivec3\n" + " (signature vec3\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec3 edge0)\n" + " (declare (in) vec3 edge1)\n" + " (declare (in) vec3 x))\n" + " ((return (expression vec3 max\n" + " (expression vec3 min\n" + " (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))\n" + " (constant vec3 (1.0 1.0 1.0)))\n" + " (constant vec3 (0.0 0.0 0.0))))))\n" "\n" - " (signature ivec4\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) vec4 edge0)\n" + " (declare (in) vec4 edge1)\n" + " (declare (in) vec4 x))\n" + " ((return (expression vec4 max\n" + " (expression vec4 min\n" + " (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))\n" + " (constant vec4 (1.0 1.0 1.0 1.0)))\n" + " (constant vec4 (0.0 0.0 0.0 0.0))))))\n" + "))\n" "\n" - " (signature ivec2\n" + "" +; +static const char *builtin_sqrt = + "((function sqrt\n" + " (signature float\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 max (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 max (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 max (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_step = + "((function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) float x))\n" + " ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge))))))\n" "\n" - " (signature uvec2\n" + " (signature vec2\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 edge)\n" + " (declare (in) vec2 x))\n" + " ((declare () vec2 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" + " (return (var_ref t))))\n" "\n" - " (signature uvec3\n" + " (signature vec3\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) float edge)\n" + " (declare (in) vec3 x))\n" + " ((declare () vec3 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" + " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" + " (return (var_ref t))))\n" "\n" - " (signature uvec4\n" + " (signature vec4\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) 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 uvec2\n" + " (signature vec2\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 uvec3\n" + " (signature vec3\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) 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 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) vec4 edge)\n" + " (declare (in) vec4 x))\n" + " ((declare () vec4 t)\n" + " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge)))))\n" + " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))\n" + " (return (var_ref t))))\n" "))\n" + "\n" "" ; -static const char *builtin_reflect = - "((function reflect\n" +static const char *builtin_tan = + "((function tan\n" " (signature float\n" " (parameters\n" - " (declare (in) float i)\n" - " (declare (in) float n))\n" - " ((return (expression float -\n" - " (var_ref i)\n" - " (expression float *\n" - " (constant float (2.0))\n" - " (expression float *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" + " (declare (in) float angle))\n" + " ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n" "\n" " (signature vec2\n" " (parameters\n" - " (declare (in) vec2 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) vec2 angle))\n" + " ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n" "\n" " (signature vec3\n" " (parameters\n" - " (declare (in) vec3 i)\n" - " (declare (in) vec3 n))\n" - " ((return (expression vec3 -\n" - " (var_ref i)\n" - " (expression vec3 *\n" - " (constant float (2.0))\n" - " (expression vec3 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" + " (declare (in) vec3 angle))\n" + " ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 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" + " (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_texture3D = - "((function texture3D\n" - " (signature vec4\n" +static const char *builtin_tanh = + "((function tanh\n" + " (signature float\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" - "\n" + " (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) 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" + " (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" "" ; @@ -4014,706 +3279,1441 @@ static const char *builtin_texelFetch = "))\n" "" ; -static const char *builtin_noise4 = - "((function noise4\n" +static const char *builtin_texture = + "((function texture\n" " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec4 (0 0 0 0)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1DArray sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" + " (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" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (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) 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 *builtin_notEqual = - "((function notEqual\n" - " (signature bvec2\n" +static const char *builtin_texture1D = + "((function texture1D\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) sampler1D sampler)\n" + " (declare (in) float P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\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) 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 bvec4\n" + "))\n" + "" +; +static const char *builtin_texture1DArray = + "((function texture1DArray\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) sampler1DArray sampler)\n" + " (declare (in) vec2 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) 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 bvec3\n" + "))\n" + "" +; +static const char *builtin_texture1DArrayLod = + "((function texture1DArrayLod\n" + " (signature vec4\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) 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 bvec4\n" + "))\n" + "" +; +static const char *builtin_texture1DLod = + "((function texture1DLod\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) 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" - " (signature bvec2\n" + "))\n" + "" +; +static const char *builtin_texture1DProj = + "((function texture1DProj\n" + " (signature vec4\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) 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 bvec3\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) 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 bvec4\n" + " (signature vec4\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) 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) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_outerProduct = - "((function outerProduct\n" - " (signature mat2\n" +static const char *builtin_texture1DProjLod = + "((function texture1DProjLod\n" + " (signature vec4\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) 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 mat2x3\n" + " (signature vec4\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) 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 mat2x4\n" + "))\n" + "" +; +static const char *builtin_texture2D = + "((function texture2D\n" + " (signature vec4\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) sampler2D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature mat3x2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3x2 m)\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))\n" - " ))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) 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 mat3\n" + "))\n" + "" +; +static const char *builtin_texture2DArray = + "((function texture2DArray\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) sampler2DArray sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\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) 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 mat4x2\n" + "))\n" + "" +; +static const char *builtin_texture2DArrayLod = + "((function texture2DArrayLod\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) 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 mat4x3\n" + "))\n" + "" +; +static const char *builtin_texture2DLod = + "((function texture2DLod\n" + " (signature vec4\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) sampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" "\n" - " (signature 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 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" +static const char *builtin_texture2DProj = + "((function texture2DProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) sampler2D 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" + " ((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) sampler1DShadow sampler)\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D 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" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" "\n" "))\n" "" ; -static const char *builtin_noise1 = - "((function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" +static const char *builtin_texture2DProjLod = + "((function texture2DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant float (0)))))\n" - " (signature float\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 vec4\n" " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (constant float (0)))))\n" - " (signature float\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + "\n" + "))\n" + "" +; +static const char *builtin_texture2DRect = + "((function texture2DRect\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant float (0)))))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + "\n" "))\n" "" ; -static const char *builtin_refract = - "((function refract\n" - " (signature float\n" +static const char *builtin_texture2DRectProj = + "((function texture2DRectProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float i)\n" - " (declare (in) float n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float dot (var_ref n) (var_ref i))\n" - " (expression float dot (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant float (0.0))))\n" - " ((return (expression float -\n" - " (expression float * (var_ref eta) (var_ref i))\n" - " (expression float *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) 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 vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 i)\n" - " (declare (in) vec2 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float dot (var_ref n) (var_ref i))\n" - " (expression float dot (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec2 (0.0 0.0))))\n" - " ((return (expression vec2 -\n" - " (expression vec2 * (var_ref eta) (var_ref i))\n" - " (expression vec2 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) 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" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_texture3D = + "((function texture3D\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 i)\n" - " (declare (in) vec3 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (constant bool (1)) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float dot (var_ref n) (var_ref i))\n" - " (expression float dot (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec3 (0.0 0.0 0.0))))\n" - " ((return (expression vec3 -\n" - " (expression vec3 * (var_ref eta) (var_ref i))\n" - " (expression vec3 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" + " (declare (in) sampler3D 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 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) 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" "))\n" "" ; -static const char *builtin_noise3 = - "((function noise3\n" - " (signature vec3\n" +static const char *builtin_texture3DLod = + "((function texture3DLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " (signature vec3\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + "))\n" + "" +; +static const char *builtin_texture3DProj = + "((function texture3DProj\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " (signature vec3\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) vec3 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" - " (signature vec3\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + "))\n" + "" +; +static const char *builtin_texture3DProjLod = + "((function texture3DProjLod\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (constant vec3 (0 0 0)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_min = - "((function min\n" - " (signature float\n" +static const char *builtin_textureCube = + "((function textureCube\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" "\n" - " (signature vec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))\n" "\n" - " (signature vec3\n" + "))\n" + "" +; +static const char *builtin_textureCubeLod = + "((function textureCubeLod\n" + " (signature vec4\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) 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" + "))\n" + "" +; +static const char *builtin_textureGrad = + "((function textureGrad\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) 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) float arg1))\n" - " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature vec3\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) 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) float arg1))\n" - " ((return (expression vec4 min (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 int\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) 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 ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) 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 ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 ivec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 ivec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 ivec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" " (signature ivec4\n" " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uint\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\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 uvec2\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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 uvec3\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" + " (declare (in) 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) uvec4 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\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_textureCube = - "((function textureCube\n" +static const char *builtin_textureLod = + "((function textureLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))\n" + " (declare (in) 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" + " (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" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) float P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\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" + "\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" + " (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) 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) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usamplerCube sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) 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) 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 *builtin_shadow1DArray = - "((function shadow1DArray\n" +static const char *builtin_textureProj = + "((function textureProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\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 ivec4\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" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" + " (signature ivec4\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" + "\n" + " (signature uvec4\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" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 P) )\n" - " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler2D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler2D sampler)\n" + " (declare (in) vec3 P) )\n" + " ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))\n" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\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 ivec4\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" + " (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" + "\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 ivec4\n" + " (parameters\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P) )\n" + " ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (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) 1 (swiz z (var_ref P)) (var_ref bias) ))))\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))\n" "\n" - "))\n" - "" -; -static const char *builtin_exp = - "((function exp\n" - " (signature float\n" + " (signature ivec4\n" " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float exp (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 vec2\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp (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 vec3\n" + " (signature vec4\n" " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp (var_ref arg0)))))\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" + " (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" + "\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" "\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 exp (var_ref arg0)))))\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float bias) )\n" + " ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))\n" + "\n" "))\n" "" ; -static const char *builtin_greaterThan = - "((function greaterThan\n" - " (signature bvec2\n" +static const char *builtin_textureProjGrad = + "((function textureProjGrad\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) 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 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) 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 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) 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 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) 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 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) 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 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" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float dPdx) \n" + " (declare (in) float dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" "\n" - " (signature bvec2\n" + " (signature vec4\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) 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 bvec3\n" + " (signature ivec4\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) 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 bvec4\n" + " (signature uvec4\n" " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((declare () bvec4 temp)\n" - " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n" - " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n" - " (return (var_ref temp))))\n" + " (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) sampler2D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec2 dPdx) \n" + " (declare (in) vec2 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) 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 uvec4\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" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) vec3 dPdx) \n" + " (declare (in) vec3 dPdy) )\n" + " ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) 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 uvec4\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" + "\n" "))\n" "" ; -static const char *builtin_texture2DLod = - "((function texture2DLod\n" +static const char *builtin_textureProjLod = + "((function textureProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" + " (declare (in) sampler1D 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" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec2 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature ivec4\n" + " (parameters\n" + " (declare (in) isampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature uvec4\n" + " (parameters\n" + " (declare (in) usampler1D sampler)\n" + " (declare (in) vec4 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec3 P) \n" + " (declare (in) float lod) )\n" + " ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))\n" + "\n" + " (signature ivec4\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" + "\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" + " (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" + "\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" + " (signature ivec4\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" + "\n" + " (signature uvec4\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" "\n" "))\n" "" ; -static const char *builtin_dot = - "((function dot\n" - " (signature float\n" +static const char *builtin_transpose = + "((function transpose\n" + " (signature mat2\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) 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 float\n" + " (signature mat3x2\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) mat2x3 m))\n" + " ((declare () mat3x2 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature mat4x2\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) mat2x4 m))\n" + " ((declare () mat4x2 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" + "(return (var_ref t))))\n" "\n" - " (signature float\n" + " (signature mat2x3\n" " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" - "))\n" + " (declare (in) mat3x2 m))\n" + " ((declare () mat2x3 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + "(return (var_ref t))))\n" + "\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 m))\n" + " ((declare () mat3 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" + "(return (var_ref t))))\n" + "\n" + " (signature mat4x3\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" + "\n" + " (signature mat2x4\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" + "\n" + " (signature mat3x4\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" + "\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 m))\n" + " ((declare () mat4 t)\n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n" + " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) \n" + "(return (var_ref t))))\n" + ")\n" + "\n" + ")\n" + "\n" "" ; -static const char *prototypes_for_120_vert = +static const char *prototypes_for_110_frag = "(\n" "(function radians\n" " (signature float\n" @@ -5434,10 +5434,6 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) vec4 x))\n" " ()))\n" - "(function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ()))\n" "(function faceforward\n" " (signature float\n" " (parameters\n" @@ -5524,119 +5520,6 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) mat4 x)\n" " (declare (in) mat4 y))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ()))\n" - "(function outerProduct\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec4 r))\n" - " ()))\n" - "(function transpose\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 m))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 m))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 m))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat3x2 m))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat4x2 m))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat4x3 m))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat3x4 m))\n" " ()))\n" "(function lessThan\n" " (signature bvec2\n" @@ -5898,6 +5781,12 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) float coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture1DProj\n" " (signature vec4\n" @@ -5909,32 +5798,30 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture1DProjLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1D sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture2D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec2 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture2DProj\n" " (signature vec4\n" @@ -5946,117 +5833,153 @@ static const char *prototypes_for_120_vert = " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2D sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function texture3D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture3DProj\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function texture3DLod\n" + "(function texture3DProj\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" + " (declare (in) vec4 coord))\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler3D sampler)\n" " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function textureCube\n" " (signature vec4\n" " (parameters\n" " (declare (in) samplerCube sampler)\n" " (declare (in) vec3 coord))\n" - " ()))\n" - "(function textureCubeLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" " (declare (in) samplerCube sampler)\n" " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow1D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow2D\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2DShadow sampler)\n" " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow1DProj\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler1DShadow sampler)\n" " (declare (in) vec4 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" " ()))\n" "(function shadow2DProj\n" " (signature vec4\n" " (parameters\n" " (declare (in) sampler2DShadow sampler)\n" " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow1DLod\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float bias))\n" " ()))\n" - "(function shadow2DLod\n" + "(function dFdx\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 p))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p))\n" " ()))\n" - "(function shadow1DProjLod\n" + "(function dFdy\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 p))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p))\n" " ()))\n" - "(function shadow2DProjLod\n" + "(function fwidth\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 p))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 p))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" + " (declare (in) vec4 p))\n" " ()))\n" "(function noise1\n" " (signature float\n" @@ -6127,132 +6050,70 @@ static const char *prototypes_for_120_vert = " (declare (in) vec4 x))\n" " ())))" ; -static const char *functions_for_120_vert [] = { +static const char *functions_for_110_frag [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_matrixCompMult, - builtin_shadow2DProjLod, - builtin_noise2, - builtin_texture3DProjLod, - builtin_pow, - builtin_texture2DProj, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, + builtin_cos, + builtin_cross, + builtin_dFdx, + builtin_dFdy, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_shadow2DProj, - builtin_shadow1DProjLod, - builtin_any, - builtin_shadow1DProj, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_texture3DLod, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_shadow1DLod, - builtin_ftransform, - builtin_sin, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_transpose, - builtin_outerProduct, - builtin_ceil, - builtin_reflect, - builtin_textureCubeLod, - builtin_step, - builtin_texture1D, + builtin_fwidth, builtin_greaterThan, - builtin_texture3D, - builtin_not, - builtin_texture2DProjLod, + builtin_greaterThanEqual, builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, builtin_noise1, - builtin_refract, + builtin_noise2, builtin_noise3, - builtin_texture2DLod, - builtin_min, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_pow, builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DProj, + builtin_shadow2D, + builtin_shadow2DProj, + builtin_sign, + builtin_sin, builtin_smoothstep, - builtin_texture1DProjLod, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DProj, + builtin_texture2D, + builtin_texture2DProj, + builtin_texture3D, + builtin_texture3DProj, builtin_textureCube, - builtin_length, - builtin_texture1DLod, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, -}; -static const char *prototypes_for_EXT_texture_array_frag = - "(\n" - "(function texture1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_texture_array_frag [] = { - builtin_shadow2DArray, - builtin_shadow1DArray, - builtin_texture1DArray, - builtin_texture2DArray, }; static const char *prototypes_for_110_vert = "(\n" @@ -7556,80 +7417,80 @@ static const char *prototypes_for_110_vert = " ())))" ; static const char *functions_for_110_vert [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_matrixCompMult, - builtin_shadow2DProjLod, - builtin_noise2, - builtin_texture3DProjLod, - builtin_pow, - builtin_texture2DProj, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, + builtin_cos, + builtin_cross, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_shadow2DProj, - builtin_shadow1DProjLod, - builtin_any, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_texture3DLod, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_shadow1DLod, builtin_ftransform, - builtin_sin, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_shadow1DProj, - builtin_ceil, - builtin_reflect, - builtin_textureCubeLod, - builtin_step, - builtin_texture1D, builtin_greaterThan, - builtin_texture3D, - builtin_not, - builtin_texture2DProjLod, + builtin_greaterThanEqual, builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, builtin_noise1, - builtin_refract, + builtin_noise2, builtin_noise3, - builtin_texture2DLod, - builtin_min, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_pow, builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, builtin_texture1DProjLod, + builtin_texture2D, + builtin_texture2DLod, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, builtin_textureCube, - builtin_length, - builtin_texture1DLod, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, + builtin_textureCubeLod, }; -static const char *prototypes_for_110_frag = +static const char *prototypes_for_120_frag = "(\n" "(function radians\n" " (signature float\n" @@ -8436,6 +8297,119 @@ static const char *prototypes_for_110_frag = " (parameters\n" " (declare (in) mat4 x)\n" " (declare (in) mat4 y))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) mat2x3 x)\n" + " (declare (in) mat2x3 y))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat2x4 x)\n" + " (declare (in) mat2x4 y))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat3x2 x)\n" + " (declare (in) mat3x2 y))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat3x4 x)\n" + " (declare (in) mat3x4 y))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat4x2 x)\n" + " (declare (in) mat4x2 y))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat4x3 x)\n" + " (declare (in) mat4x3 y))\n" + " ()))\n" + "(function outerProduct\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec4 r))\n" + " ()))\n" + "(function transpose\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) mat2 m))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 m))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 m))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) mat3x2 m))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat2x3 m))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat4x2 m))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat2x4 m))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat4x3 m))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat3x4 m))\n" " ()))\n" "(function lessThan\n" " (signature bvec2\n" @@ -8966,127 +8940,1562 @@ static const char *prototypes_for_110_frag = " (declare (in) vec4 x))\n" " ())))" ; -static const char *functions_for_110_frag [] = { +static const char *functions_for_120_frag [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_matrixCompMult, - builtin_noise2, - builtin_pow, - builtin_texture2DProj, - builtin_fwidth, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, + builtin_cos, + builtin_cross, + builtin_dFdx, + builtin_dFdy, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_any, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_shadow2DProj, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_dFdx, - builtin_sin, - builtin_shadow2D, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_shadow1DProj, - builtin_ceil, - builtin_reflect, - builtin_step, - builtin_texture1D, + builtin_fwidth, builtin_greaterThan, - builtin_texture3D, - builtin_not, + builtin_greaterThanEqual, builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, builtin_noise1, - builtin_refract, + builtin_noise2, builtin_noise3, - builtin_min, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_outerProduct, + builtin_pow, builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DProj, + builtin_shadow2D, + builtin_shadow2DProj, + builtin_sign, + builtin_sin, builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DProj, + builtin_texture2D, + builtin_texture2DProj, + builtin_texture3D, + builtin_texture3DProj, builtin_textureCube, - builtin_length, - builtin_dFdy, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, + builtin_transpose, }; -static const char *prototypes_for_EXT_texture_array_vert = +static const char *prototypes_for_120_vert = "(\n" - "(function texture1DArray\n" + "(function radians\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float degrees))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 degrees))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 degrees))\n" + " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec4 degrees))\n" + " ()))\n" + "(function degrees\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float radians))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 radians))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 radians))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 radians))\n" + " ()))\n" + "(function sin\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 angle))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function cos\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 angle))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function tan\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 angle))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function asin\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 angle))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function acos\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float angle))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 angle))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 angle))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 angle))\n" + " ()))\n" + "(function atan\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float y)\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float y_over_x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 y_over_x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 y_over_x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 y_over_x))\n" + " ()))\n" + "(function pow\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ()))\n" + "(function exp\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function log\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function exp2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function log2\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function sqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function inversesqrt\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function abs\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function sign\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function floor\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function ceil\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function fract\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function mod\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ()))\n" + "(function min\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" + " ()))\n" + "(function max\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) float y))\n" + " ()))\n" + "(function clamp\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 minVal)\n" + " (declare (in) vec2 maxVal))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 minVal)\n" + " (declare (in) vec3 maxVal))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 minVal)\n" + " (declare (in) vec4 maxVal))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) float minVal)\n" + " (declare (in) float maxVal))\n" + " ()))\n" + "(function mix\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y)\n" + " (declare (in) float a))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y)\n" + " (declare (in) vec2 a))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y)\n" + " (declare (in) vec3 a))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y)\n" + " (declare (in) vec4 a))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y)\n" + " (declare (in) float a))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y)\n" + " (declare (in) float a))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y)\n" + " (declare (in) float a))\n" + " ()))\n" + "(function step\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 edge)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 edge)\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 edge)\n" + " (declare (in) vec4 x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float edge)\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function smoothstep\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 edge0)\n" + " (declare (in) vec2 edge1)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 edge0)\n" + " (declare (in) vec3 edge1)\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 edge0)\n" + " (declare (in) vec4 edge1)\n" + " (declare (in) vec4 x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float edge0)\n" + " (declare (in) float edge1)\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function length\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function distance\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float p0)\n" + " (declare (in) float p1))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec2 p0)\n" + " (declare (in) vec2 p1))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 p0)\n" + " (declare (in) vec3 p1))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 p0)\n" + " (declare (in) vec4 p1))\n" + " ()))\n" + "(function dot\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x)\n" + " (declare (in) float y))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ()))\n" + "(function cross\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ()))\n" + "(function normalize\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function ftransform\n" + " (signature vec4\n" + " (parameters)\n" + " ()))\n" + "(function faceforward\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float N)\n" + " (declare (in) float I)\n" + " (declare (in) float Nref))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 N)\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 Nref))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 N)\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 Nref))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 N)\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 Nref))\n" + " ()))\n" + "(function reflect\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float I)\n" + " (declare (in) float N))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N))\n" + " ()))\n" + "(function refract\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float I)\n" + " (declare (in) float N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 I)\n" + " (declare (in) vec2 N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 I)\n" + " (declare (in) vec3 N)\n" + " (declare (in) float eta))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 I)\n" + " (declare (in) vec4 N)\n" + " (declare (in) float eta))\n" + " ()))\n" + "(function matrixCompMult\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) mat2 x)\n" + " (declare (in) mat2 y))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 x)\n" + " (declare (in) mat3 y))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 x)\n" + " (declare (in) mat4 y))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) mat2x3 x)\n" + " (declare (in) mat2x3 y))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat2x4 x)\n" + " (declare (in) mat2x4 y))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat3x2 x)\n" + " (declare (in) mat3x2 y))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat3x4 x)\n" + " (declare (in) mat3x4 y))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat4x2 x)\n" + " (declare (in) mat4x2 y))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat4x3 x)\n" + " (declare (in) mat4x3 y))\n" + " ()))\n" + "(function outerProduct\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec2 r))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) vec2 c)\n" + " (declare (in) vec4 r))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) vec4 c)\n" + " (declare (in) vec3 r))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) vec3 c)\n" + " (declare (in) vec4 r))\n" + " ()))\n" + "(function transpose\n" + " (signature mat2\n" + " (parameters\n" + " (declare (in) mat2 m))\n" + " ())\n" + " (signature mat3\n" + " (parameters\n" + " (declare (in) mat3 m))\n" + " ())\n" + " (signature mat4\n" + " (parameters\n" + " (declare (in) mat4 m))\n" + " ())\n" + " (signature mat2x3\n" + " (parameters\n" + " (declare (in) mat3x2 m))\n" + " ())\n" + " (signature mat3x2\n" + " (parameters\n" + " (declare (in) mat2x3 m))\n" + " ())\n" + " (signature mat2x4\n" + " (parameters\n" + " (declare (in) mat4x2 m))\n" + " ())\n" + " (signature mat4x2\n" + " (parameters\n" + " (declare (in) mat2x4 m))\n" + " ())\n" + " (signature mat3x4\n" + " (parameters\n" + " (declare (in) mat4x3 m))\n" + " ())\n" + " (signature mat4x3\n" + " (parameters\n" + " (declare (in) mat3x4 m))\n" + " ()))\n" + "(function lessThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ()))\n" + "(function lessThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ()))\n" + "(function greaterThan\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ()))\n" + "(function greaterThanEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ()))\n" + "(function equal\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) bvec2 x)\n" + " (declare (in) bvec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) bvec3 x)\n" + " (declare (in) bvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) bvec4 x)\n" + " (declare (in) bvec4 y))\n" + " ()))\n" + "(function notEqual\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) vec2 x)\n" + " (declare (in) vec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) vec3 x)\n" + " (declare (in) vec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) vec4 x)\n" + " (declare (in) vec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) ivec2 x)\n" + " (declare (in) ivec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) ivec3 x)\n" + " (declare (in) ivec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) ivec4 x)\n" + " (declare (in) ivec4 y))\n" + " ())\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) bvec2 x)\n" + " (declare (in) bvec2 y))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) bvec3 x)\n" + " (declare (in) bvec3 y))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) bvec4 x)\n" + " (declare (in) bvec4 y))\n" + " ()))\n" + "(function any\n" + " (signature bool\n" + " (parameters\n" + " (declare (in) bvec2 x))\n" + " ())\n" + " (signature bool\n" + " (parameters\n" + " (declare (in) bvec3 x))\n" + " ())\n" + " (signature bool\n" + " (parameters\n" + " (declare (in) bvec4 x))\n" + " ()))\n" + "(function all\n" + " (signature bool\n" + " (parameters\n" + " (declare (in) bvec2 x))\n" + " ())\n" + " (signature bool\n" + " (parameters\n" + " (declare (in) bvec3 x))\n" + " ())\n" + " (signature bool\n" + " (parameters\n" + " (declare (in) bvec4 x))\n" + " ()))\n" + "(function not\n" + " (signature bvec2\n" + " (parameters\n" + " (declare (in) bvec2 x))\n" + " ())\n" + " (signature bvec3\n" + " (parameters\n" + " (declare (in) bvec3 x))\n" + " ())\n" + " (signature bvec4\n" + " (parameters\n" + " (declare (in) bvec4 x))\n" + " ()))\n" + "(function texture1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord))\n" + " ()))\n" + "(function texture1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" " (declare (in) vec2 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord))\n" " ()))\n" - "(function texture1DArrayLod\n" + "(function texture1DLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) float coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" " (declare (in) vec2 coord)\n" " (declare (in) float lod))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function texture2DArray\n" + "(function texture2D\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord))\n" + " ()))\n" + "(function texture2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 coord))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord))\n" " ()))\n" - "(function texture2DArrayLod\n" + "(function texture2DLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function texture2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" " (declare (in) vec3 coord)\n" " (declare (in) float lod))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function shadow1DArray\n" + "(function texture3D\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) sampler3D sampler)\n" " (declare (in) vec3 coord))\n" " ()))\n" - "(function shadow1DArrayLod\n" + "(function texture3DProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function texture3DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler3D sampler)\n" " (declare (in) vec3 coord)\n" " (declare (in) float lod))\n" " ()))\n" - "(function shadow2DArray\n" + "(function texture3DProjLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" + " (declare (in) sampler3D sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function textureCube\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function textureCubeLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) samplerCube sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow2D\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord))\n" + " ()))\n" + "(function shadow1DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord))\n" + " ()))\n" + "(function shadow2DProj\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" " (declare (in) vec4 coord))\n" + " ()))\n" + "(function shadow1DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow1DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function shadow2DProjLod\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) vec4 coord)\n" + " (declare (in) float lod))\n" + " ()))\n" + "(function noise1\n" + " (signature float\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature float\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise2\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec2\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise3\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec3\n" + " (parameters\n" + " (declare (in) vec4 x))\n" + " ()))\n" + "(function noise4\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) float x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec2 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec3 x))\n" + " ())\n" + " (signature vec4\n" + " (parameters\n" + " (declare (in) vec4 x))\n" " ())))" ; -static const char *functions_for_EXT_texture_array_vert [] = { - builtin_texture1DArrayLod, - builtin_shadow2DArray, - builtin_texture2DArrayLod, - builtin_shadow1DArrayLod, - builtin_shadow1DArray, - builtin_texture2DArray, - builtin_texture1DArray, +static const char *functions_for_120_vert [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, + builtin_clamp, + builtin_cos, + builtin_cross, + builtin_degrees, + builtin_distance, + builtin_dot, + builtin_equal, + builtin_exp, + builtin_exp2, + builtin_faceforward, + builtin_floor, + builtin_fract, + builtin_ftransform, + builtin_greaterThan, + builtin_greaterThanEqual, + builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, + builtin_max, + builtin_min, + builtin_mix, + builtin_mod, + builtin_noise1, + builtin_noise2, + builtin_noise3, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, + builtin_outerProduct, + builtin_pow, + builtin_radians, + builtin_reflect, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, + builtin_texture1DProjLod, + builtin_texture2D, + builtin_texture2DLod, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, + builtin_textureCube, + builtin_textureCubeLod, + builtin_transpose, }; static const char *prototypes_for_130_frag = "(\n" @@ -12064,130 +13473,92 @@ static const char *prototypes_for_130_frag = " ())))" ; static const char *functions_for_130_frag [] = { + builtin_abs, + builtin_acos, builtin_all, - builtin_textureProj, - builtin_fwidth, - builtin_texture2DProj, - builtin_shadow1DProjLod, - builtin_texture3DLod, - builtin_mix, - builtin_texture, - builtin_degrees, + builtin_any, + builtin_asin, + builtin_atan, builtin_ceil, - builtin_texture1D, - builtin_not, - builtin_mod, - builtin_radians, - builtin_smoothstep, - builtin_textureProjGrad, - builtin_lessThan, - builtin_dFdy, - builtin_textureGrad, builtin_clamp, + builtin_cos, builtin_cosh, - builtin_asin, - builtin_texture1DProj, + builtin_cross, builtin_dFdx, - builtin_shadow2DProj, - builtin_textureLod, - builtin_faceforward, - builtin_abs, - builtin_log2, - builtin_lessThanEqual, - builtin_transpose, - builtin_step, - builtin_sinh, - builtin_cos, - builtin_shadow2DProjLod, + builtin_dFdy, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, - builtin_length, - builtin_texelFetch, - builtin_matrixCompMult, - builtin_pow, - builtin_texture2DProjLod, - builtin_textureProjLod, - builtin_log, + builtin_exp, builtin_exp2, + builtin_faceforward, + builtin_floor, builtin_fract, - builtin_shadow1DLod, - builtin_texture1DLod, + builtin_fwidth, builtin_greaterThan, - builtin_texture3DProj, - builtin_sign, - builtin_inversesqrt, - builtin_distance, - builtin_refract, - builtin_tanh, - builtin_texture1DProjLod, - builtin_texture2D, builtin_greaterThanEqual, - builtin_texture3DProjLod, - builtin_tan, - builtin_any, - builtin_normalize, - builtin_shadow1DProj, - builtin_floor, - builtin_cross, - builtin_sqrt, - builtin_textureCubeLod, - builtin_sin, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_atan, + builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, + builtin_log2, + builtin_matrixCompMult, builtin_max, - builtin_reflect, - builtin_texture3D, - builtin_acos, + builtin_min, + builtin_mix, + builtin_mod, + builtin_noise1, + builtin_noise2, + builtin_noise3, builtin_noise4, + builtin_normalize, + builtin_not, builtin_notEqual, builtin_outerProduct, + builtin_pow, + builtin_radians, + builtin_reflect, + builtin_refract, builtin_shadow1D, - builtin_noise1, - builtin_noise2, - builtin_noise3, - builtin_min, - builtin_textureCube, - builtin_exp, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, + builtin_shadow2DProjLod, + builtin_sign, + builtin_sin, + builtin_sinh, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, + builtin_tanh, + builtin_texelFetch, + builtin_texture, + builtin_texture1D, + builtin_texture1DLod, + builtin_texture1DProj, + builtin_texture1DProjLod, + builtin_texture2D, builtin_texture2DLod, - builtin_dot, -}; -static const char *prototypes_for_ARB_texture_rectangle_vert = - "(\n" - "(function texture2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_ARB_texture_rectangle_vert [] = { - builtin_texture2DRect, - builtin_shadow2DRectProj, - builtin_shadow2DRect, - builtin_texture2DRectProj, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, + builtin_textureCube, + builtin_textureCubeLod, + builtin_textureGrad, + builtin_textureLod, + builtin_textureProj, + builtin_textureProjGrad, + builtin_textureProjLod, + builtin_transpose, }; static const char *prototypes_for_130_vert = "(\n" @@ -15118,90 +16489,90 @@ static const char *prototypes_for_130_vert = " ())))" ; static const char *functions_for_130_vert [] = { + builtin_abs, + builtin_acos, + builtin_all, + builtin_any, + builtin_asin, + builtin_atan, + builtin_ceil, builtin_clamp, - builtin_shadow2DLod, - builtin_matrixCompMult, - builtin_textureProj, - builtin_noise2, - builtin_texture3DProjLod, - builtin_pow, - builtin_texture2DProj, - builtin_greaterThanEqual, + builtin_cos, builtin_cosh, - builtin_texture3DProj, - builtin_textureProjLod, - builtin_texture, - builtin_texture2D, + builtin_cross, + builtin_degrees, + builtin_distance, + builtin_dot, builtin_equal, + builtin_exp, + builtin_exp2, builtin_faceforward, - builtin_tan, - builtin_shadow2DProj, - builtin_shadow1DProjLod, - builtin_any, - builtin_shadow1DProj, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_texture3DLod, - builtin_textureLod, builtin_fract, - builtin_abs, - builtin_degrees, - builtin_shadow1DLod, builtin_ftransform, - builtin_sin, - builtin_shadow2D, - builtin_noise3, - builtin_texture2DProjLod, - builtin_all, + builtin_greaterThan, + builtin_greaterThanEqual, + builtin_inversesqrt, + builtin_length, + builtin_lessThan, + builtin_lessThanEqual, + builtin_log, builtin_log2, - builtin_textureGrad, - builtin_atan, - builtin_notEqual, + builtin_matrixCompMult, builtin_max, - builtin_lessThanEqual, - builtin_transpose, + builtin_min, + builtin_mix, + builtin_mod, + builtin_noise1, + builtin_noise2, + builtin_noise3, + builtin_noise4, + builtin_normalize, + builtin_not, + builtin_notEqual, builtin_outerProduct, - builtin_ceil, + builtin_pow, + builtin_radians, builtin_reflect, - builtin_textureCubeLod, - builtin_step, - builtin_texture1D, - builtin_greaterThan, - builtin_texture3D, - builtin_sinh, + builtin_refract, + builtin_shadow1D, + builtin_shadow1DLod, + builtin_shadow1DProj, + builtin_shadow1DProjLod, + builtin_shadow2D, + builtin_shadow2DLod, + builtin_shadow2DProj, builtin_shadow2DProjLod, - builtin_not, builtin_sign, - builtin_inversesqrt, - builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, - builtin_noise1, - builtin_refract, + builtin_sin, + builtin_sinh, + builtin_smoothstep, + builtin_sqrt, + builtin_step, + builtin_tan, builtin_tanh, builtin_texelFetch, - builtin_min, - builtin_radians, - builtin_smoothstep, - builtin_textureProjGrad, - builtin_texture1DProjLod, - builtin_textureCube, - builtin_length, + builtin_texture, + builtin_texture1D, builtin_texture1DLod, + builtin_texture1DProj, + builtin_texture1DProjLod, + builtin_texture2D, builtin_texture2DLod, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, + builtin_texture2DProj, + builtin_texture2DProjLod, + builtin_texture3D, + builtin_texture3DLod, + builtin_texture3DProj, + builtin_texture3DProjLod, + builtin_textureCube, + builtin_textureCubeLod, + builtin_textureGrad, + builtin_textureLod, + builtin_textureProj, + builtin_textureProjGrad, + builtin_textureProjLod, + builtin_transpose, }; static const char *prototypes_for_ARB_texture_rectangle_frag = "(\n" @@ -15236,1527 +16607,156 @@ static const char *prototypes_for_ARB_texture_rectangle_frag = " ())))" ; static const char *functions_for_ARB_texture_rectangle_frag [] = { - builtin_texture2DRect, - builtin_shadow2DRectProj, builtin_shadow2DRect, + builtin_shadow2DRectProj, + builtin_texture2DRect, builtin_texture2DRectProj, }; -static const char *prototypes_for_120_frag = +static const char *prototypes_for_ARB_texture_rectangle_vert = "(\n" - "(function radians\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float degrees))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 degrees))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 degrees))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 degrees))\n" - " ()))\n" - "(function degrees\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float radians))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 radians))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 radians))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 radians))\n" - " ()))\n" - "(function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function cos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function tan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function asin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function acos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function atan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y_over_x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y_over_x))\n" - " ()))\n" - "(function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function abs\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sign\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ceil\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function fract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function min\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function max\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ()))\n" - "(function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) float a))\n" - " ()))\n" - "(function step\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function length\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function distance\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ()))\n" - "(function dot\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function cross\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ()))\n" - "(function normalize\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" - " ())\n" + "(function texture2DRect\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec2 coord))\n" " ()))\n" - "(function reflect\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N))\n" - " ())\n" + "(function texture2DRectProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N))\n" - " ()))\n" - "(function refract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec3 coord))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ()))\n" - "(function outerProduct\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec4 r))\n" - " ()))\n" - "(function transpose\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 m))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 m))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 m))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat3x2 m))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat4x2 m))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat4x3 m))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat3x4 m))\n" - " ()))\n" - "(function lessThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function lessThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function equal\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function notEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function any\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function not\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" + " (declare (in) sampler2DRect sampler)\n" + " (declare (in) vec4 coord))\n" " ()))\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord))\n" - " ())\n" + "(function shadow2DRect\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" + " (declare (in) sampler2DRectShadow sampler)\n" + " (declare (in) vec3 coord))\n" " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord))\n" - " ())\n" + "(function shadow2DRectProj\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1D sampler)\n" + " (declare (in) sampler2DRectShadow sampler)\n" " (declare (in) vec4 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2D\n" + " ())))" +; +static const char *functions_for_ARB_texture_rectangle_vert [] = { + builtin_shadow2DRect, + builtin_shadow2DRectProj, + builtin_texture2DRect, + builtin_texture2DRectProj, +}; +static const char *prototypes_for_EXT_texture_array_frag = + "(\n" + "(function texture1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" + " (declare (in) sampler1DArray sampler)\n" " (declare (in) vec2 coord))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" + " (declare (in) sampler1DArray sampler)\n" " (declare (in) vec2 coord)\n" " (declare (in) float bias))\n" " ()))\n" - "(function texture2DProj\n" + "(function texture2DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" + " (declare (in) sampler2DArray sampler)\n" " (declare (in) vec3 coord))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" + " (declare (in) sampler2DArray sampler)\n" " (declare (in) vec3 coord)\n" " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" " ()))\n" - "(function texture3D\n" + "(function shadow1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" + " (declare (in) sampler1DArrayShadow sampler)\n" " (declare (in) vec3 coord))\n" " ())\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" + " (declare (in) sampler1DArrayShadow sampler)\n" " (declare (in) vec3 coord)\n" " (declare (in) float bias))\n" " ()))\n" - "(function texture3DProj\n" + "(function shadow2DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" + " (declare (in) sampler2DArrayShadow sampler)\n" " (declare (in) vec4 coord))\n" - " ())\n" + " ())))" +; +static const char *functions_for_EXT_texture_array_frag [] = { + builtin_shadow1DArray, + builtin_shadow2DArray, + builtin_texture1DArray, + builtin_texture2DArray, +}; +static const char *prototypes_for_EXT_texture_array_vert = + "(\n" + "(function texture1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 coord))\n" " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" + "(function texture1DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) sampler1DArray sampler)\n" + " (declare (in) vec2 coord)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function shadow1D\n" + "(function texture2DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) sampler2DArray sampler)\n" " (declare (in) vec3 coord))\n" - " ())\n" + " ()))\n" + "(function texture2DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" + " (declare (in) sampler2DArray sampler)\n" " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) float lod))\n" " ()))\n" - "(function shadow2D\n" + "(function shadow1DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) sampler1DArrayShadow sampler)\n" " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())\n" + "(function shadow1DArrayLod\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" + " (declare (in) sampler1DArrayShadow sampler)\n" + " (declare (in) vec3 coord)\n" + " (declare (in) float lod))\n" " ()))\n" - "(function shadow2DProj\n" + "(function shadow2DArray\n" " (signature vec4\n" " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" + " (declare (in) sampler2DArrayShadow sampler)\n" " (declare (in) vec4 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise2\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise3\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise4\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" " ())))" ; -static const char *functions_for_120_frag [] = { - builtin_clamp, - builtin_matrixCompMult, - builtin_noise2, - builtin_pow, - builtin_texture2DProj, - builtin_fwidth, - builtin_greaterThanEqual, - builtin_sign, - builtin_texture3DProj, - builtin_texture2D, - builtin_equal, - builtin_faceforward, - builtin_tan, - builtin_any, - builtin_shadow1DProj, - builtin_normalize, - builtin_asin, - builtin_texture1DProj, - builtin_log, - builtin_floor, - builtin_exp2, - builtin_lessThan, - builtin_cross, - builtin_sqrt, - builtin_shadow2DProj, - builtin_fract, - builtin_abs, - builtin_degrees, - builtin_dFdx, - builtin_sin, - builtin_shadow2D, - builtin_all, - builtin_log2, - builtin_atan, - builtin_notEqual, - builtin_max, - builtin_lessThanEqual, - builtin_transpose, - builtin_outerProduct, - builtin_ceil, - builtin_reflect, - builtin_step, - builtin_texture1D, - builtin_greaterThan, - builtin_texture3D, - builtin_not, - builtin_inversesqrt, - builtin_mod, - builtin_noise4, - builtin_distance, - builtin_cos, - builtin_shadow1D, - builtin_noise1, - builtin_refract, - builtin_noise3, - builtin_min, - builtin_radians, - builtin_smoothstep, - builtin_textureCube, - builtin_length, - builtin_dFdy, - builtin_exp, - builtin_acos, - builtin_mix, - builtin_dot, +static const char *functions_for_EXT_texture_array_vert [] = { + builtin_shadow1DArray, + builtin_shadow1DArrayLod, + builtin_shadow2DArray, + builtin_texture1DArray, + builtin_texture1DArrayLod, + builtin_texture2DArray, + builtin_texture2DArrayLod, }; void *builtin_mem_ctx = NULL; @@ -16776,13 +16776,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link = 0; - if (state->target == vertex_shader && state->language_version == 120) { + if (state->target == fragment_shader && state->language_version == 110) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_120_vert, - functions_for_120_vert, - Elements(functions_for_120_vert )); + prototypes_for_110_frag, + functions_for_110_frag, + Elements(functions_for_110_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16792,13 +16792,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->EXT_texture_array_enable) { + if (state->target == vertex_shader && state->language_version == 110) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_EXT_texture_array_frag, - functions_for_EXT_texture_array_frag, - Elements(functions_for_EXT_texture_array_frag )); + prototypes_for_110_vert, + functions_for_110_vert, + Elements(functions_for_110_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16808,13 +16808,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->language_version == 110) { + if (state->target == fragment_shader && state->language_version == 120) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_110_vert, - functions_for_110_vert, - Elements(functions_for_110_vert )); + prototypes_for_120_frag, + functions_for_120_frag, + Elements(functions_for_120_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16824,13 +16824,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version == 110) { + if (state->target == vertex_shader && state->language_version == 120) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_110_frag, - functions_for_110_frag, - Elements(functions_for_110_frag )); + prototypes_for_120_vert, + functions_for_120_vert, + Elements(functions_for_120_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16840,13 +16840,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->EXT_texture_array_enable) { + if (state->target == fragment_shader && state->language_version == 130) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_EXT_texture_array_vert, - functions_for_EXT_texture_array_vert, - Elements(functions_for_EXT_texture_array_vert )); + prototypes_for_130_frag, + functions_for_130_frag, + Elements(functions_for_130_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16856,13 +16856,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version == 130) { + if (state->target == vertex_shader && state->language_version == 130) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_130_frag, - functions_for_130_frag, - Elements(functions_for_130_frag )); + prototypes_for_130_vert, + functions_for_130_vert, + Elements(functions_for_130_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16872,13 +16872,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->ARB_texture_rectangle_enable) { + if (state->target == fragment_shader && state->ARB_texture_rectangle_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_ARB_texture_rectangle_vert, - functions_for_ARB_texture_rectangle_vert, - Elements(functions_for_ARB_texture_rectangle_vert )); + prototypes_for_ARB_texture_rectangle_frag, + functions_for_ARB_texture_rectangle_frag, + Elements(functions_for_ARB_texture_rectangle_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16888,13 +16888,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == vertex_shader && state->language_version == 130) { + if (state->target == vertex_shader && state->ARB_texture_rectangle_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_130_vert, - functions_for_130_vert, - Elements(functions_for_130_vert )); + prototypes_for_ARB_texture_rectangle_vert, + functions_for_ARB_texture_rectangle_vert, + Elements(functions_for_ARB_texture_rectangle_vert )); talloc_steal(builtin_mem_ctx, sh); } @@ -16904,13 +16904,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->ARB_texture_rectangle_enable) { + if (state->target == fragment_shader && state->EXT_texture_array_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_ARB_texture_rectangle_frag, - functions_for_ARB_texture_rectangle_frag, - Elements(functions_for_ARB_texture_rectangle_frag )); + prototypes_for_EXT_texture_array_frag, + functions_for_EXT_texture_array_frag, + Elements(functions_for_EXT_texture_array_frag )); talloc_steal(builtin_mem_ctx, sh); } @@ -16920,13 +16920,13 @@ _mesa_glsl_initialize_functions(exec_list *instructions, state->num_builtins_to_link++; } - if (state->target == fragment_shader && state->language_version == 120) { + if (state->target == vertex_shader && state->EXT_texture_array_enable) { static gl_shader *sh = NULL; if (sh == NULL) { sh = read_builtins(GL_VERTEX_SHADER, - prototypes_for_120_frag, - functions_for_120_frag, - Elements(functions_for_120_frag )); + prototypes_for_EXT_texture_array_vert, + functions_for_EXT_texture_array_vert, + Elements(functions_for_EXT_texture_array_vert )); talloc_steal(builtin_mem_ctx, sh); } |