summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-06-13 18:01:08 -0700
committerEric Anholt <eric@anholt.net>2013-10-08 14:25:01 -0700
commit03a35e87f09596385ee707d1a4c07dd8d529696c (patch)
treec67e50334ba9e6c67c6859bad72319b14b277d2c
parent1ca97e58d2ec86f207fe577985e4468cd5e681da (diff)
glsl-1.50: Port over basic UBO tests from glsl 1.40 VS to glsl 1.50 GS
All pass on i965 with the 3.2/1.50 overrides set. v2: Move struct declarations outside of the interface blocks to fit the new 1.50 requirement (noted by Fabian) Reviewed-by: Fabian Bieler <fabianbieler@fastmail.fm> (v1)
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-array-copy.shader_test64
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-basic.shader_test57
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-bools.shader_test63
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-float-array-const-index.shader_test60
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-float-array-variable-index.shader_test67
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-floats.shader_test63
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-mat4-row-major.shader_test57
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-mat4.shader_test57
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy-complicated.shader_test146
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy.shader_test68
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-struct-pad.shader_test76
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-struct.shader_test67
-rw-r--r--tests/spec/glsl-1.50/uniform_buffer/gs-two-members.shader_test59
13 files changed, 904 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-array-copy.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-array-copy.shader_test
new file mode 100644
index 000000000..5c5350472
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-array-copy.shader_test
@@ -0,0 +1,64 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform int j;
+uniform ubo1 {
+ vec4 colors[4];
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ vec4 temp[4] = colors;
+ temp[0] = vec4(1.0, 0.0, 0.0, 0.0);
+ v = temp[j];
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform int j 1
+uniform vec4 colors[0] 0.0 0.0 0.0 0.0
+uniform vec4 colors[1] 0.0 1.0 0.0 0.0
+uniform vec4 colors[2] 0.0 1.0 1.0 0.0
+uniform vec4 colors[3] 1.0 0.0 1.0 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-basic.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-basic.shader_test
new file mode 100644
index 000000000..4af0730b5
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-basic.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ vec4 color;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = color;
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform vec4 color 0.0 1.0 0.0 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-bools.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-bools.shader_test
new file mode 100644
index 000000000..221abe818
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-bools.shader_test
@@ -0,0 +1,63 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ bool r;
+ bool g;
+ bool b;
+ bool a;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = vec4(r, g, b, a);
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform int r 0
+uniform int g 1
+uniform int b 2
+uniform int a 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 1.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-float-array-const-index.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-float-array-const-index.shader_test
new file mode 100644
index 000000000..5506f68ae
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-float-array-const-index.shader_test
@@ -0,0 +1,60 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ float f[4];
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = vec4(f[0], f[1], f[2], f[3]);
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform float f[0] 0.0
+uniform float f[1] 1.0
+uniform float f[2] 0.0
+uniform float f[3] 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-float-array-variable-index.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-float-array-variable-index.shader_test
new file mode 100644
index 000000000..a3c6032c6
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-float-array-variable-index.shader_test
@@ -0,0 +1,67 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform int ri, gi, bi, ai;
+
+uniform ubo1 {
+ float f[4];
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = vec4(f[ri], f[gi], f[bi], f[ai]);
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform int ri 0
+uniform int gi 1
+uniform int bi 2
+uniform int ai 3
+
+uniform float f[0] 0.0
+uniform float f[1] 1.0
+uniform float f[2] 0.0
+uniform float f[3] 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-floats.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-floats.shader_test
new file mode 100644
index 000000000..02be6c67d
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-floats.shader_test
@@ -0,0 +1,63 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ float r;
+ float g;
+ float b;
+ float a;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = vec4(r, g, b, a);
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform float r 0.0
+uniform float g 1.0
+uniform float b 0.0
+uniform float a 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-mat4-row-major.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4-row-major.shader_test
new file mode 100644
index 000000000..7ee781324
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4-row-major.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ layout(row_major) mat4 m;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = m[0] + m[1] + m[2] + m[3];
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform mat4 m 0.25 0.0 0.0 0.0 0.0 0.0 0.75 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.5 0.75 1.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-mat4.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4.shader_test
new file mode 100644
index 000000000..d2e1c6132
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ mat4 m;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = m[0] + m[1] + m[2] + m[3];
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform mat4 m 0.25 0.0 0.0 0.0 0.0 0.0 0.75 0.0 0.0 0.5 0.0 0.0 0.0 0.0 0.0 1.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.5 0.75 1.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy-complicated.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy-complicated.shader_test
new file mode 100644
index 000000000..3d3a82a3c
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy-complicated.shader_test
@@ -0,0 +1,146 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+struct S2 {
+ vec2 v2;
+ mat2 m22[2];
+};
+
+struct S {
+ S2 arr[2];
+ vec3 v3;
+ bool b;
+};
+
+uniform ubo1 {
+ S s[2];
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+
+ S temp[2] = s;
+
+ /* Try to prevent copy propagation */
+ temp[0].arr[0].v2 = vec2(0.01, 0.02);
+
+ v = vec4(0, 1, 0, 0);
+
+ if (temp[0].arr[0].v2 != vec2(0.01, 0.02))
+ v = vec4(0.02, 0, temp[0].arr[0].v2);
+ else if (temp[0].arr[0].m22[0][0] != vec2(0.03, 0.04))
+ v = vec4(0.04, 0, temp[0].arr[0].m22[0][0]);
+ else if (temp[0].arr[0].m22[0][1] != vec2(0.05, 0.06))
+ v = vec4(0.06, 0, temp[0].arr[0].m22[0][1]);
+ else if (temp[0].arr[0].m22[1][0] != vec2(0.07, 0.08))
+ v = vec4(0.08, 0, temp[0].arr[0].m22[1][0]);
+ else if (temp[0].arr[0].m22[1][1] != vec2(0.09, 0.10))
+ v = vec4(0.10, 0, temp[0].arr[0].m22[1][1]);
+
+ else if (temp[0].arr[1].v2 != vec2(0.21, 0.22))
+ v = vec4(0.22, 0, temp[0].arr[1].v2);
+ else if (temp[0].arr[1].m22[0][0] != vec2(0.23, 0.24))
+ v = vec4(0.24, 0, temp[0].arr[1].m22[0][0]);
+ else if (temp[0].arr[1].m22[0][1] != vec2(0.25, 0.26))
+ v = vec4(0.26, 0, temp[0].arr[1].m22[0][1]);
+ else if (temp[0].arr[1].m22[1][0] != vec2(0.27, 0.28))
+ v = vec4(0.28, 0, temp[0].arr[1].m22[1][0]);
+ else if (temp[0].arr[1].m22[1][1] != vec2(0.29, 0.30))
+ v = vec4(0.30, 0, temp[0].arr[1].m22[1][1]);
+
+ else if (temp[0].v3 != vec3(0.31, 0.32, 0.33))
+ v = vec4(0.32, temp[0].v3);
+ else if (temp[0].b != false)
+ v = vec4(0.34, 0, 0, temp[0].b);
+
+ else if (temp[1].arr[0].v2 != vec2(0.41, 0.42))
+ v = vec4(0.42, 0, temp[1].arr[0].v2);
+ else if (temp[1].arr[0].m22[0][0] != vec2(0.43, 0.44))
+ v = vec4(0.44, 0, temp[1].arr[0].m22[0][0]);
+ else if (temp[1].arr[0].m22[0][1] != vec2(0.45, 0.46))
+ v = vec4(0.46, 0, temp[1].arr[0].m22[0][1]);
+ else if (temp[1].arr[0].m22[1][0] != vec2(0.47, 0.48))
+ v = vec4(0.48, 0, temp[1].arr[0].m22[1][0]);
+ else if (temp[1].arr[0].m22[1][1] != vec2(0.49, 0.50))
+ v = vec4(0.50, 0, temp[1].arr[0].m22[1][1]);
+
+ else if (temp[1].arr[1].v2 != vec2(0.61, 0.62))
+ v = vec4(0.62, 0, temp[1].arr[1].v2);
+ else if (temp[1].arr[1].m22[0][0] != vec2(0.63, 0.64))
+ v = vec4(0.64, 0, temp[1].arr[1].m22[0][0]);
+ else if (temp[1].arr[1].m22[0][1] != vec2(0.65, 0.66))
+ v = vec4(0.66, 0, temp[1].arr[1].m22[0][1]);
+ else if (temp[1].arr[1].m22[1][0] != vec2(0.67, 0.68))
+ v = vec4(0.68, 0, temp[1].arr[1].m22[1][0]);
+ else if (temp[1].arr[1].m22[1][1] != vec2(0.69, 0.70))
+ v = vec4(0.70, 0, temp[1].arr[1].m22[1][1]);
+
+ else if (temp[1].v3 != vec3(0.71, 0.72, 0.73))
+ v = vec4(0.72, temp[1].v3);
+ else if (temp[1].b != true)
+ v = vec4(0.74, 0, 0, temp[1].b);
+
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform vec2 s[0].arr[0].v2 0.99 0.99
+uniform mat2 s[0].arr[0].m22[0] 0.03 0.04 0.05 0.06
+uniform mat2 s[0].arr[0].m22[1] 0.07 0.08 0.09 0.10
+uniform vec2 s[0].arr[1].v2 0.21 0.22
+uniform mat2 s[0].arr[1].m22[0] 0.23 0.24 0.25 0.26
+uniform mat2 s[0].arr[1].m22[1] 0.27 0.28 0.29 0.30
+uniform vec3 s[0].v3 0.31 0.32 0.33
+uniform int s[0].b 0
+
+uniform vec2 s[1].arr[0].v2 0.41 0.42
+uniform mat2 s[1].arr[0].m22[0] 0.43 0.44 0.45 0.46
+uniform mat2 s[1].arr[0].m22[1] 0.47 0.48 0.49 0.50
+uniform vec2 s[1].arr[1].v2 0.61 0.62
+uniform mat2 s[1].arr[1].m22[0] 0.63 0.64 0.65 0.66
+uniform mat2 s[1].arr[1].m22[1] 0.67 0.68 0.69 0.70
+uniform vec3 s[1].v3 0.71 0.72 0.73
+uniform int s[1].b 2
+
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy.shader_test
new file mode 100644
index 000000000..7a84a4262
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-struct-copy.shader_test
@@ -0,0 +1,68 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+struct S {
+ vec4 a, b, c, d;
+};
+
+uniform ubo1 {
+ S colors;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+
+ S temp = colors;
+ temp.c = vec4(0.0); /* try, but fail, to prevent copy prop */
+ v = temp.a + temp.b + temp.c + temp.d;
+
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform vec4 colors.a 0.0 0.0 0.0 0.0
+uniform vec4 colors.b 0.0 1.0 0.0 0.0
+uniform vec4 colors.c 1.0 0.0 0.0 0.0
+uniform vec4 colors.d 0.0 0.0 0.0 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-struct-pad.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-struct-pad.shader_test
new file mode 100644
index 000000000..dfc8c30ad
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-struct-pad.shader_test
@@ -0,0 +1,76 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+struct S1 {
+ float r;
+};
+
+struct S2 {
+ float g;
+ float b;
+ float a;
+};
+
+struct S {
+ S1 s1;
+ S2 s2;
+
+};
+
+uniform ubo1 {
+ S s;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = vec4(s.s1.r, s.s2.g, s.s2.b, s.s2.a);
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform float s.s1.r 0.0
+uniform float s.s2.g 1.0
+uniform float s.s2.b 0.0
+uniform float s.s2.a 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-struct.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-struct.shader_test
new file mode 100644
index 000000000..9721d2675
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-struct.shader_test
@@ -0,0 +1,67 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+struct S {
+ float r;
+ float g;
+ float b;
+ float a;
+};
+
+uniform ubo1 {
+ S s;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = vec4(s.r, s.g, s.b, s.a);
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform float s.r 0.0
+uniform float s.g 1.0
+uniform float s.b 0.0
+uniform float s.a 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-two-members.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-two-members.shader_test
new file mode 100644
index 000000000..25bee8f46
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-two-members.shader_test
@@ -0,0 +1,59 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+ vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+ vec4 color1;
+ vec4 color2;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+ for (int i = 0; i < 3; i++) {
+ gl_Position = vertex_to_gs[i];
+ v = color1 + color2;
+ EmitVertex();
+ }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+ gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform vec4 color1 0.5 0.0 0.0 0.0
+uniform vec4 color2 0.0 0.75 0.0 0.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.5 0.75 0.0 0.0