[Piglit] [PATCH 17/31] arb_copy_image-formats: Remove GLenum stringification macros.

Fabian Bieler fabianbieler at fastmail.fm
Thu Dec 28 15:57:43 UTC 2017


Replace GLenum stringification macros with calls to piglit_get_gl_enum_name.

Also replace string comparison between command line argument and GLenum name
with call to piglit_get_gl_enum_from_name and integer comparision.
---
 tests/spec/arb_copy_image/formats.c | 225 ++++++++++++++++++------------------
 1 file changed, 113 insertions(+), 112 deletions(-)

diff --git a/tests/spec/arb_copy_image/formats.c b/tests/spec/arb_copy_image/formats.c
index 6bb2fbaa3..67dcd3ff1 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -47,7 +47,6 @@ PIGLIT_GL_TEST_CONFIG_END
 
 struct texture_format {
 	GLenum internal_format;
-	const char *name;
 	GLenum format;
 	GLenum data_type;
 	bool can_be_reinterpreted;
@@ -57,114 +56,111 @@ struct texture_format {
 };
 
 static const struct texture_format formats[] = {
-#define FORMAT(IF, F, D, S, B, W, H) { IF, #IF, F, D, S, B, W, H }
-	FORMAT(GL_RED, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, true, 1, 1, 1),
-	FORMAT(GL_R8I, GL_RED_INTEGER, GL_BYTE, true, 1, 1, 1),
-	FORMAT(GL_R8, GL_RED, GL_UNSIGNED_BYTE, true, 1, 1, 1),
-	FORMAT(GL_R8_SNORM, GL_RED, GL_BYTE, true, 1, 1, 1),
-
-	FORMAT(GL_RG, GL_RG, GL_UNSIGNED_BYTE, false, 2, 1, 1),
-	FORMAT(GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE, true, 2, 1, 1),
-	FORMAT(GL_RG8I, GL_RG_INTEGER, GL_BYTE, true, 2, 1, 1),
-	FORMAT(GL_RG8, GL_RG, GL_UNSIGNED_BYTE, true, 2, 1, 1),
-	FORMAT(GL_RG8_SNORM, GL_RG, GL_BYTE, true, 2, 1, 1),
-	FORMAT(GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT, true, 2, 1, 1),
-	FORMAT(GL_R16I, GL_RED_INTEGER, GL_SHORT, true, 2, 1, 1),
-	FORMAT(GL_R16, GL_RED, GL_UNSIGNED_SHORT, true, 2, 1, 1),
-	FORMAT(GL_R16_SNORM, GL_RED, GL_SHORT, true, 2, 1, 1),
-
-	FORMAT(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, false, 3, 1, 1),
-	FORMAT(GL_RGB8UI, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, true, 3, 1, 1),
-	FORMAT(GL_RGB8I, GL_RGB_INTEGER, GL_BYTE, true, 3, 1, 1),
-	FORMAT(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, true, 3, 1, 1),
-	FORMAT(GL_RGB8_SNORM, GL_RGB, GL_BYTE, true, 3, 1, 1),
-
-	FORMAT(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false, 4, 1, 1),
-	FORMAT(GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, true, 4, 1, 1),
-	FORMAT(GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE, true, 4, 1, 1),
-	FORMAT(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, true, 4, 1, 1),
-	FORMAT(GL_RGBA8_SNORM, GL_RGBA, GL_BYTE, true, 4, 1, 1),
-	FORMAT(GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT, true, 4, 1, 1),
-	FORMAT(GL_RG16I, GL_RG_INTEGER, GL_SHORT, true, 4, 1, 1),
-	FORMAT(GL_RG16, GL_RG, GL_UNSIGNED_SHORT, true, 4, 1, 1),
-	FORMAT(GL_RG16_SNORM, GL_RG, GL_SHORT, true, 4, 1, 1),
-	FORMAT(GL_R32F, GL_RED, GL_FLOAT, true, 4, 1, 1),
-
-	FORMAT(GL_RGB16UI, GL_RGB_INTEGER, GL_UNSIGNED_SHORT, true, 6, 1, 1),
-	FORMAT(GL_RGB16I, GL_RGB_INTEGER, GL_SHORT, true, 6, 1, 1),
-	FORMAT(GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, true, 6, 1, 1),
-	FORMAT(GL_RGB16_SNORM, GL_RGB, GL_SHORT, true, 6, 1, 1),
-
-	FORMAT(GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, true, 8, 1, 1),
-	FORMAT(GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT, true, 8, 1, 1),
-	FORMAT(GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, true, 8, 1, 1),
-	FORMAT(GL_RGBA16_SNORM, GL_RGBA, GL_SHORT, true, 8, 1, 1),
-	FORMAT(GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT, true, 8, 1, 1),
-	FORMAT(GL_RG32I, GL_RG_INTEGER, GL_INT, true, 8, 1, 1),
-	FORMAT(GL_RG32F, GL_RG, GL_FLOAT, true, 8, 1, 1),
-
-	FORMAT(GL_RGB32UI, GL_RGB_INTEGER, GL_UNSIGNED_INT, true, 12, 1, 1),
-	FORMAT(GL_RGB32I, GL_RGB_INTEGER, GL_INT, true, 12, 1, 1),
-	FORMAT(GL_RGB32F, GL_RGB, GL_FLOAT, true, 12, 1, 1),
-
-	FORMAT(GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT, true, 16, 1, 1),
-	FORMAT(GL_RGBA32I, GL_RGBA_INTEGER, GL_INT, true, 16, 1, 1),
-	FORMAT(GL_RGBA32F, GL_RGBA, GL_FLOAT, true, 16, 1, 1),
-
-	FORMAT(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_ALPHA12, GL_ALPHA, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_ALPHA16, GL_ALPHA, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-
-	FORMAT(GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_LUMINANCE8, GL_LUMINANCE, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_LUMINANCE12, GL_LUMINANCE, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_LUMINANCE16, GL_LUMINANCE, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-
-	FORMAT(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, false, 2, 1, 1),
-	FORMAT(GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, false, 2, 1, 1),
-	FORMAT(GL_LUMINANCE12_ALPHA12, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, false, 2, 1, 1),
-	FORMAT(GL_LUMINANCE16_ALPHA16, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT, false, 4, 1, 1),
-
-	FORMAT(GL_INTENSITY, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_INTENSITY8, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_INTENSITY12, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-	FORMAT(GL_INTENSITY16, GL_RED, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-
-	FORMAT(GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-	FORMAT(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-	FORMAT(GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-	FORMAT(GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1),
-
-	FORMAT(GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false, 4, 1, 1),
-
-	FORMAT(GL_STENCIL_INDEX8, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false, 1, 1, 1),
-
-	FORMAT(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4),
-	FORMAT(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4),
-	FORMAT(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RED, GL_BYTE, true, 16, 4, 4),
-	FORMAT(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RED, GL_BYTE, true, 16, 4, 4),
-
-	FORMAT(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4),
-	FORMAT(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4),
-	FORMAT(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RED, GL_BYTE, true, 16, 4, 4),
-	FORMAT(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RED, GL_BYTE, true, 16, 4, 4),
-
-	FORMAT(GL_COMPRESSED_RED_RGTC1, GL_RED, GL_BYTE, true, 8, 4, 4),
-	FORMAT(GL_COMPRESSED_SIGNED_RED_RGTC1, GL_RED, GL_BYTE, true, 8, 4, 4),
-
-	FORMAT(GL_COMPRESSED_RG_RGTC2, GL_RED, GL_BYTE, true, 16, 4, 4),
-	FORMAT(GL_COMPRESSED_SIGNED_RG_RGTC2, GL_RED, GL_BYTE, true, 16, 4, 4),
-
-	FORMAT(GL_COMPRESSED_RGBA_BPTC_UNORM, GL_RGBA, GL_BYTE, true, 16, 4, 4),
-	FORMAT(GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, GL_RGB, GL_BYTE, true, 16, 4, 4),
-	FORMAT(GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT, GL_RGB, GL_BYTE, true, 16, 4, 4),
-	FORMAT(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, GL_RGB, GL_BYTE, true, 16, 4, 4),
-
-	FORMAT(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, false, 8, 1, 1),
-
-#undef FORMAT
+	{ GL_RED, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, true, 1, 1, 1 },
+	{ GL_R8I, GL_RED_INTEGER, GL_BYTE, true, 1, 1, 1 },
+	{ GL_R8, GL_RED, GL_UNSIGNED_BYTE, true, 1, 1, 1 },
+	{ GL_R8_SNORM, GL_RED, GL_BYTE, true, 1, 1, 1 },
+
+	{ GL_RG, GL_RG, GL_UNSIGNED_BYTE, false, 2, 1, 1 },
+	{ GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE, true, 2, 1, 1 },
+	{ GL_RG8I, GL_RG_INTEGER, GL_BYTE, true, 2, 1, 1 },
+	{ GL_RG8, GL_RG, GL_UNSIGNED_BYTE, true, 2, 1, 1 },
+	{ GL_RG8_SNORM, GL_RG, GL_BYTE, true, 2, 1, 1 },
+	{ GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT, true, 2, 1, 1 },
+	{ GL_R16I, GL_RED_INTEGER, GL_SHORT, true, 2, 1, 1 },
+	{ GL_R16, GL_RED, GL_UNSIGNED_SHORT, true, 2, 1, 1 },
+	{ GL_R16_SNORM, GL_RED, GL_SHORT, true, 2, 1, 1 },
+
+	{ GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, false, 3, 1, 1 },
+	{ GL_RGB8UI, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, true, 3, 1, 1 },
+	{ GL_RGB8I, GL_RGB_INTEGER, GL_BYTE, true, 3, 1, 1 },
+	{ GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, true, 3, 1, 1 },
+	{ GL_RGB8_SNORM, GL_RGB, GL_BYTE, true, 3, 1, 1 },
+
+	{ GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false, 4, 1, 1 },
+	{ GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, true, 4, 1, 1 },
+	{ GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE, true, 4, 1, 1 },
+	{ GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, true, 4, 1, 1 },
+	{ GL_RGBA8_SNORM, GL_RGBA, GL_BYTE, true, 4, 1, 1 },
+	{ GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT, true, 4, 1, 1 },
+	{ GL_RG16I, GL_RG_INTEGER, GL_SHORT, true, 4, 1, 1 },
+	{ GL_RG16, GL_RG, GL_UNSIGNED_SHORT, true, 4, 1, 1 },
+	{ GL_RG16_SNORM, GL_RG, GL_SHORT, true, 4, 1, 1 },
+	{ GL_R32F, GL_RED, GL_FLOAT, true, 4, 1, 1 },
+
+	{ GL_RGB16UI, GL_RGB_INTEGER, GL_UNSIGNED_SHORT, true, 6, 1, 1 },
+	{ GL_RGB16I, GL_RGB_INTEGER, GL_SHORT, true, 6, 1, 1 },
+	{ GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, true, 6, 1, 1 },
+	{ GL_RGB16_SNORM, GL_RGB, GL_SHORT, true, 6, 1, 1 },
+
+	{ GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, true, 8, 1, 1 },
+	{ GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT, true, 8, 1, 1 },
+	{ GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, true, 8, 1, 1 },
+	{ GL_RGBA16_SNORM, GL_RGBA, GL_SHORT, true, 8, 1, 1 },
+	{ GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT, true, 8, 1, 1 },
+	{ GL_RG32I, GL_RG_INTEGER, GL_INT, true, 8, 1, 1 },
+	{ GL_RG32F, GL_RG, GL_FLOAT, true, 8, 1, 1 },
+
+	{ GL_RGB32UI, GL_RGB_INTEGER, GL_UNSIGNED_INT, true, 12, 1, 1 },
+	{ GL_RGB32I, GL_RGB_INTEGER, GL_INT, true, 12, 1, 1 },
+	{ GL_RGB32F, GL_RGB, GL_FLOAT, true, 12, 1, 1 },
+
+	{ GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT, true, 16, 1, 1 },
+	{ GL_RGBA32I, GL_RGBA_INTEGER, GL_INT, true, 16, 1, 1 },
+	{ GL_RGBA32F, GL_RGBA, GL_FLOAT, true, 16, 1, 1 },
+
+	{ GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_ALPHA12, GL_ALPHA, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_ALPHA16, GL_ALPHA, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+
+	{ GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_LUMINANCE8, GL_LUMINANCE, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_LUMINANCE12, GL_LUMINANCE, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_LUMINANCE16, GL_LUMINANCE, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+
+	{ GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, false, 2, 1, 1 },
+	{ GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, false, 2, 1, 1 },
+	{ GL_LUMINANCE12_ALPHA12, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, false, 2, 1, 1 },
+	{ GL_LUMINANCE16_ALPHA16, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT, false, 4, 1, 1 },
+
+	{ GL_INTENSITY, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_INTENSITY8, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_INTENSITY12, GL_RED, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+	{ GL_INTENSITY16, GL_RED, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+
+	{ GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+	{ GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+	{ GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+	{ GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, 2, 1, 1 },
+
+	{ GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false, 4, 1, 1 },
+
+	{ GL_STENCIL_INDEX8, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false, 1, 1, 1 },
+
+	{ GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4 },
+	{ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4 },
+	{ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RED, GL_BYTE, true, 16, 4, 4 },
+	{ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RED, GL_BYTE, true, 16, 4, 4 },
+
+	{ GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4 },
+	{ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_RED, GL_BYTE, true, 8, 4, 4 },
+	{ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RED, GL_BYTE, true, 16, 4, 4 },
+	{ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RED, GL_BYTE, true, 16, 4, 4 },
+
+	{ GL_COMPRESSED_RED_RGTC1, GL_RED, GL_BYTE, true, 8, 4, 4 },
+	{ GL_COMPRESSED_SIGNED_RED_RGTC1, GL_RED, GL_BYTE, true, 8, 4, 4 },
+
+	{ GL_COMPRESSED_RG_RGTC2, GL_RED, GL_BYTE, true, 16, 4, 4 },
+	{ GL_COMPRESSED_SIGNED_RG_RGTC2, GL_RED, GL_BYTE, true, 16, 4, 4 },
+
+	{ GL_COMPRESSED_RGBA_BPTC_UNORM, GL_RGBA, GL_BYTE, true, 16, 4, 4 },
+	{ GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, GL_RGB, GL_BYTE, true, 16, 4, 4 },
+	{ GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT, GL_RGB, GL_BYTE, true, 16, 4, 4 },
+	{ GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, GL_RGB, GL_BYTE, true, 16, 4, 4 },
+
+	{ GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, false, 8, 1, 1 },
 };
 
 
@@ -173,8 +169,9 @@ find_format(const char *str)
 {
 	int i;
 
+	const GLenum format = piglit_get_gl_enum_from_name(str);
 	for (i = 0; i < sizeof(formats) / sizeof(*formats); ++i) {
-		if (strcmp(str, formats[i].name) == 0) {
+		if (format == formats[i].internal_format) {
 			return &formats[i];
 		}
 	}
@@ -921,6 +918,8 @@ piglit_display(void)
 		src_format = &src_format_list[sf];
 		if (!is_format_supported(src_format))
 			continue;
+		const char *src_name =
+			piglit_get_gl_enum_name(src_format->internal_format);
 
 		for (df = 0; df < dst_format_count; ++df) {
 			dst_format = &dst_format_list[df];
@@ -928,6 +927,8 @@ piglit_display(void)
 				continue;
 			if (!are_formats_compatible(src_format, dst_format))
 				continue;
+			const char *dst_name = piglit_get_gl_enum_name(
+				dst_format->internal_format);
 
 			setup_test_data(src_format, dst_format);
 			if (samples == 1) {
@@ -948,7 +949,7 @@ piglit_display(void)
 				 */
 				piglit_report_subtest_result(subtest,
 					"Source: %s/Destination: %s",
-					src_format->name, dst_format->name);
+					src_name, dst_name);
 			} else if (!dst_format_arg) {
 				/* In this case, the source format was
 				 * specified but the destination was not.
@@ -956,7 +957,7 @@ piglit_display(void)
 				 */
 				piglit_report_subtest_result(subtest,
 					"Destination Format: %s",
-					dst_format->name);
+					dst_name);
 			}
 
 			if (subtest == PIGLIT_FAIL)
-- 
2.15.1



More information about the Piglit mailing list