---
 tests/all.tests                                    |  9 ++++
 .../spec/arb_geometry_shader4/compiler/sanity.geom | 17 ++++++++
 .../execution/sanity.shader_test                   | 50 +++++++++++++++++++++
 tests/spec/glsl-1.50/compiler/geometry-basic.geom  | 18 ++++++++
 .../glsl-1.50/execution/geometry-basic.shader_test | 51 ++++++++++++++++++++++
 5 files changed, 145 insertions(+)
 create mode 100644 tests/spec/arb_geometry_shader4/compiler/sanity.geom
 create mode 100644 tests/spec/arb_geometry_shader4/execution/sanity.shader_test
 create mode 100644 tests/spec/glsl-1.50/compiler/geometry-basic.geom
 create mode 100644 tests/spec/glsl-1.50/execution/geometry-basic.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index f2229c6..f150ede 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -2188,6 +2188,15 @@ arb_map_buffer_alignment = Group()
 spec['ARB_map_buffer_alignment'] = arb_map_buffer_alignment
 add_plain_test(arb_map_buffer_alignment, 
'arb_map_buffer_alignment-sanity_test')
 
+arb_geometry_shader4 = Group()
+spec['ARB_geometry_shader4'] = arb_geometry_shader4
+add_shader_test_dir(spec['ARB_geometry_shader4'],
+                    os.path.join(testsDir, 'spec', 'arb_geometry_shader4'),
+                    recursive=True)
+import_glsl_parser_tests(spec['ARB_geometry_shader4'],
+                         os.path.join(testsDir, 'spec', 
'arb_geometry_shader4'),
+                         ['compiler'])
+
 # group glslparsertest ------------------------------------------------------
 glslparsertest = Group()
 # Add all shader source files in the directories below.
diff --git a/tests/spec/arb_geometry_shader4/compiler/sanity.geom 
b/tests/spec/arb_geometry_shader4/compiler/sanity.geom
new file mode 100644
index 0000000..50a5651
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/sanity.geom
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// check_link: true
+// require_extensions: GL_ARB_geometry_shader4
+// [end config]
+
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = vec4(0.0);
+    EmitVertex();
+  }
+}
diff --git a/tests/spec/arb_geometry_shader4/execution/sanity.shader_test 
b/tests/spec/arb_geometry_shader4/execution/sanity.shader_test
new file mode 100644
index 0000000..5b62e30
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/execution/sanity.shader_test
@@ -0,0 +1,50 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+  gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = gl_PositionIn[i];
+    EmitVertex();
+  }
+}
+
+[geometry layout]
+input type GL_TRIANGLES
+output type GL_TRIANGLE_STRIP
+vertices out 3
+
+[fragment shader]
+#version 110
+
+void main()
+{
+  gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/glsl-1.50/compiler/geometry-basic.geom 
b/tests/spec/glsl-1.50/compiler/geometry-basic.geom
new file mode 100644
index 0000000..ede61e3
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/geometry-basic.geom
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = vec4(0.0);
+    EmitVertex();
+  }
+}
diff --git a/tests/spec/glsl-1.50/execution/geometry-basic.shader_test 
b/tests/spec/glsl-1.50/execution/geometry-basic.shader_test
new file mode 100644
index 0000000..06d0209
--- /dev/null
+++ b/tests/spec/glsl-1.50/execution/geometry-basic.shader_test
@@ -0,0 +1,51 @@
+[require]
+GL >= 3.1
+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;
+
+in vec4 vertex_to_gs[3];
+
+void main()
+{
+  for (int i = 0; i < 3; i++) {
+    gl_Position = vertex_to_gs[i];
+    EmitVertex();
+  }
+}
+
+[fragment shader]
+#version 150
+
+out vec4 color;
+
+void main()
+{
+  color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.8.1.3

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to