glsl2: Rework builtin function generation.

Each language version/extension and target now has a "profile" containing
all of the available builtin function prototypes.  These are written in
GLSL, and come directly out of the GLSL spec (except for expanding genType).

A new builtins/ir/ folder contains the hand-written IR for each builtin,
regardless of what version includes it.  Only those definitions that have
prototypes in the profile will be included.

The autogenerated IR for texture builtins is no longer written to disk,
so there's no longer any confusion as to what's hand-written or
generated.

All scripts are now in python instead of perl.
This commit is contained in:
Kenneth Graunke 2010-08-11 16:53:52 -07:00 committed by Ian Romanick
parent d802ba110f
commit 43ff8f1a4b
102 changed files with 16665 additions and 6612 deletions

View file

@ -164,7 +164,8 @@ glcpp/glcpp-lex.c: glcpp/glcpp-lex.l
glcpp/glcpp-parse.c: glcpp/glcpp-parse.y
bison -v -o "$@" --defines=glcpp/glcpp-parse.h $<
builtin_function.cpp: builtins/*/*
./builtins/tools/generate_builtins.pl > builtin_function.cpp
builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py
cp builtins/tools/builtin_function.cpp .
./builtins/tools/generate_builtins.py > builtin_function.cpp
-include depend

File diff suppressed because it is too large Load diff

View file

@ -1,50 +0,0 @@
((function clamp
(signature float
(parameters
(declare (in) float arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1)
(declare (in) vec2 arg2))
((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1)
(declare (in) vec3 arg2))
((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1)
(declare (in) vec4 arg2))
((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
))

View file

@ -1,32 +0,0 @@
((function matrixCompMult
(signature mat2
(parameters
(declare (in) mat2 x)
(declare (in) mat2 y))
((declare () mat2 z)
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(return (var_ref z))))
(signature mat3
(parameters
(declare (in) mat3 x)
(declare (in) mat3 y))
((declare () mat3 z)
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(return (var_ref z))))
(signature mat4
(parameters
(declare (in) mat4 x)
(declare (in) mat4 y))
((declare () mat4 z)
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
(return (var_ref z))))
))

View file

@ -1,43 +0,0 @@
((function max
(signature float
(parameters
(declare (in) float arg0)
(declare (in) float arg1))
((return (expression float max (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) float arg1))
((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) float arg1))
((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) float arg1))
((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))
))

View file

@ -1,43 +0,0 @@
((function min
(signature float
(parameters
(declare (in) float arg0)
(declare (in) float arg1))
((return (expression float min (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) float arg1))
((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) float arg1))
((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) float arg1))
((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))
))

View file

@ -1,76 +0,0 @@
((function noise1
(signature float
(parameters
(declare (in) float x))
((return (constant float (0)))))
(signature float
(parameters
(declare (in) vec2 x))
((return (constant float (0)))))
(signature float
(parameters
(declare (in) vec3 x))
((return (constant float (0)))))
(signature float
(parameters
(declare (in) vec4 x))
((return (constant float (0)))))
)
(function noise2
(signature vec2
(parameters
(declare (in) float x))
((return (constant vec2 (0 0)))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (constant vec2 (0 0)))))
(signature vec2
(parameters
(declare (in) vec3 x))
((return (constant vec2 (0 0)))))
(signature vec2
(parameters
(declare (in) vec4 x))
((return (constant vec2 (0 0)))))
)
(function noise3
(signature vec3
(parameters
(declare (in) float x))
((return (constant vec3 (0 0 0)))))
(signature vec3
(parameters
(declare (in) vec2 x))
((return (constant vec3 (0 0 0)))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (constant vec3 (0 0 0)))))
(signature vec3
(parameters
(declare (in) vec4 x))
((return (constant vec3 (0 0 0)))))
)
(function noise4
(signature vec4
(parameters
(declare (in) float x))
((return (constant vec4 (0 0 0 0)))))
(signature vec4
(parameters
(declare (in) vec2 x))
((return (constant vec4 (0 0 0 0)))))
(signature vec4
(parameters
(declare (in) vec3 x))
((return (constant vec4 (0 0 0 0)))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (constant vec4 (0 0 0 0)))))
)
)

View file

@ -1,21 +0,0 @@
((function sign
(signature float
(parameters
(declare (in) float x))
((return (expression float sign (var_ref x)))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (expression vec2 sign (var_ref x)))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (expression vec3 sign (var_ref x)))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (expression vec4 sign (var_ref x)))))
))

View file

@ -1,213 +0,0 @@
((function texture1D
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function texture1DLod
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
)
(function texture1DProj
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
)
(function texture1DProjLod
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
)
(function texture2D
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function texture2DLod
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
)
(function texture2DProj
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
)
(function texture2DProjLod
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
)
(function texture3D
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function texture3DLod
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
)
(function texture3DProj
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
)
(function texture3DProjLod
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
)
(function textureCube
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function textureCubeLod
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
)
(function shadow1D
(signature vec4
(parameters
(declare (in) sampler1DShadow sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))
)
(function shadow1DLod
(signature vec4
(parameters
(declare (in) sampler1DShadow sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))
)
(function shadow1DProj
(signature vec4
(parameters
(declare (in) sampler1DShadow sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))
)
(function shadow1DProjLod
(signature vec4
(parameters
(declare (in) sampler1DShadow sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))
)
(function shadow2D
(signature vec4
(parameters
(declare (in) sampler2DShadow sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))
)
(function shadow2DLod
(signature vec4
(parameters
(declare (in) sampler2DShadow sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))
)
(function shadow2DProj
(signature vec4
(parameters
(declare (in) sampler2DShadow sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) ))))
)
(function shadow2DProjLod
(signature vec4
(parameters
(declare (in) sampler2DShadow sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) ))))
))

View file

@ -1,73 +0,0 @@
((function dFdx
(signature float
(parameters
(declare (in) float p))
((return (expression float dFdx (var_ref p)))))
(signature vec2
(parameters
(declare (in) vec2 p))
((return (expression vec2 dFdx (var_ref p)))))
(signature vec3
(parameters
(declare (in) vec3 p))
((return (expression vec3 dFdx (var_ref p)))))
(signature vec4
(parameters
(declare (in) vec4 p))
((return (expression vec4 dFdx (var_ref p)))))
)
(function dFdy
(signature float
(parameters
(declare (in) float p))
((return (expression float dFdy (var_ref p)))))
(signature vec2
(parameters
(declare (in) vec2 p))
((return (expression vec2 dFdy (var_ref p)))))
(signature vec3
(parameters
(declare (in) vec3 p))
((return (expression vec3 dFdy (var_ref p)))))
(signature vec4
(parameters
(declare (in) vec4 p))
((return (expression vec4 dFdy (var_ref p)))))
)
(function fwidth
(signature float
(parameters
(declare (in) float p))
((return (expression float +
(expression float abs (expression float dFdx (var_ref p)))
(expression float abs (expression float dFdy (var_ref p)))))))
(signature vec2
(parameters
(declare (in) vec2 p))
((return (expression vec2 +
(expression vec2 abs (expression vec2 dFdx (var_ref p)))
(expression vec2 abs (expression vec2 dFdy (var_ref p)))))))
(signature vec3
(parameters
(declare (in) vec3 p))
((return (expression vec3 +
(expression vec3 abs (expression vec3 dFdx (var_ref p)))
(expression vec3 abs (expression vec3 dFdy (var_ref p)))))))
(signature vec4
(parameters
(declare (in) vec4 p))
((return (expression vec4 +
(expression vec4 abs (expression vec4 dFdx (var_ref p)))
(expression vec4 abs (expression vec4 dFdy (var_ref p)))))))
))

View file

@ -1,113 +0,0 @@
((function texture1D
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
)
(function texture1DProj
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
)
(function texture2D
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
)
(function texture2DProj
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
)
(function texture3D
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
)
(function texture3DProj
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
)
(function textureCube
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
)
(function shadow1D
(signature vec4
(parameters
(declare (in) sampler1DShadow sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))
)
(function shadow1DProj
(signature vec4
(parameters
(declare (in) sampler1DShadow sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))
)
(function shadow2D
(signature vec4
(parameters
(declare (in) sampler2DShadow sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))
)
(function shadow2DProj
(signature vec4
(parameters
(declare (in) sampler2DShadow sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) ))))
))

View file

@ -1,31 +0,0 @@
((function equal
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,31 +0,0 @@
((function greaterThan
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,31 +0,0 @@
((function greaterThanEqual
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,31 +0,0 @@
((function lessThan
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,31 +0,0 @@
((function lessThanEqual
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,39 +0,0 @@
((function mix
(signature float
(parameters
(declare (in) float v1)
(declare (in) float v2)
(declare (in) bool a))
((assign (var_ref a) (var_ref v1) (var_ref v2))
(return (var_ref v1))))
(signature vec2
(parameters
(declare (in) vec2 v1)
(declare (in) vec2 v2)
(declare (in) bvec2 a))
((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
(assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
(return (var_ref v1))))
(signature vec3
(parameters
(declare (in) vec3 v1)
(declare (in) vec3 v2)
(declare (in) bvec3 a))
((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
(assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
(assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))
(return (var_ref v1))))
(signature vec4
(parameters
(declare (in) vec4 v1)
(declare (in) vec4 v2)
(declare (in) bvec4 a))
((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
(assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
(assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))
(assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))
(return (var_ref v1))))
))

View file

@ -1,31 +0,0 @@
((function notEqual
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,107 +0,0 @@
((function texelFetch
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) int P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) int P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) int P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) ivec2 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) ivec2 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) ivec2 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) ivec3 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) ivec3 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) ivec3 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) ivec2 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler1DArray sampler)
(declare (in) ivec2 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler1DArray sampler)
(declare (in) ivec2 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) ivec3 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler2DArray sampler)
(declare (in) ivec3 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler2DArray sampler)
(declare (in) ivec3 P)
(declare (in) int lod) )
((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) ))))
))

View file

@ -1,110 +0,0 @@
((function texture
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) float P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) float P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature ivec4
(parameters
(declare (in) isamplerCube sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature uvec4
(parameters
(declare (in) usamplerCube sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature ivec4
(parameters
(declare (in) isampler1DArray sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature uvec4
(parameters
(declare (in) usampler1DArray sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature ivec4
(parameters
(declare (in) isampler2DArray sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
(signature uvec4
(parameters
(declare (in) usampler2DArray sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
))

View file

@ -1,147 +0,0 @@
((function textureGrad
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) float P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) float P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec2 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec2 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isamplerCube sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usamplerCube sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) ))))
)
)

View file

@ -1,128 +0,0 @@
((function textureLod
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) float P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) float P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isamplerCube sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usamplerCube sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
))

View file

@ -1,92 +0,0 @@
((function textureProj
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ))))
))

View file

@ -1,122 +0,0 @@
((function textureProjGrad
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec2 P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec2 P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec4 P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec4 P)
(declare (in) float dPdx)
(declare (in) float dPdy) )
((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec3 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec3 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec4 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec4 P)
(declare (in) vec2 dPdx)
(declare (in) vec2 dPdy) )
((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec4 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec4 P)
(declare (in) vec3 dPdx)
(declare (in) vec3 dPdy) )
((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) ))))
))

View file

@ -1,107 +0,0 @@
((function textureProjLod
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec4 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) ))))
))

View file

@ -1,128 +0,0 @@
((function texture
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) float P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) float P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) float P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) samplerCube sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isamplerCube sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usamplerCube sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
))

View file

@ -1,107 +0,0 @@
((function textureProj
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler1D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler1D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler1D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler2D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler2D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler2D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature vec4
(parameters
(declare (in) sampler3D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature ivec4
(parameters
(declare (in) isampler3D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
(signature uvec4
(parameters
(declare (in) usampler3D sampler)
(declare (in) vec4 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) ))))
))

View file

@ -1,16 +0,0 @@
((function texture2DRect
(signature vec4
(parameters
(declare (in) sampler2DRect sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function shadow2DRect
(signature vec4
(parameters
(declare (in) sampler2DRectShadow sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))
))

View file

@ -1,59 +0,0 @@
((function texture1DArray
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function texture1DArrayLod
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
)
(function texture2DArray
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () ))))
)
(function texture2DArrayLod
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) ))))
)
(function shadow1DArray
(signature vec4
(parameters
(declare (in) sampler1DArrayShadow sampler)
(declare (in) vec3 P) )
((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) ))))
)
(function shadow1DArrayLod
(signature vec4
(parameters
(declare (in) sampler1DArrayShadow sampler)
(declare (in) vec3 P)
(declare (in) float lod) )
((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) ))))
)
(function shadow2DArray
(signature vec4
(parameters
(declare (in) sampler2DArrayShadow sampler)
(declare (in) vec4 P) )
((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) ))))
))

View file

@ -1,27 +0,0 @@
((function texture1DArray
(signature vec4
(parameters
(declare (in) sampler1DArray sampler)
(declare (in) vec2 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
)
(function texture2DArray
(signature vec4
(parameters
(declare (in) sampler2DArray sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) ))))
)
(function shadow1DArray
(signature vec4
(parameters
(declare (in) sampler1DArrayShadow sampler)
(declare (in) vec3 P)
(declare (in) float bias) )
((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) ))))
))

22
src/glsl/builtins/ir/acos Normal file
View file

@ -0,0 +1,22 @@
((function acos
(signature float
(parameters
(declare (in) float x))
((return (expression float - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (expression vec2 - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (expression vec3 - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (expression vec4 - (constant float (1.5707963))
(call asin ((var_ref x)))))))
))

View file

@ -93,28 +93,5 @@
(constant float (-0.2121144))
(expression vec4 *
(constant float (0.0742610))
(expression vec4 abs (var_ref x)))))))))))
))
(function acos
(signature float
(parameters
(declare (in) float x))
((return (expression float - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (expression vec2 - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (expression vec3 - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (expression vec4 - (constant float (1.5707963))
(call asin ((var_ref x)))))))
(expression vec4 abs (var_ref x))))))))))))
))

View file

@ -1,4 +1,53 @@
((function clamp
(signature float
(parameters
(declare (in) float arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1)
(declare (in) vec2 arg2))
((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1)
(declare (in) vec3 arg2))
((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1)
(declare (in) vec4 arg2))
((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) float arg1)
(declare (in) float arg2))
((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1)))))
(signature int
(parameters
(declare (in) int arg0)

21
src/glsl/builtins/ir/dFdx Normal file
View file

@ -0,0 +1,21 @@
((function dFdx
(signature float
(parameters
(declare (in) float p))
((return (expression float dFdx (var_ref p)))))
(signature vec2
(parameters
(declare (in) vec2 p))
((return (expression vec2 dFdx (var_ref p)))))
(signature vec3
(parameters
(declare (in) vec3 p))
((return (expression vec3 dFdx (var_ref p)))))
(signature vec4
(parameters
(declare (in) vec4 p))
((return (expression vec4 dFdx (var_ref p)))))
))

21
src/glsl/builtins/ir/dFdy Normal file
View file

@ -0,0 +1,21 @@
((function dFdy
(signature float
(parameters
(declare (in) float p))
((return (expression float dFdy (var_ref p)))))
(signature vec2
(parameters
(declare (in) vec2 p))
((return (expression vec2 dFdy (var_ref p)))))
(signature vec3
(parameters
(declare (in) vec3 p))
((return (expression vec3 dFdy (var_ref p)))))
(signature vec4
(parameters
(declare (in) vec4 p))
((return (expression vec4 dFdy (var_ref p)))))
))

View file

@ -58,4 +58,34 @@
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -0,0 +1,29 @@
((function fwidth
(signature float
(parameters
(declare (in) float p))
((return (expression float +
(expression float abs (expression float dFdx (var_ref p)))
(expression float abs (expression float dFdy (var_ref p)))))))
(signature vec2
(parameters
(declare (in) vec2 p))
((return (expression vec2 +
(expression vec2 abs (expression vec2 dFdx (var_ref p)))
(expression vec2 abs (expression vec2 dFdy (var_ref p)))))))
(signature vec3
(parameters
(declare (in) vec3 p))
((return (expression vec3 +
(expression vec3 abs (expression vec3 dFdx (var_ref p)))
(expression vec3 abs (expression vec3 dFdy (var_ref p)))))))
(signature vec4
(parameters
(declare (in) vec4 p))
((return (expression vec4 +
(expression vec4 abs (expression vec4 dFdx (var_ref p)))
(expression vec4 abs (expression vec4 dFdy (var_ref p)))))))
))

View file

@ -58,4 +58,34 @@
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -58,4 +58,34 @@
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -58,4 +58,34 @@
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -58,4 +58,34 @@
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,4 +1,34 @@
((function matrixCompMult
(signature mat2
(parameters
(declare (in) mat2 x)
(declare (in) mat2 y))
((declare () mat2 z)
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(return (var_ref z))))
(signature mat3
(parameters
(declare (in) mat3 x)
(declare (in) mat3 y))
((declare () mat3 z)
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(return (var_ref z))))
(signature mat4
(parameters
(declare (in) mat4 x)
(declare (in) mat4 y))
((declare () mat4 z)
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
(return (var_ref z))))
(signature mat2x3
(parameters
(declare (in) mat2x3 x)

View file

@ -1,4 +1,46 @@
((function max
(signature float
(parameters
(declare (in) float arg0)
(declare (in) float arg1))
((return (expression float max (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) float arg1))
((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) float arg1))
((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) float arg1))
((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))
(signature int
(parameters
(declare (in) int arg0)

View file

@ -1,4 +1,46 @@
((function min
(signature float
(parameters
(declare (in) float arg0)
(declare (in) float arg1))
((return (expression float min (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))
(signature vec2
(parameters
(declare (in) vec2 arg0)
(declare (in) float arg1))
((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))
(signature vec3
(parameters
(declare (in) vec3 arg0)
(declare (in) float arg1))
((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))
(signature vec4
(parameters
(declare (in) vec4 arg0)
(declare (in) float arg1))
((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))
(signature int
(parameters
(declare (in) int arg0)

View file

@ -47,4 +47,42 @@
(declare (in) vec4 arg1)
(declare (in) float arg2))
((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2))))))
(signature float
(parameters
(declare (in) float v1)
(declare (in) float v2)
(declare (in) bool a))
((assign (var_ref a) (var_ref v1) (var_ref v2))
(return (var_ref v1))))
(signature vec2
(parameters
(declare (in) vec2 v1)
(declare (in) vec2 v2)
(declare (in) bvec2 a))
((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
(assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
(return (var_ref v1))))
(signature vec3
(parameters
(declare (in) vec3 v1)
(declare (in) vec3 v2)
(declare (in) bvec3 a))
((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
(assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
(assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))
(return (var_ref v1))))
(signature vec4
(parameters
(declare (in) vec4 v1)
(declare (in) vec4 v2)
(declare (in) bvec4 a))
((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
(assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
(assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))
(assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))
(return (var_ref v1))))
))

View file

@ -0,0 +1,18 @@
((function noise1
(signature float
(parameters
(declare (in) float x))
((return (constant float (0)))))
(signature float
(parameters
(declare (in) vec2 x))
((return (constant float (0)))))
(signature float
(parameters
(declare (in) vec3 x))
((return (constant float (0)))))
(signature float
(parameters
(declare (in) vec4 x))
((return (constant float (0)))))
))

View file

@ -0,0 +1,18 @@
((function noise2
(signature vec2
(parameters
(declare (in) float x))
((return (constant vec2 (0 0)))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (constant vec2 (0 0)))))
(signature vec2
(parameters
(declare (in) vec3 x))
((return (constant vec2 (0 0)))))
(signature vec2
(parameters
(declare (in) vec4 x))
((return (constant vec2 (0 0)))))
))

View file

@ -0,0 +1,18 @@
((function noise3
(signature vec3
(parameters
(declare (in) float x))
((return (constant vec3 (0 0 0)))))
(signature vec3
(parameters
(declare (in) vec2 x))
((return (constant vec3 (0 0 0)))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (constant vec3 (0 0 0)))))
(signature vec3
(parameters
(declare (in) vec4 x))
((return (constant vec3 (0 0 0)))))
))

View file

@ -0,0 +1,18 @@
((function noise4
(signature vec4
(parameters
(declare (in) float x))
((return (constant vec4 (0 0 0 0)))))
(signature vec4
(parameters
(declare (in) vec2 x))
((return (constant vec4 (0 0 0 0)))))
(signature vec4
(parameters
(declare (in) vec3 x))
((return (constant vec4 (0 0 0 0)))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (constant vec4 (0 0 0 0)))))
))

View file

@ -58,4 +58,34 @@
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
(assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
(assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))

View file

@ -1,4 +1,24 @@
((function sign
(signature float
(parameters
(declare (in) float x))
((return (expression float sign (var_ref x)))))
(signature vec2
(parameters
(declare (in) vec2 x))
((return (expression vec2 sign (var_ref x)))))
(signature vec3
(parameters
(declare (in) vec3 x))
((return (expression vec3 sign (var_ref x)))))
(signature vec4
(parameters
(declare (in) vec4 x))
((return (expression vec4 sign (var_ref x)))))
(signature int
(parameters
(declare (in) int x))

View file

@ -0,0 +1,364 @@
#version 110
/*
* 8.1 - Angle and Trigonometry Functions
*/
float radians(float degrees);
vec2 radians(vec2 degrees);
vec3 radians(vec3 degrees);
vec4 radians(vec4 degrees);
float degrees(float radians);
vec2 degrees(vec2 radians);
vec3 degrees(vec3 radians);
vec4 degrees(vec4 radians);
float sin(float angle);
vec2 sin(vec2 angle);
vec3 sin(vec3 angle);
vec4 sin(vec4 angle);
float cos(float angle);
vec2 cos(vec2 angle);
vec3 cos(vec3 angle);
vec4 cos(vec4 angle);
float tan(float angle);
vec2 tan(vec2 angle);
vec3 tan(vec3 angle);
vec4 tan(vec4 angle);
float asin(float angle);
vec2 asin(vec2 angle);
vec3 asin(vec3 angle);
vec4 asin(vec4 angle);
float acos(float angle);
vec2 acos(vec2 angle);
vec3 acos(vec3 angle);
vec4 acos(vec4 angle);
float atan(float y, float x);
vec2 atan(vec2 y, vec2 x);
vec3 atan(vec3 y, vec3 x);
vec4 atan(vec4 y, vec4 x);
float atan(float y_over_x);
vec2 atan(vec2 y_over_x);
vec3 atan(vec3 y_over_x);
vec4 atan(vec4 y_over_x);
/*
* 8.2 - Exponential Functions
*/
float pow(float x, float y);
vec2 pow(vec2 x, vec2 y);
vec3 pow(vec3 x, vec3 y);
vec4 pow(vec4 x, vec4 y);
float exp(float x);
vec2 exp(vec2 x);
vec3 exp(vec3 x);
vec4 exp(vec4 x);
float log(float x);
vec2 log(vec2 x);
vec3 log(vec3 x);
vec4 log(vec4 x);
float exp2(float x);
vec2 exp2(vec2 x);
vec3 exp2(vec3 x);
vec4 exp2(vec4 x);
float log2(float x);
vec2 log2(vec2 x);
vec3 log2(vec3 x);
vec4 log2(vec4 x);
float sqrt(float x);
vec2 sqrt(vec2 x);
vec3 sqrt(vec3 x);
vec4 sqrt(vec4 x);
float inversesqrt(float x);
vec2 inversesqrt(vec2 x);
vec3 inversesqrt(vec3 x);
vec4 inversesqrt(vec4 x);
/*
* 8.3 - Common Functions
*/
float abs(float x);
vec2 abs(vec2 x);
vec3 abs(vec3 x);
vec4 abs(vec4 x);
float sign(float x);
vec2 sign(vec2 x);
vec3 sign(vec3 x);
vec4 sign(vec4 x);
float floor(float x);
vec2 floor(vec2 x);
vec3 floor(vec3 x);
vec4 floor(vec4 x);
float ceil(float x);
vec2 ceil(vec2 x);
vec3 ceil(vec3 x);
vec4 ceil(vec4 x);
float fract(float x);
vec2 fract(vec2 x);
vec3 fract(vec3 x);
vec4 fract(vec4 x);
float mod(float x, float y);
vec2 mod(vec2 x, float y);
vec3 mod(vec3 x, float y);
vec4 mod(vec4 x, float y);
vec2 mod(vec2 x, vec2 y);
vec3 mod(vec3 x, vec3 y);
vec4 mod(vec4 x, vec4 y);
float min(float x, float y);
vec2 min(vec2 x, vec2 y);
vec3 min(vec3 x, vec3 y);
vec4 min(vec4 x, vec4 y);
vec2 min(vec2 x, float y);
vec3 min(vec3 x, float y);
vec4 min(vec4 x, float y);
float max(float x, float y);
vec2 max(vec2 x, vec2 y);
vec3 max(vec3 x, vec3 y);
vec4 max(vec4 x, vec4 y);
vec2 max(vec2 x, float y);
vec3 max(vec3 x, float y);
vec4 max(vec4 x, float y);
float clamp(float x, float minVal, float maxVal);
vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
vec2 clamp(vec2 x, float minVal, float maxVal);
vec3 clamp(vec3 x, float minVal, float maxVal);
vec4 clamp(vec4 x, float minVal, float maxVal);
float mix(float x, float y, float a);
vec2 mix(vec2 x, vec2 y, vec2 a);
vec3 mix(vec3 x, vec3 y, vec3 a);
vec4 mix(vec4 x, vec4 y, vec4 a);
vec2 mix(vec2 x, vec2 y, float a);
vec3 mix(vec3 x, vec3 y, float a);
vec4 mix(vec4 x, vec4 y, float a);
float step(float edge, float x);
vec2 step(vec2 edge, vec2 x);
vec3 step(vec3 edge, vec3 x);
vec4 step(vec4 edge, vec4 x);
vec2 step(float edge, vec2 x);
vec3 step(float edge, vec3 x);
vec4 step(float edge, vec4 x);
float smoothstep(float edge0, float edge1, float x);
vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
vec2 smoothstep(float edge0, float edge1, vec2 x);
vec3 smoothstep(float edge0, float edge1, vec3 x);
vec4 smoothstep(float edge0, float edge1, vec4 x);
/*
* 8.4 - Geometric Functions
*/
float length(float x);
float length(vec2 x);
float length(vec3 x);
float length(vec4 x);
float distance(float p0, float p1);
float distance(vec2 p0, vec2 p1);
float distance(vec3 p0, vec3 p1);
float distance(vec4 p0, vec4 p1);
float dot(float x, float y);
float dot(vec2 x, vec2 y);
float dot(vec3 x, vec3 y);
float dot(vec4 x, vec4 y);
vec3 cross(vec3 x, vec3 y);
float normalize(float x);
vec2 normalize(vec2 x);
vec3 normalize(vec3 x);
vec4 normalize(vec4 x);
float faceforward(float N, float I, float Nref);
vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
float reflect(float I, float N);
vec2 reflect(vec2 I, vec2 N);
vec3 reflect(vec3 I, vec3 N);
vec4 reflect(vec4 I, vec4 N);
float refract(float I, float N, float eta);
vec2 refract(vec2 I, vec2 N, float eta);
vec3 refract(vec3 I, vec3 N, float eta);
vec4 refract(vec4 I, vec4 N, float eta);
/*
* 8.5 - Matrix Functions
*/
mat2 matrixCompMult(mat2 x, mat2 y);
mat3 matrixCompMult(mat3 x, mat3 y);
mat4 matrixCompMult(mat4 x, mat4 y);
/*
* 8.6 - Vector Relational Functions
*/
bvec2 lessThan( vec2 x, vec2 y);
bvec3 lessThan( vec3 x, vec3 y);
bvec4 lessThan( vec4 x, vec4 y);
bvec2 lessThan(ivec2 x, ivec2 y);
bvec3 lessThan(ivec3 x, ivec3 y);
bvec4 lessThan(ivec4 x, ivec4 y);
bvec2 lessThanEqual( vec2 x, vec2 y);
bvec3 lessThanEqual( vec3 x, vec3 y);
bvec4 lessThanEqual( vec4 x, vec4 y);
bvec2 lessThanEqual(ivec2 x, ivec2 y);
bvec3 lessThanEqual(ivec3 x, ivec3 y);
bvec4 lessThanEqual(ivec4 x, ivec4 y);
bvec2 greaterThan( vec2 x, vec2 y);
bvec3 greaterThan( vec3 x, vec3 y);
bvec4 greaterThan( vec4 x, vec4 y);
bvec2 greaterThan(ivec2 x, ivec2 y);
bvec3 greaterThan(ivec3 x, ivec3 y);
bvec4 greaterThan(ivec4 x, ivec4 y);
bvec2 greaterThanEqual( vec2 x, vec2 y);
bvec3 greaterThanEqual( vec3 x, vec3 y);
bvec4 greaterThanEqual( vec4 x, vec4 y);
bvec2 greaterThanEqual(ivec2 x, ivec2 y);
bvec3 greaterThanEqual(ivec3 x, ivec3 y);
bvec4 greaterThanEqual(ivec4 x, ivec4 y);
bvec2 equal( vec2 x, vec2 y);
bvec3 equal( vec3 x, vec3 y);
bvec4 equal( vec4 x, vec4 y);
bvec2 equal(ivec2 x, ivec2 y);
bvec3 equal(ivec3 x, ivec3 y);
bvec4 equal(ivec4 x, ivec4 y);
bvec2 equal(bvec2 x, bvec2 y);
bvec3 equal(bvec3 x, bvec3 y);
bvec4 equal(bvec4 x, bvec4 y);
bvec2 notEqual( vec2 x, vec2 y);
bvec3 notEqual( vec3 x, vec3 y);
bvec4 notEqual( vec4 x, vec4 y);
bvec2 notEqual(ivec2 x, ivec2 y);
bvec3 notEqual(ivec3 x, ivec3 y);
bvec4 notEqual(ivec4 x, ivec4 y);
bvec2 notEqual(bvec2 x, bvec2 y);
bvec3 notEqual(bvec3 x, bvec3 y);
bvec4 notEqual(bvec4 x, bvec4 y);
bool any(bvec2 x);
bool any(bvec3 x);
bool any(bvec4 x);
bool all(bvec2 x);
bool all(bvec3 x);
bool all(bvec4 x);
bvec2 not(bvec2 x);
bvec3 not(bvec3 x);
bvec4 not(bvec4 x);
/*
* 8.7 - Texture Lookup Functions
*/
vec4 texture1D (sampler1D sampler, float coord);
vec4 texture1DProj (sampler1D sampler, vec2 coord);
vec4 texture1DProj (sampler1D sampler, vec4 coord);
vec4 texture1D (sampler1D sampler, float coord, float bias);
vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias);
vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias);
vec4 texture2D (sampler2D sampler, vec2 coord);
vec4 texture2DProj (sampler2D sampler, vec3 coord);
vec4 texture2DProj (sampler2D sampler, vec4 coord);
vec4 texture2D (sampler2D sampler, vec2 coord, float bias);
vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias);
vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias);
vec4 texture3D (sampler3D sampler, vec3 coord);
vec4 texture3DProj (sampler3D sampler, vec4 coord);
vec4 texture3D (sampler3D sampler, vec3 coord, float bias);
vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias);
vec4 textureCube (samplerCube sampler, vec3 coord);
vec4 textureCube (samplerCube sampler, vec3 coord, float bias);
vec4 shadow1D (sampler1DShadow sampler, vec3 coord);
vec4 shadow2D (sampler2DShadow sampler, vec3 coord);
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord);
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord);
vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias);
vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias);
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias);
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias);
/*
* 8.8 - Fragment Processing Functions
*/
float dFdx(float p);
vec2 dFdx(vec2 p);
vec3 dFdx(vec3 p);
vec4 dFdx(vec4 p);
float dFdy(float p);
vec2 dFdy(vec2 p);
vec3 dFdy(vec3 p);
vec4 dFdy(vec4 p);
float fwidth(float p);
vec2 fwidth(vec2 p);
vec3 fwidth(vec3 p);
vec4 fwidth(vec4 p);
/*
* 8.9 - Noise Functions
*/
float noise1(float x);
float noise1(vec2 x);
float noise1(vec3 x);
float noise1(vec4 x);
vec2 noise2(float x);
vec2 noise2(vec2 x);
vec2 noise2(vec3 x);
vec2 noise2(vec4 x);
vec3 noise3(float x);
vec3 noise3(vec2 x);
vec3 noise3(vec3 x);
vec3 noise3(vec4 x);
vec4 noise4(float x);
vec4 noise4(vec2 x);
vec4 noise4(vec3 x);
vec4 noise4(vec4 x);

