summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2015-03-27 08:49:01 +0200
committerTapani Pälli <tapani.palli@intel.com>2015-03-30 07:44:54 +0300
commitdb4d4a049aa2ab32581686e7d678e2f46f2ca23c (patch)
tree2f005984d6f8c68c7efc942b3fac3592af256fdf
parentb459cfe3b3857e5f70b010334fb76728fecc2a5b (diff)
glsl-es-1.00: add test for constant-index-expression indexing
v2: array size is 2, not 1 (Matt Turner) This test fails with current Mesa HEAD (6264348), see bug https://bugs.freedesktop.org/show_bug.cgi?id=84225. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag
new file mode 100644
index 000000000..9063fedea
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From "Appendix A" of the GLSL ES 1.00 spec:
+ *
+ * "GLSL ES 1.00 supports both arrays of samplers and arrays of
+ * structures which contain samplers. In both these cases, for
+ * ES 2.0, support for indexing with a constant-index-expression
+ * is mandated"
+ *
+ */
+#version 100
+uniform sampler2D array[2];
+
+void main()
+{
+ highp vec4 color;
+ for (int i = 0; i < 2; i++) {
+ color += texture2D(array[i], vec2(0.0));
+ }
+ gl_FragColor = color;
+}