diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders')
33 files changed, 28331 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt new file mode 100644 index 000000000..035e839a8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt @@ -0,0 +1,15 @@ +conditionals.html +constants.html +constant_expressions.html +conversions.html +declarations.html +fragdata.html +functions.html +invalid_texture_functions.html +keywords.html +linkage.html +preprocessor.html +qualification_order.html +reserved_operators.html +scoping.html +swizzles.html diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html new file mode 100644 index 000000000..c80304c55 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'conditionals'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test new file mode 100644 index 000000000..7b5f59114 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test @@ -0,0 +1,333 @@ +group if "If Statements" + + case single_statement + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case compound_statement + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (in0 >= 1.0) + { + out0 = 1.0; + out1 = 0.0; + } + ${OUTPUT} + } + "" + end + + case sequence_statements + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (in0 >= 1.0) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case sequence_condition + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (false, in0 >= 1.0) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case complex_condition + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + output float out1 = [ 1.0 | 0.0 | 0.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + out1 = 1.0; + if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0)) + out0 = 1.0, out1 = 0.0; + ${OUTPUT} + } + "" + end + + case if_else + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case if_elseif + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 2.0) + out0 = 2.0; + else if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case if_elseif_else + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 2.0) + out0 = 2.0; + else if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case mixed_if_elseif_else + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 2.0) + { + out0 = 2.0; + } + else if (in0 >= 1.0) + out0 = 2.0, out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + +end # if + +group invalid_if "Invalid If Conditionals" + + case missing_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + if true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + if (true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (5) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_zero_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_one_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (1) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_uniform_condition + expect compile_fail + + both "" + precision mediump float; + precision mediump int; + uniform int u0; + void main() + { + if (u0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (5.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_zero_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (0.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_one_condition + expect compile_fail + both "" + precision mediump float; + void main() + { + if (1.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case sampler_condition + expect compile_fail + both "" + precision mediump float; + uniform sampler2D s0; + void main() + { + if (s0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_if diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html new file mode 100644 index 000000000..db92c09fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'constant_expressions'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test new file mode 100644 index 000000000..355a4432a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test @@ -0,0 +1,288 @@ +group trivial "Trivial expressions" + + case float + values { output float out0 = 5.0; } + both "" + + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 5.0; + out0 = a; + ${OUTPUT} + } + "" + end + + case int + values { output int out0 = 5; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a = 5; + out0 = a; + ${OUTPUT} + } + "" + end + + case bool + values { output bool out0 = true; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const bool a = true; + out0 = a; + ${OUTPUT} + } + "" + end + + case cast + values { output float out0 = 1.0; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = float(int(bool(true))); + out0 = a; + ${OUTPUT} + } + "" + end + +end # trivial + +group operators "Operators" + + case math_float + values { output float out0 = 2.19; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 6.0/3.5 + 1.8*2.6 - 4.2; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_vec + values { output float out0 = 15.0; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const vec3 a = (vec4(1.0, 2.0, 3.0, 4.0).zyx * vec3(1.0, 1.5, 3.0).xyz).xzy + (vec2(5.0)/vec2(2.5)).xxy; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_int + values { output int out0 = 7; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const int a = 5-1 + 2*3 - 9/3; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_ivec + values { output int out0 = 21; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const ivec3 a = ivec2(5-1, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_mat + values { output float out0 = 8.0; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const mat3 a = mat3(3.0) * mat3(4.0); + const mat4 b = mat4(a[1][1])*2.0; + const mat2 c = mat2(b[0][0]) / 3.0; + out0 = c[0][0]+c[1][0]; + ${OUTPUT} + } + "" + end + + case logical + values { output bool out0 = true; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (!false || false) && (true ^^ false); + out0 = a; + ${OUTPUT} + } + "" + end + + case compare + values { output bool out0 = true; } + both "" + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (false == false) && (true != false) && (1 < 2) && (3 <= 3) && ((1 > 1) != (1 >= 1)); + out0 = a; + ${OUTPUT} + } + "" + end + + case selection + values { output float out0 = 5.3; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = false ? 0.0 : (true ? 5.3 : 1.0); + out0 = a; + ${OUTPUT} + } + "" + end + +end # operators + +group complex_types "Arrays, structs & nested calls" + + case struct + values { output float out0 = 260.922; } + both "" + precision highp float; + ${DECLARATIONS} + + struct S + { + vec4 a; + int b; + }; + + void main() + { + const S s = S(vec4(1.5), 123); + out0 = length(s.a.xy)*float(s.b); + ${OUTPUT} + } + "" + end + + case nested_struct + values { output float out0 = 965.9; } + both "" + precision highp float; + ${DECLARATIONS} + + struct S + { + vec4 v; + int i; + }; + + struct T + { + S s; + bool b; + int i; + }; + + struct U + { + S s; + T t; + }; + + void main() + { + const S s = S(vec4(1.5), 123); + const T t = T(s, false, 3); + const U u = U(s, t); + const U v = U(S(vec4(1.3), 4), T(S(vec4(2.0), 5), true, 6)); + out0 = float(u.s.i*v.t.i + v.t.s.i)*v.s.v.x; // float(123*6 + 5)*1.3 + ${OUTPUT} + } + "" + end + + case array + values + { + input float in0 = [ 0.0 | 1.0]; + output float out0 = [0.0 | 1.0]; + } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + float a[int(max(-1.0, 2.0))]; + a[0] = -1.0; + a[1] = in0; + out0 = a[int(min(1.0, 2.0))]; + ${OUTPUT} + } + "" + end + + case nested_builtin_funcs + values { output float out0 = 3.05; } + both "" + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = sqrt( atan(sin(1.5)/cos(1.5)) /*1.5*/ * log2(exp2(log(exp(6.2) + 0.1)) + 0.1) /*~6.2*/); + out0 = a; + ${OUTPUT} + } + "" + end + +end # complex_types diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html new file mode 100644 index 000000000..d0c7c8662 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'constants'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test new file mode 100644 index 000000000..c3887e708 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test @@ -0,0 +1,662 @@ +case float_input + values + { + input float in0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + } + values + { + input float in0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ]; + output float out0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ]; + } + + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = in0; + ${OUTPUT} + } + "" +end + +case float_uniform + values + { + uniform float uni0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ]; + } + + both "" + precision highp float; + ${DECLARATIONS} + uniform float uni0; + void main() + { + out0 = uni0; + ${OUTPUT} + } + "" +end + +case float_0 + values { output float out0 = 1.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = +1.123; + ${OUTPUT} + } + "" +end + +case float_1 + values { output float out0 = -1.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.123; + ${OUTPUT} + } + "" +end + +case float_2 + values { output float out0 = 123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123.; + ${OUTPUT} + } + "" +end + +case float_3 + values { output float out0 = 0.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = .123; + ${OUTPUT} + } + "" +end + +case float_4 + values { output float out0 = 123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e+2; + ${OUTPUT} + } + "" +end + +case float_5 + values { output float out0 = -123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23E+2; + ${OUTPUT} + } + "" +end + +case float_6 + values { output float out0 = -123.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23e2; + ${OUTPUT} + } + "" +end + +case float_7 + values { output float out0 = 0.123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e-1; + ${OUTPUT} + } + "" +end + +case float_8 + values { output float out0 = 1000.0; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1e3; + ${OUTPUT} + } + "" +end + +case int_0 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123; + ${OUTPUT} + } + "" +end + +case int_1 + values { output int out0 = -321; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -321; + ${OUTPUT} + } + "" +end + +case int_2 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0x7B; + ${OUTPUT} + } + "" +end + +case int_3 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0X7b; + ${OUTPUT} + } + "" +end + +case int_4 + values { output int out0 = 123; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0173; + ${OUTPUT} + } + "" +end + +case bool_0 + values { output bool out0 = true; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = true; + ${OUTPUT} + } + "" +end + +case bool_1 + values { output bool out0 = false; } + both "" + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = false; + ${OUTPUT} + } + "" +end + +case const_float_global + values { output float out0 = 1000.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 1000.0; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_main + values { output float out0 = -1000.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = -1000.0; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_function + values { output float out0 = -0.012; } + + both "" + precision mediump float; + ${DECLARATIONS} + float func() + { + const float theConstant = -0.012; + return theConstant; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_scope + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_1 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = 100.0; + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_2 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_3 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_4 + values { output float out0 = 2.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = 100.0; + float func() + { + const float theConstant = 2.0; + return theConstant; + } + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = func(); + } + ${OUTPUT} + } + "" +end + +case const_float_operations_with_const + values { output float out0 = 21.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theGlobalConstant = 10.0; + float func() + { + const float theConstant = 2.0; + return theConstant; + } + void main() + { + const float theConstant = -100.0; + { + const float theConstant = 1.0; + out0 = func() * theGlobalConstant + theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_1 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_2 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_3 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + void main() + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_4 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + float func() + { + const float theConstant2 = theConstant1; + return theConstant2; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_assign_uniform + expect compile_fail + values { output float out0 = 10.0; } + both "" + precision mediump float; + ${DECLARATIONS} + uniform float theUniform; + void main() + { + const float theConstant = theUniform; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_varying + expect compile_fail + values { output float out0 = 10.0; } + vertex "" + ${VERTEX_DECLARATIONS} + varying float theVarying; + void main() + { + theVarying = 1.0; + gl_Position = vec(1.0); + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float theVarying; + void main() + { + const float theConstant = theVarying; + out0 = theConstant; + ${FRAGMENT_OUTPUT} + } + "" +end + +case const_float_function_gotcha + desc "Function constant parameters are not really constants, so using them as constant expressions should fail." + expect compile_fail + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + float func(const float gotcha) + { + const float theConstant2 = gotcha; + return theConstant2*2.0; + } + void main() + { + const float theConstant = 10.0; + out0 = func(theConstant); + ${OUTPUT} + } + "" +end + +case const_float_from_int + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = float(10); + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec2 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec2(1.0, 10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec3 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec3(1.0, 10.0, 20.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec4 + values { output float out0 = 10.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec4(1.0, 10.0, 20.0, -10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_1 + expect compile_fail + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_2 + expect compile_fail + values { output float out0 = 50.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + theVariable += 30.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_user_func + expect compile_fail + values { output float out0 = 50.0; } + both "" + precision mediump float; + ${DECLARATIONS} + float func() + { + return 50.0; + } + void main() + { + const float theConstant = func(); + out0 = theConstant; + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html new file mode 100644 index 000000000..40aa8c862 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'conversions'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test new file mode 100644 index 000000000..51dd9c237 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test @@ -0,0 +1,5930 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group scalar_to_scalar "Scalar to Scalar Conversions" + + case float_to_float + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case float_to_int + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case float_to_bool + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bool out0 = [ false | true | true | true | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case int_to_float + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case int_to_int + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case int_to_bool + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bool out0 = [ false | true | true | true | true | true | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bool_to_float + values + { + input bool in0 = [ true | false ]; + output float out0 = [ 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bool_to_int + values + { + input bool in0 = [ true | false ]; + output int out0 = [ 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_scalar +group scalar_to_vector "Scalar to Vector Conversions" + + case float_to_vec2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec2 + values + { + input bool in0 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec3 + values + { + input bool in0 = [ true | false ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec4 + values + { + input bool in0 = [ true | false ]; + output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec2 + values + { + input bool in0 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec3 + values + { + input bool in0 = [ true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec4 + values + { + input bool in0 = [ true | false ]; + output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec2 + values + { + input bool in0 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec3 + values + { + input bool in0 = [ true | false ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec4 + values + { + input bool in0 = [ true | false ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_vector +group vector_to_scalar "Vector to Scalar Conversions" + + case vec2_to_float + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_int + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bool + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_float + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_int + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bool + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_float + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_int + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bool + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bool out0 = [ false | true | true | true | true ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_float + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_int + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bool + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_float + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_int + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bool + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_float + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_int + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bool + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_float + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_int + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bool + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_float + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_int + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bool + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_float + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_int + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output int out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bool + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_scalar +group vector_illegal "Illegal Vector Conversions" + + case vec2_to_vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + +end # vector_illegal +group vector_to_vector "Vector to Vector Conversions" + + case vec4_to_vec4 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec3 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec2 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec4 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec3 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec2 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec4 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec3 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec2 + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec3 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec2 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec3 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec2 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec3 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec2 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec4 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec3 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec2 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec4 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec3 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec2 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec4 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec3 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec2 + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec3 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec3 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec3 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec3 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec2 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec3 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec2 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec3 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec2 + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec3 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec2 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec3 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec2 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec3 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec2 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec2 + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec2 + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec2 + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_vector +group scalar_to_matrix "Scalar to Matrix Conversions" + + case float_to_mat4 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2 + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2 + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4 + values + { + input bool in0 = [ true | false ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3 + values + { + input bool in0 = [ true | false ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2 + values + { + input bool in0 = [ true | false ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_matrix +group matrix_to_matrix "Matrix to Matrix Conversions" + + case mat4_to_mat4 + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3 + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2 + values + { + input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4 + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.03125, 0.0625, 0.0, -0.75, 0.015625, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3 + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2 + values + { + input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.03125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4 + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3 + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2 + values + { + input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + +end # matrix_to_matrix +group vector_combine "Vector Combine Constructors" + + case vec2_vec2_to_vec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_ivec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_bvec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_vec4 + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_ivec4 + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_bvec4 + values + { + input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_vec4 + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_ivec4 + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_bvec4 + values + { + input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ]; + input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ]; + input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ]; + input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_vec4 + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_ivec4 + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_bvec4 + values + { + input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ]; + input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ]; + input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ]; + input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_vec4 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output vec4 out0 = [ vec4(1.0, 0.0, 1.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_ivec4 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output ivec4 out0 = [ ivec4(1, 0, 1, 0) | ivec4(0, 1, 0, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_bvec4 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(false, true, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_vec4 + values + { + input bool in0 = [ true | true | true | false | false | false | true | false | true | false ]; + input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ]; + input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ]; + input bool in3 = [ true | true | false | false | true | false | false | false | true | true ]; + output vec4 out0 = [ vec4(1.0, 1.0, -192.0, 1.0) | vec4(1.0, 2.0, -12.0, 1.0) | vec4(1.0, 1.0, 2.0, 0.0) | vec4(0.0, 0.0, -66.0, 0.0) | vec4(0.0, 36.8125, 255.0, 1.0) | vec4(0.0, -8.25, 8.0, 0.0) | vec4(1.0, -0.5, 0.0, 0.0) | vec4(0.0, 3.5, 5.0, 0.0) | vec4(1.0, -20.125, 11.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_ivec4 + values + { + input bool in0 = [ true | true | true | false | false | false | true | false | true | false ]; + input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ]; + input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ]; + input bool in3 = [ true | true | false | false | true | false | false | false | true | true ]; + output ivec4 out0 = [ ivec4(1, 1, -192, 1) | ivec4(1, 2, -12, 1) | ivec4(1, 1, 2, 0) | ivec4(0, 0, -66, 0) | ivec4(0, 36, 255, 1) | ivec4(0, -8, 8, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 3, 5, 0) | ivec4(1, -20, 11, 1) | ivec4(0, 0, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_bvec4 + values + { + input bool in0 = [ true | true | true | false | false | false | true | false | true | false ]; + input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ]; + input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ]; + input bool in3 = [ true | true | false | false | true | false | false | false | true | true ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(false, false, true, false) | bvec4(false, true, true, true) | bvec4(false, true, true, false) | bvec4(true, true, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_vec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ]; + output vec4 out0 = [ vec4(-0.5, -2.25, 0.0, 0.0) | vec4(0.0, 0.5, 0.0, -2.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_ivec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ]; + output ivec4 out0 = [ ivec4(0, -2, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_bvec4 + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, true, false, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_vec4 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ]; + output vec4 out0 = [ vec4(-32.0, 64.0, 0.0, 0.0) | vec4(-0.5, -2.25, 1.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(0.0, 0.5, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_ivec4 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ]; + output ivec4 out0 = [ ivec4(-32, 64, 0, 0) | ivec4(0, -2, 1, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_bvec4 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_vec4 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ]; + input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, -20.125) | vec4(0.0, 0.0, 0.0, 2.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 1.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 36.8125) | vec4(1.0, 1.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_ivec4 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ]; + input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ]; + output ivec4 out0 = [ ivec4(1, 0, 0, -8) | ivec4(0, 0, 0, -20) | ivec4(0, 0, 0, 2) | ivec4(0, 0, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 3) | ivec4(0, 1, 0, 36) | ivec4(1, 1, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_bvec4 + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ]; + input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_vec4 + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ]; + output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, 36.8125) | vec4(0.0, 0.5, 0.75, 3.5) | vec4(1.0, 1.25, 1.125, 1.0) | vec4(-0.5, -2.25, -4.875, -0.5) | vec4(-32.0, 64.0, -51.0, -8.25) | vec4(1.0, 1.25, 1.125, -20.125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_ivec4 + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, 36) | ivec4(0, 0, 0, 3) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 0) | ivec4(-32, 64, -51, -8) | ivec4(1, 1, 1, -20) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_bvec4 + values + { + input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_vec4 + values + { + input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ]; + input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ]; + output vec4 out0 = [ vec4(-66.0, 0.0, 0.0, 8.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(-192.0, -32.0, 64.0, 11.0) | vec4(255.0, -32.0, 64.0, -192.0) | vec4(5.0, 1.0, 1.0, 255.0) | vec4(-12.0, 0.0, 0.0, -12.0) | vec4(0.0, 1.0, 1.0, 0.0) | vec4(2.0, 0.0, -2.0, -66.0) | vec4(1.0, 0.0, -2.0, 1.0) | vec4(11.0, 0.0, 0.0, 5.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_ivec4 + values + { + input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ]; + input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ]; + output ivec4 out0 = [ ivec4(-66, 0, 0, 8) | ivec4(8, 0, 0, 2) | ivec4(-192, -32, 64, 11) | ivec4(255, -32, 64, -192) | ivec4(5, 1, 1, 255) | ivec4(-12, 0, 0, -12) | ivec4(0, 1, 1, 0) | ivec4(2, 0, -2, -66) | ivec4(1, 0, -2, 1) | ivec4(11, 0, 0, 5) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_bvec4 + values + { + input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ]; + input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, true, false) | bvec4(true, false, true, true) | bvec4(true, false, true, true) | bvec4(true, false, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_vec4 + values + { + input bool in0 = [ true | true | true | true | false | false | false | false ]; + input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + output vec4 out0 = [ vec4(1.0, 2.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(1.0, 3.5, -32.0, 64.0) | vec4(1.0, -8.25, 1.0, 1.0) | vec4(0.0, 36.8125, 0.0, -2.0) | vec4(0.0, -20.125, 0.0, -2.0) | vec4(0.0, 1.0, 1.0, 1.0) | vec4(0.0, -0.5, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_ivec4 + values + { + input bool in0 = [ true | true | true | true | false | false | false | false ]; + input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(1, 2, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(1, 3, -32, 64) | ivec4(1, -8, 1, 1) | ivec4(0, 36, 0, -2) | ivec4(0, -20, 0, -2) | ivec4(0, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_bvec4 + values + { + input bool in0 = [ true | true | true | true | false | false | false | false ]; + input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(false, true, true, true) | bvec4(false, true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_vec3 + values + { + input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ]; + input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ]; + input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ]; + output vec3 out0 = [ vec3(3.5, -0.5, 0.0) | vec3(2.0, 1.0, 1.0) | vec3(-20.125, 2.0, 3.5) | vec3(-8.25, -20.125, -8.25) | vec3(36.8125, 0.0, -0.5) | vec3(1.0, -8.25, 36.8125) | vec3(0.0, 36.8125, -20.125) | vec3(-0.5, 3.5, 2.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_ivec3 + values + { + input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ]; + input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ]; + input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ]; + output ivec3 out0 = [ ivec3(3, 0, 0) | ivec3(2, 1, 1) | ivec3(-20, 2, 3) | ivec3(-8, -20, -8) | ivec3(36, 0, 0) | ivec3(1, -8, 36) | ivec3(0, 36, -20) | ivec3(0, 3, 2) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_bvec3 + values + { + input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ]; + input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ]; + input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ]; + output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_vec3 + values + { + input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ]; + input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ]; + input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ]; + output vec3 out0 = [ vec3(0.0, 2.0, -192.0) | vec3(2.0, 8.0, -12.0) | vec3(1.0, 11.0, -66.0) | vec3(5.0, -12.0, 8.0) | vec3(255.0, -192.0, 1.0) | vec3(8.0, 1.0, 2.0) | vec3(-66.0, -66.0, 5.0) | vec3(11.0, 5.0, 11.0) | vec3(-12.0, 255.0, 255.0) | vec3(-192.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_ivec3 + values + { + input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ]; + input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ]; + input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ]; + output ivec3 out0 = [ ivec3(0, 2, -192) | ivec3(2, 8, -12) | ivec3(1, 11, -66) | ivec3(5, -12, 8) | ivec3(255, -192, 1) | ivec3(8, 1, 2) | ivec3(-66, -66, 5) | ivec3(11, 5, 11) | ivec3(-12, 255, 255) | ivec3(-192, 0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_bvec3 + values + { + input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ]; + input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ]; + input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ]; + output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_vec3 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_ivec3 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_bvec3 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_vec3 + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | false | true ]; + input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ]; + input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ]; + output vec3 out0 = [ vec3(0.0, 0.0, -12.0) | vec3(1.0, 2.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, -0.5, 5.0) | vec3(0.0, -8.25, -66.0) | vec3(1.0, 3.5, 255.0) | vec3(0.0, -20.125, 11.0) | vec3(1.0, 1.0, 0.0) | vec3(0.0, 0.0, 8.0) | vec3(1.0, 36.8125, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_ivec3 + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | false | true ]; + input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ]; + input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ]; + output ivec3 out0 = [ ivec3(0, 0, -12) | ivec3(1, 2, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, -8, -66) | ivec3(1, 3, 255) | ivec3(0, -20, 11) | ivec3(1, 1, 0) | ivec3(0, 0, 8) | ivec3(1, 36, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_bvec3 + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | false | true ]; + input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ]; + input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, false) | bvec3(false, false, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_vec3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input bool in1 = [ false | true | false | true | true ]; + output vec3 out0 = [ vec3(-0.75, -0.0322580645161, 0.0) | vec3(1.0, 1.25, 1.0) | vec3(-0.5, -2.25, 0.0) | vec3(0.0, 0.5, 1.0) | vec3(-32.0, 64.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_ivec3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input bool in1 = [ false | true | false | true | true ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_bvec3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input bool in1 = [ false | true | false | true | true ]; + output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(false, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_vec3 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ]; + output vec3 out0 = [ vec3(1.0, 0.0, 2.0) | vec3(0.0, 0.0, 36.8125) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 1.0, -20.125) | vec3(0.0, 0.0, 1.0) | vec3(0.0, 1.0, -0.5) | vec3(0.0, 0.0, -8.25) | vec3(1.0, 1.0, 3.5) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_ivec3 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ]; + output ivec3 out0 = [ ivec3(1, 0, 2) | ivec3(0, 0, 36) | ivec3(1, 0, 0) | ivec3(0, 1, -20) | ivec3(0, 0, 1) | ivec3(0, 1, 0) | ivec3(0, 0, -8) | ivec3(1, 1, 3) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_bvec3 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, true) | bvec3(true, false, false) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_vec3 + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ]; + output vec3 out0 = [ vec3(0.0, 1.0, 0.0) | vec3(0.0, 1.0, 255.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 2.0) | vec3(0.0, 0.0, 8.0) | vec3(0.0, 0.0, 11.0) | vec3(1.0, 1.0, -192.0) | vec3(1.0, 0.0, 5.0) | vec3(1.0, 0.0, -12.0) | vec3(0.0, 0.0, -66.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_ivec3 + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ]; + output ivec3 out0 = [ ivec3(0, 1, 0) | ivec3(0, 1, 255) | ivec3(1, 1, 1) | ivec3(0, 0, 2) | ivec3(0, 0, 8) | ivec3(0, 0, 11) | ivec3(1, 1, -192) | ivec3(1, 0, 5) | ivec3(1, 0, -12) | ivec3(0, 0, -66) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_bvec3 + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, false, true) | bvec3(false, false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_vec3 + values + { + input bool in0 = [ false | true | false | true | true ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 0.0, -2.0) | vec3(0.0, 0.0, 0.0) | vec3(1.0, -32.0, 64.0) | vec3(1.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_ivec3 + values + { + input bool in0 = [ false | true | false | true | true ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 0, -2) | ivec3(0, 0, 0) | ivec3(1, -32, 64) | ivec3(1, 1, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_bvec3 + values + { + input bool in0 = [ false | true | false | true | true ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_vec2 + values + { + input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ]; + input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ]; + output vec2 out0 = [ vec2(2.0, 3.5) | vec2(3.5, -20.125) | vec2(-8.25, -0.5) | vec2(-0.5, 2.0) | vec2(0.0, 1.0) | vec2(-20.125, 0.0) | vec2(36.8125, 36.8125) | vec2(1.0, -8.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_ivec2 + values + { + input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ]; + input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ]; + output ivec2 out0 = [ ivec2(2, 3) | ivec2(3, -20) | ivec2(-8, 0) | ivec2(0, 2) | ivec2(0, 1) | ivec2(-20, 0) | ivec2(36, 36) | ivec2(1, -8) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_bvec2 + values + { + input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ]; + input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_vec2 + values + { + input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ]; + input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ]; + output vec2 out0 = [ vec2(8.0, -66.0) | vec2(255.0, 2.0) | vec2(-192.0, 255.0) | vec2(2.0, 8.0) | vec2(0.0, -12.0) | vec2(1.0, 5.0) | vec2(-12.0, -192.0) | vec2(11.0, 0.0) | vec2(-66.0, 1.0) | vec2(5.0, 11.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_ivec2 + values + { + input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ]; + input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ]; + output ivec2 out0 = [ ivec2(8, -66) | ivec2(255, 2) | ivec2(-192, 255) | ivec2(2, 8) | ivec2(0, -12) | ivec2(1, 5) | ivec2(-12, -192) | ivec2(11, 0) | ivec2(-66, 1) | ivec2(5, 11) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_bvec2 + values + { + input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ]; + input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_vec2 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_ivec2 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_bvec2 + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_vec2 + values + { + input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ]; + input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ]; + output vec2 out0 = [ vec2(1.0, -192.0) | vec2(-0.5, -66.0) | vec2(-20.125, 255.0) | vec2(0.0, 1.0) | vec2(3.5, 2.0) | vec2(-8.25, 0.0) | vec2(36.8125, -12.0) | vec2(2.0, 5.0) | vec2(1.0, 11.0) | vec2(0.0, 8.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_ivec2 + values + { + input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ]; + input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ]; + output ivec2 out0 = [ ivec2(1, -192) | ivec2(0, -66) | ivec2(-20, 255) | ivec2(0, 1) | ivec2(3, 2) | ivec2(-8, 0) | ivec2(36, -12) | ivec2(2, 5) | ivec2(1, 11) | ivec2(0, 8) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_bvec2 + values + { + input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ]; + input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_vec2 + values + { + input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ]; + input bool in1 = [ true | false | false | false | true | true | false | true ]; + output vec2 out0 = [ vec2(2.0, 1.0) | vec2(-20.125, 0.0) | vec2(0.0, 0.0) | vec2(1.0, 0.0) | vec2(-8.25, 1.0) | vec2(-0.5, 1.0) | vec2(36.8125, 0.0) | vec2(3.5, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_ivec2 + values + { + input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ]; + input bool in1 = [ true | false | false | false | true | true | false | true ]; + output ivec2 out0 = [ ivec2(2, 1) | ivec2(-20, 0) | ivec2(0, 0) | ivec2(1, 0) | ivec2(-8, 1) | ivec2(0, 1) | ivec2(36, 0) | ivec2(3, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_bvec2 + values + { + input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ]; + input bool in1 = [ true | false | false | false | true | true | false | true ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_vec2 + values + { + input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ]; + input bool in1 = [ true | false | true | false | true | false | false | true | false | true ]; + output vec2 out0 = [ vec2(8.0, 1.0) | vec2(255.0, 0.0) | vec2(11.0, 1.0) | vec2(-66.0, 0.0) | vec2(0.0, 1.0) | vec2(-192.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 1.0) | vec2(5.0, 0.0) | vec2(2.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_ivec2 + values + { + input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ]; + input bool in1 = [ true | false | true | false | true | false | false | true | false | true ]; + output ivec2 out0 = [ ivec2(8, 1) | ivec2(255, 0) | ivec2(11, 1) | ivec2(-66, 0) | ivec2(0, 1) | ivec2(-192, 0) | ivec2(-12, 0) | ivec2(1, 1) | ivec2(5, 0) | ivec2(2, 1) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_bvec2 + values + { + input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ]; + input bool in1 = [ true | false | true | false | true | false | false | true | false | true ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + +end # vector_combine +group matrix_combine "Matrix Combine Constructors" + + case vec2_vec2_to_mat2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) ]; + input vec2 in1 = [ vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ]; + output mat2 out0 = [ mat2(0.0, 0.5, -0.5, -2.25) | mat2(1.0, 1.25, -0.75, -0.0322580645161) | mat2(-32.0, 64.0, -32.0, 64.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.5) | mat2(-0.5, -2.25, 1.0, 1.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_mat2 + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_mat2 + values + { + input float in0 = [ 0.0 | -0.5 | -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | -8.25 ]; + input float in1 = [ -8.25 | 2.0 | -0.5 | -20.125 | 3.5 | 1.0 | 36.8125 | 0.0 ]; + input float in2 = [ 36.8125 | -8.25 | 3.5 | 2.0 | -0.5 | -20.125 | 1.0 | 0.0 ]; + input float in3 = [ 36.8125 | 0.0 | 2.0 | 3.5 | -8.25 | -0.5 | -20.125 | 1.0 ]; + output mat2 out0 = [ mat2(0.0, -8.25, 36.8125, 36.8125) | mat2(-0.5, 2.0, -8.25, 0.0) | mat2(-20.125, -0.5, 3.5, 2.0) | mat2(2.0, -20.125, 2.0, 3.5) | mat2(36.8125, 3.5, -0.5, -8.25) | mat2(1.0, 1.0, -20.125, -0.5) | mat2(3.5, 36.8125, 1.0, -20.125) | mat2(-8.25, 0.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_mat2 + values + { + input int in0 = [ 2 | 0 | -66 | 8 | 1 | 255 | 5 | -12 | 11 | -192 ]; + input int in1 = [ -192 | 2 | 5 | -12 | -66 | 255 | 8 | 1 | 11 | 0 ]; + input int in2 = [ 2 | 11 | -192 | 255 | 1 | 5 | 0 | -12 | 8 | -66 ]; + input int in3 = [ 255 | 0 | 11 | -66 | 2 | 8 | -192 | 1 | -12 | 5 ]; + output mat2 out0 = [ mat2(2.0, -192.0, 2.0, 255.0) | mat2(0.0, 2.0, 11.0, 0.0) | mat2(-66.0, 5.0, -192.0, 11.0) | mat2(8.0, -12.0, 255.0, -66.0) | mat2(1.0, -66.0, 1.0, 2.0) | mat2(255.0, 255.0, 5.0, 8.0) | mat2(5.0, 8.0, 0.0, -192.0) | mat2(-12.0, 1.0, -12.0, 1.0) | mat2(11.0, 11.0, 8.0, -12.0) | mat2(-192.0, 0.0, -66.0, 5.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_mat2 + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output mat2 out0 = [ mat2(0.0, 0.0, 1.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_mat2 + values + { + input bool in0 = [ false | true | true | false | false | true | true | true | false | false ]; + input float in1 = [ -0.5 | -20.125 | 3.5 | 2.0 | 1.0 | 0.0 | 0.0 | 1.0 | 36.8125 | -8.25 ]; + input int in2 = [ -66 | -192 | 5 | 255 | 0 | -12 | 11 | 1 | 2 | 8 ]; + input bool in3 = [ true | false | true | false | false | false | true | false | true | true ]; + output mat2 out0 = [ mat2(0.0, -0.5, -66.0, 1.0) | mat2(1.0, -20.125, -192.0, 0.0) | mat2(1.0, 3.5, 5.0, 1.0) | mat2(0.0, 2.0, 255.0, 0.0) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, -12.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 36.8125, 2.0, 1.0) | mat2(0.0, -8.25, 8.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_mat2 + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output mat2 out0 = [ mat2(0.0, 0.5, -32.0, 64.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, -2.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.0) | mat2(1.0, 1.25, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_mat2 + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) ]; + output mat2 out0 = [ mat2(-32.0, 64.0, 0.0, 1.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(0.0, 0.5, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_mat2 + values + { + input bvec3 in0 = [ bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in1 = [ -20.125 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ]; + output mat2 out0 = [ mat2(0.0, 1.0, 0.0, -20.125) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(0.0, 0.0, 0.0, 3.5) | mat2(1.0, 0.0, 0.0, -8.25) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 2.0) | mat2(0.0, 0.0, 0.0, 36.8125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_mat2 + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ -8.25 | 36.8125 | -0.5 | -20.125 | 1.0 | 2.0 | 0.0 | 3.5 ]; + output mat2 out0 = [ mat2(0.0, 0.5, 0.75, -8.25) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(-0.75, -0.0322580645161, 0.0526315789474, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(0.0, 0.5, 0.75, 1.0) | mat2(-32.0, 64.0, -51.0, 2.0) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 3.5) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_mat2 + values + { + input int in0 = [ -66 | 255 | 8 | 0 | 5 | -12 | 1 | -192 | 2 | 11 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + input int in2 = [ 0 | -12 | 8 | -66 | 11 | 5 | 255 | 2 | 1 | -192 ]; + output mat2 out0 = [ mat2(-66.0, 0.0, -2.0, 0.0) | mat2(255.0, 0.0, 0.0, -12.0) | mat2(8.0, -32.0, 64.0, 8.0) | mat2(0.0, 1.0, 1.0, -66.0) | mat2(5.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, 5.0) | mat2(1.0, -32.0, 64.0, 255.0) | mat2(-192.0, 0.0, -2.0, 2.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(11.0, 1.0, 1.0, -192.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_mat2 + values + { + input bool in0 = [ true | true | true | false | true | false | false | false ]; + input float in1 = [ 0.0 | 1.0 | 2.0 | -0.5 | 3.5 | -20.125 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(1.0, 2.0, 0.0, -2.0) | mat2(0.0, -0.5, 0.0, 0.0) | mat2(1.0, 3.5, -32.0, 64.0) | mat2(0.0, -20.125, 0.0, -2.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, -8.25, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec3_to_mat3 + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ]; + input vec3 in1 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input vec3 in2 = [ vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.5, -2.25, -4.875, -0.5, -2.25, -4.875) | mat3(-0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75) | mat3(-32.0, 64.0, -51.0, 0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.5, 0.75, 1.0, 1.25, 1.125, 1.0, 1.25, 1.125) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec3_to_mat3 + values + { + input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) ]; + output mat3 out0 = [ mat3(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_bool_to_mat3 + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) ]; + input float in2 = [ -20.125 | -8.25 | 3.5 | 1.0 | 1.0 | -0.5 | 2.0 | 0.0 | 36.8125 | 0.0 ]; + input float in3 = [ 0.0 | -0.5 | 1.0 | -20.125 | 36.8125 | 0.0 | -8.25 | 2.0 | 3.5 | 1.0 ]; + input int in4 = [ 2 | 11 | 1 | 0 | 8 | 5 | -66 | 255 | -192 | -12 ]; + input bool in5 = [ false | true | true | false | false | true | false | true | false | true ]; + input bool in6 = [ false | true | false | false | true | true | true | true | false | false ]; + output mat3 out0 = [ mat3(-0.75, -0.0322580645161, -32.0, 64.0, -20.125, 0.0, 2.0, 0.0, 0.0) | mat3(1.0, 1.25, 0.0, -2.0, -8.25, -0.5, 11.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 3.5, 1.0, 1.0, 1.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, -20.125, 0.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 1.0, 36.8125, 8.0, 0.0, 1.0) | mat3(-32.0, 64.0, 0.0, -2.0, -0.5, 0.0, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, -8.25, -66.0, 0.0, 1.0) | mat3(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 255.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 36.8125, 3.5, -192.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0, -12.0, 1.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_float_to_mat3 + values + { + input bool in0 = [ false | false | false | true | false | false | true | true | true | true ]; + input float in1 = [ 3.5 | -20.125 | 36.8125 | 0.0 | 2.0 | -8.25 | 1.0 | -0.5 | 1.0 | 0.0 ]; + input int in2 = [ 255 | -192 | 11 | 0 | 8 | 5 | -66 | 2 | -12 | 1 ]; + input vec2 in3 = [ vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) ]; + input bool in4 = [ true | true | false | false | false | true | false | true | false | true ]; + input bvec2 in5 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ]; + input float in6 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 1.0 | 0.0 | 1.0 | -20.125 | 2.0 ]; + output mat3 out0 = [ mat3(0.0, 3.5, 255.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0) | mat3(0.0, -20.125, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0, 36.8125) | mat3(0.0, 36.8125, 11.0, -0.5, -2.25, 0.0, 1.0, 1.0, 3.5) | mat3(1.0, 0.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0, -0.5) | mat3(0.0, 2.0, 8.0, -0.5, -2.25, 0.0, 1.0, 1.0, -8.25) | mat3(0.0, -8.25, 5.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 1.0) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 1.0, 0.0, 0.0) | mat3(1.0, -0.5, 2.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 1.0, -12.0, -0.75, -0.0322580645161, 0.0, 0.0, 0.0, -20.125) | mat3(1.0, 0.0, 1.0, -32.0, 64.0, 1.0, 0.0, 1.0, 2.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_bool_to_mat3 + values + { + input bool in0 = [ true | false | false | false | false | true | true | true | true | false ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) ]; + input int in2 = [ 2 | -66 | 1 | 8 | -12 | 0 | 5 | 11 | 255 | -192 ]; + input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input bool in4 = [ false | false | true | true | true | false | true | false | false | true ]; + output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, -0.5, -2.25, -4.875, 9.0, 0.0) | mat3(0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(0.0, 0.0, 0.0, 8.0, 1.0, 1.25, 1.125, 1.75, 1.0) | mat3(0.0, 0.0, 0.0, -12.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(1.0, 0.0, 0.0, 5.0, 0.0, 0.5, 0.75, 0.825, 1.0) | mat3(1.0, 1.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 0.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_bool_to_mat3 + values + { + input float in0 = [ -0.5 | 36.8125 | 1.0 | 0.0 | -20.125 | 2.0 | -8.25 | 3.5 ]; + input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + input bool in3 = [ true | false | true | false | true | false | false | true ]; + input bool in4 = [ false | true | false | true | false | false | true | true ]; + output mat3 out0 = [ mat3(-0.5, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0) | mat3(36.8125, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 0.0, 1.0) | mat3(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(-8.25, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(3.5, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, 1.0, 1.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_vec4_to_mat4 + values + { + input vec4 in0 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in1 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) ]; + output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.25, 1.125, 1.75, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4(-0.5, -2.25, -4.875, 9.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_ivec4_to_mat4 + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) ]; + input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + input ivec4 in3 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 1.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bvec4_bvec4_bvec4_bvec4_to_mat4 + values + { + input bvec4 in0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ]; + input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, false) ]; + input bvec4 in2 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ]; + input bvec4 in3 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4 + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ]; + input bvec3 in2 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ]; + input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + input ivec2 in4 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + input float in5 = [ 3.5 | -20.125 | -8.25 | 0.0 | 36.8125 | -0.5 | 1.0 | 2.0 ]; + input vec2 in6 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + output mat4 out0 = [ mat4(-0.5, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, 0.0, 3.5, -32.0, 64.0) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, -2.0, -20.125, 1.0, 1.25) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0, -8.25, -0.75, -0.0322580645161) | mat4(2.0, -32.0, 64.0, -51.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, 0.0, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 36.8125, 1.0, 1.25) | mat4(36.8125, 0.0, -2.0, -4.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, -2.0, -0.5, 0.0, 0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0, 1.0, 0.0, 0.5) | mat4(0.0, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0, 2.0, -0.5, -2.25) ]; + } + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0, in1, in2, in3, in4, in5, in6); + ${OUTPUT} + } + "" + end + + +end # matrix_combine diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html new file mode 100644 index 000000000..f8f9435fb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'declarations'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test new file mode 100644 index 000000000..4dfb0a4a7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test @@ -0,0 +1,140 @@ +group invalid_declarations "Invalid declarations" + case attribute_in_vertex_main + expect compile_fail + vertex "" + void main() + { + attribute mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case attribute_in_fragment + expect compile_fail + vertex "" + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + attribute mediump float val; + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case uniform_in_vertex_main + expect compile_fail + vertex "" + void main() + { + uniform mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case uniform_in_fragment_main + expect compile_fail + vertex "" + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + uniform mediump float val; + gl_FragColor = vec4(1.0); + } + "" + end + + case varying_in_vertex_main + expect compile_fail + vertex "" + void main() + { + varying mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + varying mediump float val; + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case varying_in_fragment_main + expect compile_fail + vertex "" + varying mediump float val; + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + varying mediump float val; + gl_FragColor = vec4(1.0); + } + "" + end + + case invariant_attribute + expect compile_fail + vertex "" + invariant attribute mediump float val; + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case invariant_uniform + expect compile_fail + vertex "" + invariant uniform mediump float val; + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + +end # invalid_declarations diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html new file mode 100644 index 000000000..1e6f7e83a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'fragdata'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test new file mode 100644 index 000000000..f7ba4f295 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test @@ -0,0 +1,76 @@ + +case invalid_assign_to_1 + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + gl_FragData[1] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_simple + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + gl_FragColor = vec4(1.0); + gl_FragData[0] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_static_if + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void main (void) + { + if (false) + gl_FragColor = vec4(1.0); + else + gl_FragData[0] = vec4(1.0); + } + "" +end + +case write_fragcolor_and_fragdata_unused_func + version 100 es + expect compile_fail + vertex "" + void main (void) + { + gl_Position = vec4(1.0); + } + "" + fragment "" + void unused (void) + { + gl_FragData[0] = vec4(1.0); + } + void main (void) + { + gl_FragColor = vec4(1.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html new file mode 100644 index 000000000..f197df89a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'functions'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test new file mode 100644 index 000000000..2161a4c81 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test @@ -0,0 +1,3475 @@ +# Tests todo: +# - inout with varyings, attributes, uniforms (and arrays of 'em) +# - inout with arrays, array elements +# - inout with array elements +# - inout by-value semantics (arrays & elements & structs) + +# Done: +# - control flow: return, return in loop, etc. + +group datatypes "Function Parameter Data Types" + + case float_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec2 + values + { + input vec2 in0 = [ vec2(0.0, 1.0) | vec2(2.0, 2.5) ]; + output float out0 = [ -1.0 | -4.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (vec2 a) + { + return -(a.x + a.y); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec3 + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (vec3 a) + { + return -(a.x + a.y + a.z); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec4 + values + { + input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (vec4 a) + { + return -(a.x + a.y + a.z + a.w); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat2 + values + { + input mat2 in0 = mat2(0.5, -1.0, 0.2, -1.0); + output float out0 = 0.5; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (mat2 a) + { + //return -(a[0][0] + a[0][1] + a[1][0] + a[1][1]); + return a[0][0]; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat3 + values + { + input mat3 in0 = [ mat3(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0) | mat3(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0) ]; + output float out0 = [ -4.5 | -5.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (mat3 a) + { + return -(a[0][0] + a[0][1] + a[0][2] + a[1][0] + a[1][1] + a[1][2] + a[2][0] + a[2][1] + a[2][2]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat4 + values + { + input mat4 in0 = [ mat4(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -2.0, -2.0) | mat4(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0, 0.0, 2.0, -1.0, 1.0, 0.0, -1.0, 3.0) ]; + output float out0 = [ -5.5 | -9.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (mat4 a) + { + return -(a[0][0] + a[0][1] + a[0][2] + a[0][3] + a[1][0] + a[1][1] + a[1][2] + a[1][3] + a[2][0] + a[2][1] + a[2][2] + a[2][3] + a[3][0] + a[3][1] + a[3][2] + a[3][3]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_int + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) + { + return -a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec2 + values + { + input ivec2 in0 = [ ivec2(-1, 0) | ivec2(1, 4) ]; + output int out0 = [ 1 | -5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec2 a) + { + return -(a.x + a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec3 + values + { + input ivec3 in0 = [ ivec3(-1, 0, 2) | ivec3(1, 4, -8) ]; + output int out0 = [ -1 | 3 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec3 a) + { + return -(a.x + a.y + a.z); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec4 + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (ivec4 a) + { + return -(a.x + a.y + a.z + a.w); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) + { + return !a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec2 + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bvec2 a) + { + return !(a.x == a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec3 + values + { + input bvec3 in0 = [ bvec3(true, true, false) | bvec3(true, false, false) ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bvec3 a) + { + return (a.x == a.y) == a.z; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec4 + values + { + input bvec4 in0 = [ bvec4(true, true, true, false) | bvec4(false, false, true, true) | bvec4(true, false, false, true) ]; + output bool out0 = [ false | true | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bvec4 a) + { + return ((a.x == a.y) == (a.z == a.w)); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case mat2 + values + { + input mat2 in0 = [ mat2(-2.0, 0.5, -1.0, 1.0) | mat2(1.0, -3.5, -3.5, 2.5) | mat2(-2.0, -2.0, 3.5, 0.0) ]; + output mat2 out0 = [ mat2(4.0, -1.0, 2.0, -2.0) | mat2(-2.0, 7.0, 7.0, -5.0) | mat2(4.0, 4.0, -7.0, -0.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + mat2 func (mat2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3 + values + { + input mat3 in0 = [ mat3(2.5, 0.0, 1.0, -2.5, 1.0, 3.0, 0.0, 2.0, 1.5) | mat3(-3.5, 2.0, 0.5, -1.5, -3.5, 2.5, 0.0, 1.5, 3.0) | mat3(1.5, 3.0, -1.0, 2.5, -0.5, 3.5, 3.0, -3.0, -2.5) ]; + output mat3 out0 = [ mat3(-5.0, -0.0, -2.0, 5.0, -2.0, -6.0, -0.0, -4.0, -3.0) | mat3(7.0, -4.0, -1.0, 3.0, 7.0, -5.0, -0.0, -3.0, -6.0) | mat3(-3.0, -6.0, 2.0, -5.0, 1.0, -7.0, -6.0, 6.0, 5.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + mat3 func (mat3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4 + values + { + input mat4 in0 = [ mat4(-2.0, 3.5, -0.5, 1.0, -1.5, 0.0, -1.0, -1.0, 0.5, 0.5, 3.0, 1.5, 3.0, 2.5, 3.5, 1.5) | mat4(-2.5, 2.5, 3.5, 3.0, 0.5, 1.5, -2.0, 2.5, 0.5, -1.5, -3.5, 2.5, 3.5, -3.0, 2.5, -0.5) | mat4(-2.5, -1.5, 2.0, 3.0, -3.5, 1.0, -3.5, 1.5, -1.5, 3.0, 3.5, 0.0, 3.5, -1.5, -3.0, 0.5) ]; + output mat4 out0 = [ mat4(4.0, -7.0, 1.0, -2.0, 3.0, -0.0, 2.0, 2.0, -1.0, -1.0, -6.0, -3.0, -6.0, -5.0, -7.0, -3.0) | mat4(5.0, -5.0, -7.0, -6.0, -1.0, -3.0, 4.0, -5.0, -1.0, 3.0, 7.0, -5.0, -7.0, 6.0, -5.0, 1.0) | mat4(5.0, 3.0, -4.0, -6.0, 7.0, -2.0, 7.0, -3.0, 3.0, -6.0, -7.0, -0.0, -7.0, 3.0, 6.0, -1.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + mat4 func (mat4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_struct + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + + float func (Pos p) + { + return -(p.a + p.b + p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + out0 = func(p); + ${OUTPUT} + } + "" + end + + case struct_struct + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + + Pos func (Pos p) + { + return Pos(-p.a, -p.b, -p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + p = func(p); + out0 = p.a + p.b + p.c; + ${OUTPUT} + } + "" + end + + case struct_nested_struct + values + { + input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ]; + output float out0 = [ 1.0 | -0.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + struct Line { Pos start, end; }; + + Line func (Pos p) + { + return Line(p, Pos(-p.a, -p.b, -p.c)); + } + + float sum (Pos p) + { + return (p.a + p.b + p.c); + } + + void main() + { + Pos p = Pos(in0.x, in0.y, in0.z); + Line line = func(p); + out0 = sum(line.start) + (2.0 * sum(line.end)); + ${OUTPUT} + } + "" + end + + +end # datatypes + +group qualifiers "Function Parameter Qualifiers" + + case in_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_lowp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in lowp float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_lowp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out lowp float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_lowp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout lowp float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_highp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (in highp float a) + { + a = -a; + return 2.0 * a; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_highp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out highp float a) + { + a = -1.0; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_highp_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout highp float a) + { + a = -a; + } + + void main() + { + ${SETUP} + float f = 1.0; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case const_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (const float a) + { + float b = -a; + return 2.0 * b; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case const_in_float + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (const in float a) + { + float b = -a; + return 2.0 * b; + } + + void main() + { + ${SETUP} + float f = in0; + float g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case in_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_lowp_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in lowp int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_lowp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out lowp int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_lowp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout lowp int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case in_highp_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in highp int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case out_highp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (out highp int a) + { + a = -1; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case inout_highp_int + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (inout highp int a) + { + a = -a; + } + + void main() + { + ${SETUP} + int f = 1; + func(f); + out0 = f * in0; + ${OUTPUT} + } + "" + end + + case const_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + int b = -a; + return 2 * b; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case const_in_int + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const in int a) + { + int b = -a; + return 2 * b; + } + + void main() + { + ${SETUP} + int f = in0; + int g = func(f); + out0 = f + g; + ${OUTPUT} + } + "" + end + + case in_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a) + { + a = !a; + return a; + } + + void main() + { + ${SETUP} + bool f = in0; + bool g = func(f); + out0 = (f != g); + ${OUTPUT} + } + "" + end + + case out_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + void func (out bool a) + { + a = false; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + + case inout_bool + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + void func (inout bool a) + { + a = !a; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + +end # qualifiers + +group declarations "Function Declarations" + + case void_vs_no_void + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + + float func (void) + { + return -1.0; + } + "" + end + + case in_vs_no_in + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + + float func (in float f) + { + return -f; + } + "" + end + + case default_vs_explicit_precision + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + + float func (mediump float f) + { + return -f; + } + "" + end + +end # declarations + +group overloading "Function Overloading" + + case user_func_arg_type_simple + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + int func (int a) + { + return -a; + } + + void main() + { + out0 = func(in0) * float(func(-1)); + ${OUTPUT} + } + "" + end + + case user_func_arg_float_types + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) { return -a; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + + void main() + { + out0 = func(func(func(func(vec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_int_types + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + out0 = func(func(func(func(ivec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_bool_types + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + out0 = func(func(func(func(bvec4(in0)).xyz).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_basic_types + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + float func (float a) { return -a; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + + void main() + { + ${SETUP} + if (func(func(bvec4(false)).x)) + out0 = func(in0) * float(func(-1)); + else + out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arg_complex_types + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + struct Pos { float a, b, c; }; + struct Line { Pos start, end; }; + + float func (float a) { return -a; } + float func (float a[4]) { return a[0] + a[3]; } + vec2 func (vec2 a) { return a.yx; } + vec3 func (vec3 a) { return a.xxx; } + vec4 func (vec4 a) { return a.wwww; } + vec4 func (vec4 a[4]) { return a[1] + a[2]; } + int func (int a) { return -a; } + ivec2 func (ivec2 a) { return a.yx; } + ivec3 func (ivec3 a) { return a.xxx; } + ivec4 func (ivec4 a) { return a.wwww; } + bool func (bool a) { return !a; } + bvec2 func (bvec2 a) { return a.yx; } + bvec3 func (bvec3 a) { return a.xxx; } + bvec4 func (bvec4 a) { return a.wwww; } + Pos func (Pos a) { return a; } + Line func (Line a) { return Line(a.end, a.start); } + + void main() + { + ${SETUP} + float arr[4]; + vec4 arr2[4]; + out0 = func(arr) + func(arr2).x; + if (func(func(bvec4(false)).x)) + out0 = func(in0) * float(func(-1)); + else + out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x); + ${OUTPUT} + } + "" + end + + case user_func_arguments + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + float func (float a, float b) + { + return a * b; + } + + void main() + { + out0 = func(in0) * func(-0.5, -2.0); + ${OUTPUT} + } + "" + end + + case builtin_sin + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int sin(int a) { return -a; } + + void main() + { + ${SETUP} + out0 = sin(in0); + ${OUTPUT} + } + "" + end + + case builtin_step + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int step (float i, float j, int a) { return -a; } + + void main() + { + ${SETUP} + out0 = step(0.0, 1.0, in0); + ${OUTPUT} + } + "" + end + + case array_size + values + { + output float out0 = [ 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f[3]) + { + return f[0]; + } + + float func (float f[4]) + { + return f[1]; + } + + void main () + { + ${SETUP} + float x[4]; + x[0] = -1.0; + x[1] = 1.0; + x[2] = x[3] = 0.0; + out0 = func(x); + ${OUTPUT} + } + "" + end + +end # overloading + +group array_arguments "Arrays as Arguments" + + case local_in_float + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (in float a[4]) + { + a[0] = -1.0; + a[2] = -4.0; + a[3] = -3.0 * a[1]; + return a[0]; + } + + void main() + { + float arr[4]; + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + float f = func(arr); + out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_float + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (in float a[4]) + { + a[0] = -1.0; + a[2] = -4.0; + a[3] = -3.0 * a[1]; + return a[0]; + } + + float arr[4]; + + void main() + { + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + float f = func(arr); + out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case local_in_int + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, -4) | ivec4(-7, -11, 13, 19) ]; + output ivec4 out0 = [ ivec4(0, -1, -2, 4) | ivec4(7, 11, -13, -19) ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a[4]) + { + a[0] = -1; + a[2] = -4; + a[3] = -3 * a[1]; + return a[0]; + } + + void main() + { + ${SETUP} + int arr[4]; + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + int f = func(arr); + out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_int + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, 4) | ivec4(-7, -11, 13, 19) ]; + output ivec4 out0 = [ ivec4(0, -1, -2, -4) | ivec4(7, 11, -13, -19) ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (in int a[4]) + { + a[0] = -1; + a[2] = -4; + a[3] = -3 * a[1]; + return a[0]; + } + + int arr[4]; + + void main() + { + ${SETUP} + arr[0] = in0.x; + arr[1] = in0.y; + arr[2] = in0.z; + arr[3] = in0.w; + int f = func(arr); + out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + + "" + end + + case local_in_bool + values + { + input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a[4]) + { + a[0] = false; + a[2] = true; + a[3] = !a[1]; + return a[0]; + } + + void main() + { + ${SETUP} + bool arr[4]; + arr[0] = !in0.x; + arr[1] = !in0.y; + arr[2] = !in0.z; + arr[3] = !in0.w; + func(arr); + out0 = bvec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case global_in_bool + values + { + input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + bool func (in bool a[4]) + { + a[0] = false; + a[2] = true; + a[3] = !a[1]; + return a[0]; + } + + bool arr[4]; + + void main() + { + ${SETUP} + arr[0] = !in0.x; + arr[1] = !in0.y; + arr[2] = !in0.z; + arr[3] = !in0.w; + func(arr); + out0 = bvec4(arr[0], arr[1], arr[2], arr[3]); + ${OUTPUT} + } + "" + end + + case test_helpers + desc "Check that helper functions are supported properly." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output float out0 = [ 1.0 | 1.0 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + void main() + { + float arr[4]; + set(arr, in0); + negate(arr); + out0 = float(test(arr, -in0)); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_local_in_on_call + desc "Check that local 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + a[0] = 2.123; + a[2] = -4.123; + return isEqual(a, b) ? 1.0 : -1.0; + } + + void main() + { + float arr[4]; + set(arr, in0); + out0 = in0 * func(arr, arr); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_global_in_on_call + desc "Check that global 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + a[0] = 2.123; + a[2] = -4.123; + return isEqual(a, b) ? 1.0 : -1.0; + } + + float arr[4]; + + void main() + { + set(arr, in0); + out0 = in0 * func(arr, arr); + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_local_inout_on_call + desc "Check that local 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (inout float a[4], inout float b[4]) + { + negate(a); + return isEqual(a, b) ? 1.0 : -1.0; + } + + void main() + { + float arr[4]; + set(arr, in0); + float m = func(arr, arr); // returns -1.0 + float n = float(test(arr, in0) || test(arr, -in0)); + out0 = in0 * m * n; + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + + case copy_global_inout_on_call + desc "Check that global 'in' arguments are copied on call and don't alias." + values + { + input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ]; + output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + vec4 get (in float arr[4]); + void set (out float arr[4], vec4 val); + void negate (inout float arr[4]); + bool test (in float arr[4], vec4 ref); + bool isEqual (in float a[4], in float b[4]); + + float func (in float a[4], in float b[4]) + { + negate(a); + return isEqual(a, b) ? 1.0 : -1.0; + } + + float arr[4]; + + void main() + { + set(arr, in0); + float m = func(arr, arr); // returns -1.0 + float n = float(test(arr, in0) || test(arr, -in0)); + out0 = in0 * m * n; + ${OUTPUT} + } + + float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } + vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } + void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } + void negate (inout float arr[4]) { set(arr, -get(arr)); } + bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } + bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + "" + end + +# vec4 get (in float arr[4]); +# void set (out float arr[4], vec4 val); +# void negate (inout float arr[4]); +# bool test (in float arr[4], vec4 ref); +# bool isEqual (in float a[4], in float b[4]); + +# float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); } +# vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); } +# void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; } +# void negate (inout float arr[4]) { set(arr, -get(arr)); } +# bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); } +# bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); } + +end # array_arguments + +#group qualifiers "Function Parameter Qualifiers" +# +#end # qualifiers + +group control_flow "Control Flow In Functions" + + case simple_return + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + a = a * -1.0; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_if + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + if (a != 0.0) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_else + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + if (a == 0.0) + return 1.0; + else + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 1; i++) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop_if + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 3; i++) + { + if (i == 1) + return a; + else if (i > 1) + return -1.0; + a = -a; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 5; i++) + a = -a; + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_break + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + a = -a; + if (i == 4) + break; + } + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_continue + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + if (i == 4) + continue; + a = -a; + } + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_nested_loop + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + a = -a; + for (int j = 0; j < 4; j++) + { + a = -a; + if (i == 1) + return a; + } + if (i == 4) + return 1.0; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop_sequence + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) // negate a + { + a = -a; + if (i == 4) + a = -a; + } + + for (int i = 6; i < 10; i++) // keep a + { + if (i == 8) + continue; + else if (i == 9) + break; + a = -a; + } + + return a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case mixed_return_break_continue + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + for (int i = 0; i < 6; i++) + { + if (i == 0) + continue; + else if (i == 1) + { + } + else if (i == 3) + break; + else + return a; + a = -a; + } + + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end # control_flow + +group misc "Miscellaneous" + + case multi_arg_float + values + { + input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; # -sum(in0) + } + + both "" + precision mediump float; + ${DECLARATIONS} + + float sum(vec4 v) { return (v.x + v.y + v.z + v.w); } + + float func (float a, vec3 b, vec2 c, vec2 d, vec4 e) + { + return -sum(vec4(a, b) + vec4(c, d)) + sum(e); + } + + void main() + { + ${SETUP} + out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0); + ${OUTPUT} + } + "" + end + + case multi_arg_int + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int sum(ivec4 v) { return (v.x + v.y + v.z + v.w); } + + int func (int a, ivec3 b, ivec2 c, ivec2 d, ivec4 e) + { + return -sum(ivec4(a, b) + ivec4(c, d)) + sum(e); + } + + void main() + { + ${SETUP} + out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0); + ${OUTPUT} + } + "" + end + + case argument_eval_order_1 + values + { + input int in0 = [ 0 | 1 | 3 | 5 ]; + output int out0 = [ -1 | 5 | 11 | 17 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + int func (float a, int b, bool c, int d) + { + if (c) + return b + int(a) + d; + else + return -1; + } + + void main () + { + ${SETUP} + float v0 = float(in0); + int v1 = in0; + out0 = func((v0 += 1.0), v1++, (v0 > 1.5), v1); + ${OUTPUT} + } + "" + end + + case argument_eval_order_2 + values + { + input int in0 = [ 0 | -1 | 3 | 5 ]; + output int out0 = [ 3 | -1 | 9 | 13 ]; + } + + both "" + precision mediump float; + ${DECLARATIONS} + + int g; + + int modG (int v) + { + g += v; + return v; + } + + int func (float a, int b, bool c, int d) + { + if (c) + return b + int(a) + d; + else + return -1; + } + + void main () + { + ${SETUP} + out0 = func(float(g = in0), modG(2), --g > 0, g); + ${OUTPUT} + } + "" + end + + case missing_returns + values + { + input float in0 = [ 1.0 | 2.0 | 3.0 ]; + output float out0 = [ -1.0 | -2.0 | -3.0 ]; + } + both "" + // Note specification says that returned value is undefined if no return + // statement has been executed. In this case func() is called only with + // positive values. + precision mediump float; + ${DECLARATIONS} + + float func (float f) + { + if (f > 0.0) + return -f; + } + + void main () + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end # misc + +group invalid "Invalid Functions" + case break_in_body + expect compile_fail + both "" + precision mediump float; + + void func () + { + break; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case continue_in_body + expect compile_fail + both "" + precision mediump float; + + void func () + { + continue; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_value_from_void_function + expect compile_fail + both "" + precision mediump float; + + void func () + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case extra_arguments + expect compile_fail + both "" + precision mediump float; + + void func (float f) + { + } + + void main () + { + func(1.0, 2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_arguments + expect compile_fail + both "" + precision mediump float; + + void func (float f) + { + } + + void main () + { + func(); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_argument_type + expect compile_fail + both "" + precision mediump float; + + void func (in f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_basetype_mismatch + expect compile_fail + both "" + precision mediump float; + precision mediump int; + + void func (float f) + { + } + + void main () + { + func(2); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_scalar_vector_mismatch + expect compile_fail + both "" + precision mediump float; + + void func (vec2 f) + { + } + + void main () + { + func(2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_vector_size_mismatch + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + } + + void main () + { + func(vec2(2.0)); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case duplicate_function + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f); + + void func (vec3 f) + { + } + + void func (vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_return_type + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + float func (vec3 f) + { + return f.x; + } + "" + end + + case prototype_unspecified_array_size + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f[]); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_mismatch_argument_array_size + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f[3]); + void func (vec3 f[3]) + { + } + + void main () + { + vec3 array[4]; + func(array); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_const + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f); + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_array_const + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f[3]); + void func (const vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_array_inout + expect compile_fail + both "" + precision mediump float; + + void func (out vec3 f); + void func (inout vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_return_type + expect compile_fail + both "" + precision mediump float; + + func (float f); + func (inout vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_before_definition + expect compile_fail + both "" + precision mediump float; + + void main () + { + func(1.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + void func (float f) + { + } + + "" + end + + case return_array_in_struct + expect compile_fail + both "" + precision mediump float; + + struct Foo + { + float f; + float arr[2]; + }; + + Foo func () + { + Foo f; + f.f = 1.0; + f.arr[0] = 2.0; + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_precision_overload + expect compile_fail + both "" + precision mediump float; + + float func (lowp float f) + { + return f; + } + + float func (mediump float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_in_out_overload + expect compile_fail + both "" + precision mediump float; + + void func (in float f) + { + } + + void func (out float f) + { + f = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_in_inout_overload + expect compile_fail + both "" + precision mediump float; + + void func (in float f) + { + } + + void func (inout float f) + { + f = -f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_out_inout_overload + expect compile_fail + both "" + precision mediump float; + + void func (out float f) + { + f = -1.0; + } + + void func (inout float f) + { + f = -f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_overload + expect compile_fail + both "" + precision mediump float; + + float func (float f) + { + return f; + } + + int func (float f) + { + return int(f); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_precision_overload + expect compile_fail + both "" + precision mediump float; + + lowp float func (float f) + { + return f; + } + + mediump float func (float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_type_const_overload + expect compile_fail + both "" + precision mediump float; + + float func (float f) + { + return f; + } + + const float func (float f) + { + return f; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_without_value + expect compile_fail + both "" + precision mediump float; + + float func (float f) + { + return; + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_prototype + expect compile_fail + both "" + precision mediump float; + + void main () + { + float func (float f); + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_definition + expect compile_fail + both "" + precision mediump float; + + void main () + { + float func (float f) + { + return 1.0; + } + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case name_type_conflict + expect compile_fail + both "" + precision mediump float; + + struct foo { float a; } + + float foo (float f) + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case const_overload + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + } + + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_local + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + uniform float u; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case varying_local + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + varying float v; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case attribute_local + expect compile_fail + both "" + precision mediump float; + + void func (vec3 f) + { + attribute float a; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_argument + expect compile_fail + both "" + precision mediump float; + + void func (uniform vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case varying_argument + expect compile_fail + both "" + precision mediump float; + + void func (varying vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case attribute_argument + expect compile_fail + both "" + precision mediump float; + + void func (attribute vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_return_type + expect compile_fail + both "" + precision mediump float; + + uniform float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case varying_return_type + expect compile_fail + both "" + precision mediump float; + + varying float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case attribute_return_type + expect compile_fail + both "" + precision mediump float; + + attribute float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_invalid_return_type + expect compile_fail + both "" + precision mediump float; + + float main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_has_arguments + expect compile_fail + both "" + precision mediump float; + + void main (float f) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_missing_return_type + expect compile_fail + both "" + precision mediump float; + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_arg + expect compile_fail + both "" + precision mediump float; + + func (const float f) + { + f = 1.0; + } + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_array_arg + expect compile_fail + both "" + precision mediump float; + + func (const float f[3]) + { + f[0] = 1.0; + } + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case modify_const_arg + expect compile_fail + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + a = -a; + return 2 * a; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case init_const_local_from_const_arg + expect compile_fail + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + const int b = -a; + return 2 * b; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case array_size_from_const_arg + expect compile_fail + both "" + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (const int a) + { + int arr[a]; + arr[1] = 3; + return arr[1]; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(3)); + } + "" + end + + case double_declare + expect compile_fail + both "" + precision mediump float; + ${DECLARATIONS} + + float func (float f); + float func (float f); + + float func (float f) + { + return -f; + } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html new file mode 100644 index 000000000..2085a16a6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'invalid_texture_functions'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test new file mode 100644 index 000000000..7641da228 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test @@ -0,0 +1,90 @@ + +case texture2d_bias_in_vertex + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + uniform lowp sampler2D s; + + void main() + { + vec4 r = texture2D(s, vec2(1.0), 1.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +case texturecube_bias_in_vertex + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + uniform lowp samplerCube s; + + void main() + { + vec4 r = textureCube(s, vec3(1.0), 1.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +case texture2dlod_in_fragment + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + uniform sampler2D s; + + void main() + { + gl_FragColor = texture2DLod(s, vec2(0), 1.0); + } + "" +end + +case texturecubelod_in_fragment + expect compile_fail + values {} + + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + uniform samplerCube s; + + void main() + { + gl_FragColor = textureCubeLod(s, vec3(0), 1.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html new file mode 100644 index 000000000..3c7b576ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'keywords'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test new file mode 100644 index 000000000..16fc39065 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test @@ -0,0 +1,1613 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group keywords "Usage of keywords as identifiers." + + case attribute + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float attribute = 1.0; + ${OUTPUT} + } + "" + end + case const + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float const = 1.0; + ${OUTPUT} + } + "" + end + case uniform + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uniform = 1.0; + ${OUTPUT} + } + "" + end + case varying + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float varying = 1.0; + ${OUTPUT} + } + "" + end + case break + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float break = 1.0; + ${OUTPUT} + } + "" + end + case continue + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float continue = 1.0; + ${OUTPUT} + } + "" + end + case do + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float do = 1.0; + ${OUTPUT} + } + "" + end + case for + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float for = 1.0; + ${OUTPUT} + } + "" + end + case while + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float while = 1.0; + ${OUTPUT} + } + "" + end + case if + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float if = 1.0; + ${OUTPUT} + } + "" + end + case else + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float else = 1.0; + ${OUTPUT} + } + "" + end + case in + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float in = 1.0; + ${OUTPUT} + } + "" + end + case out + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float out = 1.0; + ${OUTPUT} + } + "" + end + case inout + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inout = 1.0; + ${OUTPUT} + } + "" + end + case float + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float float = 1.0; + ${OUTPUT} + } + "" + end + case int + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float int = 1.0; + ${OUTPUT} + } + "" + end + case void + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float void = 1.0; + ${OUTPUT} + } + "" + end + case bool + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bool = 1.0; + ${OUTPUT} + } + "" + end + case true + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float true = 1.0; + ${OUTPUT} + } + "" + end + case false + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float false = 1.0; + ${OUTPUT} + } + "" + end + case lowp + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float lowp = 1.0; + ${OUTPUT} + } + "" + end + case mediump + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mediump = 1.0; + ${OUTPUT} + } + "" + end + case highp + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float highp = 1.0; + ${OUTPUT} + } + "" + end + case precision + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float precision = 1.0; + ${OUTPUT} + } + "" + end + case invariant + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float invariant = 1.0; + ${OUTPUT} + } + "" + end + case discard + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float discard = 1.0; + ${OUTPUT} + } + "" + end + case return + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float return = 1.0; + ${OUTPUT} + } + "" + end + case mat2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2 = 1.0; + ${OUTPUT} + } + "" + end + case mat3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3 = 1.0; + ${OUTPUT} + } + "" + end + case mat4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4 = 1.0; + ${OUTPUT} + } + "" + end + case vec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec2 = 1.0; + ${OUTPUT} + } + "" + end + case vec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec3 = 1.0; + ${OUTPUT} + } + "" + end + case vec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec4 = 1.0; + ${OUTPUT} + } + "" + end + case ivec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec2 = 1.0; + ${OUTPUT} + } + "" + end + case ivec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec3 = 1.0; + ${OUTPUT} + } + "" + end + case ivec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec4 = 1.0; + ${OUTPUT} + } + "" + end + case bvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec2 = 1.0; + ${OUTPUT} + } + "" + end + case bvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec3 = 1.0; + ${OUTPUT} + } + "" + end + case bvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec4 = 1.0; + ${OUTPUT} + } + "" + end + case sampler2D + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2D = 1.0; + ${OUTPUT} + } + "" + end + case samplerCube + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerCube = 1.0; + ${OUTPUT} + } + "" + end + case struct + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float struct = 1.0; + ${OUTPUT} + } + "" + end + +end # keywords +group reserved_keywords "Usage of reserved keywords as identifiers." + + case asm + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float asm = 1.0; + ${OUTPUT} + } + "" + end + case class + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float class = 1.0; + ${OUTPUT} + } + "" + end + case union + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float union = 1.0; + ${OUTPUT} + } + "" + end + case enum + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float enum = 1.0; + ${OUTPUT} + } + "" + end + case typedef + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float typedef = 1.0; + ${OUTPUT} + } + "" + end + case template + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float template = 1.0; + ${OUTPUT} + } + "" + end + case this + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float this = 1.0; + ${OUTPUT} + } + "" + end + case packed + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float packed = 1.0; + ${OUTPUT} + } + "" + end + case goto + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float goto = 1.0; + ${OUTPUT} + } + "" + end + case switch + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float switch = 1.0; + ${OUTPUT} + } + "" + end + case default + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float default = 1.0; + ${OUTPUT} + } + "" + end + case inline + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inline = 1.0; + ${OUTPUT} + } + "" + end + case noinline + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float noinline = 1.0; + ${OUTPUT} + } + "" + end + case volatile + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float volatile = 1.0; + ${OUTPUT} + } + "" + end + case public + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float public = 1.0; + ${OUTPUT} + } + "" + end + case static + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float static = 1.0; + ${OUTPUT} + } + "" + end + case extern + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float extern = 1.0; + ${OUTPUT} + } + "" + end + case external + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float external = 1.0; + ${OUTPUT} + } + "" + end + case interface + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float interface = 1.0; + ${OUTPUT} + } + "" + end + case flat + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float flat = 1.0; + ${OUTPUT} + } + "" + end + case long + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float long = 1.0; + ${OUTPUT} + } + "" + end + case short + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float short = 1.0; + ${OUTPUT} + } + "" + end + case double + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float double = 1.0; + ${OUTPUT} + } + "" + end + case half + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float half = 1.0; + ${OUTPUT} + } + "" + end + case fixed + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fixed = 1.0; + ${OUTPUT} + } + "" + end + case unsigned + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float unsigned = 1.0; + ${OUTPUT} + } + "" + end + case superp + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float superp = 1.0; + ${OUTPUT} + } + "" + end + case input + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float input = 1.0; + ${OUTPUT} + } + "" + end + case output + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float output = 1.0; + ${OUTPUT} + } + "" + end + case hvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec2 = 1.0; + ${OUTPUT} + } + "" + end + case hvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec3 = 1.0; + ${OUTPUT} + } + "" + end + case hvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec4 = 1.0; + ${OUTPUT} + } + "" + end + case dvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec2 = 1.0; + ${OUTPUT} + } + "" + end + case dvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec3 = 1.0; + ${OUTPUT} + } + "" + end + case dvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec4 = 1.0; + ${OUTPUT} + } + "" + end + case fvec2 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec2 = 1.0; + ${OUTPUT} + } + "" + end + case fvec3 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec3 = 1.0; + ${OUTPUT} + } + "" + end + case fvec4 + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec4 = 1.0; + ${OUTPUT} + } + "" + end + case sampler1D + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1D = 1.0; + ${OUTPUT} + } + "" + end + case sampler3D + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3D = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DShadow + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DShadow + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRect + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case sampler3DRect + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3DRect = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRectShadow + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRectShadow = 1.0; + ${OUTPUT} + } + "" + end + case sizeof + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sizeof = 1.0; + ${OUTPUT} + } + "" + end + case cast + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float cast = 1.0; + ${OUTPUT} + } + "" + end + case namespace + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float namespace = 1.0; + ${OUTPUT} + } + "" + end + case using + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float using = 1.0; + ${OUTPUT} + } + "" + end + +end # reserved_keywords +group invalid_identifiers "Usage of invalid identifiers." + + case gl_begin + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float gl_Invalid = 1.0; + ${OUTPUT} + } + "" + end + case digit + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0123 = 1.0; + ${OUTPUT} + } + "" + end + case digit_begin + expect compile_fail + values {} + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0invalid = 1.0; + ${OUTPUT} + } + "" + end + +end # invalid_identifiers diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html new file mode 100644 index 000000000..adf118b7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'linkage'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test new file mode 100644 index 000000000..319a85858 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test @@ -0,0 +1,1715 @@ +# not declared in vertex shader, declared in fragment shader +case varying_1 + desc "varying declared in fragment shader, no reference in vertex shader" + values { output float out0 = 1.0; } + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + varying mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" +end + +# declared in vertex shader, no reference in frag shader +case varying_2 + desc "varying declared in vertex shader, no reference in fragment shader" + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# declared in vertex shader, declared in frag shader +case varying_3 + desc "varying declared in both vertex and fragment shader, but not used" + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# declared in vertex shader, static use in frag shader +case varying_4 + desc "varying declared in both shaders, statically used in fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + uniform bool u_false; + void main() + { + if (u_false) + gl_FragColor = vec4(var); + else + gl_FragColor = vec4(1.0); + } + "" +end + +# static use in vertex shader, no reference in fragment shader +case varying_5 + desc "varying declared and statically used in vertex shader, no reference in fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# static use in vertex shader, declared in fragment shader +case varying_6 + desc "varying declared and statically used in vertex shader, only declared in fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# static use in vertex shader, used in fragment shader +case varying_7 + desc "varying statically used in both vertex and fragment shader" + values { uniform bool u_false = false; } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + ${FRAGMENT_DECLARATIONS} + varying mediump float var; + void main() + { + if (u_false) + gl_FragColor = vec4(var); + else + gl_FragColor = vec4(1.0); + } + "" +end + +case varying_type_float + desc "varying of type float" + values + { + input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_vec2 + desc "varying of type vec2" + values + { + input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump vec2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying vec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_vec3 + desc "varying of type vec3" + values + { + input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump vec3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying vec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_vec4 + desc "varying of type vec4" + values + { + input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_mat2 + desc "varying of type mat2" + values + { + input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump mat2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mat2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_mat3 + desc "varying of type mat3" + values + { + input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump mat3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mat3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_type_mat4 + desc "varying of type mat4" + values + { + input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; + } + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump mat4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mat4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +# differing precision tests +case varying_differing_precision_1 + desc "varying declared as highp in vertex shader, but mediump in fragment shader" + values + { + input float in0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + ${VERTEX_DECLARATIONS} + varying highp float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mediump float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" +end + +# differing precision tests +case varying_differing_precision_2 + desc "varying declared as highp in vertex shader, but lowp in fragment shader" + values + { + input float in0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + ${VERTEX_DECLARATIONS} + varying highp vec2 var; + void main() + { + var = vec2(in0, 2.0*in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying lowp vec2 var; + void main() + { + out0 = var.y - var.x; + ${FRAGMENT_OUTPUT} + } + "" +end + +# differing precision tests +case varying_differing_precision_3 + desc "varying declared as lowp in vertex shader, but mediump in fragment shader" + values + { + input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; + } + + vertex "" + ${VERTEX_DECLARATIONS} + varying lowp vec4 var; + void main() + { + var = vec4(in0, 2.0*in0, -in0, -in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying mediump vec4 var; + void main() + { + out0 = var.x + var.y + var.z + var.w; + ${FRAGMENT_OUTPUT} + } + "" +end + +# mismatched type, static use but no runtime use in the fragment shader +case varying_type_mismatch_1 + desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader" + expect link_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump vec2 var; + void main() + { + if (false) + { + gl_FragColor = vec4(var.y); + } + else + { + ${FRAG_COLOR} = vec4(1.0); + } + } + "" +end + +# mismatched type, varyings used +case varying_type_mismatch_2 + desc "varying type mismatch (float vs. vec2)" + expect link_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump vec2 var; + void main() + { + gl_FragColor = var.xyyx; + } + "" +end + +# no declaration in vertex shader, but static use in fragment +case varying_illegal_usage_1 + desc "varying not declared in vertex shader, but statically used in fragment shader" + expect link_fail + vertex "" + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump float var; + void main() + { + gl_FragColor = vec4(var); + } + "" +end + +# integer varyings not allowed +case invalid_varying_type_int + desc "integer varying used" + expect compile_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying mediump int var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying mediump int var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# bool varyings not allowed +case invalid_varying_type_bool + desc "boolean varying used" + expect compile_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying bool var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying bool var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +# struct varyings not allowed +case invalid_varying_type_struct + desc "struct varying used" + expect compile_fail + vertex "" + ${VERTEX_DECLARATIONS} + varying struct { mediump float foo; } var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + varying struct { mediump float foo; } var; + void main() + { + gl_FragColor = vec4(1.0); + } + "" +end + +case varying_readback_1 + desc "read back (an already written) varying in the vertex shader" + values + { + input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; + output float out0 = [ 3.0 | 0.0 | -6.0 | 30.0 ]; + } + vertex "" + precision mediump float; + ${VERTEX_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + out0 = var1 + var2; + ${FRAGMENT_OUTPUT} + } + "" +end + +case varying_writeback_1 + desc "write back a varying in the fragment shader" + expect compile_fail + vertex "" + precision mediump float; + ${VERTEX_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + ${FRAGMENT_DECLARATIONS} + varying float var1; + varying float var2; + + void main() + { + var2 = var1; + out0 = var1; + ${FRAGMENT_OUTPUT} + } + "" +end + +# Struct linkage handling +case uniform_struct + desc "Same uniform struct in both shaders" + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b + val.a; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only + desc "Uniform struct declared in both, used only in vertex." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only + desc "Uniform struct declared in both, used only in fragment." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial + desc "Uniform struct declared in both, used partially in both." + values { + uniform float val.a = 1.0; + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vec4 + desc "Same uniform struct in both shaders. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only_vec4 + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 " + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only_vec4 + desc "Uniform struct declared in both, used only in fragment. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a.x + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4 + desc "Uniform struct declared in both, used partially in both. Datatype vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vec4_vec3 + desc "Same uniform struct in both shaders. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only_vec4_vec3 + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only_vec4_vec3 + desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a.x + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4_vec3 + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vec4_float + desc "Same uniform struct in both shaders. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + void main() + { + dummy = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_vertex_only_vec4_float + desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_fragment_only_vec4_float + desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.a.x + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4_float + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and float" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform float val.b = 2.0; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec4_struct + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec4" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec4 val.b.c = vec4(1.0, 2.0, 3.0, 4.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" +end + + + +case uniform_struct_partial_vec4_vec3_struct + desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec3" + values { + uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); + uniform vec3 val.b.c = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec2_vec3 + desc "Uniform struct declared in both, used partially in both. Datatype vec2 and vec3" + values { + uniform vec2 val.a = vec2(1.0, 2.0); + uniform vec3 val.b = vec3(1.0, 2.0, 3.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_vec2_int + desc "Uniform struct declared in both, used partially in both. Datatype vec2 and int" + values { + uniform vec2 val.a = vec2(1.0, 2.0); + uniform int val.b = 2; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_int_float + desc "Uniform struct declared in both, used partially in both. Datatype int and float" + values { + uniform float val.a = 1.0; + uniform int val.b = 2; + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_bvec2_vec2 + desc "Uniform struct declared in both, used partially in both. Datatype bvec2 and vec2" + values { + uniform bvec2 val.a = bvec2(true, true); + uniform vec2 val.b = vec2(1.0, 2.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_ivec2_vec2 + desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and vec2" + values { + uniform ivec2 val.a = ivec2(1, 2); + uniform vec2 val.b = vec2(1.0, 2.0); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_partial_ivec2_ivec2 + desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and ivec2" + values { + uniform ivec2 val.a = ivec2(1, 2); + uniform ivec2 val.b = ivec2(1, 2); + output float out0 = 3.0; + } + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + vec2(val.b).y; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_type_conflict_1 + desc "Fragment struct has one less member than fragment version" + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_type_conflict_2 + desc "Vertex struct has int, fragment struct has float." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump int a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = float(val.a); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_type_conflict_3 + desc "Vertex struct has vec3, fragment struct has vec4." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec3 a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump vec4 a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a.x; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_1 + desc "Vertex side struct has highp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {highp float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_2 + desc "Vertex side struct has mediump, fragment side struct lowp." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {lowp float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_3 + desc "Vertex side struct has lowp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_precision_conflict_4 + desc "Vertex side struct has lowp, fragment side struct implicit mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + varying mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Struct {float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_use_case_rip + desc "Complex Light struct from use case tests." + values { + uniform float val.constantAttenuation = 1.0; + uniform float val.quadraticAttenuation = 1.0; + output float out0 = 2.0; + } + vertex "" + struct Light + { + mediump vec3 color; + highp vec4 position; + highp vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + ${VERTEX_DECLARATIONS} + uniform Light val; + varying mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Light + { + mediump vec3 color; + highp vec4 position; + highp vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + struct Struct {float a;}; + uniform Light val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" +end + +case uniform_struct_use_case_rip_sans_highp + desc "Complex Light struct from use case tests, without highp usage" + values { + uniform float val.constantAttenuation = 1.0; + uniform float val.quadraticAttenuation = 1.0; + output float out0 = 2.0; + } + vertex "" + struct Light + { + mediump vec3 color; + mediump vec4 position; + mediump vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + ${VERTEX_DECLARATIONS} + uniform Light val; + varying mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + precision mediump float; + struct Light + { + mediump vec3 color; + mediump vec4 position; + mediump vec3 direction; + mediump float constantAttenuation; + mediump float linearAttenuation; + mediump float quadraticAttenuation; + }; + struct Struct {float a;}; + uniform Light val; + ${FRAGMENT_DECLARATIONS} + varying mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html new file mode 100644 index 000000000..ac91d2280 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'preprocessor'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test new file mode 100644 index 000000000..7e3d25149 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test @@ -0,0 +1,4287 @@ +group basic "Basic Tests" + + case correct_phases + expect compile_fail + both "" + #define e +1 + void main() + { + mediump int n = 1e; + } + "" + end + + case invalid_identifier + expect compile_fail + both "" + #define e +1 + + void main() + { + mediump int 1xyz = 1; + } + "" + end + + case null_directive + values { output float out0 = 0.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # + # // comment + /*sfd*/ # /* */ + + void main() + { + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case invalid_directive + expect compile_fail + both "" + #defin AAA + + void main() + { + } + "" + end + + case missing_identifier + expect compile_fail + both "" + #define + + void main() + { + } + "" + end + + case empty_object + values { output float out0 = -1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # define VALUE + + void main() + { + out0 = VALUE - 1.0; + ${OUTPUT} + } + "" + end + + case empty_function + values { output float out0 = -1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # define VALUE(a) + + void main() + { + out0 = VALUE(2.0) - 1.0; + ${OUTPUT} + } + "" + end + + + case empty_directive + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + # + + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case identifier_with_double_underscore + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + # define __VALUE__ 1 + + void main() + { + // __VALUE__ not used since it might be set by an "underlying software layer" + out0 = float(1.0); + ${OUTPUT} + } + "" + end +end # basic + +group definitions "Symbol Definition Tests" + + case define_value_and_function + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS:single-line} + # define VALUE (1.5 + 2.5) + # define FUNCTION(__LINE__, b) __LINE__+b + + void main() + { + out0 = FUNCTION(VALUE, ((0.2) + 1.8) ); + ${OUTPUT} + } + "" + end + + case undefine_object_invalid_syntax + expect compile_fail + both "" + precision mediump float; + #define VAL 2.0 + #undef VAL sdflkjfds + #define VAL 1.0 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VAL); + } + "" + end + + case undefine_invalid_object_1 + expect compile_fail + both "" + precision mediump float; + #undef __LINE__ + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__LINE__); + } + "" + end + + case undefine_invalid_object_2 + expect compile_fail + both "" + precision mediump float; + #undef __FILE__ + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__FILE__); + } + "" + end + + case undefine_invalid_object_3 + expect compile_fail + both "" + precision mediump float; + #undef __VERSION__ + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__VERSION__); + } + "" + end + + case undefine_invalid_object_4 + expect compile_fail + both "" + precision mediump float; + #undef GL_ES + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_ES); + } + "" + end + + case undefine_function + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define FUNCTION(a,b) a+b + #undef FUNCTION + #define FUNCTION(a,b) a-b + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + +end # definitions + +group invalid_definitions "Invalid Definition Tests" + + case define_non_identifier + expect compile_fail + both "" + precision mediump float; + #define 123 321 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_1 + expect compile_fail + both "" + precision mediump float; + #undef 123 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_2 + expect compile_fail + both "" + precision mediump float; + #undef foo.bar + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + +end # invalid_definitions + +group object_redefinitions "Object Redefinition Tests" + + case invalid_object_ident + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define AAAA 2.1 + # define VALUE (AAA - 1.0) + # define VALUE (AAAA - 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_whitespace + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA- 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_op + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA + 1.0) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_floatval_1 + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA - 1.1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_floatval_2 + expect compile_fail + both "" + precision mediump float; + # define AAA 2.0 + # define VALUE (AAA - 1.0) + # define VALUE (AAA - 1.0e-1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_1 + expect compile_fail + both "" + precision mediump float; + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 2) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_2 + expect compile_fail + both "" + precision mediump float; + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 0x1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case redefine_object_1 + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_ifdef + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #ifdef ADEFINE + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_undef_ifdef + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + #undef ADEFINE + + #ifdef ADEFINE + #define VALUE 0.0 + #else + #define VALUE 1.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_ifndef + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #ifndef ADEFINE + #define VALUE 0.0 + #else + #define VALUE 1.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_defined_1 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #if defined(ADEFINE) + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_defined_2 + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define ADEFINE 1 + #define ADEFINE 1 + + #if defined ADEFINE + #define VALUE 1.0 + #else + #define VALUE 0.0 + #endif + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_comment + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 /* fdsjklfdsjkl dsfjkhfdsjkh fdsjklhfdsjkh */ (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case redefine_object_multiline_comment + values { output float out0 = 6.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + # define VAL1 1.0 + #define VAL2 2.0 + + #define RES2 /* fdsjklfdsjkl + dsfjkhfdsjkh + fdsjklhfdsjkh */ (RES1 * VAL2) + #define RES1 (VAL2 / VAL1) + #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2) + #define VALUE (RES2 + RES1) + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + +end # object_redefinitions + +group invalid_redefinitions "Invalid Redefinitions Tests" + + case invalid_identifier_2 + expect compile_fail + both "" + precision mediump float; + # define GL_VALUE 1.0 + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_VALUE); + } + "" + end + +end # invalid_redefinitions + +group comments "Comment Tests" + + case multiline_comment_define + values { output float out0 = 4.2; } + both "" + precision mediump float; + ${DECLARATIONS} + #define VALUE /* current + value */ 4.2 + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case nested_comment + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + /* /* */ + out0 = 1.0; + // */ + ${OUTPUT} + } + "" + end + + case comment_trick_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + /*/ + out0 = 0.0; + /*/ + out0 = 1.0; + /**/ + ${OUTPUT} + } + "" + end + + case comment_trick_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + /**/ + out0 = 1.0; + /*/ + out0 = 0.0; + /**/ + ${OUTPUT} + } + "" + end + + case invalid_comment + expect compile_fail + both "" + precision mediump float; + void main() + { + /* /* */ */ + ${POSITION_FRAG_COLOR} = 1.0; + } + "" + end + + case unterminated_comment_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + /* + } + "" + end + + case unterminated_comment_2 + expect compile_fail + both "" + /* + precision mediump float; + void main() + { + } + "" + end + +end # comments + +group function_definitions "Function Definitions Tests" + + case same_object_and_function_param + values { output float out0 = 1.0; } + + both "" + precision mediump float; + ${DECLARATIONS} + #define VALUE 1.0 + #define FUNCTION(VALUE, B) (VALUE-B) + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + + case complex_func + values { output float out0 = 518.5; } + both "" + precision mediump float; + ${DECLARATIONS} + #define AAA(a,b) a*(BBB(a,b)) + #define BBB(a,b) a-b + + void main() + { + out0 = BBB(AAA(8.0/4.0, 2.0)*BBB(2.0*2.0,0.75*2.0), AAA(40.0,10.0*BBB(5.0,3.0))); + ${OUTPUT} + } + "" + end + + case function_definition_with_comments + values { output float out0 = 3.0; } + both "" + precision mediump float; + ${DECLARATIONS} + /* sdfljk */ #/* sdfljk */define /* sdfljk */ FUNC( /* jklsfd*/a /*sfdjklh*/, /*sdfklj */b /*sdfklj*/) a+b + + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + +end # function_definitions + +group recursion "Recursions Tests" + + case recursion_1 + expect compile_fail + both "" + precision mediump float; + # define AAA AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_2 + expect compile_fail + both "" + precision mediump float; + # define AAA BBB + #define BBB AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_3 + expect compile_fail + both "" + precision mediump float; + # define AAA (1.0+BBB) + #define BBB (2.0+AAA) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_4 + expect compile_fail + both "" + precision mediump float; + # define AAA(a) AAA(a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0)); + } + "" + end + + case recursion_5 + expect compile_fail + both "" + precision mediump float; + # define AAA(a, b) AAA(b, a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0, 2.0)); + } + "" + end + +end # recursion + +group function_redefinitions "Function Redefinition Tests" + + case function_redefinition_1 + values { output float out0 = 3.0; } + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC( a, b) a+b + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case function_redefinition_2 + values { output float out0 = 3.0; } + both "" + precision mediump float; + # define FUNC(a,b) (a +b) + # define FUNC( a, b )(a +b) + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case function_redefinition_3 + values { output float out0 = 3.0; } + both "" + precision mediump float; + # define FUNC(a,b) (a +b) + # define FUNC(a,b)(a /* comment + */ +b) + + ${DECLARATIONS} + void main() + { + out0 = FUNC(1.0, 2.0); + ${OUTPUT} + } + "" + end + + case invalid_function_redefinition_param_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(A,b) A+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + + case invalid_function_redefinition_param_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b,c) a+b+c + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case invalid_function_redefinition_param_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b) b+a + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + +end # functions_redefinitions + +group invalid_function_definitions "Invalid Function Definition Tests" + + case arguments_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC); + } + "" + end + + case arguments_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC()); + } + "" + end + + case arguments_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(((); + } + "" + end + + case arguments_4 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC)); + } + "" + end + + case arguments_5 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0)); + } + "" + end + + case arguments_6 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + } + "" + end + + case arguments_7 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,)); + } + "" + end + + case arguments_8 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case unique_param_name + expect compile_fail + both "" + precision mediump float; + # define FUNC(a,a) a+a + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(a + b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(,a,b) a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_1 + expect compile_fail + both "" + precision mediump float; + # define FUNC( + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_2 + expect compile_fail + both "" + precision mediump float; + # define FUNC(A a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_3 + expect compile_fail + both "" + precision mediump float; + # define FUNC(A,B,C a+b + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_4 + expect compile_fail + both "" + precision mediump float; + # define FUNC( + "" + end + +end # invalid_function_definitions + +group semantic "Semantic Tests" + + case ops_as_arguments + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define FOO(a, b) (1 a 9) b 2 + + void main() + { + out0 = float(FOO(+, *)); + ${OUTPUT} + } + "" + end + + case correct_order + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define FUNC(A) A + #define A 2.0 + + void main() + { + out0 = FUNC(A - 1.0); + ${OUTPUT} + } + "" + end + +end # semantic + +group predefined_macros "Predefined Macros Tests" + + case version + values { output float out0 = 100.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA __VERSION__ + out0 = float(AAA); + ${OUTPUT} + } + "" + end + + case gl_es_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + + void main() + { + out0 = float(GL_ES); + ${OUTPUT} + } + "" + end + + case gl_es_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define AAA(A) A + + void main() + { + out0 = float(AAA(GL_ES)); + ${OUTPUT} + } + "" + end + + case line_1 + values { output float out0 = 1.0; } + both "" + const mediump int line = __LINE__; + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(line); + ${OUTPUT} + } + "" + end + + case line_2 + # Note: Arguments are macro replaced in the first stage. + # Macro replacement list is expanded in the last stage. + values { output vec4 out0 = vec4(11.0, 11.0, 9.0, 10.0); } + + both "" + precision mediump float; + ${DECLARATIONS:single-line} + #define BBB __LINE__, /* + */ __LINE__ + #define AAA(a,b) BBB, a, b + + void main() + { + out0 = vec4(AAA(__LINE__, + __LINE__ + )); + ${OUTPUT} + } + "" + end + + case file + values { output float out0 = 0.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(__FILE__); + ${OUTPUT} + } + "" + end + + case if_gl_es + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case if_version + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if __VERSION__ == 100 + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + +end # predefined_macros + +group conditional_inclusion "Conditional Inclusion Tests" + + case basic_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA asdf + + #if defined AAA && !defined(BBB) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_2 + values { output float out0 = 1.0; } + # Note: this is expected to fail contrary to native dEQP, + # see https://github.com/KhronosGroup/WebGL/pull/1523 + expect compile_fail + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA defined(BBB) + + #if !AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + out0 = -1.0; + #elif 0 + out0 = -2.0; + #elif 1 + out0 = 1.0; + #else + out0 = -3.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_4 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + out0 = -1.0; + #elif 0 + out0 = -2.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_5 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + out0 = 1.0; + #elif 0 + out0 = -2.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~2 >> 1) & 1) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~(- - - - - 1 + + + + + +1) >> 1) & 1) + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + +end # conditional_inclusion + +group invalid_ops "Invalid Operations Tests" + + case invalid_op_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !((~(+ ++1 - - - -1) >> 1) & 1) + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_op_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !((~(+ + +1 - -- -1) >> 1) & 1) + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_1 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_2 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined() + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_3 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined( + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_4 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_5 + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined((AAA)) + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + #endif + } + "" + end + + case invalid_defined_expected_rparen + expect compile_fail + both "" + precision mediump float; + #define AAA 1 + + void main() + { + #if defined(AAA + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case defined_define + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define define 1 + #define AAA 1.0 + + void main() + { + out0 = AAA; + ${OUTPUT} + } + "" + end + +end # invalid_ops + +group undefined_identifiers "Undefined Identifiers Tests" + + case valid_undefined_identifier_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 || AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case valid_undefined_identifier_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 && AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case undefined_identifier_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 - CCC + (-AAA || BBB) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if -A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_4 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if ~A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_5 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_6 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define A 1 + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_7 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define B 1 + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_8 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define B 1 + #define A 2 + #undef A + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_9 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_10 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define A 0 + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_11 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define A 0 + #define B 2 + #undef B + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_12 + expect compile_fail + both "" + precision mediump float; + void main() + { + #define B 1 + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + +end # undefined_identifiers + +group invalid_conditionals "Invalid Conditionals Tests" + + case empty_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_if_defined + expect compile_fail + both "" + precision mediump float; + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef FOOBAR + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(2.0); + } + "" + end + + case elif_after_else + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(0.0); + #endif + } + "" + end + + case else_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case elif_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case endif_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case else_after_else + expect compile_fail + both "" + precision mediump float; + void main() + { + #if !GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case nested_elif_without_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case if_float + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1.231 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case tokens_after_if + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_elif + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 0 + #elif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_else + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #else foobar 1.231 + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_endif + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + #else + #endif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef FOOBAR foobar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef FOOBAR ,, +- << barbar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_conditionals + +group conditionals "Conditionals Tests" + + case unterminated_nested_blocks + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 1 + # if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case ifdef_1 + values { output float out0 = 1.0; } + both "" + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_2 + values { output float out0 = 1.0; } + both "" + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #if defined ( AAA) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case invalid_ifdef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifdef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case ifndef_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifndef_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define AAA + void main() + { + #ifndef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case invalid_ifndef + expect compile_fail + both "" + precision mediump float; + void main() + { + #ifndef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case mixed_conditional_inclusion + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #elif 1 + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case nested_if_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + # if __VERSION__ != 100 + out0 = -1.0; + # else + out0 = 1.0; + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + # if 0 + out0 = -1.0; + # else + # if 0 + out0 = -1.0; + # elif 1 + out0 = 1.0; + # else + out0 = -1.0; + # endif + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + # if 1 + out0 = -1.0; + # endif + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + +end # conditionals + +group directive "Directive Tests" + + case version + values { output float out0 = 1.0; } + both "" + /* asdf */ + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case version_is_less + expect compile_fail + both "" + #version 99 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_is_more + expect compile_fail + both "" + #version 101 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_missing + expect compile_fail + both "" + #version + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_1 + expect compile_fail + both "" + precision mediump float; + #version 100 + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_2 + expect compile_fail + both "" + #define FOO BAR + #version 100 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_1 + expect compile_fail + both "" + #version 100.0 + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_2 + expect compile_fail + both "" + #version foobar + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_version + expect compile_fail + both "" + #version AAA + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case additional_tokens + expect compile_fail + both "" + #version 100 foobar + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error_with_no_tokens + expect compile_fail + both "" + #error + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error + expect compile_fail + both "" + #define AAA asdf + #error 1 * AAA /* comment */ + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # directive + +group builtin "Built-in Symbol Tests" + + case line + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 1 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 234 10 + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_expression + values { output float out0 = 20.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line +20 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file_expression + values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #line (233 +10) (+10) + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_defined_1 + values { output float out0 = 4.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 4 + #line A + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_defined_2 + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 10 + #line 234 A + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case empty_line + expect compile_fail + both "" + precision mediump float; + void main() + { + #line + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_line_file_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #line 22 1.234 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #line 233 10 2 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_4 + expect compile_fail + both "" + precision mediump float; + void main() + { + #line foobar + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + +end # builtin + +group pragmas "Pragma Tests" + + # Note: pragma_vertex was removed compared to the native dEQP. + # This test was in the gles2-failures.txt skip list in the + # native dEQP. While it seemed theoretically correct, in + # practice, linking the program failed on Mac OS on all GPU + # types. Since this version of the dEQP is unlikely to be + # revisited, the test was removed here, rather than adding it + # to tcuSkipList.js. + + # Note: pragma_fragment was removed compared to the native dEQP. + # This test was buggy; it required that a varying that was not + # invariant in the vertex shader, but invariant in the fragment + # shader, must link. The test was in the gles2-failures.txt skip + # list in the native test suite. To avoid confusion the test was + # removed here, rather than adding it to tcuSkipList.js. + + case pragma_macro_exp + values { output float out0 = 1.0; } + both "" + #define off INVALID + /* pragma line not macro expanded */ + #pragma debug(off) + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case pragma_unrecognized_debug + expect build_successful + both "" + #pragma debug(1.23) + + // unrecognized preprocessor token + + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case pragma_unrecognized_token + expect build_successful + both "" + #pragma **% + + // trailing bytes form a valid but unrecognized preprocessor token + + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # pragmas + +group extensions "Extension Tests" + + case basic + values { output float out0 = 1.0; } + both "" + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case macro_exp + values { output float out0 = 1.0; } + both "" + #define warn enable + + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case missing_extension_name + expect compile_fail + both "" + #extension + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_extension_name + expect compile_fail + both "" + #extension 2 : all + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_colon + expect compile_fail + both "" + #extension all + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case expected_colon + expect compile_fail + both "" + #extension all ; + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_behavior + expect compile_fail + both "" + #extension all : + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_1 + expect compile_fail + both "" + #extension all : WARN + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_2 + expect compile_fail + both "" + #extension all : require + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_name + expect compile_fail + both "" + #extension all* : warn + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_behavior + expect compile_fail + both "" + #extension all : war*n + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_comment + expect compile_fail + both "" + #extension all : warn /*asd + precision mediump float; + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end +end # extensions + +group expressions "Expression Tests" + + case shift_left + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL << 2) == 16 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case shift_right + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 5 + out0 = 0.0; + #if (VAL >> 1) == 2 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case cmp_less_than + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 5 + out0 = 0.0; + #if (VAL < 6) && (-VAL < -4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case less_or_equal + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL <= 6) && (-VAL <= -6) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case or + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL | 5) == 7 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case and + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL & 5) == 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case xor + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL ^ 5) == 3 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case mod + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 12 + out0 = 0.0; + #if (VAL % 5) == 2 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_value + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) ) + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_tricky + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) + out0 = 0.0; + #if VAL) >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if_no + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL >= 4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_multi_if + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (4) + out0 = 0.0; + #if (((VAL)) >= (4)) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_single_if + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if (VAL >= 4) + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_ifelse_true + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + #if (VAL >= 4) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_ifelse_false + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + #if (VAL > 4) + out0 = 0.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_0 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if -4 + 5 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if (2 * 2) - 3 >= 0 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_simple_precedence_0 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 * 3 - 3 == 3 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_simple_precedence_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 - 2 / 2 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_1 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + void main() + { + #if defined(X) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_2 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + void main() + { + #if defined(X) == Y + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_3 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + void main() + { + #if defined(X) && defined(Y) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_4 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef X + void main() + { + #if defined(X) && defined(Y) + out0 = 0.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_5 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef X + void main() + { + #if defined(X) || defined(Y) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_6 + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + #define X 0 + #define Y 1 + #undef Y + void main() + { + #if defined(X) && (defined(Y) || (X == 0)) + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + +end # expressions + +group invalid_expressions "Invalid Expression Tests" + + case invalid_unary_expr + expect compile_fail + both "" + precision mediump float; + void main() + { + #if ! + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_binary_expr + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 3+4+ + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_expr + expect compile_fail + both "" + precision mediump float; + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_1 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 4 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_2 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 4 * * 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_3 + expect compile_fail + both "" + precision mediump float; + void main() + { + #if (4)(4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unopened_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + #if 4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + expect compile_fail + both "" + precision mediump float; + void main() + { + #if ((4 + 7) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_expressions + +group operator_precedence "Operator precedence" + + + case modulo_vs_not + values { output float out0 = 1.0; } + both "" + + #if ( 8 % ! 0 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_not + values { output float out0 = 1.0; } + both "" + + #if ( 8 / ! 0 ) == 8 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_not + values { output float out0 = 1.0; } + both "" + + #if ( 8 * ! 0 ) == 8 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_bit_invert + values { output float out0 = 1.0; } + both "" + + #if ( 8 % ~ 4 ) == 3 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_minus + values { output float out0 = 1.0; } + both "" + + #if ( 8 % - 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case modulo_vs_plus + values { output float out0 = 1.0; } + both "" + + #if ( 8 % + 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_bit_invert + values { output float out0 = 1.0; } + both "" + + #if ( 8 / ~ 2 ) == -2 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_minus + values { output float out0 = 1.0; } + both "" + + #if ( 8 / - 2 ) == -4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case div_vs_plus + values { output float out0 = 1.0; } + both "" + + #if ( 8 / + 2 ) == 4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_bit_invert + values { output float out0 = 1.0; } + both "" + + #if ( 8 * ~ 2 ) == -24 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_minus + values { output float out0 = 1.0; } + both "" + + #if ( 8 * - 2 ) == -16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case mul_vs_plus + values { output float out0 = 1.0; } + both "" + + #if ( 8 * + 2 ) == 16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_modulo + values { output float out0 = 1.0; } + both "" + + #if ( 8 - 3 % 2 ) == 7 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_div + values { output float out0 = 1.0; } + both "" + + #if ( 8 - 3 / 2 ) == 7 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case sub_vs_mul + values { output float out0 = 1.0; } + both "" + + #if ( 8 - 3 * 2 ) == 2 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_modulo + values { output float out0 = 1.0; } + both "" + + #if ( 8 + 3 % 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_div + values { output float out0 = 1.0; } + both "" + + #if ( 8 + 3 / 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case add_vs_mul + values { output float out0 = 1.0; } + both "" + + #if ( 8 + 3 * 2 ) == 14 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case rshift_vs_sub + values { output float out0 = 1.0; } + both "" + + #if ( 8 >> 3 - 2 ) == 4 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case rshift_vs_add + values { output float out0 = 1.0; } + both "" + + #if ( 8 >> 3 + 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case lshift_vs_sub + values { output float out0 = 1.0; } + both "" + + #if ( 8 << 3 - 2 ) == 16 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case lshift_vs_add + values { output float out0 = 1.0; } + both "" + + #if ( 8 << 3 + 2 ) == 256 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_or_equal_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 >= 3 >> 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_or_equal_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 >= 3 << 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_or_equal_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 <= 3 >> 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_or_equal_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 <= 3 << 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 > 3 >> 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case greater_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 > 3 << 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_vs_rshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 < 3 >> 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case less_vs_lshift + values { output float out0 = 1.0; } + both "" + + #if ( 8 < 3 << 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_greater_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 >= 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_less_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 <= 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_greater + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 > 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case not_equal_vs_less + values { output float out0 = 1.0; } + both "" + + #if ( 8 != 3 < 2 ) == 1 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_greater_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 >= 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_less_or_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 <= 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_greater + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 > 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case equal_vs_less + values { output float out0 = 1.0; } + both "" + + #if ( 8 == 3 < 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_and_vs_not_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 & 3 != 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_and_vs_equal + values { output float out0 = 1.0; } + both "" + + #if ( 8 & 3 == 2 ) == 0 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case xor_vs_bitwise_and + values { output float out0 = 1.0; } + both "" + + #if ( 8 ^ 3 & 2 ) == 10 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case bitwise_or_vs_xor + values { output float out0 = 1.0; } + both "" + + #if ( 8 | 3 ^ 2 ) == 9 + #define VAL 1.0 + #else + #define VAL 0.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_and_vs_bitwise_or + values { output float out0 = 1.0; } + both "" + + #if ( 0 && 3 | 2 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_and_vs_bitwise_and + values { output float out0 = 1.0; } + both "" + + #if ( 0 && 4 & 2 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + + case logical_or_vs_logical_and + values { output float out0 = 1.0; } + both "" + + #if ( 0 || 4 && 0 ) + #define VAL 0.0 + #else + #define VAL 1.0 + #endif + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = VAL; + ${OUTPUT} + } + "" + end + +end # operator_precedence diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html new file mode 100644 index 000000000..be660758b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'qualification_order'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test new file mode 100644 index 000000000..4b20ad8ee --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test @@ -0,0 +1,785 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group variables "Order of qualification in variable declarations." + + group valid "Valid orderings." + + case invariant_storage_precision + expect pass + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + invariant varying lowp float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + invariant varying lowp float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision + expect pass + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying lowp float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying lowp float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage + expect pass + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + invariant varying float x0; + + uniform float x1; + + attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + invariant varying float x0; + + uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case invariant_precision_storage + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + invariant lowp varying float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + invariant lowp varying float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_precision + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying invariant lowp float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying invariant lowp float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying lowp invariant float x0; + + uniform mediump float x1; + + attribute mediump float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying lowp invariant float x0; + + uniform mediump float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_storage + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + lowp invariant varying float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + lowp invariant varying float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_invariant + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + lowp varying invariant float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + lowp varying invariant float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + lowp varying float x0; + + mediump uniform float x1; + + mediump attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + lowp varying float x0; + + mediump uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant + expect compile_fail + values {} + + vertex "" + precision mediump float; + attribute highp vec4 dEQP_Position; + + varying invariant float x0; + + uniform float x1; + + attribute float x2; + + void main() + { + x0 = 1.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + precision mediump float; + + varying invariant float x0; + + uniform float x1; + + void main() + { + float result = x0 + x1; + gl_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # invalid + +end # variables +group parameters "Order of qualification in function parameters." + + group valid "Valid orderings." + + case storage_parameter_precision + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const in lowp float x) + { + return x + 1.0; + } + + void foo1 ( out mediump float x) + { + x = 1.0; + } + + float foo2 ( inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case storage_parameter + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const in float x) + { + return x + 1.0; + } + + void foo1 ( out float x) + { + x = 1.0; + } + + float foo2 ( inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case storage_precision + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp float x) + { + return x + 1.0; + } + + void foo1 ( mediump float x) + { + x = 1.0; + } + + float foo2 ( mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_precision + expect pass + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in lowp float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case storage_precision_parameter + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp in float x) + { + return x + 1.0; + } + + void foo1 ( mediump out float x) + { + x = 1.0; + } + + float foo2 ( mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_storage_precision + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in const lowp float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_precision_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in lowp const float x) + { + return x + 1.0; + } + + void foo1 (out mediump float x) + { + x = 1.0; + } + + float foo2 (inout mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_storage_parameter + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const in float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_parameter_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp in const float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case parameter_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (in const float x) + { + return x + 1.0; + } + + void foo1 (out float x) + { + x = 1.0; + } + + float foo2 (inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_storage + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const float x) + { + return x + 1.0; + } + + void foo1 (mediump float x) + { + x = 1.0; + } + + float foo2 (mediump float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + case precision_parameter + expect compile_fail + values {} + + both "" + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp in float x) + { + return x + 1.0; + } + + void foo1 (mediump out float x) + { + x = 1.0; + } + + float foo2 (mediump inout float x) + { + return x + 1.0; + } + + void main() + { + ${SETUP} + float result; + foo1(result); + float x0 = foo0(1.0); + foo2(result); + ${OUTPUT} + } + "" + end + + end # invalid + +end # parameters diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html new file mode 100644 index 000000000..b98b97b77 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'reserved_operators'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test new file mode 100644 index 000000000..dda1f1aad --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test @@ -0,0 +1,250 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +case operator_modulo + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value % 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_not + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value = ~value; + ${OUTPUT} + } + "" +end +case operator_bitwise_shift_left + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value << 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_shift_right + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value >> 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_and + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value & 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_xor + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value ^ 1; + ${OUTPUT} + } + "" +end +case operator_bitwise_or + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value | 1; + ${OUTPUT} + } + "" +end +case operator_assign_modulo + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value %= 1; + ${OUTPUT} + } + "" +end +case operator_assign_shift_left + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value <<= 1; + ${OUTPUT} + } + "" +end +case operator_assign_shift_right + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value >>= 1; + ${OUTPUT} + } + "" +end +case operator_assign_and + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value &= 1; + ${OUTPUT} + } + "" +end +case operator_assign_xor + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value ^= 1; + ${OUTPUT} + } + "" +end +case operator_assign_or + expect compile_fail + values {} + + both "" + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + int value = 100; + value |= 1; + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html new file mode 100644 index 000000000..5d01ef844 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'scoping'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test new file mode 100644 index 000000000..a387631af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test @@ -0,0 +1,823 @@ +group valid "Valid scoping and name redeclaration cases" + + case local_variable_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + int a = in0; + + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_local_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = -1; + } + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + { + int a = in0; + + out0 = a; + } + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_local_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + for (int a = 0; a < 10; a++) + { + } + out0 = a; + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = 5; + + void main() + { + ${SETUP} + for (int a = 0; a < 10; a++) + { + } + out0 = in0 + a - 5; + ${OUTPUT} + } + "" + end + + case variable_in_if_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = 1; + + void main() + { + ${SETUP} + if (true) + int a = 42; + out0 = a*in0; + ${OUTPUT} + } + "" + end + + case variable_from_outer_scope_visible_in_initializer + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = a+5, b = a-5; + out0 = b; + a = 42; + } + out0 = out0 + a - in0; + ${OUTPUT} + } + "" + end + + case local_int_variable_hides_struct_type + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + struct S { int val; }; + + void main() + { + ${SETUP} + int S = S(in0).val; + out0 = S; + ${OUTPUT} + } + "" + end + + case local_struct_variable_hides_struct_type + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + struct S { int val; }; + + void main() + { + ${SETUP} + S S = S(in0); + out0 = S.val; + ${OUTPUT} + } + "" + end + + case local_variable_hides_function + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int foo (int x) { return x; } + + void main() + { + ${SETUP} + int foo = in0; + out0 = foo; + ${OUTPUT} + } + "" + end + + case function_parameter_hides_global_variable + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + int func (int a) { return a; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case function_parameter_hides_struct_type + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + struct S { int x; }; + + int func (int S) { return S; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case function_parameter_hides_function + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int func (int func) { return func; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case local_variable_in_inner_scope_hides_function_parameter + version 100 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + int func (int inp, int x) { { int x = 5; return inp + x - 5; } } + + void main() + { + ${SETUP} + out0 = func(in0, 42); + ${OUTPUT} + } + "" + end + +end + +group invalid "Invalid scoping behavior" + + case redeclare_global_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + int a; + float a; + + void main() + { + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_local_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a; + float a; + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_for_init_statement_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + for (int i = 0; i < 10; i++) + { + int i = 11; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_for_condition_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + for (int i = 0; int a = (i < 10); i++) + { + int a = 0; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_for_init_statement_variable_in_for_condition + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a; + for (int i = 0; int i = (i < 10); i++) + { + a = sin(i); + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_while_condition_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a = 0; + while (int i = (a < 5)) + { + int i = 11; + a += i; + } + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case redeclare_function + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func(float x); + float func(float x); + + float func(float x) { return x + 1.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case redefine_function + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func(float x); + + float func(float x) { return x + 1.0; } + float func(float x) { return x + 2.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case redeclare_builtin + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float sin(float x); + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case redefine_builtin + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float sin(float x) { return x + 1.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case conflict_function_struct + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void f(int x); + struct f { int x; }; + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1); + } + "" + end + + case conflict_function_variable + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void f(int x); + float f; + + void main() + { + f = 1.0; + ${POSITION_FRAG_COLOR} = vec4(f); + } + "" + end + + case use_global_variable_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void func() + { + a = 2.0; + } + + float a; + + void main() + { + func(); + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_local_variable_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a = 1.0; + a = b; + float b = 2.0; + + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_struct_type_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func (float x) { return S(x).val; } + struct S { float val; }; + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case use_function_before_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func (float x) { return bar(x); } + float bar (float x) { return x; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0)); + } + "" + end + + case use_variable_from_block_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + { + float a = 1.0; + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_if_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + if (true) + float a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_else_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + if (false) + float a = 1.0; + else + float b = 2.0; + ${POSITION_FRAG_COLOR} = vec4(b); + } + "" + end + + case use_variable_from_if_in_else + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float a = 1.0; + if (true) + { + float b = 2.0; + } + else + { + a = b; + } + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case use_variable_from_for_init_statement_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = 0.0; + for (int i = 0; i < 10; i++) + { + x += sin(i); + } + ${POSITION_FRAG_COLOR} = vec4(float(i)); + } + "" + end + + case use_variable_from_while_condition_in_outer_scope + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + int a = 1; + while (bool b = (a == 1)) + { + a++; + } + ${POSITION_FRAG_COLOR} = vec4(float(b)); + } + "" + end + + case use_parameter_names_from_function_declaration + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + float func(float a, float b); + + float func(float x, float y) { return a+b; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0)); + } + "" + end + + case variable_not_visible_in_own_initializer + version 100 es + expect compile_fail + both "" + #version 100 + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = x; + ${POSITION_FRAG_COLOR} = vec4(x); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html new file mode 100644 index 000000000..864ad8046 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html @@ -0,0 +1,462 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> +<script src="shader-utils.js"></script> +<script src="shader-library.js"></script> +<script src="shader-library-case.js"></script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<script> + + description("Testing the .test parser components."); + + var wtu = WebGLTestUtils; + var successfullyParsed = false; + var parser = new shaderLibrary.Parser(); + + + // this array of functions is processed sequentially. + // returning false will abort + var tests = [ + + + function() { + var result = shaderLibrary.isWhitespace(" "); + test_result( + "Checking isWhitespace. Passing \" \". Expecting true", + result === true, result + ); + return true; + }, + function() { + var result = shaderLibrary.isWhitespace("q"); + test_result( + "Checking isWhitespace. Passing \"q\". Expecting false", + result === false, result + ); + return true; + }, + function() { + var result = shaderLibrary.isWhitespace(" \r\n\t"); + test_result( + "Checking isWhitespace. Passing \" \\r\\n\\t\". Expecting true", + result === true, result + ); + return true; + }, + function() { + var result = shaderLibrary.isWhitespace(" \r\n\tq"); + test_result( + "Checking isWhitespace. Passing \" \\r\\n\\tq\". Expecting false", + result === false, result + ); + return true; + }, + + function() { + try { + var result = shaderLibrary.removeExtraIndentation( + "\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd" + ); + } catch (err) { + result = "aborted"; + } + + test_result( + "Checking removeExtraIndentation. \ + Passing \"\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd\". \ + Expecting \"aaaa\n\tbbbb\ncccc\ndddd\"", + result === "aaaa\n\tbbbb\ncccc\ndddd", + result + ); + return true; + }, + + + function() { + // looking for private access to the parser object + var result = (typeof parser.priv != 'undefined'); + test_result("looking for private member access", result, result); + return result; + }, + + function() { + try { + var result = parser.priv.parseIntLiteral("42"); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking int parser. Passing \"42\". Expecting 42", + result === 42, result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseIntLiteral("-5"); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking int parser. Passing \"-5\". Expecting -5", + result === -5, result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseIntLiteral("42.9"); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking int parser. Passing \"42.9\". Expecting 42", + result === 42, result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseFloatLiteral("42.9"); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking float parser. Passing \"42.9\". Expecting 42.9", + result === 42.9, result + ); + return true; + }, + + + function() { + try { + var result = parser.priv.parseStringLiteral("\"hello world\""); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking string parser. Passing \"\"hello world\"\". Expecting \"hello world\"", + result == "hello world", result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseStringLiteral("\"hello world\"extra"); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking string parser. Passing \"\"hello world\"extra\". Expecting \"hello world\"", + result == "hello world", result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseStringLiteral("\"\\\"\\\"\\\"\"\\\"\""); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking string parser. Passing \"\"\\\"\\\"\\\"\"\\\"\"\". Expecting \"\"\"\"\"", + result == "\"\"\"", result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseStringLiteral("\"newline test\\nnewline test\""); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking string parser. Passing \"\"newline test\\nnewline test\"\". Expecting \"newline test\nnewline test\"", + result == "newline test\nnewline test", result + ); + return true; + }, + function() { + try { + var result = parser.priv.parseStringLiteral("\"tab test\\ttab test\""); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking string parser. Passing \"\"tab test\\ttab test\"\". Expecting \"tab test\ttab test\"", + result == "tab test\ttab test", result + ); + return true; + }, + + function() { + try { + var result = parser.priv.parseShaderSource( + "\"\"\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd\"\"" + ); + } catch (err) { + result = "aborted"; + } + + test_result( + "Checking parseShaderSource. \ + Passing \"\"\"\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd\"\"\". \ + Expecting \"aaaa\n\tbbbb\ncccc\ndddd\"", + result === "aaaa\n\tbbbb\ncccc\ndddd", + result + ); + return true; + }, + + function() { + try { + var result = parser.priv.advanceTokenTester("bool value = true;", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"bool value = true;\", 0", + result.idType == parser.priv.Token.TOKEN_BOOL && result.value == "bool", + result.name + ": " + result.value + ); + }, + + function() { + try { + var result = parser.priv.advanceTokenTester("bool value = true;", 4); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"bool value = true;\", 4", + result.idType == parser.priv.Token.TOKEN_IDENTIFIER && result.value == "value", + result.name + ": " + result.value + ); + }, + //* + function() { + try { + var result = parser.priv.advanceTokenTester("bool value = true;", 11); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"bool value = true;\", 11", + result.idType == parser.priv.Token.TOKEN_ASSIGN, + result.name + ": " + result.value + ); + }, + //*/ + function() { + try { + var result = parser.priv.advanceTokenTester("bool value = true;", 12); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"bool value = true;\", 12", + result.idType == parser.priv.Token.TOKEN_TRUE && result.value == "true", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("bool value = true;", 17); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"bool value = true;\", 17", + result.idType == parser.priv.Token.TOKEN_SEMI_COLON && result.value == ";", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("-7", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"-7\", 0", + result.idType == parser.priv.Token.TOKEN_MINUS && result.value == "-", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("-7", 1); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"-7\", 1", + result.idType == parser.priv.Token.TOKEN_INT_LITERAL && result.value == "7", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("3.145", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"3.145\", 0", + result.idType == parser.priv.Token.TOKEN_FLOAT_LITERAL && result.value == "3.145", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("1.0e+10", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"1.0e+10\", 0", + result.idType == parser.priv.Token.TOKEN_FLOAT_LITERAL && result.value == "1.0e+10", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("1.0e", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"1.0e\", 0", + result === "aborted", + result + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("\"\"shader source\"\";", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"\"\"shader source\"\";\", 0", + result.idType == parser.priv.Token.TOKEN_SHADER_SOURCE && result.value == "\"\"shader source\"\"", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("\"string\";", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"\"string\";\", 0", + result.idType == parser.priv.Token.TOKEN_STRING && result.value == "\"string\"", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("\'string\';", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"\'string\';\", 0", + result.idType == parser.priv.Token.TOKEN_STRING && result.value == "\'string\'", + result.name + ": " + result.value + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("\'string\";", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"\'string\";\", 0", + result === "aborted", + result + ); + }, + function() { + try { + var result = parser.priv.advanceTokenTester("\'string\\", 0); + } catch (err) { + result = "aborted"; + } + test_result( + "Checking advanceToken. Passing \"\'string\\\", 0", + result === "aborted", + result + ); + }, + function() { + try { + var result = parser.priv.mapDataTypeToken(parser.priv.Token.TOKEN_INT); + } catch (err) { + var result = "aborted"; + } + test_result( + "Checking advanceToken. Passing parser.priv.Token.TOKEN_INT", + result === shaderUtils.DataType.TYPE_INT, + result + ); + }, + + function() { + successfullyParsed = true;i + return true; + }, + + ]; + + var current = 0; + + function test_result(description, result, additional) { + switch (typeof(additional)) { + case "undefined": + break; + case "string": + description += ": \"" + additional + "\""; + break; + default: + description += ": " + additional; + break; + } + if (result) { + testPassed(description); + } else { + testFailed(description); + } + } + + function do_next() { + if (tests[current]() !== false && tests.length > ++current) { + setTimeout(do_next, 0); + } else { + on_complete(); + } + } + + function on_complete() { + var testPost = document.createElement('script'); + testPost.src = "../../../../js/js-test-post.js"; + document.body.appendChild(testPost); + } + + do_next(); + +// +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html new file mode 100644 index 000000000..542ca92d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = 'swizzles'; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test new file mode 100644 index 000000000..7e82c3e60 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test @@ -0,0 +1,6811 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +group vector_swizzles "Vector Swizzles" + + case mediump_vec2_x + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xx + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xy + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yx + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yxy + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xyxx + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yyyy + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_s + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ss + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_st + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ts + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tst + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec2_stss + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tttt + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec2_r + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rr + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rg + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gr + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_grg + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rgrr + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gggg + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_x + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec3_z + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zyx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xxx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzy + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_yxy + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xzx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyyx + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzzz + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_s + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec3_p + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pts + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sss + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppt + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_vec3_tst + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sps + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stts + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pppp + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_r + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec3_b + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rgb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bgr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rrr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbg + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_grg + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rbr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rggr + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbbb + values + { + input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_vec4_x + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec4_w + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wz + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_www + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyw + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzy + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyzw + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzyx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xxxx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyyy + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwww + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzzw + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwwy + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyxx + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_zzwz + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_s + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec4_q + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qs + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qp + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ttq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpt + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stpq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpts + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ssss + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_tttt + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qppq + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqt + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stss + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ppqp + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_r + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec4_a + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ar + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ab + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaa + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gga + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abg + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgba + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abgr + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rrrr + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gggg + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaaa + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abba + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaag + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgrr + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_bbab + values + { + input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_x + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xx + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xy + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yx + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yxy + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xyxx + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yyyy + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_s + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ss + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_st + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ts + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tst + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_stss + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tttt + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_r + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rr + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rg + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gr + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_grg + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rgrr + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gggg + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_x + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_z + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zyx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xxx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzy + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_yxy + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xzx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyyx + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzzz + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_s + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_p + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pts + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sss + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppt + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_tst + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sps + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stts + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pppp + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_r + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_b + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | -4 | -51 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rgb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bgr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rrr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbg + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_grg + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rbr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rggr + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbbb + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_x + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_w + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wz + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_www + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyw + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzy + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyzw + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzyx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xxxx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyyy + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwww + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzzw + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwwy + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyxx + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_zzwz + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_s + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_q + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qs + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qp + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ttq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpt + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stpq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpts + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ssss + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_tttt + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qppq + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqt + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stss + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ppqp + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_r + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | -32 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_a + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 9 | 24 | 0 ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ar + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ab + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaa + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gga + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abg + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgba + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abgr + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rrrr + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gggg + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaaa + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abba + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaag + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgrr + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_bbab + values + { + input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_x + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xx + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xy + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yx + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yxy + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xyxx + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yyyy + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_s + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ss + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_st + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ts + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tst + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_stss + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tttt + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_r + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rr + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rg + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gr + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_grg + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rgrr + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gggg + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_x + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_z + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zyx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xxx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzy + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_yxy + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xzx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyyx + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzzz + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_s + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_p + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pts + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sss + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppt + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_tst + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sps + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stts + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pppp + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_r + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_b + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bool out0 = [ false | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rgb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bgr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rrr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbg + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_grg + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rbr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rggr + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbbb + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_x + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_w + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wz + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_www + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyw + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzy + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyzw + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzyx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xxxx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyyy + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwww + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzzw + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwwy + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyxx + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_zzwz + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_s + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_q + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qs + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qp + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ttq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpt + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stpq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpts + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ssss + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_tttt + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qppq + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqt + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stss + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ppqp + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_r + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | false | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_a + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bool out0 = [ true | true | false | true | false ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ar + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ab + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaa + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gga + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abg + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgba + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abgr + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rrrr + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gggg + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaaa + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abba + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaag + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgrr + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_bbab + values + { + input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + +end # vector_swizzles diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html new file mode 100644 index 000000000..8d56d4dbe --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html @@ -0,0 +1,36 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>WebGL Shader Conformance Tests</title> +<link rel="stylesheet" href="../../../../resources/js-test-style.css"/> +<script src="../../../../js/js-test-pre.js"></script> +<script src="../../../../js/webgl-test-utils.js"></script> + +<script src="../../../../closure-library/closure/goog/base.js"></script> +<script src="../../../deqp-deps.js"></script> +<script>goog.require('modules.shared.glsShaderLibrary');</script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> +<canvas id="canvas" width="200" height="100"> </canvas> +<script> +testName = ___TEST_NAME___; +description("Shader test: " + testName + "."); + +var getFilter = function() { + var queryVars = window.location.search.substring(1).split('&'); + + for (var i = 0; i < queryVars.length; i++) { + var value = queryVars[i].split('='); + if (decodeURIComponent(value[0]) === 'filter') + return decodeURIComponent(value[1]); + } +} + + +modules.shared.glsShaderLibrary.run(testName, getFilter()) + +</script> +</body> +</html> |