View file

@ -0,0 +1,351 @@
#version 110
/*
* 8.1 - Angle and Trigonometry Functions
*/
float radians(float degrees);
vec2 radians(vec2 degrees);
vec3 radians(vec3 degrees);
vec4 radians(vec4 degrees);
float degrees(float radians);
vec2 degrees(vec2 radians);
vec3 degrees(vec3 radians);
vec4 degrees(vec4 radians);
float sin(float angle);
vec2 sin(vec2 angle);
vec3 sin(vec3 angle);
vec4 sin(vec4 angle);
float cos(float angle);
vec2 cos(vec2 angle);
vec3 cos(vec3 angle);
vec4 cos(vec4 angle);
float tan(float angle);
vec2 tan(vec2 angle);
vec3 tan(vec3 angle);
vec4 tan(vec4 angle);
float asin(float angle);
vec2 asin(vec2 angle);
vec3 asin(vec3 angle);
vec4 asin(vec4 angle);
float acos(float angle);
vec2 acos(vec2 angle);
vec3 acos(vec3 angle);
vec4 acos(vec4 angle);
float atan(float y, float x);
vec2 atan(vec2 y, vec2 x);
vec3 atan(vec3 y, vec3 x);
vec4 atan(vec4 y, vec4 x);
float atan(float y_over_x);
vec2 atan(vec2 y_over_x);
vec3 atan(vec3 y_over_x);
vec4 atan(vec4 y_over_x);
/*
* 8.2 - Exponential Functions
*/
float pow(float x, float y);
vec2 pow(vec2 x, vec2 y);
vec3 pow(vec3 x, vec3 y);
vec4 pow(vec4 x, vec4 y);
float exp(float x);
vec2 exp(vec2 x);
vec3 exp(vec3 x);
vec4 exp(vec4 x);
float log(float x);
vec2 log(vec2 x);
vec3 log(vec3 x);
vec4 log(vec4 x);
float exp2(float x);
vec2 exp2(vec2 x);
vec3 exp2(vec3 x);
vec4 exp2(vec4 x);
float log2(float x);
vec2 log2(vec2 x);
vec3 log2(vec3 x);
vec4 log2(vec4 x);
float sqrt(float x);
vec2 sqrt(vec2 x);
vec3 sqrt(vec3 x);
vec4 sqrt(vec4 x);
float inversesqrt(float x);
vec2 inversesqrt(vec2 x);
vec3 inversesqrt(vec3 x);
vec4 inversesqrt(vec4 x);
/*
* 8.3 - Common Functions
*/
float abs(float x);
vec2 abs(vec2 x);
vec3 abs(vec3 x);
vec4 abs(vec4 x);
float sign(float x);
vec2 sign(vec2 x);
vec3 sign(vec3 x);
vec4 sign(vec4 x);
float floor(float x);
vec2 floor(vec2 x);
vec3 floor(vec3 x);
vec4 floor(vec4 x);
float ceil(float x);
vec2 ceil(vec2 x);
vec3 ceil(vec3 x);
vec4 ceil(vec4 x);
float fract(float x);
vec2 fract(vec2 x);
vec3 fract(vec3 x);
vec4 fract(vec4 x);
float mod(float x, float y);
vec2 mod(vec2 x, float y);
vec3 mod(vec3 x, float y);
vec4 mod(vec4 x, float y);
vec2 mod(vec2 x, vec2 y);
vec3 mod(vec3 x, vec3 y);
vec4 mod(vec4 x, vec4 y);
float min(float x, float y);
vec2 min(vec2 x, vec2 y);
vec3 min(vec3 x, vec3 y);
vec4 min(vec4 x, vec4 y);
vec2 min(vec2 x, float y);
vec3 min(vec3 x, float y);
vec4 min(vec4 x, float y);
float max(float x, float y);
vec2 max(vec2 x, vec2 y);
vec3 max(vec3 x, vec3 y);
vec4 max(vec4 x, vec4 y);
vec2 max(vec2 x, float y);
vec3 max(vec3 x, float y);
vec4 max(vec4 x, float y);
float clamp(float x, float minVal, float maxVal);
vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
vec2 clamp(vec2 x, float minVal, float maxVal);
vec3 clamp(vec3 x, float minVal, float maxVal);
vec4 clamp(vec4 x, float minVal, float maxVal);
float mix(float x, float y, float a);
vec2 mix(vec2 x, vec2 y, vec2 a);
vec3 mix(vec3 x, vec3 y, vec3 a);
vec4 mix(vec4 x, vec4 y, vec4 a);
vec2 mix(vec2 x, vec2 y, float a);
vec3 mix(vec3 x, vec3 y, float a);
vec4 mix(vec4 x, vec4 y, float a);
float step(float edge, float x);
vec2 step(vec2 edge, vec2 x);
vec3 step(vec3 edge, vec3 x);
vec4 step(vec4 edge, vec4 x);
vec2 step(float edge, vec2 x);
vec3 step(float edge, vec3 x);
vec4 step(float edge, vec4 x);
float smoothstep(float edge0, float edge1, float x);
vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
vec2 smoothstep(float edge0, float edge1, vec2 x);
vec3 smoothstep(float edge0, float edge1, vec3 x);
vec4 smoothstep(float edge0, float edge1, vec4 x);
/*
* 8.4 - Geometric Functions
*/
float length(float x);
float length(vec2 x);
float length(vec3 x);
float length(vec4 x);
float distance(float p0, float p1);
float distance(vec2 p0, vec2 p1);
float distance(vec3 p0, vec3 p1);
float distance(vec4 p0, vec4 p1);
float dot(float x, float y);
float dot(vec2 x, vec2 y);
float dot(vec3 x, vec3 y);
float dot(vec4 x, vec4 y);
vec3 cross(vec3 x, vec3 y);
float normalize(float x);
vec2 normalize(vec2 x);
vec3 normalize(vec3 x);
vec4 normalize(vec4 x);
vec4 ftransform();
float faceforward(float N, float I, float Nref);
vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
float reflect(float I, float N);
vec2 reflect(vec2 I, vec2 N);
vec3 reflect(vec3 I, vec3 N);
vec4 reflect(vec4 I, vec4 N);
float refract(float I, float N, float eta);
vec2 refract(vec2 I, vec2 N, float eta);
vec3 refract(vec3 I, vec3 N, float eta);
vec4 refract(vec4 I, vec4 N, float eta);
/*
* 8.5 - Matrix Functions
*/
mat2 matrixCompMult(mat2 x, mat2 y);
mat3 matrixCompMult(mat3 x, mat3 y);
mat4 matrixCompMult(mat4 x, mat4 y);
/*
* 8.6 - Vector Relational Functions
*/
bvec2 lessThan( vec2 x, vec2 y);
bvec3 lessThan( vec3 x, vec3 y);
bvec4 lessThan( vec4 x, vec4 y);
bvec2 lessThan(ivec2 x, ivec2 y);
bvec3 lessThan(ivec3 x, ivec3 y);
bvec4 lessThan(ivec4 x, ivec4 y);
bvec2 lessThanEqual( vec2 x, vec2 y);
bvec3 lessThanEqual( vec3 x, vec3 y);
bvec4 lessThanEqual( vec4 x, vec4 y);
bvec2 lessThanEqual(ivec2 x, ivec2 y);
bvec3 lessThanEqual(ivec3 x, ivec3 y);
bvec4 lessThanEqual(ivec4 x, ivec4 y);
bvec2 greaterThan( vec2 x, vec2 y);
bvec3 greaterThan( vec3 x, vec3 y);
bvec4 greaterThan( vec4 x, vec4 y);
bvec2 greaterThan(ivec2 x, ivec2 y);
bvec3 greaterThan(ivec3 x, ivec3 y);
bvec4 greaterThan(ivec4 x, ivec4 y);
bvec2 greaterThanEqual( vec2 x, vec2 y);
bvec3 greaterThanEqual( vec3 x, vec3 y);
bvec4 greaterThanEqual( vec4 x, vec4 y);
bvec2 greaterThanEqual(ivec2 x, ivec2 y);
bvec3 greaterThanEqual(ivec3 x, ivec3 y);
bvec4 greaterThanEqual(ivec4 x, ivec4 y);
bvec2 equal( vec2 x, vec2 y);
bvec3 equal( vec3 x, vec3 y);
bvec4 equal( vec4 x, vec4 y);
bvec2 equal(ivec2 x, ivec2 y);
bvec3 equal(ivec3 x, ivec3 y);
bvec4 equal(ivec4 x, ivec4 y);
bvec2 equal(bvec2 x, bvec2 y);
bvec3 equal(bvec3 x, bvec3 y);
bvec4 equal(bvec4 x, bvec4 y);
bvec2 notEqual( vec2 x, vec2 y);
bvec3 notEqual( vec3 x, vec3 y);
bvec4 notEqual( vec4 x, vec4 y);
bvec2 notEqual(ivec2 x, ivec2 y);
bvec3 notEqual(ivec3 x, ivec3 y);
bvec4 notEqual(ivec4 x, ivec4 y);
bvec2 notEqual(bvec2 x, bvec2 y);
bvec3 notEqual(bvec3 x, bvec3 y);
bvec4 notEqual(bvec4 x, bvec4 y);
bool any(bvec2 x);
bool any(bvec3 x);
bool any(bvec4 x);
bool all(bvec2 x);
bool all(bvec3 x);
bool all(bvec4 x);
bvec2 not(bvec2 x);
bvec3 not(bvec3 x);
bvec4 not(bvec4 x);
/*
* 8.7 - Texture Lookup Functions
*/
vec4 texture1D (sampler1D sampler, float coord);
vec4 texture1DProj (sampler1D sampler, vec2 coord);
vec4 texture1DProj (sampler1D sampler, vec4 coord);
vec4 texture1DLod (sampler1D sampler, float coord, float lod);
vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod);
vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod);
vec4 texture2D (sampler2D sampler, vec2 coord);
vec4 texture2DProj (sampler2D sampler, vec3 coord);
vec4 texture2DProj (sampler2D sampler, vec4 coord);
vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod);
vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);
vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);
vec4 texture3D (sampler3D sampler, vec3 coord);
vec4 texture3DProj (sampler3D sampler, vec4 coord);
vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod);
vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod);
vec4 textureCube (samplerCube sampler, vec3 coord);
vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod);
vec4 shadow1D (sampler1DShadow sampler, vec3 coord);
vec4 shadow2D (sampler2DShadow sampler, vec3 coord);
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord);
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord);
vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod);
vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod);
vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod);
vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod);
/*
* 8.8 - Fragment Processing Functions (none in vertex shader)
*/
/*
* 8.9 - Noise Functions
*/
float noise1(float x);
float noise1(vec2 x);
float noise1(vec3 x);
float noise1(vec4 x);
vec2 noise2(float x);
vec2 noise2(vec2 x);
vec2 noise2(vec3 x);
vec2 noise2(vec4 x);
vec3 noise3(float x);
vec3 noise3(vec2 x);
vec3 noise3(vec3 x);
vec3 noise3(vec4 x);
vec4 noise4(float x);
vec4 noise4(vec2 x);
vec4 noise4(vec3 x);
vec4 noise4(vec4 x);

