summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-05-01 19:15:33 -0600
committerBrian Paul <[email protected]>2013-05-02 09:03:16 -0600
commit49993a1a9dc34b78ccd345b91087385917a40138 (patch)
tree5bcfe73f282e120f9652ffbe7ec53d58d9a3b008 /src/mesa/main
parent79679e258b7aa4b1dc672c03795d47456893f881 (diff)
mesa: simplify dispatch for glDraw* functions
Remove all the glDraw* functions from the GLvertexformat structure. The point of that dispatch struct is to handle all the functions which dispatch differently depending on whether we're inside glBegin/End. glDraw* are never allowed inside glBegin/End so we can remove those entries. This simplifies the code paths and gets rid of quite a bit of code. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h58
-rw-r--r--src/mesa/main/dlist.c45
-rw-r--r--src/mesa/main/vtxfmt.c43
3 files changed, 17 insertions, 129 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 916f38bd8c1..c5d7ad419c5 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1025,64 +1025,6 @@ typedef struct {
void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
/**
- * \name Array
- */
- /*@{*/
- void (GLAPIENTRYP DrawArrays)( GLenum mode, GLint start, GLsizei count );
- void (GLAPIENTRYP DrawElements)( GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices );
- void (GLAPIENTRYP DrawRangeElements)( GLenum mode, GLuint start,
- GLuint end, GLsizei count,
- GLenum type, const GLvoid *indices );
- void (GLAPIENTRYP MultiDrawElementsEXT)( GLenum mode, const GLsizei *count,
- GLenum type,
- const GLvoid **indices,
- GLsizei primcount);
- void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLint basevertex );
- void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start,
- GLuint end, GLsizei count,
- GLenum type,
- const GLvoid *indices,
- GLint basevertex);
- void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
- const GLsizei *count,
- GLenum type,
- const GLvoid * const *indices,
- GLsizei primcount,
- const GLint *basevertex);
- void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
- GLsizei count, GLsizei primcount);
- void (GLAPIENTRYP DrawArraysInstancedBaseInstance)(GLenum mode, GLint first,
- GLsizei count, GLsizei primcount,
- GLuint baseinstance);
- void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices,
- GLsizei primcount);
- void (GLAPIENTRYP DrawElementsInstancedBaseInstance)(GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices,
- GLsizei primcount, GLuint baseinstance);
- void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices,
- GLsizei primcount, GLint basevertex);
- void (GLAPIENTRYP DrawElementsInstancedBaseVertexBaseInstance)(GLenum mode, GLsizei count,
- GLenum type, const GLvoid *indices,
- GLsizei primcount, GLint basevertex,
- GLuint baseinstance);
- void (GLAPIENTRYP DrawTransformFeedback)(GLenum mode, GLuint name);
- void (GLAPIENTRYP DrawTransformFeedbackStream)(GLenum mode, GLuint name,
- GLuint stream);
- void (GLAPIENTRYP DrawTransformFeedbackInstanced)(GLenum mode, GLuint name,
- GLsizei primcount);
- void (GLAPIENTRYP DrawTransformFeedbackStreamInstanced)(GLenum mode,
- GLuint name,
- GLuint stream,
- GLsizei primcount);
- /*@}*/
-
- /**
* \name Eval
*
* If you don't support eval, fallback to the default vertex format
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 3823828ba35..18c05f0615b 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -69,6 +69,8 @@
#include "main/dispatch.h"
+#include "vbo/vbo.h"
+
/**
@@ -8820,6 +8822,9 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
_mesa_loopback_init_api_table(ctx, table);
+ /* VBO functions */
+ vbo_initialize_save_dispatch(ctx, table);
+
/* GL 1.0 */
SET_Accum(table, save_Accum);
SET_AlphaFunc(table, save_AlphaFunc);
@@ -9259,6 +9264,18 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
/* GL_ARB_uniform_buffer_object */
SET_UniformBlockBinding(table, save_UniformBlockBinding);
+
+ /* GL_ARB_draw_instanced */
+ SET_DrawArraysInstancedARB(table, save_DrawArraysInstancedARB);
+ SET_DrawElementsInstancedARB(table, save_DrawElementsInstancedARB);
+
+ /* GL_ARB_draw_elements_base_vertex */
+ SET_DrawElementsInstancedBaseVertex(table, save_DrawElementsInstancedBaseVertexARB);
+
+ /* GL_ARB_base_instance */
+ SET_DrawArraysInstancedBaseInstance(table, save_DrawArraysInstancedBaseInstance);
+ SET_DrawElementsInstancedBaseInstance(table, save_DrawElementsInstancedBaseInstance);
+ SET_DrawElementsInstancedBaseVertexBaseInstance(table, save_DrawElementsInstancedBaseVertexBaseInstance);
}
@@ -9618,34 +9635,6 @@ save_vtxfmt_init(GLvertexformat * vfmt)
vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB;
vfmt->Rectf = save_Rectf;
-
- /* GL_ARB_draw_instanced */
- vfmt->DrawArraysInstanced = save_DrawArraysInstancedARB;
- vfmt->DrawElementsInstanced = save_DrawElementsInstancedARB;
-
- /* GL_ARB_draw_elements_base_vertex */
- vfmt->DrawElementsInstancedBaseVertex = save_DrawElementsInstancedBaseVertexARB;
-
- /* GL_ARB_base_instance */
- vfmt->DrawArraysInstancedBaseInstance = save_DrawArraysInstancedBaseInstance;
- vfmt->DrawElementsInstancedBaseInstance = save_DrawElementsInstancedBaseInstance;
- vfmt->DrawElementsInstancedBaseVertexBaseInstance = save_DrawElementsInstancedBaseVertexBaseInstance;
-
- /* The driver is required to implement these as
- * 1) They can probably do a better job.
- * 2) A lot of new mechanisms would have to be added to this module
- * to support it. That code would probably never get used,
- * because of (1).
- */
-#if 0
- vfmt->DrawArrays = 0;
- vfmt->DrawElements = 0;
- vfmt->DrawRangeElements = 0;
- vfmt->MultiDrawElemementsEXT = 0;
- vfmt->DrawElementsBaseVertex = 0;
- vfmt->DrawRangeElementsBaseVertex = 0;
- vfmt->MultiDrawElemementsBaseVertex = 0;
-#endif
}
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index a2f41507855..db389a573f9 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -116,49 +116,6 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_Rectf(tab, vfmt->Rectf);
}
- if (!beginend) {
- /* These functions are only valid outside glBegin/glEnd */
- SET_DrawArrays(tab, vfmt->DrawArrays);
- SET_DrawElements(tab, vfmt->DrawElements);
-
- if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
- }
-
- SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT);
-
- if (_mesa_is_desktop_gl(ctx)) {
- SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex);
- SET_DrawRangeElementsBaseVertex(tab,
- vfmt->DrawRangeElementsBaseVertex);
- SET_MultiDrawElementsBaseVertex(tab,
- vfmt->MultiDrawElementsBaseVertex);
- SET_DrawArraysInstancedBaseInstance(tab,
- vfmt->DrawArraysInstancedBaseInstance);
- SET_DrawElementsInstancedBaseInstance(tab,
- vfmt->DrawElementsInstancedBaseInstance);
- SET_DrawElementsInstancedBaseVertex(tab,
- vfmt->DrawElementsInstancedBaseVertex);
- SET_DrawElementsInstancedBaseVertexBaseInstance(tab,
- vfmt->DrawElementsInstancedBaseVertexBaseInstance);
- }
-
- if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced);
- SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced);
- }
-
- if (_mesa_is_desktop_gl(ctx)) {
- SET_DrawTransformFeedback(tab, vfmt->DrawTransformFeedback);
- SET_DrawTransformFeedbackStream(tab,
- vfmt->DrawTransformFeedbackStream);
- SET_DrawTransformFeedbackInstanced(tab,
- vfmt->DrawTransformFeedbackInstanced);
- SET_DrawTransformFeedbackStreamInstanced(tab,
- vfmt->DrawTransformFeedbackStreamInstanced);
- }
- }
-
/* Originally for GL_NV_vertex_program, this is also used by dlist.c */
if (ctx->API == API_OPENGL_COMPAT) {
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);