Mesa (master): mesa: minor simplification in enable_texture(), updated comments
Brian Paul
brianp at kemper.freedesktop.org
Tue May 5 22:22:46 UTC 2009
Module: Mesa
Branch: master
Commit: c0d3761c167c2d952e92c46cf3a0e26461985ada
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c0d3761c167c2d952e92c46cf3a0e26461985ada
Author: Brian Paul <brianp at vmware.com>
Date: Tue May 5 16:17:55 2009 -0600
mesa: minor simplification in enable_texture(), updated comments
---
src/mesa/main/enable.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index f432be1..2e7baa4 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -222,14 +222,16 @@ get_texcoord_unit(GLcontext *ctx)
/**
* Helper function to enable or disable a texture target.
+ * \param bit one of the TEXTURE_x_BIT values
+ * \return GL_TRUE if state is changing or GL_FALSE if no change
*/
static GLboolean
-enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit)
+enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit)
{
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- const GLuint newenabled = (!state)
- ? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit);
+ const GLbitfield newenabled = state
+ ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit);
if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled)
return GL_FALSE;
More information about the mesa-commit
mailing list