[Piglit] [PATCH] arb_provoking_vertex: test OpenGL profile too

Brian Paul brianp at vmware.com
Tue Jul 18 20:24:02 UTC 2017


The GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION query is legal with
compat profile or GL 3.2.

Ideally, I guess we should have several variants of this test which
exercise different GL versions and profiles.  I hand-edited the test and
ran it with those variations.  Both NVIDIA and Mesa (with recent patch)
all pass.
---
 .../arb_provoking_vertex/quads-follow-provoking-vertex.c    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 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 91a18ce..57d2b11 100644
--- a/tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c
+++ b/tests/spec/arb_provoking_vertex/quads-follow-provoking-vertex.c
@@ -45,15 +45,22 @@ piglit_init(int argc, char **argv)
 {
 	bool pass = true;
 	GLboolean followsProvoking = false;
-	GLint major, minor;
+	GLint major, minor, profile;
 	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;
+	glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profile);
+	printf("GL profile: 0x%x\n", profile);
+
+	if ((profile & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) ||
+	    major * 10 + minor == 32) {
+		expected_error = GL_NO_ERROR;
+	} else {
+		expected_error = GL_INVALID_ENUM;
+	}
 
 	glGetBooleanv(GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION,
 		      &followsProvoking);
-- 
1.9.1



More information about the Piglit mailing list