[Piglit] [PATCH] arb_provoking_vertex: fix quads-follow-provoking-vertex test
Brian Paul
brianp at vmware.com
Mon Jul 17 18:28:54 UTC 2017
Querying GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION is illegal in
GL 3.2 and later.
Check the GL version to determine the expected error. Note that the
test says config.supports_gl_core_version = 32. With NVIDIA's driver
we get a 3.2 context but with Mesa we get a 3.3 context.
---
.../arb_provoking_vertex/quads-follow-provoking-vertex.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c b/tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c
index 02e03ee..91a18ce 100644
--- a/tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c
+++ b/tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c
@@ -45,11 +45,20 @@ piglit_init(int argc, char **argv)
{
bool pass = true;
GLboolean followsProvoking = false;
+ GLint major, minor;
+ GLenum expected_error;
+
+ glGetIntegerv(GL_MAJOR_VERSION, &major);
+ glGetIntegerv(GL_MINOR_VERSION, &minor);
+ printf("GL version: %d.%d\n", major, minor);
+
+ expected_error =
+ (major * 10 + minor > 32) ? GL_INVALID_ENUM : GL_NO_ERROR;
glGetBooleanv(GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION,
- &followsProvoking);
+ &followsProvoking);
- pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
+ pass = piglit_check_gl_error(expected_error) && pass;
piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
}
--
1.9.1
More information about the Piglit
mailing list