[Piglit] [PATCH] glsl-es-1.00: add linker test for dynamic sampler array indexing

Tapani Pälli tapani.palli at intel.com
Tue May 19 04:53:08 PDT 2015


This test verifies that when fix for 'sampler-array-index.frag' lands,
we still fail if program tries to do dynamic sampler array indexing.

Note, that currently this test does not pass with Mesa since shader
compilation fails, this will change when compiler changes land.

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../glsl-sampler-array-dynamic-index.shader_test     | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-sampler-array-dynamic-index.shader_test

diff --git a/tests/spec/glsl-es-1.00/linker/glsl-sampler-array-dynamic-index.shader_test b/tests/spec/glsl-es-1.00/linker/glsl-sampler-array-dynamic-index.shader_test
new file mode 100644
index 0000000..2838c65
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/linker/glsl-sampler-array-dynamic-index.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader passthrough]
+
+[fragment shader]
+uniform sampler2D array[2];
+uniform int index;
+void main()
+{
+        highp vec4 color;
+        for (int i = 0; i < 2; i++) {
+                color += texture2D(array[index], vec2(0.0));
+        }
+        gl_FragColor = color;
+}
+
+[test]
+link error
-- 
2.1.0



More information about the Piglit mailing list