[Piglit] [PATCH 1/4] link-struct-usage: New test for a bug in the GLSL compiler.
Eric Anholt
eric at anholt.net
Wed Sep 7 12:24:49 PDT 2011
We were assertion failing during validation after doing structure
splitting on the unlinked shaders, because the two sides ended up not
talking about the same variable any more.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
tests/shaders/link-struct-usage.shader_test | 44 +++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
create mode 100644 tests/shaders/link-struct-usage.shader_test
diff --git a/tests/shaders/link-struct-usage.shader_test b/tests/shaders/link-struct-usage.shader_test
new file mode 100644
index 0000000..8c9fdf2
--- /dev/null
+++ b/tests/shaders/link-struct-usage.shader_test
@@ -0,0 +1,44 @@
+[require]
+
+[vertex shader]
+varying vec4 color;
+struct S {
+ vec4 v;
+};
+void func();
+
+S a;
+
+void main()
+{
+ gl_Position = gl_Vertex;
+
+ a.v = vec4(0.0);
+
+ func();
+
+ color = a.v;
+}
+
+[vertex shader]
+struct S {
+ vec4 v;
+};
+
+S a;
+
+void func()
+{
+ a.v += vec4(0.0, 1.0, 0.0, 0.0);
+}
+
+[fragment shader]
+varying vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
--
1.7.5.4
More information about the Piglit
mailing list