[Piglit] [PATCH 5/6] gs: Adapt ignore-adjacent-vertices for GLSL 1.50.

Paul Berry stereotype441 at gmail.com
Sat Jul 27 06:10:06 PDT 2013


To avoid code duplication, I've left the source code for the test in
spec/arb_geometry_shader4, but I've added a command line argument that
causes it to use core GLSL 1.50 functionality rather than
ARB_geometry_shader4.

The new test cases appear in piglit output under spec/glsl-1.50.
---
 tests/all.tests                                     |  6 ++++++
 .../execution/ignore-adjacent-vertices.c            | 21 +++++++++++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index 6d27448..bc5c284 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -900,6 +900,12 @@ import_glsl_parser_tests(spec['glsl-1.50'],
 add_shader_test_dir(spec['glsl-1.50'],
 		    os.path.join(testsDir, 'spec', 'glsl-1.50'),
 		    recursive=True)
+for draw in ['', 'indexed']:
+    for prim in ['GL_LINES_ADJACENCY', 'GL_LINE_STRIP_ADJACENCY',
+                 'GL_TRIANGLES_ADJACENCY', 'GL_TRIANGLE_STRIP_ADJACENCY']:
+        add_concurrent_test(spec['glsl-1.50'],
+                            ('arb_geometry_shader4-ignore-adjacent-vertices '
+                             'core {0} {1}').format(draw, prim))
 
 # Group spec/glsl-es-3.00
 spec['glsl-es-3.00'] = Group()
diff --git a/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c b/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c
index 78cdd16..c69ecac 100644
--- a/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c
+++ b/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c
@@ -93,9 +93,20 @@ static const char fs_text[] =
 
 static const struct primitives *test;
 static bool indexed = false;
+static bool use_core = false;
+
+static void
+parse_cmd_line(int argc, char **argv);
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
-	config.supports_gl_compat_version = 20;
+	parse_cmd_line(argc, argv);
+	if (use_core) {
+		config.supports_gl_compat_version = 20;
+		config.supports_gl_core_version = 31;
+	} else {
+		config.supports_gl_compat_version = 32;
+		config.supports_gl_core_version = 32;
+	}
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
 PIGLIT_GL_TEST_CONFIG_END
 
@@ -140,6 +151,7 @@ check_framebuffer(void)
  *       GL_LINE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY or
  *       GL_TRIANGLE_STRIP_ADJACENCY).
  *     * The optional argument "indexed" to use indexed drawing.
+ *     * The optional argument "core" to use GLSL 1.50
  */
 static void
 parse_cmd_line(int argc, char **argv)
@@ -154,6 +166,8 @@ parse_cmd_line(int argc, char **argv)
 		}
 		if (strcmp(argv[i], "indexed") == 0)
 			indexed = true;
+		else if (strcmp(argv[i], "core") == 0)
+			use_core = true;
 	}
 
 	if (test == NULL) {
@@ -170,9 +184,8 @@ piglit_init(int argc, char **argv)
 	GLuint array;
 	GLuint prog;
 
-	piglit_require_extension("GL_ARB_geometry_shader4");
-
-	parse_cmd_line(argc, argv);
+	if (!use_core)
+		piglit_require_extension("GL_ARB_geometry_shader4");
 
 	/* Bind Vertex Data */
 	glGenVertexArrays(1, &array);
-- 
1.8.3.4



More information about the Piglit mailing list