summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2012-12-19 13:43:31 -0800
committerMatt Turner <[email protected]>2012-12-21 20:03:07 -0800
commitfd93d55141f11069fb76a9b377ad1af88d0ecdd3 (patch)
treea50a44d58a3830168b61cd14b0819365c4ccadaa /src/mesa
parent54203ef5ace8073327f0b41b6abbe4ce5b23fa65 (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')
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/transformfeedback.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 097cdc14f58..a14520fb23c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1807,6 +1807,7 @@ struct gl_transform_feedback_object
GLboolean Paused; /**< Is transform feedback paused? */
GLboolean EndedAnytime; /**< Has EndTransformFeedback been called
at least once? */
+ GLboolean EverBound; /**< Has this object been bound? */
/**
* GLES: if Active is true, remaining number of primitives which can be
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;
}