[Piglit] [PATCH] arb_framebuffer_srgb/blit: check requested samples against GL_MAX_SAMPLES

Brian Paul brianp at vmware.com
Tue Jan 29 17:19:45 PST 2013


We can't run some of tests if we don't support multisampling.  Just skip
those tests.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60044
---
 tests/spec/arb_framebuffer_srgb/blit.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tests/spec/arb_framebuffer_srgb/blit.c b/tests/spec/arb_framebuffer_srgb/blit.c
index abcf6fc..0814526 100644
--- a/tests/spec/arb_framebuffer_srgb/blit.c
+++ b/tests/spec/arb_framebuffer_srgb/blit.c
@@ -220,7 +220,7 @@ print_usage_and_exit(char *prog_name)
 void
 piglit_init(int argc, char **argv)
 {
-	GLint vs, fs;
+	GLint vs, fs, max_samples;
 
 	if (argc != 5) {
 		print_usage_and_exit(argv[0]);
@@ -286,6 +286,13 @@ piglit_init(int argc, char **argv)
 	piglit_require_extension("GL_ARB_framebuffer_object");
 	piglit_require_extension("GL_ARB_framebuffer_sRGB");
 
+	/* skip the test if we don't support multisampling */
+	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+	if (src_samples > max_samples ||
+	    dst_samples > max_samples) {
+		piglit_report_result(PIGLIT_SKIP);
+	}
+
 	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
 	fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_text);
 	prog = piglit_link_simple_program(vs, fs);
-- 
1.7.3.4



More information about the Piglit mailing list