[Piglit] [PATCH v2 07/15] nv_conditional_render: prefer GL_EXT_occlusion_query_boolean

Erik Faye-Lund erik.faye-lund at collabora.com
Wed Nov 7 21:14:12 UTC 2018


This is the first step in porting these tests to GLESi 2, where
GL_EXT_occlusion_query_boolean is the only such extension available.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---
 tests/spec/nv_conditional_render/common.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tests/spec/nv_conditional_render/common.c b/tests/spec/nv_conditional_render/common.c
index c2a3bbdeb..f47c9939d 100644
--- a/tests/spec/nv_conditional_render/common.c
+++ b/tests/spec/nv_conditional_render/common.c
@@ -46,25 +46,37 @@ fill_tex(int level, int w, int h, const unsigned char *color)
 void
 gen_queries(GLsizei n, GLuint *ids)
 {
-	glGenQueries(n, ids);
+	if (piglit_is_extension_supported("GL_EXT_occlusion_query_boolean"))
+		glGenQueriesEXT(n, ids);
+	else
+		glGenQueries(n, ids);
 }
 
 void
 delete_queries(GLsizei n, GLuint *ids)
 {
-	glDeleteQueries(n, ids);
+	if (piglit_is_extension_supported("GL_EXT_occlusion_query_boolean"))
+		glDeleteQueriesEXT(n, ids);
+	else
+		glDeleteQueries(n, ids);
 }
 
 void
 begin_query(GLuint id)
 {
-	glBeginQuery(GL_SAMPLES_PASSED, id);
+	if (piglit_is_extension_supported("GL_EXT_occlusion_query_boolean"))
+		glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, id);
+	else
+		glBeginQuery(GL_SAMPLES_PASSED, id);
 }
 
 void
 end_query()
 {
-	glEndQuery(GL_SAMPLES_PASSED);
+	if (piglit_is_extension_supported("GL_EXT_occlusion_query_boolean"))
+		glEndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT);
+	else
+		glEndQuery(GL_SAMPLES_PASSED);
 }
 
 void
-- 
2.19.1



More information about the Piglit mailing list