View file

@ -0,0 +1,396 @@
#version 120
/*
* 8.1 - Angle and Trigonometry Functions
*/
float radians(float degrees);
vec2 radians(vec2 degrees);
vec3 radians(vec3 degrees);
vec4 radians(vec4 degrees);
float degrees(float radians);
vec2 degrees(vec2 radians);
vec3 degrees(vec3 radians);
vec4 degrees(vec4 radians);
float sin(float angle);
vec2 sin(vec2 angle);
vec3 sin(vec3 angle);
vec4 sin(vec4 angle);
float cos(float angle);
vec2 cos(vec2 angle);
vec3 cos(vec3 angle);
vec4 cos(vec4 angle);
float tan(float angle);
vec2 tan(vec2 angle);
vec3 tan(vec3 angle);
vec4 tan(vec4 angle);
float asin(float angle);
vec2 asin(vec2 angle);
vec3 asin(vec3 angle);
vec4 asin(vec4 angle);
float acos(float angle);
vec2 acos(vec2 angle);
vec3 acos(vec3 angle);
vec4 acos(vec4 angle);
float atan(float y, float x);
vec2 atan(vec2 y, vec2 x);
vec3 atan(vec3 y, vec3 x);
vec4 atan(vec4 y, vec4 x);
float atan(float y_over_x);
vec2 atan(vec2 y_over_x);
vec3 atan(vec3 y_over_x);
vec4 atan(vec4 y_over_x);
/*
* 8.2 - Exponential Functions
*/
float pow(float x, float y);
vec2 pow(vec2 x, vec2 y);
vec3 pow(vec3 x, vec3 y);
vec4 pow(vec4 x, vec4 y);
float exp(float x);
vec2 exp(vec2 x);
vec3 exp(vec3 x);
vec4 exp(vec4 x);
float log(float x);
vec2 log(vec2 x);
vec3 log(vec3 x);
vec4 log(vec4 x);
float exp2(float x);
vec2 exp2(vec2 x);
vec3 exp2(vec3 x);
vec4 exp2(vec4 x);
float log2(float x);
vec2 log2(vec2 x);
vec3 log2(vec3 x);
vec4 log2(vec4 x);
float sqrt(float x);
vec2 sqrt(vec2 x);
vec3 sqrt(vec3 x);
vec4 sqrt(vec4 x);
float inversesqrt(float x);
vec2 inversesqrt(vec2 x);
vec3 inversesqrt(vec3 x);
vec4 inversesqrt(vec4 x);
/*
* 8.3 - Common Functions
*/
float abs(float x);
vec2 abs(vec2 x);
vec3 abs(vec3 x);
vec4 abs(vec4 x);
float sign(float x);
vec2 sign(vec2 x);
vec3 sign(vec3 x);
vec4 sign(vec4 x);
float floor(float x);
vec2 floor(vec2 x);
vec3 floor(vec3 x);
vec4 floor(vec4 x);
float ceil(float x);
vec2 ceil(vec2 x);
vec3 ceil(vec3 x);
vec4 ceil(vec4 x);
float fract(float x);
vec2 fract(vec2 x);
vec3 fract(vec3 x);
vec4 fract(vec4 x);
float mod(float x, float y);
vec2 mod(vec2 x, float y);
vec3 mod(vec3 x, float y);
vec4 mod(vec4 x, float y);
vec2 mod(vec2 x, vec2 y);
vec3 mod(vec3 x, vec3 y);
vec4 mod(vec4 x, vec4 y);
float min(float x, float y);
vec2 min(vec2 x, vec2 y);
vec3 min(vec3 x, vec3 y);
vec4 min(vec4 x, vec4 y);
vec2 min(vec2 x, float y);
vec3 min(vec3 x, float y);
vec4 min(vec4 x, float y);
float max(float x, float y);
vec2 max(vec2 x, vec2 y);
vec3 max(vec3 x, vec3 y);
vec4 max(vec4 x, vec4 y);
vec2 max(vec2 x, float y);
vec3 max(vec3 x, float y);
vec4 max(vec4 x, float y);
float clamp(float x, float minVal, float maxVal);
vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
vec2 clamp(vec2 x, float minVal, float maxVal);
vec3 clamp(vec3 x, float minVal, float maxVal);
vec4 clamp(vec4 x, float minVal, float maxVal);
float mix(float x, float y, float a);
vec2 mix(vec2 x, vec2 y, vec2 a);
vec3 mix(vec3 x, vec3 y, vec3 a);
vec4 mix(vec4 x, vec4 y, vec4 a);
vec2 mix(vec2 x, vec2 y, float a);
vec3 mix(vec3 x, vec3 y, float a);
vec4 mix(vec4 x, vec4 y, float a);
float step(float edge, float x);
vec2 step(vec2 edge, vec2 x);
vec3 step(vec3 edge, vec3 x);
vec4 step(vec4 edge, vec4 x);
vec2 step(float edge, vec2 x);
vec3 step(float edge, vec3 x);
vec4 step(float edge, vec4 x);
float smoothstep(float edge0, float edge1, float x);
vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
vec2 smoothstep(float edge0, float edge1, vec2 x);
vec3 smoothstep(float edge0, float edge1, vec3 x);
vec4 smoothstep(float edge0, float edge1, vec4 x);
/*
* 8.4 - Geometric Functions
*/
float length(float x);
float length(vec2 x);
float length(vec3 x);
float length(vec4 x);
float distance(float p0, float p1);
float distance(vec2 p0, vec2 p1);
float distance(vec3 p0, vec3 p1);
float distance(vec4 p0, vec4 p1);
float dot(float x, float y);
float dot(vec2 x, vec2 y);
float dot(vec3 x, vec3 y);
float dot(vec4 x, vec4 y);
vec3 cross(vec3 x, vec3 y);
float normalize(float x);
vec2 normalize(vec2 x);
vec3 normalize(vec3 x);
vec4 normalize(vec4 x);
float faceforward(float N, float I, float Nref);
vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
float reflect(float I, float N);
vec2 reflect(vec2 I, vec2 N);
vec3 reflect(vec3 I, vec3 N);
vec4 reflect(vec4 I, vec4 N);
float refract(float I, float N, float eta);
vec2 refract(vec2 I, vec2 N, float eta);
vec3 refract(vec3 I, vec3 N, float eta);
vec4 refract(vec4 I, vec4 N, float eta);
/*
* 8.5 - Matrix Functions
*/
mat2 matrixCompMult(mat2 x, mat2 y);
mat3 matrixCompMult(mat3 x, mat3 y);
mat4 matrixCompMult(mat4 x, mat4 y);
mat2x3 matrixCompMult(mat2x3 x, mat2x3 y);
mat2x4 matrixCompMult(mat2x4 x, mat2x4 y);
mat3x2 matrixCompMult(mat3x2 x, mat3x2 y);
mat3x4 matrixCompMult(mat3x4 x, mat3x4 y);
mat4x2 matrixCompMult(mat4x2 x, mat4x2 y);
mat4x3 matrixCompMult(mat4x3 x, mat4x3 y);
mat2 outerProduct(vec2 c, vec2 r);
mat3 outerProduct(vec3 c, vec3 r);
mat4 outerProduct(vec4 c, vec4 r);
mat2x3 outerProduct(vec3 c, vec2 r);
mat3x2 outerProduct(vec2 c, vec3 r);
mat2x4 outerProduct(vec4 c, vec2 r);
mat4x2 outerProduct(vec2 c, vec4 r);
mat3x4 outerProduct(vec4 c, vec3 r);
mat4x3 outerProduct(vec3 c, vec4 r);
mat2 transpose(mat2 m);
mat3 transpose(mat3 m);
mat4 transpose(mat4 m);
mat2x3 transpose(mat3x2 m);
mat3x2 transpose(mat2x3 m);
mat2x4 transpose(mat4x2 m);
mat4x2 transpose(mat2x4 m);
mat3x4 transpose(mat4x3 m);
mat4x3 transpose(mat3x4 m);
/*
* 8.6 - Vector Relational Functions
*/
bvec2 lessThan( vec2 x, vec2 y);
bvec3 lessThan( vec3 x, vec3 y);
bvec4 lessThan( vec4 x, vec4 y);
bvec2 lessThan(ivec2 x, ivec2 y);
bvec3 lessThan(ivec3 x, ivec3 y);
bvec4 lessThan(ivec4 x, ivec4 y);
bvec2 lessThanEqual( vec2 x, vec2 y);
bvec3 lessThanEqual( vec3 x, vec3 y);
bvec4 lessThanEqual( vec4 x, vec4 y);
bvec2 lessThanEqual(ivec2 x, ivec2 y);
bvec3 lessThanEqual(ivec3 x, ivec3 y);
bvec4 lessThanEqual(ivec4 x, ivec4 y);
bvec2 greaterThan( vec2 x, vec2 y);
bvec3 greaterThan( vec3 x, vec3 y);
bvec4 greaterThan( vec4 x, vec4 y);
bvec2 greaterThan(ivec2 x, ivec2 y);
bvec3 greaterThan(ivec3 x, ivec3 y);
bvec4 greaterThan(ivec4 x, ivec4 y);
bvec2 greaterThanEqual( vec2 x, vec2 y);
bvec3 greaterThanEqual( vec3 x, vec3 y);
bvec4 greaterThanEqual( vec4 x, vec4 y);
bvec2 greaterThanEqual(ivec2 x, ivec2 y);
bvec3 greaterThanEqual(ivec3 x, ivec3 y);
bvec4 greaterThanEqual(ivec4 x, ivec4 y);
bvec2 equal( vec2 x, vec2 y);
bvec3 equal( vec3 x, vec3 y);
bvec4 equal( vec4 x, vec4 y);
bvec2 equal(ivec2 x, ivec2 y);
bvec3 equal(ivec3 x, ivec3 y);
bvec4 equal(ivec4 x, ivec4 y);
bvec2 equal(bvec2 x, bvec2 y);
bvec3 equal(bvec3 x, bvec3 y);
bvec4 equal(bvec4 x, bvec4 y);
bvec2 notEqual( vec2 x, vec2 y);
bvec3 notEqual( vec3 x, vec3 y);
bvec4 notEqual( vec4 x, vec4 y);
bvec2 notEqual(ivec2 x, ivec2 y);
bvec3 notEqual(ivec3 x, ivec3 y);
bvec4 notEqual(ivec4 x, ivec4 y);
bvec2 notEqual(bvec2 x, bvec2 y);
bvec3 notEqual(bvec3 x, bvec3 y);
bvec4 notEqual(bvec4 x, bvec4 y);
bool any(bvec2 x);
bool any(bvec3 x);
bool any(bvec4 x);
bool all(bvec2 x);
bool all(bvec3 x);
bool all(bvec4 x);
bvec2 not(bvec2 x);
bvec3 not(bvec3 x);
bvec4 not(bvec4 x);
/*
* 8.7 - Texture Lookup Functions
*/
vec4 texture1D (sampler1D sampler, float coord);
vec4 texture1DProj (sampler1D sampler, vec2 coord);
vec4 texture1DProj (sampler1D sampler, vec4 coord);
vec4 texture1D (sampler1D sampler, float coord, float bias);
vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias);
vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias);
vec4 texture2D (sampler2D sampler, vec2 coord);
vec4 texture2DProj (sampler2D sampler, vec3 coord);
vec4 texture2DProj (sampler2D sampler, vec4 coord);
vec4 texture2D (sampler2D sampler, vec2 coord, float bias);
vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias);
vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias);
vec4 texture3D (sampler3D sampler, vec3 coord);
vec4 texture3DProj (sampler3D sampler, vec4 coord);
vec4 texture3D (sampler3D sampler, vec3 coord, float bias);
vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias);
vec4 textureCube (samplerCube sampler, vec3 coord);
vec4 textureCube (samplerCube sampler, vec3 coord, float bias);
vec4 shadow1D (sampler1DShadow sampler, vec3 coord);
vec4 shadow2D (sampler2DShadow sampler, vec3 coord);
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord);
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord);
vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias);
vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias);
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias);
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias);
/*
* 8.8 - Fragment Processing Functions
*/
float dFdx(float p);
vec2 dFdx(vec2 p);
vec3 dFdx(vec3 p);
vec4 dFdx(vec4 p);
float dFdy(float p);
vec2 dFdy(vec2 p);
vec3 dFdy(vec3 p);
vec4 dFdy(vec4 p);
float fwidth(float p);
vec2 fwidth(vec2 p);
vec3 fwidth(vec3 p);
vec4 fwidth(vec4 p);
/*
* 8.9 - Noise Functions
*/
float noise1(float x);
float noise1(vec2 x);
float noise1(vec3 x);
float noise1(vec4 x);
vec2 noise2(float x);
vec2 noise2(vec2 x);
vec2 noise2(vec3 x);
vec2 noise2(vec4 x);
vec3 noise3(float x);
vec3 noise3(vec2 x);
vec3 noise3(vec3 x);
vec3 noise3(vec4 x);
vec4 noise4(float x);
vec4 noise4(vec2 x);
vec4 noise4(vec3 x);
vec4 noise4(vec4 x);

