diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/bufferobj.c | 4 | ||||
-rw-r--r-- | src/mesa/main/colortab.c | 4 | ||||
-rw-r--r-- | src/mesa/main/context.c | 15 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 4 | ||||
-rw-r--r-- | src/mesa/main/enums.c | 2 | ||||
-rw-r--r-- | src/mesa/main/image.c | 8 | ||||
-rw-r--r-- | src/mesa/main/imports.c | 42 | ||||
-rw-r--r-- | src/mesa/main/imports.h | 3 | ||||
-rw-r--r-- | src/mesa/main/texcompress_s3tc.c | 2 | ||||
-rw-r--r-- | src/mesa/main/texenvprogram.c | 5 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 6 | ||||
-rw-r--r-- | src/mesa/main/version.h | 14 |
12 files changed, 62 insertions, 47 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 3f9f798546..009055a6ab 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -119,7 +119,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); return NULL; } - if ((GLuint) (offset + size) > bufObj->Size) { + if (offset + size > bufObj->Size) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(size + offset > buffer size)", caller); return NULL; @@ -297,7 +297,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, (void) ctx; (void) target; /* this should have been caught in _mesa_BufferSubData() */ - ASSERT((GLuint) (size + offset) <= bufObj->Size); + ASSERT(size + offset <= bufObj->Size); if (bufObj->Data) { _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index e9349516eb..9fb0baf4a7 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -472,8 +472,8 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, _mesa_free_colortable_data(table); if (width > 0) { - table->TableF = _mesa_malloc(comps * width * sizeof(GLfloat)); - table->TableUB = _mesa_malloc(comps * width * sizeof(GLubyte)); + table->TableF = (GLfloat *) _mesa_malloc(comps * width * sizeof(GLfloat)); + table->TableUB = (GLubyte *) _mesa_malloc(comps * width * sizeof(GLubyte)); if (!table->TableF || !table->TableUB) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable"); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 59e8740cdc..9b3759b6c8 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -292,13 +292,8 @@ _mesa_forceCurrent(__GLcontext *gc) GLboolean _mesa_notifyResize(__GLcontext *gc) { - GLint x, y; - GLuint width, height; - __GLdrawablePrivate *d = gc->imports.getDrawablePrivate(gc); - if (!d || !d->getDrawableSize) - return GL_FALSE; - d->getDrawableSize( d, &x, &y, &width, &height ); /* update viewport, resize software buffers, etc. */ + (void) gc; return GL_TRUE; } @@ -1082,14 +1077,8 @@ _mesa_init_constants( GLcontext *ctx ) ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES; ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH; - /* If we're running in the X server, do bounds checking to prevent - * segfaults and server crashes! - */ -#if defined(XFree86Server) - ctx->Const.CheckArrayBounds = GL_TRUE; -#else + /* CheckArrayBounds is overriden by drivers/x11 for X server */ ctx->Const.CheckArrayBounds = GL_FALSE; -#endif /* GL_ARB_draw_buffers */ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index e472c6bfb4..49bc2933bf 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4474,7 +4474,7 @@ save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); if (count > 0) { - unsigned i; + GLint i; const GLfloat * p = params; for (i = 0 ; i < count ; i++) { @@ -4708,7 +4708,7 @@ save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); if (count > 0) { - unsigned i; + GLint i; const GLfloat * p = params; for (i = 0 ; i < count ; i++) { diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index fc56809e97..8c1b785aab 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -3517,7 +3517,6 @@ static const enum_elt all_enums[1737] = static const unsigned reduced_enums[1277] = { - 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ 435, /* GL_FALSE */ 643, /* GL_LINES */ 645, /* GL_LINE_LOOP */ @@ -4794,6 +4793,7 @@ static const unsigned reduced_enums[1277] = 1314, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ 938, /* GL_MULTISAMPLE_BIT */ + 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; #define Elements(x) sizeof(x)/sizeof(*x) diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 6ff4089f0e..fc8e1f0f57 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1331,6 +1331,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], dst[i*4+2] = FLOAT_TO_BYTE(rgba[i][RCOMP]); dst[i*4+3] = FLOAT_TO_BYTE(rgba[i][ACOMP]); } + break; case GL_ABGR_EXT: for (i=0;i<n;i++) { dst[i*4+0] = FLOAT_TO_BYTE(rgba[i][ACOMP]); @@ -1479,6 +1480,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], dst[i*4+2] = FLOAT_TO_SHORT(rgba[i][RCOMP]); dst[i*4+3] = FLOAT_TO_SHORT(rgba[i][ACOMP]); } + break; case GL_ABGR_EXT: for (i=0;i<n;i++) { dst[i*4+0] = FLOAT_TO_SHORT(rgba[i][ACOMP]); @@ -1815,7 +1817,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], for (i=0;i<n;i++) { dst[i] = (((GLint) (rgba[i][RCOMP] * 7.0F)) ) | (((GLint) (rgba[i][GCOMP] * 7.0F)) << 3) - | (((GLint) (rgba[i][BCOMP] * 3.0F)) << 5); + | (((GLint) (rgba[i][BCOMP] * 3.0F)) << 6); } } break; @@ -1861,9 +1863,9 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], else if (dstFormat == GL_ABGR_EXT) { GLushort *dst = (GLushort *) dstAddr; for (i=0;i<n;i++) { - dst[i] = (((GLint) (rgba[i][ACOMP] * 15.0F)) << 4) + dst[i] = (((GLint) (rgba[i][ACOMP] * 15.0F)) << 12) | (((GLint) (rgba[i][BCOMP] * 15.0F)) << 8) - | (((GLint) (rgba[i][GCOMP] * 15.0F)) << 12) + | (((GLint) (rgba[i][GCOMP] * 15.0F)) << 4) | (((GLint) (rgba[i][RCOMP] * 15.0F)) ); } } diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index ed809acbe2..890d1a4e32 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -576,6 +576,35 @@ _mesa_ffs(int i) /** + * Find position of first bit set in given value. + * XXX Warning: this function can only be used on 64-bit systems! + * \return position of least-significant bit set, starting at 1, return zero + * if no bits set. + */ +int +_mesa_ffsll(long long val) +{ +#ifdef ffsll + return ffsll(val); +#else + int bit; + + assert(sizeof(val) == 8); + + bit = ffs(val); + if (bit != 0) + return bit; + + bit = ffs(val >> 32); + if (bit != 0) + return 32 + bit; + + return 0; +#endif +} + + +/** * Return number of bits set in given GLuint. */ unsigned int @@ -1176,16 +1205,6 @@ default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) return r; } -/** - * \todo this really is driver-specific and can't be here - */ -static __GLdrawablePrivate * -default_GetDrawablePrivate(__GLcontext *gc) -{ - (void) gc; - return NULL; -} - /*@}*/ @@ -1222,6 +1241,7 @@ _mesa_init_default_imports(__GLimports *imports, void *driverCtx) imports->fopen = default_fopen; imports->fclose = default_fclose; imports->fprintf = default_fprintf; - imports->getDrawablePrivate = default_GetDrawablePrivate; + imports->getDrawablePrivate = NULL; /* driver-specific */ + imports->getReadablePrivate = NULL; /* driver-specific */ imports->other = driverCtx; } diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 19a9478f76..d9885dbeec 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -688,6 +688,9 @@ _mesa_pow(double x, double y); extern int _mesa_ffs(int i); +extern int +_mesa_ffsll(long long i); + extern unsigned int _mesa_bitcount(unsigned int n); diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index c71501c5e6..c823967b7a 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -91,7 +91,7 @@ _mesa_dlopen(const char *libname, int flags) return dlopen(libname, flags); #endif #else - return (void *) NULL; + return NULL; #endif /* USE_EXTERNAL_DXTN_LIB */ } diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 5329719cbb..5038b9b0c3 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1184,13 +1184,14 @@ static void cache_item( struct texenvprog_cache *cache, const struct state_key *key, void *data ) { - struct texenvprog_cache_item *c = MALLOC(sizeof(*c)); + struct texenvprog_cache_item *c + = (struct texenvprog_cache_item *) MALLOC(sizeof(*c)); c->hash = hash; c->key = _mesa_malloc(sizeof(*key)); memcpy(c->key, key, sizeof(*key)); - c->data = data; + c->data = (struct gl_fragment_program *) data; if (cache->n_items > cache->size * 1.5) { if (cache->size < 1000) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 1d27cd3f7c..3cfbfa5eb5 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -699,7 +699,7 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) = _mesa_lookup_texture(ctx, textures[i]); if (delObj) { - GLboolean delete; + GLboolean deleted; _mesa_lock_texture(ctx, delObj); @@ -728,14 +728,14 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) * XXX all RefCount accesses should be protected by a mutex. */ delObj->RefCount--; - delete = (delObj->RefCount == 0); + deleted = (delObj->RefCount == 0); _mesa_unlock_texture(ctx, delObj); /* We know that refcount went to zero above, so this is * the only pointer left to delObj, so we don't have to * worry about locking any more: */ - if (delete) { + if (deleted) { ASSERT(delObj->Name != 0); /* Never delete default tex objs */ ASSERT(ctx->Driver.DeleteTexture); (*ctx->Driver.DeleteTexture)(ctx, delObj); diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index e6196050b9..e4a74cb0d4 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 6.5.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -30,8 +30,8 @@ /* Mesa version */ #define MESA_MAJOR 6 #define MESA_MINOR 5 -#define MESA_PATCH 2 -#define MESA_VERSION_STRING "6.5.2" +#define MESA_PATCH 3 +#define MESA_VERSION_STRING "6.5.3" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) @@ -39,10 +39,10 @@ /* OpenGL API version */ -#define OPENGL_MAJOR 1 -#define OPENGL_MINOR 5 +#define OPENGL_MAJOR 2 +#define OPENGL_MINOR 0 #define OPENGL_PATCH 0 -#define OPENGL_VERSION_STRING "1.5" +#define OPENGL_VERSION_STRING "2.0" /* To make version comparison easy */ #define OPENGL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |