diff options
author | Samuel Pitoiset <[email protected]> | 2017-07-18 18:17:35 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-07-31 13:53:39 +0200 |
commit | ef22651d7e5303edf5f2ee98a35187b48203a9e0 (patch) | |
tree | d6626a2981929cac7821002d228913f2cda5c4f8 | |
parent | 4b0a33d233469fd646852b7d783d5170113dd629 (diff) |
mesa: add delete_vertex_arrays() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r-- | src/mesa/main/arrayobj.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 77c0206ecfd..2c95b001a25 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -466,17 +466,11 @@ _mesa_BindVertexArray(GLuint id) * \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) +static void +delete_vertex_arrays(struct gl_context *ctx, GLsizei n, const GLuint *ids) { - GET_CURRENT_CONTEXT(ctx); GLsizei i; - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArray(n)"); - return; - } - for (i = 0; i < n; i++) { struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]); @@ -488,7 +482,7 @@ _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids) * becomes current." */ if (obj == ctx->Array.VAO) - _mesa_BindVertexArray(0); + _mesa_BindVertexArray_no_error(0); /* The ID is immediately freed for re-use */ _mesa_HashRemoveLocked(ctx->Array.Objects, obj->Name); @@ -505,6 +499,20 @@ _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids) } +void GLAPIENTRY +_mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids) +{ + GET_CURRENT_CONTEXT(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArray(n)"); + return; + } + + delete_vertex_arrays(ctx, n, ids); +} + + /** * Generate a set of unique array object IDs and store them in \c arrays. * Helper for _mesa_GenVertexArrays() and _mesa_CreateVertexArrays() |