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 | |
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')
69 files changed, 77491 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> diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt new file mode 100644 index 000000000..d98d8130b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt @@ -0,0 +1,17 @@ +arrays.html +conditionals.html +constants.html +constant_expressions.html +conversions.html +declarations.html +fragdata.html +functions.html +invalid_texture_functions.html +keywords.html +linkage.html +negative.html +preprocessor.html +qualification_order.html +scoping.html +switch.html +swizzles.html diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html new file mode 100644 index 000000000..1a79102d0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.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 = 'arrays'; +description("Shader test: " + testName + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/arrays.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test new file mode 100644 index 000000000..f6276522b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test @@ -0,0 +1,1962 @@ +#X1. Type: float[5] // An array type with 5 elements +#X2. Return value: float[5] func() { ... } // Function with a 5-element array return value +#X3. Array constructor: float[3] (1.0, 2.0, 5.5) // 3-element array with given elements +# // Fails with array of matrices! +#X4. As unnamed parameter: void func(float[5]); +#X5. Variable declaration: float[5] a; // Equivalent to float a[5]; (?) +#X6. Empty brackets: float x[] = float[] (1.0, 2.0, 3.0); // Size of x is 3 +# float y[] = float[3] (1.0, 2.0, 3.0); // Size of y is 3 (equivalent) +# float z[] = y; // Size of z is 3 +#X7. Testing that 2-dimensional arrays don't work: float a[5][3]; // Illegal +# float[5] a[3]; // Illegal +#X8. Testing that array declaration with dynamic variables as array size won't work. +#X9. Testing length() operator: z.length(); // Returns 3 for z defined before +#X10. Test C/C++ style {}-constructor +#X11. Test struct arrays +#X12. Test array element access at initialization with const/dynamic values + +group constructor "Array constructors" + + case float3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[3] x; + x = float[3] (in0.z, in0.x, in0.y); + out0 = vec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case float4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 0.2) | vec4(7.4, -1.0, 2.0, -1.3) | vec4(3.0, 1.6, -2.0, 0.5) ]; + output vec4 out0 = [ vec4(2.0, 0.5, 0.2, 1.0) | vec4(2.0, 7.4, -1.3, -1.0) | vec4(-2.0, 3.0, 0.5, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[4] x; + x = float[4] (in0.z, in0.x, in0.w, in0.y); + out0 = vec4(x[0], x[1], x[2], x[3]); + ${OUTPUT} + } + "" + end + + case int3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[3] x; + x = int[3] (in0.z, in0.x, in0.y); + out0 = ivec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case int4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ]; + output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[4] x; + x = int[4] (in0.z, in0.x, in0.w, in0.y); + out0 = ivec4(x[0], x[1], x[2], x[3]); + ${OUTPUT} + } + "" + end + + case bool3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, true, false) ]; + output bvec3 out0 = [ bvec3(false, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[3] x; + x = bool[3] (in0.z, in0.x, in0.y); + out0 = bvec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case bool4 + version 300 es + values + { + input bvec4 in0 = [ bvec4(true, true, false, false) ]; + output bvec4 out0 = [ bvec4(false, true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[4] x; + x = bool[4] (in0.z, in0.x, in0.y, in0.w); + out0 = bvec4(x[0], x[1], x[2], x[3]); + ${OUTPUT} + } + "" + end + + case struct3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + + + void main() + { + ${SETUP} + + struct test + { + float f; + vec3 v; + }; + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[3] x = test[3] (a, b, c); + + out0 = vec3(x[0].f, x[1].v.y, x[2].v.x); + ${OUTPUT} + } + "" + end + + case struct4 + version 300 es + values + { + input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ]; + output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + + void main() + { + ${SETUP} + + + struct test + { + float f; + vec3 v; + }; + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + test d = test(-in0.w, vec3(-in0.w, -in0.x, -in0.z)); + + test[4] x = test[4] (a, b, c, d); + + out0 = vec4(x[0].f, x[1].v.y, x[2].v.x, x[3].v.x); + ${OUTPUT} + } + "" + end + + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + + vec3[3] x; + x = vec3[3] ( vec3(in0.x, in0.y, in0.z) , + vec3(-in0.y, -in0.z, -in0.x), + vec3(in0.z, in0.x, in0.y) ); + out0 = vec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case int_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + + ivec3[3] x; + x = ivec3[3] ( ivec3(in0.x, in0.y, in0.z) , + ivec3(-in0.y, -in0.z, -in0.x), + ivec3(in0.z, in0.x, in0.y) ); + out0 = ivec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case bool_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + + bvec3[3] x; + x = bvec3[3] ( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x), + bvec3(in0.z, in0.x, in0.y) ); + out0 = bvec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y) , + mat3( in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + +end # type + +group return "Arrays as return value" + + case float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float[3] func(vec3 a) + { + return float[3] (a.z, -a.x, a.y); + } + + void main() + { + ${SETUP} + float[3] x = func(in0); + out0 = vec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case int + version 300 es + values + { + input ivec3 in0 = [ ivec3(4, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, -4, 1) | ivec3(2, -7, -1) | ivec3(-2, -3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + int[3] func(ivec3 a) + { + return int[3] (a.z, -a.x, a.y); + } + + void main() + { + ${SETUP} + int[3] x = func(in0); + out0 = ivec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + case bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, true, true) ]; + output bvec3 out0 = [ bvec3(true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool[3] func(bvec3 a) + { + return bool[3] (a.z, a.x, a.y); + } + + void main() + { + ${SETUP} + bool[3] x = func(in0); + out0 = bvec3(x[0], x[1], x[2]); + ${OUTPUT} + } + "" + end + + + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ]; + output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec3[3] func(vec3[3] a) + { + return vec3[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) , + vec3(in0.y, -in0.z, in0.x) , + vec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = vec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + test[3] func(test[3] a) + { + return test[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[3] t = test[3] (a, b, c); + test[3] x = func(t); + + out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x); + ${OUTPUT} + } + "" + end + + case int_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ]; + output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + ivec3[3] func(ivec3[3] a) + { + return ivec3[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) , + ivec3(in0.y, -in0.z, in0.x) , + ivec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = ivec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case bool_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + bvec3[3] func(bvec3[3] a) + { + return bvec3[3] (a[1], a[2], a[0]); + } + + void main() + { + ${SETUP} + bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x) , + bvec3(in0.z, in0.x, in0.y) ); + x = func(x); + out0 = bvec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + "" + end + + case float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y); + a[2] = mat3(in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + +end # return + +group unnamed_parameter "Array type as unnamed parameter of a function prototype" + + case float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float[3] func(float[3]); + + void main() + { + ${SETUP} + float[3] a = float[3] (in0.x, in0.y, in0.z); + float[3] b = func(a); + out0 = vec3(b[0], b[1], b[2]); + ${OUTPUT} + } + + float[3] func(float[3] a) + { + return float[3] (a[2], a[0], a[1]); + } + + "" + end + + case int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + int[3] func(int[3]); + + void main() + { + ${SETUP} + int[3] a = int[3] (in0.x, in0.y, in0.z); + int[3] b = func(a); + out0 = ivec3(b[0], b[1], b[2]); + ${OUTPUT} + } + + int[3] func(int[3] a) + { + return int[3] (a[2], a[0], a[1]); + } + + "" + end + + case bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, true, true) ]; + output bvec3 out0 = [ bvec3(true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool[3] func(bool[3]); + + void main() + { + ${SETUP} + bool[3] a = bool[3] (in0.x, in0.y, in0.z); + bool[3] b = func(a); + out0 = bvec3(b[0], b[1], b[2]); + ${OUTPUT} + } + + bool[3] func(bool[3] a) + { + return bool[3] (a[2], a[0], a[1]); + } + + "" + end + + case struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + test[3] func(test[3]); + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[3] t = test[3] (a, b, c); + test[3] x = func(t); + out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x); + ${OUTPUT} + } + + test[3] func(test[3] a) + { + return test[3] (a[1], a[2], a[0]); + } + + "" + end + + case float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ]; + output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + vec3[3] func(vec3[3]); + + void main() + { + ${SETUP} + vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) , + vec3(in0.y, -in0.z, in0.x) , + vec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = vec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + + vec3[3] func(vec3[3] a) + { + return vec3[3] (a[1], a[2], a[0]); + } + "" + end + + case int_vec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ]; + output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + ivec3[3] func(ivec3[3]); + + void main() + { + ${SETUP} + ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) , + ivec3(in0.y, -in0.z, in0.x) , + ivec3(-in0.z, in0.x, in0.y) ); + x = func(x); + out0 = ivec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + + ivec3[3] func(ivec3[3] a) + { + return ivec3[3] (a[1], a[2], a[0]); + } + "" + end + + case bool_vec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) ]; + output bvec3 out0 = [ bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + bvec3[3] func(bvec3[3]); + + void main() + { + ${SETUP} + bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x) , + bvec3(in0.z, in0.x, in0.y) ); + x = func(x); + out0 = bvec3(x[0].x, x[1].y, x[2].z); + ${OUTPUT} + } + + bvec3[3] func(bvec3[3] a) + { + return bvec3[3] (a[1], a[2], a[0]); + } + + "" + end + + case float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3]); + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + "" + end + + case int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3]); + + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y); + a[2] = mat3(-in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + "" + end + + case bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3[3] func(mat3[3]); + void main() + { + ${SETUP} + mat3[3] a, b; + a[0] = mat3(in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z); + a[1] = mat3(in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y); + a[2] = mat3(in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x); + + b = func(a); + + mat3 b0 = b[0]; + mat3 b1 = b[1]; + mat3 b2 = b[2]; + + float ret0 = b0[0][0]; + float ret1 = b1[1][1]; + float ret2 = b2[2][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + + mat3[3] func(mat3[3] x) + { + mat3[3] r; + r[0] = x[1]; + r[1] = x[2]; + r[2] = x[0]; + return r; + } + "" + end + +end # unnamed_parameter + +group declaration "Declaring arrays" + + case implicit_size_float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ]; + output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[] x = float[] (in0.z, in0.x, in0.y); + float[] y = x; + + out0 = vec3(y[0], y[1], y[2]); + ${OUTPUT} + } + "" + end + + case implicit_size_int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ]; + output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[] x = int[] (in0.z, in0.x, in0.y); + int[] y = x; + + out0 = ivec3(y[0], y[1], y[2]); + ${OUTPUT} + } + "" + end + + case implicit_size_bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, true, true) ]; + output bvec3 out0 = [ bvec3(true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[] x = bool[] (in0.z, in0.x, in0.y); + bool[] y = x; + + out0 = bvec3(y[0], y[1], y[2]); + ${OUTPUT} + } + "" + end + + case implicit_size_struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[] x = test[] (c, b, a); + test[] y = x; + + out0 = vec3(y[0].v.x, y[1].v.y, y[2].v.z); + ${OUTPUT} + } + "" + end + + case implicit_size_float_vec3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ]; + output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3[] x = vec3[] ( vec3(in0.x, in0.y, -in0.z) , + vec3(in0.y, -in0.z, in0.x) , + vec3(-in0.z, in0.x, in0.y) ); + vec3[] y = x; + out0 = vec3(y[0].x, y[1].y, y[2].z); + ${OUTPUT} + } + "" + end + + case implicit_size_int_ivec3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ]; + output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3[] x = ivec3[] ( ivec3(in0.x, in0.y, -in0.z) , + ivec3(in0.y, -in0.z, in0.x) , + ivec3(-in0.z, in0.x, in0.y) ); + ivec3[] y = x; + out0 = ivec3(y[0].x, y[1].y, y[2].z); + ${OUTPUT} + } + "" + end + + case implicit_size_bool_bvec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3[] x = bvec3[] ( bvec3(in0.x, in0.y, in0.z) , + bvec3(in0.y, in0.z, in0.x) , + bvec3(in0.z, in0.x, in0.y) ); + bvec3[] y = x; + out0 = bvec3(y[0].x, y[1].y, y[2].z); + ${OUTPUT} + } + "" + end + + case implicit_size_float_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ]; + output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = vec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case implicit_size_int_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ]; + output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y, + in0.z, in0.x, -in0.y) , + mat3( -in0.z, -in0.z, in0.z, + -in0.y, -in0.y, in0.y, + -in0.x, -in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = ivec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + case implicit_size_bool_mat3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output bvec3 out0 = [ bvec3(true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z, + in0.x, in0.y, in0.z) , + mat3( in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y, + in0.z, in0.x, in0.y) , + mat3( in0.z, in0.z, in0.z, + in0.y, in0.y, in0.y, + in0.x, in0.x, in0.x) ); + + mat3 a0 = a[0]; + mat3 a1 = a[1]; + mat3 a2 = a[2]; + + float ret0 = a0[2][0]; + float ret1 = a1[0][2]; + float ret2 = a2[1][2]; + + out0 = bvec3(ret0, ret1, ret2); + ${OUTPUT} + } + "" + end + + + case constant_expression_array_size + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + const int a = 4; + + void main () + { + const int b = 5; + float[a] array1; + float[b] array2; + float[array1.length()] array3; + float[a+b] array4; + ${OUTPUT} + } + "" + end + + case constant_expression_array_access + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + const int a = 3; + + void main () + { + ${SETUP} + const int b = 2; + float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [a]; + float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [b+2]; + float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [5]; + out0 = vec3(x, y, z); + ${OUTPUT} + } + "" + end + + case dynamic_expression_array_access + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + input ivec2 in1 = ivec2(3, 2); + output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ${SETUP} + float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x]; + float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.y+2]; + float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x+in1.y]; + out0 = vec3(x, y, z); + ${OUTPUT} + } + "" + end + + case multiple_declarations_single_statement_explicit + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output vec3 out0 = [ vec3(2.0, -1.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ${SETUP} + float[] x = float[6] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x), + y = float[2] (in0.x, -in0.y); + out0 = vec3(x[2], y[1], x[0]); + ${OUTPUT} + } + "" + end + + case multiple_declarations_single_statement_implicit + version 300 es + values + { + input ivec3 in0 = [ ivec3(5, 1, 2) ]; + output ivec3 out0 = [ ivec3(2, -1, 5) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ${SETUP} + int[] x = int[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x), + y = int[] (in0.x, -in0.y); + out0 = ivec3(x[2], y[1], x[0]); + ${OUTPUT} + } + "" + end + +end # declaration + +group length "Array length method" + + case float + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float[] x = float[3] (in0.z, in0.x, in0.y); + float[] y = float[] (in0.z, in0.x, in0.y, in0.x, in0.y); + float[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + + case int + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 1, 2) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump int; + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + int[] x = int[3] (in0.z, in0.x, in0.y); + int[] y = int[] (in0.z, in0.x, in0.y, in0.x, in0.y); + int[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + + case bool + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, true) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + bool[] x = bool[3] (in0.z, in0.x, in0.y); + bool[] y = bool[] (in0.z, in0.x, in0.y, in0.x, in0.y); + bool[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + + case struct + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ]; + output ivec3 out0 = [ ivec3(3, 5, 13) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct test + { + float f; + vec3 v; + }; + + void main() + { + ${SETUP} + + test a = test(in0.z, vec3(in0.x, in0.y, in0.z)); + test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y)); + test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x)); + + test[] x = test[3] (a, b, c); + test[] y = test[] (c, a, b, b, a); + test[13] z; + + out0 = ivec3(x.length(), y.length(), z.length()); + ${OUTPUT} + } + "" + end + +end # length + +group invalid "Invalid Functions" + + case multidimensional_array1 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[5][3]; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case multidimensional_array2 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float[5] a[3]; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case multidimensional_uniform_array + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float a[3][2]; + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case multidimensional_array_in_uniform_block + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform MyBlock + { + float a[3][2]; + }; + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case dynamic_expression_array_size + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int a = 5; + float[a] array; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_declaration_without_var_name + version 300 es + expect compile_or_link_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int[]; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_declaration_with_var_name + version 300 es + expect compile_or_link_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int[] a; + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c-style1 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[]; + a = float[3] { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case constructor_c-style2 + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float a[5] = { 1.0, 2.0, 3.0 }; + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html new file mode 100644 index 000000000..e786e1422 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/conditionals.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test new file mode 100644 index 000000000..a3a5b476f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test @@ -0,0 +1,381 @@ +group if "If Statements" + + case single_statement + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + if (in0 >= 1.0) + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case compound_statement + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (in0 >= 1.0) + out0 = 1.0; + else + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case if_elseif + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 ]; + output float out0 = [ 0.0 | 1.0 | 2.0 ]; + } + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (true + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (5) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_zero_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_one_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (1) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case int_uniform_condition + version 300 es + expect compile_fail + + both "" + #version 300 es + precision mediump float; + precision mediump int; + uniform int u0; + ${DECLARATIONS} + void main() + { + if (u0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (5.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_zero_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (0.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case float_one_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + if (1.0) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case sampler_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + uniform sampler2D s0; + ${DECLARATIONS} + 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/gles3/shaders/constant_expressions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html new file mode 100644 index 000000000..e74ca678f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/constant_expressions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test new file mode 100644 index 000000000..59c6cb6ff --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test @@ -0,0 +1,483 @@ +group trivial "Trivial expressions" + + case float + version 300 es + values { output float out0 = 5.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a = 5.0; + out0 = a; + ${OUTPUT} + } + "" + end + + case int + version 300 es + values { output int out0 = 5; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a = 5; + out0 = a; + ${OUTPUT} + } + "" + end + + case bool + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const bool a = true; + out0 = a; + ${OUTPUT} + } + "" + end + + case cast + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 2.19; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 15.0; } + both "" + #version 300 es + 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 + version 300 es + values { output int out0 = 7; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const int a = 25%7 + 2*3 - 9/3; + out0 = a; + ${OUTPUT} + } + "" + end + + case math_ivec + version 300 es + values { output int out0 = 21; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const ivec3 a = ivec2(25%7, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz; + out0 = a.x + a.y + a.z; + ${OUTPUT} + } + "" + end + + case math_mat + version 300 es + values { output float out0 = 8.0; } + both "" + #version 300 es + 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 bitwise + version 300 es + values { output int out0 = 678332; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const int a = (((0xABBA<<4) ^ 0xCAFE) | (0xDCBA & (0xABCD>>2))) ^ (~0xDEAD & 0xBEEF); + out0 = a; + ${OUTPUT} + } + "" + end + + case logical + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp int; + ${DECLARATIONS} + + void main() + { + const bool a = (!false || false) && (true ^^ false); + out0 = a; + ${OUTPUT} + } + "" + end + + case compare + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 5.3; } + both "" + #version 300 es + 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" + + case struct + version 300 es + values { output float out0 = 260.922; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 965.9; } + both "" + #version 300 es + 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_size + version 300 es + values { output int out0 = 1; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a[max(-1, 1)] = int[1](1); + out0 = a[0]; + ${OUTPUT} + } + "" + end + + case array_length + version 300 es + values { output int out0 = 2; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int a[1] = int[1](1); + out0 = a.length() + a[0]; + ${OUTPUT} + } + "" + end + + case array + version 300 es + values { output float out0 = 4.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const float a[1+2+5] = float[8](0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0); + const float f = a[1+2+4]; + out0 = f + float(a.length()-8); + ${OUTPUT} + } + "" + end + +end # complex_types + +group other "Other operations" + + case switch_case + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + void main() + { + const int _0 = 0; + const int _1 = 1; + const int _2 = 2; + const int _3 = 3; + const int _4 = 4; + + switch(int(in0)) + { + case _0: + out0 = 0; + break; + case _1: + out0 = 1; + break; + case _2: + out0 = 2; + break; + case _3: + out0 = 3; + break; + case _4: + out0 = 4; + break; + case 5: + out0 = 10; + break; + default: + out0 = 100; + + } + ${OUTPUT} + } + "" + end + + case nested_builtin_funcs + version 300 es + values { output float out0 = 3.05; } + both "" + #version 300 es + 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 + + case complex + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ]; + output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10]; + } + + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + + struct T + { + vec4 v; + }; + + struct S + { + T t; + int i; + bool b; + }; + + void main() + { + const T t = T(vec4(1.0)); + const S s = S(t, 42, true); + const int _0 = int(sin(0.0)); + const int _1 = int(1.0); + const int _2 = 2 + int(float(_0>_1)); + const int _3 = min(gl_MaxVertexAttribs, 16)/4 - 1; + const int _4 = min(gl_MaxDrawBuffers, 4); + const ivec4 nums = ivec4(0, 1, 2, 3); + + switch(int(in0)) + { + case int(float(_0)): + out0 = ((true!=false) && (!false)) ? 0 : 25; + break; + case ivec3(_1).x: + out0 = 3*18/9-5; + break; + case nums[_2]: + out0 = int(length(vec4(1.0))+0.001); + break; + case _3: + out0 = 3; + break; + case clamp(_4, 1, 6): + out0 = (s.i-2)/10; + break; + case max(3, 5): + out0 = 10; + break; + default: + out0 = 100; + + } + ${OUTPUT} + } + "" + end +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html new file mode 100644 index 000000000..891af46e5 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/constants.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test new file mode 100644 index 000000000..93e71b72b --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test @@ -0,0 +1,1153 @@ +case float_input + version 300 es + 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 "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = in0; + ${OUTPUT} + } + "" +end + +case float_uniform + version 300 es + 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 "" + #version 300 es + precision highp float; + ${DECLARATIONS} + uniform float uni0; + void main() + { + out0 = uni0; + ${OUTPUT} + } + "" +end + +case float_0 + version 300 es + values { output float out0 = 1.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = +1.123; + ${OUTPUT} + } + "" +end + +case float_1 + version 300 es + values { output float out0 = -1.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.123; + ${OUTPUT} + } + "" +end + +case float_2 + version 300 es + values { output float out0 = 123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123.; + ${OUTPUT} + } + "" +end + +case float_3 + version 300 es + values { output float out0 = 0.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = .123; + ${OUTPUT} + } + "" +end + +case float_4 + version 300 es + values { output float out0 = 123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e+2; + ${OUTPUT} + } + "" +end + +case float_5 + version 300 es + values { output float out0 = -123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23E+2; + ${OUTPUT} + } + "" +end + +case float_6 + version 300 es + values { output float out0 = -123.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -1.23e2; + ${OUTPUT} + } + "" +end + +case float_7 + version 300 es + values { output float out0 = 0.123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1.23e-1; + ${OUTPUT} + } + "" +end + +case float_8 + version 300 es + values { output float out0 = 1000.0; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 1e3; + ${OUTPUT} + } + "" +end + +case float_f_suffix_0 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1.0f; + out0 = value; + ${OUTPUT} + } + "" +end + +case float_f_suffix_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1.0F; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_0 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 123; + ${OUTPUT} + } + "" +end + +case int_1 + version 300 es + values { output int out0 = -321; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = -321; + ${OUTPUT} + } + "" +end + +case int_2 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0x7B; + ${OUTPUT} + } + "" +end + +case int_3 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0X7b; + ${OUTPUT} + } + "" +end + +case int_4 + version 300 es + values { output int out0 = 123; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = 0173; + ${OUTPUT} + } + "" +end + +case bool_0 + version 300 es + values { output bool out0 = true; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = true; + ${OUTPUT} + } + "" +end + +case bool_1 + version 300 es + values { output bool out0 = false; } + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main() + { + out0 = false; + ${OUTPUT} + } + "" +end + +case const_float_global + version 300 es + values { output float out0 = 1000.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = 1000.0; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_main + version 300 es + values { output float out0 = -1000.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant = -1000.0; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_function + version 300 es + values { output float out0 = -0.012; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func() + { + const float theConstant = -0.012; + return theConstant; + } + void main() + { + out0 = func(); + ${OUTPUT} + } + "" +end + +case const_float_scope + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + { + const float theConstant = 1.0; + out0 = theConstant; + } + ${OUTPUT} + } + "" +end + +case const_float_scope_shawdowing_1 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 2.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 21.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_2 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + const float theConstant1 = 10.0; + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + } + ${OUTPUT} + } + "" +end + +case const_float_assignment_3 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant1 = 10.0; + void main() + { + const float theConstant2 = theConstant1; + out0 = theConstant2; + ${OUTPUT} + } + "" +end + +case const_float_assignment_4 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values { output float out0 = 10.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float theUniform; + void main() + { + const float theConstant = theUniform; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_varying + version 300 es + expect compile_fail + values { output float out0 = 10.0; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out float theVarying; + void main() + { + theVarying = 1.0; + gl_Position = vec(1.0); + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float theVarying; + void main() + { + const float theConstant = theVarying; + out0 = theConstant; + ${FRAGMENT_OUTPUT} + } + "" +end + +case const_float_function_gotcha + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = float(10); + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec2 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + const float theConstant = vec2(1.0, 10.0).y; + void main() + { + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_from_vec3 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 10.0; } + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + float theVariable = 20.0; + const float theConstant = theVariable; + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case const_float_assign_variable_2 + version 300 es + expect compile_fail + values { output float out0 = 50.0; } + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values { output float out0 = 50.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func() + { + return 50.0; + } + void main() + { + const float theConstant = func(); + out0 = theConstant; + ${OUTPUT} + } + "" +end + +case int_decimal + version 300 es + values { output int out0 = 7; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 7; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_octal + version 300 es + values { output int out0 = 15; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 017; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_hexadecimal_0 + version 300 es + values { output int out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 0x2f; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_hexadecimal_1 + version 300 es + values { output int out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + int value = 0X2f; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_decimal_0 + version 300 es + values { output uint out0 = 7; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 7u; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_decimal_1 + version 300 es + values { output uint out0 = 7; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 7U; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_octal_0 + version 300 es + values { output uint out0 = 15; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 017u; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_octal_1 + version 300 es + values { output uint out0 = 15; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 017U; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_hexadecimal_0 + version 300 es + values { output uint out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 0x2fU; + out0 = value; + ${OUTPUT} + } + "" +end + +case uint_hexadecimal_1 + version 300 es + values { output uint out0 = 47; } + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + ${SETUP} + uint value = 0X2fu; + out0 = value; + ${OUTPUT} + } + "" +end + +case int_from_uint + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 7u; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case uint_from_int + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 7; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case int_from_float + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 7.0; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case uint_from_float + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 7.0; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case bool_from_int + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + bool value = 1; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case bool_from_uint + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + bool value = 1u; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case bool_from_float + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + bool value = 1.0; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case float_int_f_suffix_0 + expect compile_fail + version 300 es + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1f; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case float_int_f_suffix_1 + expect compile_fail + version 300 es + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main () + { + ${SETUP} + float value = 1F; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case int_l_suffix + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 1l; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case uint_ul_suffix + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 1ul; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_octal_0 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 018; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_octal_1 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 09U; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_hexadecimal_0 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + int value = 0x2g7; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end + +case invalid_hexadecimal_1 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + uint value = 0X1h7u; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.html new file mode 100644 index 000000000..9b6f38deb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/conversions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test new file mode 100644 index 000000000..968c2d264 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test @@ -0,0 +1,14246 @@ +# 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case float_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case float_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case int_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case int_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case int_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uint_to_float + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output float out0 = [ 0.0 | 2.0 | 3.0 | 8.0 | 9.0 | 12.0 | 10.0 | 45.0 | 193.0 | 255.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uint_to_int + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output int out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bool + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output bool out0 = [ false | true | true | true | true | true | true | true | true | true ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bool_to_float + version 300 es + values + { + input bool in0 = [ true | false ]; + output float out0 = [ 1.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bool_to_int + version 300 es + values + { + input bool in0 = [ true | false ]; + output int out0 = [ 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case float_to_uint + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uint out0 = [ 0 | 1 | 2 | 3 | 0 | 8 | 20 | 36 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case int_to_uint + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uint out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uint + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uint out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uint + version 300 es + values + { + input bool in0 = [ true | false ]; + output uint out0 = [ 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_scalar +group scalar_to_vector "Scalar to Vector Conversions" + + case float_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_vec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_vec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_vec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output vec2 out0 = [ vec2(0.0, 0.0) | vec2(2.0, 2.0) | vec2(3.0, 3.0) | vec2(8.0, 8.0) | vec2(9.0, 9.0) | vec2(12.0, 12.0) | vec2(10.0, 10.0) | vec2(45.0, 45.0) | vec2(193.0, 193.0) | vec2(255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_vec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(2.0, 2.0, 2.0) | vec3(3.0, 3.0, 3.0) | vec3(8.0, 8.0, 8.0) | vec3(9.0, 9.0, 9.0) | vec3(12.0, 12.0, 12.0) | vec3(10.0, 10.0, 10.0) | vec3(45.0, 45.0, 45.0) | vec3(193.0, 193.0, 193.0) | vec3(255.0, 255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_vec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.0, 3.0, 3.0, 3.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(12.0, 12.0, 12.0, 12.0) | vec4(10.0, 10.0, 10.0, 10.0) | vec4(45.0, 45.0, 45.0, 45.0) | vec4(193.0, 193.0, 193.0, 193.0) | vec4(255.0, 255.0, 255.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_ivec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(2, 2) | ivec2(3, 3) | ivec2(8, 8) | ivec2(9, 9) | ivec2(12, 12) | ivec2(10, 10) | ivec2(45, 45) | ivec2(193, 193) | ivec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_ivec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(8, 8, 8) | ivec3(9, 9, 9) | ivec3(12, 12, 12) | ivec3(10, 10, 10) | ivec3(45, 45, 45) | ivec3(193, 193, 193) | ivec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_ivec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(8, 8, 8, 8) | ivec4(9, 9, 9, 9) | ivec4(12, 12, 12, 12) | ivec4(10, 10, 10, 10) | ivec4(45, 45, 45, 45) | ivec4(193, 193, 193, 193) | ivec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bvec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bvec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_bvec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_vec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_ivec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_bvec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case float_to_uvec2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(3, 3) | uvec2(0, 0) | uvec2(8, 8) | uvec2(20, 20) | uvec2(36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case float_to_uvec3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(0, 0, 0) | uvec3(8, 8, 8) | uvec3(20, 20, 20) | uvec3(36, 36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case float_to_uvec4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(0, 0, 0, 0) | uvec4(8, 8, 8, 8) | uvec4(20, 20, 20, 20) | uvec4(36, 36, 36, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case int_to_uvec2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(5, 5) | uvec2(8, 8) | uvec2(11, 11) | uvec2(12, 12) | uvec2(66, 66) | uvec2(192, 192) | uvec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case int_to_uvec3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(5, 5, 5) | uvec3(8, 8, 8) | uvec3(11, 11, 11) | uvec3(12, 12, 12) | uvec3(66, 66, 66) | uvec3(192, 192, 192) | uvec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case int_to_uvec4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(5, 5, 5, 5) | uvec4(8, 8, 8, 8) | uvec4(11, 11, 11, 11) | uvec4(12, 12, 12, 12) | uvec4(66, 66, 66, 66) | uvec4(192, 192, 192, 192) | uvec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uvec2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(2, 2) | uvec2(3, 3) | uvec2(8, 8) | uvec2(9, 9) | uvec2(12, 12) | uvec2(10, 10) | uvec2(45, 45) | uvec2(193, 193) | uvec2(255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uvec3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(8, 8, 8) | uvec3(9, 9, 9) | uvec3(12, 12, 12) | uvec3(10, 10, 10) | uvec3(45, 45, 45) | uvec3(193, 193, 193) | uvec3(255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_uvec4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(8, 8, 8, 8) | uvec4(9, 9, 9, 9) | uvec4(12, 12, 12, 12) | uvec4(10, 10, 10, 10) | uvec4(45, 45, 45, 45) | uvec4(193, 193, 193, 193) | uvec4(255, 255, 255, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uvec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output uvec3 out0 = [ uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_uvec4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output uvec4 out0 = [ uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + +end # scalar_to_vector +group vector_to_scalar "Vector to Scalar Conversions" + + case vec2_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_float + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_int + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output int out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bool + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_float + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_int + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bool + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_float + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_int + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output int out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bool + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output bool out0 = [ false | true | false | true | false ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_float + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = float(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_int + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = int(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bool + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bool(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_uint + version 300 es + 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 uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uint + version 300 es + 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 uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uint + version 300 es + 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 uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uint + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uint + version 300 es + 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 uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uint + version 300 es + 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 uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uint + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uint + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uint + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uint out0 = [ 0 | 1 | 0 | 32 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uint + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output uint out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uint + version 300 es + 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 uint out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uint + version 300 es + 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 uint out0 = [ 1 | 0 | 0 | 1 | 0 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uint(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_scalar +group vector_illegal "Illegal Vector Conversions" + + case vec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec2 in0 = vec2(0.0, 0.5); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec2 in0 = ivec2(0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + vec3 out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_ivec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + bvec3 out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec2 in0 = uvec2(0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec3 out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + uvec3 out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec3 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec2 in0 = bvec2(true, false); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + vec3 in0 = vec3(0.0, 0.5, 0.75); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + ivec3 in0 = ivec3(0, 0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + vec4 out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_ivec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + ivec4 out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + uvec3 in0 = uvec3(0, 0, 0); + bvec4 out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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_uvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + bvec3 in0 = bvec3(true, false, false); + uvec4 out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec4 + version 300 es + expect compile_fail + values {} + + both "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_vec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_vec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_vec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_ivec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_ivec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_ivec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bvec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bvec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_bvec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uvec4 + version 300 es + 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 uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uvec3 + version 300 es + 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 uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case vec4_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uvec4 + version 300 es + 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 uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uvec3 + version 300 es + 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 uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec4_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uvec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uvec3 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec4_to_uvec2 + version 300 es + values + { + input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uvec4 + version 300 es + 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 uvec4 out0 = [ uvec4(1, 0, 0, 1) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uvec3 + version 300 es + 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 uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec4_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_vec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_vec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_ivec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_ivec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bvec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_bvec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uvec3 + version 300 es + 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 uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case vec3_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uvec3 + version 300 es + 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 uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case ivec3_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uvec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case uvec3_to_uvec2 + version 300 es + values + { + input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uvec3 + version 300 es + 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 uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0); + ${OUTPUT} + } + "" + end + + case bvec3_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_vec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_ivec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_bvec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_ivec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_bvec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0); + ${OUTPUT} + } + "" + end + + case vec2_to_uvec2 + version 300 es + 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 uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case ivec2_to_uvec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case uvec2_to_uvec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + case bvec2_to_uvec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ]; + output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0); + ${OUTPUT} + } + "" + end + + +end # vector_to_vector +group scalar_to_matrix "Scalar to Matrix Conversions" + + case float_to_mat4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat4x3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0) | mat4x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0) | mat4x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0) | mat4x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat4x2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0) | mat4x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0) | mat4x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3x4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat3x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat3x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0) | mat3x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat3x2 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0) | mat3x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0) | mat3x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0) | mat3x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2x4 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0) | mat2x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2x3 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0) | mat2x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0) | mat2x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0) | mat2x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0) | mat2x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case float_to_mat2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4x3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0) | mat4x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0) | mat4x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0) | mat4x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat4x2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3x4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat3x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat3x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat3x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat3x2 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat3x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat3x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat3x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2x4 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat2x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat2x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat2x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2x3 + version 300 es + values + { + input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat2x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat2x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat2x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case int_to_mat2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 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(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.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.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(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.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(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0) | mat4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0) | mat4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat4x3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0) | mat4x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0) | mat4x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0) | mat4x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0) | mat4x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat4x2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat3x4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat3x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat3x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat3x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat3x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0) | mat3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0) | mat3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0) | mat3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0) | mat3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat3x2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat3x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat3x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat3x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat3x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat2x4 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat2x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat2x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat2x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat2x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat2x3 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat2x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat2x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat2x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat2x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case uint_to_mat2 + version 300 es + values + { + input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ]; + output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.0, 0.0, 0.0, 3.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(9.0, 0.0, 0.0, 9.0) | mat2(12.0, 0.0, 0.0, 12.0) | mat2(10.0, 0.0, 0.0, 10.0) | mat2(45.0, 0.0, 0.0, 45.0) | mat2(193.0, 0.0, 0.0, 193.0) | mat2(255.0, 0.0, 0.0, 255.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4x3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat4x2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3x4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat3x2 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2x4 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2x3 + version 300 es + values + { + input bool in0 = [ true | false ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case bool_to_mat2 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat4x3 + version 300 es + 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 mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat4x2 + version 300 es + 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 mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3x4 + version 300 es + 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 mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat3x2 + version 300 es + 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 mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2x4 + version 300 es + 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 mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2x3 + version 300 es + 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 mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat4_to_mat2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat4 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + 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.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 9.975, -6.542, 0.015625, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat4x3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat4x2 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat3x4 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat3x2 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat2x4 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat2x3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x3_to_mat2 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat4 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + 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.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 9.975, -6.542, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat4x3 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 9.975, -6.542, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat4x2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat3x4 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat3 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + 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.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat3x2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat2x4 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat2x3 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat4x2_to_mat2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + 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, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat4x3 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat4x2 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat3x4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat3 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat3x2 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat2x4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat2x3 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x4_to_mat2 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 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.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4x3 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat4x2 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3x4 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat3x2 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2x4 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2x3 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat3_to_mat2 + version 300 es + 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.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat4 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + 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.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat4x3 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat4x2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat3x4 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat3 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + 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.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat3x2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat2x4 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat2x3 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat3x2_to_mat2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + 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.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat4x3 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat4x2 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat3x4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat3 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + 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.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat3x2 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat2x4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat2x3 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x4_to_mat2 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat4 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + 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.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat4x3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat4x2 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat3x4 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + 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.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat3x2 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat2x4 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat2x3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat2x3_to_mat2 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4x3 + version 300 es + 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 mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat4x2 + version 300 es + 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 mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0) | mat4x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3x4 + version 300 es + 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 mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat3x2 + version 300 es + 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 mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0) | mat3x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0) | mat3x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2x4 + version 300 es + 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 mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0) | mat2x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0) | mat2x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2x3 + version 300 es + 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 mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0) | mat2x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0) | mat2x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0); + ${OUTPUT} + } + "" + end + + case mat2_to_mat2 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_vec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_ivec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_bvec4 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_vec4 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_vec4 + version 300 es + values + { + input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ]; + input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ]; + input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ]; + input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ]; + output vec4 out0 = [ vec4(193.0, 12.0, 9.0, 3.0) | vec4(3.0, 45.0, 8.0, 9.0) | vec4(255.0, 193.0, 12.0, 12.0) | vec4(8.0, 2.0, 2.0, 2.0) | vec4(10.0, 8.0, 255.0, 255.0) | vec4(9.0, 255.0, 45.0, 193.0) | vec4(2.0, 0.0, 3.0, 0.0) | vec4(12.0, 3.0, 0.0, 10.0) | vec4(0.0, 9.0, 193.0, 45.0) | vec4(45.0, 10.0, 10.0, 8.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_ivec4 + version 300 es + values + { + input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ]; + input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ]; + input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ]; + input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ]; + output ivec4 out0 = [ ivec4(193, 12, 9, 3) | ivec4(3, 45, 8, 9) | ivec4(255, 193, 12, 12) | ivec4(8, 2, 2, 2) | ivec4(10, 8, 255, 255) | ivec4(9, 255, 45, 193) | ivec4(2, 0, 3, 0) | ivec4(12, 3, 0, 10) | ivec4(0, 9, 193, 45) | ivec4(45, 10, 10, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_bvec4 + version 300 es + values + { + input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ]; + input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ]; + input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ]; + input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ]; + 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, false, true, false) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + output vec4 out0 = [ vec4(1.0, 1.0, 0.0, 0.0) | vec4(0.0, 0.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + output ivec4 out0 = [ ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, false, true, true) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | true | false | false | false | true | false | false | true | true ]; + input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ]; + input bool in3 = [ true | true | false | false | true | true | false | true | false | false ]; + output vec4 out0 = [ vec4(1.0, 36.8125, -66.0, 1.0) | vec4(1.0, 0.0, 2.0, 1.0) | vec4(0.0, -8.25, 255.0, 0.0) | vec4(0.0, 1.0, 11.0, 0.0) | vec4(0.0, -0.5, 1.0, 1.0) | vec4(1.0, 0.0, 8.0, 1.0) | vec4(0.0, 2.0, -192.0, 0.0) | vec4(0.0, -20.125, -12.0, 1.0) | vec4(1.0, 3.5, 0.0, 0.0) | vec4(1.0, 1.0, 5.0, 0.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | true | false | false | false | true | false | false | true | true ]; + input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ]; + input bool in3 = [ true | true | false | false | true | true | false | true | false | false ]; + output ivec4 out0 = [ ivec4(1, 36, -66, 1) | ivec4(1, 0, 2, 1) | ivec4(0, -8, 255, 0) | ivec4(0, 1, 11, 0) | ivec4(0, 0, 1, 1) | ivec4(1, 0, 8, 1) | ivec4(0, 2, -192, 0) | ivec4(0, -20, -12, 1) | ivec4(1, 3, 0, 0) | ivec4(1, 1, 5, 0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | true | false | false | false | true | false | false | true | true ]; + input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ]; + input bool in3 = [ true | true | false | false | true | true | false | true | false | false ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_vec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 0.0, -2.0) | vec4(-0.5, -2.25, 0.0, 0.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_ivec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_bvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output bvec4 out0 = [ bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_vec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ]; + output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(-32.0, 64.0, 0.0, 0.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(0.0, 0.5, 1.0, 1.0) | vec4(-0.5, -2.25, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_ivec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ]; + output ivec4 out0 = [ ivec4(0, 0, 0, 1) | ivec4(-32, 64, 0, 0) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) | ivec4(0, -2, 1, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_bvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ]; + output bvec4 out0 = [ bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, false, false) | bvec4(false, true, true, true) | bvec4(true, true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_vec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 0.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 2.0) | vec4(1.0, 1.0, 1.0, 0.0) | vec4(0.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(1.0, 0.0, 0.0, 36.8125) | vec4(0.0, 1.0, 0.0, -20.125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_ivec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(0, 0, 0, 3) | ivec4(0, 1, 0, 2) | ivec4(1, 1, 1, 0) | ivec4(0, 0, 0, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 0, 0, 36) | ivec4(0, 1, 0, -20) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_bvec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ]; + output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_vec4 + version 300 es + values + { + input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | 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) ]; + input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ]; + output vec4 out0 = [ vec4(-32.0, 64.0, -51.0, -0.5) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(1.0, 1.25, 1.125, 3.5) | vec4(-0.5, -2.25, -4.875, -20.125) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, -8.25) | vec4(0.0, 0.5, 0.75, 1.0) | vec4(1.0, 1.25, 1.125, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_ivec4 + version 300 es + values + { + input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | 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) ]; + input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ]; + output ivec4 out0 = [ ivec4(-32, 64, -51, 0) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 3) | ivec4(0, -2, -4, -20) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 1, 1, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_bvec4 + version 300 es + values + { + input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | 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) ]; + input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_vec4 + version 300 es + values + { + input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ]; + input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ]; + output vec4 out0 = [ vec4(-12.0, 0.0, -2.0, 1.0) | vec4(11.0, -32.0, 64.0, 11.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(255.0, 0.0, -2.0, -66.0) | vec4(0.0, 1.0, 1.0, -192.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(-66.0, -32.0, 64.0, -12.0) | vec4(2.0, 1.0, 1.0, 255.0) | vec4(-192.0, 0.0, 0.0, 5.0) | vec4(5.0, 0.0, 0.0, 8.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_ivec4 + version 300 es + values + { + input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ]; + input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ]; + output ivec4 out0 = [ ivec4(-12, 0, -2, 1) | ivec4(11, -32, 64, 11) | ivec4(8, 0, 0, 2) | ivec4(255, 0, -2, -66) | ivec4(0, 1, 1, -192) | ivec4(1, 0, 0, 0) | ivec4(-66, -32, 64, -12) | ivec4(2, 1, 1, 255) | ivec4(-192, 0, 0, 5) | ivec4(5, 0, 0, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_bvec4 + version 300 es + values + { + input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ]; + input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ]; + output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_vec4 + version 300 es + values + { + input bool in0 = [ true | false | false | false | true | true | true | false ]; + input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, -32.0, 64.0) | vec4(0.0, 2.0, 0.0, 0.0) | vec4(0.0, 3.5, 0.0, 0.0) | vec4(1.0, -20.125, 0.0, -2.0) | vec4(1.0, -0.5, 0.0, -2.0) | vec4(1.0, 36.8125, 0.0, 0.0) | vec4(0.0, -8.25, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_ivec4 + version 300 es + values + { + input bool in0 = [ true | false | false | false | true | true | true | false ]; + input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, -32, 64) | ivec4(0, 2, 0, 0) | ivec4(0, 3, 0, 0) | ivec4(1, -20, 0, -2) | ivec4(1, 0, 0, -2) | ivec4(1, 36, 0, 0) | ivec4(0, -8, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_bvec4 + version 300 es + values + { + input bool in0 = [ true | false | false | false | true | true | true | false ]; + input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, true, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(false, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_vec4 + version 300 es + values + { + input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ]; + output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 0.0) | vec4(-20.125, 0.0, 0.0, 0.0) | vec4(-8.25, 1.0, 1.0, 1.0) | vec4(-0.5, 0.0, 2.0, 4.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 1.0, 1.0, 1.0) | vec4(3.5, 0.0, 2.0, 4.0) | vec4(36.8125, 32.0, 64.0, 51.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_ivec4 + version 300 es + values + { + input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ]; + output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(-20, 0, 0, 0) | ivec4(-8, 1, 1, 1) | ivec4(0, 0, 2, 4) | ivec4(0, 0, 0, 0) | ivec4(2, 1, 1, 1) | ivec4(3, 0, 2, 4) | ivec4(36, 32, 64, 51) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_bvec4 + version 300 es + values + { + input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ]; + output bvec4 out0 = [ bvec4(true, false, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(true, true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_vec4 + version 300 es + values + { + input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + input bool in2 = [ false | false | true | true | true | true | true | false | false | false ]; + output vec4 out0 = [ vec4(1.0, 0.0, 2.0, 0.0) | vec4(-192.0, 1.0, 1.0, 0.0) | vec4(-66.0, 0.0, 0.0, 1.0) | vec4(-12.0, 0.0, 2.0, 1.0) | vec4(0.0, 32.0, 64.0, 1.0) | vec4(2.0, 0.0, 0.0, 1.0) | vec4(11.0, 32.0, 64.0, 1.0) | vec4(8.0, 0.0, 0.0, 0.0) | vec4(255.0, 1.0, 1.0, 0.0) | vec4(5.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_ivec4 + version 300 es + values + { + input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + input bool in2 = [ false | false | true | true | true | true | true | false | false | false ]; + output ivec4 out0 = [ ivec4(1, 0, 2, 0) | ivec4(-192, 1, 1, 0) | ivec4(-66, 0, 0, 1) | ivec4(-12, 0, 2, 1) | ivec4(0, 32, 64, 1) | ivec4(2, 0, 0, 1) | ivec4(11, 32, 64, 1) | ivec4(8, 0, 0, 0) | ivec4(255, 1, 1, 0) | ivec4(5, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_bvec4 + version 300 es + values + { + input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + input bool in2 = [ false | false | true | true | true | true | true | false | false | false ]; + output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(true, true, true, false) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, false) | bvec4(true, false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_vec2_to_uvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) | vec2(0.5, 2.25) | vec2(1.0, 1.25) ]; + input vec2 in1 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.0, 0.5) | vec2(0.75, 0.0322580645161) ]; + output uvec4 out0 = [ uvec4(32, 64, 0, 2) | uvec4(0, 0, 1, 1) | uvec4(0, 0, 32, 64) | uvec4(0, 2, 0, 0) | uvec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_uvec4 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) ]; + output uvec4 out0 = [ uvec4(1, 0, 1, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_uvec4 + version 300 es + values + { + input float in0 = [ 2.0 | 36.8125 | 0.0 | 20.125 | 1.0 | 0.5 | 8.25 | 3.5 ]; + input float in1 = [ 1.0 | 8.25 | 2.0 | 20.125 | 36.8125 | 0.0 | 0.5 | 3.5 ]; + input float in2 = [ 0.0 | 8.25 | 2.0 | 1.0 | 36.8125 | 20.125 | 0.5 | 3.5 ]; + input float in3 = [ 1.0 | 8.25 | 0.0 | 2.0 | 20.125 | 3.5 | 0.5 | 36.8125 ]; + output uvec4 out0 = [ uvec4(2, 1, 0, 1) | uvec4(36, 8, 8, 8) | uvec4(0, 2, 2, 0) | uvec4(20, 20, 1, 2) | uvec4(1, 36, 36, 20) | uvec4(0, 0, 20, 3) | uvec4(8, 0, 0, 0) | uvec4(3, 3, 3, 36) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case int_int_int_int_to_uvec4 + version 300 es + values + { + input int in0 = [ 192 | 2 | 12 | 11 | 0 | 8 | 5 | 66 | 1 | 255 ]; + input int in1 = [ 66 | 12 | 5 | 1 | 0 | 192 | 8 | 255 | 11 | 2 ]; + input int in2 = [ 192 | 5 | 1 | 66 | 255 | 11 | 8 | 12 | 2 | 0 ]; + input int in3 = [ 255 | 5 | 11 | 12 | 2 | 1 | 66 | 0 | 8 | 192 ]; + output uvec4 out0 = [ uvec4(192, 66, 192, 255) | uvec4(2, 12, 5, 5) | uvec4(12, 5, 1, 11) | uvec4(11, 1, 66, 12) | uvec4(0, 0, 255, 2) | uvec4(8, 192, 11, 1) | uvec4(5, 8, 8, 66) | uvec4(66, 255, 12, 0) | uvec4(1, 11, 2, 8) | uvec4(255, 2, 0, 192) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_uvec4 + version 300 es + values + { + input uint in0 = [ 255 | 8 | 3 | 193 | 45 | 2 | 0 | 12 | 9 | 10 ]; + input uint in1 = [ 255 | 45 | 0 | 12 | 2 | 10 | 8 | 9 | 193 | 3 ]; + input uint in2 = [ 3 | 0 | 2 | 9 | 12 | 10 | 255 | 45 | 193 | 8 ]; + input uint in3 = [ 2 | 255 | 10 | 193 | 8 | 12 | 3 | 9 | 0 | 45 ]; + output uvec4 out0 = [ uvec4(255, 255, 3, 2) | uvec4(8, 45, 0, 255) | uvec4(3, 0, 2, 10) | uvec4(193, 12, 9, 193) | uvec4(45, 2, 12, 8) | uvec4(2, 10, 10, 12) | uvec4(0, 8, 255, 3) | uvec4(12, 9, 45, 9) | uvec4(9, 193, 193, 0) | uvec4(10, 3, 8, 45) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_to_uvec4 + version 300 es + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + input bool in3 = [ true | false ]; + output uvec4 out0 = [ uvec4(0, 0, 1, 1) | uvec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_to_uvec4 + version 300 es + values + { + input bool in0 = [ true | false | false | true | false | true | true | true | false | false ]; + input float in1 = [ 20.125 | 0.0 | 1.0 | 3.5 | 1.0 | 0.0 | 0.5 | 8.25 | 2.0 | 36.8125 ]; + input int in2 = [ 66 | 192 | 1 | 2 | 5 | 11 | 8 | 12 | 255 | 0 ]; + input bool in3 = [ true | true | true | true | false | true | false | false | false | false ]; + output uvec4 out0 = [ uvec4(1, 20, 66, 1) | uvec4(0, 0, 192, 1) | uvec4(0, 1, 1, 1) | uvec4(1, 3, 2, 1) | uvec4(0, 1, 5, 0) | uvec4(1, 0, 11, 1) | uvec4(1, 0, 8, 0) | uvec4(1, 8, 12, 0) | uvec4(0, 2, 255, 0) | uvec4(0, 36, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_uvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) ]; + input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) | ivec2(0, 0) ]; + output uvec4 out0 = [ uvec4(0, 2, 1, 1) | uvec4(1, 1, 0, 2) | uvec4(32, 64, 32, 64) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_uvec4 + version 300 es + values + { + input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.5, 2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, true) ]; + output uvec4 out0 = [ uvec4(32, 64, 0, 0) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(1, 1, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_uvec4 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) ]; + input float in1 = [ 2.0 | 0.0 | 36.8125 | 0.5 | 1.0 | 8.25 | 3.5 | 20.125 ]; + output uvec4 out0 = [ uvec4(1, 0, 0, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 1, 0, 36) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 8) | uvec4(1, 0, 0, 3) | uvec4(0, 0, 0, 20) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_uvec4 + version 300 es + values + { + input vec3 in0 = [ vec3(0.5, 2.25, 4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(1.0, 1.25, 1.125) | vec3(0.75, 0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) ]; + input float in1 = [ 8.25 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.5 | 20.125 | 3.5 ]; + output uvec4 out0 = [ uvec4(0, 2, 4, 8) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 4, 36) | uvec4(32, 64, 51, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 20) | uvec4(0, 0, 0, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_uvec4 + version 300 es + values + { + input int in0 = [ 8 | 1 | 11 | 192 | 255 | 12 | 66 | 2 | 0 | 5 ]; + input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(32, 64) | ivec2(0, 2) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(32, 64) | ivec2(0, 0) ]; + input int in2 = [ 2 | 192 | 12 | 0 | 8 | 1 | 66 | 255 | 11 | 5 ]; + output uvec4 out0 = [ uvec4(8, 1, 1, 2) | uvec4(1, 0, 0, 192) | uvec4(11, 1, 1, 12) | uvec4(192, 32, 64, 0) | uvec4(255, 0, 2, 8) | uvec4(12, 0, 2, 1) | uvec4(66, 0, 0, 66) | uvec4(2, 0, 0, 255) | uvec4(0, 32, 64, 11) | uvec4(5, 0, 0, 5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_uvec4 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | false | true ]; + input float in1 = [ 8.25 | 0.5 | 2.0 | 20.125 | 0.0 | 36.8125 | 3.5 | 1.0 ]; + input ivec2 in2 = [ ivec2(32, 64) | ivec2(1, 1) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) ]; + output uvec4 out0 = [ uvec4(1, 8, 32, 64) | uvec4(1, 0, 1, 1) | uvec4(0, 2, 0, 2) | uvec4(0, 20, 0, 0) | uvec4(1, 0, 0, 0) | uvec4(0, 36, 0, 2) | uvec4(0, 3, 1, 1) | uvec4(1, 1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_uvec4 + version 300 es + values + { + input float in0 = [ 8.25 | 20.125 | 1.0 | 0.5 | 3.5 | 2.0 | 36.8125 | 0.0 ]; + input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 2, 4) | uvec3(1, 1, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ]; + output uvec4 out0 = [ uvec4(8, 0, 0, 0) | uvec4(20, 0, 0, 0) | uvec4(1, 0, 2, 4) | uvec4(0, 32, 64, 51) | uvec4(3, 0, 2, 4) | uvec4(2, 1, 1, 1) | uvec4(36, 1, 1, 1) | uvec4(0, 0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_uvec4 + version 300 es + values + { + input int in0 = [ 2 | 1 | 11 | 66 | 192 | 12 | 8 | 255 | 0 | 5 ]; + input uvec2 in1 = [ uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) ]; + input bool in2 = [ true | false | false | false | false | true | true | true | false | true ]; + output uvec4 out0 = [ uvec4(2, 1, 1, 1) | uvec4(1, 0, 0, 0) | uvec4(11, 0, 0, 0) | uvec4(66, 0, 2, 0) | uvec4(192, 0, 0, 0) | uvec4(12, 0, 2, 1) | uvec4(8, 32, 64, 1) | uvec4(255, 1, 1, 1) | uvec4(0, 32, 64, 0) | uvec4(5, 0, 0, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_vec3 + version 300 es + values + { + input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ]; + input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ]; + input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ]; + output vec3 out0 = [ vec3(-0.5, 2.0, 1.0) | vec3(1.0, -20.125, 3.5) | vec3(3.5, 3.5, 2.0) | vec3(-8.25, 36.8125, -8.25) | vec3(36.8125, -8.25, -20.125) | vec3(0.0, 1.0, -0.5) | vec3(2.0, -0.5, 36.8125) | vec3(-20.125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_ivec3 + version 300 es + values + { + input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ]; + input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ]; + input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ]; + output ivec3 out0 = [ ivec3(0, 2, 1) | ivec3(1, -20, 3) | ivec3(3, 3, 2) | ivec3(-8, 36, -8) | ivec3(36, -8, -20) | ivec3(0, 1, 0) | ivec3(2, 0, 36) | ivec3(-20, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_float_float_to_bvec3 + version 300 es + values + { + input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ]; + input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ]; + input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_vec3 + version 300 es + values + { + input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ]; + input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ]; + input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ]; + output vec3 out0 = [ vec3(-192.0, 5.0, -192.0) | vec3(5.0, 1.0, 1.0) | vec3(-12.0, 8.0, 2.0) | vec3(0.0, 0.0, 5.0) | vec3(11.0, 2.0, -12.0) | vec3(8.0, -192.0, 8.0) | vec3(1.0, -12.0, 11.0) | vec3(-66.0, 255.0, 0.0) | vec3(255.0, -66.0, 255.0) | vec3(2.0, 11.0, -66.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_ivec3 + version 300 es + values + { + input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ]; + input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ]; + input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ]; + output ivec3 out0 = [ ivec3(-192, 5, -192) | ivec3(5, 1, 1) | ivec3(-12, 8, 2) | ivec3(0, 0, 5) | ivec3(11, 2, -12) | ivec3(8, -192, 8) | ivec3(1, -12, 11) | ivec3(-66, 255, 0) | ivec3(255, -66, 255) | ivec3(2, 11, -66) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_bvec3 + version 300 es + values + { + input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ]; + input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ]; + input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_vec3 + version 300 es + values + { + input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ]; + input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ]; + input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ]; + output vec3 out0 = [ vec3(8.0, 193.0, 12.0) | vec3(45.0, 2.0, 2.0) | vec3(2.0, 9.0, 193.0) | vec3(3.0, 8.0, 255.0) | vec3(255.0, 0.0, 8.0) | vec3(193.0, 255.0, 10.0) | vec3(12.0, 45.0, 45.0) | vec3(0.0, 3.0, 0.0) | vec3(9.0, 10.0, 3.0) | vec3(10.0, 12.0, 9.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_ivec3 + version 300 es + values + { + input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ]; + input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ]; + input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ]; + output ivec3 out0 = [ ivec3(8, 193, 12) | ivec3(45, 2, 2) | ivec3(2, 9, 193) | ivec3(3, 8, 255) | ivec3(255, 0, 8) | ivec3(193, 255, 10) | ivec3(12, 45, 45) | ivec3(0, 3, 0) | ivec3(9, 10, 3) | ivec3(10, 12, 9) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_bvec3 + version 300 es + values + { + input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ]; + input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ]; + input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_vec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_vec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | true | false | false | true ]; + input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ]; + input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ]; + output vec3 out0 = [ vec3(1.0, 0.0, 8.0) | vec3(1.0, 36.8125, -192.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, -8.25, 2.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 3.5, -12.0) | vec3(1.0, 1.0, 11.0) | vec3(0.0, -0.5, 255.0) | vec3(0.0, -20.125, 5.0) | vec3(1.0, 2.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | true | false | false | true ]; + input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ]; + input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ]; + output ivec3 out0 = [ ivec3(1, 0, 8) | ivec3(1, 36, -192) | ivec3(0, 0, -66) | ivec3(0, -8, 2) | ivec3(1, 1, 1) | ivec3(0, 3, -12) | ivec3(1, 1, 11) | ivec3(0, 0, 255) | ivec3(0, -20, 5) | ivec3(1, 2, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | false | true | false | false | true ]; + input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ]; + input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_vec3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ]; + input bool in1 = [ false | true | true | true | false ]; + output vec3 out0 = [ vec3(1.0, 1.25, 0.0) | vec3(-0.75, -0.0322580645161, 1.0) | vec3(-32.0, 64.0, 1.0) | vec3(-0.5, -2.25, 1.0) | vec3(0.0, 0.5, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_ivec3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ]; + input bool in1 = [ false | true | true | true | false ]; + output ivec3 out0 = [ ivec3(1, 1, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) | ivec3(0, -2, 1) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_bvec3 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ]; + input bool in1 = [ false | true | true | true | false ]; + output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_vec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ]; + output vec3 out0 = [ vec3(1.0, 0.0, -20.125) | vec3(0.0, 1.0, 2.0) | vec3(0.0, 1.0, 36.8125) | vec3(1.0, 0.0, 1.0) | vec3(0.0, 0.0, 3.5) | vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, -8.25) | vec3(0.0, 0.0, -0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_ivec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ]; + output ivec3 out0 = [ ivec3(1, 0, -20) | ivec3(0, 1, 2) | ivec3(0, 1, 36) | ivec3(1, 0, 1) | ivec3(0, 0, 3) | ivec3(0, 0, 0) | ivec3(1, 1, -8) | ivec3(0, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_bvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ]; + input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_vec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ]; + output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, 0.0, 255.0) | vec3(1.0, 0.0, 8.0) | vec3(0.0, 0.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, 0.0, 5.0) | vec3(0.0, 1.0, 11.0) | vec3(0.0, 0.0, -12.0) | vec3(1.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_ivec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ]; + output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, -66) | ivec3(0, 0, 255) | ivec3(1, 0, 8) | ivec3(0, 0, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, 1, 11) | ivec3(0, 0, -12) | ivec3(1, 1, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_bvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ]; + input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ]; + output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_vec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + output vec3 out0 = [ vec3(1.0, 0.0, -2.0) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 1.0) | vec3(1.0, -32.0, 64.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_ivec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + output ivec3 out0 = [ ivec3(1, 0, -2) | ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 1) | ivec3(1, -32, 64) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_bvec3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ]; + output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_vec3 + version 300 es + values + { + input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ]; + output vec3 out0 = [ vec3(-20.125, 0.0, 0.0) | vec3(36.8125, 0.0, 2.0) | vec3(-8.25, 32.0, 64.0) | vec3(2.0, 0.0, 0.0) | vec3(-0.5, 0.0, 2.0) | vec3(0.0, 0.0, 0.0) | vec3(3.5, 1.0, 1.0) | vec3(1.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_ivec3 + version 300 es + values + { + input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ]; + output ivec3 out0 = [ ivec3(-20, 0, 0) | ivec3(36, 0, 2) | ivec3(-8, 32, 64) | ivec3(2, 0, 0) | ivec3(0, 0, 2) | ivec3(0, 0, 0) | ivec3(3, 1, 1) | ivec3(1, 1, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_bvec3 + version 300 es + values + { + input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ]; + output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_to_uvec3 + version 300 es + values + { + input float in0 = [ 8.25 | 20.125 | 2.0 | 3.5 | 0.5 | 36.8125 | 1.0 | 0.0 ]; + input float in1 = [ 1.0 | 0.0 | 3.5 | 36.8125 | 8.25 | 2.0 | 0.5 | 20.125 ]; + input float in2 = [ 20.125 | 0.5 | 8.25 | 36.8125 | 1.0 | 0.0 | 3.5 | 2.0 ]; + output uvec3 out0 = [ uvec3(8, 1, 20) | uvec3(20, 0, 0) | uvec3(2, 3, 8) | uvec3(3, 36, 36) | uvec3(0, 8, 1) | uvec3(36, 2, 0) | uvec3(1, 0, 3) | uvec3(0, 20, 2) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case int_int_int_to_uvec3 + version 300 es + values + { + input int in0 = [ 1 | 255 | 192 | 2 | 5 | 12 | 0 | 11 | 8 | 66 ]; + input int in1 = [ 192 | 66 | 5 | 8 | 11 | 1 | 0 | 255 | 12 | 2 ]; + input int in2 = [ 192 | 5 | 1 | 11 | 66 | 8 | 12 | 0 | 2 | 255 ]; + output uvec3 out0 = [ uvec3(1, 192, 192) | uvec3(255, 66, 5) | uvec3(192, 5, 1) | uvec3(2, 8, 11) | uvec3(5, 11, 66) | uvec3(12, 1, 8) | uvec3(0, 0, 12) | uvec3(11, 255, 0) | uvec3(8, 12, 2) | uvec3(66, 2, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_to_uvec3 + version 300 es + values + { + input uint in0 = [ 193 | 9 | 45 | 255 | 2 | 0 | 10 | 8 | 12 | 3 ]; + input uint in1 = [ 3 | 45 | 2 | 9 | 10 | 0 | 8 | 12 | 255 | 193 ]; + input uint in2 = [ 2 | 3 | 9 | 10 | 255 | 8 | 12 | 0 | 193 | 45 ]; + output uvec3 out0 = [ uvec3(193, 3, 2) | uvec3(9, 45, 3) | uvec3(45, 2, 9) | uvec3(255, 9, 10) | uvec3(2, 10, 255) | uvec3(0, 0, 8) | uvec3(10, 8, 12) | uvec3(8, 12, 0) | uvec3(12, 255, 193) | uvec3(3, 193, 45) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_to_uvec3 + version 300 es + values + { + input bool in0 = [ false | true ]; + input bool in1 = [ false | true ]; + input bool in2 = [ true | false ]; + output uvec3 out0 = [ uvec3(0, 0, 1) | uvec3(1, 1, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_int_to_uvec3 + version 300 es + values + { + input bool in0 = [ true | false | true | false | false | true | false | true | true | false ]; + input float in1 = [ 36.8125 | 20.125 | 1.0 | 0.0 | 3.5 | 1.0 | 2.0 | 0.5 | 0.0 | 8.25 ]; + input int in2 = [ 1 | 0 | 8 | 66 | 2 | 11 | 192 | 5 | 12 | 255 ]; + output uvec3 out0 = [ uvec3(1, 36, 1) | uvec3(0, 20, 0) | uvec3(1, 1, 8) | uvec3(0, 0, 66) | uvec3(0, 3, 2) | uvec3(1, 1, 11) | uvec3(0, 2, 192) | uvec3(1, 0, 5) | uvec3(1, 0, 12) | uvec3(0, 8, 255) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_bool_to_uvec3 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(32.0, 64.0) | vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(0.75, 0.0322580645161) ]; + input bool in1 = [ false | false | true | true | true ]; + output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(32, 64, 0) | uvec3(0, 2, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_float_to_uvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) ]; + input float in1 = [ 8.25 | 36.8125 | 20.125 | 2.0 | 0.0 | 1.0 | 0.5 | 3.5 ]; + output uvec3 out0 = [ uvec3(1, 1, 8) | uvec3(1, 0, 36) | uvec3(0, 1, 20) | uvec3(0, 0, 2) | uvec3(1, 0, 0) | uvec3(0, 1, 1) | uvec3(0, 0, 0) | uvec3(0, 0, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_int_to_uvec3 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) ]; + input int in1 = [ 255 | 1 | 2 | 5 | 0 | 11 | 192 | 12 | 8 | 66 ]; + output uvec3 out0 = [ uvec3(1, 1, 255) | uvec3(0, 1, 1) | uvec3(0, 0, 2) | uvec3(1, 1, 5) | uvec3(0, 0, 0) | uvec3(1, 0, 11) | uvec3(0, 0, 192) | uvec3(0, 0, 12) | uvec3(0, 1, 8) | uvec3(1, 0, 66) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_ivec2_to_uvec3 + version 300 es + values + { + input bool in0 = [ true | false | true | true | false ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(32, 64) ]; + output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 2) | uvec3(1, 1, 1) | uvec3(1, 0, 0) | uvec3(0, 32, 64) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_uvec2_to_uvec3 + version 300 es + values + { + input float in0 = [ 2.0 | 8.25 | 20.125 | 3.5 | 0.0 | 0.5 | 36.8125 | 1.0 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ]; + output uvec3 out0 = [ uvec3(2, 0, 2) | uvec3(8, 1, 1) | uvec3(20, 32, 64) | uvec3(3, 0, 0) | uvec3(0, 0, 2) | uvec3(0, 0, 0) | uvec3(36, 1, 1) | uvec3(1, 0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_vec2 + version 300 es + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ]; + output vec2 out0 = [ vec2(-0.5, 1.0) | vec2(-20.125, -20.125) | vec2(1.0, 0.0) | vec2(2.0, 3.5) | vec2(3.5, -8.25) | vec2(36.8125, 36.8125) | vec2(-8.25, -0.5) | vec2(0.0, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_ivec2 + version 300 es + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ]; + output ivec2 out0 = [ ivec2(0, 1) | ivec2(-20, -20) | ivec2(1, 0) | ivec2(2, 3) | ivec2(3, -8) | ivec2(36, 36) | ivec2(-8, 0) | ivec2(0, 2) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_bvec2 + version 300 es + values + { + input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ]; + input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_vec2 + version 300 es + values + { + input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ]; + input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ]; + output vec2 out0 = [ vec2(2.0, -192.0) | vec2(-66.0, 8.0) | vec2(0.0, 1.0) | vec2(5.0, 0.0) | vec2(-12.0, 5.0) | vec2(8.0, -66.0) | vec2(-192.0, 2.0) | vec2(1.0, 255.0) | vec2(11.0, 11.0) | vec2(255.0, -12.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_ivec2 + version 300 es + values + { + input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ]; + input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ]; + output ivec2 out0 = [ ivec2(2, -192) | ivec2(-66, 8) | ivec2(0, 1) | ivec2(5, 0) | ivec2(-12, 5) | ivec2(8, -66) | ivec2(-192, 2) | ivec2(1, 255) | ivec2(11, 11) | ivec2(255, -12) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_bvec2 + version 300 es + values + { + input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ]; + input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_vec2 + version 300 es + values + { + input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ]; + input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ]; + output vec2 out0 = [ vec2(9.0, 8.0) | vec2(12.0, 9.0) | vec2(0.0, 45.0) | vec2(255.0, 2.0) | vec2(8.0, 12.0) | vec2(45.0, 193.0) | vec2(3.0, 255.0) | vec2(2.0, 0.0) | vec2(10.0, 3.0) | vec2(193.0, 10.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_ivec2 + version 300 es + values + { + input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ]; + input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ]; + output ivec2 out0 = [ ivec2(9, 8) | ivec2(12, 9) | ivec2(0, 45) | ivec2(255, 2) | ivec2(8, 12) | ivec2(45, 193) | ivec2(3, 255) | ivec2(2, 0) | ivec2(10, 3) | ivec2(193, 10) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_bvec2 + version 300 es + values + { + input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ]; + input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_vec2 + version 300 es + 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 "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_ivec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_bvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_vec2 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ]; + input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ]; + output vec2 out0 = [ vec2(0.0, -66.0) | vec2(3.5, 1.0) | vec2(0.0, 255.0) | vec2(2.0, -192.0) | vec2(-8.25, 8.0) | vec2(36.8125, 2.0) | vec2(-20.125, 0.0) | vec2(1.0, 5.0) | vec2(1.0, -12.0) | vec2(-0.5, 11.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_ivec2 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ]; + input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ]; + output ivec2 out0 = [ ivec2(0, -66) | ivec2(3, 1) | ivec2(0, 255) | ivec2(2, -192) | ivec2(-8, 8) | ivec2(36, 2) | ivec2(-20, 0) | ivec2(1, 5) | ivec2(1, -12) | ivec2(0, 11) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_bvec2 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ]; + input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ]; + output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_vec2 + version 300 es + values + { + input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ]; + input bool in1 = [ false | true | true | false | false | true | false | true ]; + output vec2 out0 = [ vec2(2.0, 0.0) | vec2(3.5, 1.0) | vec2(1.0, 1.0) | vec2(-20.125, 0.0) | vec2(-8.25, 0.0) | vec2(0.0, 1.0) | vec2(-0.5, 0.0) | vec2(36.8125, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_ivec2 + version 300 es + values + { + input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ]; + input bool in1 = [ false | true | true | false | false | true | false | true ]; + output ivec2 out0 = [ ivec2(2, 0) | ivec2(3, 1) | ivec2(1, 1) | ivec2(-20, 0) | ivec2(-8, 0) | ivec2(0, 1) | ivec2(0, 0) | ivec2(36, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_bvec2 + version 300 es + values + { + input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ]; + input bool in1 = [ false | true | true | false | false | true | false | true ]; + output bvec2 out0 = [ bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_vec2 + version 300 es + values + { + input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ]; + input bool in1 = [ true | false | false | false | true | false | true | false | true | true ]; + output vec2 out0 = [ vec2(255.0, 1.0) | vec2(2.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 0.0) | vec2(-192.0, 1.0) | vec2(5.0, 0.0) | vec2(8.0, 1.0) | vec2(0.0, 0.0) | vec2(-66.0, 1.0) | vec2(11.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_ivec2 + version 300 es + values + { + input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ]; + input bool in1 = [ true | false | false | false | true | false | true | false | true | true ]; + output ivec2 out0 = [ ivec2(255, 1) | ivec2(2, 0) | ivec2(-12, 0) | ivec2(1, 0) | ivec2(-192, 1) | ivec2(5, 0) | ivec2(8, 1) | ivec2(0, 0) | ivec2(-66, 1) | ivec2(11, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_bvec2 + version 300 es + values + { + input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ]; + input bool in1 = [ true | false | false | false | true | false | true | false | true | true ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_vec2 + version 300 es + values + { + input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ]; + input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ]; + output vec2 out0 = [ vec2(-66.0, 193.0) | vec2(1.0, 0.0) | vec2(-192.0, 2.0) | vec2(-12.0, 10.0) | vec2(5.0, 255.0) | vec2(255.0, 12.0) | vec2(11.0, 45.0) | vec2(0.0, 8.0) | vec2(2.0, 9.0) | vec2(8.0, 3.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_ivec2 + version 300 es + values + { + input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ]; + input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ]; + output ivec2 out0 = [ ivec2(-66, 193) | ivec2(1, 0) | ivec2(-192, 2) | ivec2(-12, 10) | ivec2(5, 255) | ivec2(255, 12) | ivec2(11, 45) | ivec2(0, 8) | ivec2(2, 9) | ivec2(8, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_bvec2 + version 300 es + values + { + input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ]; + input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_vec2 + version 300 es + values + { + input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ]; + output vec2 out0 = [ vec2(12.0, -20.125) | vec2(0.0, 0.0) | vec2(8.0, 3.5) | vec2(193.0, -8.25) | vec2(3.0, 0.0) | vec2(10.0, 1.0) | vec2(9.0, 2.0) | vec2(2.0, 36.8125) | vec2(45.0, -0.5) | vec2(255.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = vec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_ivec2 + version 300 es + values + { + input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ]; + output ivec2 out0 = [ ivec2(12, -20) | ivec2(0, 0) | ivec2(8, 3) | ivec2(193, -8) | ivec2(3, 0) | ivec2(10, 1) | ivec2(9, 2) | ivec2(2, 36) | ivec2(45, 0) | ivec2(255, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = ivec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_bvec2 + version 300 es + values + { + input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ]; + output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = bvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_to_uvec2 + version 300 es + values + { + input float in0 = [ 8.25 | 36.8125 | 1.0 | 0.5 | 20.125 | 0.0 | 2.0 | 3.5 ]; + input float in1 = [ 0.5 | 36.8125 | 0.0 | 2.0 | 8.25 | 20.125 | 1.0 | 3.5 ]; + output uvec2 out0 = [ uvec2(8, 0) | uvec2(36, 36) | uvec2(1, 0) | uvec2(0, 2) | uvec2(20, 8) | uvec2(0, 20) | uvec2(2, 1) | uvec2(3, 3) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_int_to_uvec2 + version 300 es + values + { + input int in0 = [ 0 | 12 | 8 | 11 | 255 | 66 | 192 | 2 | 5 | 1 ]; + input int in1 = [ 11 | 12 | 2 | 5 | 66 | 192 | 255 | 0 | 1 | 8 ]; + output uvec2 out0 = [ uvec2(0, 11) | uvec2(12, 12) | uvec2(8, 2) | uvec2(11, 5) | uvec2(255, 66) | uvec2(66, 192) | uvec2(192, 255) | uvec2(2, 0) | uvec2(5, 1) | uvec2(1, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_uint_to_uvec2 + version 300 es + values + { + input uint in0 = [ 3 | 9 | 10 | 193 | 8 | 0 | 255 | 45 | 2 | 12 ]; + input uint in1 = [ 0 | 2 | 12 | 3 | 10 | 9 | 45 | 193 | 255 | 8 ]; + output uvec2 out0 = [ uvec2(3, 0) | uvec2(9, 2) | uvec2(10, 12) | uvec2(193, 3) | uvec2(8, 10) | uvec2(0, 9) | uvec2(255, 45) | uvec2(45, 193) | uvec2(2, 255) | uvec2(12, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case bool_bool_to_uvec2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_int_to_uvec2 + version 300 es + values + { + input float in0 = [ 8.25 | 1.0 | 0.5 | 3.5 | 2.0 | 0.0 | 36.8125 | 1.0 | 0.0 | 20.125 ]; + input int in1 = [ 0 | 255 | 12 | 5 | 192 | 2 | 66 | 11 | 1 | 8 ]; + output uvec2 out0 = [ uvec2(8, 0) | uvec2(1, 255) | uvec2(0, 12) | uvec2(3, 5) | uvec2(2, 192) | uvec2(0, 2) | uvec2(36, 66) | uvec2(1, 11) | uvec2(0, 1) | uvec2(20, 8) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_bool_to_uvec2 + version 300 es + values + { + input float in0 = [ 3.5 | 1.0 | 8.25 | 0.5 | 2.0 | 36.8125 | 0.0 | 20.125 ]; + input bool in1 = [ true | false | true | false | true | false | false | true ]; + output uvec2 out0 = [ uvec2(3, 1) | uvec2(1, 0) | uvec2(8, 1) | uvec2(0, 0) | uvec2(2, 1) | uvec2(36, 0) | uvec2(0, 0) | uvec2(20, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_bool_to_uvec2 + version 300 es + values + { + input int in0 = [ 12 | 11 | 0 | 5 | 8 | 255 | 2 | 1 | 66 | 192 ]; + input bool in1 = [ true | true | false | false | false | true | false | false | true | true ]; + output uvec2 out0 = [ uvec2(12, 1) | uvec2(11, 1) | uvec2(0, 0) | uvec2(5, 0) | uvec2(8, 0) | uvec2(255, 1) | uvec2(2, 0) | uvec2(1, 0) | uvec2(66, 1) | uvec2(192, 1) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uint_to_uvec2 + version 300 es + values + { + input int in0 = [ 8 | 5 | 1 | 0 | 11 | 12 | 192 | 66 | 255 | 2 ]; + input uint in1 = [ 8 | 10 | 45 | 255 | 9 | 193 | 2 | 3 | 0 | 12 ]; + output uvec2 out0 = [ uvec2(8, 8) | uvec2(5, 10) | uvec2(1, 45) | uvec2(0, 255) | uvec2(11, 9) | uvec2(12, 193) | uvec2(192, 2) | uvec2(66, 3) | uvec2(255, 0) | uvec2(2, 12) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + case uint_float_to_uvec2 + version 300 es + values + { + input uint in0 = [ 9 | 45 | 8 | 3 | 10 | 2 | 193 | 12 | 255 | 0 ]; + input float in1 = [ 3.5 | 20.125 | 2.0 | 0.0 | 1.0 | 36.8125 | 8.25 | 1.0 | 0.0 | 0.5 ]; + output uvec2 out0 = [ uvec2(9, 3) | uvec2(45, 20) | uvec2(8, 2) | uvec2(3, 0) | uvec2(10, 1) | uvec2(2, 36) | uvec2(193, 8) | uvec2(12, 1) | uvec2(255, 0) | uvec2(0, 0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = uvec2(in0, in1); + ${OUTPUT} + } + "" + end + + +end # vector_combine +group matrix_combine "Matrix Combine Constructors" + + case vec2_vec2_to_mat2 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input vec2 in1 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) ]; + output mat2 out0 = [ mat2(1.0, 1.25, 0.0, 0.5) | mat2(-32.0, 64.0, 1.0, 1.25) | mat2(-0.5, -2.25, -0.75, -0.0322580645161) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, -0.5, -2.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec2_bvec2_to_mat2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) ]; + output mat2 out0 = [ mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_to_mat2 + version 300 es + values + { + input float in0 = [ -8.25 | 3.5 | 36.8125 | 2.0 | -20.125 | 1.0 | -0.5 | 0.0 ]; + input float in1 = [ 3.5 | -20.125 | 1.0 | 0.0 | -8.25 | 2.0 | 36.8125 | -0.5 ]; + input float in2 = [ 36.8125 | 3.5 | 0.0 | -20.125 | -0.5 | -8.25 | 1.0 | 2.0 ]; + input float in3 = [ -0.5 | 0.0 | -8.25 | -20.125 | 2.0 | 3.5 | 1.0 | 36.8125 ]; + output mat2 out0 = [ mat2(-8.25, 3.5, 36.8125, -0.5) | mat2(3.5, -20.125, 3.5, 0.0) | mat2(36.8125, 1.0, 0.0, -8.25) | mat2(2.0, 0.0, -20.125, -20.125) | mat2(-20.125, -8.25, -0.5, 2.0) | mat2(1.0, 2.0, -8.25, 3.5) | mat2(-0.5, 36.8125, 1.0, 1.0) | mat2(0.0, -0.5, 2.0, 36.8125) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 2 | 1 | -192 | 11 | -66 | 255 | 0 | 8 | -12 | 5 ]; + input int in1 = [ 11 | 255 | 5 | -66 | 8 | 2 | 0 | -12 | 1 | -192 ]; + input int in2 = [ 11 | 1 | -12 | 255 | 5 | 0 | 8 | -192 | 2 | -66 ]; + input int in3 = [ 2 | 1 | 0 | 8 | 255 | -66 | -192 | 11 | 5 | -12 ]; + output mat2 out0 = [ mat2(2.0, 11.0, 11.0, 2.0) | mat2(1.0, 255.0, 1.0, 1.0) | mat2(-192.0, 5.0, -12.0, 0.0) | mat2(11.0, -66.0, 255.0, 8.0) | mat2(-66.0, 8.0, 5.0, 255.0) | mat2(255.0, 2.0, 0.0, -66.0) | mat2(0.0, 0.0, 8.0, -192.0) | mat2(8.0, -12.0, -192.0, 11.0) | mat2(-12.0, 1.0, 2.0, 5.0) | mat2(5.0, -192.0, -66.0, -12.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case uint_uint_uint_uint_to_mat2 + version 300 es + values + { + input uint in0 = [ 193 | 9 | 12 | 45 | 10 | 2 | 8 | 3 | 255 | 0 ]; + input uint in1 = [ 0 | 255 | 12 | 193 | 3 | 2 | 45 | 9 | 8 | 10 ]; + input uint in2 = [ 3 | 9 | 10 | 2 | 12 | 193 | 255 | 0 | 8 | 45 ]; + input uint in3 = [ 45 | 12 | 9 | 3 | 2 | 255 | 10 | 8 | 193 | 0 ]; + output mat2 out0 = [ mat2(193.0, 0.0, 3.0, 45.0) | mat2(9.0, 255.0, 9.0, 12.0) | mat2(12.0, 12.0, 10.0, 9.0) | mat2(45.0, 193.0, 2.0, 3.0) | mat2(10.0, 3.0, 12.0, 2.0) | mat2(2.0, 2.0, 193.0, 255.0) | mat2(8.0, 45.0, 255.0, 10.0) | mat2(3.0, 9.0, 0.0, 8.0) | mat2(255.0, 8.0, 8.0, 193.0) | mat2(0.0, 10.0, 45.0, 0.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ true | false ]; + input bool in2 = [ true | false ]; + input bool in3 = [ false | true ]; + output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ false | true | false | true | true | false | true | true | false | false ]; + input float in1 = [ 2.0 | -0.5 | 0.0 | 1.0 | 1.0 | 36.8125 | 3.5 | 0.0 | -8.25 | -20.125 ]; + input int in2 = [ 0 | -12 | 8 | -192 | 1 | -66 | 5 | 11 | 2 | 255 ]; + input bool in3 = [ true | false | true | false | true | false | false | true | true | false ]; + output mat2 out0 = [ mat2(0.0, 2.0, 0.0, 1.0) | mat2(1.0, -0.5, -12.0, 0.0) | mat2(0.0, 0.0, 8.0, 1.0) | mat2(1.0, 1.0, -192.0, 0.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(0.0, 36.8125, -66.0, 0.0) | mat2(1.0, 3.5, 5.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(0.0, -8.25, 2.0, 1.0) | mat2(0.0, -20.125, 255.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_to_mat2 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ]; + output mat2 out0 = [ mat2(1.0, 1.25, 0.0, -2.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec2_to_mat2 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | 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(false, false) | bvec2(false, true) | bvec2(true, true) ]; + output mat2 out0 = [ mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-32.0, 64.0, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 0.0, 1.0) | mat2(0.0, 0.5, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_to_mat2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in1 = [ 36.8125 | -8.25 | 1.0 | -0.5 | 2.0 | -20.125 | 0.0 | 3.5 ]; + output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 36.8125) | mat2(0.0, 1.0, 0.0, -8.25) | mat2(0.0, 0.0, 0.0, 1.0) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(1.0, 0.0, 0.0, 2.0) | mat2(0.0, 1.0, 0.0, -20.125) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 0.0, 3.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec3_float_to_mat2 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input float in1 = [ -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 | -8.25 | 2.0 | 1.0 ]; + output mat2 out0 = [ mat2(1.0, 1.25, 1.125, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(0.0, 0.5, 0.75, 3.5) | mat2(-32.0, 64.0, -51.0, -8.25) | mat2(0.0, 0.5, 0.75, 2.0) | mat2(-0.75, -0.0322580645161, 0.0526315789474, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_ivec2_int_to_mat2 + version 300 es + values + { + input int in0 = [ 8 | -192 | 2 | 0 | -66 | 255 | 5 | 1 | -12 | 11 ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(1, 1) ]; + input int in2 = [ 2 | 1 | -12 | 0 | 11 | 8 | 255 | -192 | 5 | -66 ]; + output mat2 out0 = [ mat2(8.0, 0.0, -2.0, 2.0) | mat2(-192.0, 0.0, 0.0, 1.0) | mat2(2.0, -32.0, 64.0, -12.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-66.0, 0.0, 0.0, 11.0) | mat2(255.0, -32.0, 64.0, 8.0) | mat2(5.0, 0.0, 0.0, 255.0) | mat2(1.0, 0.0, -2.0, -192.0) | mat2(-12.0, 1.0, 1.0, 5.0) | mat2(11.0, 1.0, 1.0, -66.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case bool_float_ivec2_to_mat2 + version 300 es + values + { + input bool in0 = [ true | true | true | false | false | true | false | false ]; + input float in1 = [ 1.0 | -0.5 | -20.125 | 36.8125 | 2.0 | 0.0 | -8.25 | 3.5 ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) ]; + output mat2 out0 = [ mat2(1.0, 1.0, 0.0, 0.0) | mat2(1.0, -0.5, 0.0, 0.0) | mat2(1.0, -20.125, 1.0, 1.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, 2.0, 1.0, 1.0) | mat2(1.0, 0.0, 0.0, -2.0) | mat2(0.0, -8.25, -32.0, 64.0) | mat2(0.0, 3.5, 0.0, -2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case float_uvec3_to_mat2 + version 300 es + values + { + input float in0 = [ 36.8125 | 2.0 | -0.5 | 0.0 | -20.125 | 1.0 | 3.5 | -8.25 ]; + input uvec3 in1 = [ uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(32, 64, 51) | uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) ]; + output mat2 out0 = [ mat2(36.8125, 1.0, 1.0, 1.0) | mat2(2.0, 0.0, 2.0, 4.0) | mat2(-0.5, 0.0, 2.0, 4.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-20.125, 32.0, 64.0, 51.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(3.5, 0.0, 0.0, 0.0) | mat2(-8.25, 1.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1); + ${OUTPUT} + } + "" + end + + case int_uvec2_bool_to_mat2 + version 300 es + values + { + input int in0 = [ 1 | -66 | 5 | -192 | 11 | 0 | 8 | 2 | -12 | 255 ]; + input uvec2 in1 = [ uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 0) | uvec2(32, 64) ]; + input bool in2 = [ true | false | true | false | false | false | true | true | true | false ]; + output mat2 out0 = [ mat2(1.0, 0.0, 2.0, 1.0) | mat2(-66.0, 32.0, 64.0, 0.0) | mat2(5.0, 1.0, 1.0, 1.0) | mat2(-192.0, 0.0, 0.0, 0.0) | mat2(11.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(8.0, 0.0, 2.0, 1.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(-12.0, 0.0, 0.0, 1.0) | mat2(255.0, 32.0, 64.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_to_mat2x3 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) ]; + input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875) | mat2x3(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125) | mat2x3(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_bvec3_to_mat2x3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ]; + input bvec3 in1 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_float_float_to_mat2x3 + version 300 es + values + { + input float in0 = [ 1.0 | -8.25 | -20.125 | 36.8125 | -0.5 | 2.0 | 3.5 | 0.0 ]; + input float in1 = [ -0.5 | -20.125 | 36.8125 | -8.25 | 2.0 | 1.0 | 3.5 | 0.0 ]; + input float in2 = [ 3.5 | 1.0 | 36.8125 | -20.125 | -8.25 | -0.5 | 2.0 | 0.0 ]; + input float in3 = [ 1.0 | -8.25 | 0.0 | -20.125 | 2.0 | 3.5 | -0.5 | 36.8125 ]; + input float in4 = [ 1.0 | 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 ]; + input float in5 = [ 2.0 | -20.125 | -8.25 | -0.5 | 3.5 | 1.0 | 36.8125 | 0.0 ]; + output mat2x3 out0 = [ mat2x3(1.0, -0.5, 3.5, 1.0, 1.0, 2.0) | mat2x3(-8.25, -20.125, 1.0, -8.25, 0.0, -20.125) | mat2x3(-20.125, 36.8125, 36.8125, 0.0, 3.5, -8.25) | mat2x3(36.8125, -8.25, -20.125, -20.125, 2.0, -0.5) | mat2x3(-0.5, 2.0, -8.25, 2.0, -8.25, 3.5) | mat2x3(2.0, 1.0, -0.5, 3.5, -20.125, 1.0) | mat2x3(3.5, 3.5, 2.0, -0.5, -0.5, 36.8125) | mat2x3(0.0, 0.0, 0.0, 36.8125, 36.8125, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case int_int_int_int_int_int_to_mat2x3 + version 300 es + values + { + input int in0 = [ 2 | 8 | -192 | 0 | 5 | -12 | 1 | 255 | -66 | 11 ]; + input int in1 = [ 1 | -192 | 8 | 0 | -12 | 2 | 11 | 255 | -66 | 5 ]; + input int in2 = [ -192 | 2 | -66 | 8 | 11 | 255 | 0 | 5 | -12 | 1 ]; + input int in3 = [ 2 | 11 | 255 | 0 | -66 | -12 | 5 | -192 | 8 | 1 ]; + input int in4 = [ 8 | 0 | -12 | -192 | 2 | -66 | 1 | 255 | 5 | 11 ]; + input int in5 = [ 0 | 11 | 5 | 8 | -12 | 255 | -192 | 2 | 1 | -66 ]; + output mat2x3 out0 = [ mat2x3(2.0, 1.0, -192.0, 2.0, 8.0, 0.0) | mat2x3(8.0, -192.0, 2.0, 11.0, 0.0, 11.0) | mat2x3(-192.0, 8.0, -66.0, 255.0, -12.0, 5.0) | mat2x3(0.0, 0.0, 8.0, 0.0, -192.0, 8.0) | mat2x3(5.0, -12.0, 11.0, -66.0, 2.0, -12.0) | mat2x3(-12.0, 2.0, 255.0, -12.0, -66.0, 255.0) | mat2x3(1.0, 11.0, 0.0, 5.0, 1.0, -192.0) | mat2x3(255.0, 255.0, 5.0, -192.0, 255.0, 2.0) | mat2x3(-66.0, -66.0, -12.0, 8.0, 5.0, 1.0) | mat2x3(11.0, 5.0, 1.0, 1.0, 11.0, -66.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_bool_bool_to_mat2x3 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + input bool in3 = [ true | false ]; + input bool in4 = [ true | false ]; + input bool in5 = [ true | false ]; + output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 1.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_float_int_to_mat2x3 + version 300 es + values + { + input bool in0 = [ false | true | false | true | false | true | false | true | true | false ]; + input float in1 = [ 0.0 | -8.25 | 2.0 | -20.125 | 3.5 | 0.0 | -0.5 | 36.8125 | 1.0 | 1.0 ]; + input int in2 = [ -66 | -12 | 2 | 8 | 255 | 11 | -192 | 1 | 5 | 0 ]; + input bool in3 = [ true | false | true | false | false | true | true | false | true | false ]; + input float in4 = [ 1.0 | 0.0 | -8.25 | 1.0 | 3.5 | -20.125 | -0.5 | 0.0 | 2.0 | 36.8125 ]; + input int in5 = [ 255 | -192 | 1 | 2 | -12 | -66 | 8 | 0 | 11 | 5 ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, -66.0, 1.0, 1.0, 255.0) | mat2x3(1.0, -8.25, -12.0, 0.0, 0.0, -192.0) | mat2x3(0.0, 2.0, 2.0, 1.0, -8.25, 1.0) | mat2x3(1.0, -20.125, 8.0, 0.0, 1.0, 2.0) | mat2x3(0.0, 3.5, 255.0, 0.0, 3.5, -12.0) | mat2x3(1.0, 0.0, 11.0, 1.0, -20.125, -66.0) | mat2x3(0.0, -0.5, -192.0, 1.0, -0.5, 8.0) | mat2x3(1.0, 36.8125, 1.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 1.0, 5.0, 1.0, 2.0, 11.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 36.8125, 5.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec3_ivec3_to_mat2x3 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ]; + output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, 1.0, 1.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0) | mat2x3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0) | mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec4_to_mat2x3 + version 300 es + values + { + input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + output mat2x3 out0 = [ mat2x3(-32.0, 64.0, 1.0, 0.0, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.0, 1.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0) | mat2x3(1.0, 1.25, 1.0, 1.0, 1.0, 1.0) | mat2x3(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_ivec2_to_mat2x3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) ]; + input float in1 = [ 1.0 | -8.25 | 36.8125 | 2.0 | 3.5 | -0.5 | -20.125 | 0.0 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x3(1.0, 1.0, 1.0, 36.8125, -32.0, 64.0) | mat2x3(1.0, 0.0, 0.0, 2.0, 0.0, -2.0) | mat2x3(0.0, 0.0, 0.0, 3.5, 1.0, 1.0) | mat2x3(0.0, 1.0, 0.0, -0.5, 0.0, -2.0) | mat2x3(1.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_float_bvec2_to_mat2x3 + version 300 es + values + { + input vec3 in0 = [ 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(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input float in1 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 2.0 | 1.0 | -20.125 ]; + input bvec2 in2 = [ bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ]; + output mat2x3 out0 = [ mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, -4.875, 36.8125, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.75, 3.5, 1.0, 0.0) | mat2x3(1.0, 1.25, 1.125, -0.5, 0.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -8.25, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 2.0, 1.0, 0.0) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.25, 1.125, -20.125, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec2_to_mat2x4 + version 300 es + values + { + input vec3 in0 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) ]; + input vec3 in1 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ]; + input vec2 in2 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + output mat2x4 out0 = [ mat2x4(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -0.75, -0.0322580645161) | mat2x4(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875, -32.0, 64.0) | mat2x4(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25) | mat2x4(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 0.0, 0.5) | mat2x4(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125, -0.5, -2.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec2_to_mat2x4 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) ]; + output mat2x4 out0 = [ mat2x4(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, -2.0) | mat2x4(1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 1.0, 1.0) | mat2x4(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 0.0, 0.0) | mat2x4(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, -32.0, 64.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_to_mat2x4 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | 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) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) ]; + input float in2 = [ -8.25 | -0.5 | 3.5 | 36.8125 | 0.0 | 0.0 | 2.0 | -20.125 | 1.0 | 1.0 ]; + input float in3 = [ 1.0 | 2.0 | -0.5 | 3.5 | 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | -20.125 ]; + input int in4 = [ 255 | 8 | 11 | -12 | -192 | 0 | 2 | 1 | -66 | 5 ]; + input bool in5 = [ true | false | false | true | false | true | true | false | true | false ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.5, 1.0, 1.0, -8.25, 1.0, 255.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, -2.0, -0.5, 2.0, 8.0, 0.0) | mat2x4(-0.5, -2.25, -32.0, 64.0, 3.5, -0.5, 11.0, 0.0) | mat2x4(0.0, 0.5, 0.0, -2.0, 36.8125, 3.5, -12.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, 0.0, 0.0, 36.8125, -192.0, 0.0) | mat2x4(1.0, 1.25, 0.0, 0.0, 0.0, -8.25, 0.0, 1.0) | mat2x4(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, 1.0, 2.0, 1.0) | mat2x4(1.0, 1.25, 0.0, 0.0, -20.125, 0.0, 1.0, 0.0) | mat2x4(-0.5, -2.25, 0.0, 0.0, 1.0, 0.0, -66.0, 1.0) | mat2x4(-0.75, -0.0322580645161, 1.0, 1.0, 1.0, -20.125, 5.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_to_mat2x4 + version 300 es + values + { + input bool in0 = [ false | true | false | true | true | true | false | false | false | true ]; + input float in1 = [ 0.0 | -0.5 | -20.125 | -8.25 | 0.0 | 2.0 | 3.5 | 1.0 | 1.0 | 36.8125 ]; + input int in2 = [ 2 | 1 | 255 | 8 | -66 | 0 | -12 | 5 | -192 | 11 ]; + input vec2 in3 = [ 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) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ]; + input bool in4 = [ true | false | false | true | false | false | true | true | true | false ]; + input bvec2 in5 = [ bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) ]; + output mat2x4 out0 = [ mat2x4(0.0, 0.0, 2.0, -32.0, 64.0, 1.0, 1.0, 0.0) | mat2x4(1.0, -0.5, 1.0, -0.5, -2.25, 0.0, 1.0, 1.0) | mat2x4(0.0, -20.125, 255.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(1.0, -8.25, 8.0, -0.75, -0.0322580645161, 1.0, 1.0, 1.0) | mat2x4(1.0, 0.0, -66.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat2x4(1.0, 2.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(0.0, 3.5, -12.0, -32.0, 64.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, 5.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0) | mat2x4(1.0, 36.8125, 11.0, -0.75, -0.0322580645161, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_to_mat2x4 + version 300 es + values + { + input bool in0 = [ true | true | true | false | false | false | false | false | true | true ]; + input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) ]; + input int in2 = [ 8 | 1 | 5 | -66 | -192 | 11 | 255 | 0 | -12 | 2 ]; + input vec4 in3 = [ 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.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) ]; + output mat2x4 out0 = [ mat2x4(1.0, 1.0, 1.0, 8.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 1.0, 0.0, 5.0, -32.0, 64.0, -51.0, 24.0) | mat2x4(0.0, 0.0, 0.0, -66.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(0.0, 1.0, 0.0, 11.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 0.0, 1.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(1.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_to_mat2x4 + version 300 es + values + { + input float in0 = [ 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | 36.8125 | 1.0 | -0.5 ]; + input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ]; + input ivec2 in2 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ]; + input bool in3 = [ true | true | false | true | false | false | false | true ]; + output mat2x4 out0 = [ mat2x4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat2x4(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0) | mat2x4(-8.25, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x4(-20.125, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat2x4(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec3_vec3_to_mat3x2 + version 300 es + values + { + input vec3 in0 = [ 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(1.0, 1.25, 1.125) ]; + input vec3 in1 = [ 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) ]; + output mat3x2 out0 = [ mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125) | mat3x2(-0.5, -2.25, -4.875, -0.75, -0.0322580645161, 0.0526315789474) | mat3x2(0.0, 0.5, 0.75, -32.0, 64.0, -51.0) | mat3x2(-32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.5, 0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_bvec3_to_mat3x2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ]; + input bvec3 in1 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 0.0, 1.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case float_float_float_float_float_float_to_mat3x2 + version 300 es + values + { + input float in0 = [ -8.25 | 36.8125 | -20.125 | -0.5 | 3.5 | 1.0 | 2.0 | 0.0 ]; + input float in1 = [ 2.0 | 3.5 | -20.125 | 36.8125 | 1.0 | 0.0 | -8.25 | -0.5 ]; + input float in2 = [ -0.5 | 2.0 | 1.0 | 0.0 | -8.25 | 36.8125 | -20.125 | 3.5 ]; + input float in3 = [ 36.8125 | 0.0 | 1.0 | -0.5 | 2.0 | 3.5 | -20.125 | -8.25 ]; + input float in4 = [ 36.8125 | 2.0 | 0.0 | -0.5 | 3.5 | -20.125 | -8.25 | 1.0 ]; + input float in5 = [ 0.0 | 36.8125 | -20.125 | -0.5 | 3.5 | 2.0 | 1.0 | -8.25 ]; + output mat3x2 out0 = [ mat3x2(-8.25, 2.0, -0.5, 36.8125, 36.8125, 0.0) | mat3x2(36.8125, 3.5, 2.0, 0.0, 2.0, 36.8125) | mat3x2(-20.125, -20.125, 1.0, 1.0, 0.0, -20.125) | mat3x2(-0.5, 36.8125, 0.0, -0.5, -0.5, -0.5) | mat3x2(3.5, 1.0, -8.25, 2.0, 3.5, 3.5) | mat3x2(1.0, 0.0, 36.8125, 3.5, -20.125, 2.0) | mat3x2(2.0, -8.25, -20.125, -20.125, -8.25, 1.0) | mat3x2(0.0, -0.5, 3.5, -8.25, 1.0, -8.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case int_int_int_int_int_int_to_mat3x2 + version 300 es + values + { + input int in0 = [ 8 | -192 | 2 | 11 | 255 | -66 | 5 | -12 | 1 | 0 ]; + input int in1 = [ 1 | 2 | -12 | 5 | 0 | 255 | 8 | 11 | -192 | -66 ]; + input int in2 = [ -12 | 11 | 2 | 1 | 8 | -66 | -192 | 5 | 255 | 0 ]; + input int in3 = [ -192 | 0 | -12 | 11 | 1 | -66 | 8 | 255 | 2 | 5 ]; + input int in4 = [ -12 | 5 | 0 | -66 | 255 | 8 | -192 | 11 | 2 | 1 ]; + input int in5 = [ -66 | -12 | 8 | 2 | 255 | 0 | -192 | 11 | 1 | 5 ]; + output mat3x2 out0 = [ mat3x2(8.0, 1.0, -12.0, -192.0, -12.0, -66.0) | mat3x2(-192.0, 2.0, 11.0, 0.0, 5.0, -12.0) | mat3x2(2.0, -12.0, 2.0, -12.0, 0.0, 8.0) | mat3x2(11.0, 5.0, 1.0, 11.0, -66.0, 2.0) | mat3x2(255.0, 0.0, 8.0, 1.0, 255.0, 255.0) | mat3x2(-66.0, 255.0, -66.0, -66.0, 8.0, 0.0) | mat3x2(5.0, 8.0, -192.0, 8.0, -192.0, -192.0) | mat3x2(-12.0, 11.0, 5.0, 255.0, 11.0, 11.0) | mat3x2(1.0, -192.0, 255.0, 2.0, 2.0, 1.0) | mat3x2(0.0, -66.0, 0.0, 5.0, 1.0, 5.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bool_bool_bool_bool_bool_to_mat3x2 + version 300 es + values + { + input bool in0 = [ true | false ]; + input bool in1 = [ false | true ]; + input bool in2 = [ false | true ]; + input bool in3 = [ false | true ]; + input bool in4 = [ false | true ]; + input bool in5 = [ false | true ]; + output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 1.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_bool_float_int_to_mat3x2 + version 300 es + values + { + input bool in0 = [ true | false | true | true | false | true | false | true | false | false ]; + input float in1 = [ -20.125 | 0.0 | 3.5 | 0.0 | 1.0 | -8.25 | 1.0 | 2.0 | 36.8125 | -0.5 ]; + input int in2 = [ 255 | -66 | 8 | -192 | 5 | 11 | 1 | 2 | 0 | -12 ]; + input bool in3 = [ true | false | false | true | false | true | true | false | false | true ]; + input float in4 = [ 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | -0.5 | 2.0 | 3.5 | 1.0 | 36.8125 ]; + input int in5 = [ -192 | 8 | 2 | 255 | -66 | -12 | 11 | 0 | 5 | 1 ]; + output mat3x2 out0 = [ mat3x2(1.0, -20.125, 255.0, 1.0, 0.0, -192.0) | mat3x2(0.0, 0.0, -66.0, 0.0, -20.125, 8.0) | mat3x2(1.0, 3.5, 8.0, 0.0, 1.0, 2.0) | mat3x2(1.0, 0.0, -192.0, 1.0, -8.25, 255.0) | mat3x2(0.0, 1.0, 5.0, 0.0, 0.0, -66.0) | mat3x2(1.0, -8.25, 11.0, 1.0, -0.5, -12.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 2.0, 11.0) | mat3x2(1.0, 2.0, 2.0, 0.0, 3.5, 0.0) | mat3x2(0.0, 36.8125, 0.0, 0.0, 1.0, 5.0) | mat3x2(0.0, -0.5, -12.0, 1.0, 36.8125, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec3_ivec3_to_mat3x2 + version 300 es + 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(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) ]; + input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.5, 0.75, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 0.0, -2.0, -4.0) | mat3x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3x2(-0.5, -2.25, -4.875, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case vec2_bvec4_to_mat3x2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ]; + input bvec4 in1 = [ 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) ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.5, 1.0, 1.0, 1.0, 1.0) | mat3x2(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 1.0) | mat3x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(-0.5, -2.25, 1.0, 0.0, 0.0, 1.0) | mat3x2(1.0, 1.25, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1); + ${OUTPUT} + } + "" + end + + case bvec3_float_ivec2_to_mat3x2 + version 300 es + values + { + input bvec3 in0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) ]; + input float in1 = [ -8.25 | 1.0 | 2.0 | -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) ]; + output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, -8.25, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0) | mat3x2(0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, -0.5, 0.0, -2.0) | mat3x2(0.0, 1.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 36.8125, 0.0, -2.0) | mat3x2(1.0, 0.0, 0.0, 3.5, -32.0, 64.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_float_bvec2_to_mat3x2 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input float in1 = [ -8.25 | 36.8125 | -0.5 | 3.5 | 2.0 | -20.125 | 0.0 | 1.0 ]; + input bvec2 in2 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) ]; + output mat3x2 out0 = [ mat3x2(1.0, 1.25, 1.125, -8.25, 1.0, 0.0) | mat3x2(1.0, 1.25, 1.125, 36.8125, 0.0, 0.0) | mat3x2(-0.5, -2.25, -4.875, -0.5, 1.0, 1.0) | mat3x2(-0.5, -2.25, -4.875, 3.5, 0.0, 0.0) | mat3x2(-32.0, 64.0, -51.0, 2.0, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, -20.125, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, 0.0, 1.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec3_to_mat3 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input vec3 in1 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ]; + input vec3 in2 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) ]; + output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, 1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, 1.0, 1.25, 1.125) | mat3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75, 0.0, 0.5, 0.75) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec3_to_mat3 + version 300 es + values + { + input ivec3 in0 = [ ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) ]; + input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) ]; + output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(0.0, -2.0, -4.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(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) | mat3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(-32, 64) ]; + input float in2 = [ -0.5 | 3.5 | 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ]; + input float in3 = [ 3.5 | 0.0 | -20.125 | 36.8125 | 2.0 | -8.25 | -0.5 | 1.0 | 0.0 | 1.0 ]; + input int in4 = [ 0 | 11 | 5 | -192 | 8 | -66 | 1 | 2 | 255 | -12 ]; + input bool in5 = [ true | true | true | false | true | false | false | false | true | false ]; + input bool in6 = [ false | false | true | false | false | false | true | true | true | true ]; + output mat3 out0 = [ mat3(1.0, 1.25, 0.0, 0.0, -0.5, 3.5, 0.0, 1.0, 0.0) | mat3(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, 11.0, 1.0, 0.0) | mat3(0.0, 0.5, 1.0, 1.0, 0.0, -20.125, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, 0.0, -2.0, -20.125, 36.8125, -192.0, 0.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, 2.0, 8.0, 1.0, 0.0) | mat3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, -8.25, -66.0, 0.0, 0.0) | mat3(-0.5, -2.25, 1.0, 1.0, 0.0, -0.5, 1.0, 0.0, 1.0) | mat3(1.0, 1.25, -32.0, 64.0, 1.0, 1.0, 2.0, 0.0, 1.0) | mat3(0.0, 0.5, 0.0, 0.0, 2.0, 0.0, 255.0, 1.0, 1.0) | mat3(-32.0, 64.0, -32.0, 64.0, 36.8125, 1.0, -12.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ false | true | true | true | true | true | false | false | false | false ]; + input float in1 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 3.5 | -20.125 | 1.0 | 0.0 | 2.0 ]; + input int in2 = [ 8 | -66 | 5 | 1 | 0 | 2 | -12 | -192 | 11 | 255 ]; + input vec2 in3 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ]; + input bool in4 = [ true | false | true | false | false | true | true | false | true | false ]; + input bvec2 in5 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ]; + input float in6 = [ -0.5 | 1.0 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.0 | 3.5 | -20.125 | -8.25 ]; + output mat3 out0 = [ mat3(0.0, -8.25, 8.0, 0.0, 0.5, 1.0, 0.0, 1.0, -0.5) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, -0.5, 5.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 36.8125, 1.0, -32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, -0.5, -2.25, 0.0, 1.0, 1.0, 36.8125) | mat3(1.0, 3.5, 2.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 2.0) | mat3(0.0, -20.125, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0, 0.0) | mat3(0.0, 1.0, -192.0, 0.0, 0.5, 0.0, 0.0, 0.0, 3.5) | mat3(0.0, 0.0, 11.0, 1.0, 1.25, 1.0, 0.0, 1.0, -20.125) | mat3(0.0, 2.0, 255.0, -0.75, -0.0322580645161, 0.0, 1.0, 1.0, -8.25) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false | true | true | false | false | true | false | false | true ]; + input bvec2 in1 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ]; + input int in2 = [ -192 | 2 | 0 | 5 | 1 | -66 | 11 | -12 | 8 | 255 ]; + input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | 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.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(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + input bool in4 = [ false | true | false | true | false | false | false | true | true | true ]; + output mat3 out0 = [ mat3(1.0, 0.0, 0.0, -192.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, 2.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 1.0, 5.0, -32.0, 64.0, -51.0, 24.0, 1.0) | mat3(0.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 0.0, 1.0, 11.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 1.0, 0.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(0.0, 1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(1.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -8.25 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -20.125 | 0.0 ]; + input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) ]; + input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) ]; + input bool in3 = [ false | true | false | true | true | false | true | false ]; + input bool in4 = [ true | false | false | false | true | true | false | true ]; + output mat3 out0 = [ mat3(-8.25, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 1.0, 0.0) | mat3(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3(-0.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3(in0, in1, in2, in3, in4); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_to_mat3x4 + version 300 es + values + { + input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input vec4 in1 = [ 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) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) ]; + input vec4 in2 = [ 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) | vec4(0.0, 0.5, 0.75, 0.825) ]; + output mat3x4 out0 = [ mat3x4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0) | mat3x4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat3x4(-32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat3x4(-0.5, -2.25, -4.875, 9.0, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat3x4(0.0, 0.5, 0.75, 0.825, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_to_mat3x4 + version 300 es + values + { + input ivec4 in0 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ]; + input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + input ivec4 in2 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + output mat3x4 out0 = [ mat3x4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat3x4 + version 300 es + values + { + input vec2 in0 = [ vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-0.5, -2.25) ]; + input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, -2) ]; + input float in2 = [ 1.0 | -8.25 | 2.0 | 3.5 | -20.125 | 36.8125 | 0.0 | 1.0 | -0.5 | 0.0 ]; + input float in3 = [ -0.5 | 36.8125 | 1.0 | 1.0 | 0.0 | 3.5 | 2.0 | 0.0 | -8.25 | -20.125 ]; + input float in4 = [ -8.25 | 1.0 | 1.0 | 0.0 | 2.0 | 36.8125 | 0.0 | -20.125 | 3.5 | -0.5 ]; + input int in5 = [ 11 | 2 | 8 | 5 | 0 | -192 | 1 | -12 | 255 | -66 ]; + input int in6 = [ -12 | 5 | 8 | 1 | 0 | 255 | 11 | -192 | -66 | 2 ]; + input bool in7 = [ true | true | true | false | false | false | true | false | true | false ]; + input bool in8 = [ true | true | true | false | true | false | true | false | false | false ]; + input bool in9 = [ true | false | true | false | true | true | false | false | false | true ]; + output mat3x4 out0 = [ mat3x4(1.0, 1.25, 0.0, 0.0, 1.0, -0.5, -8.25, 11.0, -12.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, 1.0, 2.0, 5.0, 1.0, 1.0, 0.0) | mat3x4(0.0, 0.5, -32.0, 64.0, 2.0, 1.0, 1.0, 8.0, 8.0, 1.0, 1.0, 1.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, 3.5, 1.0, 0.0, 5.0, 1.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, -20.125, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3x4(-0.75, -0.0322580645161, -32.0, 64.0, 36.8125, 3.5, 36.8125, -192.0, 255.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 0.0, 1.0, 11.0, 1.0, 1.0, 0.0) | mat3x4(-0.75, -0.0322580645161, 0.0, -2.0, 1.0, 0.0, -20.125, -12.0, -192.0, 0.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, 0.0, -0.5, -8.25, 3.5, 255.0, -66.0, 1.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, -2.0, 0.0, -20.125, -0.5, -66.0, 2.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec3_bool_bvec3_float_bool_to_mat3x4 + version 300 es + values + { + input bool in0 = [ false | false | true | true | true | true | false | false | false | true ]; + input float in1 = [ 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -20.125 ]; + input int in2 = [ -66 | -192 | 255 | 8 | 0 | -12 | 5 | 2 | 11 | 1 ]; + input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | 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) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) ]; + input bool in4 = [ false | true | true | true | false | false | true | true | false | false ]; + input bvec3 in5 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in6 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 2.0 | -20.125 | 1.0 | 0.0 | 3.5 ]; + input bool in7 = [ true | false | false | true | true | false | true | false | false | true ]; + output mat3x4 out0 = [ mat3x4(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 1.0, 0.0, 0.0, -8.25, 1.0) | mat3x4(0.0, -8.25, -192.0, -32.0, 64.0, -51.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(1.0, 1.0, 255.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, -0.5, 0.0) | mat3x4(1.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 36.8125, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.0, -12.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 0.0) | mat3x4(0.0, 2.0, 5.0, 1.0, 1.25, 1.125, 1.0, 1.0, 1.0, 1.0, -20.125, 1.0) | mat3x4(0.0, 3.5, 2.0, 1.0, 1.25, 1.125, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, -0.5, 11.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, -20.125, 1.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 3.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7); + ${OUTPUT} + } + "" + end + + case bool_bvec4_int_vec4_bool_float_to_mat3x4 + version 300 es + values + { + input bool in0 = [ false | true | true | true | false | false | false | true | false | true ]; + input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ]; + input int in2 = [ 255 | 2 | -192 | -12 | 11 | 1 | 0 | -66 | 8 | 5 ]; + input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | 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(-0.5, -2.25, -4.875, 9.0) ]; + input bool in4 = [ true | true | true | false | false | false | true | true | false | false ]; + input float in5 = [ 36.8125 | 2.0 | -8.25 | 0.0 | 1.0 | 1.0 | -0.5 | 3.5 | 0.0 | -20.125 ]; + output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 255.0, -0.5, -2.25, -4.875, 9.0, 1.0, 36.8125) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 1.0, 2.0) | mat3x4(1.0, 0.0, 1.0, 0.0, 0.0, -192.0, 1.0, 1.25, 1.125, 1.75, 1.0, -8.25) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 11.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 1.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, -0.5) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 1.0, 3.5) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 5.0, -0.5, -2.25, -4.875, 9.0, 0.0, -20.125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec4_bool_bool_int_to_mat3x4 + version 300 es + values + { + input float in0 = [ 36.8125 | 1.0 | 0.0 | 3.5 | -8.25 | -20.125 | 2.0 | 0.0 | 1.0 | -0.5 ]; + input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ]; + input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ]; + input bool in3 = [ true | false | true | true | false | true | true | false | false | false ]; + input bool in4 = [ true | false | false | true | true | false | false | false | true | true ]; + input int in5 = [ 1 | 5 | -12 | 8 | -192 | 2 | -66 | 255 | 11 | 0 ]; + output mat3x4 out0 = [ mat3x4(36.8125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 5.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0, -12.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 8.0) | mat3x4(-8.25, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, -192.0) | mat3x4(-20.125, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0) | mat3x4(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -66.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 255.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 11.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat3x4(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec3_vec3_vec2_to_mat4x2 + version 300 es + values + { + input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ]; + input vec2 in2 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) ]; + output mat4x2 out0 = [ mat4x2(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 1.0, 1.25) | mat4x2(-32.0, 64.0, -51.0, -0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25) | mat4x2(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, -0.75, -0.0322580645161) | mat4x2(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -32.0, 64.0) | mat4x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125, 0.0, 0.5) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec3_ivec3_ivec2_to_mat4x2 + version 300 es + values + { + input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ]; + input ivec3 in1 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ]; + input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) ]; + output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, -2.0, -4.0, -32.0, 64.0) | mat4x2(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, -2.0, -4.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, 0.0, -2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_int_bool_to_mat4x2 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ]; + input float in2 = [ 3.5 | -8.25 | 2.0 | 36.8125 | -0.5 | 1.0 | 1.0 | 0.0 | -20.125 | 0.0 ]; + input float in3 = [ 0.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | 2.0 | 0.0 | -20.125 | 1.0 ]; + input int in4 = [ -12 | -66 | 11 | 5 | 8 | 255 | -192 | 2 | 1 | 0 ]; + input bool in5 = [ true | true | false | true | false | true | false | true | false | false ]; + output mat4x2 out0 = [ mat4x2(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, -12.0, 1.0) | mat4x2(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, -66.0, 1.0) | mat4x2(1.0, 1.25, -32.0, 64.0, 2.0, 3.5, 11.0, 0.0) | mat4x2(0.0, 0.5, 1.0, 1.0, 36.8125, 1.0, 5.0, 1.0) | mat4x2(-32.0, 64.0, 1.0, 1.0, -0.5, -0.5, 8.0, 0.0) | mat4x2(-0.75, -0.0322580645161, 0.0, 0.0, 1.0, -8.25, 255.0, 1.0) | mat4x2(-0.75, -0.0322580645161, -32.0, 64.0, 1.0, 2.0, -192.0, 0.0) | mat4x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0, 2.0, 1.0) | mat4x2(-0.5, -2.25, 0.0, 0.0, -20.125, -20.125, 1.0, 0.0) | mat4x2(1.0, 1.25, 0.0, -2.0, 0.0, 1.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec2_bool_bvec2_to_mat4x2 + version 300 es + values + { + input bool in0 = [ false | false | true | true | true | false | false | true | false | true ]; + input float in1 = [ 36.8125 | -8.25 | 3.5 | 1.0 | 2.0 | -0.5 | 0.0 | 1.0 | -20.125 | 0.0 ]; + input int in2 = [ -66 | 1 | -192 | 2 | 11 | 0 | 255 | 8 | 5 | -12 ]; + input vec2 in3 = [ vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ]; + input bool in4 = [ true | false | false | false | false | true | true | true | false | true ]; + input bvec2 in5 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) ]; + output mat4x2 out0 = [ mat4x2(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0) | mat4x2(0.0, -8.25, 1.0, -0.75, -0.0322580645161, 0.0, 0.0, 1.0) | mat4x2(1.0, 3.5, -192.0, -32.0, 64.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 2.0, 0.0, 0.5, 0.0, 1.0, 1.0) | mat4x2(1.0, 2.0, 11.0, 1.0, 1.25, 0.0, 1.0, 0.0) | mat4x2(0.0, -0.5, 0.0, 1.0, 1.25, 1.0, 0.0, 1.0) | mat4x2(0.0, 0.0, 255.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 8.0, -32.0, 64.0, 1.0, 1.0, 1.0) | mat4x2(0.0, -20.125, 5.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case bool_bvec2_int_vec4_to_mat4x2 + version 300 es + values + { + input bool in0 = [ false | false | true | false | true | false | true | true | true | false ]; + input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ]; + input int in2 = [ -12 | 8 | 2 | 255 | 5 | -192 | 0 | 11 | 1 | -66 ]; + input vec4 in3 = [ 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.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | 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.0, 0.5, 0.75, 0.825) ]; + output mat4x2 out0 = [ mat4x2(0.0, 1.0, 0.0, -12.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(0.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 1.0, 0.0, 5.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825) | mat4x2(1.0, 0.0, 1.0, 11.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 1.0, 1.0, -66.0, 0.0, 0.5, 0.75, 0.825) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec2_bool_to_mat4x2 + version 300 es + values + { + input float in0 = [ 1.0 | -8.25 | -20.125 | 3.5 | -0.5 | 2.0 | 36.8125 | 0.0 ]; + input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ]; + input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ]; + input bool in3 = [ true | true | false | true | true | false | false | false ]; + output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 0.0, 1.0, -32.0, 64.0, 1.0) | mat4x2(-8.25, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat4x2(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4x2(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x2(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 0.0) | mat4x2(36.8125, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x2(in0, in1, in2, in3); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_to_mat4x3 + version 300 es + values + { + input vec4 in0 = [ 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) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) ]; + input vec4 in1 = [ vec4(0.0, 0.5, 0.75, 0.825) | 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) ]; + input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | 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.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + output mat4x3 out0 = [ mat4x3(-0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4x3(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4x3(0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4x3(-0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4x3(-32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case ivec4_ivec4_ivec4_to_mat4x3 + version 300 es + values + { + input ivec4 in0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + input ivec4 in1 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) ]; + input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ]; + output mat4x3 out0 = [ mat4x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) | mat4x3(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0) | mat4x3(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2); + ${OUTPUT} + } + "" + end + + case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat4x3 + version 300 es + values + { + input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ]; + input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ]; + input float in2 = [ -20.125 | 3.5 | 2.0 | -0.5 | -8.25 | 0.0 | 1.0 | 0.0 | 1.0 | 36.8125 ]; + input float in3 = [ 0.0 | -8.25 | 36.8125 | 1.0 | 0.0 | -20.125 | 3.5 | 2.0 | -0.5 | 1.0 ]; + input float in4 = [ 0.0 | 1.0 | 3.5 | -20.125 | 0.0 | 36.8125 | 1.0 | -8.25 | 2.0 | -0.5 ]; + input int in5 = [ 2 | 8 | 1 | -192 | 0 | -12 | 11 | 255 | 5 | -66 ]; + input int in6 = [ 2 | -12 | 5 | 8 | 11 | 255 | 0 | -66 | 1 | -192 ]; + input bool in7 = [ true | true | false | true | false | false | false | true | false | true ]; + input bool in8 = [ true | false | false | true | true | false | true | true | false | false ]; + input bool in9 = [ false | true | false | false | false | false | true | true | true | true ]; + output mat4x3 out0 = [ mat4x3(-0.5, -2.25, 0.0, -2.0, -20.125, 0.0, 0.0, 2.0, 2.0, 1.0, 1.0, 0.0) | mat4x3(0.0, 0.5, -32.0, 64.0, 3.5, -8.25, 1.0, 8.0, -12.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 0.5, 1.0, 1.0, 2.0, 36.8125, 3.5, 1.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 1.25, -32.0, 64.0, -0.5, 1.0, -20.125, -192.0, 8.0, 1.0, 1.0, 0.0) | mat4x3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 11.0, 0.0, 1.0, 0.0) | mat4x3(-0.5, -2.25, 0.0, 0.0, 0.0, -20.125, 36.8125, -12.0, 255.0, 0.0, 0.0, 0.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, 3.5, 1.0, 11.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 1.25, 0.0, -2.0, 0.0, 2.0, -8.25, 255.0, -66.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, -0.5, 2.0, 5.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(-0.75, -0.0322580645161, 1.0, 1.0, 36.8125, 1.0, -0.5, -66.0, -192.0, 1.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9); + ${OUTPUT} + } + "" + end + + case bool_float_int_vec3_bool_bvec3_float_bool_to_mat4x3 + version 300 es + values + { + input bool in0 = [ true | true | false | false | true | true | true | false | false | false ]; + input float in1 = [ -8.25 | 2.0 | 1.0 | -0.5 | 0.0 | 0.0 | 36.8125 | -20.125 | 3.5 | 1.0 ]; + input int in2 = [ 255 | 2 | 11 | 1 | 8 | -192 | 0 | -66 | -12 | 5 ]; + input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | 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) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ]; + input bool in4 = [ true | true | false | false | true | false | false | false | true | true ]; + input bvec3 in5 = [ bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(true, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) ]; + input float in6 = [ 1.0 | 0.0 | -0.5 | 36.8125 | 1.0 | -20.125 | 2.0 | 0.0 | -8.25 | 3.5 ]; + input bool in7 = [ true | true | false | false | false | false | true | true | false | true ]; + output mat4x3 out0 = [ mat4x3(1.0, -8.25, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 2.0, 2.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(0.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat4x3(0.0, -0.5, 1.0, -32.0, 64.0, -51.0, 0.0, 0.0, 1.0, 0.0, 36.8125, 0.0) | mat4x3(1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat4x3(1.0, 0.0, -192.0, 1.0, 1.25, 1.125, 0.0, 1.0, 0.0, 0.0, -20.125, 0.0) | mat4x3(1.0, 36.8125, 0.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0) | mat4x3(0.0, -20.125, -66.0, 1.0, 1.25, 1.125, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 3.5, -12.0, -0.5, -2.25, -4.875, 1.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat4x3(0.0, 1.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 3.5, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7); + ${OUTPUT} + } + "" + end + + case bool_bvec4_int_vec4_bool_float_to_mat4x3 + version 300 es + values + { + input bool in0 = [ true | true | true | false | true | false | false | true | false | false ]; + input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, false, false, true) ]; + input int in2 = [ 5 | 11 | 0 | -192 | -66 | 255 | 1 | -12 | 8 | 2 ]; + input vec4 in3 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | 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) | vec4(0.0, 0.5, 0.75, 0.825) ]; + input bool in4 = [ false | true | true | false | true | false | true | true | false | false ]; + input float in5 = [ -20.125 | 0.0 | 1.0 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ]; + output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, -20.125) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 11.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 0.0, -0.5) | mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, -66.0, 1.0, 1.25, 1.125, 1.75, 1.0, 3.5) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0, -8.25) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.5, 0.75, 0.825, 0.0, 2.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.5, 0.75, 0.825, 0.0, 36.8125) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case float_bvec4_ivec4_bool_bool_int_to_mat4x3 + version 300 es + values + { + input float in0 = [ 36.8125 | -0.5 | 3.5 | 2.0 | 1.0 | -20.125 | 0.0 | 0.0 | -8.25 | 1.0 ]; + input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ]; + input ivec4 in2 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, -2, -4, 9) ]; + input bool in3 = [ false | true | false | true | false | false | false | true | true | true ]; + input bool in4 = [ false | true | false | true | false | true | false | false | true | true ]; + input int in5 = [ 2 | 1 | 8 | 11 | 255 | 5 | 0 | -66 | -192 | -12 ]; + output mat4x3 out0 = [ mat4x3(36.8125, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 2.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x3(3.5, 1.0, 0.0, 0.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 8.0) | mat4x3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 11.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 255.0) | mat4x3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 5.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, -66.0) | mat4x3(-8.25, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -192.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -12.0) ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = mat4x3(in0, in1, in2, in3, in4, in5); + ${OUTPUT} + } + "" + end + + case vec4_vec4_vec4_vec4_to_mat4 + version 300 es + values + { + input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | 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(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | 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 in2 = [ 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 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) ]; + output mat4 out0 = [ mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0) | mat4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(-0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input ivec4 in0 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ]; + input ivec4 in1 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ]; + input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ]; + input ivec4 in3 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ]; + output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.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, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.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, -32.0, 64.0, -51.0, 24.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bvec4 in0 = [ bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) ]; + input bvec4 in1 = [ bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ]; + input bvec4 in2 = [ bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) ]; + input bvec4 in3 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ]; + output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0) ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 2.0 | 1.0 | 3.5 | 0.0 | -20.125 | 36.8125 | -0.5 | -8.25 ]; + input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ]; + input bvec3 in2 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) ]; + input vec4 in3 = [ 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) | vec4(-0.5, -2.25, -4.875, 9.0) | 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) ]; + input ivec2 in4 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) ]; + input float in5 = [ 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 | -20.125 | 1.0 | -0.5 ]; + input vec2 in6 = [ vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(1.0, 1.25) ]; + output mat4 out0 = [ mat4(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, 2.0, 0.0, 0.5) | mat4(1.0, -32.0, 64.0, -51.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 3.5, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, 36.8125, -32.0, 64.0) | mat4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, -8.25, 0.0, 0.5) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 0.0, -0.75, -0.0322580645161) | mat4(36.8125, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -20.125, -0.5, -2.25) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 1.0, 1.0, 1.25) | mat4(-8.25, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, -0.5, 1.0, 1.25) ]; + } + + both "" + #version 300 es + 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/gles3/shaders/declarations.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html new file mode 100644 index 000000000..025d5933e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/declarations.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test new file mode 100644 index 000000000..86f98d983 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test @@ -0,0 +1,591 @@ +group invalid_declarations "Invalid declarations" + case in_in_vertex_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + in mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case out_in_vertex_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + out mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + in mediump float val; + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case in_in_fragment_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + out mediump float val; + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + in mediump float val; + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case out_in_fragment_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + out mediump float val; + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_in_vertex_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + uniform mediump float val; + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_in_fragment_main + version 300 es + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + uniform mediump float val; + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_block_in_main + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + void main() + { + uniform Block { mediump float val; }; + ${OUTPUT} + } + "" + end + + case invariant_attribute + version 300 es + expect compile_fail + vertex "" + #version 300 es + invariant in mediump float val; + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invariant_uniform + version 300 es + expect compile_fail + vertex "" + #version 300 es + invariant uniform mediump float val; + ${VERTEX_DECLARATIONS} + void main() + { + gl_Position = vec4(1.0); + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invariant_uniform_block_1 + version 300 es + expect compile_fail + both "" + #version 300 es + invariant uniform Block { mediump float val; }; + ${DECLARATIONS} + void main() + { + ${OUTPUT} + } + "" + end + + case invariant_uniform_block_2 + version 300 es + expect compile_fail + both "" + #version 300 es + uniform Block { invariant mediump float val; }; + ${DECLARATIONS} + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_layout_qualifier + version 300 es + expect compile_fail + both "" + #version 300 es + layout(foobar) uniform Block + { + mediump float val; + }; + ${DECLARATIONS} + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_member_layout_qualifier + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + layout(foobar) uniform mediump float val; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_nested_struct_definition + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + struct S + { + mediump float v; + struct T + { + highp int i; + } t; + } s; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case nested_uniform_block + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + uniform Block2 + { + mediump float v; + } block2; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_sampler_2d + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + uniform sampler2D s; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_sampler_cube + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + uniform samplerCube s; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_missing_member_semicolon + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_missing_end_semicolon + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + } + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_member_name_1 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_member_name_2 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + }; + uniform Block2 + { + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_member_name_3 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform mediump float var; + uniform Block + { + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_block_name + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + }; + uniform Block + { + mediump float var2; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_instance_name_1 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + } block; + uniform Block2 + { + mediump float var2; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_instance_name_2 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform mediump float block; + uniform Block + { + mediump float var; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_duplicate_instance_name_3 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float block; + }; + uniform Block2 + { + mediump float var2; + } block; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_array_without_instance_name_1 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block[2] + { + mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_array_without_instance_name_2 + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + mediump float var; + } [2]; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_in + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + in mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_out + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + out mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + + case uniform_block_const + version 300 es + expect compile_fail + both "" + #version 300 es + ${DECLARATIONS} + uniform Block + { + const mediump float var; + }; + void main() + { + ${OUTPUT} + } + "" + end + +end # invalid_declarations diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html new file mode 100644 index 000000000..3e531413a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/fragdata.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test new file mode 100644 index 000000000..f7ba4f295 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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/gles3/shaders/functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html new file mode 100644 index 000000000..65ff88fbb --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test new file mode 100644 index 000000000..767a03599 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test @@ -0,0 +1,4345 @@ +# 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + return -a; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec2 + version 300 es + values + { + input vec2 in0 = [ vec2(0.0, 1.0) | vec2(2.0, 2.5) ]; + output float out0 = [ -1.0 | -4.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (vec2 a) + { + return -(a.x + a.y); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_vec3 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values + { + input mat2 in0 = [ mat2(0.0, 1.0, -2.0, 0.5) | mat2(2.0, 2.5, 4.0, -7.0) ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (mat2 a) + { + return -(a[0][0] + a[0][1] + a[1][0] + a[1][1]); + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_mat3 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ -1 | 0 | 1 | 4 ]; + output int out0 = [ 1 | 0 | -1 | -4 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + int func (int a) + { + return -a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case int_ivec2 + version 300 es + values + { + input ivec2 in0 = [ ivec2(-1, 0) | ivec2(1, 4) ]; + output int out0 = [ 1 | -5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input ivec3 in0 = [ ivec3(-1, 0, 2) | ivec3(1, 4, -8) ]; + output int out0 = [ -1 | 3 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + #version 300 es + 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 uint_uint + version 300 es + values + { + input uint in0 = [ 1 | 0 | 2 | 4 ]; + output uint out0 = [ 1 | 0 | 4 | 16 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uint a) + { + return a*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uvec2 + version 300 es + values + { + input uvec2 in0 = [ uvec2(1, 0) | uvec2(2, 4) ]; + output uint out0 = [ 1 | 6 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uvec2 a) + { + return (a.x + a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uvec3 + version 300 es + values + { + input uvec3 in0 = [ uvec3(1, 0, 2) | uvec3(1, 4, 8) ]; + output uint out0 = [ 3 | 13 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uvec3 a) + { + return (a.x + a.y + a.z); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case uint_uvec4 + version 300 es + values + { + input uvec4 in0 = [ uvec4(1, 0, 2, 2) | uvec4(1, 4, 8, 2) ]; + output uint out0 = [ 5 | 15 ]; + } + + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + uint func (uvec4 a) + { + return (a.x + a.y + a.z + a.w); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bool a) + { + return !a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec2 + version 300 es + values + { + input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (bvec2 a) + { + return !(a.x == a.y); + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case bool_bvec3 + version 300 es + values + { + input bvec3 in0 = [ bvec3(true, true, false) | bvec3(true, false, false) ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat2 func (mat2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat2x3 + version 300 es + values + { + input mat2x3 in0 = [ mat2x3(2.5, 0.0, 1.0, -2.5, 1.0, 3.0) | mat2x3(0.0, 2.0, 1.5, -3.5, 2.0, 0.5) | mat2x3(-1.5, -3.5, 2.5, 0.0, 1.5, 3.0) ]; + output mat2x3 out0 = [ mat2x3(-5.0, -0.0, -2.0, 5.0, -2.0, -6.0) | mat2x3(-0.0, -4.0, -3.0, 7.0, -4.0, -1.0) | mat2x3(3.0, 7.0, -5.0, -0.0, -3.0, -6.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat2x3 func (mat2x3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat2x4 + version 300 es + values + { + input mat2x4 in0 = [ mat2x4(1.5, 3.0, -1.0, 2.5, -0.5, 3.5, 3.0, -3.0) | mat2x4(-2.5, -2.0, 3.5, -0.5, 1.0, -1.5, 0.0, -1.0) | mat2x4(-1.0, 0.5, 0.5, 3.0, 1.5, 3.0, 2.5, 3.5) ]; + output mat2x4 out0 = [ mat2x4(-3.0, -6.0, 2.0, -5.0, 1.0, -7.0, -6.0, 6.0) | mat2x4(5.0, 4.0, -7.0, 1.0, -2.0, 3.0, -0.0, 2.0) | mat2x4(2.0, -1.0, -1.0, -6.0, -3.0, -6.0, -5.0, -7.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat2x4 func (mat2x4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3x2 + version 300 es + values + { + input mat3x2 in0 = [ mat3x2(1.5, -2.5, 2.5, 3.5, 3.0, 0.5) | mat3x2(1.5, -2.0, 2.5, 0.5, -1.5, -3.5) | mat3x2(2.5, 3.5, -3.0, 2.5, -0.5, -2.5) ]; + output mat3x2 out0 = [ mat3x2(-3.0, 5.0, -5.0, -7.0, -6.0, -1.0) | mat3x2(-3.0, 4.0, -5.0, -1.0, 3.0, 7.0) | mat3x2(-5.0, -7.0, 6.0, -5.0, 1.0, 5.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3x2 func (mat3x2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3 + version 300 es + values + { + input mat3 in0 = [ mat3(-1.5, 2.0, 3.0, -3.5, 1.0, -3.5, 1.5, -1.5, 3.0) | mat3(3.5, 0.0, 3.5, -1.5, -3.0, 0.5, -3.5, -2.5, -0.5) | mat3(1.0, -2.5, -3.5, 3.0, -1.5, 3.5, 3.0, -1.0, -0.5) ]; + output mat3 out0 = [ mat3(3.0, -4.0, -6.0, 7.0, -2.0, 7.0, -3.0, 3.0, -6.0) | mat3(-7.0, -0.0, -7.0, 3.0, 6.0, -1.0, 7.0, 5.0, 1.0) | mat3(-2.0, 5.0, 7.0, -6.0, 3.0, -7.0, -6.0, 2.0, 1.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3 func (mat3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat3x4 + version 300 es + values + { + input mat3x4 in0 = [ mat3x4(0.0, 1.0, 0.5, 0.5, 1.0, 3.5, 0.0, -0.5, 1.5, -2.0, -1.5, 3.5) | mat3x4(0.0, 0.5, -3.5, -0.5, 0.5, -3.5, 1.0, 1.0, -3.5, 1.0, -0.5, 1.5) | mat3x4(-1.0, 1.5, 2.0, -3.5, -3.5, 1.5, 3.5, -2.0, -0.5, 0.5, -1.5, -1.0) ]; + output mat3x4 out0 = [ mat3x4(-0.0, -2.0, -1.0, -1.0, -2.0, -7.0, -0.0, 1.0, -3.0, 4.0, 3.0, -7.0) | mat3x4(-0.0, -1.0, 7.0, 1.0, -1.0, 7.0, -2.0, -2.0, 7.0, -2.0, 1.0, -3.0) | mat3x4(2.0, -3.0, -4.0, 7.0, 7.0, -3.0, -7.0, 4.0, 1.0, -1.0, 3.0, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat3x4 func (mat3x4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4x2 + version 300 es + values + { + input mat4x2 in0 = [ mat4x2(-1.5, -1.0, 0.5, -1.5, -1.0, 2.0, -3.5, 0.5) | mat4x2(2.0, -1.5, -2.0, 2.5, -2.0, -2.5, -0.5, 1.5) | mat4x2(-3.0, -1.5, -1.0, 2.5, -0.5, 2.5, -2.5, -1.0) ]; + output mat4x2 out0 = [ mat4x2(3.0, 2.0, -1.0, 3.0, 2.0, -4.0, 7.0, -1.0) | mat4x2(-4.0, 3.0, 4.0, -5.0, 4.0, 5.0, 1.0, -3.0) | mat4x2(6.0, 3.0, 2.0, -5.0, 1.0, -5.0, 5.0, 2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat4x2 func (mat4x2 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4x3 + version 300 es + values + { + input mat4x3 in0 = [ mat4x3(1.0, 3.0, -0.5, -2.0, -3.0, 0.0, -2.5, 2.5, 2.5, -2.5, -1.5, 2.5) | mat4x3(1.0, 2.5, -1.0, -3.0, -1.5, 2.0, -1.5, -1.0, -0.5, -0.5, -0.5, 3.0) | mat4x3(-2.5, -3.5, 3.5, 3.0, 3.5, -0.5, 3.5, 3.0, -2.0, 2.0, 2.5, 1.0) ]; + output mat4x3 out0 = [ mat4x3(-2.0, -6.0, 1.0, 4.0, 6.0, -0.0, 5.0, -5.0, -5.0, 5.0, 3.0, -5.0) | mat4x3(-2.0, -5.0, 2.0, 6.0, 3.0, -4.0, 3.0, 2.0, 1.0, 1.0, 1.0, -6.0) | mat4x3(5.0, 7.0, -7.0, -6.0, -7.0, 1.0, -7.0, -6.0, 4.0, -4.0, -5.0, -2.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat4x3 func (mat4x3 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + + case mat4 + version 300 es + values + { + input mat4 in0 = [ mat4(0.0, -1.5, -1.0, -2.0, -3.0, 0.5, -1.5, 2.5, -3.5, 3.0, 1.5, 3.0, 3.0, 3.0, 0.5, -3.5) | mat4(2.0, -2.5, -1.5, 1.0, 0.0, -0.5, 3.5, 1.0, -1.0, -2.0, 2.5, 0.0, 2.0, -1.0, -2.5, 0.5) | mat4(2.5, -2.5, 2.0, 3.0, 2.5, 2.5, -3.5, 1.0, 2.5, -3.5, -1.5, -1.5, 0.0, -0.5, 0.0, 2.0) ]; + output mat4 out0 = [ mat4(-0.0, 3.0, 2.0, 4.0, 6.0, -1.0, 3.0, -5.0, 7.0, -6.0, -3.0, -6.0, -6.0, -6.0, -1.0, 7.0) | mat4(-4.0, 5.0, 3.0, -2.0, -0.0, 1.0, -7.0, -2.0, 2.0, 4.0, -5.0, -0.0, -4.0, 2.0, 5.0, -1.0) | mat4(-5.0, 5.0, -4.0, -6.0, -5.0, -5.0, 7.0, -2.0, -5.0, 7.0, 3.0, 3.0, -0.0, 1.0, -0.0, -4.0) ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + mat4 func (mat4 a) + { + return -2.0*a; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case float_struct + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 4 ]; + output int out0 = [ 0 | -1 | 2 | -4 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | true ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (inout bool a) + { + a = !a; + } + + void main() + { + ${SETUP} + bool f = true; + func(f); + out0 = (in0 == f); + ${OUTPUT} + } + "" + end + + case const_bool + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ true | true ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + bool func (const bool a) + { + bool b = !a; + return b; + } + + void main() + { + ${SETUP} + bool f = in0; + bool g = func(f); + out0 = (f != g); + ${OUTPUT} + } + "" + end + +end # qualifiers + +group declarations "Function Declarations" + + case basic + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void); + + float func (void) + { + return -1.0; + } + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + "" + end + + case basic_arg + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f); + + float func (float f) + { + return -f; + } + + void main() + { + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case define_after_use + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + + float func (void) + { + return -1.0; + } + "" + end + + case double_declare + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void); + + float func (void); + + float func (void) + { + return -1.0; + } + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + "" + end + + case declare_after_define + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (void) + { + return -1.0; + } + + float func (void); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + "" + end + + case void_vs_no_void + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (); + + void main() + { + out0 = func() * in0; + ${OUTPUT} + } + + float func (void) + { + return -1.0; + } + "" + end + + case in_vs_no_in + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | -2 | 6 ]; + output int out0 = [ 0 | -1 | 2 | -6 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input bool in0 = [ true | false ]; + output bool out0 = [ false | true ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ]; + output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ]; + } + + both "" + #version 300 es + 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 array_size + version 300 es + values + { + output float out0 = [ 1.0 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f[3]) + { + return f[0]; + } + + float func (float f[4]) + { + return f[1]; + } + + void main () + { + ${SETUP} + float[4] x = float[4] (-1.0, 1.0, 0.0, 0.0); + out0 = func(x); + ${OUTPUT} + } + "" + end + +end # overloading + +group array_arguments "Arrays as Arguments" + + case local_in_float + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + while (a < 100.0) + return -a; + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_in_loop_if + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + while (a < 100.0) + { + a = -a; + if (a != 0.0) + return a; + else + return -1.0; + } + return 1.0; + } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + + case return_after_loop + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + int i; + for (i = 0; i < 6; i++) // negate a + { + a = -a; + if (i == 4) + a = -a; + } + + for (; 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 + version 300 es + values + { + input float in0 = [ -0.5 | 1.5 ]; + output float out0 = [ 0.5 | -1.5 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float a) + { + int i; + for (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 + version 300 es + 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 "" + #version 300 es + 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 + version 300 es + values + { + input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ]; + output int out0 = [ -3 | 1 ]; + } + + both "" + #version 300 es + 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 + version 300 es + values + { + input int in0 = [ 0 | 1 | 3 | 5 ]; + output int out0 = [ -1 | 5 | 11 | 17 ]; + } + + both "" + #version 300 es + precision highp 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 + version 300 es + values + { + input int in0 = [ 0 | -1 | 3 | 5 ]; + output int out0 = [ 3 | -1 | 9 | 13 ]; + } + + both "" + #version 300 es + precision highp 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 + +end # misc + +group invalid "Invalid Functions" + case break_in_body + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func () + { + break; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case continue_in_body + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func () + { + continue; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case return_value_from_void_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func () + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case extra_arguments + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (float f) + { + } + + void main () + { + func(1.0, 2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_arguments + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (float f) + { + } + + void main () + { + func(); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_argument_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (in f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_basetype_mismatch + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + precision mediump int; + ${DECLARATIONS} + + void func (float f) + { + } + + void main () + { + func(2); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_scalar_vector_mismatch + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec2 f) + { + } + + void main () + { + func(2.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case argument_vector_size_mismatch + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + } + + void main () + { + func(vec2(2.0)); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case duplicate_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f[]); + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_mismatch_argument_array_size + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f); + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case prototype_mismatch_argument_array_const + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (out vec3 f); + void func (inout vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + func (float f); + func (inout vec3 f[3]) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case call_before_definition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + func(1.0); + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + void func (float f) + { + } + + "" + end + + case argument_precision_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (float f) + { + return; + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_prototype + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float func (float f); + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case local_function_definition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float func (float f) + { + return 1.0; + } + + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case name_type_conflict + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct foo { float a; } + + float foo (float f) + { + return 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case const_overload + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + } + + void func (const vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + uniform float u; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case in_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + in float v; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case out_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + in float a; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case inout_local + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (vec3 f) + { + inout float a; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_argument + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void func (uniform vec3 f) + { + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case uniform_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + uniform float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case in_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + in float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0))); + } + "" + end + + case out_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + out float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0))); + } + "" + end + + case inout_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + inout float func (vec3 f) + { + return f.x; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0))); + } + "" + end + + case main_invalid_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_has_arguments + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main (float f) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case main_missing_return_type + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const float f) + { + f = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case write_const_array_arg + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const float f[3]) + { + f[0] = 1.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case use_const_arg_in_const_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const int i) + { + const int z = i+1; + return float(z); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(1)); + } + "" + end + + case use_const_arg_as_array_size + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float func (const int i) + { + float f[i]; + f[0] = 1.0; + return f[0]; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(func(1)); + } + "" + end + + case overload_builtin_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int sin (int x) + { + return int(sin(float(x))); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(sin(1)); + } + "" + end + + case redefine_builtin_function + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float sin (float x) + { + return 0.0; + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case basic_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float fib (float x) + { + if (x <= 1.0) + return x; + else + return fib(x-2.0) + fib(x-1.0); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(fib(5.0)); + } + "" + end + + case simple_tail_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float rec (float x) + { + if (x <= 0.0) + return 0.0; + else + return rec(x-1.0); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(rec(5.0)); + } + "" + end + + case dynamic_conditional_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float ua; + uniform float ub; + + float funcA (float x); + float funcB (float x); + + float funcA (float x) + { + if (ub+x > 0.0) + funcB(x*2.0); + else + return ub; + } + + float funcB (float x) + { + return sqrt(funcA(x)); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(funcB(ua)); + } + "" + end + + case dynamic_loop_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float ua; + uniform float ub; + + float funcA (float x); + float funcB (float x); + + float funcA (float x) + { + for (float z = 0.0; z < ub+x; z++) + { + if (z > 2.0) + funcB(z*2.0); + else + return z; + } + } + + float funcB (float x) + { + return sqrt(funcA(x)); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(funcB(ua)); + } + "" + end + + case dynamic_switch_recursion + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform float ua; + uniform mediump int ub; + + float funcA (float x); + float funcB (float x); + + float funcA (float x) + { + switch (ub + int(x)) + { + case 0: return ua-1.0; + case 1: return ua; + case 2: return funcB(x*2.0); + default: return 0.0; + } + } + + float funcB (float x) + { + return sqrt(funcA(x)); + } + + void main () + { + ${POSITION_FRAG_COLOR} = vec4(funcB(ua)); + } + "" + end + + case modify_const_arg + version 300 es + expect compile_fail + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + 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 + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html new file mode 100644 index 000000000..98c13381d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/invalid_texture_functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test new file mode 100644 index 000000000..10d65b22e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test @@ -0,0 +1,1143 @@ +# WARNING: This file is auto-generated. Do NOT modify it manually, but rather +# modify the generating script file. Otherwise changes will be lost! + +case texture_sampler3dshadow_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler3DShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texture(s, vec4(0))); + ${OUTPUT} + } + "" +end +case texture_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texture(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_samplercube_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_isamplercube_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_usamplercube_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_samplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_isamplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_usamplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureproj_sampler2darrayshadow_vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0))); + ${OUTPUT} + } + "" +end +case textureproj_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case texturelod_samplercubeshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case texturelod_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_isamplercube_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_usamplercube_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_isamplercube_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_usamplercube_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec2_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercube_vec3_ivec3_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darray_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darray_vec3_ivec3_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0), float(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercubeshadow_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_samplercubeshadow_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darrayshadow_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureoffset_sampler2darrayshadow_vec4_ivec2_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0), float(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercube_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_isamplercube_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump isamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_usamplercube_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump usamplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2dshadow_ivec2_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec2(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercubeshadow_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2darrayshadow_ivec3_int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercube_ivec3_int_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2dshadow_ivec2_int_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec2(0), int(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texelfetch_samplercubeshadow_ivec3_int_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texelfetch_sampler2darrayshadow_ivec3_int_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_samplercube_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_samplercube_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_samplercubeshadow_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_sampler2darrayshadow_vec4_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojoffset_sampler2darrayshadow_vec4_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_samplercube_vec3_float_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_samplercube_vec3_float_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_samplercubeshadow_vec3_float_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_sampler2darrayshadow_vec3_float_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturelodoffset_sampler2darrayshadow_vec3_float_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojlod_samplercube_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureprojlod_sampler2darray_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case textureprojlod_sampler2darrayshadow_vec4_float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArrayShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0))); + ${OUTPUT} + } + "" +end +case texturegrad_sampler2darray_vec3_vec3_vec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGrad(s, vec3(0), vec3(0), vec3(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercube_vec3_vec3_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec3(0), vec3(0), vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercube_vec3_vec3_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec3(0), vec3(0), vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercubeshadow_vec4_vec3_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec4(0), vec3(0), vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case texturegradoffset_samplercubeshadow_vec4_vec3_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCubeShadow s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec4(0), vec3(0), vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojgrad_samplercube_vec4_vec3_vec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGrad(s, vec4(0), vec3(0), vec3(0))); + ${OUTPUT} + } + "" +end +case textureprojgrad_sampler2darray_vec4_vec2_vec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGrad(s, vec4(0), vec2(0), vec2(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_samplercube_vec4_vec3_vec3_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec3(0), vec3(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_samplercube_vec4_vec3_vec3_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump samplerCube s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec3(0), vec3(0), ivec3(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_sampler2darray_vec4_vec2_vec2_ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec2(0), vec2(0), ivec2(0))); + ${OUTPUT} + } + "" +end +case textureprojgradoffset_sampler2darray_vec4_vec2_vec2_ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + uniform mediump sampler2DArray s; + + void main() + { + ${SETUP} + ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec2(0), vec2(0), ivec3(0))); + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html new file mode 100644 index 000000000..5899a9a27 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/keywords.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test new file mode 100644 index 000000000..b588cd74e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test @@ -0,0 +1,3219 @@ +# 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 const + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float const = 1.0; + ${OUTPUT} + } + "" + end + case uniform + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uniform = 1.0; + ${OUTPUT} + } + "" + end + case layout + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float layout = 1.0; + ${OUTPUT} + } + "" + end + case centroid + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float centroid = 1.0; + ${OUTPUT} + } + "" + end + case flat + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float flat = 1.0; + ${OUTPUT} + } + "" + end + case smooth + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float smooth = 1.0; + ${OUTPUT} + } + "" + end + case break + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float break = 1.0; + ${OUTPUT} + } + "" + end + case continue + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float continue = 1.0; + ${OUTPUT} + } + "" + end + case do + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float do = 1.0; + ${OUTPUT} + } + "" + end + case for + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float for = 1.0; + ${OUTPUT} + } + "" + end + case while + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float while = 1.0; + ${OUTPUT} + } + "" + end + case switch + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float switch = 1.0; + ${OUTPUT} + } + "" + end + case case + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float case = 1.0; + ${OUTPUT} + } + "" + end + case default + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float default = 1.0; + ${OUTPUT} + } + "" + end + case if + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float if = 1.0; + ${OUTPUT} + } + "" + end + case else + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float else = 1.0; + ${OUTPUT} + } + "" + end + case in + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float in = 1.0; + ${OUTPUT} + } + "" + end + case out + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float out = 1.0; + ${OUTPUT} + } + "" + end + case inout + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inout = 1.0; + ${OUTPUT} + } + "" + end + case float + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float float = 1.0; + ${OUTPUT} + } + "" + end + case int + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float int = 1.0; + ${OUTPUT} + } + "" + end + case void + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float void = 1.0; + ${OUTPUT} + } + "" + end + case bool + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bool = 1.0; + ${OUTPUT} + } + "" + end + case true + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float true = 1.0; + ${OUTPUT} + } + "" + end + case false + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float false = 1.0; + ${OUTPUT} + } + "" + end + case invariant + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float invariant = 1.0; + ${OUTPUT} + } + "" + end + case discard + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float discard = 1.0; + ${OUTPUT} + } + "" + end + case return + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float return = 1.0; + ${OUTPUT} + } + "" + end + case mat2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2 = 1.0; + ${OUTPUT} + } + "" + end + case mat3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3 = 1.0; + ${OUTPUT} + } + "" + end + case mat4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4 = 1.0; + ${OUTPUT} + } + "" + end + case mat2x2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2x2 = 1.0; + ${OUTPUT} + } + "" + end + case mat2x3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2x3 = 1.0; + ${OUTPUT} + } + "" + end + case mat2x4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat2x4 = 1.0; + ${OUTPUT} + } + "" + end + case mat3x2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3x2 = 1.0; + ${OUTPUT} + } + "" + end + case mat3x3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3x3 = 1.0; + ${OUTPUT} + } + "" + end + case mat3x4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat3x4 = 1.0; + ${OUTPUT} + } + "" + end + case mat4x2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4x2 = 1.0; + ${OUTPUT} + } + "" + end + case mat4x3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4x3 = 1.0; + ${OUTPUT} + } + "" + end + case mat4x4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mat4x4 = 1.0; + ${OUTPUT} + } + "" + end + case vec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec2 = 1.0; + ${OUTPUT} + } + "" + end + case vec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec3 = 1.0; + ${OUTPUT} + } + "" + end + case vec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float vec4 = 1.0; + ${OUTPUT} + } + "" + end + case ivec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec2 = 1.0; + ${OUTPUT} + } + "" + end + case ivec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec3 = 1.0; + ${OUTPUT} + } + "" + end + case ivec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float ivec4 = 1.0; + ${OUTPUT} + } + "" + end + case bvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec2 = 1.0; + ${OUTPUT} + } + "" + end + case bvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec3 = 1.0; + ${OUTPUT} + } + "" + end + case bvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float bvec4 = 1.0; + ${OUTPUT} + } + "" + end + case uint + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uint = 1.0; + ${OUTPUT} + } + "" + end + case uvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uvec2 = 1.0; + ${OUTPUT} + } + "" + end + case uvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uvec3 = 1.0; + ${OUTPUT} + } + "" + end + case uvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uvec4 = 1.0; + ${OUTPUT} + } + "" + end + case lowp + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float lowp = 1.0; + ${OUTPUT} + } + "" + end + case mediump + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float mediump = 1.0; + ${OUTPUT} + } + "" + end + case highp + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float highp = 1.0; + ${OUTPUT} + } + "" + end + case precision + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float precision = 1.0; + ${OUTPUT} + } + "" + end + case sampler2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2D = 1.0; + ${OUTPUT} + } + "" + end + case sampler3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3D = 1.0; + ${OUTPUT} + } + "" + end + case samplerCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerCube = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DShadow = 1.0; + ${OUTPUT} + } + "" + end + case samplerCubeShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerCubeShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DArray = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case isampler2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2D = 1.0; + ${OUTPUT} + } + "" + end + case isampler3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler3D = 1.0; + ${OUTPUT} + } + "" + end + case isamplerCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isamplerCube = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DArray = 1.0; + ${OUTPUT} + } + "" + end + case usampler2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2D = 1.0; + ${OUTPUT} + } + "" + end + case usampler3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler3D = 1.0; + ${OUTPUT} + } + "" + end + case usamplerCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usamplerCube = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DArray = 1.0; + ${OUTPUT} + } + "" + end + case struct + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + 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 attribute + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float attribute = 1.0; + ${OUTPUT} + } + "" + end + case varying + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float varying = 1.0; + ${OUTPUT} + } + "" + end + case coherent + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float coherent = 1.0; + ${OUTPUT} + } + "" + end + case restrict + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float restrict = 1.0; + ${OUTPUT} + } + "" + end + case readonly + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float readonly = 1.0; + ${OUTPUT} + } + "" + end + case writeonly + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float writeonly = 1.0; + ${OUTPUT} + } + "" + end + case resource + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float resource = 1.0; + ${OUTPUT} + } + "" + end + case atomic_uint + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float atomic_uint = 1.0; + ${OUTPUT} + } + "" + end + case noperspective + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float noperspective = 1.0; + ${OUTPUT} + } + "" + end + case patch + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float patch = 1.0; + ${OUTPUT} + } + "" + end + case sample + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sample = 1.0; + ${OUTPUT} + } + "" + end + case subroutine + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float subroutine = 1.0; + ${OUTPUT} + } + "" + end + case common + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float common = 1.0; + ${OUTPUT} + } + "" + end + case partition + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float partition = 1.0; + ${OUTPUT} + } + "" + end + case active + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float active = 1.0; + ${OUTPUT} + } + "" + end + case asm + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float asm = 1.0; + ${OUTPUT} + } + "" + end + case class + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float class = 1.0; + ${OUTPUT} + } + "" + end + case union + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float union = 1.0; + ${OUTPUT} + } + "" + end + case enum + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float enum = 1.0; + ${OUTPUT} + } + "" + end + case typedef + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float typedef = 1.0; + ${OUTPUT} + } + "" + end + case template + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float template = 1.0; + ${OUTPUT} + } + "" + end + case this + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float this = 1.0; + ${OUTPUT} + } + "" + end + case goto + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float goto = 1.0; + ${OUTPUT} + } + "" + end + case inline + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float inline = 1.0; + ${OUTPUT} + } + "" + end + case noinline + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float noinline = 1.0; + ${OUTPUT} + } + "" + end + case volatile + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float volatile = 1.0; + ${OUTPUT} + } + "" + end + case public + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float public = 1.0; + ${OUTPUT} + } + "" + end + case static + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float static = 1.0; + ${OUTPUT} + } + "" + end + case extern + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float extern = 1.0; + ${OUTPUT} + } + "" + end + case external + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float external = 1.0; + ${OUTPUT} + } + "" + end + case interface + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float interface = 1.0; + ${OUTPUT} + } + "" + end + case long + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float long = 1.0; + ${OUTPUT} + } + "" + end + case short + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float short = 1.0; + ${OUTPUT} + } + "" + end + case double + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float double = 1.0; + ${OUTPUT} + } + "" + end + case half + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float half = 1.0; + ${OUTPUT} + } + "" + end + case fixed + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fixed = 1.0; + ${OUTPUT} + } + "" + end + case unsigned + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float unsigned = 1.0; + ${OUTPUT} + } + "" + end + case superp + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float superp = 1.0; + ${OUTPUT} + } + "" + end + case input + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float input = 1.0; + ${OUTPUT} + } + "" + end + case output + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float output = 1.0; + ${OUTPUT} + } + "" + end + case hvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec2 = 1.0; + ${OUTPUT} + } + "" + end + case hvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec3 = 1.0; + ${OUTPUT} + } + "" + end + case hvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float hvec4 = 1.0; + ${OUTPUT} + } + "" + end + case dvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec2 = 1.0; + ${OUTPUT} + } + "" + end + case dvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec3 = 1.0; + ${OUTPUT} + } + "" + end + case dvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float dvec4 = 1.0; + ${OUTPUT} + } + "" + end + case fvec2 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec2 = 1.0; + ${OUTPUT} + } + "" + end + case fvec3 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec3 = 1.0; + ${OUTPUT} + } + "" + end + case fvec4 + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float fvec4 = 1.0; + ${OUTPUT} + } + "" + end + case sampler3DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler3DRect = 1.0; + ${OUTPUT} + } + "" + end + case filter + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float filter = 1.0; + ${OUTPUT} + } + "" + end + case image1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1D = 1.0; + ${OUTPUT} + } + "" + end + case image2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2D = 1.0; + ${OUTPUT} + } + "" + end + case image3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image3D = 1.0; + ${OUTPUT} + } + "" + end + case imageCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float imageCube = 1.0; + ${OUTPUT} + } + "" + end + case iimage1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage1D = 1.0; + ${OUTPUT} + } + "" + end + case iimage2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage2D = 1.0; + ${OUTPUT} + } + "" + end + case iimage3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage3D = 1.0; + ${OUTPUT} + } + "" + end + case iimageCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimageCube = 1.0; + ${OUTPUT} + } + "" + end + case uimage1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage1D = 1.0; + ${OUTPUT} + } + "" + end + case uimage2D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage2D = 1.0; + ${OUTPUT} + } + "" + end + case uimage3D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage3D = 1.0; + ${OUTPUT} + } + "" + end + case uimageCube + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimageCube = 1.0; + ${OUTPUT} + } + "" + end + case image1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1DArray = 1.0; + ${OUTPUT} + } + "" + end + case image2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2DArray = 1.0; + ${OUTPUT} + } + "" + end + case iimage1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage1DArray = 1.0; + ${OUTPUT} + } + "" + end + case iimage2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimage2DArray = 1.0; + ${OUTPUT} + } + "" + end + case uimage1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage1DArray = 1.0; + ${OUTPUT} + } + "" + end + case uimage2DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimage2DArray = 1.0; + ${OUTPUT} + } + "" + end + case image1DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1DShadow = 1.0; + ${OUTPUT} + } + "" + end + case image2DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2DShadow = 1.0; + ${OUTPUT} + } + "" + end + case image1DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image1DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case image2DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float image2DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case imageBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float imageBuffer = 1.0; + ${OUTPUT} + } + "" + end + case iimageBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float iimageBuffer = 1.0; + ${OUTPUT} + } + "" + end + case uimageBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float uimageBuffer = 1.0; + ${OUTPUT} + } + "" + end + case sampler1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1D = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DShadow = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DArray = 1.0; + ${OUTPUT} + } + "" + end + case sampler1DArrayShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler1DArrayShadow = 1.0; + ${OUTPUT} + } + "" + end + case isampler1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler1D = 1.0; + ${OUTPUT} + } + "" + end + case isampler1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler1DArray = 1.0; + ${OUTPUT} + } + "" + end + case usampler1D + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler1D = 1.0; + ${OUTPUT} + } + "" + end + case usampler1DArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler1DArray = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DRectShadow + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DRectShadow = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DRect + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DRect = 1.0; + ${OUTPUT} + } + "" + end + case samplerBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float samplerBuffer = 1.0; + ${OUTPUT} + } + "" + end + case isamplerBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isamplerBuffer = 1.0; + ${OUTPUT} + } + "" + end + case usamplerBuffer + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usamplerBuffer = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DMS + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DMS = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DMS + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DMS = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DMS + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DMS = 1.0; + ${OUTPUT} + } + "" + end + case sampler2DMSArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sampler2DMSArray = 1.0; + ${OUTPUT} + } + "" + end + case isampler2DMSArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float isampler2DMSArray = 1.0; + ${OUTPUT} + } + "" + end + case usampler2DMSArray + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float usampler2DMSArray = 1.0; + ${OUTPUT} + } + "" + end + case sizeof + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float sizeof = 1.0; + ${OUTPUT} + } + "" + end + case cast + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float cast = 1.0; + ${OUTPUT} + } + "" + end + case namespace + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float namespace = 1.0; + ${OUTPUT} + } + "" + end + case using + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + 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 {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float gl_Invalid = 1.0; + ${OUTPUT} + } + "" + end + case digit + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0123 = 1.0; + ${OUTPUT} + } + "" + end + case digit_begin + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float 0invalid = 1.0; + ${OUTPUT} + } + "" + end + case max_length + expect compile_fail + values {} + version 300 es + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + ${SETUP} + float abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdX = 1.0; + ${OUTPUT} + } + "" + end + +end # invalid_identifiers diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html new file mode 100644 index 000000000..c6ebbbc05 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/linkage.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test new file mode 100644 index 000000000..4cdaa0618 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test @@ -0,0 +1,3833 @@ + +# Varying tests +group varying "Varying linkage" + + # Linking rules + group rules "Varying linking rules" + # not declared in vertex shader, declared in fragment shader + case fragment_declare + version 300 es + desc "varying declared in fragment shader, no reference in vertex shader" + values { output float out0 = 1.0; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" + end + + # declared in vertex shader, no reference in frag shader + case vertex_declare + version 300 es + desc "varying declared in vertex shader, no reference in fragment shader" + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # declared in vertex shader, declared in frag shader + case both_declare + version 300 es + desc "varying declared in both vertex and fragment shader, but not used" + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # declared in vertex shader, static use in frag shader + case vertex_declare_fragment_use + version 300 es + desc "varying declared in both shaders, statically used in fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + if (u_false) + ${FRAG_COLOR} = vec4(var); + else + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # static use in vertex shader, no reference in fragment shader + case vertex_use_fragment_declare + version 300 es + desc "varying declared and statically used in vertex shader, no reference in fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # static use in vertex shader, declared in fragment shader + case vertex_use_declare_fragment + version 300 es + desc "varying declared and statically used in vertex shader, only declared in fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + in mediump float var; + ${FRAGMENT_DECLARATIONS} + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # static use in vertex shader, used in fragment shader + case vertex_use_fragment_use + version 300 es + desc "varying statically used in both vertex and fragment shader" + values { uniform bool u_false = false; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + if (u_false) + var = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + if (u_false) + ${FRAG_COLOR} = vec4(var); + else + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # differing precision tests + case differing_precision_1 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out highp float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + # differing precision tests + case differing_precision_2 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out highp vec2 var; + void main() + { + var = vec2(in0, 2.0*in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in lowp vec2 var; + void main() + { + out0 = var.y - var.x; + ${FRAGMENT_OUTPUT} + } + "" + end + + # differing precision tests + case differing_precision_3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out lowp vec4 var; + void main() + { + var = vec4(in0, 2.0*in0, -in0, -in0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in 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 type_mismatch_1 + version 300 es + desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump vec2 var; + void main() + { + if (false) + { + ${FRAG_COLOR} = vec4(var.y); + } + else + { + ${FRAG_COLOR} = vec4(1.0); + } + } + "" + end + + # mismatched type, varyings used + case type_mismatch_2 + version 300 es + desc "varying type mismatch (float vs. vec2)" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + var = 2.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump vec2 var; + void main() + { + ${FRAG_COLOR} = var.xyyx; + } + "" + end + + # mismatched type, varyings used + case type_mismatch_3 + version 300 es + desc "varying type mismatch (int vs. uint)" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump int var; + void main() + { + var = 2; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in mediump uint var; + void main() + { + ${FRAG_COLOR} = vec4(var); + } + "" + end + + # mismatched type, varyings used + case struct_type_mismatch_1 + version 300 es + desc "struct member mismatch" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { highp float a; highp vec2 b; }; + out S var; + void main() + { + var.a = 2.0; + var.b = vec2(1.0, 0.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { highp float a; highp vec3 b; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(var.a, var.b); + } + "" + end + + # mismatched type, varyings unused in fragment shader (runtime) + case struct_type_mismatch_2 + version 300 es + desc "struct member mismatch" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { highp float a; highp vec2 b; }; + out S var; + void main() + { + var.a = 2.0; + var.b = vec2(1.0, 0.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { highp float a; highp vec3 b; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(var.a); + if (false) + ${FRAG_COLOR}.yzw = var.b; + } + "" + end + + # mismatched type, varyings unused in both (runtime) + case struct_type_mismatch_3 + version 300 es + desc "struct member mismatch" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { highp float a; highp vec2 b; }; + out S var; + void main() + { + var.a = 2.0; + if (false) + var.b = vec2(1.0, 0.0); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { highp float a; highp vec3 b; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(var.a); + if (false) + ${FRAG_COLOR}.yzw = var.b; + } + "" + end + + # interpolation_mismatch + case interpolation_mismatch_1 + version 300 es + desc "varying interpolation different (flat vs. smooth)" + expect link_fail + + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + in highp float in0; + flat out mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + ${FRAG_COLOR} = vec4(var); + } + "" + end + + # different interpolation + case differing_interpolation_2 + version 300 es + desc "varying interpolation different (smooth vs. centroid)" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + smooth out mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + centroid in mediump float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + # no declaration in vertex shader, but static use in fragment + case illegal_usage_1 + version 300 es + desc "varying not declared in vertex shader, but statically used in fragment shader" + expect link_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump float var; + void main() + { + ${FRAG_COLOR} = vec4(var); + } + "" + end + + # non-flat integer varyings not allowed + case invalid_type_int + version 300 es + desc "integer varying used" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump int var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump int var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # non-flat integer varyings not allowed + case invalid_type_uint + version 300 es + desc "integer varying used" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump uint var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump uint var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + # bool varyings not allowed + case invalid_type_bool + version 300 es + desc "boolean varying used" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out bool var; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in bool var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_struct_array + version 300 es + desc "float array inside struct" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a[3]; }; + out S var; + void main() + { + var.a[0] = 1.0; + var.a[1] = 1.0; + var.a[2] = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a[3]; }; + in S var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_struct_struct + version 300 es + desc "struct inside struct" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; }; + struct T { S s; }; + out T var; + void main() + { + var.s.a = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; }; + struct T { S s; }; + in T var; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_array_struct + version 300 es + desc "array of structs" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump int a; }; + flat out S var[2]; + void main() + { + ${VERTEX_SETUP} + var[0].a = 1; + var[1].a = 1; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump int a; }; + flat in S var[2]; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_type_array_array + version 300 es + desc "array of arrays" + expect compile_fail + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var[2][2]; + void main() + { + ${VERTEX_SETUP} + var[0][0] = 1.0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + in mediump float var[2][2]; + void main() + { + ${FRAG_COLOR} = vec4(1.0); + } + "" + end + end + + group basic_types "Basic varying types" + case float + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump float var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec2 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump vec2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in vec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump vec3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in vec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x3 + version 300 es + desc "varying of type mat2x3" + values + { + input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat2x3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat2x3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x4 + version 300 es + desc "varying of type mat2x4" + values + { + input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat2x4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat2x4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x2 + version 300 es + desc "varying of type mat3x2" + values + { + input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat3x2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat3x2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x4 + version 300 es + desc "varying of type mat3x4" + values + { + input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat3x4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat3x4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x2 + version 300 es + desc "varying of type mat4x2" + values + { + input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat4x2 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat4x2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x3 + version 300 es + desc "varying of type mat4x3" + values + { + input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat4x3 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat4x3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + out mediump mat4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mat4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case int + version 300 es + desc "varying of type int" + values + { + input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump int var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in int var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec2 + version 300 es + desc "varying of type ivec2" + values + { + input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump ivec2 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in ivec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec3 + version 300 es + desc "varying of type ivec3" + values + { + input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump ivec3 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in ivec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec4 + version 300 es + desc "varying of type ivec4" + values + { + input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump ivec4 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in ivec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uint + version 300 es + desc "varying of type int" + values + { + input uint in0 = [ 1 | 2 | 3 | 16 ]; + output uint out0 = [ 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uint var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uint var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec2 + version 300 es + desc "varying of type uvec2" + values + { + input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uvec2 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uvec2 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec3 + version 300 es + desc "varying of type uvec3" + values + { + input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uvec3 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uvec3 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec4 + version 300 es + desc "varying of type uvec4" + values + { + input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump uvec4 var; + void main() + { + ${VERTEX_SETUP} + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + flat in uvec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group struct "Structure varyings" + case float + version 300 es + desc "varying of type float inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec2 + version 300 es + desc "varying of type vec2 inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump vec2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump vec2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec3 + version 300 es + desc "varying of type vec3 inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump vec3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump vec3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4 + version 300 es + desc "varying of type vec4 inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump vec4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump vec4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2 + version 300 es + desc "varying of type mat2 inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x3 + version 300 es + desc "varying of type mat2x3 inside struct" + values + { + input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat2x3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat2x3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat2x4 + version 300 es + desc "varying of type mat2x4 inside struct" + values + { + input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat2x4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat2x4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x2 + version 300 es + desc "varying of type mat3x2 inside struct" + values + { + input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat3x2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat3x2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3 + version 300 es + desc "varying of type mat3 inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat3x4 + version 300 es + desc "varying of type mat3x4 inside struct" + values + { + input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat3x4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat3x4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x2 + version 300 es + desc "varying of type mat4x2 inside struct" + values + { + input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat4x2 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat4x2 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4x3 + version 300 es + desc "varying of type mat4x3 inside struct" + values + { + input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat4x3 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat4x3 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case mat4 + version 300 es + desc "varying of type mat4 inside struct" + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump mat4 a; }; + out S var; + void main() + { + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump mat4 a; }; + in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case int + version 300 es + desc "varying of type int inside struct" + values + { + input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump int a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump int a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec2 + version 300 es + desc "varying of type ivec2 inside struct" + values + { + input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump ivec2 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump ivec2 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec3 + version 300 es + desc "varying of type ivec3 inside struct" + values + { + input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump ivec3 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump ivec3 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case ivec4 + version 300 es + desc "varying of type ivec4 inside struct" + values + { + input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump ivec4 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump ivec4 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uint + version 300 es + desc "varying of type uint in struct" + values + { + input uint in0 = [ 1 | 2 | 3 | 16 ]; + output uint out0 = [ 1 | 2 | 3 | 16 ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uint a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uint a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec2 + version 300 es + desc "varying of type uvec2 inside struct" + values + { + input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uvec2 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uvec2 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec3 + version 300 es + desc "varying of type uvec3 inside struct" + values + { + input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uvec3 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uvec3 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case uvec4 + version 300 es + desc "varying of type uvec4 inside struct" + values + { + input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; + } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump uvec4 a; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + ${FRAGMENT_DECLARATIONS} + struct S { mediump uvec4 a; }; + flat in S var; + void main() + { + out0 = var.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case float_vec3 + version 300 es + desc "varyings of type float and vec3 inside struct" + 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 ]; + input vec3 in1 = [ 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 out1 = [ 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; highp vec3 b; }; + out S var; + void main() + { + var.a = in0; + var.b = in1; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; highp vec3 b; }; + in S var; + void main() + { + out0 = var.a; + out1 = var.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case float_uvec2_vec3 + version 300 es + desc "varyings of type float and vec3 inside struct" + 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 ]; + input uvec2 in1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ]; + output uvec2 out1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ]; + input vec3 in2 = [ 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 out2 = [ 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct S { mediump float a; highp uvec2 b; highp vec3 c; }; + flat out S var; + void main() + { + ${VERTEX_SETUP} + var.a = in0; + var.b = in1; + var.c = in2; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + struct S { mediump float a; highp uvec2 b; highp vec3 c; }; + flat in S var; + void main() + { + out0 = var.a; + out1 = var.b; + out2 = var.c; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group interpolation "Varying interpolation modes" + case smooth + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + smooth out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + smooth in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case centroid + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + centroid out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + centroid in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + + case flat + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + flat out mediump vec4 var; + void main() + { + var = in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + flat in vec4 var; + void main() + { + out0 = var; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group usage "Varying usage in shaders" + case readback_1 + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${VERTEX_DECLARATIONS} + out float var1; + out float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float var1; + in float var2; + + void main() + { + out0 = var1 + var2; + ${FRAGMENT_OUTPUT} + } + "" + end + + case writeback_1 + version 300 es + desc "write back a varying in the fragment shader" + values + { + input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; + } + expect compile_fail + vertex "" + #version 300 es + precision mediump float; + ${VERTEX_DECLARATIONS} + out float var1; + out float var2; + + void main() + { + var1 = in0; + var2 = var1 + in0; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in float var1; + in float var2; + + void main() + { + var2 = var1; + out0 = var1; + ${FRAGMENT_OUTPUT} + } + "" + end + end +end + +group uniform "Uniform linkage" + group basic "Default block uniforms of scalar and vector types" + case precision_conflict_1 + version 300 es + desc "Vertex side uniform has highp, fragment side uniform mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform highp float u_val; + out mediump float res; + void main() + { + res = u_val; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + uniform float u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = u_val + res; + ${FRAGMENT_OUTPUT} + } + "" + end + case precision_conflict_2 + version 300 es + desc "Vertex side uniform has highp, fragment side uniform mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform highp float u_val; + out mediump float res; + void main() + { + res = u_val; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision highp float; + uniform mediump float u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = u_val + res; + ${FRAGMENT_OUTPUT} + } + "" + end + case precision_conflict_3 + version 300 es + desc "Vertex side uniform has lowp, fragment side uniform highp." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform lowp int u_val; + out mediump float res; + void main() + { + res = float(u_val); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision highp float; + uniform highp int u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = float(u_val) + res; + ${FRAGMENT_OUTPUT} + } + "" + end + case precision_conflict_4 + version 300 es + desc "Vertex side uniform has lowp, fragment side uniform mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + uniform lowp vec3 u_val; + out mediump float res; + void main() + { + res = u_val.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision highp float; + uniform mediump vec3 u_val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = u_val.z + res; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group struct "Uniform structs" + # Struct linkage handling + case basic + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b + val.a; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + 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 partial + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only_vec4 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only_vec4 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + 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 partial_vec4 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec4 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4_vec3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.b.y + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only_vec4_vec3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x + val.b.y; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only_vec4_vec3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + 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 partial_vec4_vec3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vec4_float + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + out mediump float dummy; + void main() + { + dummy = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + in mediump float dummy; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = val.b + val.a.x; + out0 = out0 + dummy; + out0 = out0 - dummy; + ${FRAGMENT_OUTPUT} + } + "" + end + + case vertex_only_vec4_float + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x + val.b; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + in mediump float res; + ${FRAGMENT_DECLARATIONS} + void main() + { out0 = res; + ${FRAGMENT_OUTPUT} + } + "" + end + + case fragment_only_vec4_float + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + 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 partial_vec4_float + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a; mediump float b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4_struct + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Inner {mediump vec4 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec4_vec3_struct + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Inner {mediump vec3 c;}; + struct Struct {mediump vec4 a; Inner b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.c.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec2_vec3 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec2 a; mediump vec3 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_vec2_int + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec2 a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_int_float + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a; mediump int b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + float(val.b); + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_bvec2_vec2 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {bvec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_ivec2_vec2 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump ivec2 a; mediump vec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.b.y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case partial_ivec2_ivec2 + version 300 es + 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 "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = vec2(val.a).x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump ivec2 a; mediump ivec2 b;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + vec2(val.b).y; + ${FRAGMENT_OUTPUT} + } + "" + end + + case type_conflict_1 + version 300 es + desc "Fragment struct has one less member than fragment version" + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a; mediump float b;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = res + val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case type_conflict_2 + version 300 es + desc "Vertex struct has int, fragment struct has float." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump int a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = float(val.a); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case type_conflict_3 + version 300 es + desc "Vertex struct has vec3, fragment struct has vec4." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump vec3 a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = float(val.a.x); + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump vec4 a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a.x; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_1 + version 300 es + desc "Vertex side struct has highp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {highp float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_2 + version 300 es + desc "Vertex side struct has mediump, fragment side struct lowp." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {mediump float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {lowp float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_3 + version 300 es + desc "Vertex side struct has lowp, fragment side struct mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {mediump float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case precision_conflict_4 + version 300 es + desc "Vertex side struct has lowp, fragment side struct implicit mediump." + expect link_fail + values {output float out0 = 3.0;} + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + struct Struct {lowp float a;}; + uniform Struct val; + out mediump float res; + void main() + { + res = val.a; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + struct Struct {float a;}; + uniform Struct val; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { out0 = val.a; + ${FRAGMENT_OUTPUT} + } + "" + end + + case light_struct_highp + version 300 es + 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 "" + #version 300 es + 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; + out mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + 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} + in mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" + end + + case light_struct_mediump + version 300 es + 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 "" + #version 300 es + 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; + out mediump float res; + void main() + { + res = val.constantAttenuation; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + 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} + in mediump float res; + void main() + { + out0 = res + val.quadraticAttenuation; + ${FRAGMENT_OUTPUT} + } + "" + end + end + + group block "Uniform blocks" + case type_mismatch + version 300 es + expect link_fail + vertex "" + #version 300 es + + uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + uniform Block + { + highp vec3 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val, 1.0); + } + "" + end + + case members_mismatch + version 300 es + expect link_fail + vertex "" + #version 300 es + + uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + uniform Block + { + highp vec4 val; + lowp uint u; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val); + } + "" + end + + case layout_qualifier_mismatch_2 + version 300 es + expect compile_fail + vertex "" + #version 300 es + + layout(shared) uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + layout(packed) uniform Block + { + highp vec4 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val); + } + "" + end + + case layout_qualifier_mismatch_3 + version 300 es + expect link_fail + vertex "" + #version 300 es + + layout(row_major) uniform Block + { + highp vec4 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val.x; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + layout(column_major) uniform Block + { + highp vec4 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val); + } + "" + end + + case layout_qualifier_mismatch_4 + version 300 es + expect link_fail + vertex "" + #version 300 es + + layout(row_major) uniform Block + { + highp mat3 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val[0][1]; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + layout(column_major) uniform Block + { + highp mat3 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val[2], 1.0); + } + "" + end + + case layout_qualifier_mismatch_5 + version 300 es + expect link_fail + vertex "" + #version 300 es + + uniform Block + { + layout(row_major) uniform highp mat3 val; + }; + + ${VERTEX_DECLARATIONS} + out mediump float res; + void main() + { + res = val[0][1]; + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + + uniform Block + { + layout(column_major) uniform highp mat3 val; + }; + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + in mediump float res; + void main() + { + dEQP_FragColor = vec4(val[2], 1.0); + } + "" + end + end +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html new file mode 100644 index 000000000..89236e542 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.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 = 'negative'; +description("Shader test: " + testName + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/negative.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test new file mode 100644 index 000000000..c7b86eded --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test @@ -0,0 +1,100 @@ +# Generic invalid cases that don't fall into other categories + +group c_cast "C-style casts" + + case float_0 + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + float a = 0.0; + float b = (float)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case float_1 + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + int a = 0; + float b = (float)a; + ${POSITION_FRAG_COLOR} = vec4(b); + } + "" + end + + case float_2 + expect compile_fail + version 300 es + both "" + #version 300 es + ${DECLARATIONS} + void main () + { + highp float a = 0.0; + mediump float b = (mediump float)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case int + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + float a = 0.0; + int b = (int)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case uint + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + float a = 0.0; + uint b = (uint)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + + case bool + expect compile_fail + version 300 es + both "" + #version 300 es + precision highp float; + ${DECLARATIONS} + void main () + { + int a = 1; + bool b = (bool)a; + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + "" + end + +end # casts diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html new file mode 100644 index 000000000..f472cec46 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/preprocessor.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test new file mode 100644 index 000000000..ebe385196 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test @@ -0,0 +1,5256 @@ +group basic "Basic Tests" + + case correct_phases + version 300 es + expect compile_fail + both "" + #version 300 es + #define e +1 + ${DECLARATIONS} + void main() + { + mediump int n = 1e; + ${OUTPUT} + } + "" + end + + case invalid_identifier + version 300 es + expect compile_fail + both "" + #version 300 es + #define e +1 + ${DECLARATIONS} + void main() + { + mediump int 1xyz = 1; + ${OUTPUT} + } + "" + end + + case null_directive + version 300 es + values { output float out0 = 0.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # + # // comment + /*sfd*/ # /* */ + + void main() + { + out0 = 0.0; + ${OUTPUT} + } + "" + end + + case invalid_directive + version 300 es + expect compile_fail + both "" + #version 300 es + #defin AAA + ${DECLARATIONS} + + void main() + { + ${OUTPUT} + } + "" + end + + case missing_identifier + version 300 es + expect compile_fail + both "" + #version 300 es + #define + ${DECLARATIONS} + + void main() + { + ${OUTPUT} + } + "" + end + + case empty_object + version 300 es + values { output float out0 = -1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # define VALUE + + void main() + { + out0 = VALUE - 1.0; + ${OUTPUT} + } + "" + end + + case empty_function + version 300 es + values { output float out0 = -1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # define VALUE(a) + + void main() + { + out0 = VALUE(2.0) - 1.0; + ${OUTPUT} + } + "" + end + + case empty_directive + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + # + + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case identifier_with_double_underscore + values { output float out0 = 1.0; } + version 300 es + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define VAL 2.0 + #undef VAL sdflkjfds + #define VAL 1.0 + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VAL); + } + "" + end + + case undefine_invalid_object_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef __LINE__ + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__LINE__); + } + "" + end + + case undefine_invalid_object_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef __FILE__ + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__FILE__); + } + "" + end + + case undefine_invalid_object_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef __VERSION__ + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(__VERSION__); + } + "" + end + + case undefine_invalid_object_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef GL_ES + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(GL_ES); + } + "" + end + + case undefine_function + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + #define FUNCTION(a,b) a+b + #undef FUNCTION + #define FUNCTION(a,b) a-b + ${DECLARATIONS} + + void main() + { + out0 = FUNCTION(3.0, 2.0); + ${OUTPUT} + } + "" + end + +end # definitions + +group invalid_definitions "Invalid Definition Tests" + + case define_non_identifier + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define 123 321 + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef 123 + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case undef_non_identifier_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #undef foo.bar + ${DECLARATIONS} + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + +end # invalid_definitions + +group object_redefinitions "Object Redefinition Tests" + + case invalid_object_ident + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 2) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case invalid_object_intval_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA 2 + # define VALUE (AAA - 1) + # define VALUE (AAA - 0x1) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(VALUE); + } + "" + end + + case redefine_object_1 + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 6.0; } + + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + values { output float out0 = 4.2; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define VALUE /* current + value */ 4.2 + + void main() + { + out0 = VALUE; + ${OUTPUT} + } + "" + end + + case nested_comment + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 0.0; + /* /* */ + out0 = 1.0; + // */ + ${OUTPUT} + } + "" + end + + case comment_trick_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /*/ + out0 = 0.0; + /*/ + out0 = 1.0; + /**/ + ${OUTPUT} + } + "" + end + + case comment_trick_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /**/ + out0 = 1.0; + /*/ + out0 = 0.0; + /**/ + ${OUTPUT} + } + "" + end + + case invalid_comment + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /* /* */ */ + ${POSITION_FRAG_COLOR} = 1.0; + } + "" + end + + case unterminated_comment_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + /* + } + "" + end + + case unterminated_comment_2 + version 300 es + expect compile_fail + both "" + #version 300 es + /* + precision mediump float; + ${DECLARATIONS} + void main() + { + } + "" + end + + case backslash_in_a_comment_1 + version 300 es + expect build_successful + both "" + #version 300 es + // \\note these are some declarations + precision mediump float; + ${DECLARATIONS} + // \\note this is the main function + void main() + { + // \\note this is a function body + ${OUTPUT} + } + "" + end + + case backslash_in_a_comment_2 + version 300 es + expect build_successful + both "" + #version 300 es + /* \\note these are some declarations */ + precision mediump float; + ${DECLARATIONS} + /* \\note this is the main function */ + void main() + { + /* \\note this is a function body */ + ${OUTPUT} + } + "" + end +end # comments + +group line_continuation "Line Continuation Tests" + + case comment + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + out0 = 1.0; + // comment \\ + out0 = -1.0; + ${OUTPUT} + } + "" + end + + case define + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define A(X) \\ + (-1.0*(X)) + + void main () + { + out0 = A(-1.0); + ${OUTPUT} + } + "" + end + + case preprocessing_token + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #def\\ + ine A(X) (-1.0*(X)) + + void main () + { + out0 = A(-1.0); + ${OUTPUT} + } + "" + end + + case token + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f\\ + oo = 1.0; + out0 = foo; + ${OUTPUT} + } + "" + end + + case middle_of_line + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define A a \\ b + #define B 1.0 + + void main () + { + out0 = B; + ${OUTPUT} + } + "" + end + +end # line_continuation + +group function_definitions "Function Definitions Tests" + + case same_object_and_function_param + version 300 es + values { output float out0 = 1.0; } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 518.5; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA BBB + #define BBB AAA + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA (1.0+BBB) + #define BBB (2.0+AAA) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA); + } + "" + end + + case recursion_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # define AAA(a) AAA(a) + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(AAA(1.0)); + } + "" + end + + case recursion_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + # 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 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 3.0; } + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(A,b) A+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0)); + } + "" + end + + case invalid_function_redefinition_param_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b,c) a+b+c + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case invalid_function_redefinition_param_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + # define FUNC(a,b) b+a + + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC); + } + "" + end + + case arguments_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC()); + } + "" + end + + case arguments_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(((); + } + "" + end + + case arguments_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC)); + } + "" + end + + case arguments_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0)); + } + "" + end + + case arguments_6 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + } + "" + end + + case arguments_7 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,)); + } + "" + end + + case arguments_8 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0)); + } + "" + end + + case unique_param_name + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a,a) a+a + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(a + b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case argument_list_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(,a,b) a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC( + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(A a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC(A,B,C a+b + + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0)); + } + "" + end + + case no_closing_parenthesis_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + # define FUNC( + "" + end + +end # invalid_function_definitions + +group semantic "Semantic Tests" + + case ops_as_arguments + version 300 es + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define FOO(a, b) (1 a 9) b 2 + + void main() + { + out0 = float(FOO(+, *)); + ${OUTPUT} + } + "" + end + + case correct_order + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 300.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA __VERSION__ + out0 = float(AAA); + ${OUTPUT} + } + "" + end + + case gl_es_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + out0 = float(GL_ES); + ${OUTPUT} + } + "" + end + + case gl_es_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define AAA(A) A + + void main() + { + out0 = float(AAA(GL_ES)); + ${OUTPUT} + } + "" + end + + case line_1 + version 300 es + values { output float out0 = 2.0; } + both "" + #version 300 es + const mediump int line = __LINE__; + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(line); + ${OUTPUT} + } + "" + end + + case line_2 + version 300 es + # Note: Arguments are macro replaced in the first stage. + # Macro replacement list is expanded in the last stage. + values { output vec4 out0 = vec4(12.0, 12.0, 10.0, 11.0); } + + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 0.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = float(__FILE__); + ${OUTPUT} + } + "" + end + + case if_gl_es + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case if_version + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if __VERSION__ == 300 + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + +end # predefined_macros + +group conditional_inclusion "Conditional Inclusion Tests" + + case basic_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA defined(BBB) + + #if !AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_macro_defined_test + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define AAA defined + + #if AAA AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_macro_undef + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define BBB 1 + #define AAA defined(BBB) + #undef BBB + + #if !AAA + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case define_defined + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define CCC 1 + #define defined BBB + #define AAA defined + + #if AAA CCC + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case define_defined_outside_if + version 300 es + 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 "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define CCC - 0.5 + #define defined 0.5 + #define AAA defined + out0 = 1.0 - (AAA CCC); + ${OUTPUT} + } + "" + end + + case defined_invalid_before_all_macros_replaced + version 300 es + expect compile_fail + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define FOO 1 + #define OPEN defined( + #define CLOSE FOO) + + #if OPEN CLOSE + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case basic_3 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !((~2 >> 1) & 1) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case unary_ops_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined() + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined( + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined) + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_defined_expected_identifier_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined((AAA)) + ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0); + #endif + } + "" + end + + case invalid_defined_expected_rparen + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + #define AAA 1 + + ${DECLARATIONS} + void main() + { + #if defined(AAA + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case defined_define + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 || AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case valid_undefined_identifier_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 && AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case undefined_identifier_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if !A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if -A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if ~A + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_5 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if A && B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_6 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if A || B + ${POSITION_FRAG_COLOR} = vec4(1.0); + #else + ${POSITION_FRAG_COLOR} = vec4(-1.0); + #endif + } + "" + end + + case undefined_identifier_10 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case empty_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case invalid_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case empty_if_defined + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if defined + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_if_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef FOOBAR + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef GL_ES + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_else_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_elif_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #elif 0 + ${POSITION_FRAG_COLOR} = vec4(2.0); + } + "" + end + + case elif_after_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #else + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case elif_without_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #elif 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case endif_without_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case else_after_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + # elif + ${POSITION_FRAG_COLOR} = vec4(0.0); + # endif + #endif + } + "" + end + + case if_float + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_elif + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 0 + #elif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + #endif + } + "" + end + + case tokens_after_else + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #else foobar 1.231 + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_endif + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + #else + #endif foobar + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifdef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef FOOBAR foobar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case tokens_after_ifndef + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef FOOBAR ,, +- << barbar + #else + #endif + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_nested_blocks + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 1 + # if 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_conditionals + +group conditionals "Conditionals Tests" + + case ifdef_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + #if defined ( AAA) + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifdef_3 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifdef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifndef_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #else + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case ifndef_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + #define AAA + void main() + { + #ifndef AAA + out0 = -1.0; + #else + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case mixed_conditional_inclusion + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #ifndef AAA + out0 = 1.0; + #elif 1 + out0 = -1.0; + #endif + ${OUTPUT} + } + "" + end + + case nested_if_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if GL_ES + # if __VERSION__ != 300 + out0 = -1.0; + # else + out0 = 1.0; + # endif + #endif + ${OUTPUT} + } + "" + end + + case nested_if_2 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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_is_less + expect compile_fail + version 300 es + both "" + #version 299 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_is_more + expect compile_fail + version 300 es + both "" + #version 301 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_missing_es + expect compile_fail + version 300 es + both "" + #version 300 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_missing + expect compile_fail + version 300 es + both "" + #version + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_1 + expect compile_fail + version 300 es + both "" + precision mediump float; + #version 300 es + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_not_first_statement_2 + expect compile_fail + version 300 es + both "" + #define FOO BAR + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_1 + expect compile_fail + version 300 es + both "" + #version 300 es.0 + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case version_invalid_token_2 + expect compile_fail + version 300 es + both "" + #version foobar + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_version + expect compile_fail + version 300 es + both "" + #version AAA + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case additional_tokens + expect compile_fail + version 300 es + both "" + #version 300 es foobar + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error_with_no_tokens + version 300 es + expect compile_fail + both "" + #version 300 es + #error + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case error + version 300 es + expect compile_fail + both "" + #version 300 es + #define AAA asdf + #error 1 * AAA /* comment */ + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # directive + +group builtin "Built-in Symbol Tests" + + case line + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 1 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file + version 300 es + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 234 10 + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_expression + version 300 es + values { output float out0 = 20.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line +20 + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_and_file_expression + version 300 es + values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line (233 +10) (+10) + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case line_defined_1 + version 300 es + values { output float out0 = 4.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 4 + #line A + out0 = float(__LINE__); + ${OUTPUT} + } + "" + end + + case line_defined_2 + version 300 es + values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define A 10 + #line 234 A + out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + ${OUTPUT} + } + "" + end + + case empty_line + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_line_file_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 22 1.234 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line 233 10 2 + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + + case invalid_line_file_4 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #line foobar + ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__); + } + "" + end + +end # builtin + +group pragmas "Pragma Tests" + + case pragma_vertex + version 300 es + values { output float out0 = 1.0; } + vertex "" + #version 300 es + #pragma + #pragma STDGL invariant(all) + #pragma debug(off) + #pragma optimize(off) + + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + precision mediump float; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" + end + + case pragma_fragment + version 300 es + values { output float out0 = 1.0; } + vertex "" + #version 300 es + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 300 es + #pragma + #pragma debug(off) + #pragma optimize(off) + + precision mediump float; + ${FRAGMENT_DECLARATIONS} + void main() + { + out0 = 1.0; + ${FRAGMENT_OUTPUT} + } + "" + end + + case pragma_macro_exp + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + expect build_successful + both "" + #version 300 es + #pragma debug(1.23) + + // unrecognized preprocessor token + + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case pragma_unrecognized_token + # Note: upstream dEQP uses unicode characters here but we can't test + # this in WebGL because it requires strings passed to glShaderSource + # to be ASCII. This would cause the test to fail at glShaderSource + # instead of glCompileShader, which is not what we want to test. + version 300 es + expect build_successful + both "" + #version 300 es + #pragma **% + + // trailing bytes form a valid but unrecognized preprocessor token + + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # pragmas + +group extensions "Extension Tests" + + case basic + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case macro_exp + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #define warn enable + + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + out0 = 1.0; + ${OUTPUT} + } + "" + end + + case missing_extension_name + version 300 es + expect compile_fail + both "" + #version 300 es + #extension + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_extension_name + version 300 es + expect compile_fail + both "" + #version 300 es + #extension 2 : all + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_colon + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case expected_colon + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all ; + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_behavior + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_1 + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : WARN + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_behavior_2 + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : require + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_name + # Note: upstream dEQP uses unicode characters here but we can't test + # this in WebGL because it requires strings passed to glShaderSource + # to be ASCII. This would cause the test to fail at glShaderSource + # instead of glCompileShader, which is not what we want to test. + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all* : warn + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_char_in_behavior + # Note: upstream dEQP uses unicode characters here but we can't test + # this in WebGL because it requires strings passed to glShaderSource + # to be ASCII. This would cause the test to fail at glShaderSource + # instead of glCompileShader, which is not what we want to test. + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : war*n + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unterminated_comment + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : warn /*asd + precision mediump float; + ${DECLARATIONS} + void main() + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case after_non_preprocessing_tokens + version 300 es + expect compile_fail + both "" + #version 300 es + #extension all : warn + + precision mediump float; + ${DECLARATIONS} + void main() + { + #extension all : disable + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end +end # extensions + +group expressions "Expression Tests" + + case shift_left + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL | 5) == 7 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case and + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL & 5) == 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case xor + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 6 + out0 = 0.0; + #if (VAL ^ 5) == 3 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case mod + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL (( (4 ) ) ) + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_tricky + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #define VAL 4 + out0 = 0.0; + #if VAL >= 4 + out0 = 1.0; + #endif + ${OUTPUT} + } + "" + end + + case parenthesis_if + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if -4 + 5 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case eval_basic_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 2 - 2 / 2 == 1 + out0 = 1.0; + #else + out0 = 0.0; + #endif + ${OUTPUT} + } + "" + end + + case defined_1 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + 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 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if ! + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_binary_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 3+4+ + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case missing_expr + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 4 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 4 * * 4 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case invalid_expr_3 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if (4)(4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unopened_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if 4) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + + case unclosed_parenthesis + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + #if ((4 + 7) + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + "" + end + +end # invalid_expressions + +group operator_precedence "Operator precedence" + + + case modulo_vs_not + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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 + version 300 es + values { output float out0 = 1.0; } + both "" + #version 300 es + #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/gles3/shaders/qualification_order.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html new file mode 100644 index 000000000..d381f96f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/qualification_order.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test new file mode 100644 index 000000000..42c5b357f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test @@ -0,0 +1,2714 @@ +# 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_interp_storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_interp_storage + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage + expect pass + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out float x0; + + out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in float x0; + + in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + + end # valid + group invalid "Invalid orderings." + + case invariant_interp_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth lowp centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_interp_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out smooth lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_precision_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out lowp smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_precision_interp_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant lowp smooth centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_precision_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant lowp centroid out smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_invariant_storage_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth invariant centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_invariant_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth invariant lowp centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_invariant_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out invariant lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_precision_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out lowp invariant float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_precision_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth lowp invariant centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_precision_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth lowp centroid out invariant float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_interp_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant smooth lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_precision_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant lowp smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_invariant_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth invariant lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_precision_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth lowp invariant float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp invariant smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_interp_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp smooth invariant float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_interp_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp invariant smooth centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp invariant centroid out smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_interp_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp smooth invariant centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_interp_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp smooth centroid out invariant float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_invariant_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out invariant smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_interp_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out smooth invariant float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth lowp centroid out float x0; + + flat mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth lowp centroid in float x0; + + flat mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth lowp float x0; + + out flat mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth lowp float x0; + + in flat mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp smooth float x0; + + out mediump flat float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp smooth float x0; + + in mediump flat float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_interp_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp smooth centroid out float x0; + + mediump flat out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp smooth centroid in float x0; + + mediump flat in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out smooth float x0; + + mediump out flat float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in smooth float x0; + + mediump in flat float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out smooth float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth invariant centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out invariant float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant smooth float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth invariant float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant lowp centroid out float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant_precision + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp invariant float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_invariant_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp invariant centroid out float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out invariant float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case precision_storage + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + lowp centroid out float x0; + + mediump out float x1; + + highp uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + lowp centroid in float x0; + + mediump in float x1; + + highp uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_interp + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out smooth float x0; + + out flat float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in smooth float x0; + + in flat float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_invariant + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out invariant float x0; + + out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + centroid in float x0; + + in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_interp_storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out lowp float x0; + + flat out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in lowp float x0; + + flat in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_interp_storage_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case storage_precision_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + centroid out lowp float x0; + + out mediump float x1; + + uniform highp float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant centroid in lowp float x0; + + in mediump float x1; + + uniform highp float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case interp_storage_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + smooth centroid out float x0; + + flat out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant smooth centroid in float x0; + + flat in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_FragColor = vec4(result, result, result, 1.0); + } + "" + end + case invariant_storage_invariant_input + expect compile_fail + values {} + + vertex "" + #version 300 es + precision mediump float; + in highp vec4 dEQP_Position; + + invariant centroid out float x0; + + out float x1; + + uniform float x2; + + void main() + { + x0 = 1.0; + x1 = 2.0; + gl_Position = dEQP_Position; + } + "" + + fragment "" + #version 300 es + precision mediump float; + layout(location = 0) out mediump vec4 dEQP_FragColor; + + invariant centroid in float x0; + + in float x1; + + uniform float x2; + + void main() + { + float result = (x0 + x1 + x2) / 3.0; + dEQP_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 + version 300 es + values {} + + both "" + #version 300 es + 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 highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (const lowp float x) + { + return x + 1.0; + } + + void foo1 ( mediump float x) + { + x = 1.0; + } + + float foo2 ( highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 ( highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 (highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 (highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 + version 300 es + values {} + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float foo0 (lowp const float x) + { + return x + 1.0; + } + + void foo1 (mediump float x) + { + x = 1.0; + } + + float foo2 (highp 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 + version 300 es + values {} + + both "" + #version 300 es + 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 (highp 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/gles3/shaders/scoping.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html new file mode 100644 index 000000000..c525b32b6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/scoping.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test new file mode 100644 index 000000000..4f195250f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test @@ -0,0 +1,901 @@ +group valid "Valid scoping and name redeclaration cases" + + case local_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = -1; + + void main() + { + ${SETUP} + int a = in0; + + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_local_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + { + int a = -1; + } + out0 = a; + ${OUTPUT} + } + "" + end + + case block_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + for (int a = 0; a < 10; a++) + { + } + out0 = a; + ${OUTPUT} + } + "" + end + + case while_condition_variable_hides_local_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + void main() + { + ${SETUP} + int a = in0; + int i = 0; + while (bool a = (i < 1)) + { + i++; + } + out0 = a; + ${OUTPUT} + } + "" + end + + case for_init_statement_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = 5; + + void main() + { + ${SETUP} + for (int a = 0; a < 10; a++) + { + } + out0 = in0 + a - 5; + ${OUTPUT} + } + "" + end + + case while_condition_variable_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a = 5; + + void main() + { + ${SETUP} + int i = 0; + while (bool a = (i < 1)) + { + i++; + } + out0 = in0 + a - 5; + ${OUTPUT} + } + "" + end + + case variable_in_if_hides_global_variable + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + 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 + + case redeclare_function + version 300 es + values + { + input int in0 = [ 1 | 2 | 3 ]; + output int out0 = [ 1 | 2 | 3 ]; + } + + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int func (int x); + int func (int); + int func (int inp) { return inp; } + + void main() + { + ${SETUP} + out0 = func(in0); + ${OUTPUT} + } + "" + end + +end + +group invalid "Invalid scoping behavior" + + case redeclare_global_variable + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + int a; + float a; + + void main() + { + a = 1.0; + ${POSITION_FRAG_COLOR} = vec4(a); + } + "" + end + + case redeclare_local_variable + version 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 redefine_function + version 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + float sin(float x); + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(sin(1.0)); + } + "" + end + + case redefine_builtin + version 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + 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 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main() + { + float x = x; + ${POSITION_FRAG_COLOR} = vec4(x); + } + "" + end + + case local_variable_hides_function_parameter + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + float func (float inp, float x) { int x = 5.0; return inp + x - 5.0; } + + void main() + { + ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0)); + } + "" + end + +end # invalid diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html new file mode 100644 index 000000000..9c9a5a0e1 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.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 = 'switch'; +description("Shader test: " + testName + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/switch.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test new file mode 100644 index 000000000..687eb7eba --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test @@ -0,0 +1,633 @@ + +case empty_condition + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch () + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_float + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float c = 1.0; + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_bool + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + bool c = true; + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_ivec2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + ivec2 c = ivec2(1, 1); + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case condition_struct + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + struct S { int m; }; + + void main () + { + S c = S(1); + switch (c) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case duplicate_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int c = 1; + switch (c) + { + case 1: + case 1: + break; + } + + ${OUTPUT} + } + "" +end + +case float_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int c = 1; + switch (c) + { + case 1.0: + break; + } + + ${OUTPUT} + } + "" +end + +case non_const_int_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + int c = 1; + int l = 2; + switch (c) + { + case l: + break; + } + + ${OUTPUT} + } + "" +end + +case statement_before_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + case 1: + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + + ${OUTPUT} + } + "" +end + +case statement_before_default_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + ${POSITION_FRAG_COLOR} = vec4(1.0); + default: + ${POSITION_FRAG_COLOR} = vec4(0.0); + } + + ${OUTPUT} + } + "" +end + +case no_statement_after_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 0: + break; + case 1: + } + + ${OUTPUT} + } + "" +end + +case no_statement_after_default_label + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 0: + break; + default: + } + + ${OUTPUT} + } + "" +end + +case case_in_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + if (f > 0.0) + { + case 1: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_if + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + if (f > 0.0) + { + default: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case case_in_for_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + for (int i = 0; i < 2; i++) + { + case 1: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_for_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + for (int i = 0; i < 2; i++) + { + default: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case case_in_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + while (f > 0.0) + { + case 1: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + while (f > 0.0) + { + default: + f *= 2.0; + } + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case case_in_do_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + do + { + case 1: + f *= 2.0; + } while (f > 0.0); + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case default_in_do_while_loop + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + float f = 1.0; + switch (1) + { + case 0: + f = 0.0; + do + { + default: + f *= 2.0; + } while (f > 0.0); + break; + case 2: + break; + } + + ${OUTPUT} + } + "" +end + +case missing_colon + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 1 + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case missing_opening_brace + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case missing_closing_brace + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + + ${OUTPUT} + } + "" +end + +case double_case + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + case case 1: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case double_default_1 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + default: + break; + default: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end + +case double_default_2 + version 300 es + expect compile_fail + both "" + #version 300 es + precision mediump float; + ${DECLARATIONS} + + void main () + { + switch (1) + { + default default: + ${POSITION_FRAG_COLOR} = vec4(1.0); + } + + ${OUTPUT} + } + "" +end diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.html new file mode 100644 index 000000000..6f633be63 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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/gles3/shaders/swizzles.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test new file mode 100644 index 000000000..2477ebb06 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test @@ -0,0 +1,7459 @@ +# 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 + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yxy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_xyxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec2_yyyy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec2_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_st + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_vec2_ts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tst + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec2_stss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec2_tttt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec2_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_grg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec2_rgrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec2_gggg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec3_z + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_yxy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xzx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_xyyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_vec3_zzzz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_vec3_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec3_p + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_ppt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_vec3_tst + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_vec3_sps + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_vec3_stts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_vec3_pppp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_vec3_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec3_b + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rgb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bgr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_grg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rbr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_rggr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_vec3_bbbb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_vec4_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_vec4_w + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_www + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyzw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xxxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_yyyy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwww + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wzzw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_vec4_wwwy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_vec4_xyxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_vec4_zzwz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_vec4_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_vec4_q + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qs + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ttq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stpq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qpts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ssss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_tttt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qppq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_vec4_qqqt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_vec4_stss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ppqp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_vec4_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_vec4_a + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ar + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_vec4_ab + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaa + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gga + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgba + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abgr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rrrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_gggg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaaa + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_vec4_abba + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_vec4_aaag + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_vec4_rgrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_vec4_bbab + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yxy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_xyxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_yyyy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_st + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_ts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tst + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_stss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_tttt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_grg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_rgrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec2_gggg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_z + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_yxy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xzx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_xyyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_zzzz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_p + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_ppt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_tst + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_sps + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_stts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_pppp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_b + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rgb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bgr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_grg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rbr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_rggr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_ivec3_bbbb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_w + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_www + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyzw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xxxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_yyyy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwww + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wzzw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_wwwy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_xyxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_zzwz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_q + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qs + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ttq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stpq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qpts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ssss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_tttt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qppq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_qqqt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_stss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ppqp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_a + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ar + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_ab + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaa + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gga + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgba + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abgr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rrrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_gggg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaaa + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_abba + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_aaag + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_rgrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_ivec4_bbab + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbab; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yxy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_xyxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_yyyy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_st + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.st; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_ts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ts; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tst + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_stss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_tttt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_grg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_rgrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec2_gggg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_z + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.z; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_yxy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yxy; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xzx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xzx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_xyyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_zzzz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzzz; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_p + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.p; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sss; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_ppt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppt; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_tst + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tst; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_sps + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.sps; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_stts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stts; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_pppp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.pppp; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_b + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.b; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rgb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bgr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_grg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.grg; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rbr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rbr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_rggr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rggr; + ${OUTPUT} + } + "" + end + + case mediump_bvec3_bbbb + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.bbbb; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_x + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.x; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_w + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.w; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_www + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.www; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyzw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzyx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzyx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xxxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xxxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_yyyy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.yyyy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwww + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwww; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wzzw + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wzzw; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_wwwy + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.wwwy; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_xyxx + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.xyxx; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_zzwz + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.zzwz; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_s + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.s; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_q + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.q; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qs + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qs; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ttq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ttq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stpq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stpq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qpts + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qpts; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ssss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ssss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_tttt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.tttt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qppq + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qppq; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_qqqt + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.qqqt; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_stss + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.stss; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ppqp + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ppqp; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_r + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.r; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_a + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.a; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ar + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ar; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_ab + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.ab; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaa + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gga + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gga; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgba + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abgr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abgr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rrrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rrrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_gggg + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.gggg; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaaa + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaaa; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_abba + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.abba; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_aaag + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.aaag; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_rgrr + version 300 es + 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 "" + #version 300 es + precision mediump float; + + ${DECLARATIONS} + + void main() + { + ${SETUP} + out0 = in0.rgrr; + ${OUTPUT} + } + "" + end + + case mediump_bvec4_bbab + version 300 es + 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 "" + #version 300 es + 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/gles3/shaders/template.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html new file mode 100644 index 000000000..a1937f2ca --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/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 + "."); +WebGLTestUtils.setDefault3DContextVersion(2); + +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> |