diff options
author | Matt Turner <[email protected]> | 2012-12-19 13:43:31 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2012-12-21 20:03:07 -0800 |
commit | fd93d55141f11069fb76a9b377ad1af88d0ecdd3 (patch) | |
tree | a50a44d58a3830168b61cd14b0819365c4ccadaa /src/mesa/main/transformfeedback.c | |
parent | 54203ef5ace8073327f0b41b6abbe4ce5b23fa65 (diff) |
Make IsTransformFeedback() return false before BindTransformFeedback()
The GL 4.3 an ES 3.0 specs say
A transform feedback object is created by binding a name returned by
GenTransformFeedbacks with the command
void BindTransformFeedback( enum target, uint id );
Fixes arb_transform_feedback2-istransformfeedback and part of
es3conform's CoverageES30.test.
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/transformfeedback.c')
-rw-r--r-- | src/mesa/main/transformfeedback.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 42f38e0cc4a..1bf4beaeb08 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -80,6 +80,7 @@ reference_transform_feedback_object(struct gl_transform_feedback_object **ptr, } else { obj->RefCount++; + obj->EverBound = GL_TRUE; *ptr = obj; } } @@ -178,6 +179,7 @@ new_transform_feedback(struct gl_context *ctx, GLuint name) if (obj) { obj->Name = name; obj->RefCount = 1; + obj->EverBound = GL_FALSE; } return obj; } @@ -793,14 +795,19 @@ _mesa_GenTransformFeedbacks(GLsizei n, GLuint *names) GLboolean GLAPIENTRY _mesa_IsTransformFeedback(GLuint name) { + struct gl_transform_feedback_object *obj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (name && _mesa_lookup_transform_feedback_object(ctx, name)) - return GL_TRUE; - else + if (name == 0) + return GL_FALSE; + + obj = _mesa_lookup_transform_feedback_object(ctx, name); + if (obj == NULL) return GL_FALSE; + + return obj->EverBound; } |