[Piglit] [PATCH] Skip testing textures with depth-stencil formats in glGenerateMipmap

Anuj Phogat anuj.phogat at gmail.com
Mon Nov 5 12:02:29 PST 2012


depth-stencil formats are disallowed in glGenerateMipmap because the
stencil component is not filterable.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 tests/fbo/fbo-generatemipmap-formats.c |   41 +++++++++++++++++++++++++++----
 1 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index a83a266..821e607 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -450,6 +450,7 @@ test_format(const struct format_desc *format, GLenum basetype)
 enum piglit_result
 piglit_display(void)
 {
+	struct format_desc format;
 	GLboolean pass = GL_TRUE;
 	int i;
 	(void)fbo_formats_display;
@@ -459,20 +460,48 @@ piglit_display(void)
 
 	if (piglit_automatic) {
 		for (i = 0; i < test_sets[test_index].num_formats; i++) {
-			pass = test_format(&test_sets[test_index].format[i],
-					   test_sets[test_index].basetype) && pass;
+			format = test_sets[test_index].format[i];
+			if (format.base_internal_format != GL_DEPTH_STENCIL)
+			{
+				pass =
+				test_format(&test_sets[test_index].format[i],
+					    test_sets[test_index].basetype)
+					    && pass;
+			}
+			else
+				/* Textures with depth-stencil internal format
+				 * are not allowed in glGenerateMipmap.
+				 */
+				printf("Skipped testing %s\n",
+				piglit_get_gl_enum_name(format.internalformat));
 		}
 		if (piglit_is_extension_supported("GL_ARB_texture_non_power_of_two")) {
 			set_npot(GL_TRUE);
 			for (i = 0; i < test_sets[test_index].num_formats; i++) {
-				pass = test_format(&test_sets[test_index].format[i],
-						   test_sets[test_index].basetype) && pass;
+				format = test_sets[test_index].format[i];
+				if (format.base_internal_format != GL_DEPTH_STENCIL)
+				{
+					pass =
+					test_format(&test_sets[test_index].format[i],
+						    test_sets[test_index].basetype)
+						    && pass;
+				}
+				else
+					printf("Skipped testing %s\n",
+					piglit_get_gl_enum_name(format.internalformat));
 			}
 			set_npot(GL_FALSE);
 		}
 	} else {
-		pass = test_format(&test_sets[test_index].format[format_index],
-				   test_sets[test_index].basetype);
+		format = test_sets[test_index].format[format_index];
+		if (format.base_internal_format != GL_DEPTH_STENCIL)
+		{
+			pass = test_format(&format,
+					   test_sets[test_index].basetype);
+		}
+		else
+			printf("Skipped testing %s\n",
+			piglit_get_gl_enum_name(format.internalformat));
 	}
 
 	piglit_present_results();
-- 
1.7.7.6



More information about the Piglit mailing list