mesa: Collect all the draw functions in draw.{h,c}.
authorMathias Fröhlich <mathias.froehlich@web.de>
Mon, 29 Oct 2018 05:13:20 +0000 (06:13 +0100)
committerMathias Fröhlich <mathias.froehlich@web.de>
Thu, 1 Nov 2018 05:08:49 +0000 (06:08 +0100)
Some of these functions were distributed across different
implementation and header files. Put them at a central place.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/mesa/drivers/common/meta.c
src/mesa/main/draw.c
src/mesa/main/draw.h
src/mesa/main/varray.c
src/mesa/main/varray.h

index 056a181c17b2d08b85a3c6cd14c110a22aaec351..4392c4bbd88655bd00468d330fc3d13096945fa5 100644 (file)
@@ -42,6 +42,7 @@
 #include "main/buffers.h"
 #include "main/clear.h"
 #include "main/condrender.h"
+#include "main/draw.h"
 #include "main/depth.h"
 #include "main/enable.h"
 #include "main/fbobject.h"
index 85a9eedbc3225574a1c4c770cdbd9e599b603131..cceadf2613aca18a296efd521f56f0f29a06d5e0 100644 (file)
@@ -2146,6 +2146,49 @@ _mesa_DrawTransformFeedback(GLenum mode, GLuint name)
 }
 
 
