summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/attrib.c11
-rw-r--r--src/mesa/main/dlist.c5
-rw-r--r--src/mesa/main/light.c11
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/points.c11
-rw-r--r--src/mesa/main/teximage.h11
-rw-r--r--src/mesa/main/texobj.c47
-rw-r--r--src/mesa/main/texobj.h7
8 files changed, 54 insertions, 50 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 4654704afd..1aa0a02fc7 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.1
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -348,6 +348,8 @@ _mesa_PushAttrib(GLbitfield mask)
ctx->Texture.Unit[u].Current3D->RefCount++;
ctx->Texture.Unit[u].CurrentCubeMap->RefCount++;
ctx->Texture.Unit[u].CurrentRect->RefCount++;
+ ctx->Texture.Unit[u].Current1DArray->RefCount++;
+ ctx->Texture.Unit[u].Current2DArray->RefCount++;
}
attr = MALLOC_STRUCT( gl_texture_attrib );
MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) );
@@ -363,6 +365,10 @@ _mesa_PushAttrib(GLbitfield mask)
attr->Unit[u].CurrentCubeMap);
_mesa_copy_texture_object(&attr->Unit[u].SavedRect,
attr->Unit[u].CurrentRect);
+ _mesa_copy_texture_object(&attr->Unit[u].Saved1DArray,
+ attr->Unit[u].Current1DArray);
+ _mesa_copy_texture_object(&attr->Unit[u].Saved2DArray,
+ attr->Unit[u].Current2DArray);
}
_mesa_unlock_context_textures(ctx);
@@ -776,6 +782,7 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
_mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, obj->MagFilter);
_mesa_TexParameterf(target, GL_TEXTURE_MIN_LOD, obj->MinLod);
_mesa_TexParameterf(target, GL_TEXTURE_MAX_LOD, obj->MaxLod);
+ _mesa_TexParameterf(target, GL_TEXTURE_LOD_BIAS, obj->LodBias);
_mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, obj->BaseLevel);
if (target != GL_TEXTURE_RECTANGLE_ARB)
_mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, obj->MaxLevel);
@@ -809,6 +816,8 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
ctx->Texture.Unit[u].Current3D->RefCount--;
ctx->Texture.Unit[u].CurrentCubeMap->RefCount--;
ctx->Texture.Unit[u].CurrentRect->RefCount--;
+ ctx->Texture.Unit[u].Current1DArray->RefCount--;
+ ctx->Texture.Unit[u].Current2DArray->RefCount--;
}
}
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index c8c68214ce..91ddcbf9ed 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -6596,9 +6596,6 @@ execute_list(GLcontext *ctx, GLuint list)
CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
break;
-
-
-
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
break;
@@ -8407,8 +8404,6 @@ print_list(GLcontext *ctx, GLuint list)
_mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
break;
-
-
/*
* meta opcodes/commands
*/
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 92d8a0ae0d..6e057614ba 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.0
*
- * Copyright (C) 1999-2005 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"),
@@ -1117,6 +1117,13 @@ compute_light_positions( GLcontext *ctx )
}
light->_VP_inf_spot_attenuation = 1.0;
}
+ else {
+ /* positional light w/ homogeneous coordinate, divide by W */
+ GLfloat wInv = 1.0 / light->_Position[3];
+ light->_Position[0] *= wInv;
+ light->_Position[1] *= wInv;
+ light->_Position[2] *= wInv;
+ }
if (light->_Flags & LIGHT_SPOT) {
if (ctx->_NeedEyeCoords) {
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 894b9edb36..fc712def57 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1397,7 +1397,6 @@ struct gl_texture_image
*/
struct gl_texture_object
{
- _glthread_Mutex Mutex; /**< for thread safety */
GLint RefCount; /**< reference count */
GLuint Name; /**< the user-visible texture object ID */
GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 9caa9ab3ab..8674c7299c 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -5,9 +5,9 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 7.0
*
- * 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"),
@@ -61,10 +61,6 @@ _mesa_PointSize( GLfloat size )
ctx->Point.MinSize,
ctx->Point.MaxSize);
- ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 ||
- ctx->Point.Params[1] != 0.0 ||
- ctx->Point.Params[2] != 0.0);
-
if (ctx->Driver.PointSize)
ctx->Driver.PointSize(ctx, size);
}
@@ -122,6 +118,9 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
return;
FLUSH_VERTICES(ctx, _NEW_POINT);
COPY_3V(ctx->Point.Params, params);
+ ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 ||
+ ctx->Point.Params[1] != 0.0 ||
+ ctx->Point.Params[2] != 0.0);
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 68457f4728..f2cad7eb2d 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -107,18 +107,19 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
GLint width, GLint height, GLint depth, GLint border);
-/* Lock a texture for updating. See also _mesa_lock_context_textures().
+/**
+ * Lock a texture for updating. See also _mesa_lock_context_textures().
*/
-static INLINE void _mesa_lock_texture(GLcontext *ctx,
- struct gl_texture_object *texObj)
+static INLINE void
+_mesa_lock_texture(GLcontext *ctx, struct gl_texture_object *texObj)
{
_glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
ctx->Shared->TextureStateStamp++;
(void) texObj;
}
-static INLINE void _mesa_unlock_texture(GLcontext *ctx,
- struct gl_texture_object *texObj)
+static INLINE void
+_mesa_unlock_texture(GLcontext *ctx, struct gl_texture_object *texObj)
{
_glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
}
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index bd447ac068..0d2946e95a 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -42,10 +42,6 @@
#include "mtypes.h"
-#ifdef __VMS
-#define _mesa_sprintf sprintf
-#endif
-
/**********************************************************************/
/** \name Internal functions */
/*@{*/
@@ -110,7 +106,6 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
_mesa_bzero(obj, sizeof(*obj));
/* init the non-zero fields */
- _glthread_INIT_MUTEX(obj->Mutex);
obj->RefCount = 1;
obj->Name = name;
obj->Target = target;
@@ -140,13 +135,13 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */
obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */
- _mesa_init_colortable(&obj->Palette);
}
/**
* Deallocate a texture object struct. It should have already been
* removed from the texture object pool.
+ * Called via ctx->Driver.DeleteTexture() if not overriden by a driver.
*
* \param shared the shared GL state to which the object belongs.
* \param texOjb the texture object to delete.
@@ -169,9 +164,6 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
}
}
- /* destroy the mutex -- it may have allocated memory (eg on bsd) */
- _glthread_DESTROY_MUTEX(texObj->Mutex);
-
/* free this object */
_mesa_free(texObj);
}
@@ -532,13 +524,6 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
/** \name API functions */
/*@{*/
-/**
- * Texture name generation lock.
- *
- * Used by _mesa_GenTextures() to guarantee that the generation and allocation
- * of texture IDs is atomic.
- */
-_glthread_DECLARE_STATIC_MUTEX(GenTexturesLock);
/**
* Generate texture names.
@@ -548,9 +533,9 @@ _glthread_DECLARE_STATIC_MUTEX(GenTexturesLock);
*
* \sa glGenTextures().
*
- * While holding the GenTexturesLock lock, calls _mesa_HashFindFreeKeyBlock()
- * to find a block of free texture IDs which are stored in \p textures.
- * Corresponding empty texture objects are also generated.
+ * Calls _mesa_HashFindFreeKeyBlock() to find a block of free texture
+ * IDs which are stored in \p textures. Corresponding empty texture
+ * objects are also generated.
*/
void GLAPIENTRY
_mesa_GenTextures( GLsizei n, GLuint *textures )
@@ -571,7 +556,7 @@ _mesa_GenTextures( GLsizei n, GLuint *textures )
/*
* This must be atomic (generation and allocation of texture IDs)
*/
- _glthread_LOCK_MUTEX(GenTexturesLock);
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
@@ -582,20 +567,18 @@ _mesa_GenTextures( GLsizei n, GLuint *textures )
GLenum target = 0;
texObj = (*ctx->Driver.NewTextureObject)( ctx, name, target);
if (!texObj) {
- _glthread_UNLOCK_MUTEX(GenTexturesLock);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTextures");
return;
}
/* insert into hash table */
- _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
_mesa_HashInsert(ctx->Shared->TexObjects, texObj->Name, texObj);
- _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
textures[i] = name;
}
- _glthread_UNLOCK_MUTEX(GenTexturesLock);
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
}
@@ -1097,14 +1080,21 @@ _mesa_IsTexture( GLuint texture )
return t && t->Target;
}
-/* Simplest implementation of texture locking: Grab the a new mutex in
+
+/**
+ * Simplest implementation of texture locking: Grab the a new mutex in
* the shared context. Examine the shared context state timestamp and
* if there has been a change, set the appropriate bits in
* ctx->NewState.
*
- * See also _mesa_lock/unlock_texture in texobj.h
+ * This is used to deal with synchronizing things when a texture object
+ * is used/modified by different contexts (or threads) which are sharing
+ * the texture.
+ *
+ * See also _mesa_lock/unlock_texture() in teximage.h
*/
-void _mesa_lock_context_textures( GLcontext *ctx )
+void
+_mesa_lock_context_textures( GLcontext *ctx )
{
_glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
@@ -1115,7 +1105,8 @@ void _mesa_lock_context_textures( GLcontext *ctx )
}
-void _mesa_unlock_context_textures( GLcontext *ctx )
+void
+_mesa_unlock_context_textures( GLcontext *ctx )
{
assert(ctx->Shared->TextureStateStamp == ctx->TextureStateTimestamp);
_glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index ec7cf8cd86..2a2bde3601 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -61,8 +61,11 @@ extern void
_mesa_test_texobj_completeness( const GLcontext *ctx,
struct gl_texture_object *obj );
-extern void _mesa_unlock_context_textures( GLcontext *ctx );
-extern void _mesa_lock_context_textures( GLcontext *ctx );
+extern void
+_mesa_unlock_context_textures( GLcontext *ctx );
+
+extern void
+_mesa_lock_context_textures( GLcontext *ctx );
/*@}*/