[Piglit] [PATCH] arb_uniform_buffer_object: test indirect access of array of structs

Nicolai Hähnle nhaehnle at gmail.com
Thu Oct 13 07:38:08 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

This currently fails in st_glsl_to_tgsi because it does not handle the struct
members y and zw correctly. This case is not covered by the random UBO test
generator, because the failure is only triggered by indirect access to the
array.
---
 ...fs-array-of-structs-std140-indirect.shader_test | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 tests/spec/arb_uniform_buffer_object/execution/fs-array-of-structs-std140-indirect.shader_test

diff --git a/tests/spec/arb_uniform_buffer_object/execution/fs-array-of-structs-std140-indirect.shader_test b/tests/spec/arb_uniform_buffer_object/execution/fs-array-of-structs-std140-indirect.shader_test
new file mode 100644
index 0000000..e327a6f
--- /dev/null
+++ b/tests/spec/arb_uniform_buffer_object/execution/fs-array-of-structs-std140-indirect.shader_test
@@ -0,0 +1,46 @@
+# Test indirect access of an array of structs, where struct members are not
+# vec4-aligned.
+
+[require]
+GLSL >= 1.30
+GL_ARB_uniform_buffer_object
+
+[vertex shader passthrough]
+
+[fragment shader]
+#extension GL_ARB_uniform_buffer_object: require
+
+struct S {
+    float x;
+    float y;
+    vec2 zw;
+};
+
+layout(std140) uniform Block {
+    S s[2];
+};
+
+uniform int idx;
+
+out vec4 outcolor;
+
+void main()
+{
+    outcolor = vec4(s[idx].x, s[idx].y, s[idx].zw.x, s[idx].zw.y);
+}
+
+[test]
+uniform vec2 s[0].x 0.1
+uniform vec2 s[0].y 0.2
+uniform vec2 s[0].zw 0.3 0.4
+uniform vec2 s[1].x 0.5
+uniform vec2 s[1].y 0.6
+uniform vec2 s[1].zw 0.7 0.8
+
+uniform int idx 0
+draw rect -1 -1 2 2
+probe all rgba 0.1 0.2 0.3 0.4
+
+uniform int idx 1
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.6 0.7 0.8
-- 
2.7.4



More information about the Piglit mailing list