[Piglit] [PATCH 3/4] Test uniform block array indices must be integral constant expressions.
Nicholas Mack
nichmack at gmail.com
Mon Jul 29 15:25:12 PDT 2013
Section 4.3.7(Interface Blocks) of the GLSL 1.50 spec says:
"All indexes used to index a uniform block array must be constant
integral expressions."
---
...e-name-array-access-with-nonconstant-index.vert | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 tests/spec/glsl-1.50/compiler/uniform_block/interface-name-array-access-with-nonconstant-index.vert
diff --git a/tests/spec/glsl-1.50/compiler/uniform_block/interface-name-array-access-with-nonconstant-index.vert b/tests/spec/glsl-1.50/compiler/uniform_block/interface-name-array-access-with-nonconstant-index.vert
new file mode 100644
index 0000000..1f751d9
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/uniform_block/interface-name-array-access-with-nonconstant-index.vert
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * [end config]
+ *
+ * Section 4.3.7(Interface Blocks) of the GLSL 1.50 spec says:
+ *
+ * "All indexes used to index a uniform block array must be constant
+ * integral expressions."
+ */
+#version 150
+
+uniform transform_data {
+ mat4 mvp;
+} camera[2];
+
+uniform int idx;
+
+in vec4 position;
+
+void main()
+{
+ gl_Position = camera[idx].mvp * position;
+}
--
1.8.3.1
More information about the Piglit
mailing list