[Mesa-dev] [PATCH] mesa: Fix order of errors for glDrawTransformFeedbackStream

Kenneth Graunke kenneth at whitecape.org
Sat Oct 18 09:22:45 PDT 2014


On Saturday, October 18, 2014 09:12:07 PM Chris Forbes wrote:
> The OpenGL 4.0 core profile specification, section 2.17.3
> Transform Feedback Draw Operations says:
> 
>    "The error INVALID_VALUE is generated if <stream> is greater
>     than or equal to the value of MAX_VERTEX_STREAMS.
>     ...
>     The error INVALID_OPERATION
>     is generated if EndTransformFeedback has never been called
>     while the object named by id was bound."
> 
> Fixes the piglit test:
>    ARB_transform_feedback3/arb_transform_feedback3-draw_using_invalid_stream_index
>    (with the test itself fixed to eliminate an unrelated failure)
> 
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/main/api_validate.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index 9b80600..a3a2d25 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -749,17 +749,17 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx,
>        return GL_FALSE;
>     }
>  
> -   if (!obj->EndedAnytime) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawTransformFeedback*");
> -      return GL_FALSE;
> -   }
> -
>     if (stream >= ctx->Const.MaxVertexStreams) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
>                    "glDrawTransformFeedbackStream*(index>=MaxVertexStream)");
>        return GL_FALSE;
>     }
>  
> +   if (!obj->EndedAnytime) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawTransformFeedback*");
> +      return GL_FALSE;
> +   }
> +
>     if (numInstances <= 0) {
>        if (numInstances < 0)
>           _mesa_error(ctx, GL_INVALID_VALUE,
> 

Seems reasonable.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141018/7ccaa149/attachment-0001.sig>


More information about the mesa-dev mailing list