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 | |
parent | 7e0cb473b063072fee121d536e7e37679528e991 (diff) |
mesa: implement new DrawTransformFeedback functions
Acked-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/api_validate.c | 26 | ||||
-rw-r--r-- | src/mesa/main/api_validate.h | 4 | ||||
-rw-r--r-- | src/mesa/main/vtxfmt.c | 5 |
3 files changed, 29 insertions, 6 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; } diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h index 59f3297681e..8dc8df4b2fc 100644 --- a/src/mesa/main/api_validate.h +++ b/src/mesa/main/api_validate.h @@ -83,7 +83,9 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, extern 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); #endif diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index a27596a9864..bf7a54c0ad6 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -111,6 +111,11 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex); SET_DrawElementsInstancedBaseVertexBaseInstance(tab, vfmt->DrawElementsInstancedBaseVertexBaseInstance); SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback); + SET_DrawTransformFeedbackStream(tab, vfmt->DrawTransformFeedbackStream); + SET_DrawTransformFeedbackInstanced(tab, + vfmt->DrawTransformFeedbackInstanced); + SET_DrawTransformFeedbackStreamInstanced(tab, + vfmt->DrawTransformFeedbackStreamInstanced); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); |