diff options
Diffstat (limited to 'src/mesa/main/transformfeedback.c')
-rw-r--r-- | src/mesa/main/transformfeedback.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 305589df75a..6e93b3b49d1 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -342,9 +342,12 @@ void GLAPIENTRY _mesa_BeginTransformFeedback(GLenum mode) { struct gl_transform_feedback_object *obj; + struct gl_transform_feedback_info *info; + int i; GET_CURRENT_CONTEXT(ctx); obj = ctx->TransformFeedback.CurrentObject; + info = &ctx->Shader.CurrentVertexProgram->LinkedTransformFeedback; switch (mode) { case GL_POINTS: @@ -363,6 +366,15 @@ _mesa_BeginTransformFeedback(GLenum mode) return; } + for (i = 0; i < info->NumBuffers; ++i) { + if (obj->BufferNames[i] == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBeginTransformFeedback(binding point %d does not have " + "a buffer object bound)", i); + return; + } + } + FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); obj->Active = GL_TRUE; ctx->TransformFeedback.Mode = mode; |