[Piglit] [PATCH] glBeginConditionalRenderNV begin zero

Ian Romanick idr at freedesktop.org
Fri Dec 13 11:58:45 PST 2013


On 12/10/2013 04:08 AM, Jin Zhou wrote:
> From: Jin Zhou <jin.zhou at amd.com>
> 
> a INVALID_VALUE error should be genrated, instead of INVALID_OPERATION
> 
> ---
>  tests/spec/nv_conditional_render/begin-zero.c |   13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
>  mode change 100644 => 100755 tests/spec/nv_conditional_render/begin-zero.c
> 
> diff --git a/tests/spec/nv_conditional_render/begin-zero.c b/tests/spec/nv_conditional_render/begin-zero.c
> old mode 100644
> new mode 100755
> index 3d85b92..c898499
> --- a/tests/spec/nv_conditional_render/begin-zero.c
> +++ b/tests/spec/nv_conditional_render/begin-zero.c
> @@ -27,17 +27,12 @@
>   * @file begin-zero.c
>   *
>   * Tests that starting conditional rendering on a 0 query object
> - * results in INVALID_OPERATION.
> + * results in INVALID_VALUE.
>   *
>   * From the NV_conditional_render spec:
>   *
> - *     "BeginQuery sets the active query object name for the query
> - *      type given by <target> to <id>.  If BeginQuery is called with
> - *      an <id> of zero, if the active query object name for <target>
> - *      is non-zero, if <id> is the active query object name for any
> - *      query type, or if <id> is the active query object for
> - *      condtional rendering (Section 2.X), the error INVALID
> - *      OPERATION is generated."
> + *     "INVALID_VALUE is generated by BeginConditionalRenderNVX if <id> is not the
> + *       name of an existing occlusion query object."

This isn't a test of NVX_conditional_render, so quoting that
specification is inappropriate.  It looks like the test quoted the
wrong part of the correct spec.  That should have been obvious since
the text mentions BeginQuery but the test calls
BeginConditionalRenderNV. :(

How about if we change the comment to:

/**
 * @file begin-zero.c
 *
 * Tests that starting conditional rendering on a 0 query object
 * results in INVALID_VALUE.
 *
 * From the NV_conditional_render spec:
 *
 *     "If BeginConditionalRenderNV is called while conditional rendering is
 *     in progress, or if EndConditionalRenderNV is called while conditional
 *     rendering is not in progress, the error INVALID_OPERATION is
 *     generated.  The error INVALID_VALUE is generated if <id> is not the
 *     name of an existing query object query."
 */

With that change, this patch is

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

>   */
>  
>  PIGLIT_GL_TEST_CONFIG_BEGIN
> @@ -64,7 +59,7 @@ piglit_init(int argc, char **argv)
>  	piglit_require_extension("GL_NV_conditional_render");
>  
>  	glBeginConditionalRenderNV(0, GL_QUERY_WAIT_NV);
> -	if (!piglit_check_gl_error(GL_INVALID_OPERATION))
> +	if (!piglit_check_gl_error(GL_INVALID_VALUE))
>  		piglit_report_result(PIGLIT_FAIL);
>  
>  	piglit_report_result(PIGLIT_PASS);
> 



More information about the Piglit mailing list