dlist: remove _mesa_dlist_alloc_aligned
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 18 Jun 2021 13:10:38 +0000 (15:10 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Jul 2021 10:05:46 +0000 (10:05 +0000)
It was only used in _mesa_dlist_alloc_vertex_list, so inline it there
instead.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11493>

src/mesa/main/dlist.c
src/mesa/main/dlist.h

index 4fcb2d9..291018c 100644 (file)
@@ -1640,14 +1640,14 @@ _mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint bytes)
 }
 
 
-/**
- * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
- * aligned in 64-bit environments, 4-byte aligned otherwise.
- */
 void *
-_mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes)
+_mesa_dlist_alloc_vertex_list(struct gl_context *ctx, bool copy_to_current)
 {
-   Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes, true);
+   Node *n =  dlist_alloc(ctx,
+                          copy_to_current ? OPCODE_VERTEX_LIST_COPY_CURRENT :
+                                            OPCODE_VERTEX_LIST,
+                          sizeof(struct vbo_save_vertex_list),
+                          true);
    if (n)
       return n + 1;  /* return pointer to payload area, after opcode */
    else
@@ -1655,16 +1655,6 @@ _mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes)
 }
 
 
-void *
-_mesa_dlist_alloc_vertex_list(struct gl_context *ctx, bool copy_to_current)
-{
-   return _mesa_dlist_alloc_aligned(ctx,
-                                    copy_to_current ? OPCODE_VERTEX_LIST_COPY_CURRENT :
-                                                      OPCODE_VERTEX_LIST,
-                                    sizeof(struct vbo_save_vertex_list));
-}
-
-
 /**
  * Allocate space for a display list instruction.  The space is basically
  * an array of Nodes where node[0] holds the opcode, node[1] is the first
index 1b7d973..c84e9bb 100644 (file)
@@ -109,9 +109,6 @@ void *
 _mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint sz);
 
 void *
-_mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes);
-
-void *
 _mesa_dlist_alloc_vertex_list(struct gl_context *ctx,
                               bool copy_to_current);