diff options
Diffstat (limited to 'mesalib/src/mesa/main/enable.c')
-rw-r--r-- | mesalib/src/mesa/main/enable.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index b2c77243b..6461ac1b3 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -54,47 +54,47 @@ static void client_state(struct gl_context *ctx, GLenum cap, GLboolean state) { struct gl_array_object *arrayObj = ctx->Array.ArrayObj; - GLuint flag; + GLbitfield64 flag; GLboolean *var; switch (cap) { case GL_VERTEX_ARRAY: - var = &arrayObj->Vertex.Enabled; - flag = _NEW_ARRAY_VERTEX; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled; + flag = VERT_BIT_POS; break; case GL_NORMAL_ARRAY: - var = &arrayObj->Normal.Enabled; - flag = _NEW_ARRAY_NORMAL; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled; + flag = VERT_BIT_NORMAL; break; case GL_COLOR_ARRAY: - var = &arrayObj->Color.Enabled; - flag = _NEW_ARRAY_COLOR0; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled; + flag = VERT_BIT_COLOR0; break; case GL_INDEX_ARRAY: - var = &arrayObj->Index.Enabled; - flag = _NEW_ARRAY_INDEX; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled; + flag = VERT_BIT_COLOR_INDEX; break; case GL_TEXTURE_COORD_ARRAY: - var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; - flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); + var = &arrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)].Enabled; + flag = VERT_BIT_TEX(ctx->Array.ActiveTexture); break; case GL_EDGE_FLAG_ARRAY: - var = &arrayObj->EdgeFlag.Enabled; - flag = _NEW_ARRAY_EDGEFLAG; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled; + flag = VERT_BIT_EDGEFLAG; break; case GL_FOG_COORDINATE_ARRAY_EXT: - var = &arrayObj->FogCoord.Enabled; - flag = _NEW_ARRAY_FOGCOORD; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled; + flag = VERT_BIT_FOG; break; case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &arrayObj->SecondaryColor.Enabled; - flag = _NEW_ARRAY_COLOR1; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled; + flag = VERT_BIT_COLOR1; break; #if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_OES: - var = &arrayObj->PointSize.Enabled; - flag = _NEW_ARRAY_POINT_SIZE; + var = &arrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled; + flag = VERT_BIT_POINT_SIZE; break; #endif @@ -118,9 +118,9 @@ client_state(struct gl_context *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 = &arrayObj->VertexAttrib[n].Enabled; - flag = _NEW_ARRAY_ATTRIB(n); + ASSERT(VERT_ATTRIB_GENERIC(n) < Elements(ctx->Array.ArrayObj->VertexAttrib)); + var = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(n)].Enabled; + flag = VERT_BIT_GENERIC(n); } break; #endif /* FEATURE_NV_vertex_program */ @@ -1226,27 +1226,27 @@ _mesa_IsEnabled( GLenum cap ) /* client-side state */ case GL_VERTEX_ARRAY: - return (ctx->Array.ArrayObj->Vertex.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled != 0); case GL_NORMAL_ARRAY: - return (ctx->Array.ArrayObj->Normal.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0); case GL_COLOR_ARRAY: - return (ctx->Array.ArrayObj->Color.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled != 0); case GL_INDEX_ARRAY: - return (ctx->Array.ArrayObj->Index.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0); case GL_TEXTURE_COORD_ARRAY: - return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture] + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)] .Enabled != 0); case GL_EDGE_FLAG_ARRAY: - return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled != 0); case GL_FOG_COORDINATE_ARRAY_EXT: CHECK_EXTENSION(EXT_fog_coord); - return (ctx->Array.ArrayObj->FogCoord.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0); case GL_SECONDARY_COLOR_ARRAY_EXT: CHECK_EXTENSION(EXT_secondary_color); - return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0); #if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_OES: - return (ctx->Array.ArrayObj->PointSize.Enabled != 0); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0); #endif /* GL_ARB_texture_cube_map */ @@ -1312,8 +1312,8 @@ _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); + ASSERT(VERT_ATTRIB_GENERIC(n) < Elements(ctx->Array.ArrayObj->VertexAttrib)); + return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(n)].Enabled != 0); } case GL_MAP1_VERTEX_ATTRIB0_4_NV: case GL_MAP1_VERTEX_ATTRIB1_4_NV: |