[v2,07/15] nv_conditional_render: prefer GL_EXT_occlusion_query_boolean

Submitted by Erik Faye-Lund on Nov. 7, 2018, 9:14 p.m.

Details

Message ID 20181107211420.7355-8-erik.faye-lund@collabora.com
State New
Headers show

Not browsing as part of any series.

Patch hide | download patch | download mbox

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