[Piglit] [PATCH 7/7] Extend required-texture-attachment-formats to GL 3.1, 3.3, and 4.2.

Eric Anholt eric at anholt.net
Thu May 16 07:28:49 PDT 2013


---
 tests/all.tests                                    |  5 +++-
 .../gl-3.0/required-texture-attachment-formats.c   | 30 ++++++++++++++--------
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index a2d381d..417ca08 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -698,7 +698,7 @@ add_concurrent_test(gl30, 'integer-errors')
 gl30['minmax'] = concurrent_test('gl-3.0-minmax')
 gl30['required-sized-texture-formats'] = concurrent_test('gl-3.0-required-sized-texture-formats 30')
 gl30['required-renderbuffer-attachment-formats'] = concurrent_test('gl-3.0-required-renderbuffer-attachment-formats 30')
-add_concurrent_test(gl30, 'gl-3.0-required-texture-attachment-formats')
+gl30['required-texture-attachment-formats'] = concurrent_test('gl-3.0-required-texture-attachment-formats 30')
 add_concurrent_test(gl30, 'gl-3.0-texture-integer')
 add_plain_test(gl30, 'gl30basic')
 add_plain_test(gl30, 'array-depth-roundtrip')
@@ -714,15 +714,18 @@ for subtest in ['generated', 'written', 'flush']:
         gl31[cmdline] = concurrent_test('gl-3.1-' + cmdline)
 gl31['required-renderbuffer-attachment-formats'] = concurrent_test('gl-3.0-required-renderbuffer-attachment-formats 31')
 gl31['required-sized-texture-formats'] = concurrent_test('gl-3.0-required-sized-texture-formats 31')
+gl31['required-texture-attachment-formats'] = concurrent_test('gl-3.0-required-texture-attachment-formats 31')
 
 spec['!OpenGL 3.2/minmax'] = concurrent_test('gl-3.2-minmax')
 
 spec['!OpenGL 3.3/minmax'] = concurrent_test('gl-3.3-minmax')
 spec['!OpenGL 3.3/required-renderbuffer-attachment-formats'] = concurrent_test('gl-3.0-required-renderbuffer-attachment-formats 33')
 spec['!OpenGL 3.3/required-sized-texture-formats'] = concurrent_test('gl-3.0-required-sized-texture-formats 33')
+spec['!OpenGL 3.3/required-texture-attachment-formats'] = concurrent_test('gl-3.0-required-texture-attachment-formats 33')
 
 spec['!OpenGL 4.2/required-renderbuffer-attachment-formats'] = concurrent_test('gl-3.0-required-renderbuffer-attachment-formats 42')
 spec['!OpenGL 4.2/required-sized-texture-formats'] = concurrent_test('gl-3.0-required-sized-texture-formats 42')
+spec['!OpenGL 4.2/required-texture-attachment-formats'] = concurrent_test('gl-3.0-required-texture-attachment-formats 42')
 
 # Group spec/glsl-es-1.00
 spec['glsl-es-1.00'] = Group()
diff --git a/tests/spec/gl-3.0/required-texture-attachment-formats.c b/tests/spec/gl-3.0/required-texture-attachment-formats.c
index a901044..11e20ac 100644
--- a/tests/spec/gl-3.0/required-texture-attachment-formats.c
+++ b/tests/spec/gl-3.0/required-texture-attachment-formats.c
@@ -32,15 +32,7 @@
  * 180 "Required Texture Formats".
  */
 
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-	config.supports_gl_compat_version = 10;
-
-	config.window_width = 32;
-	config.window_height = 32;
-	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
-
-PIGLIT_GL_TEST_CONFIG_END
+static int target_version;
 
 enum piglit_result
 piglit_display(void)
@@ -65,8 +57,7 @@ piglit_init(int argc, char **argv)
 		GLenum format, type, attachment, status;
 		const struct sized_internalformat *f;
 
-		/* FINISHME: Add support for future GL versions. */
-		if (required_formats[i].version != 30)
+		if (!valid_for_gl_version(&required_formats[i], target_version))
 			continue;
 
 		if (!required_formats[i].rb_required)
@@ -151,3 +142,20 @@ piglit_init(int argc, char **argv)
 
 	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
+
+int
+main(int argc, char *argv[])
+{
+	struct piglit_gl_test_config config;
+
+	setup_required_size_test(argc, argv, &config);
+	target_version = MAX2(config.supports_gl_compat_version,
+			      config.supports_gl_core_version);
+	config.init = piglit_init;
+	config.display = piglit_display;
+
+	piglit_gl_test_run(argc, argv, &config);
+
+	/* UNREACHED */
+	return 0;
+}
-- 
1.8.3.rc0



More information about the Piglit mailing list