From: Brian Paul Date: Thu, 6 Aug 2009 19:53:06 +0000 (-0600) Subject: mesa: new _mesa_copy_client_array() function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b28854088bb6a6fa1a12f47056d9aee2fbdefc70;p=mesa.git mesa: new _mesa_copy_client_array() function --- diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 88bf8d8d350..be1c03cec2a 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1098,6 +1098,29 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, } +/** + * Copy one client vertex array to another. + */ +void +_mesa_copy_client_array(GLcontext *ctx, + struct gl_client_array *dst, + struct gl_client_array *src) +{ + dst->Size = src->Size; + dst->Type = src->Type; + dst->Format = src->Format; + dst->Stride = src->Stride; + dst->StrideB = src->StrideB; + dst->Ptr = src->Ptr; + dst->Enabled = src->Enabled; + dst->Normalized = src->Normalized; + dst->_ElementSize = src->_ElementSize; + _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj); + dst->_MaxElement = src->_MaxElement; +} + + + /** * Print vertex array's fields. */ diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index d4d505ae049..becc67c29d3 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -160,6 +160,12 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +extern void +_mesa_copy_client_array(GLcontext *ctx, + struct gl_client_array *dst, + struct gl_client_array *src); + + extern void _mesa_print_arrays(GLcontext *ctx);