diff options
author | Fabian Bieler <fabianbieler@fastmail.fm> | 2017-11-22 00:08:04 +0100 |
---|---|---|
committer | Fabian Bieler <fabianbieler@fastmail.fm> | 2017-12-02 19:33:58 +0100 |
commit | afe4e4c693a59516afd4b96ae1d50d5703e7a08a (patch) | |
tree | e3bb2fd6d4ca85b235a3ce932a3c8254dbd315ea | |
parent | 44d87f8807b645e2a9c2ed63e1c8de778306c75d (diff) |
Port struct glsl test from Glean to Piglit.
4 files changed, 96 insertions, 0 deletions
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 000000000..4c5347624 --- /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 000000000..a8a2fda27 --- /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 000000000..de442b81d --- /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 000000000..07f732782 --- /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) |