aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/api_validate.c')
-rw-r--r--mesalib/src/mesa/main/api_validate.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index cf6aaf0c6..ece0a2b4a 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/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;
}