[Piglit] [PATCH 1/2] arb_occlusion_query2: expect an error when target mismatch in glBeginQuery()

Ian Romanick idr at freedesktop.org
Tue Feb 17 14:09:07 PST 2015


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 02/16/2015 03:19 AM, Eduardo Lima Mitev wrote:
> From the OpenGL 3.3 spec, section "2.14. ASYNCHRONOUS QUERIES", page 94:
> 
>     "[...] if id is the name of an existing query object whose type does not
>      match target, [...] the error INVALID_OPERATION is generated."
> 
> Similar wording exists in the OpenGL ES 3.0.0 spec, section "2.13.
> ASYNCHRONOUS QUERIES", page 82.
> 
> Hence, trying to call BeginQuery on a query object which has already
> been bound to a different target should return GL_INVALID_OPERATION.
> ---
>  tests/spec/arb_occlusion_query2/api.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/spec/arb_occlusion_query2/api.c b/tests/spec/arb_occlusion_query2/api.c
> index f4d46e3..271948e 100644
> --- a/tests/spec/arb_occlusion_query2/api.c
> +++ b/tests/spec/arb_occlusion_query2/api.c
> @@ -59,6 +59,10 @@ test_error_begin_while_other_active(void)
>  	glEndQuery(GL_SAMPLES_PASSED);
>  	piglit_reset_gl_error();
>  
> +	glDeleteQueries(2, oq);
> +
> +	glGenQueries(2, oq);
> +
>  	glBeginQuery(GL_ANY_SAMPLES_PASSED, oq[0]);
>  	if (!piglit_check_gl_error(0))
>  		pass = false;
> @@ -124,6 +128,10 @@ test_error_end_wrong_target(void)
>  	glEndQuery(GL_SAMPLES_PASSED);
>  	piglit_reset_gl_error();
>  
> +	glDeleteQueries(1, &oq);
> +
> +	glGenQueries(1, &oq);
> +
>  	glBeginQuery(GL_ANY_SAMPLES_PASSED, oq);
>  	if (!piglit_check_gl_error(0))
>  		pass = false;
> @@ -191,6 +199,9 @@ test_current_query(void)
>  		pass = false;
>  	}
>  	glEndQuery(GL_ANY_SAMPLES_PASSED);
> +	glDeleteQueries(1, &oq);
> +
> +	glGenQueries(1, &oq);
>  
>  	/* Test the result for GL_SAMPLES_PASSED active */
>  	glBeginQuery(GL_SAMPLES_PASSED, oq);
> 



More information about the Piglit mailing list