Chris Forbes <chr...@ijw.co.nz> writes: > Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series. > > Signed-off-by: Chris Forbes <chr...@ijw.co.nz> > --- > src/mesa/main/api_validate.c | 163 > +++++++++++++++++++++++++++++++++++++++++++ > src/mesa/main/api_validate.h | 26 +++++++ > 2 files changed, 189 insertions(+) > > diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c > index f285c97..befd69f 100644 > --- a/src/mesa/main/api_validate.c > +++ b/src/mesa/main/api_validate.c > @@ -837,3 +837,166 @@ _mesa_validate_DrawTransformFeedback(struct gl_context > *ctx, > > return GL_TRUE; > } > + > +static GLboolean > +valid_draw_indirect(struct gl_context *ctx, > + GLenum mode, const GLvoid *indirect, > + GLsizei size, const char *name) > +{ > + const GLsizeiptr end = (GLsizeiptr)indirect + size; > + > + if (!_mesa_valid_prim_mode(ctx, mode, name)) > + return GL_FALSE; > + > + if ((GLsizeiptr)indirect & (sizeof(GLuint) - 1)) { > + _mesa_error(ctx, GL_INVALID_OPERATION, > + "%s(indirect is not aligned)", name); > + return GL_FALSE; > + } > + > + if (_mesa_is_bufferobj(ctx->DrawIndirectBuffer)) { > + if (_mesa_bufferobj_mapped(ctx->DrawIndirectBuffer)) { > + _mesa_error(ctx, GL_INVALID_OPERATION, > + "%s(DRAW_INDIRECT_BUFFER is mapped)", name); > + return GL_FALSE; > + }
Other BO usage in the draw path doesn't check that buffers aren't mapped. What makes this path special? > + if (ctx->DrawIndirectBuffer->Size < end) { > + _mesa_error(ctx, GL_INVALID_OPERATION, > + "%s(DRAW_INDIRECT_BUFFER too small)", name); > + return GL_FALSE; > + }
pgpTXinCnuteS.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev