Mesa (main): mesa: move _mesa_copy_vertex_attrib/buffer functions to their only use
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri May 28 22:41:34 UTC 2021
Module: Mesa
Branch: main
Commit: 5195d848a0bd1ea5f6d409cdf4f1467a82f18b06
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5195d848a0bd1ea5f6d409cdf4f1467a82f18b06
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue May 25 15:10:36 2021 -0400
mesa: move _mesa_copy_vertex_attrib/buffer functions to their only use
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
---
src/mesa/main/attrib.c | 33 +++++++++++++++++++++++++++++++--
src/mesa/main/varray.c | 30 ------------------------------
src/mesa/main/varray.h | 11 -----------
3 files changed, 31 insertions(+), 43 deletions(-)
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index dab7b89357d..8231af08336 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1300,6 +1300,35 @@ copy_pixelstore(struct gl_context *ctx,
#define GL_CLIENT_PACK_BIT (1<<20)
#define GL_CLIENT_UNPACK_BIT (1<<21)
+static void
+copy_vertex_attrib_array(struct gl_context *ctx,
+ struct gl_array_attributes *dst,
+ const struct gl_array_attributes *src)
+{
+ dst->Ptr = src->Ptr;
+ dst->RelativeOffset = src->RelativeOffset;
+ dst->Format = src->Format;
+ dst->Stride = src->Stride;
+ dst->BufferBindingIndex = src->BufferBindingIndex;
+ dst->_EffBufferBindingIndex = src->_EffBufferBindingIndex;
+ dst->_EffRelativeOffset = src->_EffRelativeOffset;
+}
+
+static void
+copy_vertex_buffer_binding(struct gl_context *ctx,
+ struct gl_vertex_buffer_binding *dst,
+ const struct gl_vertex_buffer_binding *src)
+{
+ dst->Offset = src->Offset;
+ dst->Stride = src->Stride;
+ dst->InstanceDivisor = src->InstanceDivisor;
+ dst->_BoundArrays = src->_BoundArrays;
+ dst->_EffBoundArrays = src->_EffBoundArrays;
+ dst->_EffOffset = src->_EffOffset;
+
+ _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj);
+}
+
/**
* Copy gl_vertex_array_object from src to dest.
* 'dest' must be in an initialized state.
@@ -1315,8 +1344,8 @@ copy_array_object(struct gl_context *ctx,
/* skip RefCount */
for (i = 0; i < ARRAY_SIZE(src->VertexAttrib); i++) {
- _mesa_copy_vertex_attrib_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
- _mesa_copy_vertex_buffer_binding(ctx, &dest->BufferBinding[i], &src->BufferBinding[i]);
+ copy_vertex_attrib_array(ctx, &dest->VertexAttrib[i], &src->VertexAttrib[i]);
+ copy_vertex_buffer_binding(ctx, &dest->BufferBinding[i], &src->BufferBinding[i]);
}
/* Enabled must be the same than on push */
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index ce8c1d585c1..f9fc598a513 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -3786,36 +3786,6 @@ _mesa_VertexArrayVertexBindingDivisorEXT(GLuint vaobj, GLuint bindingIndex,
"glVertexArrayVertexBindingDivisorEXT");
}
-
-void
-_mesa_copy_vertex_attrib_array(struct gl_context *ctx,
- struct gl_array_attributes *dst,
- const struct gl_array_attributes *src)
-{
- dst->Ptr = src->Ptr;
- dst->RelativeOffset = src->RelativeOffset;
- dst->Format = src->Format;
- dst->Stride = src->Stride;
- dst->BufferBindingIndex = src->BufferBindingIndex;
- dst->_EffBufferBindingIndex = src->_EffBufferBindingIndex;
- dst->_EffRelativeOffset = src->_EffRelativeOffset;
-}
-
-void
-_mesa_copy_vertex_buffer_binding(struct gl_context *ctx,
- struct gl_vertex_buffer_binding *dst,
- const struct gl_vertex_buffer_binding *src)
-{
- dst->Offset = src->Offset;
- dst->Stride = src->Stride;
- dst->InstanceDivisor = src->InstanceDivisor;
- dst->_BoundArrays = src->_BoundArrays;
- dst->_EffBoundArrays = src->_EffBoundArrays;
- dst->_EffOffset = src->_EffOffset;
-
- _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj);
-}
-
/**
* Print current vertex object/array info. For debug.
*/
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 3cd8b5fcdbf..bb02a31535e 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -485,17 +485,6 @@ extern void GLAPIENTRY
_mesa_VertexArrayVertexBindingDivisorEXT(GLuint vaobj, GLuint bindingIndex,
GLuint divisor);
-
-extern void
-_mesa_copy_vertex_attrib_array(struct gl_context *ctx,
- struct gl_array_attributes *dst,
- const struct gl_array_attributes *src);
-
-extern void
-_mesa_copy_vertex_buffer_binding(struct gl_context *ctx,
- struct gl_vertex_buffer_binding *dst,
- const struct gl_vertex_buffer_binding *src);
-
extern void
_mesa_print_arrays(struct gl_context *ctx);
More information about the mesa-commit
mailing list