[Mesa-dev] [PATCH 1/2] mesa: don't use genned but unnammed xfb objects.
Kenneth Graunke
kenneth at whitecape.org
Mon May 9 07:04:18 UTC 2016
On Monday, May 9, 2016 4:22:21 PM PDT Dave Airlie wrote:
> From: Dave Airlie <airlied at 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 <airlied at 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 <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: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160509/0f46bcc5/attachment.sig>
More information about the mesa-dev
mailing list