View file

@ -0,0 +1,383 @@
#version 120
/*
* 8.1 - Angle and Trigonometry Functions
*/
float radians(float degrees);
vec2 radians(vec2 degrees);
vec3 radians(vec3 degrees);
vec4 radians(vec4 degrees);
float degrees(float radians);
vec2 degrees(vec2 radians);
vec3 degrees(vec3 radians);
vec4 degrees(vec4 radians);
float sin(float angle);
vec2 sin(vec2 angle);
vec3 sin(vec3 angle);
vec4 sin(vec4 angle);
float cos(float angle);
vec2 cos(vec2 angle);
vec3 cos(vec3 angle);
vec4 cos(vec4 angle);
float tan(float angle);
vec2 tan(vec2 angle);
vec3 tan(vec3 angle);
vec4 tan(vec4 angle);
float asin(float angle);
vec2 asin(vec2 angle);
vec3 asin(vec3 angle);
vec4 asin(vec4 angle);
float acos(float angle);
vec2 acos(vec2 angle);
vec3 acos(vec3 angle);
vec4 acos(vec4 angle);
float atan(float y, float x);
vec2 atan(vec2 y, vec2 x);
vec3 atan(vec3 y, vec3 x);
vec4 atan(vec4 y, vec4 x);
float atan(float y_over_x);
vec2 atan(vec2 y_over_x);
vec3 atan(vec3 y_over_x);
vec4 atan(vec4 y_over_x);
/*
* 8.2 - Exponential Functions
*/
float pow(float x, float y);
vec2 pow(vec2 x, vec2 y);
vec3 pow(vec3 x, vec3 y);
vec4 pow(vec4 x, vec4 y);
float exp(float x);
vec2 exp(vec2 x);
vec3 exp(vec3 x);
vec4 exp(vec4 x);
float log(float x);
vec2 log(vec2 x);
vec3 log(vec3 x);
vec4 log(vec4 x);
float exp2(float x);
vec2 exp2(vec2 x);
vec3 exp2(vec3 x);
vec4 exp2(vec4 x);
float log2(float x);
vec2 log2(vec2 x);
vec3 log2(vec3 x);
vec4 log2(vec4 x);
float sqrt(float x);
vec2 sqrt(vec2 x);
vec3 sqrt(vec3 x);
vec4 sqrt(vec4 x);
float inversesqrt(float x);
vec2 inversesqrt(vec2 x);
vec3 inversesqrt(vec3 x);
vec4 inversesqrt(vec4 x);
/*
* 8.3 - Common Functions
*/
float abs(float x);
vec2 abs(vec2 x);
vec3 abs(vec3 x);
vec4 abs(vec4 x);
float sign(float x);
vec2 sign(vec2 x);
vec3 sign(vec3 x);
vec4 sign(vec4 x);
float floor(float x);
vec2 floor(vec2 x);
vec3 floor(vec3 x);
vec4 floor(vec4 x);
float ceil(float x);
vec2 ceil(vec2 x);
vec3 ceil(vec3 x);
vec4 ceil(vec4 x);
float fract(float x);
vec2 fract(vec2 x);
vec3 fract(vec3 x);
vec4 fract(vec4 x);
float mod(float x, float y);
vec2 mod(vec2 x, float y);
vec3 mod(vec3 x, float y);
vec4 mod(vec4 x, float y);
vec2 mod(vec2 x, vec2 y);
vec3 mod(vec3 x, vec3 y);
vec4 mod(vec4 x, vec4 y);
float min(float x, float y);
vec2 min(vec2 x, vec2 y);
vec3 min(vec3 x, vec3 y);
vec4 min(vec4 x, vec4 y);
vec2 min(vec2 x, float y);
vec3 min(vec3 x, float y);
vec4 min(vec4 x, float y);
float max(float x, float y);
vec2 max(vec2 x, vec2 y);
vec3 max(vec3 x, vec3 y);
vec4 max(vec4 x, vec4 y);
vec2 max(vec2 x, float y);
vec3 max(vec3 x, float y);
vec4 max(vec4 x, float y);
float clamp(float x, float minVal, float maxVal);
vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
vec2 clamp(vec2 x, float minVal, float maxVal);
vec3 clamp(vec3 x, float minVal, float maxVal);
vec4 clamp(vec4 x, float minVal, float maxVal);
float mix(float x, float y, float a);
vec2 mix(vec2 x, vec2 y, vec2 a);
vec3 mix(vec3 x, vec3 y, vec3 a);
vec4 mix(vec4 x, vec4 y, vec4 a);
vec2 mix(vec2 x, vec2 y, float a);
vec3 mix(vec3 x, vec3 y, float a);
vec4 mix(vec4 x, vec4 y, float a);
float step(float edge, float x);
vec2 step(vec2 edge, vec2 x);
vec3 step(vec3 edge, vec3 x);
vec4 step(vec4 edge, vec4 x);
vec2 step(float edge, vec2 x);
vec3 step(float edge, vec3 x);
vec4 step(float edge, vec4 x);
float smoothstep(float edge0, float edge1, float x);
vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
vec2 smoothstep(float edge0, float edge1, vec2 x);
vec3 smoothstep(float edge0, float edge1, vec3 x);
vec4 smoothstep(float edge0, float edge1, vec4 x);
/*
* 8.4 - Geometric Functions
*/
float length(float x);
float length(vec2 x);
float length(vec3 x);
float length(vec4 x);
float distance(float p0, float p1);
float distance(vec2 p0, vec2 p1);
float distance(vec3 p0, vec3 p1);
float distance(vec4 p0, vec4 p1);
float dot(float x, float y);
float dot(vec2 x, vec2 y);
float dot(vec3 x, vec3 y);
float dot(vec4 x, vec4 y);
vec3 cross(vec3 x, vec3 y);
float normalize(float x);
vec2 normalize(vec2 x);
vec3 normalize(vec3 x);
vec4 normalize(vec4 x);
vec4 ftransform();
float faceforward(float N, float I, float Nref);
vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
float reflect(float I, float N);
vec2 reflect(vec2 I, vec2 N);
vec3 reflect(vec3 I, vec3 N);
vec4 reflect(vec4 I, vec4 N);
float refract(float I, float N, float eta);
vec2 refract(vec2 I, vec2 N, float eta);
vec3 refract(vec3 I, vec3 N, float eta);
vec4 refract(vec4 I, vec4 N, float eta);
/*
* 8.5 - Matrix Functions
*/
mat2 matrixCompMult(mat2 x, mat2 y);
mat3 matrixCompMult(mat3 x, mat3 y);
mat4 matrixCompMult(mat4 x, mat4 y);
mat2x3 matrixCompMult(mat2x3 x, mat2x3 y);
mat2x4 matrixCompMult(mat2x4 x, mat2x4 y);
mat3x2 matrixCompMult(mat3x2 x, mat3x2 y);
mat3x4 matrixCompMult(mat3x4 x, mat3x4 y);
mat4x2 matrixCompMult(mat4x2 x, mat4x2 y);
mat4x3 matrixCompMult(mat4x3 x, mat4x3 y);
mat2 outerProduct(vec2 c, vec2 r);
mat3 outerProduct(vec3 c, vec3 r);
mat4 outerProduct(vec4 c, vec4 r);
mat2x3 outerProduct(vec3 c, vec2 r);
mat3x2 outerProduct(vec2 c, vec3 r);
mat2x4 outerProduct(vec4 c, vec2 r);
mat4x2 outerProduct(vec2 c, vec4 r);
mat3x4 outerProduct(vec4 c, vec3 r);
mat4x3 outerProduct(vec3 c, vec4 r);
mat2 transpose(mat2 m);
mat3 transpose(mat3 m);
mat4 transpose(mat4 m);
mat2x3 transpose(mat3x2 m);
mat3x2 transpose(mat2x3 m);
mat2x4 transpose(mat4x2 m);
mat4x2 transpose(mat2x4 m);
mat3x4 transpose(mat4x3 m);
mat4x3 transpose(mat3x4 m);
/*
* 8.6 - Vector Relational Functions
*/
bvec2 lessThan( vec2 x, vec2 y);
bvec3 lessThan( vec3 x, vec3 y);
bvec4 lessThan( vec4 x, vec4 y);
bvec2 lessThan(ivec2 x, ivec2 y);
bvec3 lessThan(ivec3 x, ivec3 y);
bvec4 lessThan(ivec4 x, ivec4 y);
bvec2 lessThanEqual( vec2 x, vec2 y);
bvec3 lessThanEqual( vec3 x, vec3 y);
bvec4 lessThanEqual( vec4 x, vec4 y);
bvec2 lessThanEqual(ivec2 x, ivec2 y);
bvec3 lessThanEqual(ivec3 x, ivec3 y);
bvec4 lessThanEqual(ivec4 x, ivec4 y);
bvec2 greaterThan( vec2 x, vec2 y);
bvec3 greaterThan( vec3 x, vec3 y);
bvec4 greaterThan( vec4 x, vec4 y);
bvec2 greaterThan(ivec2 x, ivec2 y);
bvec3 greaterThan(ivec3 x, ivec3 y);
bvec4 greaterThan(ivec4 x, ivec4 y);
bvec2 greaterThanEqual( vec2 x, vec2 y);
bvec3 greaterThanEqual( vec3 x, vec3 y);
bvec4 greaterThanEqual( vec4 x, vec4 y);
bvec2 greaterThanEqual(ivec2 x, ivec2 y);
bvec3 greaterThanEqual(ivec3 x, ivec3 y);
bvec4 greaterThanEqual(ivec4 x, ivec4 y);
bvec2 equal( vec2 x, vec2 y);
bvec3 equal( vec3 x, vec3 y);
bvec4 equal( vec4 x, vec4 y);
bvec2 equal(ivec2 x, ivec2 y);
bvec3 equal(ivec3 x, ivec3 y);
bvec4 equal(ivec4 x, ivec4 y);
bvec2 equal(bvec2 x, bvec2 y);
bvec3 equal(bvec3 x, bvec3 y);
bvec4 equal(bvec4 x, bvec4 y);
bvec2 notEqual( vec2 x, vec2 y);
bvec3 notEqual( vec3 x, vec3 y);
bvec4 notEqual( vec4 x, vec4 y);
bvec2 notEqual(ivec2 x, ivec2 y);
bvec3 notEqual(ivec3 x, ivec3 y);
bvec4 notEqual(ivec4 x, ivec4 y);
bvec2 notEqual(bvec2 x, bvec2 y);
bvec3 notEqual(bvec3 x, bvec3 y);
bvec4 notEqual(bvec4 x, bvec4 y);
bool any(bvec2 x);
bool any(bvec3 x);
bool any(bvec4 x);
bool all(bvec2 x);
bool all(bvec3 x);
bool all(bvec4 x);
bvec2 not(bvec2 x);
bvec3 not(bvec3 x);
bvec4 not(bvec4 x);
/*
* 8.7 - Texture Lookup Functions
*/
vec4 texture1D (sampler1D sampler, float coord);
vec4 texture1DProj (sampler1D sampler, vec2 coord);
vec4 texture1DProj (sampler1D sampler, vec4 coord);
vec4 texture1DLod (sampler1D sampler, float coord, float lod);
vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod);
vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod);
vec4 texture2D (sampler2D sampler, vec2 coord);
vec4 texture2DProj (sampler2D sampler, vec3 coord);
vec4 texture2DProj (sampler2D sampler, vec4 coord);
vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod);
vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);
vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);
vec4 texture3D (sampler3D sampler, vec3 coord);
vec4 texture3DProj (sampler3D sampler, vec4 coord);
vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod);
vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod);
vec4 textureCube (samplerCube sampler, vec3 coord);
vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod);
vec4 shadow1D (sampler1DShadow sampler, vec3 coord);
vec4 shadow2D (sampler2DShadow sampler, vec3 coord);
vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord);
vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord);
vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod);
vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod);
vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod);
vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod);
/*
* 8.8 - Fragment Processing Functions (none in vertex shader)
*/
/*
* 8.9 - Noise Functions
*/
float noise1(float x);
float noise1(vec2 x);
float noise1(vec3 x);
float noise1(vec4 x);
vec2 noise2(float x);
vec2 noise2(vec2 x);
vec2 noise2(vec3 x);
vec2 noise2(vec4 x);
vec3 noise3(float x);
vec3 noise3(vec2 x);
vec3 noise3(vec3 x);
vec3 noise3(vec4 x);
vec4 noise4(float x);
vec4 noise4(vec2 x);
vec4 noise4(vec3 x);
vec4 noise4(vec4 x);

