Module: Mesa
Branch: master
Commit: eb82373abb08171d7fcb15b5f4f229fc9ca9aa91
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb82373abb08171d7fcb15b5f4f229fc9ca9aa91

Author: Brian Paul <[email protected]>
Date:   Mon Sep 28 09:22:33 2009 -0600

mesa: use _mesa_get_current_tex_unit() helper

---

 src/mesa/main/enable.c   |    4 ++--
 src/mesa/main/fbobject.c |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 8e6b01f..4383aed 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -37,6 +37,7 @@
 #include "mtypes.h"
 #include "enums.h"
 #include "api_arrayelt.h"
+#include "texstate.h"
 
 
 
@@ -228,8 +229,7 @@ get_texcoord_unit(GLcontext *ctx)
 static GLboolean
 enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit)
 {
-   const GLuint curr = ctx->Texture.CurrentUnit;
-   struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
+   struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
    const GLbitfield newenabled = state
       ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
 
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 13f49da..680fd22 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -44,6 +44,7 @@
 #include "teximage.h"
 #include "texobj.h"
 #include "texstore.h"
+#include "texstate.h"
 
 
 /** Set this to 1 to help debug FBO incompleteness problems */
@@ -1955,7 +1956,7 @@ _mesa_GenerateMipmapEXT(GLenum target)
       return;
    }
 
-   texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+   texUnit = _mesa_get_current_tex_unit(ctx);
    texObj = _mesa_select_tex_object(ctx, texUnit, target);
 
    _mesa_lock_texture(ctx, texObj);

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to