From 93c2604a3437dbc40a972bdb479ee9b86c1caebb Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 19 Jul 2014 14:56:21 +1000 Subject: [PATCH] glsl-1.20: Test union alignment is correct in struct that has an array of structs --- .../uniform_buffer/vs-struct-pad-array.shader_test | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad-array.shader_test diff --git a/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad-array.shader_test b/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad-array.shader_test new file mode 100644 index 0000000..0037595 --- /dev/null +++ b/tests/spec/glsl-1.40/uniform_buffer/vs-struct-pad-array.shader_test @@ -0,0 +1,51 @@ +[require] +GLSL >= 1.40 + +[vertex shader] +#version 140 + +struct S1 { + float r; +}; + +struct S2 { + float g; + float b; + float a; +}; + +struct S { + S1 s1; + S2 s2[2]; +}; + +uniform ubo1 { + S s; +}; + +in vec4 piglit_vertex; +out vec4 v; + +void main() +{ + gl_Position = piglit_vertex; + v = vec4(s.s1.r, s.s2[1].g, s.s2[0].b, s.s2[0].a); +} + +[fragment shader] +#version 140 + +in vec4 v; + +void main() +{ + gl_FragColor = v; +} + +[test] +uniform float s.s1.r 0.0 +uniform float s.s2[1].g 1.0 +uniform float s.s2[0].b 0.0 +uniform float s.s2[0].a 0.0 +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 0.0 -- 1.9.3