diff options
Diffstat (limited to 'src/glsl/builtins')
-rw-r--r-- | src/glsl/builtins/110/clamp | 50 | ||||
-rw-r--r-- | src/glsl/builtins/110/matrixCompMult | 32 | ||||
-rw-r--r-- | src/glsl/builtins/110/max | 43 | ||||
-rw-r--r-- | src/glsl/builtins/110/min | 43 | ||||
-rw-r--r-- | src/glsl/builtins/110/noise_fake | 76 | ||||
-rw-r--r-- | src/glsl/builtins/110/sign | 21 | ||||
-rw-r--r-- | src/glsl/builtins/110/textures | 213 | ||||
-rw-r--r-- | src/glsl/builtins/110_fs/derivatives | 73 | ||||
-rw-r--r-- | src/glsl/builtins/110_fs/textures | 113 | ||||
-rw-r--r-- | src/glsl/builtins/130/equal | 31 | ||||
-rw-r--r-- | src/glsl/builtins/130/greaterThan | 31 | ||||
-rw-r--r-- | src/glsl/builtins/130/greaterThanEqual | 31 | ||||
-rw-r--r-- | src/glsl/builtins/130/lessThan | 31 | ||||
-rw-r--r-- | src/glsl/builtins/130/lessThanEqual | 31 | ||||
-rw-r--r-- | src/glsl/builtins/130/mix | 39 | ||||
-rw-r--r-- | src/glsl/builtins/130/notEqual | 31 | ||||
-rw-r--r-- | src/glsl/builtins/130/texelFetch | 107 | ||||
-rw-r--r-- | src/glsl/builtins/130/texture | 110 | ||||
-rw-r--r-- | src/glsl/builtins/130/textureGrad | 147 | ||||
-rw-r--r-- | src/glsl/builtins/130/textureLod | 128 | ||||
-rw-r--r-- | src/glsl/builtins/130/textureProj | 92 | ||||
-rw-r--r-- | src/glsl/builtins/130/textureProjGrad | 122 | ||||
-rw-r--r-- | src/glsl/builtins/130/textureProjLod | 107 | ||||
-rw-r--r-- | src/glsl/builtins/130_fs/texture | 128 | ||||
-rw-r--r-- | src/glsl/builtins/130_fs/textureProj | 107 | ||||
-rw-r--r-- | src/glsl/builtins/ARB_texture_rectangle/textures | 16 | ||||
-rw-r--r-- | src/glsl/builtins/EXT_texture_array/textures | 59 | ||||
-rw-r--r-- | src/glsl/builtins/EXT_texture_array_fs/textures | 27 | ||||
-rw-r--r-- | src/glsl/builtins/ir/abs (renamed from src/glsl/builtins/110/abs) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/acos | 22 | ||||
-rw-r--r-- | src/glsl/builtins/ir/all (renamed from src/glsl/builtins/110/all) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/any (renamed from src/glsl/builtins/110/any) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/asin (renamed from src/glsl/builtins/110/asin) | 25 | ||||
-rw-r--r-- | src/glsl/builtins/ir/atan (renamed from src/glsl/builtins/110/atan) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/ceil (renamed from src/glsl/builtins/110/ceil) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/clamp (renamed from src/glsl/builtins/130/clamp) | 49 | ||||
-rw-r--r-- | src/glsl/builtins/ir/cos (renamed from src/glsl/builtins/110/cos) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/cosh (renamed from src/glsl/builtins/130/cosh) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/cross (renamed from src/glsl/builtins/110/cross) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/dFdx | 21 | ||||
-rw-r--r-- | src/glsl/builtins/ir/dFdy | 21 | ||||
-rw-r--r-- | src/glsl/builtins/ir/degrees (renamed from src/glsl/builtins/110/degrees) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/distance (renamed from src/glsl/builtins/110/distance) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/dot (renamed from src/glsl/builtins/110/dot) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/equal (renamed from src/glsl/builtins/110/equal) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/exp (renamed from src/glsl/builtins/110/exp) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/exp2 (renamed from src/glsl/builtins/110/exp2) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/faceforward (renamed from src/glsl/builtins/110/faceforward) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/floor (renamed from src/glsl/builtins/110/floor) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/fract (renamed from src/glsl/builtins/110/fract) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/ftransform (renamed from src/glsl/builtins/110_vs/ftransform) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/fwidth | 29 | ||||
-rw-r--r-- | src/glsl/builtins/ir/greaterThan (renamed from src/glsl/builtins/110/greaterThan) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/greaterThanEqual (renamed from src/glsl/builtins/110/greaterThanEqual) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/inversesqrt (renamed from src/glsl/builtins/110/inversesqrt) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/length (renamed from src/glsl/builtins/110/length) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/lessThan (renamed from src/glsl/builtins/110/lessThan) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/lessThanEqual (renamed from src/glsl/builtins/110/lessThanEqual) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/log (renamed from src/glsl/builtins/110/log) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/log2 (renamed from src/glsl/builtins/110/log2) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/matrixCompMult (renamed from src/glsl/builtins/120/matrixCompMult) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/max (renamed from src/glsl/builtins/130/max) | 42 | ||||
-rw-r--r-- | src/glsl/builtins/ir/min (renamed from src/glsl/builtins/130/min) | 42 | ||||
-rw-r--r-- | src/glsl/builtins/ir/mix (renamed from src/glsl/builtins/110/mix) | 38 | ||||
-rw-r--r-- | src/glsl/builtins/ir/mod (renamed from src/glsl/builtins/110/mod) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/noise1 | 18 | ||||
-rw-r--r-- | src/glsl/builtins/ir/noise2 | 18 | ||||
-rw-r--r-- | src/glsl/builtins/ir/noise3 | 18 | ||||
-rw-r--r-- | src/glsl/builtins/ir/noise4 | 18 | ||||
-rw-r--r-- | src/glsl/builtins/ir/normalize (renamed from src/glsl/builtins/110/normalize) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/not (renamed from src/glsl/builtins/110/not) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/notEqual (renamed from src/glsl/builtins/110/notEqual) | 30 | ||||
-rw-r--r-- | src/glsl/builtins/ir/outerProduct (renamed from src/glsl/builtins/120/outerProduct) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/pow (renamed from src/glsl/builtins/110/pow) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/radians (renamed from src/glsl/builtins/110/radians) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/reflect (renamed from src/glsl/builtins/110/reflect) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/refract (renamed from src/glsl/builtins/110/refract) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/sign (renamed from src/glsl/builtins/130/sign) | 20 | ||||
-rw-r--r-- | src/glsl/builtins/ir/sin (renamed from src/glsl/builtins/110/sin) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/sinh (renamed from src/glsl/builtins/130/sinh) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/smoothstep (renamed from src/glsl/builtins/110/smoothstep) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/sqrt (renamed from src/glsl/builtins/110/sqrt) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/step (renamed from src/glsl/builtins/110/step) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/tan (renamed from src/glsl/builtins/110/tan) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/tanh (renamed from src/glsl/builtins/130/tanh) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/ir/transpose (renamed from src/glsl/builtins/120/transpose) | 0 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/110.frag | 364 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/110.vert | 351 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/120.frag | 396 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/120.vert | 383 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/ARB_texture_rectangle.frag | 7 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/ARB_texture_rectangle.vert | 7 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/EXT_texture_array.frag | 11 | ||||
-rw-r--r-- | src/glsl/builtins/profiles/EXT_texture_array.vert | 11 | ||||
-rw-r--r-- | src/glsl/builtins/tools/builtin_function.cpp | 39 | ||||
-rwxr-xr-x | src/glsl/builtins/tools/generate_builtins.pl | 164 | ||||
-rwxr-xr-x | src/glsl/builtins/tools/generate_builtins.py | 207 | ||||
-rwxr-xr-x | src/glsl/builtins/tools/texture_builtins.py | 261 |
98 files changed, 2499 insertions, 2332 deletions
diff --git a/src/glsl/builtins/110/clamp b/src/glsl/builtins/110/clamp deleted file mode 100644 index d05cc76dc23..00000000000 --- a/src/glsl/builtins/110/clamp +++ /dev/null @@ -1,50 +0,0 @@ -((function clamp - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) vec2 arg2)) - ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) vec3 arg2)) - ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) vec4 arg2)) - ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/matrixCompMult b/src/glsl/builtins/110/matrixCompMult deleted file mode 100644 index cb5a2cb1f7b..00000000000 --- a/src/glsl/builtins/110/matrixCompMult +++ /dev/null @@ -1,32 +0,0 @@ -((function matrixCompMult - (signature mat2 - (parameters - (declare (in) mat2 x) - (declare (in) mat2 y)) - ((declare () mat2 z) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) -(return (var_ref z)))) - - (signature mat3 - (parameters - (declare (in) mat3 x) - (declare (in) mat3 y)) - ((declare () mat3 z) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) -(return (var_ref z)))) - - (signature mat4 - (parameters - (declare (in) mat4 x) - (declare (in) mat4 y)) - ((declare () mat4 z) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) - (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) -)) - diff --git a/src/glsl/builtins/110/max b/src/glsl/builtins/110/max deleted file mode 100644 index f91ae417e4b..00000000000 --- a/src/glsl/builtins/110/max +++ /dev/null @@ -1,43 +0,0 @@ -((function max - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float max (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/min b/src/glsl/builtins/110/min deleted file mode 100644 index 78fc44120af..00000000000 --- a/src/glsl/builtins/110/min +++ /dev/null @@ -1,43 +0,0 @@ -((function min - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float min (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/110/noise_fake b/src/glsl/builtins/110/noise_fake deleted file mode 100644 index bcfb17b04b8..00000000000 --- a/src/glsl/builtins/110/noise_fake +++ /dev/null @@ -1,76 +0,0 @@ -((function noise1 - (signature float - (parameters - (declare (in) float x)) - ((return (constant float (0))))) - (signature float - (parameters - (declare (in) vec2 x)) - ((return (constant float (0))))) - (signature float - (parameters - (declare (in) vec3 x)) - ((return (constant float (0))))) - (signature float - (parameters - (declare (in) vec4 x)) - ((return (constant float (0))))) - ) - - (function noise2 - (signature vec2 - (parameters - (declare (in) float x)) - ((return (constant vec2 (0 0))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (constant vec2 (0 0))))) - (signature vec2 - (parameters - (declare (in) vec3 x)) - ((return (constant vec2 (0 0))))) - (signature vec2 - (parameters - (declare (in) vec4 x)) - ((return (constant vec2 (0 0))))) - ) - - (function noise3 - (signature vec3 - (parameters - (declare (in) float x)) - ((return (constant vec3 (0 0 0))))) - (signature vec3 - (parameters - (declare (in) vec2 x)) - ((return (constant vec3 (0 0 0))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (constant vec3 (0 0 0))))) - (signature vec3 - (parameters - (declare (in) vec4 x)) - ((return (constant vec3 (0 0 0))))) - ) - - (function noise4 - (signature vec4 - (parameters - (declare (in) float x)) - ((return (constant vec4 (0 0 0 0))))) - (signature vec4 - (parameters - (declare (in) vec2 x)) - ((return (constant vec4 (0 0 0 0))))) - (signature vec4 - (parameters - (declare (in) vec3 x)) - ((return (constant vec4 (0 0 0 0))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (constant vec4 (0 0 0 0))))) - ) -) diff --git a/src/glsl/builtins/110/sign b/src/glsl/builtins/110/sign deleted file mode 100644 index fa475197cf5..00000000000 --- a/src/glsl/builtins/110/sign +++ /dev/null @@ -1,21 +0,0 @@ -((function sign - (signature float - (parameters - (declare (in) float x)) - ((return (expression float sign (var_ref x))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 sign (var_ref x))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 sign (var_ref x))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 sign (var_ref x))))) -)) diff --git a/src/glsl/builtins/110/textures b/src/glsl/builtins/110/textures deleted file mode 100644 index c81b7e8ad49..00000000000 --- a/src/glsl/builtins/110/textures +++ /dev/null @@ -1,213 +0,0 @@ -((function texture1D - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture1DLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture1DProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -) - (function texture1DProjLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -) - (function texture2D - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) -(function texture2DLod - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture2DProj - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -) - (function texture2DProjLod - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -) - (function texture3D - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture3DLod - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture3DProj - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -) - (function texture3DProjLod - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -) - (function textureCube - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function textureCubeLod - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function shadow1D - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -) - (function shadow1DLod - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow1DProj - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) )))) - -) - (function shadow1DProjLod - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow2D - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -) - (function shadow2DLod - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow2DProj - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) )))) - -) - (function shadow2DProjLod - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/110_fs/derivatives b/src/glsl/builtins/110_fs/derivatives deleted file mode 100644 index b79852ee1ff..00000000000 --- a/src/glsl/builtins/110_fs/derivatives +++ /dev/null @@ -1,73 +0,0 @@ -((function dFdx - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdx (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdx (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdx (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdx (var_ref p))))) - ) - - (function dFdy - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdy (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdy (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdy (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdy (var_ref p))))) - ) - - (function fwidth - (signature float - (parameters - (declare (in) float p)) - ((return (expression float + - (expression float abs (expression float dFdx (var_ref p))) - (expression float abs (expression float dFdy (var_ref p))))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 + - (expression vec2 abs (expression vec2 dFdx (var_ref p))) - (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 + - (expression vec3 abs (expression vec3 dFdx (var_ref p))) - (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 + - (expression vec4 abs (expression vec4 dFdx (var_ref p))) - (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) -)) diff --git a/src/glsl/builtins/110_fs/textures b/src/glsl/builtins/110_fs/textures deleted file mode 100644 index 38f3787e9ef..00000000000 --- a/src/glsl/builtins/110_fs/textures +++ /dev/null @@ -1,113 +0,0 @@ -((function texture1D - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture1DProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -) - (function texture2D - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture2DProj - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -) - (function texture3D - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture3DProj - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -) - (function textureCube - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function shadow1D - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) - -) - (function shadow1DProj - (signature vec4 - (parameters - (declare (in) sampler1DShadow sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) )))) - -) - (function shadow2D - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) - -) - (function shadow2DProj - (signature vec4 - (parameters - (declare (in) sampler2DShadow sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) (swiz z (var_ref P)) (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/130/equal b/src/glsl/builtins/130/equal deleted file mode 100644 index 079c3e97fb2..00000000000 --- a/src/glsl/builtins/130/equal +++ /dev/null @@ -1,31 +0,0 @@ -((function equal - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/greaterThan b/src/glsl/builtins/130/greaterThan deleted file mode 100644 index a9fb7b3a43e..00000000000 --- a/src/glsl/builtins/130/greaterThan +++ /dev/null @@ -1,31 +0,0 @@ -((function greaterThan - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/greaterThanEqual b/src/glsl/builtins/130/greaterThanEqual deleted file mode 100644 index 293c93c7cca..00000000000 --- a/src/glsl/builtins/130/greaterThanEqual +++ /dev/null @@ -1,31 +0,0 @@ -((function greaterThanEqual - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/lessThan b/src/glsl/builtins/130/lessThan deleted file mode 100644 index d9f693fd63f..00000000000 --- a/src/glsl/builtins/130/lessThan +++ /dev/null @@ -1,31 +0,0 @@ -((function lessThan - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/lessThanEqual b/src/glsl/builtins/130/lessThanEqual deleted file mode 100644 index 494411b869a..00000000000 --- a/src/glsl/builtins/130/lessThanEqual +++ /dev/null @@ -1,31 +0,0 @@ -((function lessThanEqual - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/mix b/src/glsl/builtins/130/mix deleted file mode 100644 index 9a1fcd70ffa..00000000000 --- a/src/glsl/builtins/130/mix +++ /dev/null @@ -1,39 +0,0 @@ -((function mix - (signature float - (parameters - (declare (in) float v1) - (declare (in) float v2) - (declare (in) bool a)) - ((assign (var_ref a) (var_ref v1) (var_ref v2)) - (return (var_ref v1)))) - - (signature vec2 - (parameters - (declare (in) vec2 v1) - (declare (in) vec2 v2) - (declare (in) bvec2 a)) - ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) - (return (var_ref v1)))) - - (signature vec3 - (parameters - (declare (in) vec3 v1) - (declare (in) vec3 v2) - (declare (in) bvec3 a)) - ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) - (return (var_ref v1)))) - - (signature vec4 - (parameters - (declare (in) vec4 v1) - (declare (in) vec4 v2) - (declare (in) bvec4 a)) - ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2))) - (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2))) - (return (var_ref v1)))) -)) diff --git a/src/glsl/builtins/130/notEqual b/src/glsl/builtins/130/notEqual deleted file mode 100644 index 81e6376bd9c..00000000000 --- a/src/glsl/builtins/130/notEqual +++ /dev/null @@ -1,31 +0,0 @@ -((function notEqual - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((declare () bvec2 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((declare () bvec3 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (return (var_ref temp)))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((declare () bvec4 temp) - (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) - (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) - (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) - (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) - (return (var_ref temp)))) -)) diff --git a/src/glsl/builtins/130/texelFetch b/src/glsl/builtins/130/texelFetch deleted file mode 100644 index d51ce65a897..00000000000 --- a/src/glsl/builtins/130/texelFetch +++ /dev/null @@ -1,107 +0,0 @@ -((function texelFetch - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) int P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) int P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) int P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) ivec2 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) ivec3 P) - (declare (in) int lod) ) - ((return (txf (var_ref sampler) (var_ref P) (0 0 0) (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/130/texture b/src/glsl/builtins/130/texture deleted file mode 100644 index b170b583094..00000000000 --- a/src/glsl/builtins/130/texture +++ /dev/null @@ -1,110 +0,0 @@ -((function texture - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -)) diff --git a/src/glsl/builtins/130/textureGrad b/src/glsl/builtins/130/textureGrad deleted file mode 100644 index 0ef428c224a..00000000000 --- a/src/glsl/builtins/130/textureGrad +++ /dev/null @@ -1,147 +0,0 @@ -((function textureGrad - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (var_ref P) (0 0 0) 1 () ((var_ref dPdx) (var_ref dPdy)) )))) - -) -) diff --git a/src/glsl/builtins/130/textureLod b/src/glsl/builtins/130/textureLod deleted file mode 100644 index 7d7059d848c..00000000000 --- a/src/glsl/builtins/130/textureLod +++ /dev/null @@ -1,128 +0,0 @@ -((function textureLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/130/textureProj b/src/glsl/builtins/130/textureProj deleted file mode 100644 index 40ea1c2af68..00000000000 --- a/src/glsl/builtins/130/textureProj +++ /dev/null @@ -1,92 +0,0 @@ -((function textureProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () )))) - -)) diff --git a/src/glsl/builtins/130/textureProjGrad b/src/glsl/builtins/130/textureProjGrad deleted file mode 100644 index b4bfa58c123..00000000000 --- a/src/glsl/builtins/130/textureProjGrad +++ /dev/null @@ -1,122 +0,0 @@ -((function textureProjGrad - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) - (declare (in) float dPdx) - (declare (in) float dPdy) ) - ((return (txd (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) - (declare (in) vec2 dPdx) - (declare (in) vec2 dPdy) ) - ((return (txd (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) - (declare (in) vec3 dPdx) - (declare (in) vec3 dPdy) ) - ((return (txd (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () ((var_ref dPdx) (var_ref dPdy)) )))) - -)) diff --git a/src/glsl/builtins/130/textureProjLod b/src/glsl/builtins/130/textureProjLod deleted file mode 100644 index d242f7e40fc..00000000000 --- a/src/glsl/builtins/130/textureProjLod +++ /dev/null @@ -1,107 +0,0 @@ -((function textureProjLod - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref lod) )))) - -)) diff --git a/src/glsl/builtins/130_fs/texture b/src/glsl/builtins/130_fs/texture deleted file mode 100644 index 0de981397f0..00000000000 --- a/src/glsl/builtins/130_fs/texture +++ /dev/null @@ -1,128 +0,0 @@ -((function texture - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) float P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) samplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usamplerCube sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/130_fs/textureProj b/src/glsl/builtins/130_fs/textureProj deleted file mode 100644 index b1d8f0a2f33..00000000000 --- a/src/glsl/builtins/130_fs/textureProj +++ /dev/null @@ -1,107 +0,0 @@ -((function textureProj - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz y (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler1D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz x (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz z (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler2D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature vec4 - (parameters - (declare (in) sampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature ivec4 - (parameters - (declare (in) isampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - - (signature uvec4 - (parameters - (declare (in) usampler3D sampler) - (declare (in) vec4 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) (swiz w (var_ref P)) () (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/ARB_texture_rectangle/textures b/src/glsl/builtins/ARB_texture_rectangle/textures deleted file mode 100644 index 161d8c4a541..00000000000 --- a/src/glsl/builtins/ARB_texture_rectangle/textures +++ /dev/null @@ -1,16 +0,0 @@ -((function texture2DRect - (signature vec4 - (parameters - (declare (in) sampler2DRect sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function shadow2DRect - (signature vec4 - (parameters - (declare (in) sampler2DRectShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -)) diff --git a/src/glsl/builtins/EXT_texture_array/textures b/src/glsl/builtins/EXT_texture_array/textures deleted file mode 100644 index 8a91f901401..00000000000 --- a/src/glsl/builtins/EXT_texture_array/textures +++ /dev/null @@ -1,59 +0,0 @@ -((function texture1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture1DArrayLod - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function texture2DArray - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (var_ref P) (0 0 0) 1 () )))) - -) - (function texture2DArrayLod - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref lod) )))) - -) - (function shadow1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArrayShadow sampler) - (declare (in) vec3 P) ) - ((return (tex (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) )))) - -) - (function shadow1DArrayLod - (signature vec4 - (parameters - (declare (in) sampler1DArrayShadow sampler) - (declare (in) vec3 P) - (declare (in) float lod) ) - ((return (txl (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref lod) )))) - -) - (function shadow2DArray - (signature vec4 - (parameters - (declare (in) sampler2DArrayShadow sampler) - (declare (in) vec4 P) ) - ((return (tex (var_ref sampler) (swiz xyz (var_ref P)) (0 0 0) 1 (swiz w (var_ref P)) )))) - -)) diff --git a/src/glsl/builtins/EXT_texture_array_fs/textures b/src/glsl/builtins/EXT_texture_array_fs/textures deleted file mode 100644 index 74e184387ac..00000000000 --- a/src/glsl/builtins/EXT_texture_array_fs/textures +++ /dev/null @@ -1,27 +0,0 @@ -((function texture1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArray sampler) - (declare (in) vec2 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function texture2DArray - (signature vec4 - (parameters - (declare (in) sampler2DArray sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (var_ref P) (0 0 0) 1 () (var_ref bias) )))) - -) - (function shadow1DArray - (signature vec4 - (parameters - (declare (in) sampler1DArrayShadow sampler) - (declare (in) vec3 P) - (declare (in) float bias) ) - ((return (txb (var_ref sampler) (swiz xy (var_ref P)) (0 0 0) 1 (swiz z (var_ref P)) (var_ref bias) )))) - -)) diff --git a/src/glsl/builtins/110/abs b/src/glsl/builtins/ir/abs index 904845307c4..904845307c4 100644 --- a/src/glsl/builtins/110/abs +++ b/src/glsl/builtins/ir/abs diff --git a/src/glsl/builtins/ir/acos b/src/glsl/builtins/ir/acos new file mode 100644 index 00000000000..d1cfebeff8a --- /dev/null +++ b/src/glsl/builtins/ir/acos @@ -0,0 +1,22 @@ +((function acos + (signature float + (parameters + (declare (in) float x)) + ((return (expression float - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) +)) diff --git a/src/glsl/builtins/110/all b/src/glsl/builtins/ir/all index 2cac0dfb684..2cac0dfb684 100644 --- a/src/glsl/builtins/110/all +++ b/src/glsl/builtins/ir/all diff --git a/src/glsl/builtins/110/any b/src/glsl/builtins/ir/any index f10e8a7b478..f10e8a7b478 100644 --- a/src/glsl/builtins/110/any +++ b/src/glsl/builtins/ir/any diff --git a/src/glsl/builtins/110/asin b/src/glsl/builtins/ir/asin index d26bde364b1..e230ad614ee 100644 --- a/src/glsl/builtins/110/asin +++ b/src/glsl/builtins/ir/asin @@ -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)))))))))))) )) diff --git a/src/glsl/builtins/110/atan b/src/glsl/builtins/ir/atan index 84048293870..84048293870 100644 --- a/src/glsl/builtins/110/atan +++ b/src/glsl/builtins/ir/atan diff --git a/src/glsl/builtins/110/ceil b/src/glsl/builtins/ir/ceil index a26a7750493..a26a7750493 100644 --- a/src/glsl/builtins/110/ceil +++ b/src/glsl/builtins/ir/ceil diff --git a/src/glsl/builtins/130/clamp b/src/glsl/builtins/ir/clamp index e1aad5c8d98..2bdc466b269 100644 --- a/src/glsl/builtins/130/clamp +++ b/src/glsl/builtins/ir/clamp @@ -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) diff --git a/src/glsl/builtins/110/cos b/src/glsl/builtins/ir/cos index 88f266eccbe..88f266eccbe 100644 --- a/src/glsl/builtins/110/cos +++ b/src/glsl/builtins/ir/cos diff --git a/src/glsl/builtins/130/cosh b/src/glsl/builtins/ir/cosh index 45e0ae427d6..45e0ae427d6 100644 --- a/src/glsl/builtins/130/cosh +++ b/src/glsl/builtins/ir/cosh diff --git a/src/glsl/builtins/110/cross b/src/glsl/builtins/ir/cross index 24717a2183d..24717a2183d 100644 --- a/src/glsl/builtins/110/cross +++ b/src/glsl/builtins/ir/cross diff --git a/src/glsl/builtins/ir/dFdx b/src/glsl/builtins/ir/dFdx new file mode 100644 index 00000000000..30594d33c74 --- /dev/null +++ b/src/glsl/builtins/ir/dFdx @@ -0,0 +1,21 @@ +((function dFdx + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdx (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdx (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdx (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdx (var_ref p))))) +)) diff --git a/src/glsl/builtins/ir/dFdy b/src/glsl/builtins/ir/dFdy new file mode 100644 index 00000000000..fb5798d3cbe --- /dev/null +++ b/src/glsl/builtins/ir/dFdy @@ -0,0 +1,21 @@ +((function dFdy + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdy (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdy (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdy (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdy (var_ref p))))) +)) diff --git a/src/glsl/builtins/110/degrees b/src/glsl/builtins/ir/degrees index dc0d7b9e20d..dc0d7b9e20d 100644 --- a/src/glsl/builtins/110/degrees +++ b/src/glsl/builtins/ir/degrees diff --git a/src/glsl/builtins/110/distance b/src/glsl/builtins/ir/distance index a2309c484f9..a2309c484f9 100644 --- a/src/glsl/builtins/110/distance +++ b/src/glsl/builtins/ir/distance diff --git a/src/glsl/builtins/110/dot b/src/glsl/builtins/ir/dot index a91a6d2c56d..a91a6d2c56d 100644 --- a/src/glsl/builtins/110/dot +++ b/src/glsl/builtins/ir/dot diff --git a/src/glsl/builtins/110/equal b/src/glsl/builtins/ir/equal index ae7ddc53bdc..d7a4bc6063f 100644 --- a/src/glsl/builtins/110/equal +++ b/src/glsl/builtins/ir/equal @@ -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)))) )) diff --git a/src/glsl/builtins/110/exp b/src/glsl/builtins/ir/exp index a73bd6a7f84..a73bd6a7f84 100644 --- a/src/glsl/builtins/110/exp +++ b/src/glsl/builtins/ir/exp diff --git a/src/glsl/builtins/110/exp2 b/src/glsl/builtins/ir/exp2 index a842d3fe65b..a842d3fe65b 100644 --- a/src/glsl/builtins/110/exp2 +++ b/src/glsl/builtins/ir/exp2 diff --git a/src/glsl/builtins/110/faceforward b/src/glsl/builtins/ir/faceforward index d1703972388..d1703972388 100644 --- a/src/glsl/builtins/110/faceforward +++ b/src/glsl/builtins/ir/faceforward diff --git a/src/glsl/builtins/110/floor b/src/glsl/builtins/ir/floor index 8dd8052799b..8dd8052799b 100644 --- a/src/glsl/builtins/110/floor +++ b/src/glsl/builtins/ir/floor diff --git a/src/glsl/builtins/110/fract b/src/glsl/builtins/ir/fract index 3f0763d1b3e..3f0763d1b3e 100644 --- a/src/glsl/builtins/110/fract +++ b/src/glsl/builtins/ir/fract diff --git a/src/glsl/builtins/110_vs/ftransform b/src/glsl/builtins/ir/ftransform index 9ca63dc1e34..9ca63dc1e34 100644 --- a/src/glsl/builtins/110_vs/ftransform +++ b/src/glsl/builtins/ir/ftransform diff --git a/src/glsl/builtins/ir/fwidth b/src/glsl/builtins/ir/fwidth new file mode 100644 index 00000000000..385e05d6a1a --- /dev/null +++ b/src/glsl/builtins/ir/fwidth @@ -0,0 +1,29 @@ +((function fwidth + (signature float + (parameters + (declare (in) float p)) + ((return (expression float + + (expression float abs (expression float dFdx (var_ref p))) + (expression float abs (expression float dFdy (var_ref p))))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 + + (expression vec2 abs (expression vec2 dFdx (var_ref p))) + (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 + + (expression vec3 abs (expression vec3 dFdx (var_ref p))) + (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 + + (expression vec4 abs (expression vec4 dFdx (var_ref p))) + (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) +)) diff --git a/src/glsl/builtins/110/greaterThan b/src/glsl/builtins/ir/greaterThan index ae03030e495..ce7bd29bed8 100644 --- a/src/glsl/builtins/110/greaterThan +++ b/src/glsl/builtins/ir/greaterThan @@ -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)))) )) diff --git a/src/glsl/builtins/110/greaterThanEqual b/src/glsl/builtins/ir/greaterThanEqual index 204d5fd1439..de1a9f9516e 100644 --- a/src/glsl/builtins/110/greaterThanEqual +++ b/src/glsl/builtins/ir/greaterThanEqual @@ -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)))) )) diff --git a/src/glsl/builtins/110/inversesqrt b/src/glsl/builtins/ir/inversesqrt index 5b66d2b3695..5b66d2b3695 100644 --- a/src/glsl/builtins/110/inversesqrt +++ b/src/glsl/builtins/ir/inversesqrt diff --git a/src/glsl/builtins/110/length b/src/glsl/builtins/ir/length index 89ff7f3ef12..89ff7f3ef12 100644 --- a/src/glsl/builtins/110/length +++ b/src/glsl/builtins/ir/length diff --git a/src/glsl/builtins/110/lessThan b/src/glsl/builtins/ir/lessThan index 5c4254165c7..52113b70466 100644 --- a/src/glsl/builtins/110/lessThan +++ b/src/glsl/builtins/ir/lessThan @@ -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)))) )) diff --git a/src/glsl/builtins/110/lessThanEqual b/src/glsl/builtins/ir/lessThanEqual index ccb955b8a76..4b240be5d19 100644 --- a/src/glsl/builtins/110/lessThanEqual +++ b/src/glsl/builtins/ir/lessThanEqual @@ -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)))) )) diff --git a/src/glsl/builtins/110/log b/src/glsl/builtins/ir/log index d168abb5a73..d168abb5a73 100644 --- a/src/glsl/builtins/110/log +++ b/src/glsl/builtins/ir/log diff --git a/src/glsl/builtins/110/log2 b/src/glsl/builtins/ir/log2 index b96c6276f0a..b96c6276f0a 100644 --- a/src/glsl/builtins/110/log2 +++ b/src/glsl/builtins/ir/log2 diff --git a/src/glsl/builtins/120/matrixCompMult b/src/glsl/builtins/ir/matrixCompMult index 69331e26525..538da18a794 100644 --- a/src/glsl/builtins/120/matrixCompMult +++ b/src/glsl/builtins/ir/matrixCompMult @@ -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) diff --git a/src/glsl/builtins/130/max b/src/glsl/builtins/ir/max index 0863e411a32..2b5a02868cc 100644 --- a/src/glsl/builtins/130/max +++ b/src/glsl/builtins/ir/max @@ -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) diff --git a/src/glsl/builtins/130/min b/src/glsl/builtins/ir/min index 576546f6f20..2deef1118a7 100644 --- a/src/glsl/builtins/130/min +++ b/src/glsl/builtins/ir/min @@ -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) diff --git a/src/glsl/builtins/110/mix b/src/glsl/builtins/ir/mix index 8638d06887c..6bc6f0a43e8 100644 --- a/src/glsl/builtins/110/mix +++ b/src/glsl/builtins/ir/mix @@ -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)))) )) diff --git a/src/glsl/builtins/110/mod b/src/glsl/builtins/ir/mod index aeaea240e2d..aeaea240e2d 100644 --- a/src/glsl/builtins/110/mod +++ b/src/glsl/builtins/ir/mod diff --git a/src/glsl/builtins/ir/noise1 b/src/glsl/builtins/ir/noise1 new file mode 100644 index 00000000000..eb7be358575 --- /dev/null +++ b/src/glsl/builtins/ir/noise1 @@ -0,0 +1,18 @@ +((function noise1 + (signature float + (parameters + (declare (in) float x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec2 x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec3 x)) + ((return (constant float (0))))) + (signature float + (parameters + (declare (in) vec4 x)) + ((return (constant float (0))))) +)) diff --git a/src/glsl/builtins/ir/noise2 b/src/glsl/builtins/ir/noise2 new file mode 100644 index 00000000000..ae4443a704a --- /dev/null +++ b/src/glsl/builtins/ir/noise2 @@ -0,0 +1,18 @@ +((function noise2 + (signature vec2 + (parameters + (declare (in) float x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec3 x)) + ((return (constant vec2 (0 0))))) + (signature vec2 + (parameters + (declare (in) vec4 x)) + ((return (constant vec2 (0 0))))) +)) diff --git a/src/glsl/builtins/ir/noise3 b/src/glsl/builtins/ir/noise3 new file mode 100644 index 00000000000..30d9681890e --- /dev/null +++ b/src/glsl/builtins/ir/noise3 @@ -0,0 +1,18 @@ +((function noise3 + (signature vec3 + (parameters + (declare (in) float x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec2 x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (constant vec3 (0 0 0))))) + (signature vec3 + (parameters + (declare (in) vec4 x)) + ((return (constant vec3 (0 0 0))))) +)) diff --git a/src/glsl/builtins/ir/noise4 b/src/glsl/builtins/ir/noise4 new file mode 100644 index 00000000000..913bef2aa1b --- /dev/null +++ b/src/glsl/builtins/ir/noise4 @@ -0,0 +1,18 @@ +((function noise4 + (signature vec4 + (parameters + (declare (in) float x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec2 x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec3 x)) + ((return (constant vec4 (0 0 0 0))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (constant vec4 (0 0 0 0))))) +)) diff --git a/src/glsl/builtins/110/normalize b/src/glsl/builtins/ir/normalize index be88a9830d1..be88a9830d1 100644 --- a/src/glsl/builtins/110/normalize +++ b/src/glsl/builtins/ir/normalize diff --git a/src/glsl/builtins/110/not b/src/glsl/builtins/ir/not index b696b06557f..b696b06557f 100644 --- a/src/glsl/builtins/110/not +++ b/src/glsl/builtins/ir/not diff --git a/src/glsl/builtins/110/notEqual b/src/glsl/builtins/ir/notEqual index ccdcaa3aafa..bcc7339bb6e 100644 --- a/src/glsl/builtins/110/notEqual +++ b/src/glsl/builtins/ir/notEqual @@ -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)))) )) diff --git a/src/glsl/builtins/120/outerProduct b/src/glsl/builtins/ir/outerProduct index 69ae741e176..69ae741e176 100644 --- a/src/glsl/builtins/120/outerProduct +++ b/src/glsl/builtins/ir/outerProduct diff --git a/src/glsl/builtins/110/pow b/src/glsl/builtins/ir/pow index a61bc4418e3..a61bc4418e3 100644 --- a/src/glsl/builtins/110/pow +++ b/src/glsl/builtins/ir/pow diff --git a/src/glsl/builtins/110/radians b/src/glsl/builtins/ir/radians index 6a0f5d2e219..6a0f5d2e219 100644 --- a/src/glsl/builtins/110/radians +++ b/src/glsl/builtins/ir/radians diff --git a/src/glsl/builtins/110/reflect b/src/glsl/builtins/ir/reflect index 8238fdc93fd..8238fdc93fd 100644 --- a/src/glsl/builtins/110/reflect +++ b/src/glsl/builtins/ir/reflect diff --git a/src/glsl/builtins/110/refract b/src/glsl/builtins/ir/refract index 522ab411734..522ab411734 100644 --- a/src/glsl/builtins/110/refract +++ b/src/glsl/builtins/ir/refract diff --git a/src/glsl/builtins/130/sign b/src/glsl/builtins/ir/sign index f86062a2443..1f51718dab1 100644 --- a/src/glsl/builtins/130/sign +++ b/src/glsl/builtins/ir/sign @@ -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)) diff --git a/src/glsl/builtins/110/sin b/src/glsl/builtins/ir/sin index e6009d8ef12..e6009d8ef12 100644 --- a/src/glsl/builtins/110/sin +++ b/src/glsl/builtins/ir/sin diff --git a/src/glsl/builtins/130/sinh b/src/glsl/builtins/ir/sinh index 7ad4f58e204..7ad4f58e204 100644 --- a/src/glsl/builtins/130/sinh +++ b/src/glsl/builtins/ir/sinh diff --git a/src/glsl/builtins/110/smoothstep b/src/glsl/builtins/ir/smoothstep index 663eec63419..663eec63419 100644 --- a/src/glsl/builtins/110/smoothstep +++ b/src/glsl/builtins/ir/smoothstep diff --git a/src/glsl/builtins/110/sqrt b/src/glsl/builtins/ir/sqrt index 0302d164ae5..0302d164ae5 100644 --- a/src/glsl/builtins/110/sqrt +++ b/src/glsl/builtins/ir/sqrt diff --git a/src/glsl/builtins/110/step b/src/glsl/builtins/ir/step index ce6f4354228..ce6f4354228 100644 --- a/src/glsl/builtins/110/step +++ b/src/glsl/builtins/ir/step diff --git a/src/glsl/builtins/110/tan b/src/glsl/builtins/ir/tan index 99798631859..99798631859 100644 --- a/src/glsl/builtins/110/tan +++ b/src/glsl/builtins/ir/tan diff --git a/src/glsl/builtins/130/tanh b/src/glsl/builtins/ir/tanh index 3b7271bf779..3b7271bf779 100644 --- a/src/glsl/builtins/130/tanh +++ b/src/glsl/builtins/ir/tanh diff --git a/src/glsl/builtins/120/transpose b/src/glsl/builtins/ir/transpose index 416a0ee4677..416a0ee4677 100644 --- a/src/glsl/builtins/120/transpose +++ b/src/glsl/builtins/ir/transpose diff --git a/src/glsl/builtins/profiles/110.frag b/src/glsl/builtins/profiles/110.frag new file mode 100644 index 00000000000..25bc62c093c --- /dev/null +++ b/src/glsl/builtins/profiles/110.frag @@ -0,0 +1,364 @@ +#version 110 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); + + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/110.vert b/src/glsl/builtins/profiles/110.vert new file mode 100644 index 00000000000..545e59c5397 --- /dev/null +++ b/src/glsl/builtins/profiles/110.vert @@ -0,0 +1,351 @@ +#version 110 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/120.frag b/src/glsl/builtins/profiles/120.frag new file mode 100644 index 00000000000..a207435f337 --- /dev/null +++ b/src/glsl/builtins/profiles/120.frag @@ -0,0 +1,396 @@ +#version 120 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); + + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/120.vert b/src/glsl/builtins/profiles/120.vert new file mode 100644 index 00000000000..e14c931647f --- /dev/null +++ b/src/glsl/builtins/profiles/120.vert @@ -0,0 +1,383 @@ +#version 120 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); diff --git a/src/glsl/builtins/profiles/ARB_texture_rectangle.frag b/src/glsl/builtins/profiles/ARB_texture_rectangle.frag new file mode 100644 index 00000000000..8938aa3e97c --- /dev/null +++ b/src/glsl/builtins/profiles/ARB_texture_rectangle.frag @@ -0,0 +1,7 @@ +#extension GL_ARB_texture_rectangle : enable +vec4 texture2DRect(sampler2DRect sampler, vec2 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); + +vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); +vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/profiles/ARB_texture_rectangle.vert b/src/glsl/builtins/profiles/ARB_texture_rectangle.vert new file mode 100644 index 00000000000..8938aa3e97c --- /dev/null +++ b/src/glsl/builtins/profiles/ARB_texture_rectangle.vert @@ -0,0 +1,7 @@ +#extension GL_ARB_texture_rectangle : enable +vec4 texture2DRect(sampler2DRect sampler, vec2 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); + +vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); +vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/profiles/EXT_texture_array.frag b/src/glsl/builtins/profiles/EXT_texture_array.frag new file mode 100644 index 00000000000..d133132191b --- /dev/null +++ b/src/glsl/builtins/profiles/EXT_texture_array.frag @@ -0,0 +1,11 @@ +#extension GL_EXT_texture_array : enable +vec4 texture1DArray(sampler1DArray sampler, vec2 coord); +vec4 texture1DArray(sampler1DArray sampler, vec2 coord, float bias); + +vec4 texture2DArray(sampler1DArray sampler, vec2 coord); +vec4 texture2DArray(sampler1DArray sampler, vec2 coord, float bias); + +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord, float bias); + +vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/profiles/EXT_texture_array.vert b/src/glsl/builtins/profiles/EXT_texture_array.vert new file mode 100644 index 00000000000..4f7b2b5f8b1 --- /dev/null +++ b/src/glsl/builtins/profiles/EXT_texture_array.vert @@ -0,0 +1,11 @@ +#extension GL_EXT_texture_array : enable +vec4 texture1DArray(sampler1DArray sampler, vec2 coord); +vec4 texture1DArrayLod(sampler1DArray sampler, vec2 coord, float lod); + +vec4 texture2DArray(sampler1DArray sampler, vec2 coord); +vec4 texture2DArrayLod(sampler1DArray sampler, vec2 coord, float lod); + +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); +vec4 shadow1DArrayLod(sampler1DArrayShadow sampler, vec3 coord, float lod); + +vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); diff --git a/src/glsl/builtins/tools/builtin_function.cpp b/src/glsl/builtins/tools/builtin_function.cpp new file mode 100644 index 00000000000..c44804f2ef7 --- /dev/null +++ b/src/glsl/builtins/tools/builtin_function.cpp @@ -0,0 +1,39 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <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) +{ +} diff --git a/src/glsl/builtins/tools/generate_builtins.pl b/src/glsl/builtins/tools/generate_builtins.pl deleted file mode 100755 index 91ef8917b0a..00000000000 --- a/src/glsl/builtins/tools/generate_builtins.pl +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env perl - -sub process_version { - my ($version) = @_; - my @vars; - print "/* $version builtins */\n\n"; - - my @files = <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"; diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py new file mode 100755 index 00000000000..2eb67e398a6 --- /dev/null +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -0,0 +1,207 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import re, glob, sys +from os import path +from subprocess import Popen, PIPE + +# Local module: generator for texture lookup builtins +from texture_builtins import generate_texture_functions + +builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") + +# Read the files in builtins/ir/*...add them to the supplied dictionary. +def read_ir_files(fs): + for filename in glob.glob(path.join(path.join(builtins_dir, 'ir'), '*')): + with open(filename) as f: + fs[path.basename(filename)] = f.read() + +# Return a dictionary containing all builtin definitions (even generated) +def get_builtin_definitions(): + fs = {} + generate_texture_functions(fs) + read_ir_files(fs) + return fs + +def stringify(s): + t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "') + return ' "' + t + '"\n' + +def write_function_definitions(): + fs = get_builtin_definitions() + for k, v in fs.iteritems(): + print 'static const char *builtin_' + k + ' =' + print stringify(v), ';' + +def run_compiler(args): + compiler_path = path.join(path.join(builtins_dir, '..'), 'glsl_compiler') + command = [compiler_path, '--dump-lir'] + args + p = Popen(command, 1, stdout=PIPE, shell=False) + output = p.communicate()[0] + return (output, p.returncode) + +def write_profile(filename, profile): + (proto_ir, returncode) = run_compiler([filename]) + + if returncode != 0: + print '#error builtins profile', profile, 'failed to compile' + return + + # Kill any global variable declarations. We don't want them. + kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE); + proto_ir = kill_globals.sub('', proto_ir) + + print 'static const char *prototypes_for_' + profile + ' =' + print stringify(proto_ir), ';' + + # Print a table of all the functions (not signatures) referenced. + # This is done so we can avoid bothering with a hash table in the C++ code. + + function_names = set() + for func in re.finditer(r'\(function (.+)\n', proto_ir): + function_names.add(func.group(1)) + + print 'static const char *functions_for_' + profile + ' [] = {' + for func in function_names: + print ' builtin_' + func + ',' + print '};' + +def write_profiles(): + profiles = get_profile_list() + for (filename, profile) in profiles: + write_profile(filename, profile) + +def get_profile_list(): + profiles = [] + for pfile in glob.glob(path.join(path.join(builtins_dir, 'profiles'), '*')): + profiles.append((pfile, path.basename(pfile).replace('.', '_'))) + return profiles + +if __name__ == "__main__": + print """/* DO NOT MODIFY - automatically generated by generate_builtins.py */ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <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 '}' + diff --git a/src/glsl/builtins/tools/texture_builtins.py b/src/glsl/builtins/tools/texture_builtins.py index 33d9642ef78..8bf708b5aac 100755 --- a/src/glsl/builtins/tools/texture_builtins.py +++ b/src/glsl/builtins/tools/texture_builtins.py @@ -1,7 +1,7 @@ #!/usr/bin/python -from os import path import sys +import StringIO def vec_type(g, size): if size == 1: @@ -95,204 +95,255 @@ def generate_fiu_sigs(tex_inst, sampler_type, use_proj = False, unused_fields = generate_sigs("i", tex_inst, sampler_type, use_proj, unused_fields) generate_sigs("u", tex_inst, sampler_type, use_proj, unused_fields) -builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") +def start_function(name): + sys.stdout = StringIO.StringIO() + print "((function " + name -with open(path.join(builtins_dir, "130", "texture"), 'w') as sys.stdout: - print "((function texture" +def end_function(fs, name): + print "))" + fs[name] = sys.stdout.getvalue(); + sys.stdout.close() + +# Generate all the functions and store them in the supplied dictionary. +# This is better than writing them to actual files since they should never be +# edited; it'd also be easy to confuse them with the many hand-generated files. +# +# Takes a dictionary as an argument. +def generate_texture_functions(fs): + start_function("texture") generate_fiu_sigs("tex", "1D") generate_fiu_sigs("tex", "2D") generate_fiu_sigs("tex", "3D") generate_fiu_sigs("tex", "Cube") generate_fiu_sigs("tex", "1DArray") generate_fiu_sigs("tex", "2DArray") - print "))" -# txb variants are only allowed within a fragment shader (GLSL 1.30 p. 86) -with open(path.join(builtins_dir, "130_fs", "texture"), 'w') as sys.stdout: - print "((function texture" generate_fiu_sigs("txb", "1D") generate_fiu_sigs("txb", "2D") generate_fiu_sigs("txb", "3D") generate_fiu_sigs("txb", "Cube") generate_fiu_sigs("txb", "1DArray") generate_fiu_sigs("txb", "2DArray") - print "))" + end_function(fs, "texture") -with open(path.join(builtins_dir, "130", "textureProj"), 'w') as sys.stdout: - print "((function textureProj" + start_function("textureProj") generate_fiu_sigs("tex", "1D", True) generate_fiu_sigs("tex", "1D", True, 2) generate_fiu_sigs("tex", "2D", True) generate_fiu_sigs("tex", "2D", True, 1) generate_fiu_sigs("tex", "3D", True) - print "))" -with open(path.join(builtins_dir, "130_fs", "textureProj"), 'w') as sys.stdout: - print "((function textureProj" generate_fiu_sigs("txb", "1D", True) generate_fiu_sigs("txb", "1D", True, 2) generate_fiu_sigs("txb", "2D", True) generate_fiu_sigs("txb", "2D", True, 1) generate_fiu_sigs("txb", "3D", True) - print "))" + end_function(fs, "textureProj") -with open(path.join(builtins_dir, "130", "textureLod"), 'w') as sys.stdout: - print "((function textureLod" + start_function("textureLod") generate_fiu_sigs("txl", "1D") generate_fiu_sigs("txl", "2D") generate_fiu_sigs("txl", "3D") generate_fiu_sigs("txl", "Cube") generate_fiu_sigs("txl", "1DArray") generate_fiu_sigs("txl", "2DArray") - print "))" + end_function(fs, "textureLod") -with open(path.join(builtins_dir, "130", "texelFetch"), 'w') as sys.stdout: - print "((function texelFetch" + start_function("texelFetch") generate_fiu_sigs("txf", "1D") generate_fiu_sigs("txf", "2D") generate_fiu_sigs("txf", "3D") generate_fiu_sigs("txf", "1DArray") generate_fiu_sigs("txf", "2DArray") - print "))" + end_function(fs, "texelFetch") -with open(path.join(builtins_dir, "130", "textureProjLod"), 'w') as sys.stdout: - print "((function textureProjLod" + start_function("textureProjLod") generate_fiu_sigs("txl", "1D", True) generate_fiu_sigs("txl", "1D", True, 2) generate_fiu_sigs("txl", "2D", True) generate_fiu_sigs("txl", "2D", True, 1) generate_fiu_sigs("txl", "3D", True) - print "))" + end_function(fs, "textureProjLod") -with open(path.join(builtins_dir, "130", "textureGrad"), 'w') as sys.stdout: - print "((function textureGrad" + start_function("textureGrad") generate_fiu_sigs("txd", "1D") generate_fiu_sigs("txd", "2D") generate_fiu_sigs("txd", "3D") generate_fiu_sigs("txd", "Cube") generate_fiu_sigs("txd", "1DArray") generate_fiu_sigs("txd", "2DArray") - print ")\n)" + end_function(fs, "textureGrad") -with open(path.join(builtins_dir, "130", "textureProjGrad"), 'w') as sys.stdout: - print "((function textureProjGrad" + start_function("textureProjGrad") generate_fiu_sigs("txd", "1D", True) generate_fiu_sigs("txd", "1D", True, 2) generate_fiu_sigs("txd", "2D", True) generate_fiu_sigs("txd", "2D", True, 1) generate_fiu_sigs("txd", "3D", True) - print "))" + end_function(fs, "textureProjGrad") -# ARB_texture_rectangle extension -with open(path.join(builtins_dir, "ARB_texture_rectangle", "textures"), 'w') as sys.stdout: - print "((function texture2DRect" + # ARB_texture_rectangle extension + start_function("texture2DRect") generate_sigs("", "tex", "2DRect") - print ")\n (function shadow2DRect" + end_function(fs, "texture2DRect") + + start_function("texture2DRectProj") + generate_sigs("", "tex", "2DRect", True) + generate_sigs("", "tex", "2DRect", True, 1) + end_function(fs, "texture2DRectProj") + + start_function("shadow2DRect") generate_sigs("", "tex", "2DRectShadow") - print "))" + end_function(fs, "shadow2DRect") -# EXT_texture_array extension -with open(path.join(builtins_dir, "EXT_texture_array", "textures"), 'w') as sys.stdout: - print "((function texture1DArray" + start_function("shadow2DRectProj") + generate_sigs("", "tex", "2DRectShadow", True) + end_function(fs, "shadow2DRectProj") + + # EXT_texture_array extension + start_function("texture1DArray") generate_sigs("", "tex", "1DArray") - print ")\n (function texture1DArrayLod" + generate_sigs("", "txb", "1DArray") + end_function(fs, "texture1DArray") + + start_function("texture1DArrayLod") generate_sigs("", "txl", "1DArray") - print ")\n (function texture2DArray" + end_function(fs, "texture1DArrayLod") + + start_function("texture2DArray") generate_sigs("", "tex", "2DArray") - print ")\n (function texture2DArrayLod" + generate_sigs("", "txb", "2DArray") + end_function(fs, "texture2DArray") + + start_function("texture2DArrayLod") generate_sigs("", "txl", "2DArray") - print ")\n (function shadow1DArray" + end_function(fs, "texture2DArrayLod") + + start_function("shadow1DArray") generate_sigs("", "tex", "1DArrayShadow") - print ")\n (function shadow1DArrayLod" + generate_sigs("", "txb", "1DArrayShadow") + end_function(fs, "shadow1DArray") + + start_function("shadow1DArrayLod") generate_sigs("", "txl", "1DArrayShadow") - print ")\n (function shadow2DArray" - generate_sigs("", "tex", "2DArrayShadow") - print "))" + end_function(fs, "shadow1DArrayLod") -with open(path.join(builtins_dir, "EXT_texture_array_fs", "textures"), 'w') as sys.stdout: - print "((function texture1DArray" - generate_sigs("", "txb", "1DArray") - print ")\n (function texture2DArray" - generate_sigs("", "txb", "2DArray") - print ")\n (function shadow1DArray" - generate_sigs("", "txb", "1DArrayShadow") - print "))" + start_function("shadow2DArray") + generate_sigs("", "tex", "2DArrayShadow") + end_function(fs, "shadow2DArray") -# Deprecated (110/120 style) functions with silly names: -with open(path.join(builtins_dir, "110", "textures"), 'w') as sys.stdout: - print "((function texture1D" + # Deprecated (110/120 style) functions with silly names: + start_function("texture1D") generate_sigs("", "tex", "1D") - print ")\n (function texture1DLod" + generate_sigs("", "txb", "1D") + end_function(fs, "texture1D") + + start_function("texture1DLod") generate_sigs("", "txl", "1D") - print ")\n (function texture1DProj" + end_function(fs, "texture1DLod") + + start_function("texture1DProj") generate_sigs("", "tex", "1D", True) generate_sigs("", "tex", "1D", True, 2) - print ")\n (function texture1DProjLod" + generate_sigs("", "txb", "1D", True) + generate_sigs("", "txb", "1D", True, 2) + end_function(fs, "texture1DProj") + + start_function("texture1DProjLod") generate_sigs("", "txl", "1D", True) generate_sigs("", "txl", "1D", True, 2) - print ")\n (function texture2D" + end_function(fs, "texture1DProjLod") + + start_function("texture2D") generate_sigs("", "tex", "2D") - print ")\n(function texture2DLod" + generate_sigs("", "txb", "2D") + end_function(fs, "texture2D") + + start_function("texture2DLod") generate_sigs("", "txl", "2D") - print ")\n (function texture2DProj" + end_function(fs, "texture2DLod") + + start_function("texture2DProj") generate_sigs("", "tex", "2D", True) generate_sigs("", "tex", "2D", True, 1) - print ")\n (function texture2DProjLod" + generate_sigs("", "txb", "2D", True) + generate_sigs("", "txb", "2D", True, 1) + end_function(fs, "texture2DProj") + + start_function("texture2DProjLod") generate_sigs("", "txl", "2D", True) generate_sigs("", "txl", "2D", True, 1) - print ")\n (function texture3D" + end_function(fs, "texture2DProjLod") + + start_function("texture3D") generate_sigs("", "tex", "3D") - print ")\n (function texture3DLod" + generate_sigs("", "txb", "3D") + end_function(fs, "texture3D") + + start_function("texture3DLod") generate_sigs("", "txl", "3D") - print ")\n (function texture3DProj" + end_function(fs, "texture3DLod") + + start_function("texture3DProj") generate_sigs("", "tex", "3D", True) - print ")\n (function texture3DProjLod" + generate_sigs("", "txb", "3D", True) + end_function(fs, "texture3DProj") + + start_function("texture3DProjLod") generate_sigs("", "txl", "3D", True) - print ")\n (function textureCube" + end_function(fs, "texture3DProjLod") + + start_function("textureCube") generate_sigs("", "tex", "Cube") - print ")\n (function textureCubeLod" + generate_sigs("", "txb", "Cube") + end_function(fs, "textureCube") + + start_function("textureCubeLod") generate_sigs("", "txl", "Cube") - print ")\n (function shadow1D" + end_function(fs, "textureCubeLod") + + start_function("shadow1D") generate_sigs("", "tex", "1DShadow", False, 1) - print ")\n (function shadow1DLod" + generate_sigs("", "txb", "1DShadow", False, 1) + end_function(fs, "shadow1D") + + start_function("shadow1DLod") generate_sigs("", "txl", "1DShadow", False, 1) - print ")\n (function shadow1DProj" + end_function(fs, "shadow1DLod") + + start_function("shadow1DProj") generate_sigs("", "tex", "1DShadow", True, 1) - print ")\n (function shadow1DProjLod" + generate_sigs("", "txb", "1DShadow", True, 1) + end_function(fs, "shadow1DProj") + + start_function("shadow1DProjLod") generate_sigs("", "txl", "1DShadow", True, 1) - print ")\n (function shadow2D" + end_function(fs, "shadow1DProjLod") + + start_function("shadow2D") generate_sigs("", "tex", "2DShadow") - print ")\n (function shadow2DLod" + generate_sigs("", "txb", "2DShadow") + end_function(fs, "shadow2D") + + start_function("shadow2DLod") generate_sigs("", "txl", "2DShadow") - print ")\n (function shadow2DProj" + end_function(fs, "shadow2DLod") + + start_function("shadow2DProj") generate_sigs("", "tex", "2DShadow", True) - print ")\n (function shadow2DProjLod" + generate_sigs("", "txb", "2DShadow", True) + end_function(fs, "shadow2DProj") + + start_function("shadow2DProjLod") generate_sigs("", "txl", "2DShadow", True) - print "))" + end_function(fs, "shadow2DProjLod") -with open(path.join(builtins_dir, "110_fs", "textures"), 'w') as sys.stdout: - print "((function texture1D" - generate_sigs("", "txb", "1D") - print ")\n (function texture1DProj" - generate_sigs("", "txb", "1D", True) - generate_sigs("", "txb", "1D", True, 2) - print ")\n (function texture2D" - generate_sigs("", "txb", "2D") - print ")\n (function texture2DProj" - generate_sigs("", "txb", "2D", True) - generate_sigs("", "txb", "2D", True, 1) - print ")\n (function texture3D" - generate_sigs("", "txb", "3D") - print ")\n (function texture3DProj" - generate_sigs("", "txb", "3D", True) - print ")\n (function textureCube" - generate_sigs("", "txb", "Cube") - print ")\n (function shadow1D" - generate_sigs("", "txb", "1DShadow", False, 1) - print ")\n (function shadow1DProj" - generate_sigs("", "txb", "1DShadow", True, 1) - print ")\n (function shadow2D" - generate_sigs("", "txb", "2DShadow") - print ")\n (function shadow2DProj" - generate_sigs("", "txb", "2DShadow", True) - print "))" + sys.stdout = sys.__stdout__ + return fs + +# If you actually run this script, it'll print out all the functions. +if __name__ == "__main__": + fs = {} + generate_texture_functions(fs); + for k, v in fs.iteritems(): + print v |