summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2017-07-17 12:13:15 -0600
committerBrian Paul <brianp@vmware.com>2017-07-18 09:22:19 -0600
commiteda25a4a2229f5d2f32deea206a1bf9191043ec6 (patch)
treefadcbe692020ea3264bc682a4d414148e45589b6
parent51b6cd74d06c9d9d0b5263967926ff2fd820f668 (diff)
arb_provoking_vertex: fix quads-follow-provoking-vertex test
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. Reviewed-by: Neha Bhende<bhenden@vmware.com>
-rw-r--r--tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c13
1 files 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 02e03eeca..91a18cea2 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);
}