diff options
author | brianp <brianp> | 2000-11-21 18:01:52 +0000 |
---|---|---|
committer | brianp <brianp> | 2000-11-21 18:01:52 +0000 |
commit | 9fa11da2052726de3901687d2669d30ccfb9f4b4 (patch) | |
tree | 76e3d91955ed78d565a9aaa9dc44fa513944d4fd /xc/extras | |
parent | f470f0c03f0a5dfd9424d78ee98442567eba18fa (diff) |
sync with latest Mesa 3.4 tweaks
Diffstat (limited to 'xc/extras')
-rw-r--r-- | xc/extras/Mesa/src/colortab.c | 8 | ||||
-rw-r--r-- | xc/extras/Mesa/src/readpix.c | 6 | ||||
-rw-r--r-- | xc/extras/Mesa/src/texobj.c | 11 | ||||
-rw-r--r-- | xc/extras/Mesa/src/texutil.c | 17 | ||||
-rw-r--r-- | xc/extras/Mesa/src/varray.c | 19 |
5 files changed, 37 insertions, 24 deletions
diff --git a/xc/extras/Mesa/src/colortab.c b/xc/extras/Mesa/src/colortab.c index 425c03b1d..75a79ef90 100644 --- a/xc/extras/Mesa/src/colortab.c +++ b/xc/extras/Mesa/src/colortab.c @@ -357,7 +357,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, _mesa_unpack_float_color_span(ctx, width, table->Format, tempTab, /* dest */ format, type, data, - &ctx->Unpack, GL_TRUE, GL_FALSE); + &ctx->Unpack, GL_FALSE, GL_FALSE); table->TableType = GL_FLOAT; table->Table = MALLOC(comps * width * sizeof(GLfloat)); @@ -421,7 +421,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, _mesa_unpack_ubyte_color_span(ctx, width, table->Format, (GLubyte *) table->Table, /* dest */ format, type, data, - &ctx->Unpack, GL_TRUE); + &ctx->Unpack, GL_FALSE); } /* floatTable */ } /* proxy */ @@ -533,7 +533,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, if (table->TableType == GL_UNSIGNED_BYTE) { GLubyte *dest = (GLubyte *) table->Table + start * comps * sizeof(GLubyte); _mesa_unpack_ubyte_color_span(ctx, count, table->Format, dest, - format, type, data, &ctx->Unpack, GL_TRUE); + format, type, data, &ctx->Unpack, GL_FALSE); } else { GLfloat tempTab[MAX_COLOR_TABLE_SIZE * 4]; @@ -545,7 +545,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, _mesa_unpack_float_color_span(ctx, count, table->Format, tempTab, /* dest */ format, type, data, - &ctx->Unpack, GL_TRUE, GL_FALSE); + &ctx->Unpack, GL_FALSE, GL_FALSE); tableF = (GLfloat *) table->Table; diff --git a/xc/extras/Mesa/src/readpix.c b/xc/extras/Mesa/src/readpix.c index 96a3f11b2..1695bb2db 100644 --- a/xc/extras/Mesa/src/readpix.c +++ b/xc/extras/Mesa/src/readpix.c @@ -1,3 +1,4 @@ +/* $Id: readpix.c,v 1.14 2000/11/21 18:01:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -38,6 +39,7 @@ #include "pixel.h" #include "readpix.h" #include "span.h" +#include "state.h" #include "stencil.h" #include "types.h" #endif @@ -700,6 +702,10 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, return; } + if (ctx->NewState) { + gl_update_state(ctx); + } + if (ctx->Driver.ReadPixels && (*ctx->Driver.ReadPixels)(ctx, x, y, width, height, format, type, &ctx->Pack, pixels)) diff --git a/xc/extras/Mesa/src/texobj.c b/xc/extras/Mesa/src/texobj.c index 86d438c47..09d2c3381 100644 --- a/xc/extras/Mesa/src/texobj.c +++ b/xc/extras/Mesa/src/texobj.c @@ -1,3 +1,4 @@ +/* $Id: texobj.c,v 1.15 2000/11/21 18:01:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -69,6 +70,7 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name, obj->Priority = 1.0F; obj->WrapS = GL_REPEAT; obj->WrapT = GL_REPEAT; + obj->WrapR = GL_REPEAT; obj->MinFilter = GL_NEAREST_MIPMAP_LINEAR; obj->MagFilter = GL_LINEAR; obj->MinLod = -1000.0; @@ -551,6 +553,8 @@ _mesa_BindTexture( GLenum target, GLuint texName ) return; } + ctx->NewState |= NEW_TEXTURING; + if (oldTexObj->Name == texName) return; @@ -611,17 +615,12 @@ _mesa_BindTexture( GLenum target, GLuint texName ) || (oldTexObj->Image[0] && newTexObj->Image[0] && (oldTexObj->Image[0]->Format!=newTexObj->Image[0]->Format)))) { - ctx->NewState |= (NEW_RASTER_OPS | NEW_TEXTURING); + ctx->NewState |= NEW_RASTER_OPS; } - if (oldTexObj->Complete != newTexObj->Complete) - ctx->NewState |= NEW_TEXTURING; - /* Pass BindTexture call to device driver */ if (ctx->Driver.BindTexture) { (*ctx->Driver.BindTexture)( ctx, target, newTexObj ); - /* Make sure the Driver.UpdateState() function gets called! */ - ctx->NewState |= NEW_TEXTURING; } if (oldTexObj->Name > 0) { diff --git a/xc/extras/Mesa/src/texutil.c b/xc/extras/Mesa/src/texutil.c index a64aada5b..70f5c26a9 100644 --- a/xc/extras/Mesa/src/texutil.c +++ b/xc/extras/Mesa/src/texutil.c @@ -1,3 +1,4 @@ +/* $Id: texutil.c,v 1.8 2000/11/21 18:01:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -822,15 +823,21 @@ _mesa_convert_texsubimage(MesaIntTexFormat dstFormat, const GLubyte *src = (const GLubyte *) _mesa_image_address(packing, srcImage, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); - const GLint srcStride = _mesa_image_row_stride(packing, + const GLint srcRowStride = _mesa_image_row_stride(packing, width, srcFormat, srcType); GLubyte *dst = (GLubyte *) dstImage + dstYoffset * dstRowStride + dstXoffset; + const GLint rowSize = width * sizeof(GLubyte); GLint row; - for (row = 0; row < height; row++) { - MEMCPY(dst, src, width * sizeof(GLubyte)); - dst += dstRowStride; - src += srcStride; + if (dstRowStride == srcRowStride && dstRowStride == rowSize) { + MEMCPY(dst, src, rowSize * height); + } + else { + for (row = 0; row < height; row++) { + MEMCPY(dst, src, rowSize); + dst += dstRowStride; + src += srcRowStride; + } } } else { diff --git a/xc/extras/Mesa/src/varray.c b/xc/extras/Mesa/src/varray.c index 7547ea3bf..d1b728965 100644 --- a/xc/extras/Mesa/src/varray.c +++ b/xc/extras/Mesa/src/varray.c @@ -1,3 +1,4 @@ +/* $Id: varray.c,v 1.14 2000/11/21 18:01:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -547,11 +548,11 @@ _mesa_DrawArrays(GLenum mode, GLint start, GLsizei count) { GLint remaining = count; GLint i; - struct gl_client_array *Normal; - struct gl_client_array *Color; - struct gl_client_array *Index; + struct gl_client_array *Normal = 0; + struct gl_client_array *Color = 0; + struct gl_client_array *Index = 0; struct gl_client_array *TexCoord[MAX_TEXTURE_UNITS]; - struct gl_client_array *EdgeFlag; + struct gl_client_array *EdgeFlag = 0; struct immediate *IM = VB->IM; struct gl_pipeline *elt = &ctx->CVA.elt; GLboolean relock; @@ -977,12 +978,12 @@ void _mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) { GET_CURRENT_CONTEXT(ctx); - GLboolean tflag, cflag, nflag; /* enable/disable flags */ - GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */ + GLboolean tflag, cflag, nflag; /* enable/disable flags */ + GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */ - GLenum ctype; /* color type */ - GLint coffset, noffset, voffset;/* color, normal, vertex offsets */ - GLint defstride; /* default stride */ + GLenum ctype = 0; /* color type */ + GLint coffset = 0, noffset = 0, voffset = 0;/* color, normal, vertex offsets */ + GLint defstride; /* default stride */ GLint c, f; GLint coordUnitSave; |