mesa: use _mesa_get_current_tex_unit() helper in BindTexture()
authorBrian Paul <brianp@vmware.com>
Thu, 17 Mar 2011 03:13:31 +0000 (21:13 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 17 Mar 2011 03:13:31 +0000 (21:13 -0600)
src/mesa/main/texobj.c

index c06bbb67e5f185553ec97a874319136ea6dae6e6..c1e3e4dec7931476af3c6465c9b58899393c3fb7 100644 (file)
@@ -39,6 +39,7 @@
 #include "macros.h"
 #include "teximage.h"
 #include "texobj.h"
+#include "texstate.h"
 #include "mtypes.h"
 #include "program/prog_instruction.h"
 
@@ -1013,8 +1014,7 @@ void GLAPIENTRY
 _mesa_BindTexture( GLenum target, GLuint texName )
 {
    GET_CURRENT_CONTEXT(ctx);
-   const GLuint unit = ctx->Texture.CurrentUnit;
-   struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+   struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
    struct gl_texture_object *newTexObj = NULL;
    GLint targetIndex;
    ASSERT_OUTSIDE_BEGIN_END(ctx);