diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-06-12 12:09:34 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-06-12 12:09:34 -0400 |
commit | 1036ef2bf468611d37b5df06fc4424f2002e3837 (patch) | |
tree | f0859a6d903c2570a0a00c918da88139f8f7d065 /src/mesa/main/enable.c | |
parent | 917f8bc1a85e61311cef6478127b387df70fba14 (diff) | |
parent | 1cd0afffc9edbcac690f8ab436aecfced26b0aba (diff) |
Merge master and fix conflicts
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r-- | src/mesa/main/enable.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f432be183c..48268fcd27 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -119,6 +119,7 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) CHECK_EXTENSION(NV_vertex_program, cap); { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; + ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); var = &ctx->Array.ArrayObj->VertexAttrib[n].Enabled; flag = _NEW_ARRAY_ATTRIB(n); } @@ -222,14 +223,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; @@ -1314,6 +1317,7 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(NV_vertex_program); { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; + ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0); } case GL_MAP1_VERTEX_ATTRIB0_4_NV: |