+/* GL_IBM_multimode_draw_arrays */
+void GLAPIENTRY
+_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
+                              const GLsizei * count,
+                              GLsizei primcount, GLint modestride )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint i;
+
+   FLUSH_VERTICES(ctx, 0);
+
+   for ( i = 0 ; i < primcount ; i++ ) {
+      if ( count[i] > 0 ) {
+         GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
+         CALL_DrawArrays(ctx->CurrentServerDispatch, ( m, first[i], count[i] ));
+      }
+   }
+}
+
+
+/* GL_IBM_multimode_draw_arrays */
+void GLAPIENTRY
+_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
+                                GLenum type, const GLvoid * const * indices,
+                                GLsizei primcount, GLint modestride )
+{
+   GET_CURRENT_CONTEXT(ctx);
+   GLint i;
+
+   FLUSH_VERTICES(ctx, 0);
+
+   /* XXX not sure about ARB_vertex_buffer_object handling here */
+
+   for ( i = 0 ; i < primcount ; i++ ) {
+      if ( count[i] > 0 ) {
+         GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
+         CALL_DrawElements(ctx->CurrentServerDispatch, ( m, count[i], type,
+                                                         indices[i] ));
+      }
+   }
+}
+
+
 /*
  * Helper function for _mesa_draw_indirect below that additionally takes a zero
  * initialized array of _mesa_prim scratch space memory as the last argument.
index 57b3ec9e7db6ac4205c7e416b84bfd46f030859d..76d54f48222734bf3a88db2de8522c6068806f83 100644 (file)
@@ -87,6 +87,71 @@ _mesa_draw_indirect(struct gl_context *ctx, GLuint mode,
                     const struct _mesa_index_buffer *ib);
 
 
+void GLAPIENTRY
+_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
+
+
+void GLAPIENTRY
+_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
+                          GLsizei primcount);
+
+
+void GLAPIENTRY
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+                   const GLvoid *indices);
+
+
+void GLAPIENTRY
+_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
+                        GLenum type, const GLvoid *indices);
+
+
+void GLAPIENTRY
+_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+                             const GLvoid *indices, GLint basevertex);
+
+
+void GLAPIENTRY
+_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
+                                  GLsizei count, GLenum type,
+                                  const GLvoid *indices,
+                                  GLint basevertex);
+
+
+void GLAPIENTRY
+_mesa_DrawTransformFeedback(GLenum mode, GLuint name);
+
+
+
+void GLAPIENTRY
+_mesa_MultiDrawArrays(GLenum mode, const GLint *first,
+                      const GLsizei *count, GLsizei primcount);
+
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
+                           const GLvoid **indices, GLsizei primcount);
+
+
+void GLAPIENTRY
+_mesa_MultiDrawElementsBaseVertex(GLenum mode,
+                                  const GLsizei *count, GLenum type,
+                                  const GLvoid **indices, GLsizei primcount,
+                                  const GLint *basevertex);
+
+
+void GLAPIENTRY
+_mesa_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
+                             const GLsizei * count,
+                             GLsizei primcount, GLint modestride);
+
+
+void GLAPIENTRY
+_mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count,
+                               GLenum type, const GLvoid * const * indices,
+                               GLsizei primcount, GLint modestride);
+
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a3e1aebb76cd391e58a285637d62fd6650641489..2e27a16a99b281083f078826082782a83b0b8a12 100644 (file)
@@ -1905,49 +1905,6 @@ _mesa_UnlockArraysEXT( void )
 }
 
 
-/* GL_IBM_multimode_draw_arrays */
-void GLAPIENTRY
-_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
-                             const GLsizei * count,
-                             GLsizei primcount, GLint modestride )
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLint i;
-
-   FLUSH_VERTICES(ctx, 0);
-
-   for ( i = 0 ; i < primcount ; i++ ) {
-      if ( count[i] > 0 ) {
-         GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
-        CALL_DrawArrays(ctx->CurrentServerDispatch, ( m, first[i], count[i] ));
-      }
-   }
-}
-
-
-/* GL_IBM_multimode_draw_arrays */
-void GLAPIENTRY
-_mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
-                               GLenum type, const GLvoid * const * indices,
-                               GLsizei primcount, GLint modestride )
-{
-   GET_CURRENT_CONTEXT(ctx);
-   GLint i;
-
-   FLUSH_VERTICES(ctx, 0);
-
-   /* XXX not sure about ARB_vertex_buffer_object handling here */
-
-   for ( i = 0 ; i < primcount ; i++ ) {
-      if ( count[i] > 0 ) {
-         GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
-        CALL_DrawElements(ctx->CurrentServerDispatch, ( m, count[i], type,
-                                                        indices[i] ));
-      }
-   }
-}
-
-
 static void
 primitive_restart_index(struct gl_context *ctx, GLuint index)
 {
index a901bf9171dc74e42c6d710d67478022f7e06d03..a2477a7c6fea5f71b4eb2b898c3110116bef7dcf 100644 (file)
@@ -270,31 +270,6 @@ extern void GLAPIENTRY
 _mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
 
 
-extern void GLAPIENTRY
-_mesa_MultiDrawArrays(GLenum mode, const GLint *first,
-                      const GLsizei *count, GLsizei primcount);
-
-extern void GLAPIENTRY
-_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
-                           const GLvoid **indices, GLsizei primcount);
-
-extern void GLAPIENTRY
-_mesa_MultiDrawElementsBaseVertex(GLenum mode,
-                                  const GLsizei *count, GLenum type,
-                                  const GLvoid **indices, GLsizei primcount,
-                                  const GLint *basevertex);
-
-extern void GLAPIENTRY
-_mesa_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first,
-                             const GLsizei * count,
-                             GLsizei primcount, GLint modestride );
-
-
-extern void GLAPIENTRY
-_mesa_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count,
-                               GLenum type, const GLvoid * const * indices,
-                               GLsizei primcount, GLint modestride );
-
 extern void GLAPIENTRY
 _mesa_LockArraysEXT(GLint first, GLsizei count);
 
@@ -302,34 +277,6 @@ extern void GLAPIENTRY
 _mesa_UnlockArraysEXT(void);
 
 
-extern void GLAPIENTRY
-_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
-
-extern void GLAPIENTRY
-_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
-                          GLsizei primcount);
-
-extern void GLAPIENTRY
-_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
-                   const GLvoid *indices);
-
-extern void GLAPIENTRY
-_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
-                        GLenum type, const GLvoid *indices);
-
-extern void GLAPIENTRY
-_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
-                             const GLvoid *indices, GLint basevertex);
-
-extern void GLAPIENTRY
-_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
-                                  GLsizei count, GLenum type,
-                                  const GLvoid *indices,
-                                  GLint basevertex);
-
-extern void GLAPIENTRY
-_mesa_DrawTransformFeedback(GLenum mode, GLuint name);
-
 void GLAPIENTRY
 _mesa_PrimitiveRestartIndex_no_error(GLuint index);