summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-11-01 07:25:42 +0100
committerMathias Fröhlich <[email protected]>2018-11-02 08:42:03 +0100
commit9f009c1a8f93b29c3a09fd68f81bab248e0686f2 (patch)
treee0c59aa5bf65f1e9ba285cc1301c2054670614d9 /src/mesa
parentc7bdda8aa5f1fb1d797512a0a54a032153755c6c (diff)
mesa: Remove needless indirection in some draw functions.
Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/draw.c164
-rw-r--r--src/mesa/main/draw.h6
2 files changed, 44 insertions, 126 deletions
diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c
index cceadf2613a..99ea4d928be 100644
--- a/src/mesa/main/draw.c
+++ b/src/mesa/main/draw.c
@@ -274,7 +274,7 @@ print_draw_arrays(struct gl_context *ctx,
{
const struct gl_vertex_array_object *vao = ctx->Array.VAO;
- printf("_mesa_exec_DrawArrays(mode 0x%x, start %d, count %d):\n",
+ printf("_mesa_DrawArrays(mode 0x%x, start %d, count %d):\n",
mode, start, count);
unsigned i;
@@ -538,8 +538,8 @@ _mesa_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
/**
* Called from glDrawArrays when in immediate mode (not display list mode).
*/
-static void GLAPIENTRY
-_mesa_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
+void GLAPIENTRY
+_mesa_DrawArrays(GLenum mode, GLint start, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
@@ -573,9 +573,9 @@ _mesa_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
* Called from glDrawArraysInstanced when in immediate mode (not
* display list mode).
*/
-static void GLAPIENTRY
-_mesa_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
- GLsizei numInstances)
+void GLAPIENTRY
+_mesa_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
+ GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
@@ -859,10 +859,10 @@ _mesa_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
/**
* Called by glDrawRangeElementsBaseVertex() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
- 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)
{
static GLuint warnCount = 0;
GLboolean index_bounds_valid = GL_TRUE;
@@ -958,9 +958,9 @@ _mesa_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
/**
* Called by glDrawRangeElements() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type, const GLvoid * indices)
+void GLAPIENTRY
+_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
+ GLsizei count, GLenum type, const GLvoid * indices)
{
if (MESA_VERBOSE & VERBOSE_DRAW) {
GET_CURRENT_CONTEXT(ctx);
@@ -970,17 +970,17 @@ _mesa_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
_mesa_enum_to_string(type), indices);
}
- _mesa_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
- indices, 0);
+ _mesa_DrawRangeElementsBaseVertex(mode, start, end, count, type,
+ indices, 0);
}
/**
* Called by glDrawElements() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid * indices)
+void GLAPIENTRY
+_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1009,9 +1009,9 @@ _mesa_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
/**
* Called by glDrawElementsBaseVertex() in immediate mode.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
- const GLvoid * indices, GLint basevertex)
+void GLAPIENTRY
+_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
+ const GLvoid * indices, GLint basevertex)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1321,10 +1321,9 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
}
-static void GLAPIENTRY
-_mesa_exec_MultiDrawElements(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid * const *indices, GLsizei primcount)
+void GLAPIENTRY
+_mesa_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid * const *indices, GLsizei primcount)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1344,12 +1343,12 @@ _mesa_exec_MultiDrawElements(GLenum mode,
}
-static void GLAPIENTRY
-_mesa_exec_MultiDrawElementsBaseVertex(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid * const *indices,
- GLsizei primcount,
- const GLsizei *basevertex)
+void GLAPIENTRY
+_mesa_MultiDrawElementsBaseVertex(GLenum mode,
+ const GLsizei *count, GLenum type,
+ const GLvoid * const *indices,
+ GLsizei primcount,
+ const GLsizei *basevertex)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1444,8 +1443,8 @@ _mesa_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
* glVertexPointer, glColorPointer, etc.
* Part of GL_ARB_transform_feedback2.
*/
-static void GLAPIENTRY
-_mesa_exec_DrawTransformFeedback(GLenum mode, GLuint name)
+void GLAPIENTRY
+_mesa_DrawTransformFeedback(GLenum mode, GLuint name)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_transform_feedback_object *obj =
@@ -1997,15 +1996,15 @@ void
_mesa_initialize_exec_dispatch(const struct gl_context *ctx,
struct _glapi_table *exec)
{
- SET_DrawArrays(exec, _mesa_exec_DrawArrays);
- SET_DrawElements(exec, _mesa_exec_DrawElements);
+ SET_DrawArrays(exec, _mesa_DrawArrays);
+ SET_DrawElements(exec, _mesa_DrawElements);
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawRangeElements(exec, _mesa_exec_DrawRangeElements);
+ SET_DrawRangeElements(exec, _mesa_DrawRangeElements);
}
SET_MultiDrawArrays(exec, _mesa_exec_MultiDrawArrays);
- SET_MultiDrawElementsEXT(exec, _mesa_exec_MultiDrawElements);
+ SET_MultiDrawElementsEXT(exec, _mesa_MultiDrawElements);
if (ctx->API == API_OPENGL_COMPAT) {
SET_Rectf(exec, _mesa_exec_Rectf);
@@ -2015,13 +2014,13 @@ _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
if (ctx->API != API_OPENGLES &&
ctx->Extensions.ARB_draw_elements_base_vertex) {
- SET_DrawElementsBaseVertex(exec, _mesa_exec_DrawElementsBaseVertex);
+ SET_DrawElementsBaseVertex(exec, _mesa_DrawElementsBaseVertex);
SET_MultiDrawElementsBaseVertex(exec,
- _mesa_exec_MultiDrawElementsBaseVertex);
+ _mesa_MultiDrawElementsBaseVertex);
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_DrawRangeElementsBaseVertex(exec,
- _mesa_exec_DrawRangeElementsBaseVertex);
+ _mesa_DrawRangeElementsBaseVertex);
SET_DrawElementsInstancedBaseVertex(exec,
_mesa_exec_DrawElementsInstancedBaseVertex);
}
@@ -2042,12 +2041,12 @@ _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
}
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
- SET_DrawArraysInstancedARB(exec, _mesa_exec_DrawArraysInstanced);
+ SET_DrawArraysInstancedARB(exec, _mesa_DrawArraysInstanced);
SET_DrawElementsInstancedARB(exec, _mesa_exec_DrawElementsInstanced);
}
if (_mesa_is_desktop_gl(ctx)) {
- SET_DrawTransformFeedback(exec, _mesa_exec_DrawTransformFeedback);
+ SET_DrawTransformFeedback(exec, _mesa_DrawTransformFeedback);
SET_DrawTransformFeedbackStream(exec,
_mesa_exec_DrawTransformFeedbackStream);
SET_DrawTransformFeedbackInstanced(exec,
@@ -2065,87 +2064,6 @@ _mesa_initialize_exec_dispatch(const struct gl_context *ctx,
-/**
- * The following functions are only used for OpenGL ES 1/2 support.
- * And some aren't even supported (yet) in ES 1/2.
- */
-
-
-void GLAPIENTRY
-_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- _mesa_exec_DrawArrays(mode, first, count);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
- GLsizei primcount)
-{
- _mesa_exec_DrawArraysInstanced(mode, first, count, primcount);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- _mesa_exec_DrawElements(mode, count, type, indices);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLint basevertex)
-{
- _mesa_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
- GLenum type, const GLvoid * indices)
-{
- _mesa_exec_DrawRangeElements(mode, start, end, count, type, indices);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices, GLint basevertex)
-{
- _mesa_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
- indices, basevertex);
-}
-
-
-void GLAPIENTRY
-_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
- const GLvoid ** indices, GLsizei primcount)
-{
- _mesa_exec_MultiDrawElements(mode, count, type, indices, primcount);
-}
-
-
-void GLAPIENTRY
-_mesa_MultiDrawElementsBaseVertex(GLenum mode,
- const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount,
- const GLint *basevertex)
-{
- _mesa_exec_MultiDrawElementsBaseVertex(mode, count, type, indices,
- primcount, basevertex);
-}
-
-
-void GLAPIENTRY
-_mesa_DrawTransformFeedback(GLenum mode, GLuint name)
-{
- _mesa_exec_DrawTransformFeedback(mode, name);
-}
-
-
/* GL_IBM_multimode_draw_arrays */
void GLAPIENTRY
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
diff --git a/src/mesa/main/draw.h b/src/mesa/main/draw.h
index 76d54f48222..b8e61132137 100644
--- a/src/mesa/main/draw.h
+++ b/src/mesa/main/draw.h
@@ -129,14 +129,14 @@ _mesa_MultiDrawArrays(GLenum mode, const GLint *first,
void GLAPIENTRY
-_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount);
+_mesa_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
+ const GLvoid *const *indices, GLsizei primcount);
void GLAPIENTRY
_mesa_MultiDrawElementsBaseVertex(GLenum mode,
const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount,
+ const GLvoid * const * indices, GLsizei primcount,
const GLint *basevertex);