From: Ian Romanick <[email protected]> It was just impractical to generate these tests using scripts, so they are hand-written.
Signed-off-by: Ian Romanick <[email protected]> --- .../uniform-initializer/fs-structure.shader_test | 44 ++++++++++++++++++++ .../uniform-initializer/vs-structure.shader_test | 42 +++++++++++++++++++ 2 files changed, 86 insertions(+), 0 deletions(-) create mode 100644 tests/spec/glsl-1.20/execution/uniform-initializer/fs-structure.shader_test create mode 100644 tests/spec/glsl-1.20/execution/uniform-initializer/vs-structure.shader_test diff --git a/tests/spec/glsl-1.20/execution/uniform-initializer/fs-structure.shader_test b/tests/spec/glsl-1.20/execution/uniform-initializer/fs-structure.shader_test new file mode 100644 index 0000000..3b0c950 --- /dev/null +++ b/tests/spec/glsl-1.20/execution/uniform-initializer/fs-structure.shader_test @@ -0,0 +1,44 @@ +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +void main() +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +varying vec4 color; + +struct S { + int i; + float f; + vec4 v[2]; +}; + +uniform S s = S(9, 33.3, vec4[2](vec4(1, 2, 3, 4), + vec4(9, 8, 7, 6))); + +void main() +{ + vec4 color; + + if (s.i == 9 + && s.f == 33.3 + && s.v[0] == vec4(1, 2, 3, 4) + && s.v[1] == vec4(9, 8, 7, 6)) { + color = vec4(0, 1, 0, 1); + } else { + color = vec4(1, 0, 0, 1); + } + + + gl_FragColor = color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0 1 0 diff --git a/tests/spec/glsl-1.20/execution/uniform-initializer/vs-structure.shader_test b/tests/spec/glsl-1.20/execution/uniform-initializer/vs-structure.shader_test new file mode 100644 index 0000000..f2fa32d --- /dev/null +++ b/tests/spec/glsl-1.20/execution/uniform-initializer/vs-structure.shader_test @@ -0,0 +1,42 @@ +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +struct S { + int i; + float f; + vec4 v[2]; +}; + +uniform S s = S(9, 33.3, vec4[2](vec4(1, 2, 3, 4), + vec4(9, 8, 7, 6))); +varying vec4 color; + +void main() +{ + if (s.i == 9 + && s.f == 33.3 + && s.v[0] == vec4(1, 2, 3, 4) + && s.v[1] == vec4(9, 8, 7, 6)) { + color = vec4(0, 1, 0, 1); + } else { + color = vec4(1, 0, 0, 1); + } + + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 +varying vec4 color; + +void main() +{ + gl_FragColor = color; +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 0 1 0 -- 1.7.6.5 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
