[Piglit] [PATCH] msaa: Skip tests when samples > GL_MAX_SAMPLES.

Paul Berry stereotype441 at gmail.com
Mon Aug 20 13:20:45 PDT 2012


A few of the recently-added MSAA tests were missing this check,
causing bogus failures on i965/gen6 and i965/gen7 (which only support
up to 4x MSAA and 8x MSAA, respectively).
---
 .../alpha-to-coverage-dual-src-blend.cpp           |    7 +++++++
 .../alpha-to-one-dual-src-blend.cpp                |    7 +++++++
 .../alpha-to-one-single-sample-buffer.cpp          |    7 +++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
index ffd90e9..5f8db5d 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-coverage-dual-src-blend.cpp
@@ -72,6 +72,13 @@ piglit_init(int argc, char **argv)
 				pattern_height,
 				GL_TRUE);
 
+	/* Skip the test if samples > GL_MAX_SAMPLES */
+	GLint max_samples;
+	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+
+	if (samples > max_samples)
+		piglit_report_result(PIGLIT_SKIP);
+
 	ms_fbo_and_draw_buffers_setup(samples,
 				      pattern_width,
 				      pattern_height,
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
index 4eb8dc8..062af05 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-dual-src-blend.cpp
@@ -72,6 +72,13 @@ piglit_init(int argc, char **argv)
 				pattern_height,
 				GL_TRUE);
 
+	/* Skip the test if samples > GL_MAX_SAMPLES */
+	GLint max_samples;
+	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+
+	if (samples > max_samples)
+		piglit_report_result(PIGLIT_SKIP);
+
 	ms_fbo_and_draw_buffers_setup(samples,
 				      pattern_width,
 				      pattern_height,
diff --git a/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp b/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp
index 4f58e02..0919fd3 100644
--- a/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp
+++ b/tests/spec/ext_framebuffer_multisample/alpha-to-one-single-sample-buffer.cpp
@@ -59,6 +59,13 @@ piglit_init(int argc, char **argv)
 				pattern_height,
 				GL_TRUE);
 
+	/* Skip the test if samples > GL_MAX_SAMPLES */
+	GLint max_samples;
+	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+
+	if (samples > max_samples)
+		piglit_report_result(PIGLIT_SKIP);
+
 	ms_fbo_and_draw_buffers_setup(samples,
 				      pattern_width,
 				      pattern_height,
-- 
1.7.7.6



More information about the Piglit mailing list