From be906fe05e1fd6c488ff84b24379d7272a5ac5af Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Jun 2006 15:39:10 +0000 Subject: added some comments, braces in _mesa_BindTexture --- src/mesa/main/texobj.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index cfe9229cdb..8b42c2a712 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) -- cgit v1.2.3