[Mesa-dev] [PATCH 3/4] mesa: inline bind_vertex_array() helper

Timothy Arceri tarceri at itsqueeze.com
Mon Apr 24 05:28:48 UTC 2017


The previous commit removed the only other user of this function.
---
 src/mesa/main/arrayobj.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 1050201..c52a07b 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -410,33 +410,33 @@ _mesa_all_buffers_are_unmapped(const struct gl_vertex_array_object *vao)
 
    return true;
 }
 
 /**********************************************************************/
 /* API Functions                                                      */
 /**********************************************************************/
 
 
 /**
- * Helper for _mesa_BindVertexArray().
- * \param genRequired  specifies behavour when id was not generated with
- *                     glGenVertexArrays().
+ * ARB version of glBindVertexArray()
  */
-static void
-bind_vertex_array(struct gl_context *ctx, GLuint id)
+void GLAPIENTRY
+_mesa_BindVertexArray( GLuint id )
 {
+   GET_CURRENT_CONTEXT(ctx);
+
    struct gl_vertex_array_object * const oldObj = ctx->Array.VAO;
    struct gl_vertex_array_object *newObj = NULL;
 
    assert(oldObj != NULL);
 
-   if ( oldObj->Name == id )
+   if (oldObj->Name == id)
       return;   /* rebinding the same array object- no change */
 
    /*
     * Get pointer to new array object (newObj)
     */
    if (id == 0) {
       /* The spec says there is no array object named 0, but we use
        * one internally because it simplifies things.
        */
       newObj = ctx->Array.DefaultVAO;
@@ -476,31 +476,20 @@ bind_vertex_array(struct gl_context *ctx, GLuint id)
       ctx->Array._DrawArrays = NULL;
       ctx->Array.DrawMethod = DRAW_NONE;
    }
 
    ctx->NewState |= _NEW_ARRAY;
    _mesa_reference_vao(ctx, &ctx->Array.VAO, newObj);
 }
 
 
 /**
- * ARB version of glBindVertexArray()
- */
-void GLAPIENTRY
-_mesa_BindVertexArray( GLuint id )
-{
-   GET_CURRENT_CONTEXT(ctx);
-   bind_vertex_array(ctx, id);
-}
-
-
-/**
  * Delete a set of array objects.
  *
  * \param n      Number of array objects to delete.
  * \param ids    Array of \c n array object IDs.
  */
 void GLAPIENTRY
 _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids)
 {
    GET_CURRENT_CONTEXT(ctx);
    GLsizei i;
-- 
2.9.3



More information about the mesa-dev mailing list