On Monday, May 9, 2016 4:22:21 PM PDT Dave Airlie wrote:
> From: Dave Airlie <airl...@redhat.com>
> 
> If we try to draw or query an XFB object that hasn't been bound,
> we shouldn't return any information.
> 
> This fixes a couple if cases in:
> GL33-CTS.transform_feedback.api_errors_test
> 
> The ObjectLabel test is inspired by another test.
> 
> Signed-off-by: Dave Airlie <airl...@redhat.com>
> ---
>  src/mesa/main/api_validate.c | 5 +++++
>  src/mesa/main/objectlabel.c  | 3 ++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index 6ec65e5..7fa8f21 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -665,6 +665,11 @@ _mesa_validate_DrawTransformFeedback(struct gl_context 
*ctx,
>        return GL_FALSE;
>     }
>  

Maybe add some spec citations?

   /* From the GL 4.5 specification, page 429:
    * "An INVALID_VALUE error is generated if id is not the name of a
    *  transform feedback object."
    */

> +   if (!obj->EverBound) {
> +      _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTransformFeedback*(name)");
> +      return GL_FALSE;
> +   }
> +
>     if (stream >= ctx->Const.MaxVertexStreams) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
>                    
"glDrawTransformFeedbackStream*(index>=MaxVertexStream)");
> diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c
> index 5070b00..e4f42d0 100644
> --- a/src/mesa/main/objectlabel.c
> +++ b/src/mesa/main/objectlabel.c
> @@ -179,7 +179,8 @@ get_label_pointer(struct gl_context *ctx, GLenum 
identifier, GLuint name,
>           struct gl_transform_feedback_object *tfo =
>              _mesa_lookup_transform_feedback_object(ctx, name);

   /* From the GL 4.5 specification, page 536:
    * "An INVALID_VALUE error is generated if name is not the name of a
    *  valid object of the type specified by identifier."
    */

>           if (tfo)
> -            labelPtr = &tfo->Label;
> +            if (tfo->EverBound)
> +               labelPtr = &tfo->Label;
>        }
>        break;
>     case GL_SAMPLER:
> 


Series is:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to