diff options
author | Marek Olšák <[email protected]> | 2011-12-18 04:51:48 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-12 13:05:59 +0200 |
commit | db7404defd47aa22082b52a6a31a08fb39fab626 (patch) | |
tree | 2ff43940b78d0c1b1fb1d0537847cd124fa1033e /src/mesa/main/api_validate.c | |
parent | 7e0cb473b063072fee121d536e7e37679528e991 (diff) |
mesa: implement new DrawTransformFeedback functions
Acked-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r-- | src/mesa/main/api_validate.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index cf6aaf0c687..ece0a2b4ad7 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -593,26 +593,42 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, GLboolean _mesa_validate_DrawTransformFeedback(struct gl_context *ctx, GLenum mode, - struct gl_transform_feedback_object *obj) + struct gl_transform_feedback_object *obj, + GLuint stream, + GLsizei numInstances) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); FLUSH_CURRENT(ctx, 0); - if (!_mesa_valid_prim_mode(ctx, mode, "glDrawTransformFeedback")) { + if (!_mesa_valid_prim_mode(ctx, mode, "glDrawTransformFeedback*(mode)")) { return GL_FALSE; } if (!obj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTransformFeedback(name)"); + _mesa_error(ctx, GL_INVALID_VALUE, "glDrawTransformFeedback*(name)"); return GL_FALSE; } if (!obj->EndedAnytime) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawTransformFeedback"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawTransformFeedback*"); return GL_FALSE; } - if (!check_valid_to_render(ctx, "glDrawTransformFeedback")) { + if (stream >= ctx->Const.MaxVertexStreams) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glDrawTransformFeedbackStream*(index>=MaxVertexStream)"); + return GL_FALSE; + } + + if (numInstances <= 0) { + if (numInstances < 0) + _mesa_error(ctx, GL_INVALID_VALUE, + "glDrawTransformFeedback*Instanced(numInstances=%d)", + numInstances); + return GL_FALSE; + } + + if (!check_valid_to_render(ctx, "glDrawTransformFeedback*")) { return GL_FALSE; } |