[Piglit] [PATCH] ext_texture_swizzle: remove requirement for GL_ARB_texture_rg

Brian Paul brianp at vmware.com
Thu Nov 12 08:26:21 PST 2015


In the depth texture mode swizzle test, if we don't support
GL_ARB_texture_rg, simply skip the tests which use the GL_RED format.
---
 tests/spec/ext_texture_swizzle/depth_texture_mode_and_swizzle.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/spec/ext_texture_swizzle/depth_texture_mode_and_swizzle.c b/tests/spec/ext_texture_swizzle/depth_texture_mode_and_swizzle.c
index 61a0e9c..47a85e0 100644
--- a/tests/spec/ext_texture_swizzle/depth_texture_mode_and_swizzle.c
+++ b/tests/spec/ext_texture_swizzle/depth_texture_mode_and_swizzle.c
@@ -100,6 +100,8 @@ piglit_display()
 			{ 1, 0, .5, 0 }
 		},
 	};
+	const bool have_ARB_texture_rg =
+		piglit_is_extension_supported("GL_ARB_texture_rg");
 
 	piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 
@@ -107,6 +109,9 @@ piglit_display()
 	glClear(GL_COLOR_BUFFER_BIT);
 
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
+		if (tests[i].depth_mode == GL_RED && !have_ARB_texture_rg)
+			continue;
+
 		glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE,
 				tests[i].depth_mode);
 		glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA,
@@ -180,7 +185,6 @@ void
 piglit_init(int argc, char **argv)
 {
 	piglit_require_extension("GL_EXT_texture_swizzle");
-	piglit_require_extension("GL_ARB_texture_rg");
 
 	setup_shaders();
 	setup_texture();
-- 
1.9.1



More information about the Piglit mailing list