aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert')
-rw-r--r--tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-ctor-implicit-conversion-vec2-bvec2.vert37
1 files changed, 37 insertions, 0 deletions
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);
+}