View file

@ -0,0 +1,7 @@
#extension GL_ARB_texture_rectangle : enable
vec4 texture2DRect(sampler2DRect sampler, vec2 coord);
vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord);
vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord);
vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord);
vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord);

View file

@ -0,0 +1,7 @@
#extension GL_ARB_texture_rectangle : enable
vec4 texture2DRect(sampler2DRect sampler, vec2 coord);
vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord);
vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord);
vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord);
vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord);

View file

@ -0,0 +1,11 @@
#extension GL_EXT_texture_array : enable
vec4 texture1DArray(sampler1DArray sampler, vec2 coord);
vec4 texture1DArray(sampler1DArray sampler, vec2 coord, float bias);
vec4 texture2DArray(sampler1DArray sampler, vec2 coord);
vec4 texture2DArray(sampler1DArray sampler, vec2 coord, float bias);
vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord);
vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord, float bias);
vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord);

View file

@ -0,0 +1,11 @@
#extension GL_EXT_texture_array : enable
vec4 texture1DArray(sampler1DArray sampler, vec2 coord);
vec4 texture1DArrayLod(sampler1DArray sampler, vec2 coord, float lod);
vec4 texture2DArray(sampler1DArray sampler, vec2 coord);
vec4 texture2DArrayLod(sampler1DArray sampler, vec2 coord, float lod);
vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord);
vec4 shadow1DArrayLod(sampler1DArrayShadow sampler, vec3 coord, float lod);
vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord);

