From 38ae2658c4b4add786d39f4f323490de8f57b5cf Mon Sep 17 00:00:00 2001 From: Tom Gall Date: Mon, 7 Jan 2013 14:45:29 -0600 Subject: gles2: glslparser tests ported to glsl es 1.00 --- .../structure-and-array-operations/array-add.vert | 26 ++++ ...rray-assign-implicit-conversion-bool-float.vert | 21 +++ .../array-assign-implicit-conversion-bool-int.vert | 21 +++ ...ray-assign-implicit-conversion-bvec2-ivec2.vert | 21 +++ ...rray-assign-implicit-conversion-bvec2-vec2.vert | 21 +++ ...ray-assign-implicit-conversion-bvec3-ivec3.vert | 21 +++ ...rray-assign-implicit-conversion-bvec3-vec3.vert | 21 +++ ...ray-assign-implicit-conversion-bvec4-ivec4.vert | 21 +++ ...rray-assign-implicit-conversion-bvec4-vec4.vert | 21 +++ ...rray-assign-implicit-conversion-float-bool.vert | 21 +++ ...array-assign-implicit-conversion-float-int.vert | 21 +++ .../array-assign-implicit-conversion-int-bool.vert | 21 +++ ...array-assign-implicit-conversion-int-float.vert | 21 +++ ...ray-assign-implicit-conversion-ivec2-bvec2.vert | 21 +++ ...rray-assign-implicit-conversion-ivec2-vec2.vert | 21 +++ ...ray-assign-implicit-conversion-ivec3-bvec3.vert | 21 +++ ...rray-assign-implicit-conversion-ivec3-vec3.vert | 21 +++ ...ray-assign-implicit-conversion-ivec4-bvec4.vert | 21 +++ ...rray-assign-implicit-conversion-ivec4-vec4.vert | 21 +++ ...rray-assign-implicit-conversion-vec2-bvec2.vert | 21 +++ ...rray-assign-implicit-conversion-vec2-ivec2.vert | 21 +++ ...rray-assign-implicit-conversion-vec3-bvec3.vert | 21 +++ ...rray-assign-implicit-conversion-vec3-ivec3.vert | 21 +++ ...rray-assign-implicit-conversion-vec4-bvec4.vert | 21 +++ ...rray-assign-implicit-conversion-vec4-ivec4.vert | 21 +++ .../array-assign-implicit-size.vert | 23 +++ .../array-assign.vert | 30 ++++ .../array-attribute.vert | 19 +++ .../array-constant-index-implicit-size.vert | 22 +++ .../array-constant-index-negative.vert | 19 +++ .../array-constant-index-too-large.vert | 20 +++ .../array-ctor-implicit-conversion-bool-float.vert | 37 +++++ .../array-ctor-implicit-conversion-bool-int.vert | 37 +++++ ...array-ctor-implicit-conversion-bvec2-ivec2.vert | 37 +++++ .../array-ctor-implicit-conversion-bvec2-vec2.vert | 37 +++++ ...array-ctor-implicit-conversion-bvec3-ivec3.vert | 37 +++++ .../array-ctor-implicit-conversion-bvec3-vec3.vert | 37 +++++ ...array-ctor-implicit-conversion-bvec4-ivec4.vert | 37 +++++ .../array-ctor-implicit-conversion-bvec4-vec4.vert | 37 +++++ .../array-ctor-implicit-conversion-float-bool.vert | 37 +++++ .../array-ctor-implicit-conversion-float-int.vert | 37 +++++ .../array-ctor-implicit-conversion-int-bool.vert | 37 +++++ .../array-ctor-implicit-conversion-int-float.vert | 37 +++++ ...array-ctor-implicit-conversion-ivec2-bvec2.vert | 37 +++++ .../array-ctor-implicit-conversion-ivec2-vec2.vert | 37 +++++ ...array-ctor-implicit-conversion-ivec3-bvec3.vert | 37 +++++ .../array-ctor-implicit-conversion-ivec3-vec3.vert | 37 +++++ ...array-ctor-implicit-conversion-ivec4-bvec4.vert | 37 +++++ .../array-ctor-implicit-conversion-ivec4-vec4.vert | 37 +++++ .../array-ctor-implicit-conversion-vec2-bvec2.vert | 37 +++++ .../array-ctor-implicit-conversion-vec2-ivec2.vert | 37 +++++ .../array-ctor-implicit-conversion-vec3-bvec3.vert | 37 +++++ .../array-ctor-implicit-conversion-vec3-ivec3.vert | 37 +++++ .../array-ctor-implicit-conversion-vec4-bvec4.vert | 37 +++++ .../array-ctor-implicit-conversion-vec4-ivec4.vert | 37 +++++ .../array-ctor-mismatched-size.vert | 16 ++ .../structure-and-array-operations/array-ctor.vert | 17 +++ .../array-divide.vert | 26 ++++ .../array-equal-implicit-size.vert | 28 ++++ .../array-equal-matrix.vert | 22 +++ .../array-equal-mismatched-base-type.vert | 22 +++ .../array-equal-mismatched-size.vert | 22 +++ .../array-equal-vector.vert | 22 +++ .../array-equal.vert | 22 +++ .../array-function-parameter-implicit-size.vert | 29 ++++ .../array-function-parameter-unsized.vert | 21 +++ .../array-function-return-unsized.vert | 31 ++++ .../array-function-return.vert | 31 ++++ .../array-greater-equal.vert | 25 ++++ .../array-greater.vert | 25 ++++ .../array-length-implicit-size.vert | 21 +++ .../array-length-with-argument.vert | 14 ++ .../array-length.vert | 24 +++ .../array-less-equal.vert | 25 ++++ .../structure-and-array-operations/array-less.vert | 25 ++++ .../array-logical-and.vert | 25 ++++ .../array-logical-not.vert | 25 ++++ .../array-logical-or.vert | 25 ++++ .../array-logical-xor.vert | 25 ++++ .../array-multidimensional-new-syntax.vert | 18 +++ .../array-multidimensional.vert | 18 +++ .../array-multiply.vert | 26 ++++ .../array-negate.vert | 25 ++++ .../array-not-equal-implicit-size.vert | 28 ++++ .../array-not-equal-matrix.vert | 22 +++ .../array-not-equal-mismatched-base-type.vert | 22 +++ .../array-not-equal-mismatched-size.vert | 22 +++ .../array-not-equal-vertor.vert | 22 +++ .../array-not-equal.vert | 22 +++ .../array-of-any-type.vert | 44 ++++++ ...ay-of-array-function-parameter-declaration.frag | 20 +++ ...ay-of-array-function-parameter-declaration.vert | 20 +++ ...ray-of-array-function-parameter-definition.frag | 23 +++ ...ray-of-array-function-parameter-definition.vert | 23 +++ .../array-of-array-structure-field.frag | 22 +++ .../array-of-array-structure-field.vert | 22 +++ .../array-of-struct-of-array.vert | 28 ++++ .../array-of-struct.vert | 22 +++ .../array-positive.vert | 25 ++++ .../array-postdecrement.vert | 24 +++ .../array-postincrement.vert | 24 +++ .../array-predecrement.vert | 24 +++ .../array-preincrement.vert | 24 +++ .../array-redeclaration-01.vert | 31 ++++ .../array-redeclaration-initializer.vert | 28 ++++ .../array-redeclaration-too-small.vert | 28 ++++ .../array-redeclaration-wrong-base-type.vert | 29 ++++ .../array-selection.vert | 24 +++ .../array-sequence.vert | 25 ++++ .../array-shadow-redeclaration.vert | 29 ++++ .../array-size-bool.vert | 17 +++ .../array-size-bvec2.vert | 17 +++ .../array-size-bvec3.vert | 17 +++ .../array-size-bvec4.vert | 17 +++ .../array-size-constant-cast.vert | 18 +++ .../array-size-constant-relational.vert | 162 +++++++++++++++++++++ .../array-size-float.vert | 17 +++ .../array-size-int.vert | 17 +++ .../array-size-ivec2.vert | 17 +++ .../array-size-ivec3.vert | 17 +++ .../array-size-ivec4.vert | 17 +++ .../array-size-length.vert | 18 +++ .../array-size-negative.vert | 17 +++ .../array-size-non-builtin-function.vert | 19 +++ .../array-size-not-constant.vert | 18 +++ .../array-size-selection.vert | 23 +++ .../array-size-sequence-in-parenthesis.vert | 33 +++++ .../array-size-sequence.vert | 33 +++++ .../array-size-vec2.vert | 17 +++ .../array-size-vec3.vert | 17 +++ .../array-size-vec4.vert | 17 +++ .../array-size-with-side-effect.vert | 20 +++ .../array-size-zero.vert | 17 +++ .../array-subtract.vert | 26 ++++ .../array-variable-index-implicit-size-global.vert | 24 +++ .../array-variable-index-implicit-size-local.vert | 29 ++++ 136 files changed, 3544 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-assign-implicit-conversion-bool-float.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-int.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-ivec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-vec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-ivec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-vec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-ivec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-vec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-bool.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-int.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-bool.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-float.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-bvec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-vec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-bvec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-vec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-bvec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-vec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-bvec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-ivec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-bvec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-ivec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-bvec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-ivec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-int.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-ivec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-vec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-ivec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-vec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-ivec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-vec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-bool.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-int.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-bool.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-float.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-bvec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-vec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-bvec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-vec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-bvec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-vec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-ivec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-bvec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-ivec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-bvec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-ivec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor.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-equal-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-vector.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.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-length-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-with-argument.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length.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-multidimensional-new-syntax.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.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-not-equal-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.frag create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.frag create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct-of-array.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct.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-predecrement.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-preincrement.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-01.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-initializer.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-too-small.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-wrong-base-type.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-shadow-redeclaration.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-global.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-local.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 00000000..0ed5a818 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert @@ -0,0 +1,26 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-assign-implicit-conversion-bool-float.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-float.vert new file mode 100644 index 00000000..06a298e0 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-float.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bool a[2]; + +void main() +{ + float b[2]; + b = a; + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-int.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-int.vert new file mode 100644 index 00000000..be1d8beb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bool-int.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bool a[2]; + +void main() +{ + int b[2]; + b = a; + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-ivec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-ivec2.vert new file mode 100644 index 00000000..cda2e5d9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-ivec2.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bvec2 a[2]; + +void main() +{ + ivec2 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-vec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-vec2.vert new file mode 100644 index 00000000..97ad3887 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec2-vec2.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bvec2 a[2]; + +void main() +{ + vec2 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-ivec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-ivec3.vert new file mode 100644 index 00000000..f192fbf3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-ivec3.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bvec3 a[2]; + +void main() +{ + ivec3 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-vec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-vec3.vert new file mode 100644 index 00000000..26ea54ae --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec3-vec3.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bvec3 a[2]; + +void main() +{ + vec3 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-ivec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-ivec4.vert new file mode 100644 index 00000000..c3e2a29e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-ivec4.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bvec4 a[2]; + +void main() +{ + ivec4 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-vec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-vec4.vert new file mode 100644 index 00000000..35e891be --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-bvec4-vec4.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform bvec4 a[2]; + +void main() +{ + vec4 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-bool.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-bool.vert new file mode 100644 index 00000000..028c8458 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-bool.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform float a[2]; + +void main() +{ + bool b[2]; + b = a; + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-int.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-int.vert new file mode 100644 index 00000000..7a00b1a6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-float-int.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform float a[2]; + +void main() +{ + int b[2]; + b = a; + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-bool.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-bool.vert new file mode 100644 index 00000000..5bbe87eb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-bool.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform int a[2]; + +void main() +{ + bool b[2]; + b = a; + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-float.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-float.vert new file mode 100644 index 00000000..dfc4846e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-int-float.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform int a[2]; + +void main() +{ + float b[2]; + b = a; + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-bvec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-bvec2.vert new file mode 100644 index 00000000..5483a5c6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-bvec2.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform ivec2 a[2]; + +void main() +{ + bvec2 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-vec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-vec2.vert new file mode 100644 index 00000000..93aaf4fc --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec2-vec2.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform ivec2 a[2]; + +void main() +{ + vec2 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-bvec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-bvec3.vert new file mode 100644 index 00000000..a2816323 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-bvec3.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform ivec3 a[2]; + +void main() +{ + bvec3 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-vec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-vec3.vert new file mode 100644 index 00000000..7dfbcf94 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec3-vec3.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform ivec3 a[2]; + +void main() +{ + vec3 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-bvec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-bvec4.vert new file mode 100644 index 00000000..d5320891 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-bvec4.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform ivec4 a[2]; + +void main() +{ + bvec4 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-vec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-vec4.vert new file mode 100644 index 00000000..e05cefbf --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-ivec4-vec4.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform ivec4 a[2]; + +void main() +{ + vec4 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-bvec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-bvec2.vert new file mode 100644 index 00000000..4123c104 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-bvec2.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform vec2 a[2]; + +void main() +{ + bvec2 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-ivec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-ivec2.vert new file mode 100644 index 00000000..b8e00e14 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec2-ivec2.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform vec2 a[2]; + +void main() +{ + ivec2 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-bvec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-bvec3.vert new file mode 100644 index 00000000..f4743515 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-bvec3.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform vec3 a[2]; + +void main() +{ + bvec3 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-ivec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-ivec3.vert new file mode 100644 index 00000000..34763c18 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec3-ivec3.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform vec3 a[2]; + +void main() +{ + ivec3 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-bvec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-bvec4.vert new file mode 100644 index 00000000..9f2248ac --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-bvec4.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform vec4 a[2]; + +void main() +{ + bvec4 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-ivec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-ivec4.vert new file mode 100644 index 00000000..5fb50015 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-conversion-vec4-ivec4.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float." + */ + + +uniform vec4 a[2]; + +void main() +{ + ivec4 b[2]; + b = a; + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert new file mode 100644 index 00000000..b0f96886 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign-implicit-size.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "However, implicitly sized arrays cannot be assigned to. Note, this is + * a rare case that initializers and assignments appear to have different + * semantics." + */ + + +uniform float a[5]; + +void main() +{ + float b[]; + b = a; + + gl_Position = vec4(0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert new file mode 100644 index 00000000..ea43f565 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert @@ -0,0 +1,30 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +void main() +{ + vec4 a[2]; + vec4 b[2]; + vec4 c[2]; + + a = vec4[2](vec4(0.0), vec4(2.0)); + b = vec4[ ](vec4(0.5), vec4(2.0)); + c = a; + + gl_Position = a[0] + b[0] + c[1]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert new file mode 100644 index 00000000..9e5adcd8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-attribute.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec: + * + * "Attribute variables cannot be declared as arrays or structures." + */ + + +attribute vec4 a[2] +uniform int i; + +void main() +{ + gl_Position = a[i]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert new file mode 100644 index 00000000..cb059a8d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-implicit-size.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "If an array is indexed with an expression that is not an integral + * constant expression, or if an array is passed as an argument to a + * function, then its size must be declared before any such use." + */ + + +/* Assume the array is sized in a different compilation unit. + */ +vec4 [] an_array; + +void main() +{ + gl_Position = an_array[2]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert new file mode 100644 index 00000000..57adef39 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-negative.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is also illegal to index an array with a negative constant + * expression." + */ + + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = an_array[-1]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert new file mode 100644 index 00000000..edd6dd02 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-constant-index-too-large.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is illegal to declare an array with a size, and then later (in the + * same shader) index the same array with an integral constant expression + * greater than or equal to the declared size." + */ + + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = an_array[6]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert new file mode 100644 index 00000000..b9897b04 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bool a[2]; + +void main() +{ + float b[2] = float[](a[0], a[1]); + + gl_Position = vec4(b[0]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-int.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-int.vert new file mode 100644 index 00000000..6756e5df --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-int.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bool a[2]; + +void main() +{ + int b[2] = int[](a[0], a[1]); + + gl_Position = vec4(b[0]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-ivec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-ivec2.vert new file mode 100644 index 00000000..e6acb50a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-ivec2.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bvec2 a[2]; + +void main() +{ + ivec2 b[2] = ivec2[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-vec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-vec2.vert new file mode 100644 index 00000000..8c7547af --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec2-vec2.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bvec2 a[2]; + +void main() +{ + vec2 b[2] = vec2[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-ivec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-ivec3.vert new file mode 100644 index 00000000..c35b80ca --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-ivec3.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bvec3 a[2]; + +void main() +{ + ivec3 b[2] = ivec3[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-vec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-vec3.vert new file mode 100644 index 00000000..f30cda7f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec3-vec3.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bvec3 a[2]; + +void main() +{ + vec3 b[2] = vec3[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-ivec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-ivec4.vert new file mode 100644 index 00000000..dca751bd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-ivec4.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bvec4 a[2]; + +void main() +{ + ivec4 b[2] = ivec4[](a[0], a[1]); + + gl_Position = vec4(b[0]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-vec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-vec4.vert new file mode 100644 index 00000000..d518d646 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec4-vec4.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform bvec4 a[2]; + +void main() +{ + vec4 b[2] = vec4[](a[0], a[1]); + + gl_Position = b[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-bool.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-bool.vert new file mode 100644 index 00000000..908b60ea --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-bool.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform float a[2]; + +void main() +{ + bool b[2] = bool[](a[0], a[0]); + + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-int.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-int.vert new file mode 100644 index 00000000..b1930b28 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-float-int.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform float a[2]; + +void main() +{ + int b[2] = int[](a[0], a[0]); + + gl_Position = vec4(b[0], b[0], b[1], b[1]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-bool.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-bool.vert new file mode 100644 index 00000000..1431ea07 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-bool.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform int a[2]; + +void main() +{ + bool b[2] = bool[](a[0], a[1]); + + gl_Position = vec4(b[0]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-float.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-float.vert new file mode 100644 index 00000000..be076126 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-int-float.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform int a[2]; + +void main() +{ + float b[2] = float[](a[0], a[1]); + + gl_Position = vec4(b[0]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-bvec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-bvec2.vert new file mode 100644 index 00000000..cdb1b7be --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-bvec2.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform ivec2 a[2]; + +void main() +{ + bvec2 b[2] = bvec2[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-vec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-vec2.vert new file mode 100644 index 00000000..027577f3 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec2-vec2.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform ivec2 a[2]; + +void main() +{ + vec2 b[2] = vec2[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-bvec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-bvec3.vert new file mode 100644 index 00000000..20fc85b6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-bvec3.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform ivec3 a[2]; + +void main() +{ + bvec3 b[2] = bvec3[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-vec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-vec3.vert new file mode 100644 index 00000000..0653d3c2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec3-vec3.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform ivec3 a[2]; + +void main() +{ + vec3 b[2] = vec3[](a[0], a[1]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-bvec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-bvec4.vert new file mode 100644 index 00000000..81a012ef --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-bvec4.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform ivec4 a[2]; + +void main() +{ + bvec4 b[2] = bvec4[](a[0], a[1]); + + gl_Position = vec4(b[0]); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-vec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-vec4.vert new file mode 100644 index 00000000..a61446e2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-ivec4-vec4.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform ivec4 a[2]; + +void main() +{ + vec4 b[2] = vec4[](a[0], a[1]); + + gl_Position = b[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert new file mode 100644 index 00000000..374b80bd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform vec2 a[2]; + +void main() +{ + bvec2 b[2] = bvec2[](a[0], a[0]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-ivec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-ivec2.vert new file mode 100644 index 00000000..9d102d7a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-ivec2.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform vec2 a[2]; + +void main() +{ + ivec2 b[2] = ivec2[](a[0], a[0]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-bvec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-bvec3.vert new file mode 100644 index 00000000..991471d6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-bvec3.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform vec3 a[2]; + +void main() +{ + bvec3 b[2] = bvec3[](a[0], a[0]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-ivec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-ivec3.vert new file mode 100644 index 00000000..2a62ea71 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec3-ivec3.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform vec3 a[2]; + +void main() +{ + ivec3 b[2] = ivec3[](a[0], a[0]); + + gl_Position = vec4(b[0].x, b[0].y, b[1].x, b[1].y); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-bvec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-bvec4.vert new file mode 100644 index 00000000..90efda56 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-bvec4.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform vec4 a[2]; + +void main() +{ + bvec4 b[2] = bvec4[](a[0], a[0]); + + gl_Position = vec4(b[0].x, b[0].y, b[0].z, b[0].w); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-ivec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-ivec4.vert new file mode 100644 index 00000000..513f9022 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec4-ivec4.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "In some situations, an expression and its type will be implicitly + * converted to a different type. The following table shows all allowed + * implicit conversions: + * + * Type of expression Can be implicitly converted to + * int float + * ivec2 vec2 + * ivec3 vec3 + * ivec4 vec4 + * + * There are no implicit array or structure conversions. For example, an + * array of int cannot be implicitly converted to an array of float. When + * an implicit conversion is done, it is not just a re-interpretation of + * the expression's value, but a conversion of that value to an equivalent + * value in the new type. For example, the integer value 5 will be + * converted to the floating-point value 5.0. The conversions in the + * table above are done only as indicated by other sections of this + * specification." + */ + + +uniform vec4 a[2]; + +void main() +{ + ivec4 b[2] = ivec4[](a[0], a[0]); + + gl_Position = vec4(b[0].x, b[0].y, b[0].z, b[0].w); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert new file mode 100644 index 00000000..fd78eed7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-mismatched-size.vert @@ -0,0 +1,16 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 33 (page 39 of the PDF) of the GLSL 1.20 spec: + * + * "There must be exactly the same number of arguments as the size of the + * array being constructed." + */ + + +vec4 a[] = vec4[2](vec4(0.0), vec4(1.0), vec4(2.0)); + +void main() { gl_Position = a[0]; } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor.vert new file mode 100644 index 00000000..ec0ff82a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "Arrays can have initializers formed from array constructors:" + */ + + +vec4 a[2] = vec4[2](vec4(0.0), vec4(2.0)); +vec4 b[2] = vec4[ ](vec4(0.5), vec4(2.0)); +vec4 c[ ] = vec4[ ](vec4(1.0), vec4(2.0)); + +void main() { gl_Position = a[0] + b[0] + 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 00000000..14144c46 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert @@ -0,0 +1,26 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-equal-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-implicit-size.vert new file mode 100644 index 00000000..39b32e62 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-implicit-size.vert @@ -0,0 +1,28 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[]; + + // Implicitly size c to match a and b. + c[0] = b[0]; + c[1] = b[1]; + + gl_Position = vec4(a == c); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert new file mode 100644 index 00000000..d1076632 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-matrix.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[4]; +uniform mat4 b; + +void main() +{ + gl_Position = vec4(a == b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert new file mode 100644 index 00000000..214dcfa5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-base-type.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[2]; +uniform vec3 b[2]; // Note the differing base type + +void main() +{ + gl_Position = vec4(a == b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert new file mode 100644 index 00000000..025de07c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-mismatched-size.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[2]; +uniform vec4 b[3]; // Note the differing size + +void main() +{ + gl_Position = vec4(a == b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-vector.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-vector.vert new file mode 100644 index 00000000..a9808810 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal-vector.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform float a[4]; +uniform vec4 b; + +void main() +{ + gl_Position = vec4(a == b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal.vert new file mode 100644 index 00000000..a6ee2822 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-equal.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +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-function-parameter-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert new file mode 100644 index 00000000..e9a065e2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-implicit-size.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "If an array is indexed with an expression that is not an integral + * constant expression, or if an array is passed as an argument to a + * function, then its size must be declared before any such use." + */ + + +float a_function(vec4[6]); + +void main() +{ + vec4 [] an_array; + + an_array[0] = vec4(0); + an_array[1] = vec4(1); + an_array[2] = vec4(2); + an_array[3] = vec4(3); + an_array[4] = vec4(4); + an_array[5] = vec4(5); + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert new file mode 100644 index 00000000..b8135ca7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-parameter-unsized.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Arrays declared as formal parameters in a function declaration + * must specify a size." + */ + + +vec4 a_function(vec4 [] p); + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = a_function(an_array); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert new file mode 100644 index 00000000..9acba275 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return-unsized.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "This type can be used anywhere any other type can be used, including + * as the return value from a function + * + * float[5] foo() { } + * + * as a constructor of an array + * + * float[5](3.4, 4.2, 5.0, 5.2, 1.1) + * + * as an unnamed parameter + * + * void foo(float[5])" + */ + + +vec4[] a_function(vec4 [6] p); + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = a_function(an_array)[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert new file mode 100644 index 00000000..cc58f9fb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-function-return.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "This type can be used anywhere any other type can be used, including + * as the return value from a function + * + * float[5] foo() { } + * + * as a constructor of an array + * + * float[5](3.4, 4.2, 5.0, 5.2, 1.1) + * + * as an unnamed parameter + * + * void foo(float[5])" + */ + + +vec4[2] a_function(vec4 [6]); + +uniform vec4 [6] an_array; + +void main() +{ + gl_Position = a_function(an_array)[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 00000000..464208cc --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..fbc3019d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-length-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-implicit-size.vert new file mode 100644 index 00000000..b5bafa75 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-implicit-size.vert @@ -0,0 +1,21 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "The length method cannot be called on an array that has not been + * explicitly sized." + */ + + +void main() +{ + float b[]; + + b[2] = 1.0; // Implicitly size array to have at least 3 elements + + gl_Position = vec4(b.length()); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-with-argument.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-with-argument.vert new file mode 100644 index 00000000..2096ae5c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length-with-argument.vert @@ -0,0 +1,14 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + */ + + +uniform vec4 a[2]; + +void main() +{ + gl_Position = vec4(a.length(5)); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length.vert new file mode 100644 index 00000000..3399b199 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-length.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec: + * + * "Arrays know the number of elements they contain. This can be obtained + * by using the length method: + * + * a.length(); // returns 5 for the above declarations + * + * The length method cannot be called on an array that has not been + * explicitly sized." + */ + + +uniform vec4 a[2]; + +void main() +{ + gl_Position = vec4(a.length()); +} 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 00000000..803d539f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..2f54c746 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..f14211a9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..85800965 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..fd22520a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..64ebe544 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-multidimensional-new-syntax.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert new file mode 100644 index 00000000..7e113883 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +uniform vec4 [1] an_array[1]; + +void main() +{ + gl_Position = an_array[0][0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert new file mode 100644 index 00000000..984d29c9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +uniform vec4 an_array[1][1]; + +void main() +{ + gl_Position = an_array[0][0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert new file mode 100644 index 00000000..1c33f777 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert @@ -0,0 +1,26 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-negate.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert new file mode 100644 index 00000000..567b3d35 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-not-equal-implicit-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert new file mode 100644 index 00000000..4f522e36 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert @@ -0,0 +1,28 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[2]; +uniform vec4 b[2]; + +void main() +{ + vec4 c[]; + + // Implicitly size c to match a and b. + c[0] = b[0]; + c[1] = b[2]; + + gl_Position = vec4(a != c); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert new file mode 100644 index 00000000..88bda2ae --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[4]; +uniform mat4 b; + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert new file mode 100644 index 00000000..fb771112 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[2]; +uniform vec3 b[2]; // Note the differing base type + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert new file mode 100644 index 00000000..b709902e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform vec4 a[2]; +uniform vec4 b[3]; // Note the differing size + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert new file mode 100644 index 00000000..e7a3f07f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +uniform float a[4]; +uniform vec4 b; + +void main() +{ + gl_Position = vec4(a != b); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert new file mode 100644 index 00000000..2e57da5e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "The equality operators and assignment operator are only allowed if the + * two operands are same size and type....Both array operands must be + * explicitly sized. When using the equality operators ... two arrays are + * equal if and only if all the elements are element-wise equal. + */ + + +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-of-any-type.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert new file mode 100644 index 00000000..4b16a87a --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-any-type.vert @@ -0,0 +1,44 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ + + +uniform float array01[1]; +uniform int array02[1]; +uniform bool array03[1]; +uniform vec2 array04[1]; +uniform vec3 array05[1]; +uniform vec4 array06[1]; +uniform ivec2 array07[1]; +uniform ivec3 array08[1]; +uniform ivec4 array09[1]; +uniform bvec2 array10[1]; +uniform bvec3 array11[1]; +uniform bvec4 array12[1]; +uniform mat2 array13[1]; +uniform mat2x2 array14[1]; +uniform mat2x3 array15[1]; +uniform mat2x4 array16[1]; +uniform mat3 array17[1]; +uniform mat3x2 array18[1]; +uniform mat3x3 array19[1]; +uniform mat3x4 array20[1]; +uniform mat4 array21[1]; +uniform mat4x2 array22[1]; +uniform mat4x3 array23[1]; +uniform mat4x4 array24[1]; +uniform sampler1D array25[1]; +uniform sampler2D array26[1]; +uniform sampler3D array27[1]; +uniform samplerCube array28[1]; +uniform sampler1DShadow array29[1]; +uniform sampler2DShadow array30[1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag new file mode 100644 index 00000000..b911f730 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.frag @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +attribute vec4 vert; + +void foo(vec4 [2] x[2]); + +void main() +{ + gl_FragData[0] = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.vert new file mode 100644 index 00000000..b32216cd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-declaration.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +attribute vec4 vert; + +void foo(vec4 [2] x[2]); + +void main() +{ + gl_Position = vert; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.frag b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.frag new file mode 100644 index 00000000..cc07075b --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.frag @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +attribute vec4 vert; + +void foo(vec4 [2] x[2]) +{ + gl_Position = vert; +} + +void main() +{ + gl_FragData[0] = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.vert new file mode 100644 index 00000000..6c12fda1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-function-parameter-definition.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +attribute vec4 vert; + +void foo(vec4 [2] x[2]) +{ + gl_Position = vert; +} + +void main() +{ + gl_Position = vert; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.frag b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.frag new file mode 100644 index 00000000..6eb9aebc --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.frag @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +attribute vec4 vert; + +struct S { + vec4 [2] x[2]; +}; + +void main() +{ + gl_FragData[0] = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.vert new file mode 100644 index 00000000..9b884f50 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-array-structure-field.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + + +attribute vec4 vert; + +struct S { + vec4 [2] x[2]; +}; + +void main() +{ + gl_Position = vert; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct-of-array.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct-of-array.vert new file mode 100644 index 00000000..1bf190d2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct-of-array.vert @@ -0,0 +1,28 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 18 (page 24 of the PDF) of the GLSL 1.20 spec: + * + * "Member declarators can contain arrays. Such arrays must have a size + * specified, and the size must be an integral constant expression that's + * greater than zero (see Section 4.3.3 "Constant Expressions")." + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ + + +struct s { + float x[3]; + int y; +}; + +void main() +{ + s a[2]; + gl_Position = vec4(a.length() + a.x.length()); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct.vert new file mode 100644 index 00000000..077f18cd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-of-struct.vert @@ -0,0 +1,22 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ + + +struct s { + float x; + int y; +}; + +void main() +{ + s a[2]; + gl_Position = vec4(a.length()); +} 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 00000000..b1ff7e4e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..37b9ac6f --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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 00000000..16d096ad --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-predecrement.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-predecrement.vert new file mode 100644 index 00000000..c9e221f4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-predecrement.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-preincrement.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-preincrement.vert new file mode 100644 index 00000000..dba841e1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-preincrement.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-redeclaration-01.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-01.vert new file mode 100644 index 00000000..1bc0ebff --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-01.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ + + +float a_function(vec4[6]); + +void main() +{ + vec4 [] an_array; + + an_array[0] = vec4(0); + an_array[1] = vec4(1); + an_array[2] = vec4(2); + an_array[3] = vec4(3); + an_array[4] = vec4(4); + an_array[5] = vec4(5); + + vec4 [6] an_array; + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-initializer.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-initializer.vert new file mode 100644 index 00000000..d0b86dcd --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-initializer.vert @@ -0,0 +1,28 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ + + +float a_function(float[3]); + +void main() +{ + float [] an_array; + + an_array[0] = 0.0; + an_array[1] = 1.0; + an_array[2] = 2.0; + + float [] an_array = float[](2.0, 1.0, 0.0); + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-too-small.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-too-small.vert new file mode 100644 index 00000000..970a250c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-too-small.vert @@ -0,0 +1,28 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ + + +float a_function(float[2]); + +void main() +{ + float [] an_array; + + an_array[0] = 0.0; + an_array[1] = 1.0; + an_array[2] = 2.0; + + float [2] an_array; + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-wrong-base-type.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-wrong-base-type.vert new file mode 100644 index 00000000..2998e4d2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-redeclaration-wrong-base-type.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ + + +float a_function(float[3]); +float a_function(vec4[3]); + +void main() +{ + float [] an_array; + + an_array[0] = 0.0; + an_array[1] = 1.0; + an_array[2] = 2.0; + + vec4 [3] an_array; + + gl_Position = vec4(a_function(an_array)); +} 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 00000000..dc3fe359 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 38 (page 44 of the PDF) of the GLSL 1.20 spec: + * + * "The ternary selection operator (?:). It operates on three expressions + * (exp1 ? exp2 : exp3)....The second and third expressions can be any + * type, as long their types match....This resulting matching type is + * the type of the entire expression." + */ + + +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 00000000..bf6a96d5 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert @@ -0,0 +1,25 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-shadow-redeclaration.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert new file mode 100644 index 00000000..f691fd8d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 21 (page 27 of the PDF) of the GLSL 1.20 spec: + * + * "An implicitly sized array can be re-declared in the same scope + * as an array of the same base type." + */ + + +attribute vec4 v; + +void main() +{ + float a[]; + + a[3] = 1.2; // Implicitly size "a" to have 4 elements. + + { + float a[4]; // this declaration shadows the previous + } + + a.length(); // illegal - "a' is not explicitly sized + + gl_Position = v; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert new file mode 100644 index 00000000..223ae49c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bool.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [true] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert new file mode 100644 index 00000000..bff5c946 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec2.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [bvec2(true, false)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert new file mode 100644 index 00000000..b17b2975 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec3.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [bvec3(true, true, false)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert new file mode 100644 index 00000000..00d28447 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-bvec4.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [bvec4(true, true, false, false)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert new file mode 100644 index 00000000..8a9324a6 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-cast.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +const float size = 3.14159; +uniform vec4 [int(size)] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert new file mode 100644 index 00000000..2fca80b8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-constant-relational.vert @@ -0,0 +1,162 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +const vec4 v4_1 = vec4(1); +const vec4 v4_0 = v4_1 - v4_1; +const vec3 v3_1 = vec3(1); +const vec3 v3_0 = v3_1 - v3_1; +const vec2 v2_1 = vec2(1); +const vec2 v2_0 = v2_1 - v2_1; + +const ivec4 iv4_1 = ivec4(1); +const ivec4 iv4_0 = iv4_1 - iv4_1; +const ivec3 iv3_1 = ivec3(1); +const ivec3 iv3_0 = iv3_1 - iv3_1; +const ivec2 iv2_1 = ivec2(1); +const ivec2 iv2_0 = iv2_1 - iv2_1; + +const bvec4 bv4_1 = bvec4(true); +const bvec4 bv4_0 = not(bv4_1); +const bvec3 bv3_1 = bvec3(true); +const bvec3 bv3_0 = not(bv3_1); +const bvec2 bv2_1 = bvec2(true); +const bvec2 bv2_0 = not(bv2_1); + +// All forms of lessThan. +float [all( lessThan( v4_1, v4_0) ) ? -1 : 1] array01; +float [all(not(lessThan( v4_1, v4_0))) ? 1 : -1] array02; +float [any( lessThan( v4_1, v4_0) ) ? -1 : 1] array03; +float [any(not(lessThan( v4_1, v4_0))) ? 1 : -1] array04; +float [all( lessThan(iv4_1, iv4_0) ) ? -1 : 1] array05; +float [all(not(lessThan(iv4_1, iv4_0))) ? 1 : -1] array06; +float [any( lessThan(iv4_1, iv4_0) ) ? -1 : 1] array07; +float [any(not(lessThan(iv4_1, iv4_0))) ? 1 : -1] array08; + +// All forms of lessThanEqual. +float [all( lessThanEqual( v4_1, v4_0) ) ? -1 : 1] array11; +float [all(not(lessThanEqual( v4_1, v4_0))) ? 1 : -1] array12; +float [any( lessThanEqual( v4_1, v4_0) ) ? -1 : 1] array13; +float [any(not(lessThanEqual( v4_1, v4_0))) ? 1 : -1] array14; +float [all( lessThanEqual(iv4_1, iv4_0) ) ? -1 : 1] array15; +float [all(not(lessThanEqual(iv4_1, iv4_0))) ? 1 : -1] array16; +float [any( lessThanEqual(iv4_1, iv4_0) ) ? -1 : 1] array17; +float [any(not(lessThanEqual(iv4_1, iv4_0))) ? 1 : -1] array18; + +// All forms of greaterThan. +float [all( greaterThan( v4_1, v4_0) ) ? 1 : -1] array21; +float [all(not(greaterThan( v4_1, v4_0))) ? -1 : 1] array22; +float [any( greaterThan( v4_1, v4_0) ) ? 1 : -1] array23; +float [any(not(greaterThan( v4_1, v4_0))) ? -1 : 1] array24; +float [all( greaterThan(iv4_1, iv4_0) ) ? 1 : -1] array25; +float [all(not(greaterThan(iv4_1, iv4_0))) ? -1 : 1] array26; +float [any( greaterThan(iv4_1, iv4_0) ) ? 1 : -1] array27; +float [any(not(greaterThan(iv4_1, iv4_0))) ? -1 : 1] array28; + +// All forms of greaterThanEqual. +float [all( greaterThanEqual( v4_1, v4_0) ) ? 1 : -1] array31; +float [all(not(greaterThanEqual( v4_1, v4_0))) ? -1 : 1] array32; +float [any( greaterThanEqual( v4_1, v4_0) ) ? 1 : -1] array33; +float [any(not(greaterThanEqual( v4_1, v4_0))) ? -1 : 1] array34; +float [all( greaterThanEqual(iv4_1, iv4_0) ) ? 1 : -1] array35; +float [all(not(greaterThanEqual(iv4_1, iv4_0))) ? -1 : 1] array36; +float [any( greaterThanEqual(iv4_1, iv4_0) ) ? 1 : -1] array37; +float [any(not(greaterThanEqual(iv4_1, iv4_0))) ? -1 : 1] array38; + +// All forms of equal. +float [all( equal( v4_1, v4_0) ) ? -1 : 1] array41; +float [all(not(equal( v4_1, v4_0))) ? 1 : -1] array42; +float [any( equal( v4_1, v4_0) ) ? -1 : 1] array43; +float [any(not(equal( v4_1, v4_0))) ? 1 : -1] array44; +float [all( equal(iv4_1, iv4_0) ) ? -1 : 1] array45; +float [all(not(equal(iv4_1, iv4_0))) ? 1 : -1] array46; +float [any( equal(iv4_1, iv4_0) ) ? -1 : 1] array47; +float [any(not(equal(iv4_1, iv4_0))) ? 1 : -1] array48; +float [all( equal(bv4_1, bv4_0) ) ? -1 : 1] array49; +float [all(not(equal(bv4_1, bv4_0))) ? 1 : -1] array4a; +float [any( equal(bv4_1, bv4_0) ) ? -1 : 1] array4b; +float [any(not(equal(bv4_1, bv4_0))) ? 1 : -1] array4c; + +// All forms of notEqual. +float [all( notEqual( v4_1, v4_0) ) ? 1 : -1] array51; +float [all(not(notEqual( v4_1, v4_0))) ? -1 : 1] array52; +float [any( notEqual( v4_1, v4_0) ) ? 1 : -1] array53; +float [any(not(notEqual( v4_1, v4_0))) ? -1 : 1] array54; +float [all( notEqual(iv4_1, iv4_0) ) ? 1 : -1] array55; +float [all(not(notEqual(iv4_1, iv4_0))) ? -1 : 1] array56; +float [any( notEqual(iv4_1, iv4_0) ) ? 1 : -1] array57; +float [any(not(notEqual(iv4_1, iv4_0))) ? -1 : 1] array58; +float [all( notEqual(bv4_1, bv4_0) ) ? 1 : -1] array59; +float [all(not(notEqual(bv4_1, bv4_0))) ? -1 : 1] array5a; +float [any( notEqual(bv4_1, bv4_0) ) ? 1 : -1] array5b; +float [any(not(notEqual(bv4_1, bv4_0))) ? -1 : 1] array5c; + +void main() +{ + gl_Position = vec4(array01.length() + + array02.length() + + array03.length() + + array04.length() + + array05.length() + + array06.length() + + array07.length() + + array08.length() + + array11.length() + + array12.length() + + array13.length() + + array14.length() + + array15.length() + + array16.length() + + array17.length() + + array18.length() + + array21.length() + + array22.length() + + array23.length() + + array24.length() + + array25.length() + + array26.length() + + array27.length() + + array28.length() + + array31.length() + + array32.length() + + array33.length() + + array34.length() + + array35.length() + + array36.length() + + array37.length() + + array38.length() + + array41.length() + + array42.length() + + array43.length() + + array44.length() + + array45.length() + + array46.length() + + array47.length() + + array48.length() + + array49.length() + + array4a.length() + + array4b.length() + + array4c.length() + + array51.length() + + array52.length() + + array53.length() + + array54.length() + + array55.length() + + array56.length() + + array57.length() + + array58.length() + + array59.length() + + array5a.length() + + array5b.length() + + array5c.length()); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert new file mode 100644 index 00000000..94a121f2 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-float.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [2.3] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert new file mode 100644 index 00000000..592c353d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-int.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [int(2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert new file mode 100644 index 00000000..d88e47d7 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec2.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [ivec2(2.3,2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert new file mode 100644 index 00000000..5bdaaf71 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec3.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [ivec3(2.3,2.3,2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert new file mode 100644 index 00000000..1a1a6ea9 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-ivec4.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [ivec4(2.3,2.3,2.3,2.3)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert new file mode 100644 index 00000000..f78465d8 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-length.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform vec4 [3] a; +uniform vec4 [a.length()] b; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert new file mode 100644 index 00000000..bd17dacb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-negative.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform vec4 [-1] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert new file mode 100644 index 00000000..99b7e1ba --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-non-builtin-function.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +int foo() { return 3; } + +uniform vec4 [foo()] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert new file mode 100644 index 00000000..baa377eb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-not-constant.vert @@ -0,0 +1,18 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform int size; +uniform vec4 [size] a; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert new file mode 100644 index 00000000..4ecc2c33 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-selection.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 38 (page 44 of the PDF) of the GLSL 1.20 spec: + * + * "The ternary selection operator (?:). It operates on three expressions + * (exp1 ? exp2 : exp3)....The second and third expressions can be any + * type, as long their types match....This resulting matching type is + * the type of the entire expression." + */ + + +const vec4[] a = vec4[](vec4(0), vec4(1)); +const vec4[] b = vec4[](vec4(1), vec4(0)); +uniform vec4 c[((true) ? a : b).length()]; + +void main() +{ + gl_Position = c[0]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert new file mode 100644 index 00000000..0f0b5789 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence-in-parenthesis.vert @@ -0,0 +1,33 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * The body of the GLSL spec is slient on this issue, but the grammar says: + * + * expression: + * assignment_expression + * expression COMMA assignment_expression + * + * constant_expression: + * conditional_expression + * + * ... + * + * init_declarator_list: + * single_declaration + * init_declarator_list COMMA IDENTIFIER + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer + * init_declarator_list COMMA IDENTIFIER EQUAL initializer + * + * This also matches C and C++. + */ + + +uniform float a[(5,3)]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert new file mode 100644 index 00000000..387161fb --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-sequence.vert @@ -0,0 +1,33 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * The body of the GLSL spec is slient on this issue, but the grammar says: + * + * expression: + * assignment_expression + * expression COMMA assignment_expression + * + * constant_expression: + * conditional_expression + * + * ... + * + * init_declarator_list: + * single_declaration + * init_declarator_list COMMA IDENTIFIER + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer + * init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer + * init_declarator_list COMMA IDENTIFIER EQUAL initializer + * + * This also matches C and C++. + */ + + +uniform float a[5,3]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert new file mode 100644 index 00000000..3712d4ee --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec2.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [vec2(2,2)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert new file mode 100644 index 00000000..7817ea00 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec3.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [vec3(2,2,2)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert new file mode 100644 index 00000000..39edae0c --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-vec4.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform float [vec4(2,2,2,2)] a; + +void main() { gl_Position = vec4(a[0]); } diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert new file mode 100644 index 00000000..426e3a63 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-with-side-effect.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +void main() +{ + int x; + vec4[(x = 3)] a; + gl_Position = vec4(0.0); +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert new file mode 100644 index 00000000..547d4c14 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-size-zero.vert @@ -0,0 +1,17 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "When an array size is specified in a declaration, it must be an + * integral constant expression (see Section 4.3.3 "Constant Expressions") + * greater than zero." + */ + + +uniform vec4 [0] a; + +void main() { gl_Position = vec4(0.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 00000000..776325a1 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert @@ -0,0 +1,26 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec: + * + * "In total, only the following operators are allowed to operate on + * arrays and structures as whole entities: + * + * field or method selector . + * equality == != + * assignment = + * indexing (arrays only) []" + */ + + +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-variable-index-implicit-size-global.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-global.vert new file mode 100644 index 00000000..e4527b16 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-global.vert @@ -0,0 +1,24 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "If an array is indexed with an expression that is not an integral + * constant expression, or if an array is passed as an argument to a + * function, then its size must be declared before any such use." + */ + + +/* Assume the array is sized in a different compilation unit. + */ +vec4 [] an_array; + +uniform int i; + +void main() +{ + gl_Position = an_array[i]; +} diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-local.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-local.vert new file mode 100644 index 00000000..2269c49e --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-variable-index-implicit-size-local.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * glsles_version: 1.00 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "If an array is indexed with an expression that is not an integral + * constant expression, or if an array is passed as an argument to a + * function, then its size must be declared before any such use." + */ + + +attribute vec4 a; +attribute vec4 b; + +uniform int i; + +void main() +{ + vec4 [] an_array; + + an_array[0] = a; + an_array[1] = vec4(0); + an_array[2] = b; + + gl_Position = an_array[i]; +} -- cgit v1.2.3