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