[Piglit] [PATCH 2/4] GL_ARB_texture_compression/invalid_formats: Allow some formats to be optional

Ian Romanick idr at freedesktop.org
Mon Aug 19 16:35:51 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

There are some compressed formats that the spec doesn't seem to require
implementations to advertise via GL_COMPRESSED_TEXTURE_FORMATS.  No
formats are yet marked as optional.  The next two patches will add that.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Anuj Phogat <anuj.phogat at gmail.com>
---
 .../spec/arb_texture_compression/invalid-formats.c | 32 ++++++++++++++--------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/tests/spec/arb_texture_compression/invalid-formats.c b/tests/spec/arb_texture_compression/invalid-formats.c
index 1fbc281..be53247 100644
--- a/tests/spec/arb_texture_compression/invalid-formats.c
+++ b/tests/spec/arb_texture_compression/invalid-formats.c
@@ -294,7 +294,8 @@ reject_bad(const struct format_tuple *bad, GLenum *compressed_formats,
 
 static bool
 try_formats(const struct format_list *t, GLenum *compressed_formats,
-	    GLint num_compressed_formats, bool check_errors, bool supported)
+	    GLint num_compressed_formats, bool check_errors, bool supported,
+	    bool optional)
 {
 	bool pass = true;
 
@@ -316,7 +317,7 @@ try_formats(const struct format_list *t, GLenum *compressed_formats,
 			}
 
 			if (j == num_compressed_formats) {
-				if (check_errors) {
+				if (check_errors && !optional) {
 					fprintf(stderr,
 						"%s should be available.\n",
 						t->good[i].name);
@@ -406,35 +407,40 @@ piglit_init(int argc, char **argv)
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_ARB_texture_compression_bptc"))
+					   piglit_is_extension_supported("GL_ARB_texture_compression_bptc"),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "s3tc") == 0) {
 			pass = try_formats(&s3tc_formats,
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_EXT_texture_compression_s3tc"))
+					   piglit_is_extension_supported("GL_EXT_texture_compression_s3tc"),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "fxt1") == 0) {
 			pass = try_formats(&fxt1_formats,
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_3DFX_texture_compression_FXT1"))
+					   piglit_is_extension_supported("GL_3DFX_texture_compression_FXT1"),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "latc") == 0) {
 			pass = try_formats(&latc_formats,
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_EXT_texture_compression_latc"))
+					   piglit_is_extension_supported("GL_EXT_texture_compression_latc"),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "3dc") == 0) {
 			pass = try_formats(&ati_3dc_formats,
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_ATI_texture_compression_3dc"))
+					   piglit_is_extension_supported("GL_ATI_texture_compression_3dc"),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "rgtc") == 0) {
 			pass = try_formats(&rgtc_formats,
@@ -442,7 +448,8 @@ piglit_init(int argc, char **argv)
 					   num_compressed_formats,
 					   check_errors,
 					   (piglit_is_extension_supported("GL_ARB_texture_compression_rgtc")
-					    || piglit_is_extension_supported("GL_EXT_texture_compression_rgtc")))
+					    || piglit_is_extension_supported("GL_EXT_texture_compression_rgtc")),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "srgb") == 0) {
 			pass = try_formats(&srgb_formats,
@@ -450,21 +457,24 @@ piglit_init(int argc, char **argv)
 					   num_compressed_formats,
 					   check_errors,
 					   (piglit_is_extension_supported("GL_EXT_texture_sRGB")
-					    && piglit_is_extension_supported("GL_EXT_texture_compression_s3tc")))
+					    && piglit_is_extension_supported("GL_EXT_texture_compression_s3tc")),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "paletted") == 0) {
 			pass = try_formats(&paletted_formats,
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_OES_compressed_paletted_texture"))
+					   piglit_is_extension_supported("GL_OES_compressed_paletted_texture"),
+					   false)
 				&& pass;
 		} else if (strcmp(argv[i], "etc1") == 0) {
 			pass = try_formats(&etc1_formats,
 					   compressed_formats,
 					   num_compressed_formats,
 					   check_errors,
-					   piglit_is_extension_supported("GL_OES_compressed_ETC1_RGB8_texture")
+					   piglit_is_extension_supported("GL_OES_compressed_ETC1_RGB8_texture"),
+					   false)
 				&& pass;
 		} else {
 			fprintf(stderr,
-- 
1.8.1.4



More information about the Piglit mailing list