diff options
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) |