[Piglit] [PATCH] add new indexing test with dynamic indexing of integer vector

Tapani Pälli tapani.palli at intel.com
Tue Apr 3 07:01:36 UTC 2018


Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105438
---
 tests/shaders/glsl-fs-vec4-indexing-8.shader_test | 24 +++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-vec4-indexing-8.shader_test

diff --git a/tests/shaders/glsl-fs-vec4-indexing-8.shader_test b/tests/shaders/glsl-fs-vec4-indexing-8.shader_test
new file mode 100644
index 000000000..ab01fa900
--- /dev/null
+++ b/tests/shaders/glsl-fs-vec4-indexing-8.shader_test
@@ -0,0 +1,24 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform float id;
+void main()
+{
+	ivec4 test = ivec4(0, 1, 0, 0);
+	vec4 test2 = vec4(0.0, 1.0, 0.0, 0.0);
+	int index = int(id);
+	float col = test2[test[index]];
+	gl_FragColor = vec4(col);
+}
+
+[test]
+uniform float id 1
+draw rect -1 -1 2 2
+probe rgb 1 1 1.0 1.0 1.0
-- 
2.14.3



More information about the Piglit mailing list