[Piglit] [PATCH 1/2] glsl-vs-arrays-rw: New test for temporary read-write indirection.

Jose Fonseca jfonseca at vmware.com
Tue Jul 14 07:34:47 PDT 2015


Similar to glsl-vs-arrays, but due to optimizations, glsl-vs-arrays
actually ends up doing indirection of the CONST registers, not TEMP.

VMWARE PR 1470667.
---
 tests/shaders/glsl-vs-arrays-rw.shader_test | 37 +++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 tests/shaders/glsl-vs-arrays-rw.shader_test

diff --git a/tests/shaders/glsl-vs-arrays-rw.shader_test b/tests/shaders/glsl-vs-arrays-rw.shader_test
new file mode 100644
index 0000000..1009388
--- /dev/null
+++ b/tests/shaders/glsl-vs-arrays-rw.shader_test
@@ -0,0 +1,37 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+/* VS array access (read-write) from temps using a varying
+ * array indices.
+ */
+uniform float one;
+uniform int writeIndex;
+uniform int readIndex;
+varying vec4 color;
+void main()
+{
+	vec4 colors[4];
+	colors[0] = vec4(0.0, 0.0, 0.0, 0.0);
+	colors[1] = vec4(0.0, 0.0, 0.0, 0.0);
+	colors[2] = vec4(0.0, 0.0, 0.0, 0.0);
+	colors[3] = vec4(0.0, 0.0, 0.0, 0.0);
+
+	gl_Position = gl_Vertex;
+
+	colors[writeIndex] = vec4(1.0, 1.0, 1.0, 1.0);
+	color = colors[readIndex];
+}
+
+[fragment shader]
+varying vec4 color;
+void main()
+{
+	gl_FragColor = color;
+}
+
+[test]
+uniform int readIndex 0.0
+uniform int writeIndex 0.0
+draw rect -1 -1 2 2
+relative probe rgb (0.0, 0.0) (1.0, 1.0, 1.0, 1.0)
-- 
2.1.4



More information about the Piglit mailing list