[Piglit] [PATCH] arb_texture_multisample/sample-mask-execution: check for GL_MAX_SAMPLES >= 4

Brian Paul brianp at vmware.com
Tue Jul 25 13:37:15 UTC 2017


Skip the test if GL_MAX_SAMPLES<4 because we need 4x msaa to run this
test.

As is, if 4x MSAA is not supported, we get a bunch of FBO errors and then
an unexpected GL_INVALID_OPERATION error which generates a piglit failure.

v2: check for GL_MAX_SAMPLES >= 4 instead of non-zero.
---
 tests/spec/arb_texture_multisample/sample-mask-execution.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/spec/arb_texture_multisample/sample-mask-execution.c b/tests/spec/arb_texture_multisample/sample-mask-execution.c
index 4605465..4c4ff9f 100644
--- a/tests/spec/arb_texture_multisample/sample-mask-execution.c
+++ b/tests/spec/arb_texture_multisample/sample-mask-execution.c
@@ -103,9 +103,17 @@ void
 piglit_init(int argc, char **argv)
 {
     bool use_multisample_texture = false;
+    GLint max_samples;
 
     piglit_require_extension("GL_ARB_texture_multisample");
 
+    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
+    if (max_samples < 4) {
+       /* we need 4x msaa for this test */
+       printf("GL_MAX_SAMPLES = %d, need 4\n", max_samples);
+       piglit_report_result(PIGLIT_SKIP);
+    }
+
     while (++argv,--argc) {
         if (!strcmp(*argv, "-tex"))
             use_multisample_texture = true;
-- 
1.9.1



More information about the Piglit mailing list