summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-06-15 15:39:10 +0000
committerBrian Paul <[email protected]>2006-06-15 15:39:10 +0000
commitbe906fe05e1fd6c488ff84b24379d7272a5ac5af (patch)
tree5e334f97a820df1e364d9d39a5ff4b48b5cbbf04 /src/mesa/main/texobj.c
parent2d77b25c27cdb49b1f3f6eda4643eaeaf230b9a2 (diff)
added some comments, braces in _mesa_BindTexture
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index cfe9229cdb1..8b42c2a712c 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -754,7 +754,7 @@ void GLAPIENTRY
_mesa_BindTexture( GLenum target, GLuint texName )
{
GET_CURRENT_CONTEXT(ctx);
- GLuint unit = ctx->Texture.CurrentUnit;
+ const GLuint unit = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
struct gl_texture_object *oldTexObj;
struct gl_texture_object *newTexObj = NULL;
@@ -796,12 +796,15 @@ _mesa_BindTexture( GLenum target, GLuint texName )
return;
}
- if (oldTexObj->Name == texName)
+ if (oldTexObj->Name == texName) {
/* XXX this might be wrong. If the texobj is in use by another
* context and a texobj parameter was changed, this might be our
* only chance to update this context's hardware state.
+ * Note that some applications re-bind the same texture a lot so we
+ * want to handle that case quickly.
*/
return; /* rebinding the same texture- no change */
+ }
/*
* Get pointer to new texture object (newTexObj)