From 103b8f11d660457c8b1c0041bb85a2f0e8d2ec95 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 25 Jun 2018 10:31:34 +1000 Subject: [PATCH] mesa: make valid_draw_indirect_multi() accessible externally MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We will use this to add compat support to ARB_multi_draw_indirect in the following patch. Reviewed-by: Marek Olšák --- src/mesa/main/draw_validate.c | 24 ++++++++++++------------ src/mesa/main/draw_validate.h | 3 +++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/mesa/main/draw_validate.c b/src/mesa/main/draw_validate.c index 352263c5c78..c0a234a2bc2 100644 --- a/src/mesa/main/draw_validate.c +++ b/src/mesa/main/draw_validate.c @@ -1192,10 +1192,10 @@ valid_draw_indirect_elements(struct gl_context *ctx, return valid_draw_indirect(ctx, mode, indirect, size, name); } -static inline GLboolean -valid_draw_indirect_multi(struct gl_context *ctx, - GLsizei primcount, GLsizei stride, - const char *name) +GLboolean +_mesa_valid_draw_indirect_multi(struct gl_context *ctx, + GLsizei primcount, GLsizei stride, + const char *name) { /* From the ARB_multi_draw_indirect specification: @@ -1259,8 +1259,8 @@ _mesa_validate_MultiDrawArraysIndirect(struct gl_context *ctx, /* caller has converted stride==0 to drawArraysNumParams * sizeof(GLuint) */ assert(stride != 0); - if (!valid_draw_indirect_multi(ctx, primcount, stride, - "glMultiDrawArraysIndirect")) + if (!_mesa_valid_draw_indirect_multi(ctx, primcount, stride, + "glMultiDrawArraysIndirect")) return GL_FALSE; /* number of bytes of the indirect buffer which will be read */ @@ -1287,8 +1287,8 @@ _mesa_validate_MultiDrawElementsIndirect(struct gl_context *ctx, /* caller has converted stride==0 to drawElementsNumParams * sizeof(GLuint) */ assert(stride != 0); - if (!valid_draw_indirect_multi(ctx, primcount, stride, - "glMultiDrawElementsIndirect")) + if (!_mesa_valid_draw_indirect_multi(ctx, primcount, stride, + "glMultiDrawElementsIndirect")) return GL_FALSE; /* number of bytes of the indirect buffer which will be read */ @@ -1366,8 +1366,8 @@ _mesa_validate_MultiDrawArraysIndirectCount(struct gl_context *ctx, /* caller has converted stride==0 to drawArraysNumParams * sizeof(GLuint) */ assert(stride != 0); - if (!valid_draw_indirect_multi(ctx, maxdrawcount, stride, - "glMultiDrawArraysIndirectCountARB")) + if (!_mesa_valid_draw_indirect_multi(ctx, maxdrawcount, stride, + "glMultiDrawArraysIndirectCountARB")) return GL_FALSE; /* number of bytes of the indirect buffer which will be read */ @@ -1397,8 +1397,8 @@ _mesa_validate_MultiDrawElementsIndirectCount(struct gl_context *ctx, /* caller has converted stride==0 to drawElementsNumParams * sizeof(GLuint) */ assert(stride != 0); - if (!valid_draw_indirect_multi(ctx, maxdrawcount, stride, - "glMultiDrawElementsIndirectCountARB")) + if (!_mesa_valid_draw_indirect_multi(ctx, maxdrawcount, stride, + "glMultiDrawElementsIndirectCountARB")) return GL_FALSE; /* number of bytes of the indirect buffer which will be read */ diff --git a/src/mesa/main/draw_validate.h b/src/mesa/main/draw_validate.h index 7a181153fb7..d015c7e830e 100644 --- a/src/mesa/main/draw_validate.h +++ b/src/mesa/main/draw_validate.h @@ -44,6 +44,9 @@ _mesa_is_valid_prim_mode(const struct gl_context *ctx, GLenum mode); extern GLboolean _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name); +extern GLboolean +_mesa_valid_draw_indirect_multi(struct gl_context *ctx, GLsizei primcount, + GLsizei stride, const char *name); extern GLboolean _mesa_validate_DrawArrays(struct gl_context *ctx, GLenum mode, GLsizei count); -- 2.30.2