View file

@ -0,0 +1,39 @@
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include "glsl_parser_extras.h"
/* A dummy file. When compiling prototypes, we don't care about builtins.
* We really don't want to half-compile builtin_functions.cpp and fail, though.
*/
void
_mesa_glsl_release_functions(void)
{
}
void
_mesa_glsl_initialize_functions(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
}

View file

@ -1,164 +0,0 @@
#!/usr/bin/env perl
sub process_version {
my ($version) = @_;
my @vars;
print "/* $version builtins */\n\n";
my @files = <builtins/$version/*>;
foreach $file (@files) {
push(@vars, process_file($file));
}
print "static const char *functions_for_$version [] = {\n";
foreach $var (@vars) {
print " $var,\n";
}
print "};\n\n"
}
sub process_file {
my ($file) = @_;
# Change from builtins/110/foo to builtins_110_foo
my $var = $file; $var =~ s!/!_!g;
print "static const char *$var = {\n";
open SRC, "<", "$file" or die $!;
while (<SRC>) {
s/\\/\\\\/g;
s/\"/\\\"/g;
s/\n/\\n/g;
print " \"$_\"\n";
}
print "};\n\n";
close SRC or die $!;
return $var;
}
print << 'EOF';
/* DO NOT MODIFY - automatically generated by generate_builtins.pl */
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include "main/compiler.h"
#include "glsl_parser_extras.h"
#include "ir_reader.h"
#include "program.h"
extern "C" struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
gl_shader *
read_builtins(GLenum target, const char **functions, unsigned count)
{
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
new(sh) _mesa_glsl_parse_state(NULL, target, sh);
st->language_version = 130;
st->ARB_texture_rectangle_enable = true;
st->EXT_texture_array_enable = true;
_mesa_glsl_initialize_types(st);
sh->ir = new(sh) exec_list;
sh->symbols = st->symbols;
for (unsigned i = 0; i < count; i++) {
_mesa_glsl_read_ir(st, sh->ir, functions[i]);
if (st->error) {
printf("error reading builtin: %.35s ...\n", functions[i]);
delete st;
talloc_free(sh);
return NULL;
}
}
reparent_ir(sh->ir, sh);
delete st;
return sh;
}
EOF
@versions = sort(<builtins/[1-9A-Z]*>);
foreach $version (@versions) {
$version =~ s!builtins/!!g;
process_version($version);
}
print << 'EOF';
void *builtin_mem_ctx = NULL;
void
_mesa_glsl_release_functions(void)
{
talloc_free(builtin_mem_ctx);
}
void
_mesa_glsl_initialize_functions(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
if (builtin_mem_ctx == NULL)
builtin_mem_ctx = talloc_init("GLSL built-in functions");
state->num_builtins_to_link = 0;
EOF
foreach $version_xs (@versions) {
$check = "";
if ($version_xs =~ /_vs/) {
$check = "state->target == vertex_shader && ";
} elsif ($version_xs =~ /_fs/) {
$check = "state->target == fragment_shader && ";
}
$version = $version_xs;
$version =~ s/_[vf]s//g;
if ($version =~ /^[1-9][0-9][0-9]/) {
$check = "${check}state->language_version >= $version";
} else {
# Not a version...an extension name
$check = "${check}state->${version}_enable";
}
print " if ($check) {\n";
print " static gl_shader *sh = NULL;\n";
print "\n";
print " if (sh == NULL) {\n";
print " sh = read_builtins(GL_VERTEX_SHADER, functions_for_$version_xs,\n";
print " Elements(functions_for_$version_xs));\n";
print " talloc_steal(builtin_mem_ctx, sh);\n";
print " }\n";
print "\n";
print " import_prototypes(sh->ir, instructions, state->symbols, state);\n";
print " state->builtins_to_link[state->num_builtins_to_link] = sh;\n";
print " state->num_builtins_to_link++;\n";
print " }\n";
print "\n";
}
print "}\n";

View file

@ -0,0 +1,207 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re, glob, sys
from os import path
from subprocess import Popen, PIPE
# Local module: generator for texture lookup builtins
from texture_builtins import generate_texture_functions
builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..")
# Read the files in builtins/ir/*...add them to the supplied dictionary.
def read_ir_files(fs):
for filename in glob.glob(path.join(path.join(builtins_dir, 'ir'), '*')):
with open(filename) as f:
fs[path.basename(filename)] = f.read()
# Return a dictionary containing all builtin definitions (even generated)
def get_builtin_definitions():
fs = {}
generate_texture_functions(fs)
read_ir_files(fs)
return fs
def stringify(s):
t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "')
return ' "' + t + '"\n'
def write_function_definitions():
fs = get_builtin_definitions()
for k, v in fs.iteritems():
print 'static const char *builtin_' + k + ' ='
print stringify(v), ';'
def run_compiler(args):
compiler_path = path.join(path.join(builtins_dir, '..'), 'glsl_compiler')
command = [compiler_path, '--dump-lir'] + args
p = Popen(command, 1, stdout=PIPE, shell=False)
output = p.communicate()[0]
return (output, p.returncode)
def write_profile(filename, profile):
(proto_ir, returncode) = run_compiler([filename])
if returncode != 0:
print '#error builtins profile', profile, 'failed to compile'
return
# Kill any global variable declarations. We don't want them.
kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE);
proto_ir = kill_globals.sub('', proto_ir)
print 'static const char *prototypes_for_' + profile + ' ='
print stringify(proto_ir), ';'
# Print a table of all the functions (not signatures) referenced.
# This is done so we can avoid bothering with a hash table in the C++ code.
function_names = set()
for func in re.finditer(r'\(function (.+)\n', proto_ir):
function_names.add(func.group(1))
print 'static const char *functions_for_' + profile + ' [] = {'
for func in function_names:
print ' builtin_' + func + ','
print '};'
def write_profiles():
profiles = get_profile_list()
for (filename, profile) in profiles:
write_profile(filename, profile)
def get_profile_list():
profiles = []
for pfile in glob.glob(path.join(path.join(builtins_dir, 'profiles'), '*')):
profiles.append((pfile, path.basename(pfile).replace('.', '_')))
return profiles
if __name__ == "__main__":
print """/* DO NOT MODIFY - automatically generated by generate_builtins.py */
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include "main/compiler.h"
#include "glsl_parser_extras.h"
#include "ir_reader.h"
#include "program.h"
#include "ast.h"
extern "C" struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
new(sh) _mesa_glsl_parse_state(NULL, target, sh);
st->language_version = 130;
st->ARB_texture_rectangle_enable = true;
st->EXT_texture_array_enable = true;
_mesa_glsl_initialize_types(st);
sh->ir = new(sh) exec_list;
sh->symbols = st->symbols;
/* Read the IR containing the prototypes */
_mesa_glsl_read_ir(st, sh->ir, protos, true);
/* Read ALL the function bodies, telling the IR reader not to scan for
* prototypes (we've already created them). The IR reader will skip any
* signature that does not already exist as a prototype.
*/
for (unsigned i = 0; i < count; i++) {
_mesa_glsl_read_ir(st, sh->ir, functions[i], false);
if (st->error) {
printf("error reading builtin: %.35s ...\\n", functions[i]);
talloc_free(sh);
return NULL;
}
}
reparent_ir(sh->ir, sh);
delete st;
return sh;
}
"""
write_function_definitions()
write_profiles()
print """
void *builtin_mem_ctx = NULL;
void
_mesa_glsl_release_functions(void)
{
talloc_free(builtin_mem_ctx);
}
void
_mesa_glsl_initialize_functions(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
if (builtin_mem_ctx == NULL)
builtin_mem_ctx = talloc_init("GLSL built-in functions");
state->num_builtins_to_link = 0;
"""
profiles = get_profile_list()
for (filename, profile) in profiles:
if profile.endswith('_vert'):
check = 'state->target == vertex_shader && '
elif profile.endswith('_frag'):
check = 'state->target == fragment_shader && '
version = re.sub(r'_(vert|frag)$', '', profile)
if version.isdigit():
check += 'state->language_version == ' + version
else: # an extension name
check += 'state->' + version + '_enable'
print ' if (' + check + ') {'
print ' static gl_shader *sh = NULL;'
print ' if (sh == NULL) {'
print ' sh = read_builtins(GL_VERTEX_SHADER,'
print ' prototypes_for_' + profile + ','
print ' functions_for_' + profile + ','
print ' Elements(functions_for_' + profile,
print '));'
print ' talloc_steal(builtin_mem_ctx, sh);'
print ' }'
print
print ' import_prototypes(sh->ir, instructions, state->symbols,'
print ' state);'
print ' state->builtins_to_link[state->num_builtins_to_link] = sh;'
print ' state->num_builtins_to_link++;'
print ' }'
print
print '}'

View file

@ -1,7 +1,7 @@
#!/usr/bin/python
from os import path
import sys
import StringIO
def vec_type(g, size):
if size == 1:
@ -95,204 +95,255 @@ def generate_fiu_sigs(tex_inst, sampler_type, use_proj = False, unused_fields =
generate_sigs("i", tex_inst, sampler_type, use_proj, unused_fields)
generate_sigs("u", tex_inst, sampler_type, use_proj, unused_fields)
builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..")
def start_function(name):
sys.stdout = StringIO.StringIO()
print "((function " + name
with open(path.join(builtins_dir, "130", "texture"), 'w') as sys.stdout:
print "((function texture"
def end_function(fs, name):
print "))"
fs[name] = sys.stdout.getvalue();
sys.stdout.close()
# Generate all the functions and store them in the supplied dictionary.
# This is better than writing them to actual files since they should never be
# edited; it'd also be easy to confuse them with the many hand-generated files.
#
# Takes a dictionary as an argument.
def generate_texture_functions(fs):
start_function("texture")
generate_fiu_sigs("tex", "1D")
generate_fiu_sigs("tex", "2D")
generate_fiu_sigs("tex", "3D")
generate_fiu_sigs("tex", "Cube")
generate_fiu_sigs("tex", "1DArray")
generate_fiu_sigs("tex", "2DArray")
print "))"
# txb variants are only allowed within a fragment shader (GLSL 1.30 p. 86)
with open(path.join(builtins_dir, "130_fs", "texture"), 'w') as sys.stdout:
print "((function texture"
generate_fiu_sigs("txb", "1D")
generate_fiu_sigs("txb", "2D")
generate_fiu_sigs("txb", "3D")
generate_fiu_sigs("txb", "Cube")
generate_fiu_sigs("txb", "1DArray")
generate_fiu_sigs("txb", "2DArray")
print "))"
end_function(fs, "texture")
with open(path.join(builtins_dir, "130", "textureProj"), 'w') as sys.stdout:
print "((function textureProj"
start_function("textureProj")
generate_fiu_sigs("tex", "1D", True)
generate_fiu_sigs("tex", "1D", True, 2)
generate_fiu_sigs("tex", "2D", True)
generate_fiu_sigs("tex", "2D", True, 1)
generate_fiu_sigs("tex", "3D", True)
print "))"
with open(path.join(builtins_dir, "130_fs", "textureProj"), 'w') as sys.stdout:
print "((function textureProj"
generate_fiu_sigs("txb", "1D", True)
generate_fiu_sigs("txb", "1D", True, 2)
generate_fiu_sigs("txb", "2D", True)
generate_fiu_sigs("txb", "2D", True, 1)
generate_fiu_sigs("txb", "3D", True)
print "))"
end_function(fs, "textureProj")
with open(path.join(builtins_dir, "130", "textureLod"), 'w') as sys.stdout:
print "((function textureLod"
start_function("textureLod")
generate_fiu_sigs("txl", "1D")
generate_fiu_sigs("txl", "2D")
generate_fiu_sigs("txl", "3D")
generate_fiu_sigs("txl", "Cube")
generate_fiu_sigs("txl", "1DArray")
generate_fiu_sigs("txl", "2DArray")
print "))"
end_function(fs, "textureLod")
with open(path.join(builtins_dir, "130", "texelFetch"), 'w') as sys.stdout:
print "((function texelFetch"
start_function("texelFetch")
generate_fiu_sigs("txf", "1D")
generate_fiu_sigs("txf", "2D")
generate_fiu_sigs("txf", "3D")
generate_fiu_sigs("txf", "1DArray")
generate_fiu_sigs("txf", "2DArray")
print "))"
end_function(fs, "texelFetch")
with open(path.join(builtins_dir, "130", "textureProjLod"), 'w') as sys.stdout:
print "((function textureProjLod"
start_function("textureProjLod")
generate_fiu_sigs("txl", "1D", True)
generate_fiu_sigs("txl", "1D", True, 2)
generate_fiu_sigs("txl", "2D", True)
generate_fiu_sigs("txl", "2D", True, 1)
generate_fiu_sigs("txl", "3D", True)
print "))"
end_function(fs, "textureProjLod")
with open(path.join(builtins_dir, "130", "textureGrad"), 'w') as sys.stdout:
print "((function textureGrad"
start_function("textureGrad")
generate_fiu_sigs("txd", "1D")
generate_fiu_sigs("txd", "2D")
generate_fiu_sigs("txd", "3D")
generate_fiu_sigs("txd", "Cube")
generate_fiu_sigs("txd", "1DArray")
generate_fiu_sigs("txd", "2DArray")
print ")\n)"
end_function(fs, "textureGrad")
with open(path.join(builtins_dir, "130", "textureProjGrad"), 'w') as sys.stdout:
print "((function textureProjGrad"
start_function("textureProjGrad")
generate_fiu_sigs("txd", "1D", True)
generate_fiu_sigs("txd", "1D", True, 2)
generate_fiu_sigs("txd", "2D", True)
generate_fiu_sigs("txd", "2D", True, 1)
generate_fiu_sigs("txd", "3D", True)
print "))"
end_function(fs, "textureProjGrad")
# ARB_texture_rectangle extension
with open(path.join(builtins_dir, "ARB_texture_rectangle", "textures"), 'w') as sys.stdout:
print "((function texture2DRect"
# ARB_texture_rectangle extension
start_function("texture2DRect")
generate_sigs("", "tex", "2DRect")
print ")\n (function shadow2DRect"
end_function(fs, "texture2DRect")
start_function("texture2DRectProj")
generate_sigs("", "tex", "2DRect", True)
generate_sigs("", "tex", "2DRect", True, 1)
end_function(fs, "texture2DRectProj")
start_function("shadow2DRect")
generate_sigs("", "tex", "2DRectShadow")
print "))"
end_function(fs, "shadow2DRect")
# EXT_texture_array extension
with open(path.join(builtins_dir, "EXT_texture_array", "textures"), 'w') as sys.stdout:
print "((function texture1DArray"
start_function("shadow2DRectProj")
generate_sigs("", "tex", "2DRectShadow", True)
end_function(fs, "shadow2DRectProj")
# EXT_texture_array extension
start_function("texture1DArray")
generate_sigs("", "tex", "1DArray")
print ")\n (function texture1DArrayLod"
generate_sigs("", "txl", "1DArray")
print ")\n (function texture2DArray"
generate_sigs("", "tex", "2DArray")
print ")\n (function texture2DArrayLod"
generate_sigs("", "txl", "2DArray")
print ")\n (function shadow1DArray"
generate_sigs("", "tex", "1DArrayShadow")
print ")\n (function shadow1DArrayLod"
generate_sigs("", "txl", "1DArrayShadow")
print ")\n (function shadow2DArray"
generate_sigs("", "tex", "2DArrayShadow")
print "))"
with open(path.join(builtins_dir, "EXT_texture_array_fs", "textures"), 'w') as sys.stdout:
print "((function texture1DArray"
generate_sigs("", "txb", "1DArray")
print ")\n (function texture2DArray"
generate_sigs("", "txb", "2DArray")
print ")\n (function shadow1DArray"
generate_sigs("", "txb", "1DArrayShadow")
print "))"
end_function(fs, "texture1DArray")
# Deprecated (110/120 style) functions with silly names:
with open(path.join(builtins_dir, "110", "textures"), 'w') as sys.stdout:
print "((function texture1D"
start_function("texture1DArrayLod")
generate_sigs("", "txl", "1DArray")
end_function(fs, "texture1DArrayLod")
start_function("texture2DArray")
generate_sigs("", "tex", "2DArray")
generate_sigs("", "txb", "2DArray")
end_function(fs, "texture2DArray")
start_function("texture2DArrayLod")
generate_sigs("", "txl", "2DArray")
end_function(fs, "texture2DArrayLod")
start_function("shadow1DArray")
generate_sigs("", "tex", "1DArrayShadow")
generate_sigs("", "txb", "1DArrayShadow")
end_function(fs, "shadow1DArray")
start_function("shadow1DArrayLod")
generate_sigs("", "txl", "1DArrayShadow")
end_function(fs, "shadow1DArrayLod")
start_function("shadow2DArray")
generate_sigs("", "tex", "2DArrayShadow")
end_function(fs, "shadow2DArray")
# Deprecated (110/120 style) functions with silly names:
start_function("texture1D")
generate_sigs("", "tex", "1D")
print ")\n (function texture1DLod"
generate_sigs("", "txb", "1D")
end_function(fs, "texture1D")
start_function("texture1DLod")
generate_sigs("", "txl", "1D")
print ")\n (function texture1DProj"
end_function(fs, "texture1DLod")
start_function("texture1DProj")
generate_sigs("", "tex", "1D", True)
generate_sigs("", "tex", "1D", True, 2)
print ")\n (function texture1DProjLod"
generate_sigs("", "txl", "1D", True)
generate_sigs("", "txl", "1D", True, 2)
print ")\n (function texture2D"
generate_sigs("", "tex", "2D")
print ")\n(function texture2DLod"
generate_sigs("", "txl", "2D")
print ")\n (function texture2DProj"
generate_sigs("", "tex", "2D", True)
generate_sigs("", "tex", "2D", True, 1)
print ")\n (function texture2DProjLod"
generate_sigs("", "txl", "2D", True)
generate_sigs("", "txl", "2D", True, 1)
print ")\n (function texture3D"
generate_sigs("", "tex", "3D")
print ")\n (function texture3DLod"
generate_sigs("", "txl", "3D")
print ")\n (function texture3DProj"
generate_sigs("", "tex", "3D", True)
print ")\n (function texture3DProjLod"
generate_sigs("", "txl", "3D", True)
print ")\n (function textureCube"
generate_sigs("", "tex", "Cube")
print ")\n (function textureCubeLod"
generate_sigs("", "txl", "Cube")
print ")\n (function shadow1D"
generate_sigs("", "tex", "1DShadow", False, 1)
print ")\n (function shadow1DLod"
generate_sigs("", "txl", "1DShadow", False, 1)
print ")\n (function shadow1DProj"
generate_sigs("", "tex", "1DShadow", True, 1)
print ")\n (function shadow1DProjLod"
generate_sigs("", "txl", "1DShadow", True, 1)
print ")\n (function shadow2D"
generate_sigs("", "tex", "2DShadow")
print ")\n (function shadow2DLod"
generate_sigs("", "txl", "2DShadow")
print ")\n (function shadow2DProj"
generate_sigs("", "tex", "2DShadow", True)
print ")\n (function shadow2DProjLod"
generate_sigs("", "txl", "2DShadow", True)
print "))"
with open(path.join(builtins_dir, "110_fs", "textures"), 'w') as sys.stdout:
print "((function texture1D"
generate_sigs("", "txb", "1D")
print ")\n (function texture1DProj"
generate_sigs("", "txb", "1D", True)
generate_sigs("", "txb", "1D", True, 2)
print ")\n (function texture2D"
end_function(fs, "texture1DProj")
start_function("texture1DProjLod")
generate_sigs("", "txl", "1D", True)
generate_sigs("", "txl", "1D", True, 2)
end_function(fs, "texture1DProjLod")
start_function("texture2D")
generate_sigs("", "tex", "2D")
generate_sigs("", "txb", "2D")
print ")\n (function texture2DProj"
end_function(fs, "texture2D")
start_function("texture2DLod")
generate_sigs("", "txl", "2D")
end_function(fs, "texture2DLod")
start_function("texture2DProj")
generate_sigs("", "tex", "2D", True)
generate_sigs("", "tex", "2D", True, 1)
generate_sigs("", "txb", "2D", True)
generate_sigs("", "txb", "2D", True, 1)
print ")\n (function texture3D"
end_function(fs, "texture2DProj")
start_function("texture2DProjLod")
generate_sigs("", "txl", "2D", True)
generate_sigs("", "txl", "2D", True, 1)
end_function(fs, "texture2DProjLod")
start_function("texture3D")
generate_sigs("", "tex", "3D")
generate_sigs("", "txb", "3D")
print ")\n (function texture3DProj"
end_function(fs, "texture3D")
start_function("texture3DLod")
generate_sigs("", "txl", "3D")
end_function(fs, "texture3DLod")
start_function("texture3DProj")
generate_sigs("", "tex", "3D", True)
generate_sigs("", "txb", "3D", True)
print ")\n (function textureCube"
end_function(fs, "texture3DProj")
start_function("texture3DProjLod")
generate_sigs("", "txl", "3D", True)
end_function(fs, "texture3DProjLod")
start_function("textureCube")
generate_sigs("", "tex", "Cube")
generate_sigs("", "txb", "Cube")
print ")\n (function shadow1D"
end_function(fs, "textureCube")
start_function("textureCubeLod")
generate_sigs("", "txl", "Cube")
end_function(fs, "textureCubeLod")
start_function("shadow1D")
generate_sigs("", "tex", "1DShadow", False, 1)
generate_sigs("", "txb", "1DShadow", False, 1)
print ")\n (function shadow1DProj"
end_function(fs, "shadow1D")
start_function("shadow1DLod")
generate_sigs("", "txl", "1DShadow", False, 1)
end_function(fs, "shadow1DLod")
start_function("shadow1DProj")
generate_sigs("", "tex", "1DShadow", True, 1)
generate_sigs("", "txb", "1DShadow", True, 1)
print ")\n (function shadow2D"
end_function(fs, "shadow1DProj")
start_function("shadow1DProjLod")
generate_sigs("", "txl", "1DShadow", True, 1)
end_function(fs, "shadow1DProjLod")
start_function("shadow2D")
generate_sigs("", "tex", "2DShadow")
generate_sigs("", "txb", "2DShadow")
print ")\n (function shadow2DProj"
end_function(fs, "shadow2D")
start_function("shadow2DLod")
generate_sigs("", "txl", "2DShadow")
end_function(fs, "shadow2DLod")
start_function("shadow2DProj")
generate_sigs("", "tex", "2DShadow", True)
generate_sigs("", "txb", "2DShadow", True)
print "))"
end_function(fs, "shadow2DProj")
start_function("shadow2DProjLod")
generate_sigs("", "txl", "2DShadow", True)
end_function(fs, "shadow2DProjLod")
sys.stdout = sys.__stdout__
return fs
# If you actually run this script, it'll print out all the functions.
if __name__ == "__main__":
fs = {}
generate_texture_functions(fs);
for k, v in fs.iteritems():
print v

Some files were not shown because too many files have changed in this diff Show more