[Piglit] [PATCH] tests/glslparsertest/glsl2: Unsigned array index test

tiffany tiffany at stormbit.net
Wed Sep 3 11:22:04 PDT 2014


This test corresponds with commit 7f61ab2f20633443834ff8e832892d5c4cc1c675, which fixes an assertion in Mesa when indexing an array can cause a failure under certain circumstances.
---
 tests/glslparsertest/glsl2/array-index.frag | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 tests/glslparsertest/glsl2/array-index.frag

diff --git a/tests/glslparsertest/glsl2/array-index.frag b/tests/glslparsertest/glsl2/array-index.frag
new file mode 100644
index 0000000..41af438
--- /dev/null
+++ b/tests/glslparsertest/glsl2/array-index.frag
@@ -0,0 +1,19 @@
+/* From page 44 (page 50 of the PDF) of the GLSL 1.30 spec:
+ *
+ *    "Array elements are accessed using an expression whose type is int or uint."
+ *
+ * [config]
+ * expect_result: pass
+ * glsl_version: 1.30
+ * [end config]
+ */
+#version 130
+flat in uint i;
+out vec4 color;
+
+const float a[4] = float[4](0.0, 1.0, 2.0, 3.0);
+
+void main()
+{
+	color = vec4(a[i]);
+}
-- 
2.1.0



More information about the Piglit mailing list