---
 .../glsl-1.10/execution/struct-array.shader_test   | 22 +++++++++++++++++
 .../struct-multiple-instances.shader_test          | 23 ++++++++++++++++++
 .../glsl-1.10/execution/struct-nested.shader_test  | 28 ++++++++++++++++++++++
 tests/spec/glsl-1.10/execution/struct.shader_test  | 23 ++++++++++++++++++
 4 files changed, 96 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/execution/struct-array.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/struct-multiple-instances.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/struct-nested.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/struct.shader_test

diff --git a/tests/spec/glsl-1.10/execution/struct-array.shader_test 
b/tests/spec/glsl-1.10/execution/struct-array.shader_test
new file mode 100644
index 0000000..4c53476
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/struct-array.shader_test
@@ -0,0 +1,22 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+struct s1 {
+  float f1;
+  vec4 v4;
+};
+
+void main()
+{
+       s1 a[2];
+       a[0].v4 = vec4(0.25, 0.5, 0.75, 1.0);
+       a[0].f1 = 0.0;
+       a[1] = a[0];
+       gl_FragColor = a[1].v4;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.5, 0.75, 1.0)
diff --git 
a/tests/spec/glsl-1.10/execution/struct-multiple-instances.shader_test 
b/tests/spec/glsl-1.10/execution/struct-multiple-instances.shader_test
new file mode 100644
index 0000000..a8a2fda
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/struct-multiple-instances.shader_test
@@ -0,0 +1,23 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+struct s1 {
+  float f1;
+  vec4 v4;
+};
+
+void main()
+{
+
+       s1 a, b;
+       a.v4 = vec4(0.25, 0.5, 0.75, 1.0);
+       a.f1 = 0.0;
+       b = a;
+       gl_FragColor = b.v4;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.5, 0.75, 1.0)
diff --git a/tests/spec/glsl-1.10/execution/struct-nested.shader_test 
b/tests/spec/glsl-1.10/execution/struct-nested.shader_test
new file mode 100644
index 0000000..de442b8
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/struct-nested.shader_test
@@ -0,0 +1,28 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+struct s1 {
+       float foo;
+       vec4 v4;
+};
+struct s2 {
+       float bar;
+       s1 s;
+       float baz;
+};
+
+void main()
+{
+       s2 a;
+       a.s.v4 = vec4(0.25, 0.5, 0.75, 1.0);
+       a.bar = 0.0;
+       a.baz = 0.0;
+       a.s.foo = 0.0;
+       gl_FragColor = a.s.v4;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.25, 0.5, 0.75, 1.0)
diff --git a/tests/spec/glsl-1.10/execution/struct.shader_test 
b/tests/spec/glsl-1.10/execution/struct.shader_test
new file mode 100644
index 0000000..07f7327
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/struct.shader_test
@@ -0,0 +1,23 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+struct s1 {
+  float f1;
+  vec4 v4;
+};
+
+void main()
+{
+       vec4 scale = vec4(0.5);
+       vec4 bias = vec4(0.1);
+       s1 a;
+       a.v4 = vec4(0.25, 0.5, 0.75, 1.0);
+       a.f1 = 0.0;
+       gl_FragColor = a.v4 * scale + bias;
+}
+
+
+[test]
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.225, 0.35, 0.475, 0.6)
-- 
2.7.4

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to