[Piglit] [PATCH] Add a test for a uniform indexed by a swizzled vector

Jason Ekstrand jason at jlekstrand.net
Thu Aug 20 07:41:30 PDT 2015


This catches a bug in the i965 backend compiler where we were running a
pass (to split vectors up) that didn't know about indirects before we
lowered the indirects away.
---
 ...fs-uniform-indexed-by-swizzled-vec4.shader_test | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test

diff --git a/tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test b/tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test
new file mode 100644
index 0000000..ffe54c5
--- /dev/null
+++ b/tests/shaders/glsl-fs-uniform-indexed-by-swizzled-vec4.shader_test
@@ -0,0 +1,24 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform float f[2];
+uniform ivec4 s;
+
+void main()
+{
+   gl_FragColor = vec4(f[s.x], f[s.y], f[s.z], f[s.w]);
+}
+
+[test]
+uniform float f[0] 0.0
+uniform float f[1] 1.0
+uniform ivec4 s 0 1 0 1
+draw rect -1 -1 2 2
+probe rgb 1 1 0.0 1.0 0.0
-- 
2.4.3



More information about the Piglit mailing list