summaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-3.00/compiler/array-length-is-constant.vert
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/glsl-es-3.00/compiler/array-length-is-constant.vert')
-rw-r--r--tests/spec/glsl-es-3.00/compiler/array-length-is-constant.vert28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-3.00/compiler/array-length-is-constant.vert b/tests/spec/glsl-es-3.00/compiler/array-length-is-constant.vert
new file mode 100644
index 00000000..7569270a
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/array-length-is-constant.vert
@@ -0,0 +1,28 @@
+#version 300 es
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Page 35 of the OpenGL ES Shading Language 3.00 spec says:
+ *
+ * "Arrays have a fixed number of elements. This can be obtained
+ * by using the length method:
+ *
+ * a.length();
+ * // returns 5 for the above declarations
+ *
+ * The return value is a constant signed integral expression. The
+ * precision is determined using the same rules as for literal
+ * integers."
+ */
+
+uniform vec4 a[7];
+uniform vec4 b[a.length()];
+uniform int i;
+
+void main()
+{
+ gl_Position = a[i] + b[i];
+}