From: Paul Berry Date: Thu, 6 Oct 2011 17:31:34 +0000 (-0700) Subject: glsl: Add '.ir' extension to builtin IR files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b6f32bbe12e1082e78951b6ef073bf244ba0b8b7;p=mesa.git glsl: Add '.ir' extension to builtin IR files This patch adds the extension '.ir' to all the files in src/glsl/builtins/ir/, and changes generate_builtins.py so that it no longer globs on '*' to find the files to build. This prevents spurious files (such as EMACS' infamous *~ backup files) from breaking the build. --- diff --git a/src/glsl/builtins/ir/abs b/src/glsl/builtins/ir/abs deleted file mode 100644 index d07d1d99e9f..00000000000 --- a/src/glsl/builtins/ir/abs +++ /dev/null @@ -1,41 +0,0 @@ -((function abs - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float abs (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 abs (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 abs (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 abs (var_ref arg0))))) - - (signature int - (parameters - (declare (in) int arg0)) - ((return (expression int abs (var_ref arg0))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0)) - ((return (expression ivec2 abs (var_ref arg0))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0)) - ((return (expression ivec3 abs (var_ref arg0))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0)) - ((return (expression ivec4 abs (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/abs.ir b/src/glsl/builtins/ir/abs.ir new file mode 100644 index 00000000000..d07d1d99e9f --- /dev/null +++ b/src/glsl/builtins/ir/abs.ir @@ -0,0 +1,41 @@ +((function abs + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 abs (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 abs (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 abs (var_ref arg0))))) + + (signature int + (parameters + (declare (in) int arg0)) + ((return (expression int abs (var_ref arg0))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0)) + ((return (expression ivec2 abs (var_ref arg0))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0)) + ((return (expression ivec3 abs (var_ref arg0))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0)) + ((return (expression ivec4 abs (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/acos b/src/glsl/builtins/ir/acos deleted file mode 100644 index d1cfebeff8a..00000000000 --- a/src/glsl/builtins/ir/acos +++ /dev/null @@ -1,22 +0,0 @@ -((function acos - (signature float - (parameters - (declare (in) float x)) - ((return (expression float - (constant float (1.5707963)) - (call asin ((var_ref x))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 - (constant float (1.5707963)) - (call asin ((var_ref x))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 - (constant float (1.5707963)) - (call asin ((var_ref x))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 - (constant float (1.5707963)) - (call asin ((var_ref x))))))) -)) diff --git a/src/glsl/builtins/ir/acos.ir b/src/glsl/builtins/ir/acos.ir new file mode 100644 index 00000000000..d1cfebeff8a --- /dev/null +++ b/src/glsl/builtins/ir/acos.ir @@ -0,0 +1,22 @@ +((function acos + (signature float + (parameters + (declare (in) float x)) + ((return (expression float - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) +)) diff --git a/src/glsl/builtins/ir/acosh b/src/glsl/builtins/ir/acosh deleted file mode 100644 index 9a4c291ad5b..00000000000 --- a/src/glsl/builtins/ir/acosh +++ /dev/null @@ -1,21 +0,0 @@ -((function acosh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float log (expression float + (var_ref x) (expression float sqrt (expression float - (expression float * (var_ref x) (var_ref x)) (constant float (1))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 log (expression vec2 + (var_ref x) (expression vec2 sqrt (expression vec2 - (expression vec2 * (var_ref x) (var_ref x)) (constant float (1))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 log (expression vec3 + (var_ref x) (expression vec3 sqrt (expression vec3 - (expression vec3 * (var_ref x) (var_ref x)) (constant float (1))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 log (expression vec4 + (var_ref x) (expression vec4 sqrt (expression vec4 - (expression vec4 * (var_ref x) (var_ref x)) (constant float (1))))))))) -)) diff --git a/src/glsl/builtins/ir/acosh.ir b/src/glsl/builtins/ir/acosh.ir new file mode 100644 index 00000000000..9a4c291ad5b --- /dev/null +++ b/src/glsl/builtins/ir/acosh.ir @@ -0,0 +1,21 @@ +((function acosh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float log (expression float + (var_ref x) (expression float sqrt (expression float - (expression float * (var_ref x) (var_ref x)) (constant float (1))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 log (expression vec2 + (var_ref x) (expression vec2 sqrt (expression vec2 - (expression vec2 * (var_ref x) (var_ref x)) (constant float (1))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 log (expression vec3 + (var_ref x) (expression vec3 sqrt (expression vec3 - (expression vec3 * (var_ref x) (var_ref x)) (constant float (1))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 log (expression vec4 + (var_ref x) (expression vec4 sqrt (expression vec4 - (expression vec4 * (var_ref x) (var_ref x)) (constant float (1))))))))) +)) diff --git a/src/glsl/builtins/ir/all b/src/glsl/builtins/ir/all deleted file mode 100644 index 2cac0dfb684..00000000000 --- a/src/glsl/builtins/ir/all +++ /dev/null @@ -1,16 +0,0 @@ -((function all - (signature bool - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0)))))) -)) diff --git a/src/glsl/builtins/ir/all.ir b/src/glsl/builtins/ir/all.ir new file mode 100644 index 00000000000..2cac0dfb684 --- /dev/null +++ b/src/glsl/builtins/ir/all.ir @@ -0,0 +1,16 @@ +((function all + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0)))))) +)) diff --git a/src/glsl/builtins/ir/any b/src/glsl/builtins/ir/any deleted file mode 100644 index cc6038a3156..00000000000 --- a/src/glsl/builtins/ir/any +++ /dev/null @@ -1,16 +0,0 @@ -((function any - (signature bool - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bool any (var_ref arg0))))) - - (signature bool - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bool any (var_ref arg0))))) - - (signature bool - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bool any (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/any.ir b/src/glsl/builtins/ir/any.ir new file mode 100644 index 00000000000..cc6038a3156 --- /dev/null +++ b/src/glsl/builtins/ir/any.ir @@ -0,0 +1,16 @@ +((function any + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool any (var_ref arg0))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool any (var_ref arg0))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bool any (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/asin b/src/glsl/builtins/ir/asin deleted file mode 100644 index 45d9e672958..00000000000 --- a/src/glsl/builtins/ir/asin +++ /dev/null @@ -1,109 +0,0 @@ -((function asin - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * - (expression float sign (var_ref x)) - (expression float - - (constant float (1.5707964)) - (expression float * - (expression float sqrt - (expression float - - (constant float (1.0)) - (expression float abs (var_ref x)))) - (expression float + - (constant float (1.5707964)) - (expression float * - (expression float abs (var_ref x)) - (expression float + - (constant float (-0.21460183)) - (expression float * - (expression float abs (var_ref x)) - (expression float + - (constant float (0.086566724)) - (expression float * - (expression float abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * - (expression vec2 sign (var_ref x)) - (expression vec2 - - (constant float (1.5707964)) - (expression vec2 * - (expression vec2 sqrt - (expression vec2 - - (constant float (1.0)) - (expression vec2 abs (var_ref x)))) - (expression vec2 + - (constant float (1.5707964)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (expression vec2 + - (constant float (-0.21460183)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (expression vec2 + - (constant float (0.086566724)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * - (expression vec3 sign (var_ref x)) - (expression vec3 - - (constant float (1.5707964)) - (expression vec3 * - (expression vec3 sqrt - (expression vec3 - - (constant float (1.0)) - (expression vec3 abs (var_ref x)))) - (expression vec3 + - (constant float (1.5707964)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (expression vec3 + - (constant float (-0.21460183)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (expression vec3 + - (constant float (0.086566724)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * - (expression vec4 sign (var_ref x)) - (expression vec4 - - (constant float (1.5707964)) - (expression vec4 * - (expression vec4 sqrt - (expression vec4 - - (constant float (1.0)) - (expression vec4 abs (var_ref x)))) - (expression vec4 + - (constant float (1.5707964)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (expression vec4 + - (constant float (-0.21460183)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (expression vec4 + - (constant float (0.086566724)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) -)) diff --git a/src/glsl/builtins/ir/asin.ir b/src/glsl/builtins/ir/asin.ir new file mode 100644 index 00000000000..45d9e672958 --- /dev/null +++ b/src/glsl/builtins/ir/asin.ir @@ -0,0 +1,109 @@ +((function asin + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * + (expression float sign (var_ref x)) + (expression float - + (constant float (1.5707964)) + (expression float * + (expression float sqrt + (expression float - + (constant float (1.0)) + (expression float abs (var_ref x)))) + (expression float + + (constant float (1.5707964)) + (expression float * + (expression float abs (var_ref x)) + (expression float + + (constant float (-0.21460183)) + (expression float * + (expression float abs (var_ref x)) + (expression float + + (constant float (0.086566724)) + (expression float * + (expression float abs (var_ref x)) + (constant float (-0.03102955)) + )))))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * + (expression vec2 sign (var_ref x)) + (expression vec2 - + (constant float (1.5707964)) + (expression vec2 * + (expression vec2 sqrt + (expression vec2 - + (constant float (1.0)) + (expression vec2 abs (var_ref x)))) + (expression vec2 + + (constant float (1.5707964)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (expression vec2 + + (constant float (-0.21460183)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (expression vec2 + + (constant float (0.086566724)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (constant float (-0.03102955)) + )))))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * + (expression vec3 sign (var_ref x)) + (expression vec3 - + (constant float (1.5707964)) + (expression vec3 * + (expression vec3 sqrt + (expression vec3 - + (constant float (1.0)) + (expression vec3 abs (var_ref x)))) + (expression vec3 + + (constant float (1.5707964)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (expression vec3 + + (constant float (-0.21460183)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (expression vec3 + + (constant float (0.086566724)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (constant float (-0.03102955)) + )))))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * + (expression vec4 sign (var_ref x)) + (expression vec4 - + (constant float (1.5707964)) + (expression vec4 * + (expression vec4 sqrt + (expression vec4 - + (constant float (1.0)) + (expression vec4 abs (var_ref x)))) + (expression vec4 + + (constant float (1.5707964)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (expression vec4 + + (constant float (-0.21460183)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (expression vec4 + + (constant float (0.086566724)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (constant float (-0.03102955)) + )))))))))))) +)) diff --git a/src/glsl/builtins/ir/asinh b/src/glsl/builtins/ir/asinh deleted file mode 100644 index d2dc7102cc3..00000000000 --- a/src/glsl/builtins/ir/asinh +++ /dev/null @@ -1,53 +0,0 @@ -((function asinh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * - (expression float sign (var_ref x)) - (expression float log - (expression float + - (expression float abs (var_ref x)) - (expression float sqrt - (expression float + - (expression float * (var_ref x) (var_ref x)) - (constant float (1)))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * - (expression vec2 sign (var_ref x)) - (expression vec2 log - (expression vec2 + - (expression vec2 abs (var_ref x)) - (expression vec2 sqrt - (expression vec2 + - (expression vec2 * (var_ref x) (var_ref x)) - (constant float (1)))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * - (expression vec3 sign (var_ref x)) - (expression vec3 log - (expression vec3 + - (expression vec3 abs (var_ref x)) - (expression vec3 sqrt - (expression vec3 + - (expression vec3 * (var_ref x) (var_ref x)) - (constant float (1)))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * - (expression vec4 sign (var_ref x)) - (expression vec4 log - (expression vec4 + - (expression vec4 abs (var_ref x)) - (expression vec4 sqrt - (expression vec4 + - (expression vec4 * (var_ref x) (var_ref x)) - (constant float (1)))))))))) -)) diff --git a/src/glsl/builtins/ir/asinh.ir b/src/glsl/builtins/ir/asinh.ir new file mode 100644 index 00000000000..d2dc7102cc3 --- /dev/null +++ b/src/glsl/builtins/ir/asinh.ir @@ -0,0 +1,53 @@ +((function asinh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * + (expression float sign (var_ref x)) + (expression float log + (expression float + + (expression float abs (var_ref x)) + (expression float sqrt + (expression float + + (expression float * (var_ref x) (var_ref x)) + (constant float (1)))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * + (expression vec2 sign (var_ref x)) + (expression vec2 log + (expression vec2 + + (expression vec2 abs (var_ref x)) + (expression vec2 sqrt + (expression vec2 + + (expression vec2 * (var_ref x) (var_ref x)) + (constant float (1)))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * + (expression vec3 sign (var_ref x)) + (expression vec3 log + (expression vec3 + + (expression vec3 abs (var_ref x)) + (expression vec3 sqrt + (expression vec3 + + (expression vec3 * (var_ref x) (var_ref x)) + (constant float (1)))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * + (expression vec4 sign (var_ref x)) + (expression vec4 log + (expression vec4 + + (expression vec4 abs (var_ref x)) + (expression vec4 sqrt + (expression vec4 + + (expression vec4 * (var_ref x) (var_ref x)) + (constant float (1)))))))))) +)) diff --git a/src/glsl/builtins/ir/atan b/src/glsl/builtins/ir/atan deleted file mode 100644 index 7b5ea13c6ba..00000000000 --- a/src/glsl/builtins/ir/atan +++ /dev/null @@ -1,128 +0,0 @@ -((function atan - (signature float - (parameters - (declare (in) float y_over_x)) - ((return (call asin ((expression float * - (var_ref y_over_x) - (expression float rsq - (expression float + - (expression float * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 y_over_x)) - ((return (call asin ((expression vec2 * - (var_ref y_over_x) - (expression vec2 rsq - (expression vec2 + - (expression vec2 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 y_over_x)) - ((return (call asin ((expression vec3 * - (var_ref y_over_x) - (expression vec3 rsq - (expression vec3 + - (expression vec3 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 y_over_x)) - ((return (call asin ((expression vec4 * - (var_ref y_over_x) - (expression vec4 rsq - (expression vec4 + - (expression vec4 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0)))))))))) - - (signature float - (parameters - (declare (in ) float y) - (declare (in ) float x) - ) - ( - (declare () float r) - (if (expression bool > - (expression float abs (var_ref x)) - (expression float * (constant float (1.0e-8)) (expression float abs (var_ref y)))) ( - (assign (x) (var_ref r) (call atan ((expression float / (var_ref y) (var_ref x))))) - (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( - (if (expression bool >= (var_ref y) (constant float (0.000000)) ) - ((assign (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593))))) - ((assign (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593)))))) - ) - ( - )) - ) - ( - (declare () float sgn) - (assign (x) (var_ref sgn) (expression float sign (var_ref y))) - (assign (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965)))) - )) - - (return (var_ref r) ) - )) - - - - (signature vec2 - (parameters - (declare (in) vec2 y) - (declare (in) vec2 x)) - ((declare () vec2 r) - (assign (x) (var_ref r) - (call atan ((swiz x (var_ref y)) - (swiz x (var_ref x))))) - (assign (y) (var_ref r) - (call atan ((swiz y (var_ref y)) - (swiz y (var_ref x))))) - (return (var_ref r)))) - - (signature vec3 - (parameters - (declare (in) vec3 y) - (declare (in) vec3 x)) - ((declare () vec3 r) - (assign (x) (var_ref r) - (call atan ((swiz x (var_ref y)) - (swiz x (var_ref x))))) - (assign (y) (var_ref r) - (call atan ((swiz y (var_ref y)) - (swiz y (var_ref x))))) - (assign (z) (var_ref r) - (call atan ((swiz z (var_ref y)) - (swiz z (var_ref x))))) - (return (var_ref r)))) - - (signature vec4 - (parameters - (declare (in) vec4 y) - (declare (in) vec4 x)) - ((declare () vec4 r) - (assign (x) (var_ref r) - (call atan ((swiz x (var_ref y)) - (swiz x (var_ref x))))) - (assign (y) (var_ref r) - (call atan ((swiz y (var_ref y)) - (swiz y (var_ref x))))) - (assign (z) (var_ref r) - (call atan ((swiz z (var_ref y)) - (swiz z (var_ref x))))) - (assign (w) (var_ref r) - (call atan ((swiz w (var_ref y)) - (swiz w (var_ref x))))) - (return (var_ref r))))) - -)) diff --git a/src/glsl/builtins/ir/atan.ir b/src/glsl/builtins/ir/atan.ir new file mode 100644 index 00000000000..7b5ea13c6ba --- /dev/null +++ b/src/glsl/builtins/ir/atan.ir @@ -0,0 +1,128 @@ +((function atan + (signature float + (parameters + (declare (in) float y_over_x)) + ((return (call asin ((expression float * + (var_ref y_over_x) + (expression float rsq + (expression float + + (expression float * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 y_over_x)) + ((return (call asin ((expression vec2 * + (var_ref y_over_x) + (expression vec2 rsq + (expression vec2 + + (expression vec2 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 y_over_x)) + ((return (call asin ((expression vec3 * + (var_ref y_over_x) + (expression vec3 rsq + (expression vec3 + + (expression vec3 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 y_over_x)) + ((return (call asin ((expression vec4 * + (var_ref y_over_x) + (expression vec4 rsq + (expression vec4 + + (expression vec4 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature float + (parameters + (declare (in ) float y) + (declare (in ) float x) + ) + ( + (declare () float r) + (if (expression bool > + (expression float abs (var_ref x)) + (expression float * (constant float (1.0e-8)) (expression float abs (var_ref y)))) ( + (assign (x) (var_ref r) (call atan ((expression float / (var_ref y) (var_ref x))))) + (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) + ((assign (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593))))) + ((assign (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593)))))) + ) + ( + )) + ) + ( + (declare () float sgn) + (assign (x) (var_ref sgn) (expression float sign (var_ref y))) + (assign (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965)))) + )) + + (return (var_ref r) ) + )) + + + + (signature vec2 + (parameters + (declare (in) vec2 y) + (declare (in) vec2 x)) + ((declare () vec2 r) + (assign (x) (var_ref r) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (y) (var_ref r) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (return (var_ref r)))) + + (signature vec3 + (parameters + (declare (in) vec3 y) + (declare (in) vec3 x)) + ((declare () vec3 r) + (assign (x) (var_ref r) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (y) (var_ref r) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (z) (var_ref r) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (return (var_ref r)))) + + (signature vec4 + (parameters + (declare (in) vec4 y) + (declare (in) vec4 x)) + ((declare () vec4 r) + (assign (x) (var_ref r) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (y) (var_ref r) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (z) (var_ref r) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (assign (w) (var_ref r) + (call atan ((swiz w (var_ref y)) + (swiz w (var_ref x))))) + (return (var_ref r))))) + +)) diff --git a/src/glsl/builtins/ir/atanh b/src/glsl/builtins/ir/atanh deleted file mode 100644 index 5ef3596f052..00000000000 --- a/src/glsl/builtins/ir/atanh +++ /dev/null @@ -1,37 +0,0 @@ -((function atanh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float log - (expression float / - (expression float + (constant float (1)) (var_ref x)) - (expression float - (constant float (1)) (var_ref x)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant float (0.5)) - (expression vec2 log - (expression vec2 / - (expression vec2 + (constant float (1)) (var_ref x)) - (expression vec2 - (constant float (1)) (var_ref x)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant float (0.5)) - (expression vec3 log - (expression vec3 / - (expression vec3 + (constant float (1)) (var_ref x)) - (expression vec3 - (constant float (1)) (var_ref x)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant float (0.5)) - (expression vec4 log - (expression vec4 / - (expression vec4 + (constant float (1)) (var_ref x)) - (expression vec4 - (constant float (1)) (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/ir/atanh.ir b/src/glsl/builtins/ir/atanh.ir new file mode 100644 index 00000000000..5ef3596f052 --- /dev/null +++ b/src/glsl/builtins/ir/atanh.ir @@ -0,0 +1,37 @@ +((function atanh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float log + (expression float / + (expression float + (constant float (1)) (var_ref x)) + (expression float - (constant float (1)) (var_ref x)))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant float (0.5)) + (expression vec2 log + (expression vec2 / + (expression vec2 + (constant float (1)) (var_ref x)) + (expression vec2 - (constant float (1)) (var_ref x)))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant float (0.5)) + (expression vec3 log + (expression vec3 / + (expression vec3 + (constant float (1)) (var_ref x)) + (expression vec3 - (constant float (1)) (var_ref x)))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant float (0.5)) + (expression vec4 log + (expression vec4 / + (expression vec4 + (constant float (1)) (var_ref x)) + (expression vec4 - (constant float (1)) (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/ceil b/src/glsl/builtins/ir/ceil deleted file mode 100644 index a26a7750493..00000000000 --- a/src/glsl/builtins/ir/ceil +++ /dev/null @@ -1,21 +0,0 @@ -((function ceil - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float ceil (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 ceil (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 ceil (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 ceil (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/ceil.ir b/src/glsl/builtins/ir/ceil.ir new file mode 100644 index 00000000000..a26a7750493 --- /dev/null +++ b/src/glsl/builtins/ir/ceil.ir @@ -0,0 +1,21 @@ +((function ceil + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float ceil (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 ceil (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 ceil (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 ceil (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/clamp b/src/glsl/builtins/ir/clamp deleted file mode 100644 index 2bdc466b269..00000000000 --- a/src/glsl/builtins/ir/clamp +++ /dev/null @@ -1,148 +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))))) - - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1) - (declare (in) ivec2 arg2)) - ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1) - (declare (in) ivec3 arg2)) - ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1) - (declare (in) ivec4 arg2)) - ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1) - (declare (in) uvec2 arg2)) - ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1) - (declare (in) uvec3 arg2)) - ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1) - (declare (in) uvec4 arg2)) - ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/clamp.ir b/src/glsl/builtins/ir/clamp.ir new file mode 100644 index 00000000000..2bdc466b269 --- /dev/null +++ b/src/glsl/builtins/ir/clamp.ir @@ -0,0 +1,148 @@ +((function clamp + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1) + (declare (in) ivec2 arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1) + (declare (in) ivec3 arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1) + (declare (in) ivec4 arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1) + (declare (in) uvec2 arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1) + (declare (in) uvec3 arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1) + (declare (in) uvec4 arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/cos b/src/glsl/builtins/ir/cos deleted file mode 100644 index 88f266eccbe..00000000000 --- a/src/glsl/builtins/ir/cos +++ /dev/null @@ -1,21 +0,0 @@ -((function cos - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float cos (var_ref angle))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 cos (var_ref angle))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 cos (var_ref angle))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 cos (var_ref angle))))) -)) diff --git a/src/glsl/builtins/ir/cos.ir b/src/glsl/builtins/ir/cos.ir new file mode 100644 index 00000000000..88f266eccbe --- /dev/null +++ b/src/glsl/builtins/ir/cos.ir @@ -0,0 +1,21 @@ +((function cos + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float cos (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 cos (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 cos (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 cos (var_ref angle))))) +)) diff --git a/src/glsl/builtins/ir/cosh b/src/glsl/builtins/ir/cosh deleted file mode 100644 index 945743138fc..00000000000 --- a/src/glsl/builtins/ir/cosh +++ /dev/null @@ -1,30 +0,0 @@ -((function cosh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float + - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant float (0.5)) - (expression vec2 + - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant float (0.5)) - (expression vec3 + - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant float (0.5)) - (expression vec4 + - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/ir/cosh.ir b/src/glsl/builtins/ir/cosh.ir new file mode 100644 index 00000000000..945743138fc --- /dev/null +++ b/src/glsl/builtins/ir/cosh.ir @@ -0,0 +1,30 @@ +((function cosh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant float (0.5)) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant float (0.5)) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant float (0.5)) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/cross b/src/glsl/builtins/ir/cross deleted file mode 100644 index 02991fe4227..00000000000 --- a/src/glsl/builtins/ir/cross +++ /dev/null @@ -1,9 +0,0 @@ -((function cross - (signature vec3 - (parameters - (declare (in) vec3 a) - (declare (in) vec3 b)) - ((return (expression vec3 - - (expression vec3 * (swiz yzx (var_ref a)) (swiz zxy (var_ref b))) - (expression vec3 * (swiz zxy (var_ref a)) (swiz yzx (var_ref b))))))) -)) diff --git a/src/glsl/builtins/ir/cross.ir b/src/glsl/builtins/ir/cross.ir new file mode 100644 index 00000000000..02991fe4227 --- /dev/null +++ b/src/glsl/builtins/ir/cross.ir @@ -0,0 +1,9 @@ +((function cross + (signature vec3 + (parameters + (declare (in) vec3 a) + (declare (in) vec3 b)) + ((return (expression vec3 - + (expression vec3 * (swiz yzx (var_ref a)) (swiz zxy (var_ref b))) + (expression vec3 * (swiz zxy (var_ref a)) (swiz yzx (var_ref b))))))) +)) diff --git a/src/glsl/builtins/ir/dFdx b/src/glsl/builtins/ir/dFdx deleted file mode 100644 index 30594d33c74..00000000000 --- a/src/glsl/builtins/ir/dFdx +++ /dev/null @@ -1,21 +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))))) -)) diff --git a/src/glsl/builtins/ir/dFdx.ir b/src/glsl/builtins/ir/dFdx.ir new file mode 100644 index 00000000000..30594d33c74 --- /dev/null +++ b/src/glsl/builtins/ir/dFdx.ir @@ -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 deleted file mode 100644 index fb5798d3cbe..00000000000 --- a/src/glsl/builtins/ir/dFdy +++ /dev/null @@ -1,21 +0,0 @@ -((function dFdy - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdy (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdy (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdy (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdy (var_ref p))))) -)) diff --git a/src/glsl/builtins/ir/dFdy.ir b/src/glsl/builtins/ir/dFdy.ir new file mode 100644 index 00000000000..fb5798d3cbe --- /dev/null +++ b/src/glsl/builtins/ir/dFdy.ir @@ -0,0 +1,21 @@ +((function dFdy + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdy (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdy (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdy (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdy (var_ref p))))) +)) diff --git a/src/glsl/builtins/ir/degrees b/src/glsl/builtins/ir/degrees deleted file mode 100644 index dc0d7b9e20d..00000000000 --- a/src/glsl/builtins/ir/degrees +++ /dev/null @@ -1,21 +0,0 @@ -((function degrees - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) -)) diff --git a/src/glsl/builtins/ir/degrees.ir b/src/glsl/builtins/ir/degrees.ir new file mode 100644 index 00000000000..dc0d7b9e20d --- /dev/null +++ b/src/glsl/builtins/ir/degrees.ir @@ -0,0 +1,21 @@ +((function degrees + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) +)) diff --git a/src/glsl/builtins/ir/distance b/src/glsl/builtins/ir/distance deleted file mode 100644 index c249f8c9962..00000000000 --- a/src/glsl/builtins/ir/distance +++ /dev/null @@ -1,31 +0,0 @@ -((function distance - (signature float - (parameters - (declare (in) float p0) - (declare (in) float p1)) - ((return (expression float abs (expression float - (var_ref p0) (var_ref p1)))))) - - (signature float - (parameters - (declare (in) vec2 p0) - (declare (in) vec2 p1)) - ((declare () vec2 p) - (assign (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec3 p0) - (declare (in) vec3 p1)) - ((declare () vec3 p) - (assign (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec4 p0) - (declare (in) vec4 p1)) - ((declare () vec4 p) - (assign (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) -)) diff --git a/src/glsl/builtins/ir/distance.ir b/src/glsl/builtins/ir/distance.ir new file mode 100644 index 00000000000..c249f8c9962 --- /dev/null +++ b/src/glsl/builtins/ir/distance.ir @@ -0,0 +1,31 @@ +((function distance + (signature float + (parameters + (declare (in) float p0) + (declare (in) float p1)) + ((return (expression float abs (expression float - (var_ref p0) (var_ref p1)))))) + + (signature float + (parameters + (declare (in) vec2 p0) + (declare (in) vec2 p1)) + ((declare () vec2 p) + (assign (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec3 p0) + (declare (in) vec3 p1)) + ((declare () vec3 p) + (assign (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec4 p0) + (declare (in) vec4 p1)) + ((declare () vec4 p) + (assign (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) +)) diff --git a/src/glsl/builtins/ir/dot b/src/glsl/builtins/ir/dot deleted file mode 100644 index 1f27f323597..00000000000 --- a/src/glsl/builtins/ir/dot +++ /dev/null @@ -1,25 +0,0 @@ -((function dot - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float * (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/dot.ir b/src/glsl/builtins/ir/dot.ir new file mode 100644 index 00000000000..1f27f323597 --- /dev/null +++ b/src/glsl/builtins/ir/dot.ir @@ -0,0 +1,25 @@ +((function dot + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float * (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/equal b/src/glsl/builtins/ir/equal deleted file mode 100644 index a414b3e535f..00000000000 --- a/src/glsl/builtins/ir/equal +++ /dev/null @@ -1,73 +0,0 @@ -((function equal - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) bvec2 arg0) - (declare (in) bvec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0) - (declare (in) bvec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0) - (declare (in) bvec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/equal.ir b/src/glsl/builtins/ir/equal.ir new file mode 100644 index 00000000000..a414b3e535f --- /dev/null +++ b/src/glsl/builtins/ir/equal.ir @@ -0,0 +1,73 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) bvec2 arg0) + (declare (in) bvec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0) + (declare (in) bvec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0) + (declare (in) bvec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/exp b/src/glsl/builtins/ir/exp deleted file mode 100644 index a73bd6a7f84..00000000000 --- a/src/glsl/builtins/ir/exp +++ /dev/null @@ -1,21 +0,0 @@ -((function exp - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float exp (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 exp (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 exp (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 exp (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/exp.ir b/src/glsl/builtins/ir/exp.ir new file mode 100644 index 00000000000..a73bd6a7f84 --- /dev/null +++ b/src/glsl/builtins/ir/exp.ir @@ -0,0 +1,21 @@ +((function exp + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/exp2 b/src/glsl/builtins/ir/exp2 deleted file mode 100644 index a842d3fe65b..00000000000 --- a/src/glsl/builtins/ir/exp2 +++ /dev/null @@ -1,21 +0,0 @@ -((function exp2 - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float exp2 (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 exp2 (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 exp2 (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 exp2 (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/exp2.ir b/src/glsl/builtins/ir/exp2.ir new file mode 100644 index 00000000000..a842d3fe65b --- /dev/null +++ b/src/glsl/builtins/ir/exp2.ir @@ -0,0 +1,21 @@ +((function exp2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp2 (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/faceforward b/src/glsl/builtins/ir/faceforward deleted file mode 100644 index 35b79571c6b..00000000000 --- a/src/glsl/builtins/ir/faceforward +++ /dev/null @@ -1,37 +0,0 @@ -((function faceforward - (signature float - (parameters - (declare (in) float N) - (declare (in) float I) - (declare (in) float Nref)) - ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression float neg (var_ref N))))))) - - (signature vec2 - (parameters - (declare (in) vec2 N) - (declare (in) vec2 I) - (declare (in) vec2 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec2 neg (var_ref N))))))) - - (signature vec3 - (parameters - (declare (in) vec3 N) - (declare (in) vec3 I) - (declare (in) vec3 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec3 neg (var_ref N))))))) - - (signature vec4 - (parameters - (declare (in) vec4 N) - (declare (in) vec4 I) - (declare (in) vec4 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec4 neg (var_ref N))))))) -)) diff --git a/src/glsl/builtins/ir/faceforward.ir b/src/glsl/builtins/ir/faceforward.ir new file mode 100644 index 00000000000..35b79571c6b --- /dev/null +++ b/src/glsl/builtins/ir/faceforward.ir @@ -0,0 +1,37 @@ +((function faceforward + (signature float + (parameters + (declare (in) float N) + (declare (in) float I) + (declare (in) float Nref)) + ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression float neg (var_ref N))))))) + + (signature vec2 + (parameters + (declare (in) vec2 N) + (declare (in) vec2 I) + (declare (in) vec2 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec2 neg (var_ref N))))))) + + (signature vec3 + (parameters + (declare (in) vec3 N) + (declare (in) vec3 I) + (declare (in) vec3 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec3 neg (var_ref N))))))) + + (signature vec4 + (parameters + (declare (in) vec4 N) + (declare (in) vec4 I) + (declare (in) vec4 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec4 neg (var_ref N))))))) +)) diff --git a/src/glsl/builtins/ir/floor b/src/glsl/builtins/ir/floor deleted file mode 100644 index 8dd8052799b..00000000000 --- a/src/glsl/builtins/ir/floor +++ /dev/null @@ -1,21 +0,0 @@ -((function floor - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float floor (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 floor (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 floor (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 floor (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/floor.ir b/src/glsl/builtins/ir/floor.ir new file mode 100644 index 00000000000..8dd8052799b --- /dev/null +++ b/src/glsl/builtins/ir/floor.ir @@ -0,0 +1,21 @@ +((function floor + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float floor (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 floor (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 floor (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 floor (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/fract b/src/glsl/builtins/ir/fract deleted file mode 100644 index 3f0763d1b3e..00000000000 --- a/src/glsl/builtins/ir/fract +++ /dev/null @@ -1,22 +0,0 @@ -((function fract - (signature float - (parameters - (declare (in) float x)) - ((return (expression float fract (var_ref x))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 fract (var_ref x))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 fract (var_ref x))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 fract (var_ref x))))) -)) - diff --git a/src/glsl/builtins/ir/fract.ir b/src/glsl/builtins/ir/fract.ir new file mode 100644 index 00000000000..3f0763d1b3e --- /dev/null +++ b/src/glsl/builtins/ir/fract.ir @@ -0,0 +1,22 @@ +((function fract + (signature float + (parameters + (declare (in) float x)) + ((return (expression float fract (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 fract (var_ref x))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 fract (var_ref x))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 fract (var_ref x))))) +)) + diff --git a/src/glsl/builtins/ir/ftransform b/src/glsl/builtins/ir/ftransform deleted file mode 100644 index 9ca63dc1e34..00000000000 --- a/src/glsl/builtins/ir/ftransform +++ /dev/null @@ -1,9 +0,0 @@ -((declare (uniform) mat4 gl_ModelViewProjectionMatrix) - (declare (in) vec4 gl_Vertex) - (function ftransform - (signature vec4 - (parameters) - ((return (expression vec4 * - (var_ref gl_ModelViewProjectionMatrix) - (var_ref gl_Vertex))))) -)) diff --git a/src/glsl/builtins/ir/ftransform.ir b/src/glsl/builtins/ir/ftransform.ir new file mode 100644 index 00000000000..9ca63dc1e34 --- /dev/null +++ b/src/glsl/builtins/ir/ftransform.ir @@ -0,0 +1,9 @@ +((declare (uniform) mat4 gl_ModelViewProjectionMatrix) + (declare (in) vec4 gl_Vertex) + (function ftransform + (signature vec4 + (parameters) + ((return (expression vec4 * + (var_ref gl_ModelViewProjectionMatrix) + (var_ref gl_Vertex))))) +)) diff --git a/src/glsl/builtins/ir/fwidth b/src/glsl/builtins/ir/fwidth deleted file mode 100644 index 385e05d6a1a..00000000000 --- a/src/glsl/builtins/ir/fwidth +++ /dev/null @@ -1,29 +0,0 @@ -((function fwidth - (signature float - (parameters - (declare (in) float p)) - ((return (expression float + - (expression float abs (expression float dFdx (var_ref p))) - (expression float abs (expression float dFdy (var_ref p))))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 + - (expression vec2 abs (expression vec2 dFdx (var_ref p))) - (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 + - (expression vec3 abs (expression vec3 dFdx (var_ref p))) - (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 + - (expression vec4 abs (expression vec4 dFdx (var_ref p))) - (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) -)) diff --git a/src/glsl/builtins/ir/fwidth.ir b/src/glsl/builtins/ir/fwidth.ir new file mode 100644 index 00000000000..385e05d6a1a --- /dev/null +++ b/src/glsl/builtins/ir/fwidth.ir @@ -0,0 +1,29 @@ +((function fwidth + (signature float + (parameters + (declare (in) float p)) + ((return (expression float + + (expression float abs (expression float dFdx (var_ref p))) + (expression float abs (expression float dFdy (var_ref p))))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 + + (expression vec2 abs (expression vec2 dFdx (var_ref p))) + (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 + + (expression vec3 abs (expression vec3 dFdx (var_ref p))) + (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 + + (expression vec4 abs (expression vec4 dFdx (var_ref p))) + (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) +)) diff --git a/src/glsl/builtins/ir/greaterThan b/src/glsl/builtins/ir/greaterThan deleted file mode 100644 index 18af865288f..00000000000 --- a/src/glsl/builtins/ir/greaterThan +++ /dev/null @@ -1,55 +0,0 @@ -((function greaterThan - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/greaterThan.ir b/src/glsl/builtins/ir/greaterThan.ir new file mode 100644 index 00000000000..18af865288f --- /dev/null +++ b/src/glsl/builtins/ir/greaterThan.ir @@ -0,0 +1,55 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/greaterThanEqual b/src/glsl/builtins/ir/greaterThanEqual deleted file mode 100644 index 6d3bc892cb7..00000000000 --- a/src/glsl/builtins/ir/greaterThanEqual +++ /dev/null @@ -1,55 +0,0 @@ -((function greaterThanEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/greaterThanEqual.ir b/src/glsl/builtins/ir/greaterThanEqual.ir new file mode 100644 index 00000000000..6d3bc892cb7 --- /dev/null +++ b/src/glsl/builtins/ir/greaterThanEqual.ir @@ -0,0 +1,55 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/inversesqrt b/src/glsl/builtins/ir/inversesqrt deleted file mode 100644 index 5b66d2b3695..00000000000 --- a/src/glsl/builtins/ir/inversesqrt +++ /dev/null @@ -1,21 +0,0 @@ -((function inversesqrt - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float rsq (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 rsq (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 rsq (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 rsq (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/inversesqrt.ir b/src/glsl/builtins/ir/inversesqrt.ir new file mode 100644 index 00000000000..5b66d2b3695 --- /dev/null +++ b/src/glsl/builtins/ir/inversesqrt.ir @@ -0,0 +1,21 @@ +((function inversesqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float rsq (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 rsq (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 rsq (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 rsq (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/length b/src/glsl/builtins/ir/length deleted file mode 100644 index b72334ee8a2..00000000000 --- a/src/glsl/builtins/ir/length +++ /dev/null @@ -1,21 +0,0 @@ -((function length - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float abs (var_ref arg0))))) - - (signature float - (parameters - (declare (in) vec2 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec3 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec4 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) -)) diff --git a/src/glsl/builtins/ir/length.ir b/src/glsl/builtins/ir/length.ir new file mode 100644 index 00000000000..b72334ee8a2 --- /dev/null +++ b/src/glsl/builtins/ir/length.ir @@ -0,0 +1,21 @@ +((function length + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature float + (parameters + (declare (in) vec2 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec3 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec4 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) +)) diff --git a/src/glsl/builtins/ir/lessThan b/src/glsl/builtins/ir/lessThan deleted file mode 100644 index 8401fe9db60..00000000000 --- a/src/glsl/builtins/ir/lessThan +++ /dev/null @@ -1,55 +0,0 @@ -((function lessThan - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/lessThan.ir b/src/glsl/builtins/ir/lessThan.ir new file mode 100644 index 00000000000..8401fe9db60 --- /dev/null +++ b/src/glsl/builtins/ir/lessThan.ir @@ -0,0 +1,55 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/lessThanEqual b/src/glsl/builtins/ir/lessThanEqual deleted file mode 100644 index c1cdd3fb605..00000000000 --- a/src/glsl/builtins/ir/lessThanEqual +++ /dev/null @@ -1,55 +0,0 @@ -((function lessThanEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/lessThanEqual.ir b/src/glsl/builtins/ir/lessThanEqual.ir new file mode 100644 index 00000000000..c1cdd3fb605 --- /dev/null +++ b/src/glsl/builtins/ir/lessThanEqual.ir @@ -0,0 +1,55 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/log b/src/glsl/builtins/ir/log deleted file mode 100644 index d168abb5a73..00000000000 --- a/src/glsl/builtins/ir/log +++ /dev/null @@ -1,21 +0,0 @@ -((function log - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float log (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 log (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 log (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 log (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/log.ir b/src/glsl/builtins/ir/log.ir new file mode 100644 index 00000000000..d168abb5a73 --- /dev/null +++ b/src/glsl/builtins/ir/log.ir @@ -0,0 +1,21 @@ +((function log + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/log2 b/src/glsl/builtins/ir/log2 deleted file mode 100644 index b96c6276f0a..00000000000 --- a/src/glsl/builtins/ir/log2 +++ /dev/null @@ -1,21 +0,0 @@ -((function log2 - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float log2 (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 log2 (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 log2 (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 log2 (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/log2.ir b/src/glsl/builtins/ir/log2.ir new file mode 100644 index 00000000000..b96c6276f0a --- /dev/null +++ b/src/glsl/builtins/ir/log2.ir @@ -0,0 +1,21 @@ +((function log2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log2 (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/matrixCompMult b/src/glsl/builtins/ir/matrixCompMult deleted file mode 100644 index 2400f11afad..00000000000 --- a/src/glsl/builtins/ir/matrixCompMult +++ /dev/null @@ -1,91 +0,0 @@ -((function matrixCompMult - (signature mat2 - (parameters - (declare (in) mat2 x) - (declare (in) mat2 y)) - ((declare () mat2 z) - (assign (xy) (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 (xy) (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 (xyz) (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 (xyz) (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 (xyz) (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 (xyzw) (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 (xyzw) (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 (xyzw) (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 (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) - - (signature mat2x3 - (parameters - (declare (in) mat2x3 x) - (declare (in) mat2x3 y)) - ((declare () mat2x3 z) - (assign (xyz) (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 (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) -(return (var_ref z)))) - - (signature mat3x2 - (parameters - (declare (in) mat3x2 x) - (declare (in) mat3x2 y)) - ((declare () mat3x2 z) - (assign (xy) (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 (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) -(return (var_ref z)))) - - (signature mat2x4 - (parameters - (declare (in) mat2x4 x) - (declare (in) mat2x4 y)) - ((declare () mat2x4 z) - (assign (xyzw) (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 (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) -(return (var_ref z)))) - - (signature mat4x2 - (parameters - (declare (in) mat4x2 x) - (declare (in) mat4x2 y)) - ((declare () mat4x2 z) - (assign (xy) (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 (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) - (assign (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) - - (signature mat3x4 - (parameters - (declare (in) mat3x4 x) - (declare (in) mat3x4 y)) - ((declare () mat3x4 z) - (assign (xyzw) (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 (xyzw) (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 (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) -(return (var_ref z)))) - - (signature mat4x3 - (parameters - (declare (in) mat4x3 x) - (declare (in) mat4x3 y)) - ((declare () mat4x3 z) - (assign (xyz) (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 (xyz) (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 (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) - (assign (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) -)) diff --git a/src/glsl/builtins/ir/matrixCompMult.ir b/src/glsl/builtins/ir/matrixCompMult.ir new file mode 100644 index 00000000000..2400f11afad --- /dev/null +++ b/src/glsl/builtins/ir/matrixCompMult.ir @@ -0,0 +1,91 @@ +((function matrixCompMult + (signature mat2 + (parameters + (declare (in) mat2 x) + (declare (in) mat2 y)) + ((declare () mat2 z) + (assign (xy) (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 (xy) (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 (xyz) (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 (xyz) (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 (xyz) (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 (xyzw) (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 (xyzw) (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 (xyzw) (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 (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) +(return (var_ref z)))) + + (signature mat2x3 + (parameters + (declare (in) mat2x3 x) + (declare (in) mat2x3 y)) + ((declare () mat2x3 z) + (assign (xyz) (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 (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) +(return (var_ref z)))) + + (signature mat3x2 + (parameters + (declare (in) mat3x2 x) + (declare (in) mat3x2 y)) + ((declare () mat3x2 z) + (assign (xy) (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 (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) +(return (var_ref z)))) + + (signature mat2x4 + (parameters + (declare (in) mat2x4 x) + (declare (in) mat2x4 y)) + ((declare () mat2x4 z) + (assign (xyzw) (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 (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) +(return (var_ref z)))) + + (signature mat4x2 + (parameters + (declare (in) mat4x2 x) + (declare (in) mat4x2 y)) + ((declare () mat4x2 z) + (assign (xy) (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 (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) + (assign (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) +(return (var_ref z)))) + + (signature mat3x4 + (parameters + (declare (in) mat3x4 x) + (declare (in) mat3x4 y)) + ((declare () mat3x4 z) + (assign (xyzw) (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 (xyzw) (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 (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) +(return (var_ref z)))) + + (signature mat4x3 + (parameters + (declare (in) mat4x3 x) + (declare (in) mat4x3 y)) + ((declare () mat4x3 z) + (assign (xyz) (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 (xyz) (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 (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) + (assign (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) +(return (var_ref z)))) +)) diff --git a/src/glsl/builtins/ir/max b/src/glsl/builtins/ir/max deleted file mode 100644 index 2b5a02868cc..00000000000 --- a/src/glsl/builtins/ir/max +++ /dev/null @@ -1,127 +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))))) - - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1)) - ((return (expression int max (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1)) - ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1)) - ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1)) - ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1)) - ((return (expression uint max (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1)) - ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1)) - ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1)) - ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/max.ir b/src/glsl/builtins/ir/max.ir new file mode 100644 index 00000000000..2b5a02868cc --- /dev/null +++ b/src/glsl/builtins/ir/max.ir @@ -0,0 +1,127 @@ +((function max + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/min b/src/glsl/builtins/ir/min deleted file mode 100644 index 2deef1118a7..00000000000 --- a/src/glsl/builtins/ir/min +++ /dev/null @@ -1,127 +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))))) - - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1)) - ((return (expression int min (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1)) - ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1)) - ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1)) - ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1)) - ((return (expression uint min (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1)) - ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1)) - ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1)) - ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/min.ir b/src/glsl/builtins/ir/min.ir new file mode 100644 index 00000000000..2deef1118a7 --- /dev/null +++ b/src/glsl/builtins/ir/min.ir @@ -0,0 +1,127 @@ +((function min + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/mix b/src/glsl/builtins/ir/mix deleted file mode 100644 index a31f0fa7086..00000000000 --- a/src/glsl/builtins/ir/mix +++ /dev/null @@ -1,88 +0,0 @@ -((function mix - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) vec2 arg2)) - ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) vec3 arg2)) - ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) vec4 arg2)) - ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) float arg2)) - ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) float arg2)) - ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) float arg2)) - ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) - - (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)) (x) (var_ref v1) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (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)) (x) (var_ref v1) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (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)) (x) (var_ref v1) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2))) - (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2))) - (return (var_ref v1)))) -)) diff --git a/src/glsl/builtins/ir/mix.ir b/src/glsl/builtins/ir/mix.ir new file mode 100644 index 00000000000..a31f0fa7086 --- /dev/null +++ b/src/glsl/builtins/ir/mix.ir @@ -0,0 +1,88 @@ +((function mix + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) float arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) float arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) float arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature float + (parameters + (declare (in) float v1) + (declare (in) float v2) + (declare (in) bool a)) + ((assign (var_ref a) (var_ref v1) (var_ref v2)) + (return (var_ref v1)))) + + (signature vec2 + (parameters + (declare (in) vec2 v1) + (declare (in) vec2 v2) + (declare (in) bvec2 a)) + ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (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)) (x) (var_ref v1) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (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)) (x) (var_ref v1) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2))) + (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2))) + (return (var_ref v1)))) +)) diff --git a/src/glsl/builtins/ir/mod b/src/glsl/builtins/ir/mod deleted file mode 100644 index aeaea240e2d..00000000000 --- a/src/glsl/builtins/ir/mod +++ /dev/null @@ -1,43 +0,0 @@ -((function mod - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float % (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/mod.ir b/src/glsl/builtins/ir/mod.ir new file mode 100644 index 00000000000..aeaea240e2d --- /dev/null +++ b/src/glsl/builtins/ir/mod.ir @@ -0,0 +1,43 @@ +((function mod + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/modf b/src/glsl/builtins/ir/modf deleted file mode 100644 index f4f631567bd..00000000000 --- a/src/glsl/builtins/ir/modf +++ /dev/null @@ -1,37 +0,0 @@ -((function modf - (signature float - (parameters - (declare (in) float x) - (declare (out) float i)) - ((declare () float t) - (assign (x) (var_ref t) (expression float trunc (var_ref x))) - (assign (x) (var_ref i) (var_ref t)) - (return (expression float - (var_ref x) (var_ref t))))) - - (signature vec2 - (parameters - (declare (in) vec2 x) - (declare (out) vec2 i)) - ((declare () vec2 t) - (assign (xy) (var_ref t) (expression vec2 trunc (var_ref x))) - (assign (xy) (var_ref i) (var_ref t)) - (return (expression vec2 - (var_ref x) (var_ref t))))) - - (signature vec3 - (parameters - (declare (in) vec3 x) - (declare (out) vec3 i)) - ((declare () vec3 t) - (assign (xyz) (var_ref t) (expression vec3 trunc (var_ref x))) - (assign (xyz) (var_ref i) (var_ref t)) - (return (expression vec3 - (var_ref x) (var_ref t))))) - - (signature vec4 - (parameters - (declare (in) vec4 x) - (declare (out) vec4 i)) - ((declare () vec4 t) - (assign (xyzw) (var_ref t) (expression vec4 trunc (var_ref x))) - (assign (xyzw) (var_ref i) (var_ref t)) - (return (expression vec4 - (var_ref x) (var_ref t))))) -)) diff --git a/src/glsl/builtins/ir/modf.ir b/src/glsl/builtins/ir/modf.ir new file mode 100644 index 00000000000..f4f631567bd --- /dev/null +++ b/src/glsl/builtins/ir/modf.ir @@ -0,0 +1,37 @@ +((function modf + (signature float + (parameters + (declare (in) float x) + (declare (out) float i)) + ((declare () float t) + (assign (x) (var_ref t) (expression float trunc (var_ref x))) + (assign (x) (var_ref i) (var_ref t)) + (return (expression float - (var_ref x) (var_ref t))))) + + (signature vec2 + (parameters + (declare (in) vec2 x) + (declare (out) vec2 i)) + ((declare () vec2 t) + (assign (xy) (var_ref t) (expression vec2 trunc (var_ref x))) + (assign (xy) (var_ref i) (var_ref t)) + (return (expression vec2 - (var_ref x) (var_ref t))))) + + (signature vec3 + (parameters + (declare (in) vec3 x) + (declare (out) vec3 i)) + ((declare () vec3 t) + (assign (xyz) (var_ref t) (expression vec3 trunc (var_ref x))) + (assign (xyz) (var_ref i) (var_ref t)) + (return (expression vec3 - (var_ref x) (var_ref t))))) + + (signature vec4 + (parameters + (declare (in) vec4 x) + (declare (out) vec4 i)) + ((declare () vec4 t) + (assign (xyzw) (var_ref t) (expression vec4 trunc (var_ref x))) + (assign (xyzw) (var_ref i) (var_ref t)) + (return (expression vec4 - (var_ref x) (var_ref t))))) +)) diff --git a/src/glsl/builtins/ir/noise1 b/src/glsl/builtins/ir/noise1 deleted file mode 100644 index 115505610a6..00000000000 --- a/src/glsl/builtins/ir/noise1 +++ /dev/null @@ -1,18 +0,0 @@ -((function noise1 - (signature float - (parameters - (declare (in) float x)) - ((return (expression float noise (var_ref x))))) - (signature float - (parameters - (declare (in) vec2 x)) - ((return (expression float noise (var_ref x))))) - (signature float - (parameters - (declare (in) vec3 x)) - ((return (expression float noise (var_ref x))))) - (signature float - (parameters - (declare (in) vec4 x)) - ((return (expression float noise (var_ref x))))) -)) diff --git a/src/glsl/builtins/ir/noise1.ir b/src/glsl/builtins/ir/noise1.ir new file mode 100644 index 00000000000..115505610a6 --- /dev/null +++ b/src/glsl/builtins/ir/noise1.ir @@ -0,0 +1,18 @@ +((function noise1 + (signature float + (parameters + (declare (in) float x)) + ((return (expression float noise (var_ref x))))) + (signature float + (parameters + (declare (in) vec2 x)) + ((return (expression float noise (var_ref x))))) + (signature float + (parameters + (declare (in) vec3 x)) + ((return (expression float noise (var_ref x))))) + (signature float + (parameters + (declare (in) vec4 x)) + ((return (expression float noise (var_ref x))))) +)) diff --git a/src/glsl/builtins/ir/noise2 b/src/glsl/builtins/ir/noise2 deleted file mode 100644 index d3366145fed..00000000000 --- a/src/glsl/builtins/ir/noise2 +++ /dev/null @@ -1,61 +0,0 @@ -((function noise2 - (signature vec2 - (parameters (declare (in) vec4 p)) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) - - (signature vec2 - (parameters (declare (in) vec3 p)) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) - - (signature vec2 - (parameters - (declare (in ) vec2 p) - ) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) - - (signature vec2 - (parameters - (declare (in ) float p) - ) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) -)) diff --git a/src/glsl/builtins/ir/noise2.ir b/src/glsl/builtins/ir/noise2.ir new file mode 100644 index 00000000000..d3366145fed --- /dev/null +++ b/src/glsl/builtins/ir/noise2.ir @@ -0,0 +1,61 @@ +((function noise2 + (signature vec2 + (parameters (declare (in) vec4 p)) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (return (var_ref t)) + )) + + (signature vec2 + (parameters (declare (in) vec3 p)) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (return (var_ref t)) + )) + + (signature vec2 + (parameters + (declare (in ) vec2 p) + ) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (return (var_ref t)) + )) + + (signature vec2 + (parameters + (declare (in ) float p) + ) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (return (var_ref t)) + )) +)) diff --git a/src/glsl/builtins/ir/noise3 b/src/glsl/builtins/ir/noise3 deleted file mode 100644 index 1d8aa3f30d0..00000000000 --- a/src/glsl/builtins/ir/noise3 +++ /dev/null @@ -1,73 +0,0 @@ -((function noise3 - (signature vec3 - (parameters (declare (in) vec4 p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) - - (signature vec3 - (parameters (declare (in) vec3 p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) - - (signature vec3 - (parameters (declare (in) vec2 p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) - - (signature vec3 - (parameters (declare (in) float p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) - (assign (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) -)) diff --git a/src/glsl/builtins/ir/noise3.ir b/src/glsl/builtins/ir/noise3.ir new file mode 100644 index 00000000000..1d8aa3f30d0 --- /dev/null +++ b/src/glsl/builtins/ir/noise3.ir @@ -0,0 +1,73 @@ +((function noise3 + (signature vec3 + (parameters (declare (in) vec4 p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) + (assign (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))))) + + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (assign (z) (var_ref t) (var_ref c)) + (return (var_ref t)) + )) + + (signature vec3 + (parameters (declare (in) vec3 p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) + (assign (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))))) + + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (assign (z) (var_ref t) (var_ref c)) + (return (var_ref t)) + )) + + (signature vec3 + (parameters (declare (in) vec2 p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) + (assign (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))))) + + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (assign (z) (var_ref t) (var_ref c)) + (return (var_ref t)) + )) + + (signature vec3 + (parameters (declare (in) float p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (x) (var_ref a) (expression float noise (var_ref p))) + (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) + (assign (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0))))) + + (assign (x) (var_ref t) (var_ref a)) + (assign (y) (var_ref t) (var_ref b)) + (assign (z) (var_ref t) (var_ref c)) + (return (var_ref t)) + )) +)) diff --git a/src/glsl/builtins/ir/noise4 b/src/glsl/builtins/ir/noise4 deleted file mode 100644 index 4949696546f..00000000000 --- a/src/glsl/builtins/ir/noise4 +++ /dev/null @@ -1,97 +0,0 @@ -((function noise4 - (signature vec4 - (parameters (declare (in) vec4 p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () vec4 _p) - (assign (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) - - (signature vec4 - (parameters (declare (in) vec3 p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () vec3 _p) - (assign (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) - - (signature vec4 - (parameters (declare (in) vec2 p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () vec2 _p) - (assign (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) - - (signature vec4 - (parameters (declare (in) float p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () float _p) - (assign (x) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) -)) diff --git a/src/glsl/builtins/ir/noise4.ir b/src/glsl/builtins/ir/noise4.ir new file mode 100644 index 00000000000..4949696546f --- /dev/null +++ b/src/glsl/builtins/ir/noise4.ir @@ -0,0 +1,97 @@ +((function noise4 + (signature vec4 + (parameters (declare (in) vec4 p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () vec4 _p) + (assign (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) ) + + (assign (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) + (assign (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0))))) + + (assign (x) (var_ref _r) (var_ref _x)) + (assign (y) (var_ref _r) (var_ref _y)) + (assign (z) (var_ref _r) (var_ref _z)) + (assign (w) (var_ref _r) (var_ref _w)) + (return (var_ref _r)) + )) + + (signature vec4 + (parameters (declare (in) vec3 p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () vec3 _p) + (assign (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) ) + + (assign (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) + (assign (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0))))) + + (assign (x) (var_ref _r) (var_ref _x)) + (assign (y) (var_ref _r) (var_ref _y)) + (assign (z) (var_ref _r) (var_ref _z)) + (assign (w) (var_ref _r) (var_ref _w)) + (return (var_ref _r)) + )) + + (signature vec4 + (parameters (declare (in) vec2 p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () vec2 _p) + (assign (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) ) + + (assign (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) + (assign (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0))))) + + (assign (x) (var_ref _r) (var_ref _x)) + (assign (y) (var_ref _r) (var_ref _y)) + (assign (z) (var_ref _r) (var_ref _z)) + (assign (w) (var_ref _r) (var_ref _w)) + (return (var_ref _r)) + )) + + (signature vec4 + (parameters (declare (in) float p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () float _p) + (assign (x) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) ) + + (assign (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0))))) + (assign (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0))))) + + (assign (x) (var_ref _r) (var_ref _x)) + (assign (y) (var_ref _r) (var_ref _y)) + (assign (z) (var_ref _r) (var_ref _z)) + (assign (w) (var_ref _r) (var_ref _w)) + (return (var_ref _r)) + )) +)) diff --git a/src/glsl/builtins/ir/normalize b/src/glsl/builtins/ir/normalize deleted file mode 100644 index 0de0db0b648..00000000000 --- a/src/glsl/builtins/ir/normalize +++ /dev/null @@ -1,21 +0,0 @@ -((function normalize - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float sign (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) -)) diff --git a/src/glsl/builtins/ir/normalize.ir b/src/glsl/builtins/ir/normalize.ir new file mode 100644 index 00000000000..0de0db0b648 --- /dev/null +++ b/src/glsl/builtins/ir/normalize.ir @@ -0,0 +1,21 @@ +((function normalize + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sign (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) +)) diff --git a/src/glsl/builtins/ir/not b/src/glsl/builtins/ir/not deleted file mode 100644 index b696b06557f..00000000000 --- a/src/glsl/builtins/ir/not +++ /dev/null @@ -1,16 +0,0 @@ -((function not - (signature bvec2 - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bvec2 ! (var_ref arg0))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bvec3 ! (var_ref arg0))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bvec4 ! (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/not.ir b/src/glsl/builtins/ir/not.ir new file mode 100644 index 00000000000..b696b06557f --- /dev/null +++ b/src/glsl/builtins/ir/not.ir @@ -0,0 +1,16 @@ +((function not + (signature bvec2 + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bvec2 ! (var_ref arg0))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bvec3 ! (var_ref arg0))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bvec4 ! (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/notEqual b/src/glsl/builtins/ir/notEqual deleted file mode 100644 index abaf1914c9f..00000000000 --- a/src/glsl/builtins/ir/notEqual +++ /dev/null @@ -1,73 +0,0 @@ -((function notEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) bvec2 arg0) - (declare (in) bvec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0) - (declare (in) bvec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0) - (declare (in) bvec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/notEqual.ir b/src/glsl/builtins/ir/notEqual.ir new file mode 100644 index 00000000000..abaf1914c9f --- /dev/null +++ b/src/glsl/builtins/ir/notEqual.ir @@ -0,0 +1,73 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) bvec2 arg0) + (declare (in) bvec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0) + (declare (in) bvec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0) + (declare (in) bvec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/outerProduct b/src/glsl/builtins/ir/outerProduct deleted file mode 100644 index 0e3f375bbac..00000000000 --- a/src/glsl/builtins/ir/outerProduct +++ /dev/null @@ -1,92 +0,0 @@ -((function outerProduct - (signature mat2 - (parameters - (declare (in) vec2 u) - (declare (in) vec2 v)) - ((declare () mat2 m) - (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat2x3 - (parameters - (declare (in) vec3 u) - (declare (in) vec2 v)) - ((declare () mat2x3 m) - (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat2x4 - (parameters - (declare (in) vec4 u) - (declare (in) vec2 v)) - ((declare () mat2x4 m) - (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat3x2 - (parameters - (declare (in) vec2 u) - (declare (in) vec3 v)) - ((declare () mat3x2 m) - (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)) - )) - - (signature mat3 - (parameters - (declare (in) vec3 u) - (declare (in) vec3 v)) - ((declare () mat3 m) - (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)))) - - (signature mat3x4 - (parameters - (declare (in) vec4 u) - (declare (in) vec3 v)) - ((declare () mat3x4 m) - (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)))) - - (signature mat4x2 - (parameters - (declare (in) vec2 u) - (declare (in) vec4 v)) - ((declare () mat4x2 m) - (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) - - (signature mat4x3 - (parameters - (declare (in) vec3 u) - (declare (in) vec4 v)) - ((declare () mat4x3 m) - (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) - - (signature mat4 - (parameters - (declare (in) vec4 u) - (declare (in) vec4 v)) - ((declare () mat4 m) - (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) -)) diff --git a/src/glsl/builtins/ir/outerProduct.ir b/src/glsl/builtins/ir/outerProduct.ir new file mode 100644 index 00000000000..0e3f375bbac --- /dev/null +++ b/src/glsl/builtins/ir/outerProduct.ir @@ -0,0 +1,92 @@ +((function outerProduct + (signature mat2 + (parameters + (declare (in) vec2 u) + (declare (in) vec2 v)) + ((declare () mat2 m) + (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat2x3 + (parameters + (declare (in) vec3 u) + (declare (in) vec2 v)) + ((declare () mat2x3 m) + (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat2x4 + (parameters + (declare (in) vec4 u) + (declare (in) vec2 v)) + ((declare () mat2x4 m) + (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat3x2 + (parameters + (declare (in) vec2 u) + (declare (in) vec3 v)) + ((declare () mat3x2 m) + (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)) + )) + + (signature mat3 + (parameters + (declare (in) vec3 u) + (declare (in) vec3 v)) + ((declare () mat3 m) + (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) + + (signature mat3x4 + (parameters + (declare (in) vec4 u) + (declare (in) vec3 v)) + ((declare () mat3x4 m) + (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) + + (signature mat4x2 + (parameters + (declare (in) vec2 u) + (declare (in) vec4 v)) + ((declare () mat4x2 m) + (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (assign (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) + + (signature mat4x3 + (parameters + (declare (in) vec3 u) + (declare (in) vec4 v)) + ((declare () mat4x3 m) + (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (assign (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) + + (signature mat4 + (parameters + (declare (in) vec4 u) + (declare (in) vec4 v)) + ((declare () mat4 m) + (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (assign (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) +)) diff --git a/src/glsl/builtins/ir/pow b/src/glsl/builtins/ir/pow deleted file mode 100644 index a61bc4418e3..00000000000 --- a/src/glsl/builtins/ir/pow +++ /dev/null @@ -1,25 +0,0 @@ -((function pow - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float pow (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) -)) diff --git a/src/glsl/builtins/ir/pow.ir b/src/glsl/builtins/ir/pow.ir new file mode 100644 index 00000000000..a61bc4418e3 --- /dev/null +++ b/src/glsl/builtins/ir/pow.ir @@ -0,0 +1,25 @@ +((function pow + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float pow (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) +)) diff --git a/src/glsl/builtins/ir/radians b/src/glsl/builtins/ir/radians deleted file mode 100644 index a419101cf16..00000000000 --- a/src/glsl/builtins/ir/radians +++ /dev/null @@ -1,21 +0,0 @@ -((function radians - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (constant float (0.0174532925)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (constant float (0.0174532925)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (constant float (0.0174532925)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (constant float (0.0174532925)))))) -)) diff --git a/src/glsl/builtins/ir/radians.ir b/src/glsl/builtins/ir/radians.ir new file mode 100644 index 00000000000..a419101cf16 --- /dev/null +++ b/src/glsl/builtins/ir/radians.ir @@ -0,0 +1,21 @@ +((function radians + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (0.0174532925)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (0.0174532925)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (0.0174532925)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (0.0174532925)))))) +)) diff --git a/src/glsl/builtins/ir/reflect b/src/glsl/builtins/ir/reflect deleted file mode 100644 index 1fa394e3c99..00000000000 --- a/src/glsl/builtins/ir/reflect +++ /dev/null @@ -1,58 +0,0 @@ -((function reflect - (signature float - (parameters - (declare (in) float i) - (declare (in) float n)) - ((return (expression float - - (var_ref i) - (expression float * - (constant float (2.0)) - (expression float * - (expression float * - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec2 - (parameters - (declare (in) vec2 i) - (declare (in) vec2 n)) - ((return (expression vec2 - - (var_ref i) - (expression vec2 * - (constant float (2.0)) - (expression vec2 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec3 - (parameters - (declare (in) vec3 i) - (declare (in) vec3 n)) - ((return (expression vec3 - - (var_ref i) - (expression vec3 * - (constant float (2.0)) - (expression vec3 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec4 - (parameters - (declare (in) vec4 i) - (declare (in) vec4 n)) - ((return (expression vec4 - - (var_ref i) - (expression vec4 * - (constant float (2.0)) - (expression vec4 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - -)) diff --git a/src/glsl/builtins/ir/reflect.ir b/src/glsl/builtins/ir/reflect.ir new file mode 100644 index 00000000000..1fa394e3c99 --- /dev/null +++ b/src/glsl/builtins/ir/reflect.ir @@ -0,0 +1,58 @@ +((function reflect + (signature float + (parameters + (declare (in) float i) + (declare (in) float n)) + ((return (expression float - + (var_ref i) + (expression float * + (constant float (2.0)) + (expression float * + (expression float * + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n)) + ((return (expression vec2 - + (var_ref i) + (expression vec2 * + (constant float (2.0)) + (expression vec2 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n)) + ((return (expression vec3 - + (var_ref i) + (expression vec3 * + (constant float (2.0)) + (expression vec3 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n)) + ((return (expression vec4 - + (var_ref i) + (expression vec4 * + (constant float (2.0)) + (expression vec4 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + +)) diff --git a/src/glsl/builtins/ir/refract b/src/glsl/builtins/ir/refract deleted file mode 100644 index 60899f01cec..00000000000 --- a/src/glsl/builtins/ir/refract +++ /dev/null @@ -1,102 +0,0 @@ -((function refract - (signature float - (parameters - (declare (in) float i) - (declare (in) float n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float * (var_ref n) (var_ref i)) - (expression float * (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant float (0.0)))) - ((return (expression float - - (expression float * (var_ref eta) (var_ref i)) - (expression float * - (expression float + - (expression float * (var_ref eta) - (expression float * (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 i) - (declare (in) vec2 n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec2 (0.0 0.0)))) - ((return (expression vec2 - - (expression vec2 * (var_ref eta) (var_ref i)) - (expression vec2 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 i) - (declare (in) vec3 n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec3 (0.0 0.0 0.0)))) - ((return (expression vec3 - - (expression vec3 * (var_ref eta) (var_ref i)) - (expression vec3 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 i) - (declare (in) vec4 n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec4 (0.0 0.0 0.0 0.0)))) - ((return (expression vec4 - - (expression vec4 * (var_ref eta) (var_ref i)) - (expression vec4 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - -)) diff --git a/src/glsl/builtins/ir/refract.ir b/src/glsl/builtins/ir/refract.ir new file mode 100644 index 00000000000..60899f01cec --- /dev/null +++ b/src/glsl/builtins/ir/refract.ir @@ -0,0 +1,102 @@ +((function refract + (signature float + (parameters + (declare (in) float i) + (declare (in) float n) + (declare (in) float eta)) + ((declare () float k) + (assign (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float * (var_ref n) (var_ref i)) + (expression float * (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant float (0.0)))) + ((return (expression float - + (expression float * (var_ref eta) (var_ref i)) + (expression float * + (expression float + + (expression float * (var_ref eta) + (expression float * (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n) + (declare (in) float eta)) + ((declare () float k) + (assign (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec2 (0.0 0.0)))) + ((return (expression vec2 - + (expression vec2 * (var_ref eta) (var_ref i)) + (expression vec2 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n) + (declare (in) float eta)) + ((declare () float k) + (assign (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec3 (0.0 0.0 0.0)))) + ((return (expression vec3 - + (expression vec3 * (var_ref eta) (var_ref i)) + (expression vec3 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n) + (declare (in) float eta)) + ((declare () float k) + (assign (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec4 (0.0 0.0 0.0 0.0)))) + ((return (expression vec4 - + (expression vec4 * (var_ref eta) (var_ref i)) + (expression vec4 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + +)) diff --git a/src/glsl/builtins/ir/round b/src/glsl/builtins/ir/round deleted file mode 100644 index d0d425bd656..00000000000 --- a/src/glsl/builtins/ir/round +++ /dev/null @@ -1,21 +0,0 @@ -((function round - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float round_even (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 round_even (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 round_even (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 round_even (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/round.ir b/src/glsl/builtins/ir/round.ir new file mode 100644 index 00000000000..d0d425bd656 --- /dev/null +++ b/src/glsl/builtins/ir/round.ir @@ -0,0 +1,21 @@ +((function round + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float round_even (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 round_even (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 round_even (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 round_even (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/roundEven b/src/glsl/builtins/ir/roundEven deleted file mode 100644 index a9c99b6f44c..00000000000 --- a/src/glsl/builtins/ir/roundEven +++ /dev/null @@ -1,21 +0,0 @@ -((function roundEven - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float round_even (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 round_even (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 round_even (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 round_even (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/roundEven.ir b/src/glsl/builtins/ir/roundEven.ir new file mode 100644 index 00000000000..a9c99b6f44c --- /dev/null +++ b/src/glsl/builtins/ir/roundEven.ir @@ -0,0 +1,21 @@ +((function roundEven + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float round_even (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 round_even (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 round_even (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 round_even (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/sign b/src/glsl/builtins/ir/sign deleted file mode 100644 index 1f51718dab1..00000000000 --- a/src/glsl/builtins/ir/sign +++ /dev/null @@ -1,42 +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))))) - - (signature int - (parameters - (declare (in) int x)) - ((return (expression int sign (var_ref x))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 x)) - ((return (expression ivec2 sign (var_ref x))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 x)) - ((return (expression ivec3 sign (var_ref x))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 x)) - ((return (expression ivec4 sign (var_ref x))))) -)) - diff --git a/src/glsl/builtins/ir/sign.ir b/src/glsl/builtins/ir/sign.ir new file mode 100644 index 00000000000..1f51718dab1 --- /dev/null +++ b/src/glsl/builtins/ir/sign.ir @@ -0,0 +1,42 @@ +((function sign + (signature float + (parameters + (declare (in) float x)) + ((return (expression float sign (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 sign (var_ref x))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 sign (var_ref x))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 sign (var_ref x))))) + + (signature int + (parameters + (declare (in) int x)) + ((return (expression int sign (var_ref x))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 x)) + ((return (expression ivec2 sign (var_ref x))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 x)) + ((return (expression ivec3 sign (var_ref x))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 x)) + ((return (expression ivec4 sign (var_ref x))))) +)) + diff --git a/src/glsl/builtins/ir/sin b/src/glsl/builtins/ir/sin deleted file mode 100644 index e6009d8ef12..00000000000 --- a/src/glsl/builtins/ir/sin +++ /dev/null @@ -1,21 +0,0 @@ -((function sin - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float sin (var_ref angle))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 sin (var_ref angle))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 sin (var_ref angle))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 sin (var_ref angle))))) -)) diff --git a/src/glsl/builtins/ir/sin.ir b/src/glsl/builtins/ir/sin.ir new file mode 100644 index 00000000000..e6009d8ef12 --- /dev/null +++ b/src/glsl/builtins/ir/sin.ir @@ -0,0 +1,21 @@ +((function sin + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float sin (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 sin (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 sin (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 sin (var_ref angle))))) +)) diff --git a/src/glsl/builtins/ir/sinh b/src/glsl/builtins/ir/sinh deleted file mode 100644 index 31edd30e5ec..00000000000 --- a/src/glsl/builtins/ir/sinh +++ /dev/null @@ -1,30 +0,0 @@ -((function sinh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float - - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant float (0.5)) - (expression vec2 - - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant float (0.5)) - (expression vec3 - - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant float (0.5)) - (expression vec4 - - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/ir/sinh.ir b/src/glsl/builtins/ir/sinh.ir new file mode 100644 index 00000000000..31edd30e5ec --- /dev/null +++ b/src/glsl/builtins/ir/sinh.ir @@ -0,0 +1,30 @@ +((function sinh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant float (0.5)) + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant float (0.5)) + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant float (0.5)) + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/smoothstep b/src/glsl/builtins/ir/smoothstep deleted file mode 100644 index 94c98b29e53..00000000000 --- a/src/glsl/builtins/ir/smoothstep +++ /dev/null @@ -1,100 +0,0 @@ -((function smoothstep - (signature float - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) float x)) - ((declare () float t) - (assign (x) (var_ref t) - (expression float max - (expression float min - (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t)))))))) - (signature vec2 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (xy) (var_ref t) - (expression vec2 max - (expression vec2 min - (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec3 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (xyz) (var_ref t) - (expression vec3 max - (expression vec3 min - (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t)))))))) - - - (signature vec4 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (xyzw) (var_ref t) - (expression vec4 max - (expression vec4 min - (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 edge0) - (declare (in) vec2 edge1) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (xy) (var_ref t) - (expression vec2 max - (expression vec2 min - (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 edge0) - (declare (in) vec3 edge1) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (xyz) (var_ref t) - (expression vec3 max - (expression vec3 min - (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 edge0) - (declare (in) vec4 edge1) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (xyzw) (var_ref t) - (expression vec4 max - (expression vec4 min - (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t)))))))) -)) - diff --git a/src/glsl/builtins/ir/smoothstep.ir b/src/glsl/builtins/ir/smoothstep.ir new file mode 100644 index 00000000000..94c98b29e53 --- /dev/null +++ b/src/glsl/builtins/ir/smoothstep.ir @@ -0,0 +1,100 @@ +((function smoothstep + (signature float + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) float x)) + ((declare () float t) + (assign (x) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t)))))))) + (signature vec2 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (xy) (var_ref t) + (expression vec2 max + (expression vec2 min + (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t)))))))) + + (signature vec3 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (xyz) (var_ref t) + (expression vec3 max + (expression vec3 min + (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t)))))))) + + + (signature vec4 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (xyzw) (var_ref t) + (expression vec4 max + (expression vec4 min + (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t)))))))) + + (signature vec2 + (parameters + (declare (in) vec2 edge0) + (declare (in) vec2 edge1) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (xy) (var_ref t) + (expression vec2 max + (expression vec2 min + (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t)))))))) + + (signature vec3 + (parameters + (declare (in) vec3 edge0) + (declare (in) vec3 edge1) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (xyz) (var_ref t) + (expression vec3 max + (expression vec3 min + (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t)))))))) + + (signature vec4 + (parameters + (declare (in) vec4 edge0) + (declare (in) vec4 edge1) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (xyzw) (var_ref t) + (expression vec4 max + (expression vec4 min + (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t)))))))) +)) + diff --git a/src/glsl/builtins/ir/sqrt b/src/glsl/builtins/ir/sqrt deleted file mode 100644 index 0302d164ae5..00000000000 --- a/src/glsl/builtins/ir/sqrt +++ /dev/null @@ -1,21 +0,0 @@ -((function sqrt - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float sqrt (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 sqrt (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 sqrt (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 sqrt (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/sqrt.ir b/src/glsl/builtins/ir/sqrt.ir new file mode 100644 index 00000000000..0302d164ae5 --- /dev/null +++ b/src/glsl/builtins/ir/sqrt.ir @@ -0,0 +1,21 @@ +((function sqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 sqrt (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 sqrt (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 sqrt (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/ir/step b/src/glsl/builtins/ir/step deleted file mode 100644 index efcd7bc8023..00000000000 --- a/src/glsl/builtins/ir/step +++ /dev/null @@ -1,68 +0,0 @@ -((function step - (signature float - (parameters - (declare (in) float edge) - (declare (in) float x)) - ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) - - (signature vec2 - (parameters - (declare (in) float edge) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec3 - (parameters - (declare (in) float edge) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec4 - (parameters - (declare (in) float edge) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) - (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec2 - (parameters - (declare (in) vec2 edge) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (return (var_ref t)))) - - (signature vec3 - (parameters - (declare (in) vec3 edge) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) - (return (var_ref t)))) - - (signature vec4 - (parameters - (declare (in) vec4 edge) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) - (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) - (return (var_ref t)))) -)) - diff --git a/src/glsl/builtins/ir/step.ir b/src/glsl/builtins/ir/step.ir new file mode 100644 index 00000000000..efcd7bc8023 --- /dev/null +++ b/src/glsl/builtins/ir/step.ir @@ -0,0 +1,68 @@ +((function step + (signature float + (parameters + (declare (in) float edge) + (declare (in) float x)) + ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) + + (signature vec2 + (parameters + (declare (in) float edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) float edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) float edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec2 + (parameters + (declare (in) vec2 edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) vec3 edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) vec4 edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) + (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) + (return (var_ref t)))) +)) + diff --git a/src/glsl/builtins/ir/tan b/src/glsl/builtins/ir/tan deleted file mode 100644 index 99798631859..00000000000 --- a/src/glsl/builtins/ir/tan +++ /dev/null @@ -1,21 +0,0 @@ -((function tan - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) -)) diff --git a/src/glsl/builtins/ir/tan.ir b/src/glsl/builtins/ir/tan.ir new file mode 100644 index 00000000000..99798631859 --- /dev/null +++ b/src/glsl/builtins/ir/tan.ir @@ -0,0 +1,21 @@ +((function tan + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) +)) diff --git a/src/glsl/builtins/ir/tanh b/src/glsl/builtins/ir/tanh deleted file mode 100644 index 3b7271bf779..00000000000 --- a/src/glsl/builtins/ir/tanh +++ /dev/null @@ -1,42 +0,0 @@ -((function tanh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float / - (expression float - - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))) - (expression float + - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 / - (expression vec2 - - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))) - (expression vec2 + - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 / - (expression vec3 - - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))) - (expression vec3 + - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 / - (expression vec4 - - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))) - (expression vec4 + - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/src/glsl/builtins/ir/tanh.ir b/src/glsl/builtins/ir/tanh.ir new file mode 100644 index 00000000000..3b7271bf779 --- /dev/null +++ b/src/glsl/builtins/ir/tanh.ir @@ -0,0 +1,42 @@ +((function tanh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float / + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 / + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 / + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 / + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) diff --git a/src/glsl/builtins/ir/transpose b/src/glsl/builtins/ir/transpose deleted file mode 100644 index 043327d235b..00000000000 --- a/src/glsl/builtins/ir/transpose +++ /dev/null @@ -1,139 +0,0 @@ -((function transpose - (signature mat2 - (parameters - (declare (in) mat2 m)) - ((declare () mat2 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat3x2 - (parameters - (declare (in) mat2x3 m)) - ((declare () mat3x2 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat4x2 - (parameters - (declare (in) mat2x4 m)) - ((declare () mat4x2 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat2x3 - (parameters - (declare (in) mat3x2 m)) - ((declare () mat2x3 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat3 - (parameters - (declare (in) mat3 m)) - ((declare () mat3 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat4x3 - (parameters - (declare (in) mat3x4 m)) - ((declare () mat4x3 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat2x4 - (parameters - (declare (in) mat4x2 m)) - ((declare () mat2x4 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) - - (signature mat3x4 - (parameters - (declare (in) mat4x3 m)) - ((declare () mat3x4 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) - - (signature mat4 - (parameters - (declare (in) mat4 m)) - ((declare () mat4 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) - (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) -) - -) - diff --git a/src/glsl/builtins/ir/transpose.ir b/src/glsl/builtins/ir/transpose.ir new file mode 100644 index 00000000000..043327d235b --- /dev/null +++ b/src/glsl/builtins/ir/transpose.ir @@ -0,0 +1,139 @@ +((function transpose + (signature mat2 + (parameters + (declare (in) mat2 m)) + ((declare () mat2 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat3x2 + (parameters + (declare (in) mat2x3 m)) + ((declare () mat3x2 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat4x2 + (parameters + (declare (in) mat2x4 m)) + ((declare () mat4x2 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat2x3 + (parameters + (declare (in) mat3x2 m)) + ((declare () mat2x3 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat3 + (parameters + (declare (in) mat3 m)) + ((declare () mat3 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat4x3 + (parameters + (declare (in) mat3x4 m)) + ((declare () mat4x3 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat2x4 + (parameters + (declare (in) mat4x2 m)) + ((declare () mat2x4 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat3x4 + (parameters + (declare (in) mat4x3 m)) + ((declare () mat3x4 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat4 + (parameters + (declare (in) mat4 m)) + ((declare () mat4 t) + (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) + (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) + (assign (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) +) + +) + diff --git a/src/glsl/builtins/ir/trunc b/src/glsl/builtins/ir/trunc deleted file mode 100644 index d320a2a7722..00000000000 --- a/src/glsl/builtins/ir/trunc +++ /dev/null @@ -1,21 +0,0 @@ -((function trunc - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float trunc (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 trunc (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 trunc (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 trunc (var_ref arg0))))) -)) diff --git a/src/glsl/builtins/ir/trunc.ir b/src/glsl/builtins/ir/trunc.ir new file mode 100644 index 00000000000..d320a2a7722 --- /dev/null +++ b/src/glsl/builtins/ir/trunc.ir @@ -0,0 +1,21 @@ +((function trunc + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float trunc (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 trunc (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 trunc (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 trunc (var_ref arg0))))) +)) diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py index 8ce2b70c500..b8c12bc3659 100755 --- a/src/glsl/builtins/tools/generate_builtins.py +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -24,9 +24,10 @@ compiler = argv[1] # Read the files in builtins/ir/*...add them to the supplied dictionary. def read_ir_files(fs): - for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*')): + for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*.ir')): + function_name = path.basename(filename).split('.')[0] with open(filename) as f: - fs[path.basename(filename)] = f.read() + fs[function_name] = f.read() # Return a dictionary containing all builtin definitions (even generated) def get_builtin_definitions(): @@ -103,8 +104,13 @@ def write_profiles(): write_profile(filename, profile) def get_profile_list(): + profile_files = [] + for extension in ['frag', 'vert']: + path_glob = path.join( + path.join(builtins_dir, 'profiles'), '*.' + extension) + profile_files.extend(glob(path_glob)) profiles = [] - for pfile in sorted(glob(path.join(path.join(builtins_dir, 'profiles'), '*'))): + for pfile in sorted(profile_files): profiles.append((pfile, path.basename(pfile).replace('.', '_'))) return profiles