aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/draw.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-10-29 06:13:20 +0100
committerMathias Fröhlich <[email protected]>2018-11-01 06:08:49 +0100
commitad52e19408c1b830dc059bda84443341f6b4e65c (patch)
treea3e21aaca21911b14ccd71f340ecec66b1b0a3cf /src/mesa/main/draw.c
parent3d64f3c79564f562cc56add8b8ba9659fd19a97d (diff)
mesa: Collect all the draw functions in draw.{h,c}.
Some of these functions were distributed across different implementation and header files. Put them at a central place. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/draw.c')
-rw-r--r--src/mesa/main/draw.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c
index 85a9eedbc32..cceadf2613a 100644
--- a/src/mesa/main/draw.c
+++ b/src/mesa/main/draw.c
@@ -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.