mesa: make valid_draw_indirect_multi() accessible externally
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 25 Jun 2018 00:31:34 +0000 (10:31 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 29 Jun 2018 22:38:33 +0000 (08:38 +1000)
We will use this to add compat support to ARB_multi_draw_indirect
in the following patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/draw_validate.c
src/mesa/main/draw_validate.h

index 352263c5c7820645e837365099f9565163137fbe..c0a234a2bc286c1cc07ce93ad26dc14c7424982c 100644 (file)
@@ -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 */
index 7a181153fb748579fe4bc3ab9f11aaf9b6d84308..d015c7e830e7c8c990551547335f5921b9626f49 100644 (file)
@@ -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);