diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2004-06-25 15:08:05 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2004-06-25 15:08:05 +0000 |
commit | 63a39a797a3cc592282234aa023245004327d211 (patch) | |
tree | 22ed4488a633a85a9610accf0e06a60cb10b8915 | |
parent | 63cd4098dc8dcbb7eb2038c695da3057dbffdeec (diff) |
merge fix from trunk (fixes bug 979597)
-rw-r--r-- | src/mesa/array_cache/ac_import.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c index f0c452021a..fcc00d84b3 100644 --- a/src/mesa/array_cache/ac_import.c +++ b/src/mesa/array_cache/ac_import.c @@ -197,28 +197,21 @@ static void reset_attrib( GLcontext *ctx, GLuint index ) /* * Generic import function for color data */ -static void import( GLcontext *ctx, - GLenum type, - struct gl_client_array *to, - struct gl_client_array *from ) +static void +import( const GLcontext *ctx, + GLenum destType, + struct gl_client_array *to, + const struct gl_client_array *from ) { - GLubyte *dest; - const GLubyte *src; - ACcontext *ac = AC_CONTEXT(ctx); - - if (type == 0) - type = from->Type; + const ACcontext *ac = AC_CONTEXT(ctx); - /* The dest and source data addresses are the sum of the buffer - * object's start plus the vertex array pointer/offset. - */ - dest = ADD_POINTERS(to->BufferObj->Data, to->Ptr); - src = ADD_POINTERS(from->BufferObj->Data, from->Ptr); + if (destType == 0) + destType = from->Type; - switch (type) { + switch (destType) { case GL_FLOAT: - _math_trans_4fc( (GLfloat (*)[4]) dest, - src, + _math_trans_4fc( (GLfloat (*)[4]) to->Ptr, + from->Ptr, from->StrideB, from->Type, from->Size, @@ -230,8 +223,8 @@ static void import( GLcontext *ctx, break; case GL_UNSIGNED_BYTE: - _math_trans_4ub( (GLubyte (*)[4]) dest, - src, + _math_trans_4ub( (GLubyte (*)[4]) to->Ptr, + from->Ptr, from->StrideB, from->Type, from->Size, @@ -243,8 +236,8 @@ static void import( GLcontext *ctx, break; case GL_UNSIGNED_SHORT: - _math_trans_4us( (GLushort (*)[4]) dest, - src, + _math_trans_4us( (GLushort (*)[4]) to->Ptr, + from->Ptr, from->StrideB, from->Type, from->Size, @@ -256,7 +249,7 @@ static void import( GLcontext *ctx, break; default: - ASSERT(0); + _mesa_problem(ctx, "Unexpected dest format in import()"); break; } } |