Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations a series of array operator tests including logical and mathimatical tests. These are operators including +,/,>,<,>=,<=,&&,!,||,^^,+,-,++,--, , ,-
Signed-off-by: Tom Gall <[email protected]> --- .../structure-and-array-operations/array-add.vert | 23 +++++++++++++++++ .../array-divide.vert | 23 +++++++++++++++++ .../array-greater-equal.vert | 20 +++++++++++++++ .../array-greater.vert | 20 +++++++++++++++ .../array-less-equal.vert | 20 +++++++++++++++ .../structure-and-array-operations/array-less.vert | 20 +++++++++++++++ .../array-logical-and.vert | 20 +++++++++++++++ .../array-logical-not.vert | 19 ++++++++++++++ .../array-logical-or.vert | 20 +++++++++++++++ .../array-logical-xor.vert | 20 +++++++++++++++ .../array-negate.vert | 22 +++++++++++++++++ .../array-positive.vert | 22 +++++++++++++++++ .../array-postdecrement.vert | 21 ++++++++++++++++ .../array-postincrement.vert | 21 ++++++++++++++++ .../array-selection.vert | 26 ++++++++++++++++++++ .../array-sequence.vert | 20 +++++++++++++++ .../array-subtract.vert | 23 +++++++++++++++++ 17 files changed, 360 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert new file mode 100644 index 0000000..e824260 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[2] = a + b; + gl_Position = c[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert new file mode 100644 index 0000000..d1c9111 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[2] = a / b; + gl_Position = c[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert new file mode 100644 index 0000000..49cfa5e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The relational operators greater (>), less than (<), greater than or + * equal (>=), less than or equal (<=) operate only on scalar integer and + * scalar floating point expressions." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a >= b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert new file mode 100644 index 0000000..2f59003 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The relational operators greater (>), less than (<), greater than or + * equal (>=), less than or equal (<=) operate only on scalar integer and + * scalar floating point expressions." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a > b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert new file mode 100644 index 0000000..9d5b51c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The relational operators greater (>), less than (<), greater than or + * equal (>=), less than or equal (<=) operate only on scalar integer and + * scalar floating point expressions." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a <= b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert new file mode 100644 index 0000000..41a7280 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The relational operators greater (>), less than (<), greater than or + * equal (>=), less than or equal (<=) operate only on scalar integer and + * scalar floating point expressions." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a < b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert new file mode 100644 index 0000000..7b4860d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The logical binary operators and (&&), or (||), and exclusive or (^^) + * operate only one two Boolean expressions and result in a Boolean + * expression. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a && b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert new file mode 100644 index 0000000..70e4839 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The logical unary operator not (!) operates only on a Boolean expression + * and results in a Boolean expression. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(!a); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert new file mode 100644 index 0000000..5e8b704 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The logical binary operators and (&&), or (||), and exclusive or (^^) + * operate only one two Boolean expressions and result in a Boolean + * expression. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a || b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert new file mode 100644 index 0000000..12673fd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The logical binary operators and (&&), or (||), and exclusive or (^^) + * operate only one two Boolean expressions and result in a Boolean + * expression. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(a ^^ b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert new file mode 100644 index 0000000..0d7697d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(-a == b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert new file mode 100644 index 0000000..ee5671c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = vec4(+a == b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert new file mode 100644 index 0000000..3ace25e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; + +void main() +{ + gl_Position = (a--)[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert new file mode 100644 index 0000000..2c3e2b0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; + +void main() +{ + gl_Position = (a++)[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert new file mode 100644 index 0000000..e7cbec1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert @@ -0,0 +1,26 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 49 of the GLSL ES 1.00.17 spec: + * + * "The ternary selection operator (?:). It operates on three expressions + * (exp1 ? exp2 : exp3). This operator evaluates the first expression, + * which must result in a scalar Boolean. If the result is true, it + * selects to evaluate the second expression, otherwise it selects to + * evaluate the third expression. One one of the second or third expressions + * is evaluated. The second and third expressions must be the same type, but + * can be of any type other than an array." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; +uniform int i; +uniform bool pick_from_a_or_b; + +void main() +{ + gl_Position = (pick_from_a_or_b ? a : b)[i]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert new file mode 100644 index 0000000..6e3f60a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The sequence operator (,) that operates on expressions by returning the + * type and value of the right-most expression in a comma separated list of + * expressions. All expressions are evaluated, in order, from right to left. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + gl_Position = (a, b)[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert new file mode 100644 index 0000000..d9c717d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.00 + * [end config] + * + * From page 48 of the GLSL ES 1.00.17 spec: + * + * "The arithmetic binary operators add (+), subtract (-), multiply (*), + * and divide (/) operate on integer and floating-point typed expressions + * (including vectors and matrices). The two operands must be of the same + * type or one can be a scalar float and the other a float vector or matrix + * or one can be a scalar integer and the other an integer vector." + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[2] = a - b; + gl_Position = c[0]; +} -- 1.7.10.4 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
