[Piglit] [PATCH 4/7] texwrap: Add missing extension checks

Ian Romanick idr at freedesktop.org
Thu Dec 19 11:37:32 PST 2013


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

Also update the setting of has_texture_swizzle.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/texturing/texwrap.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index 86fe9ee..b353d01 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -1660,7 +1660,9 @@ void piglit_init(int argc, char **argv)
 	texture_npot = 0;
 	texture_proj = 0;
 	texture_swizzle = 0;
-	has_texture_swizzle = piglit_is_extension_supported("GL_ARB_texture_swizzle");
+	has_texture_swizzle = piglit_get_gl_version() >= 33
+		|| piglit_is_extension_supported("GL_ARB_texture_swizzle")
+		|| piglit_is_extension_supported("GL_EXT_texture_swizzle");
 	has_npot = piglit_is_extension_supported("GL_ARB_texture_non_power_of_two");
 	test = &test_sets[0];
 
@@ -1703,6 +1705,12 @@ void piglit_init(int argc, char **argv)
 			continue;
 		}
 		if (strcmp(argv[p], "swizzled") == 0) {
+			if (!has_texture_swizzle) {
+				printf("OpenGL 3.3, GL_ARB_texture_swizzle, or "
+				       "GL_EXT_texture_swizzle is required for "
+				       "\"swizzled\".\n");
+				piglit_report_result(PIGLIT_SKIP);
+			}
 			texture_swizzle = 1;
 			printf("Using texture swizzling.\n");
 			continue;
-- 
1.8.1.4



More information about the Piglit mailing list