diff options
Diffstat (limited to 'src/mesa/main')
90 files changed, 10000 insertions, 7358 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index bae3bf11cb..c2c29c4f3d 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -29,7 +29,7 @@ */ -#include "glheader.h" +#include "mfeatures.h" #if FEATURE_accum #include "accum.h" #endif @@ -880,5 +880,12 @@ _mesa_init_exec_table(struct _glapi_table *exec) /* GL_ATI_separate_stencil */ SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); + +#if FEATURE_ARB_framebuffer_object + /* The ARB_fbo functions are the union of + * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array + */ + SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample); +#endif } diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 924d7134a2..0e3f5ff957 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -31,7 +31,6 @@ #include "glheader.h" #include "macros.h" -#include "colormac.h" #include "api_loopback.h" #include "mtypes.h" #include "glapi/glapi.h" diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 2eb96ae3f4..5c8955d7c8 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.0.1 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -30,6 +30,72 @@ #include "state.h" +/** + * Find the max index in the given element/index buffer + */ +static GLuint +max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf) +{ + const GLubyte *map = NULL; + GLuint max = 0; + GLint i; + + if (elementBuf->Name) { + /* elements are in a user-defined buffer object. need to map it */ + map = ctx->Driver.MapBuffer(ctx, + GL_ELEMENT_ARRAY_BUFFER_ARB, + GL_READ_ONLY, + elementBuf); + /* Actual address is the sum of pointers */ + indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices); + } + + if (type == GL_UNSIGNED_INT) { + for (i = 0; i < count; i++) + if (((GLuint *) indices)[i] > max) + max = ((GLuint *) indices)[i]; + } + else if (type == GL_UNSIGNED_SHORT) { + for (i = 0; i < count; i++) + if (((GLushort *) indices)[i] > max) + max = ((GLushort *) indices)[i]; + } + else { + ASSERT(type == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) + if (((GLubyte *) indices)[i] > max) + max = ((GLubyte *) indices)[i]; + } + + if (map) { + ctx->Driver.UnmapBuffer(ctx, + GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Array.ElementArrayBufferObj); + } + + return max; +} + +static GLboolean +check_valid_to_render(GLcontext *ctx, char *function) +{ + if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, + "glDraw%s(incomplete framebuffer)", function); + return GL_FALSE; + } + + /* Always need vertex positions, unless a vertex program is in use */ + if (!ctx->VertexProgram._Current && + !ctx->Array.ArrayObj->Vertex.Enabled && + !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) + return GL_FALSE; + + return GL_TRUE; +} + GLboolean _mesa_validate_DrawElements(GLcontext *ctx, GLenum mode, GLsizei count, GLenum type, @@ -59,24 +125,20 @@ _mesa_validate_DrawElements(GLcontext *ctx, if (ctx->NewState) _mesa_update_state(ctx); - /* Always need vertex positions, unless a vertex program is in use */ - if (!ctx->VertexProgram._Current && - !ctx->Array.ArrayObj->Vertex.Enabled && - !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) + if (!check_valid_to_render(ctx, "Elements")) return GL_FALSE; /* Vertex buffer object tests */ if (ctx->Array.ElementArrayBufferObj->Name) { + /* use indices in the buffer object */ GLuint indexBytes; - /* use indices in the buffer object */ if (!ctx->Array.ElementArrayBufferObj->Size) { _mesa_warning(ctx, "glDrawElements called with empty array elements buffer"); return GL_FALSE; } - /* make sure count doesn't go outside buffer bounds */ if (type == GL_UNSIGNED_INT) { indexBytes = count * sizeof(GLuint); } @@ -88,6 +150,7 @@ _mesa_validate_DrawElements(GLcontext *ctx, indexBytes = count * sizeof(GLushort); } + /* make sure count doesn't go outside buffer bounds */ if (indexBytes > (GLuint) ctx->Array.ElementArrayBufferObj->Size) { _mesa_warning(ctx, "glDrawElements index out of buffer bounds"); return GL_FALSE; @@ -101,39 +164,8 @@ _mesa_validate_DrawElements(GLcontext *ctx, if (ctx->Const.CheckArrayBounds) { /* find max array index */ - const GLubyte *map; - GLuint max = 0; - GLint i; - - map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - ctx->Array.ElementArrayBufferObj); - - /* Actual address is the sum of pointers */ - indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices); - - if (type == GL_UNSIGNED_INT) { - for (i = 0; i < count; i++) - if (((GLuint *) indices)[i] > max) - max = ((GLuint *) indices)[i]; - } - else if (type == GL_UNSIGNED_SHORT) { - for (i = 0; i < count; i++) - if (((GLushort *) indices)[i] > max) - max = ((GLushort *) indices)[i]; - } - else { - ASSERT(type == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) - if (((GLubyte *) indices)[i] > max) - max = ((GLubyte *) indices)[i]; - } - - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - ctx->Array.ElementArrayBufferObj); - + GLuint max = max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); if (max >= ctx->Array._MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ return GL_FALSE; @@ -143,7 +175,6 @@ _mesa_validate_DrawElements(GLcontext *ctx, return GL_TRUE; } - GLboolean _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, GLuint start, GLuint end, @@ -178,44 +209,40 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, if (ctx->NewState) _mesa_update_state(ctx); - /* Always need vertex positions, unless a vertex program is in use */ - if (!ctx->VertexProgram._Current && - !ctx->Array.ArrayObj->Vertex.Enabled && - !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) + if (!check_valid_to_render(ctx, "RangeElements")) return GL_FALSE; /* Vertex buffer object tests */ if (ctx->Array.ElementArrayBufferObj->Name) { - /* XXX re-use code from above? */ + /* use indices in the buffer object */ + GLuint indexBytes; + + if (type == GL_UNSIGNED_INT) { + indexBytes = count * sizeof(GLuint); + } + else if (type == GL_UNSIGNED_BYTE) { + indexBytes = count * sizeof(GLubyte); + } + else { + ASSERT(type == GL_UNSIGNED_SHORT); + indexBytes = count * sizeof(GLushort); + } + + /* make sure count doesn't go outside buffer bounds */ + if (indexBytes > ctx->Array.ElementArrayBufferObj->Size) { + _mesa_warning(ctx, "glDrawRangeElements index out of buffer bounds"); + return GL_FALSE; + } } else { - /* not using VBO */ + /* not using a VBO */ if (!indices) return GL_FALSE; } if (ctx->Const.CheckArrayBounds) { - /* Find max array index. - * We don't trust the user's start and end values. - */ - GLuint max = 0; - GLint i; - if (type == GL_UNSIGNED_INT) { - for (i = 0; i < count; i++) - if (((GLuint *) indices)[i] > max) - max = ((GLuint *) indices)[i]; - } - else if (type == GL_UNSIGNED_SHORT) { - for (i = 0; i < count; i++) - if (((GLushort *) indices)[i] > max) - max = ((GLushort *) indices)[i]; - } - else { - ASSERT(type == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) - if (((GLubyte *) indices)[i] > max) - max = ((GLubyte *) indices)[i]; - } + GLuint max = max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); if (max >= ctx->Array._MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ return GL_FALSE; @@ -236,8 +263,9 @@ _mesa_validate_DrawArrays(GLcontext *ctx, { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (count < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" ); + if (count <= 0) { + if (count < 0) + _mesa_error(ctx, GL_INVALID_VALUE, "glDrawArrays(count)" ); return GL_FALSE; } @@ -249,10 +277,7 @@ _mesa_validate_DrawArrays(GLcontext *ctx, if (ctx->NewState) _mesa_update_state(ctx); - /* Always need vertex positions, unless a vertex program is in use */ - if (!ctx->VertexProgram._Current && - !ctx->Array.ArrayObj->Vertex.Enabled && - !ctx->Array.ArrayObj->VertexAttrib[0].Enabled) + if (!check_valid_to_render(ctx, "Arrays")) return GL_FALSE; if (ctx->Const.CheckArrayBounds) { diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 1461239317..b04095fd16 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -98,6 +98,28 @@ _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ) } +static void +init_array(GLcontext *ctx, + struct gl_client_array *array, GLint size, GLint type) +{ + array->Size = size; + array->Type = type; + array->Format = GL_RGBA; /* only significant for GL_EXT_vertex_array_bgra */ + array->Stride = 0; + array->StrideB = 0; + array->Ptr = NULL; + array->Enabled = GL_FALSE; + array->Normalized = GL_FALSE; +#if FEATURE_ARB_vertex_buffer_object + /* Vertex array buffers */ + array->BufferObj = ctx->Array.NullBufferObj; +#endif +} + + +/** + * Initialize a gl_array_object's arrays. + */ void _mesa_initialize_array_object( GLcontext *ctx, struct gl_array_object *obj, @@ -107,87 +129,23 @@ _mesa_initialize_array_object( GLcontext *ctx, obj->Name = name; - /* Vertex arrays */ - obj->Vertex.Size = 4; - obj->Vertex.Type = GL_FLOAT; - obj->Vertex.Stride = 0; - obj->Vertex.StrideB = 0; - obj->Vertex.Ptr = NULL; - obj->Vertex.Enabled = GL_FALSE; - obj->Normal.Type = GL_FLOAT; - obj->Normal.Stride = 0; - obj->Normal.StrideB = 0; - obj->Normal.Ptr = NULL; - obj->Normal.Enabled = GL_FALSE; - obj->Color.Size = 4; - obj->Color.Type = GL_FLOAT; - obj->Color.Stride = 0; - obj->Color.StrideB = 0; - obj->Color.Ptr = NULL; - obj->Color.Enabled = GL_FALSE; - obj->SecondaryColor.Size = 4; - obj->SecondaryColor.Type = GL_FLOAT; - obj->SecondaryColor.Stride = 0; - obj->SecondaryColor.StrideB = 0; - obj->SecondaryColor.Ptr = NULL; - obj->SecondaryColor.Enabled = GL_FALSE; - obj->FogCoord.Size = 1; - obj->FogCoord.Type = GL_FLOAT; - obj->FogCoord.Stride = 0; - obj->FogCoord.StrideB = 0; - obj->FogCoord.Ptr = NULL; - obj->FogCoord.Enabled = GL_FALSE; - obj->Index.Type = GL_FLOAT; - obj->Index.Stride = 0; - obj->Index.StrideB = 0; - obj->Index.Ptr = NULL; - obj->Index.Enabled = GL_FALSE; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - obj->TexCoord[i].Size = 4; - obj->TexCoord[i].Type = GL_FLOAT; - obj->TexCoord[i].Stride = 0; - obj->TexCoord[i].StrideB = 0; - obj->TexCoord[i].Ptr = NULL; - obj->TexCoord[i].Enabled = GL_FALSE; + /* Init the individual arrays */ + init_array(ctx, &obj->Vertex, 4, GL_FLOAT); + init_array(ctx, &obj->Normal, 3, GL_FLOAT); + init_array(ctx, &obj->Color, 4, GL_FLOAT); + init_array(ctx, &obj->SecondaryColor, 4, GL_FLOAT); + init_array(ctx, &obj->FogCoord, 1, GL_FLOAT); + init_array(ctx, &obj->Index, 1, GL_FLOAT); + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { + init_array(ctx, &obj->TexCoord[i], 4, GL_FLOAT); } - obj->EdgeFlag.Stride = 0; - obj->EdgeFlag.StrideB = 0; - obj->EdgeFlag.Ptr = NULL; - obj->EdgeFlag.Enabled = GL_FALSE; + init_array(ctx, &obj->EdgeFlag, 1, GL_BOOL); for (i = 0; i < VERT_ATTRIB_MAX; i++) { - obj->VertexAttrib[i].Size = 4; - obj->VertexAttrib[i].Type = GL_FLOAT; - obj->VertexAttrib[i].Stride = 0; - obj->VertexAttrib[i].StrideB = 0; - obj->VertexAttrib[i].Ptr = NULL; - obj->VertexAttrib[i].Enabled = GL_FALSE; - obj->VertexAttrib[i].Normalized = GL_FALSE; + init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT); } #if FEATURE_point_size_array - obj->PointSize.Type = GL_FLOAT; - obj->PointSize.Stride = 0; - obj->PointSize.StrideB = 0; - obj->PointSize.Ptr = NULL; - obj->PointSize.Enabled = GL_FALSE; - obj->PointSize.BufferObj = ctx->Array.NullBufferObj; -#endif - -#if FEATURE_ARB_vertex_buffer_object - /* Vertex array buffers */ - obj->Vertex.BufferObj = ctx->Array.NullBufferObj; - obj->Normal.BufferObj = ctx->Array.NullBufferObj; - obj->Color.BufferObj = ctx->Array.NullBufferObj; - obj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj; - obj->FogCoord.BufferObj = ctx->Array.NullBufferObj; - obj->Index.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - obj->TexCoord[i].BufferObj = ctx->Array.NullBufferObj; - } - obj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj; - for (i = 0; i < VERT_ATTRIB_MAX; i++) { - obj->VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj; - } + init_array(ctx, &obj->PointSize, 1, GL_FLOAT); #endif } @@ -335,7 +293,7 @@ _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids) unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj ); unbind_buffer_object( ctx, obj->FogCoord.BufferObj ); unbind_buffer_object( ctx, obj->Index.BufferObj ); - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj ); } unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj ); diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 7179fba3db..996033a2d8 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.2 + * Version: 7.3 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -53,8 +54,26 @@ #include "texobj.h" #include "texparam.h" #include "texstate.h" +#include "varray.h" #include "mtypes.h" -#include "math/m_xform.h" + + +/** + * Special struct for saving/restoring texture state (GL_TEXTURE_BIT) + */ +struct texture_state +{ + struct gl_texture_attrib Texture; /**< The usual context state */ + + /** to save per texture object state (wrap modes, filters, etc): */ + struct gl_texture_object SavedObj[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS]; + + /** + * To save references to texture objects (so they don't get accidentally + * deleted while saved in the attribute stack). + */ + struct gl_texture_object *SavedTexRef[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS]; +}; /** @@ -206,7 +225,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->SampleAlphaToOne = ctx->Multisample.SampleAlphaToOne; attr->SampleCoverage = ctx->Multisample.SampleCoverage; attr->SampleCoverageInvert = ctx->Multisample.SampleCoverageInvert; - for (i=0; i<MAX_TEXTURE_UNITS; i++) { + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { attr->Texture[i] = ctx->Texture.Unit[i].Enabled; attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled; attr->TextureColorTable[i] = ctx->Texture.Unit[i].ColorTableEnabled; @@ -345,47 +364,41 @@ _mesa_PushAttrib(GLbitfield mask) } if (mask & GL_TEXTURE_BIT) { - struct gl_texture_attrib *attr; - GLuint u; + struct texture_state *texstate = CALLOC_STRUCT(texture_state); + GLuint u, tex; + + if (!texstate) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib(GL_TEXTURE_BIT)"); + goto end; + } _mesa_lock_context_textures(ctx); - /* Bump the texture object reference counts so that they don't - * inadvertantly get deleted. + + /* copy/save the bulk of texture state here */ + _mesa_memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture)); + + /* Save references to the currently bound texture objects so they don't + * accidentally get deleted while referenced in the attribute stack. */ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - ctx->Texture.Unit[u].Current1D->RefCount++; - ctx->Texture.Unit[u].Current2D->RefCount++; - ctx->Texture.Unit[u].Current3D->RefCount++; - ctx->Texture.Unit[u].CurrentCubeMap->RefCount++; - ctx->Texture.Unit[u].CurrentRect->RefCount++; - ctx->Texture.Unit[u].Current1DArray->RefCount++; - ctx->Texture.Unit[u].Current2DArray->RefCount++; + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_reference_texobj(&texstate->SavedTexRef[u][tex], + ctx->Texture.Unit[u].CurrentTex[tex]); + } } - attr = MALLOC_STRUCT( gl_texture_attrib ); - MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) ); - /* copy state of the currently bound texture objects */ + /* copy state/contents of the currently bound texture objects */ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - _mesa_copy_texture_object(&attr->Unit[u].Saved1D, - attr->Unit[u].Current1D); - _mesa_copy_texture_object(&attr->Unit[u].Saved2D, - attr->Unit[u].Current2D); - _mesa_copy_texture_object(&attr->Unit[u].Saved3D, - attr->Unit[u].Current3D); - _mesa_copy_texture_object(&attr->Unit[u].SavedCubeMap, - attr->Unit[u].CurrentCubeMap); - _mesa_copy_texture_object(&attr->Unit[u].SavedRect, - attr->Unit[u].CurrentRect); - _mesa_copy_texture_object(&attr->Unit[u].Saved1DArray, - attr->Unit[u].Current1DArray); - _mesa_copy_texture_object(&attr->Unit[u].Saved2DArray, - attr->Unit[u].Current2DArray); + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_copy_texture_object(&texstate->SavedObj[u][tex], + ctx->Texture.Unit[u].CurrentTex[tex]); + } } _mesa_unlock_context_textures(ctx); newnode = new_attrib_node( GL_TEXTURE_BIT ); - newnode->data = attr; + newnode->data = texstate; newnode->next = head; head = newnode; } @@ -421,6 +434,7 @@ _mesa_PushAttrib(GLbitfield mask) head = newnode; } +end: ctx->AttribStack[ctx->AttribStackDepth] = head; ctx->AttribStackDepth++; } @@ -630,14 +644,19 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) } +/** + * Pop/restore texture attribute/group state. + */ static void -pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) +pop_texture_group(GLcontext *ctx, struct texture_state *texstate) { GLuint u; + _mesa_lock_context_textures(ctx); + for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - const struct gl_texture_unit *unit = &texAttrib->Unit[u]; - GLuint i; + const struct gl_texture_unit *unit = &texstate->Texture.Unit[u]; + GLuint tgt; _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u); _mesa_set_enable(ctx, GL_TEXTURE_1D, @@ -660,26 +679,26 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) } _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode); _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor); - _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenModeS); - _mesa_TexGeni(GL_T, GL_TEXTURE_GEN_MODE, unit->GenModeT); - _mesa_TexGeni(GL_R, GL_TEXTURE_GEN_MODE, unit->GenModeR); - _mesa_TexGeni(GL_Q, GL_TEXTURE_GEN_MODE, unit->GenModeQ); - _mesa_TexGenfv(GL_S, GL_OBJECT_PLANE, unit->ObjectPlaneS); - _mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->ObjectPlaneT); - _mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->ObjectPlaneR); - _mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->ObjectPlaneQ); + _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode); + _mesa_TexGeni(GL_T, GL_TEXTURE_GEN_MODE, unit->GenT.Mode); + _mesa_TexGeni(GL_R, GL_TEXTURE_GEN_MODE, unit->GenR.Mode); + _mesa_TexGeni(GL_Q, GL_TEXTURE_GEN_MODE, unit->GenQ.Mode); + _mesa_TexGenfv(GL_S, GL_OBJECT_PLANE, unit->GenS.ObjectPlane); + _mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->GenT.ObjectPlane); + _mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->GenR.ObjectPlane); + _mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->GenQ.ObjectPlane); /* Eye plane done differently to avoid re-transformation */ { struct gl_texture_unit *destUnit = &ctx->Texture.Unit[u]; - COPY_4FV(destUnit->EyePlaneS, unit->EyePlaneS); - COPY_4FV(destUnit->EyePlaneT, unit->EyePlaneT); - COPY_4FV(destUnit->EyePlaneR, unit->EyePlaneR); - COPY_4FV(destUnit->EyePlaneQ, unit->EyePlaneQ); + COPY_4FV(destUnit->GenS.EyePlane, unit->GenS.EyePlane); + COPY_4FV(destUnit->GenT.EyePlane, unit->GenT.EyePlane); + COPY_4FV(destUnit->GenR.EyePlane, unit->GenR.EyePlane); + COPY_4FV(destUnit->GenQ.EyePlane, unit->GenQ.EyePlane); if (ctx->Driver.TexGen) { - ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->EyePlaneS); - ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->EyePlaneT); - ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->EyePlaneR); - ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->EyePlaneQ); + ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->GenS.EyePlane); + ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->GenT.EyePlane); + ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->GenR.EyePlane); + ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->GenQ.EyePlane); } } _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, @@ -730,52 +749,32 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) 1 << unit->Combine.ScaleShiftA); } - /* Restore texture object state */ - for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { - GLenum target = 0; + /* Restore texture object state for each target */ + for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { const struct gl_texture_object *obj = NULL; GLfloat bordColor[4]; + GLenum target; - switch (i) { - case 0: - target = GL_TEXTURE_1D; - obj = &unit->Saved1D; - break; - case 1: - target = GL_TEXTURE_2D; - obj = &unit->Saved2D; - break; - case 2: - target = GL_TEXTURE_3D; - obj = &unit->Saved3D; - break; - case 3: - if (!ctx->Extensions.ARB_texture_cube_map) - continue; - target = GL_TEXTURE_CUBE_MAP_ARB; - obj = &unit->SavedCubeMap; - break; - case 4: - if (!ctx->Extensions.NV_texture_rectangle) - continue; - target = GL_TEXTURE_RECTANGLE_NV; - obj = &unit->SavedRect; - break; - case 5: - if (!ctx->Extensions.MESA_texture_array) - continue; - target = GL_TEXTURE_1D_ARRAY_EXT; - obj = &unit->Saved1DArray; - break; - case 6: - if (!ctx->Extensions.MESA_texture_array) - continue; - target = GL_TEXTURE_2D_ARRAY_EXT; - obj = &unit->Saved2DArray; - break; - default: - ; /* silence warnings */ + obj = &texstate->SavedObj[u][tgt]; + + /* don't restore state for unsupported targets to prevent + * raising GL errors. + */ + if (obj->Target == GL_TEXTURE_CUBE_MAP_ARB && + !ctx->Extensions.ARB_texture_cube_map) { + continue; + } + else if (obj->Target == GL_TEXTURE_RECTANGLE_NV && + !ctx->Extensions.NV_texture_rectangle) { + continue; } + else if ((obj->Target == GL_TEXTURE_1D_ARRAY_EXT || + obj->Target == GL_TEXTURE_2D_ARRAY_EXT) && + !ctx->Extensions.MESA_texture_array) { + continue; + } + + target = obj->Target; _mesa_BindTexture(target, obj->Name); @@ -784,8 +783,8 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) bordColor[2] = CHAN_TO_FLOAT(obj->BorderColor[2]); bordColor[3] = CHAN_TO_FLOAT(obj->BorderColor[3]); - _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority); _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, bordColor); + _mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, obj->WrapS); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, obj->WrapT); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, obj->WrapR); @@ -801,35 +800,21 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, obj->MaxAnisotropy); } - if (ctx->Extensions.SGIX_shadow) { - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_SGIX, - obj->CompareFlag); - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_OPERATOR_SGIX, - obj->CompareOperator); - } - if (ctx->Extensions.SGIX_shadow_ambient) { - _mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX, - obj->ShadowAmbient); + if (ctx->Extensions.ARB_shadow_ambient) { + _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, + obj->CompareFailValue); } + } + /* remove saved references to the texture objects */ + for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { + _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL); } } - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB - + texAttrib->CurrentUnit); - /* "un-bump" the texture object reference counts. We did that so they - * wouldn't inadvertantly get deleted while they were still referenced - * inside the attribute state stack. - */ - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - ctx->Texture.Unit[u].Current1D->RefCount--; - ctx->Texture.Unit[u].Current2D->RefCount--; - ctx->Texture.Unit[u].Current3D->RefCount--; - ctx->Texture.Unit[u].CurrentCubeMap->RefCount--; - ctx->Texture.Unit[u].CurrentRect->RefCount--; - ctx->Texture.Unit[u].Current1DArray->RefCount--; - ctx->Texture.Unit[u].Current2DArray->RefCount--; - } + _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + texstate->Texture.CurrentUnit); + + _mesa_unlock_context_textures(ctx); } @@ -898,14 +883,13 @@ _mesa_PopAttrib(void) * function, but legal for the later. */ GLboolean multipleBuffers = GL_FALSE; - if (ctx->Extensions.ARB_draw_buffers) { - GLuint i; - for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) { - if (color->DrawBuffer[i] != GL_NONE) { - multipleBuffers = GL_TRUE; - break; - } - } + GLuint i; + + for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) { + if (color->DrawBuffer[i] != GL_NONE) { + multipleBuffers = GL_TRUE; + break; + } } /* Call the API_level functions, not _mesa_drawbuffers() * since we need to do error checking on the pop'd @@ -1001,9 +985,8 @@ _mesa_PopAttrib(void) _mesa_Hint(GL_FOG_HINT, hint->Fog); _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, hint->ClipVolumeClipping); - if (ctx->Extensions.ARB_texture_compression) - _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB, - hint->TextureCompression); + _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB, + hint->TextureCompression); } break; case GL_LIGHTING_BIT: @@ -1098,8 +1081,9 @@ _mesa_PopAttrib(void) (GLint) point->CoordReplace[u]); } _mesa_set_enable(ctx, GL_POINT_SPRITE_NV,point->PointSprite); - _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV, - ctx->Point.SpriteRMode); + if (ctx->Extensions.NV_point_sprite) + _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV, + ctx->Point.SpriteRMode); _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN, (GLfloat)ctx->Point.SpriteOrigin); } @@ -1208,9 +1192,9 @@ _mesa_PopAttrib(void) case GL_TEXTURE_BIT: /* Take care of texture object reference counters */ { - const struct gl_texture_attrib *texture; - texture = (const struct gl_texture_attrib *) attr->data; - pop_texture_group(ctx, texture); + struct texture_state *texstate + = (struct texture_state *) attr->data; + pop_texture_group(ctx, texstate); ctx->NewState |= _NEW_TEXTURE; } break; @@ -1263,9 +1247,6 @@ adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step) array->ArrayObj->TexCoord[i].BufferObj->RefCount += step; for (i = 0; i < VERT_ATTRIB_MAX; i++) array->ArrayObj->VertexAttrib[i].BufferObj->RefCount += step; - - array->ArrayBufferObj->RefCount += step; - array->ElementArrayBufferObj->RefCount += step; } @@ -1409,8 +1390,10 @@ _mesa_PopClientAttrib(void) adjust_buffer_object_ref_counts(&ctx->Array, -1); ctx->Array.ActiveTexture = data->ActiveTexture; - ctx->Array.LockFirst = data->LockFirst; - ctx->Array.LockCount = data->LockCount; + if (data->LockCount != 0) + _mesa_LockArraysEXT(data->LockFirst, data->LockCount); + else if (ctx->Array.LockCount) + _mesa_UnlockArraysEXT(); _mesa_BindVertexArrayAPPLE( data->ArrayObj->Name ); @@ -1447,6 +1430,42 @@ _mesa_PopClientAttrib(void) } +/** + * Free any attribute state data that might be attached to the context. + */ +void +_mesa_free_attrib_data(GLcontext *ctx) +{ + while (ctx->AttribStackDepth > 0) { + struct gl_attrib_node *attr, *next; + + ctx->AttribStackDepth--; + attr = ctx->AttribStack[ctx->AttribStackDepth]; + + while (attr) { + if (attr->kind == GL_TEXTURE_BIT) { + struct texture_state *texstate = (struct texture_state*)attr->data; + GLuint u, tgt; + /* clear references to the saved texture objects */ + for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { + for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { + _mesa_reference_texobj(&texstate->SavedTexRef[u][tgt], NULL); + } + } + } + else { + /* any other chunks of state that requires special handling? */ + } + + next = attr->next; + _mesa_free(attr->data); + _mesa_free(attr); + attr = next; + } + } +} + + void _mesa_init_attrib( GLcontext *ctx ) { /* Renderer and client attribute stacks */ diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index 09d75196b2..2cf8fe6934 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -1,18 +1,8 @@ -/** - * \file attrib.h - * Attribute stacks. - * - * \if subset - * (No-op) - * - * \endif - */ - /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 7.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -32,8 +22,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - - #ifndef ATTRIB_H #define ATTRIB_H @@ -58,10 +46,14 @@ _mesa_PopClientAttrib( void ); extern void _mesa_init_attrib( GLcontext *ctx ); +extern void +_mesa_free_attrib_data( GLcontext *ctx ); + #else /** No-op */ #define _mesa_init_attrib( c ) ((void)0) +#define _mesa_free_attrib_data( c ) ((void)0) #endif diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 4d4a897141..39cf6153e2 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -31,7 +31,6 @@ #include "glheader.h" #include "blend.h" -#include "colormac.h" #include "context.h" #include "enums.h" #include "macros.h" diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index dd4ac4679e..016543da01 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -446,6 +446,89 @@ _mesa_init_buffer_objects( GLcontext *ctx ) ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj; } +/** + * Bind the specified target to buffer for the specified context. + */ +static void +bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) +{ + struct gl_buffer_object *oldBufObj; + struct gl_buffer_object *newBufObj = NULL; + struct gl_buffer_object **bindTarget = NULL; + + switch (target) { + case GL_ARRAY_BUFFER_ARB: + bindTarget = &ctx->Array.ArrayBufferObj; + break; + case GL_ELEMENT_ARRAY_BUFFER_ARB: + bindTarget = &ctx->Array.ElementArrayBufferObj; + break; + case GL_PIXEL_PACK_BUFFER_EXT: + bindTarget = &ctx->Pack.BufferObj; + break; + case GL_PIXEL_UNPACK_BUFFER_EXT: + bindTarget = &ctx->Unpack.BufferObj; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target)"); + return; + } + + /* Get pointer to old buffer object (to be unbound) */ + oldBufObj = get_buffer(ctx, target); + if (oldBufObj && oldBufObj->Name == buffer) + return; /* rebinding the same buffer object- no change */ + + /* + * Get pointer to new buffer object (newBufObj) + */ + if (buffer == 0) { + /* The spec says there's not a buffer object named 0, but we use + * one internally because it simplifies things. + */ + newBufObj = ctx->Array.NullBufferObj; + } + else { + /* non-default buffer object */ + newBufObj = _mesa_lookup_bufferobj(ctx, buffer); + if (!newBufObj) { + /* if this is a new buffer object id, allocate a buffer object now */ + ASSERT(ctx->Driver.NewBufferObject); + newBufObj = ctx->Driver.NewBufferObject(ctx, buffer, target); + if (!newBufObj) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB"); + return; + } + _mesa_HashInsert(ctx->Shared->BufferObjects, buffer, newBufObj); + } + } + + /* bind new buffer */ + _mesa_reference_buffer_object(ctx, bindTarget, newBufObj); + + /* Pass BindBuffer call to device driver */ + if (ctx->Driver.BindBuffer && newBufObj) + ctx->Driver.BindBuffer( ctx, target, newBufObj ); +} + + +/** + * Update the default buffer objects in the given context to reference those + * specified in the shared state and release those referencing the old + * shared state. + */ +void +_mesa_update_default_objects_buffer_objects(GLcontext *ctx) +{ + /* Bind the NullBufferObj to remove references to those + * in the shared context hash table. + */ + bind_buffer_object( ctx, GL_ARRAY_BUFFER_ARB, 0); + bind_buffer_object( ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + bind_buffer_object( ctx, GL_PIXEL_PACK_BUFFER_ARB, 0); + bind_buffer_object( ctx, GL_PIXEL_UNPACK_BUFFER_ARB, 0); +} + /** * When we're about to read pixel data out of a PBO (via glDrawPixels, @@ -684,64 +767,9 @@ void GLAPIENTRY _mesa_BindBufferARB(GLenum target, GLuint buffer) { GET_CURRENT_CONTEXT(ctx); - struct gl_buffer_object *oldBufObj; - struct gl_buffer_object *newBufObj = NULL; - struct gl_buffer_object **bindTarget = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bindTarget = &ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bindTarget = &ctx->Unpack.BufferObj; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target)"); - return; - } - - /* Get pointer to old buffer object (to be unbound) */ - oldBufObj = get_buffer(ctx, target); - if (oldBufObj && oldBufObj->Name == buffer) - return; /* rebinding the same buffer object- no change */ - - /* - * Get pointer to new buffer object (newBufObj) - */ - if (buffer == 0) { - /* The spec says there's not a buffer object named 0, but we use - * one internally because it simplifies things. - */ - newBufObj = ctx->Array.NullBufferObj; - } - else { - /* non-default buffer object */ - newBufObj = _mesa_lookup_bufferobj(ctx, buffer); - if (!newBufObj) { - /* if this is a new buffer object id, allocate a buffer object now */ - ASSERT(ctx->Driver.NewBufferObject); - newBufObj = ctx->Driver.NewBufferObject(ctx, buffer, target); - if (!newBufObj) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB"); - return; - } - _mesa_HashInsert(ctx->Shared->BufferObjects, buffer, newBufObj); - } - } - - /* bind new buffer */ - _mesa_reference_buffer_object(ctx, bindTarget, newBufObj); - - /* Pass BindBuffer call to device driver */ - if (ctx->Driver.BindBuffer && newBufObj) - ctx->Driver.BindBuffer( ctx, target, newBufObj ); + bind_buffer_object(ctx, target, buffer); } @@ -780,7 +808,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) unbind(ctx, &ctx->Array.ArrayObj->FogCoord.BufferObj, bufObj); unbind(ctx, &ctx->Array.ArrayObj->Index.BufferObj, bufObj); unbind(ctx, &ctx->Array.ArrayObj->EdgeFlag.BufferObj, bufObj); - for (j = 0; j < MAX_TEXTURE_UNITS; j++) { + for (j = 0; j < MAX_TEXTURE_COORD_UNITS; j++) { unbind(ctx, &ctx->Array.ArrayObj->TexCoord[j].BufferObj, bufObj); } for (j = 0; j < VERT_ATTRIB_MAX; j++) { @@ -801,7 +829,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) _mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 ); } - /* The ID is immediately freed for re-use */ + /* The ID is immediately freed for re-use */ _mesa_HashRemove(ctx->Shared->BufferObjects, bufObj->Name); _mesa_reference_buffer_object(ctx, &bufObj, NULL); } diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 2f908c5c35..3c08f0083c 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -38,6 +38,9 @@ extern void _mesa_init_buffer_objects( GLcontext *ctx ); +extern void +_mesa_update_default_objects_buffer_objects(GLcontext *ctx); + extern struct gl_buffer_object * _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ); @@ -103,7 +106,6 @@ extern void _mesa_unmap_drawpix_pbo(GLcontext *ctx, const struct gl_pixelstore_attrib *unpack); - extern void * _mesa_map_readpix_pbo(GLcontext *ctx, const struct gl_pixelstore_attrib *pack, diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 1d07c68633..85db3868c4 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -133,6 +133,14 @@ draw_buffer_enum_to_bitmask(GLenum buffer) return BUFFER_BIT_COLOR2; case GL_COLOR_ATTACHMENT3_EXT: return BUFFER_BIT_COLOR3; + case GL_COLOR_ATTACHMENT4_EXT: + return BUFFER_BIT_COLOR4; + case GL_COLOR_ATTACHMENT5_EXT: + return BUFFER_BIT_COLOR5; + case GL_COLOR_ATTACHMENT6_EXT: + return BUFFER_BIT_COLOR6; + case GL_COLOR_ATTACHMENT7_EXT: + return BUFFER_BIT_COLOR7; default: /* error */ return BAD_MASK; @@ -182,6 +190,14 @@ read_buffer_enum_to_index(GLenum buffer) return BUFFER_COLOR2; case GL_COLOR_ATTACHMENT3_EXT: return BUFFER_COLOR3; + case GL_COLOR_ATTACHMENT4_EXT: + return BUFFER_COLOR4; + case GL_COLOR_ATTACHMENT5_EXT: + return BUFFER_COLOR5; + case GL_COLOR_ATTACHMENT6_EXT: + return BUFFER_COLOR6; + case GL_COLOR_ATTACHMENT7_EXT: + return BUFFER_COLOR7; default: /* error */ return -1; @@ -196,6 +212,20 @@ read_buffer_enum_to_index(GLenum buffer) * \sa _mesa_DrawBuffersARB * * \param buffer buffer token such as GL_LEFT or GL_FRONT_AND_BACK, etc. + * + * Note that the behaviour of this function depends on whether the + * current ctx->DrawBuffer is a window-system framebuffer (Name=0) or + * a user-created framebuffer object (Name!=0). + * In the former case, we update the per-context ctx->Color.DrawBuffer + * state var _and_ the FB's ColorDrawBuffer state. + * In the later case, we update the FB's ColorDrawBuffer state only. + * + * Furthermore, upon a MakeCurrent() or BindFramebuffer() call, if the + * new FB is a window system FB, we need to re-update the FB's + * ColorDrawBuffer state to match the context. This is handled in + * _mesa_update_framebuffer(). + * + * See the GL_EXT_framebuffer_object spec for more info. */ void GLAPIENTRY _mesa_DrawBuffer(GLenum buffer) @@ -217,13 +247,14 @@ _mesa_DrawBuffer(GLenum buffer) destMask = draw_buffer_enum_to_bitmask(buffer); if (destMask == BAD_MASK) { /* totally bogus buffer */ - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer=0x%x)", buffer); return; } destMask &= supportedMask; if (destMask == 0x0) { /* none of the named color buffers exist! */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(buffer)"); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDrawBuffer(buffer=0x%x)", buffer); return; } } @@ -259,11 +290,10 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (!ctx->Extensions.ARB_draw_buffers) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB"); - return; - } - if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { + /* Turns out n==0 is a valid input that should not produce an error. + * The remaining code below correctly handles the n==0 case. + */ + if (n < 0 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { _mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)"); return; } @@ -305,55 +335,28 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) _mesa_drawbuffers(ctx, n, buffers, destMask); /* - * Call device driver function. + * Call device driver function. Note that n can be equal to 0, + * in which case we don't want to reference buffers[0], which + * may not be valid. */ if (ctx->Driver.DrawBuffers) ctx->Driver.DrawBuffers(ctx, n, buffers); else if (ctx->Driver.DrawBuffer) - ctx->Driver.DrawBuffer(ctx, buffers[0]); -} - - -/** - * Set color output state. Traditionally, there was only one color - * output, but fragment programs can now have several distinct color - * outputs (see GL_ARB_draw_buffers). This function sets the state - * for one such color output. - * \param ctx current context - * \param output which fragment program output - * \param buffer buffer to write to (like GL_LEFT) - * \param destMask BUFFER_* bitmask - * (like BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT). - */ -static void -set_color_output(GLcontext *ctx, GLuint output, GLenum buffer, - GLbitfield destMask) -{ - struct gl_framebuffer *fb = ctx->DrawBuffer; - - ASSERT(output < ctx->Const.MaxDrawBuffers); - - /* Set per-FBO state */ - fb->ColorDrawBuffer[output] = buffer; - fb->_ColorDrawBufferMask[output] = destMask; - /* not really needed, will be set later */ - fb->_NumColorDrawBuffers[output] = 0; - - if (fb->Name == 0) - /* Set traditional state var */ - ctx->Color.DrawBuffer[output] = buffer; + ctx->Driver.DrawBuffer(ctx, n>0? buffers[0]:GL_NONE); } /** - * Helper routine used by _mesa_DrawBuffer, _mesa_DrawBuffersARB and - * other places (window fbo fixup) to set fbo (and the old ctx) fields. + * Helper function to set the GL_DRAW_BUFFER state in the context and + * current FBO. + * * All error checking will have been done prior to calling this function * so nothing should go wrong at this point. + * * \param ctx current context * \param n number of color outputs to set * \param buffers array[n] of colorbuffer names, like GL_LEFT. - * \param destMask array[n] of BUFFER_* bitmasks which correspond to the + * \param destMask array[n] of BUFFER_BIT_* bitmasks which correspond to the * colorbuffer names. (i.e. GL_FRONT_AND_BACK => * BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT). */ @@ -361,13 +364,13 @@ void _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, const GLbitfield *destMask) { + struct gl_framebuffer *fb = ctx->DrawBuffer; GLbitfield mask[MAX_DRAW_BUFFERS]; - GLuint output; if (!destMask) { /* compute destMask values now */ - const GLbitfield supportedMask - = supported_buffer_bitmask(ctx, ctx->DrawBuffer); + const GLbitfield supportedMask = supported_buffer_bitmask(ctx, fb); + GLuint output; for (output = 0; output < n; output++) { mask[output] = draw_buffer_enum_to_bitmask(buffers[output]); ASSERT(mask[output] != BAD_MASK); @@ -376,56 +379,75 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, destMask = mask; } - for (output = 0; output < n; output++) { - set_color_output(ctx, output, buffers[output], destMask[output]); + if (n == 1) { + GLuint buf, count = 0; + /* init to -1 to help catch errors */ + fb->_ColorDrawBufferIndexes[0] = -1; + for (buf = 0; buf < BUFFER_COUNT; buf++) { + if (destMask[0] & (1 << buf)) { + fb->_ColorDrawBufferIndexes[count] = buf; + count++; + } + } + fb->ColorDrawBuffer[0] = buffers[0]; + fb->_NumColorDrawBuffers = count; + } + else { + GLuint buf, count = 0; + for (buf = 0; buf < n; buf++ ) { + if (destMask[buf]) { + fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1; + fb->ColorDrawBuffer[buf] = buffers[buf]; + count = buf + 1; + } + else { + fb->_ColorDrawBufferIndexes[buf] = -1; + } + } + /* set remaining outputs to -1 (GL_NONE) */ + while (buf < ctx->Const.MaxDrawBuffers) { + fb->_ColorDrawBufferIndexes[buf] = -1; + fb->ColorDrawBuffer[buf] = GL_NONE; + buf++; + } + fb->_NumColorDrawBuffers = count; } - /* set remaining color outputs to NONE */ - for (output = n; output < ctx->Const.MaxDrawBuffers; output++) { - set_color_output(ctx, output, GL_NONE, 0x0); + if (fb->Name == 0) { + /* also set context drawbuffer state */ + GLuint buf; + for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { + ctx->Color.DrawBuffer[buf] = fb->ColorDrawBuffer[buf]; + } } ctx->NewState |= _NEW_BUFFERS; } -GLboolean -_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer) +/** + * Like \sa _mesa_drawbuffers(), this is a helper function for setting + * GL_READ_BUFFER state in the context and current FBO. + * \param ctx the rendering context + * \param buffer GL_FRONT, GL_BACK, GL_COLOR_ATTACHMENT0, etc. + * \param bufferIndex the numerical index corresponding to 'buffer' + */ +void +_mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex) { - struct gl_framebuffer *fb; - GLbitfield supportedMask; - GLint srcBuffer; - - fb = ctx->ReadBuffer; - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - - if (fb->Name > 0 && buffer == GL_NONE) { - /* This is legal for user-created framebuffer objects */ - srcBuffer = -1; - } - else { - /* general case / window-system framebuffer */ - srcBuffer = read_buffer_enum_to_index(buffer); - if (srcBuffer == -1) { - _mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer=0x%x)", buffer); - return GL_FALSE; - } - supportedMask = supported_buffer_bitmask(ctx, fb); - if (((1 << srcBuffer) & supportedMask) == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer=0x%x)", buffer); - return GL_FALSE; - } - } + struct gl_framebuffer *fb = ctx->ReadBuffer; if (fb->Name == 0) { + /* Only update the per-context READ_BUFFER state if we're bound to + * a window-system framebuffer. + */ ctx->Pixel.ReadBuffer = buffer; } + fb->ColorReadBuffer = buffer; - fb->_ColorReadBufferIndex = srcBuffer; + fb->_ColorReadBufferIndex = bufferIndex; - return GL_TRUE; + ctx->NewState |= _NEW_PIXEL; } @@ -437,15 +459,43 @@ _mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer) void GLAPIENTRY _mesa_ReadBuffer(GLenum buffer) { + struct gl_framebuffer *fb; + GLbitfield supportedMask; + GLint srcBuffer; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - if (!_mesa_readbuffer_update_fields(ctx, buffer)) - return; + fb = ctx->ReadBuffer; + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); + + if (fb->Name > 0 && buffer == GL_NONE) { + /* This is legal for user-created framebuffer objects */ + srcBuffer = -1; + } + else { + /* general case / window-system framebuffer */ + srcBuffer = read_buffer_enum_to_index(buffer); + if (srcBuffer == -1) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glReadBuffer(buffer=0x%x)", buffer); + return; + } + supportedMask = supported_buffer_bitmask(ctx, fb); + if (((1 << srcBuffer) & supportedMask) == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glReadBuffer(buffer=0x%x)", buffer); + return; + } + } + + /* OK, all error checking has been completed now */ + _mesa_readbuffer(ctx, buffer, srcBuffer); ctx->NewState |= _NEW_BUFFERS; /* diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index 53d5fb80d4..8a7e7b5c1f 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -46,8 +46,8 @@ extern void _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, const GLbitfield *destMask); -extern GLboolean -_mesa_readbuffer_update_fields(GLcontext *ctx, GLenum buffer); +extern void +_mesa_readbuffer(GLcontext *ctx, GLenum buffer, GLint bufferIndex); extern void GLAPIENTRY _mesa_ReadBuffer( GLenum mode ); diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index 434685984d..63388f42ee 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -138,7 +138,9 @@ _mesa_Clear( GLbitfield mask ) return; } - if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0) + if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 || + ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax || + ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax) return; if (ctx->RenderMode == GL_RENDER) { @@ -155,7 +157,10 @@ _mesa_Clear( GLbitfield mask ) */ bufferMask = 0; if (mask & GL_COLOR_BUFFER_BIT) { - bufferMask |= ctx->DrawBuffer->_ColorDrawBufferMask[0]; + GLuint i; + for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { + bufferMask |= (1 << ctx->DrawBuffer->_ColorDrawBufferIndexes[i]); + } } if ((mask & GL_DEPTH_BUFFER_BIT) diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 43ef55ee3b..96c80e6ef8 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -29,7 +29,6 @@ #include "macros.h" #include "mtypes.h" -#include "math/m_xform.h" #include "math/m_matrix.h" diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index a19521fc85..74692e9a98 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -180,20 +180,24 @@ do { \ */ /*@{*/ -#define PACK_COLOR_8888( R, G, B, A ) \ - (((R) << 24) | ((G) << 16) | ((B) << 8) | (A)) +#define PACK_COLOR_8888( X, Y, Z, W ) \ + (((X) << 24) | ((Y) << 16) | ((Z) << 8) | (W)) -#define PACK_COLOR_8888_REV( R, G, B, A ) \ - (((A) << 24) | ((B) << 16) | ((G) << 8) | (R)) +#define PACK_COLOR_8888_REV( X, Y, Z, W ) \ + (((W) << 24) | ((Z) << 16) | ((Y) << 8) | (X)) -#define PACK_COLOR_888( R, G, B ) \ - (((R) << 16) | ((G) << 8) | (B)) +#define PACK_COLOR_888( X, Y, Z ) \ + (((X) << 16) | ((Y) << 8) | (Z)) -#define PACK_COLOR_565( R, G, B ) \ - ((((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | (((B) & 0xf8) >> 3)) +#define PACK_COLOR_565( X, Y, Z ) \ + ((((X) & 0xf8) << 8) | (((Y) & 0xfc) << 3) | (((Z) & 0xf8) >> 3)) -#define PACK_COLOR_565_REV( R, G, B ) \ - (((R) & 0xf8) | ((G) & 0xe0) >> 5 | (((G) & 0x1c) << 11) | (((B) & 0xf8) << 5)) +#define PACK_COLOR_565_REV( X, Y, Z ) \ + (((X) & 0xf8) | ((Y) & 0xe0) >> 5 | (((Y) & 0x1c) << 11) | (((Z) & 0xf8) << 5)) + +#define PACK_COLOR_5551( R, G, B, A ) \ + ((((R) & 0xf8) << 8) | (((G) & 0xf8) << 3) | (((B) & 0xf8) >> 2) | \ + ((A) ? 1 : 0)) #define PACK_COLOR_1555( A, B, G, R ) \ ((((B) & 0xf8) << 7) | (((G) & 0xf8) << 2) | (((R) & 0xf8) >> 3) | \ diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 97120398f9..bd9cf438b4 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -383,7 +383,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, return; } - if (width < 0 || (width != 0 && _mesa_bitcount(width) != 1)) { + if (width < 0 || (width != 0 && !_mesa_is_pow_two(width))) { /* error */ if (proxy) { table->Size = 0; diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h new file mode 100644 index 0000000000..39b19bb776 --- /dev/null +++ b/src/mesa/main/compiler.h @@ -0,0 +1,479 @@ +/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/** + * \file compiler.h + * Compiler-related stuff. + */ + + +#ifndef COMPILER_H +#define COMPILER_H + + +#include <assert.h> +#include <ctype.h> +#if defined(__alpha__) && defined(CCPML) +#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */ +#else +#include <math.h> +#endif +#include <limits.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#if defined(__linux__) && defined(__i386__) +#include <fpu_control.h> +#endif +#include <float.h> +#include <stdarg.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * Get standard integer types + */ +#if defined(_MSC_VER) + typedef __int8 int8_t; + typedef unsigned __int8 uint8_t; + typedef __int16 int16_t; + typedef unsigned __int16 uint16_t; +# ifndef __eglplatform_h_ + typedef __int32 int32_t; +# endif + typedef unsigned __int32 uint32_t; + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; + +# if defined(_WIN64) + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +# else + typedef __int32 intptr_t; + typedef unsigned __int32 uintptr_t; +# endif + +# define INT64_C(__val) __val##i64 +# define UINT64_C(__val) __val##ui64 +#else +# include <stdint.h> +#endif + + +/** + * Sun compilers define __i386 instead of the gcc-style __i386__ + */ +#ifdef __SUNPRO_C +# if !defined(__i386__) && defined(__i386) +# define __i386__ +# elif !defined(__amd64__) && defined(__amd64) +# define __amd64__ +# elif !defined(__sparc__) && defined(__sparc) +# define __sparc__ +# endif +# if !defined(__volatile) +# define __volatile volatile +# endif +#endif + + +/** + * finite macro. + */ +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) +# define __WIN32__ +# define finite _finite +#endif +#if defined(__WATCOMC__) +# define finite _finite +# pragma disable_message(201) /* Disable unreachable code warnings */ +#endif + + +/** + * Disable assorted warnings + */ +#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP) +# if !defined(__GNUC__) /* mingw environment */ +# pragma warning( disable : 4068 ) /* unknown pragma */ +# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ +# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ +# pragma warning( disable : 4127 ) /* conditional expression is constant */ +# if defined(MESA_MINWARN) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# endif +# endif +#endif + + +/** + * Function inlining + */ +#if defined(__GNUC__) +# define INLINE __inline__ +#elif defined(__MSC__) +# define INLINE __inline +#elif defined(_MSC_VER) +# define INLINE __inline +#elif defined(__ICL) +# define INLINE __inline +#elif defined(__INTEL_COMPILER) +# define INLINE inline +#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) +# define INLINE __inline +#elif defined(__SUNPRO_C) && defined(__C99FEATURES__) +# define INLINE inline +# define __inline inline +# define __inline__ inline +#elif (__STDC_VERSION__ >= 199901L) /* C99 */ +# define INLINE inline +#else +# define INLINE +#endif + + +/** + * PUBLIC/USED macros + * + * If we build the library with gcc's -fvisibility=hidden flag, we'll + * use the PUBLIC macro to mark functions that are to be exported. + * + * We also need to define a USED attribute, so the optimizer doesn't + * inline a static function that we later use in an alias. - ajax + */ +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define PUBLIC __attribute__((visibility("default"))) +# define USED __attribute__((used)) +#else +# define PUBLIC +# define USED +#endif + + +/** + * Some compilers don't like some of Mesa's const usage. In those places use + * CONST instead of const. Pass -DNO_CONST to compilers where this matters. + */ +#ifdef NO_CONST +# define CONST +#else +# define CONST const +#endif + + +/** + * __builtin_expect macros + */ +#if (!defined(__GNUC__) || __GNUC__ < 3) && (!defined(__IBMC__) || __IBMC__ < 900) +# define __builtin_expect(x, y) x +#endif + + +/** + * The __FUNCTION__ gcc variable is generally only used for debugging. + * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. + * Don't define it if using a newer Windows compiler. + */ +#ifndef __FUNCTION__ +# if defined(__VMS) +# define __FUNCTION__ "VMS$NL:" +# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ + (!defined(_MSC_VER) || _MSC_VER < 1300) +# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ + (defined(__SUNPRO_C) && defined(__C99FEATURES__)) +# define __FUNCTION__ __func__ +# else +# define __FUNCTION__ "<unknown>" +# endif +# endif +#endif + + +/** + * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN. + * Do not use them unless absolutely necessary! + * Try to use a runtime test instead. + * For now, only used by some DRI hardware drivers for color/texel packing. + */ +#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +#if defined(__linux__) +#include <byteswap.h> +#define CPU_TO_LE32( x ) bswap_32( x ) +#else /*__linux__*/ +#include <sys/endian.h> +#define CPU_TO_LE32( x ) bswap32( x ) +#endif /*__linux__*/ +#define MESA_BIG_ENDIAN 1 +#else +#define CPU_TO_LE32( x ) ( x ) +#define MESA_LITTLE_ENDIAN 1 +#endif +#define LE32_TO_CPU( x ) CPU_TO_LE32( x ) + + + +#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP) +#define CAPI _cdecl +#endif + + +/** + * Create a macro so that asm functions can be linked into compilers other + * than GNU C + */ +#ifndef _ASMAPI +#if defined(WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/ +#define _ASMAPI __cdecl +#else +#define _ASMAPI +#endif +#ifdef PTR_DECL_IN_FRONT +#define _ASMAPIP * _ASMAPI +#else +#define _ASMAPIP _ASMAPI * +#endif +#endif + +#ifdef USE_X86_ASM +#define _NORMAPI _ASMAPI +#define _NORMAPIP _ASMAPIP +#else +#define _NORMAPI +#define _NORMAPIP * +#endif + + +/* This is a macro on IRIX */ +#ifdef _P +#undef _P +#endif + + +/* Turn off macro checking systems used by other libraries */ +#ifdef CHECK +#undef CHECK +#endif + + +/** + * ASSERT macro + */ +#if !defined(_WIN32_WCE) +#if defined(BUILD_FOR_SNAP) && defined(CHECKED) +# define ASSERT(X) _CHECK(X) +#elif defined(DEBUG) +# define ASSERT(X) assert(X) +#else +# define ASSERT(X) +#endif +#endif + + +#ifndef NULL +#define NULL 0 +#endif + + +/** + * LONGSTRING macro + * gcc -pedantic warns about long string literals, LONGSTRING silences that. + */ +#if !defined(__GNUC__) || (__GNUC__ < 2) || \ + ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) +# define LONGSTRING +#else +# define LONGSTRING __extension__ +#endif + + +#ifndef M_PI +#define M_PI (3.1415926536) +#endif + +#ifndef M_E +#define M_E (2.7182818284590452354) +#endif + +#ifndef ONE_DIV_LN2 +#define ONE_DIV_LN2 (1.442695040888963456) +#endif + +#ifndef ONE_DIV_SQRT_LN2 +#define ONE_DIV_SQRT_LN2 (1.201122408786449815) +#endif + +#ifndef FLT_MAX_EXP +#define FLT_MAX_EXP 128 +#endif + + +/** + * USE_IEEE: Determine if we're using IEEE floating point + */ +#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ + defined(__s390x__) || defined(__powerpc__) || \ + defined(__x86_64__) || \ + defined(ia64) || defined(__ia64__) || \ + defined(__hppa__) || defined(hpux) || \ + defined(__mips) || defined(_MIPS_ARCH) || \ + defined(__arm__) || \ + defined(__sh__) || defined(__m32r__) || \ + (defined(__sun) && defined(_IEEE_754)) || \ + (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) +#define USE_IEEE +#define IEEE_ONE 0x3f800000 +#endif + + +/** + * START/END_FAST_MATH macros: + * + * START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save + * original mode to a temporary). + * END_FAST_MATH: Restore x86 FPU to original mode. + */ +#if defined(__GNUC__) && defined(__i386__) +/* + * Set the x86 FPU control word to guarentee only 32 bits of precision + * are stored in registers. Allowing the FPU to store more introduces + * differences between situations where numbers are pulled out of memory + * vs. situations where the compiler is able to optimize register usage. + * + * In the worst case, we force the compiler to use a memory access to + * truncate the float, by specifying the 'volatile' keyword. + */ +/* Hardware default: All exceptions masked, extended double precision, + * round to nearest (IEEE compliant): + */ +#define DEFAULT_X86_FPU 0x037f +/* All exceptions masked, single precision, round to nearest: + */ +#define FAST_X86_FPU 0x003f +/* The fldcw instruction will cause any pending FP exceptions to be + * raised prior to entering the block, and we clear any pending + * exceptions before exiting the block. Hence, asm code has free + * reign over the FPU while in the fast math block. + */ +#if defined(NO_FAST_MATH) +#define START_FAST_MATH(x) \ +do { \ + static GLuint mask = DEFAULT_X86_FPU; \ + __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \ + __asm__ ( "fldcw %0" : : "m" (mask) ); \ +} while (0) +#else +#define START_FAST_MATH(x) \ +do { \ + static GLuint mask = FAST_X86_FPU; \ + __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \ + __asm__ ( "fldcw %0" : : "m" (mask) ); \ +} while (0) +#endif +/* Restore original FPU mode, and clear any exceptions that may have + * occurred in the FAST_MATH block. + */ +#define END_FAST_MATH(x) \ +do { \ + __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \ +} while (0) + +#elif defined(__WATCOMC__) && defined(__386__) +#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ +#define FAST_X86_FPU 0x003f /* See GCC comments above */ +void _watcom_start_fast_math(unsigned short *x,unsigned short *mask); +#pragma aux _watcom_start_fast_math = \ + "fnstcw word ptr [eax]" \ + "fldcw word ptr [ecx]" \ + parm [eax] [ecx] \ + modify exact []; +void _watcom_end_fast_math(unsigned short *x); +#pragma aux _watcom_end_fast_math = \ + "fnclex" \ + "fldcw word ptr [eax]" \ + parm [eax] \ + modify exact []; +#if defined(NO_FAST_MATH) +#define START_FAST_MATH(x) \ +do { \ + static GLushort mask = DEFAULT_X86_FPU; \ + _watcom_start_fast_math(&x,&mask); \ +} while (0) +#else +#define START_FAST_MATH(x) \ +do { \ + static GLushort mask = FAST_X86_FPU; \ + _watcom_start_fast_math(&x,&mask); \ +} while (0) +#endif +#define END_FAST_MATH(x) _watcom_end_fast_math(&x) + +#elif defined(_MSC_VER) && defined(_M_IX86) +#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ +#define FAST_X86_FPU 0x003f /* See GCC comments above */ +#if defined(NO_FAST_MATH) +#define START_FAST_MATH(x) do {\ + static GLuint mask = DEFAULT_X86_FPU;\ + __asm fnstcw word ptr [x]\ + __asm fldcw word ptr [mask]\ +} while(0) +#else +#define START_FAST_MATH(x) do {\ + static GLuint mask = FAST_X86_FPU;\ + __asm fnstcw word ptr [x]\ + __asm fldcw word ptr [mask]\ +} while(0) +#endif +#define END_FAST_MATH(x) do {\ + __asm fnclex\ + __asm fldcw word ptr [x]\ +} while(0) + +#else +#define START_FAST_MATH(x) x = 0 +#define END_FAST_MATH(x) (void)(x) +#endif + + + +#define Elements(x) (sizeof(x)/sizeof(*(x))) + + + + +#ifdef __cplusplus +} +#endif + + +#endif /* COMPILER_H */ diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 34ab77d13e..bb3e980bfa 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -1,13 +1,9 @@ -/** - * \file config.h - * Tunable configuration parameters. - */ - /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 2008 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -27,14 +23,15 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/** + * \file config.h + * Tunable configuration parameters. + */ #ifndef MESA_CONFIG_H_INCLUDED #define MESA_CONFIG_H_INCLUDED -#include "main/mfeatures.h" - - /** * \name OpenGL implementation limits */ @@ -101,41 +98,42 @@ #define MAX_COLOR_TABLE_SIZE 256 /** Number of 1D/2D texture mipmap levels */ -#define MAX_TEXTURE_LEVELS 12 +#define MAX_TEXTURE_LEVELS 13 /** Number of 3D texture mipmap levels */ #define MAX_3D_TEXTURE_LEVELS 9 /** Number of cube texture mipmap levels - GL_ARB_texture_cube_map */ -#define MAX_CUBE_TEXTURE_LEVELS 12 +#define MAX_CUBE_TEXTURE_LEVELS 13 /** Maximum rectangular texture size - GL_NV_texture_rectangle */ -#define MAX_TEXTURE_RECT_SIZE 2048 +#define MAX_TEXTURE_RECT_SIZE 4096 /** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */ #define MAX_ARRAY_TEXTURE_LAYERS 64 -/** Number of texture units - GL_ARB_multitexture - * This needs to be the larger of MAX_TEXTURE_COORD_UNITS and - * MAX_TEXTURE_IMAGE_UNITS seen below, since MAX_TEXTURE_UNITS is used - * to dimension some arrays that store both coord and image data. -*/ -#define MAX_TEXTURE_UNITS 8 - -/*@}*/ +/** + * Max number of texture coordinate units. This mainly just applies to + * the fixed-function vertex code. This will be difficult to raise above + * eight because of various vertex attribute bitvectors. + */ +#define MAX_TEXTURE_COORD_UNITS 8 +/** + * Max number of texture image units. Also determines number of texture + * samplers in shaders. + */ +#define MAX_TEXTURE_IMAGE_UNITS 16 /** - * \name Separate numbers of texture coordinates and texture image units. - * - * These values will eventually replace most instances of MAX_TEXTURE_UNITS. - * We should always have MAX_TEXTURE_COORD_UNITS <= MAX_TEXTURE_IMAGE_UNITS. - * And, GL_MAX_TEXTURE_UNITS <= MAX_TEXTURE_COORD_UNITS. + * Larger of MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS. + * This value is only used for dimensioning arrays. + * Either MAX_TEXTURE_COORD_UNITS or MAX_TEXTURE_IMAGE_UNITS (or the + * corresponding ctx->Const.MaxTextureCoord/ImageUnits fields) should be + * used almost everywhere else. */ -/*@{*/ -#define MAX_TEXTURE_COORD_UNITS 8 -#define MAX_TEXTURE_IMAGE_UNITS 8 -/*@}*/ +#define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS) + /** * Maximum viewport/image width. Must accomodate all texture sizes too. @@ -165,7 +163,7 @@ #define MAX_TEXTURE_MAX_ANISOTROPY 16.0 /** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */ -#define MAX_TEXTURE_LOD_BIAS 11.0 +#define MAX_TEXTURE_LOD_BIAS 12.0 /** For GL_ARB_vertex_program */ /*@{*/ @@ -181,16 +179,16 @@ /** For any program target/extension */ /*@{*/ #define MAX_PROGRAM_INSTRUCTIONS (16 * 1024) -#define MAX_PROGRAM_LOCAL_PARAMS 128 /* KW: power of two */ +#define MAX_PROGRAM_LOCAL_PARAMS 256 /**< per-program constants (power of two) */ #define MAX_PROGRAM_ENV_PARAMS 128 #define MAX_PROGRAM_MATRICES 8 #define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 #define MAX_PROGRAM_CALL_DEPTH 8 #define MAX_PROGRAM_TEMPS 128 #define MAX_PROGRAM_ADDRESS_REGS 2 -#define MAX_UNIFORMS 128 /**< number of float components */ +#define MAX_UNIFORMS 1024 /**< number of vec4 uniforms */ #define MAX_VARYING 8 /**< number of float[4] vectors */ -#define MAX_SAMPLERS 8 +#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS #define MAX_PROGRAM_INPUTS 32 #define MAX_PROGRAM_OUTPUTS 32 /*@}*/ @@ -218,8 +216,8 @@ /** For GL_ARB_vertex_shader */ /*@{*/ #define MAX_VERTEX_ATTRIBS 16 -#define MAX_VERTEX_TEXTURE_IMAGE_UNITS 0 -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS) +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS +#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS /*@}*/ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index e5ec35c77f..a94bbf3fdf 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,14 +1,9 @@ -/** - * \file context.c - * Mesa context/visual/framebuffer management functions. - * \author Brian Paul - */ - /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 2008 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -28,6 +23,11 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/** + * \file context.c + * Mesa context/visual/framebuffer management functions. + * \author Brian Paul + */ /** * \mainpage Mesa Main Module @@ -77,6 +77,7 @@ #include "glheader.h" +#include "mfeatures.h" #include "imports.h" #if FEATURE_accum #include "accum.h" @@ -151,10 +152,7 @@ #include "shader/atifragshader.h" #endif #if _HAVE_FULL_GL -#include "math/m_translate.h" #include "math/m_matrix.h" -#include "math/m_xform.h" -#include "math/mathmod.h" #endif #ifdef USE_SPARC_ASM @@ -186,6 +184,7 @@ GLfloat _mesa_ubyte_to_float_color_tab[256]; void _mesa_notifySwapBuffers(__GLcontext *ctx) { + FLUSH_VERTICES( ctx, 0 ); if (ctx->Driver.Flush) { ctx->Driver.Flush(ctx); } @@ -387,13 +386,9 @@ one_time_init( GLcontext *ctx ) _mesa_init_sqrt_table(); -#if _HAVE_FULL_GL - _math_init(); - for (i = 0; i < 256; i++) { _mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F; } -#endif #ifdef USE_SPARC_ASM _mesa_init_sparc_glapi_relocs(); @@ -429,6 +424,7 @@ one_time_init( GLcontext *ctx ) static GLboolean alloc_shared_state( GLcontext *ctx ) { + GLuint i; struct gl_shared_state *ss = CALLOC_STRUCT(gl_shared_state); if (!ss) return GL_FALSE; @@ -470,36 +466,25 @@ alloc_shared_state( GLcontext *ctx ) ss->ShaderObjects = _mesa_NewHashTable(); #endif - ss->Default1D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D); - if (!ss->Default1D) - goto cleanup; - - ss->Default2D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D); - if (!ss->Default2D) - goto cleanup; - - ss->Default3D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_3D); - if (!ss->Default3D) - goto cleanup; - - ss->DefaultCubeMap = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_CUBE_MAP_ARB); - if (!ss->DefaultCubeMap) - goto cleanup; - - ss->DefaultRect = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_RECTANGLE_NV); - if (!ss->DefaultRect) - goto cleanup; - - ss->Default1DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D_ARRAY_EXT); - if (!ss->Default1DArray) - goto cleanup; - - ss->Default2DArray = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_2D_ARRAY_EXT); - if (!ss->Default2DArray) - goto cleanup; + /* Create default texture objects */ + for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { + /* NOTE: the order of these enums matches the TEXTURE_x_INDEX values */ + static const GLenum targets[NUM_TEXTURE_TARGETS] = { + GL_TEXTURE_2D_ARRAY_EXT, + GL_TEXTURE_1D_ARRAY_EXT, + GL_TEXTURE_CUBE_MAP, + GL_TEXTURE_3D, + GL_TEXTURE_RECTANGLE_NV, + GL_TEXTURE_2D, + GL_TEXTURE_1D + }; + ss->DefaultTex[i] = ctx->Driver.NewTextureObject(ctx, 0, targets[i]); + if (!ss->DefaultTex[i]) + goto cleanup; + } /* sanity check */ - assert(ss->Default1D->RefCount == 1); + assert(ss->DefaultTex[TEXTURE_1D_INDEX]->RefCount == 1); _glthread_INIT_MUTEX(ss->TexMutex); ss->TextureStateStamp = 0; @@ -553,20 +538,10 @@ cleanup: _mesa_DeleteHashTable(ss->RenderBuffers); #endif - if (ss->Default1D) - (*ctx->Driver.DeleteTexture)(ctx, ss->Default1D); - if (ss->Default2D) - (*ctx->Driver.DeleteTexture)(ctx, ss->Default2D); - if (ss->Default3D) - (*ctx->Driver.DeleteTexture)(ctx, ss->Default3D); - if (ss->DefaultCubeMap) - (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultCubeMap); - if (ss->DefaultRect) - (*ctx->Driver.DeleteTexture)(ctx, ss->DefaultRect); - if (ss->Default1DArray) - (*ctx->Driver.DeleteTexture)(ctx, ss->Default1DArray); - if (ss->Default2DArray) - (*ctx->Driver.DeleteTexture)(ctx, ss->Default2DArray); + for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { + if (ss->DefaultTex[i]) + ctx->Driver.DeleteTexture(ctx, ss->DefaultTex[i]); + } _mesa_free(ss); @@ -581,7 +556,7 @@ static void delete_displaylist_cb(GLuint id, void *data, void *userData) { #if FEATURE_dlist - struct mesa_display_list *list = (struct mesa_display_list *) data; + struct gl_display_list *list = (struct gl_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); #endif @@ -729,6 +704,8 @@ delete_renderbuffer_cb(GLuint id, void *data, void *userData) static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) { + GLuint i; + /* * Free display lists */ @@ -778,13 +755,9 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) */ ASSERT(ctx->Driver.DeleteTexture); /* the default textures */ - ctx->Driver.DeleteTexture(ctx, ss->Default1D); - ctx->Driver.DeleteTexture(ctx, ss->Default2D); - ctx->Driver.DeleteTexture(ctx, ss->Default3D); - ctx->Driver.DeleteTexture(ctx, ss->DefaultCubeMap); - ctx->Driver.DeleteTexture(ctx, ss->DefaultRect); - ctx->Driver.DeleteTexture(ctx, ss->Default1DArray); - ctx->Driver.DeleteTexture(ctx, ss->Default2DArray); + for (i = 0; i < NUM_TEXTURE_TARGETS; i++) { + ctx->Driver.DeleteTexture(ctx, ss->DefaultTex[i]); + } /* all other textures */ _mesa_HashDeleteAll(ss->TexObjects, delete_texture_cb, ctx); _mesa_DeleteHashTable(ss->TexObjects); @@ -809,7 +782,7 @@ _mesa_init_current(GLcontext *ctx) } /* redo special cases: */ - ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 1.0 ); + ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_WEIGHT], 1.0, 0.0, 0.0, 0.0 ); ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_NORMAL], 0.0, 0.0, 1.0, 1.0 ); ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR0], 1.0, 1.0, 1.0, 1.0 ); ASSIGN_4V( ctx->Current.Attrib[VERT_ATTRIB_COLOR1], 0.0, 0.0, 0.0, 1.0 ); @@ -870,8 +843,8 @@ _mesa_init_constants(GLcontext *ctx) assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS); assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS); - assert(MAX_TEXTURE_UNITS >= MAX_TEXTURE_COORD_UNITS); - assert(MAX_TEXTURE_UNITS >= MAX_TEXTURE_IMAGE_UNITS); + /* Max texture size should be <= max viewport size (render to texture) */ + assert((1 << (MAX_TEXTURE_LEVELS - 1)) <= MAX_WIDTH); /* Constants, may be overriden (usually only reduced) by device drivers */ ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS; @@ -935,6 +908,9 @@ _mesa_init_constants(GLcontext *ctx) ctx->Const.MaxVarying = MAX_VARYING; #endif + /* GL_ARB_framebuffer_object */ + ctx->Const.MaxSamples = 0; + /* sanity checks */ ASSERT(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)); @@ -963,13 +939,21 @@ check_context_limits(GLcontext *ctx) assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS); - assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH); - assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH); + /* number of coord units cannot be greater than number of image units */ + assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits); + + assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS); + assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS); + assert(ctx->Const.MaxCubeTextureLevels <= MAX_CUBE_TEXTURE_LEVELS); + assert(ctx->Const.MaxTextureRectSize <= MAX_TEXTURE_RECT_SIZE); /* make sure largest texture image is <= MAX_WIDTH in size */ - assert((1 << (ctx->Const.MaxTextureLevels -1 )) <= MAX_WIDTH); - assert((1 << (ctx->Const.MaxCubeTextureLevels -1 )) <= MAX_WIDTH); - assert((1 << (ctx->Const.Max3DTextureLevels -1 )) <= MAX_WIDTH); + assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= MAX_WIDTH); + assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= MAX_WIDTH); + assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= MAX_WIDTH); + + assert(ctx->Const.MaxViewportWidth <= MAX_WIDTH); + assert(ctx->Const.MaxViewportHeight <= MAX_WIDTH); assert(ctx->Const.MaxDrawBuffers <= MAX_DRAW_BUFFERS); @@ -1063,7 +1047,6 @@ init_attrib_groups(GLcontext *ctx) /* Miscellaneous */ ctx->NewState = _NEW_ALL; ctx->ErrorValue = (GLenum) GL_NO_ERROR; - ctx->_Facing = 0; ctx->varying_vp_inputs = ~0; return GL_TRUE; @@ -1071,6 +1054,28 @@ init_attrib_groups(GLcontext *ctx) /** + * Update default objects in a GL context with respect to shared state. + * + * \param ctx GL context. + * + * Removes references to old default objects, (texture objects, program + * objects, etc.) and changes to reference those from the current shared + * state. + */ +static GLboolean +update_default_objects(GLcontext *ctx) +{ + assert(ctx); + + _mesa_update_default_objects_program(ctx); + _mesa_update_default_objects_texture(ctx); + _mesa_update_default_objects_buffer_objects(ctx); + + return GL_TRUE; +} + + +/** * This is the default function we plug into all dispatch table slots * This helps prevents a segfault when someone calls a GL function without * first checking if the extension's supported. @@ -1205,7 +1210,6 @@ _mesa_initialize_context(GLcontext *ctx, ctx->FragmentProgram._MaintainTexEnvProgram = (_mesa_getenv("MESA_TEX_PROG") != NULL); - ctx->FragmentProgram._UseTexEnvProgram = ctx->FragmentProgram._MaintainTexEnvProgram; ctx->VertexProgram._MaintainTnlProgram = (_mesa_getenv("MESA_TNL_PROG") != NULL); @@ -1274,18 +1278,19 @@ _mesa_create_context(const GLvisual *visual, void _mesa_free_context_data( GLcontext *ctx ) { - /* if we're destroying the current context, unbind it first */ - if (ctx == _mesa_get_current_context()) { - _mesa_make_current(NULL, NULL, NULL); - } - else { - /* unreference WinSysDraw/Read buffers */ - _mesa_unreference_framebuffer(&ctx->WinSysDrawBuffer); - _mesa_unreference_framebuffer(&ctx->WinSysReadBuffer); - _mesa_unreference_framebuffer(&ctx->DrawBuffer); - _mesa_unreference_framebuffer(&ctx->ReadBuffer); + if (!_mesa_get_current_context()){ + /* No current context, but we may need one in order to delete + * texture objs, etc. So temporarily bind the context now. + */ + _mesa_make_current(ctx, NULL, NULL); } + /* unreference WinSysDraw/Read buffers */ + _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL); + _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL); + _mesa_reference_framebuffer(&ctx->DrawBuffer, NULL); + _mesa_reference_framebuffer(&ctx->ReadBuffer, NULL); + _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL); _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL); @@ -1294,6 +1299,9 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); +#if FEATURE_attrib_stack + _mesa_free_attrib_data(ctx); +#endif _mesa_free_lighting_data( ctx ); #if FEATURE_evaluators _mesa_free_eval_data( ctx ); @@ -1331,6 +1339,11 @@ _mesa_free_context_data( GLcontext *ctx ) if (ctx->Extensions.String) _mesa_free((void *) ctx->Extensions.String); + + /* unbind the context if it's currently bound */ + if (ctx == _mesa_get_current_context()) { + _mesa_make_current(NULL, NULL, NULL); + } } @@ -1562,8 +1575,6 @@ void _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, GLframebuffer *readBuffer ) { - GET_CURRENT_CONTEXT(oldCtx); - if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(newCtx, "_mesa_make_current()\n"); @@ -1588,13 +1599,6 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, _glapi_set_context((void *) newCtx); ASSERT(_mesa_get_current_context() == newCtx); - if (oldCtx) { - _mesa_unreference_framebuffer(&oldCtx->WinSysDrawBuffer); - _mesa_unreference_framebuffer(&oldCtx->WinSysReadBuffer); - _mesa_unreference_framebuffer(&oldCtx->DrawBuffer); - _mesa_unreference_framebuffer(&oldCtx->ReadBuffer); - } - if (!newCtx) { _glapi_set_dispatch(NULL); /* none current */ } @@ -1614,10 +1618,12 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, * or not bound to a user-created FBO. */ if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) { - /* fix up the fb fields - these will end up wrong otherwise - * if the DRIdrawable changes, and everything relies on them. - * This is a bit messy (same as needed in _mesa_BindFramebufferEXT) - */ + /* KW: merge conflict here, revisit. + */ + /* fix up the fb fields - these will end up wrong otherwise + * if the DRIdrawable changes, and everything relies on them. + * This is a bit messy (same as needed in _mesa_BindFramebufferEXT) + */ unsigned int i; GLenum buffers[MAX_DRAW_BUFFERS]; @@ -1631,9 +1637,11 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, } if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) { _mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer); - _mesa_readbuffer_update_fields(newCtx, newCtx->Pixel.ReadBuffer); } + /* XXX only set this flag if we're really changing the draw/read + * framebuffer bindings. + */ newCtx->NewState |= _NEW_BUFFERS; #if 1 @@ -1701,12 +1709,18 @@ GLboolean _mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare) { if (ctx && ctxToShare && ctx->Shared && ctxToShare->Shared) { - ctx->Shared->RefCount--; - if (ctx->Shared->RefCount == 0) { - free_shared_state(ctx, ctx->Shared); - } + struct gl_shared_state *oldSharedState = ctx->Shared; + ctx->Shared = ctxToShare->Shared; ctx->Shared->RefCount++; + + update_default_objects(ctx); + + oldSharedState->RefCount--; + if (oldSharedState->RefCount == 0) { + free_shared_state(ctx, oldSharedState); + } + return GL_TRUE; } else { diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 9423b66a7d..ecc1cec779 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -49,11 +49,13 @@ #define CONTEXT_H -#include "glapi/glapi.h" #include "imports.h" #include "mtypes.h" +struct _glapi_table; + + /** \name Visual-related functions */ /*@{*/ @@ -275,10 +277,12 @@ do { \ (((CTX)->Light.Enabled && \ (CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \ || (CTX)->Fog.ColorSumEnabled \ - || ((CTX)->VertexProgram._Enabled && \ - ((CTX)->VertexProgram.Current->Base.InputsRead & VERT_BIT_COLOR1)) \ - || ((CTX)->FragmentProgram._Enabled && \ - ((CTX)->FragmentProgram.Current->Base.InputsRead & FRAG_BIT_COL1)) \ + || ((CTX)->VertexProgram._Current && \ + ((CTX)->VertexProgram._Current != (CTX)->VertexProgram._TnlProgram) && \ + ((CTX)->VertexProgram._Current->Base.InputsRead & VERT_BIT_COLOR1)) \ + || ((CTX)->FragmentProgram._Current && \ + ((CTX)->FragmentProgram._Current != (CTX)->FragmentProgram._TexEnvProgram) && \ + ((CTX)->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL1)) \ ) diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 7fb0a211d7..411b6a7b21 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -34,7 +34,7 @@ /* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */ struct gl_pixelstore_attrib; -struct mesa_display_list; +struct gl_display_list; /** * Device driver function table. @@ -456,8 +456,8 @@ struct dd_function_table { */ void (*GetCompressedTexImage)(GLcontext *ctx, GLenum target, GLint level, GLvoid *img, - const struct gl_texture_object *texObj, - const struct gl_texture_image *texImage); + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); /** * Called to query number of bytes of storage needed to store the @@ -504,6 +504,11 @@ struct dd_function_table { */ void (*FreeTexImageData)( GLcontext *ctx, struct gl_texture_image *tImage ); + /** Map texture image data into user space */ + void (*MapTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); + /** Unmap texture images from user space */ + void (*UnmapTexture)( GLcontext *ctx, struct gl_texture_object *tObj ); + /** * Note: no context argument. This function doesn't initially look * like it belongs here, except that the driver is the only entity @@ -803,6 +808,8 @@ struct dd_function_table { struct gl_renderbuffer_attachment *att); void (*FinishRenderTexture)(GLcontext *ctx, struct gl_renderbuffer_attachment *att); + void (*ValidateFramebuffer)(GLcontext *ctx, + struct gl_framebuffer *fb); /*@}*/ #endif #if FEATURE_EXT_framebuffer_blit @@ -992,7 +999,7 @@ struct dd_function_table { * Notify the T&L component before and after calling a display list. */ void (*BeginCallList)( GLcontext *ctx, - struct mesa_display_list *dlist ); + struct gl_display_list *dlist ); /** * Called by glEndCallList(). * diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 77fef32558..fcef093ac3 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -24,9 +24,13 @@ #include "mtypes.h" #include "context.h" +#include "hash.h" #include "imports.h" #include "debug.h" #include "get.h" +#include "texobj.h" +#include "texformat.h" + /** * Primitive names @@ -164,9 +168,7 @@ static void add_debug_flags( const char *debug ) { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM }, - { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */ - { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */ + { "disassem", VERBOSE_DISASSEM } }; GLuint i; @@ -221,3 +223,98 @@ _mesa_init_debug( GLcontext *ctx ) add_debug_flags(c); } + +/* + * Write ppm file + */ +static void +write_ppm(const char *filename, const GLubyte *buffer, int width, int height, + int comps, int rcomp, int gcomp, int bcomp) +{ + FILE *f = fopen( filename, "w" ); + if (f) { + int i, x, y; + const GLubyte *ptr = buffer; + fprintf(f,"P6\n"); + fprintf(f,"# ppm-file created by osdemo.c\n"); + fprintf(f,"%i %i\n", width,height); + fprintf(f,"255\n"); + fclose(f); + f = fopen( filename, "ab" ); /* reopen in binary append mode */ + for (y=height-1; y>=0; y--) { + for (x=0; x<width; x++) { + i = (y*width + x) * comps; + fputc(ptr[i+rcomp], f); /* write red */ + fputc(ptr[i+gcomp], f); /* write green */ + fputc(ptr[i+bcomp], f); /* write blue */ + } + } + fclose(f); + } +} + + +/** + * Write level[0] image to a ppm file. + */ +static void +write_texture_image(struct gl_texture_object *texObj) +{ + const struct gl_texture_image *img = texObj->Image[0][0]; + if (img) { + char s[100]; + + /* make filename */ + sprintf(s, "/tmp/teximage%u.ppm", texObj->Name); + + switch (img->TexFormat->MesaFormat) { + case MESA_FORMAT_RGBA8888: + write_ppm(s, img->Data, img->Width, img->Height, 4, 3, 2, 1); + break; + case MESA_FORMAT_ARGB8888: + write_ppm(s, img->Data, img->Width, img->Height, 4, 2, 1, 0); + break; + default: + printf("XXXX unsupported mesa tex format %d in %s\n", + img->TexFormat->MesaFormat, __FUNCTION__); + } + } +} + + +static GLboolean DumpImages; + + +static void +dump_texture_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + int i; + (void) userData; + + printf("Texture %u\n", texObj->Name); + printf(" Target 0x%x\n", texObj->Target); + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { + struct gl_texture_image *texImg = texObj->Image[0][i]; + if (texImg) { + printf(" Image %u: %d x %d x %d at %p\n", i, + texImg->Width, texImg->Height, texImg->Depth, texImg->Data); + if (DumpImages && i == 0) { + write_texture_image(texObj); + } + } + } +} + + +/** + * Print basic info about all texture objext to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_textures(GLboolean dumpImages) +{ + GET_CURRENT_CONTEXT(ctx); + DumpImages = dumpImages; + _mesa_HashDeleteAll(ctx->Shared->TexObjects, dump_texture_cb, ctx); +} diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index 94d99c384b..1862ec75b7 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -57,4 +57,7 @@ extern void _mesa_init_debug( GLcontext *ctx ); #endif +extern void +_mesa_dump_textures(GLboolean dumpImages); + #endif diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index d4990bb795..7be2aacaf2 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -62,15 +62,9 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) static void delete_wrapper(struct gl_renderbuffer *rb) { - struct gl_renderbuffer *dsrb = rb->Wrapped; - ASSERT(dsrb); ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 || rb->_ActualFormat == GL_STENCIL_INDEX8_EXT); - /* decrement refcount on the wrapped buffer and delete it if necessary */ - dsrb->RefCount--; - if (dsrb->RefCount <= 0) { - dsrb->Delete(dsrb); - } + _mesa_reference_renderbuffer(&rb->Wrapped, NULL); _mesa_free(rb); } @@ -213,7 +207,7 @@ put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, const void *values, const GLubyte *mask) { struct gl_renderbuffer *dsrb = z24rb->Wrapped; - const GLubyte *src = (const GLubyte *) values; + const GLuint *src = (const GLuint *) values; ASSERT(z24rb->DataType == GL_UNSIGNED_INT); ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); @@ -282,8 +276,8 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, z24rb->RefCount = 1; z24rb->Width = dsrb->Width; z24rb->Height = dsrb->Height; - z24rb->InternalFormat = GL_DEPTH_COMPONENT24_ARB; - z24rb->_ActualFormat = GL_DEPTH_COMPONENT24_ARB; + z24rb->InternalFormat = GL_DEPTH_COMPONENT24; + z24rb->_ActualFormat = GL_DEPTH_COMPONENT24; z24rb->_BaseFormat = GL_DEPTH_COMPONENT; z24rb->DataType = GL_UNSIGNED_INT; z24rb->DepthBits = 24; diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms new file mode 100644 index 0000000000..e49ec65d42 --- /dev/null +++ b/src/mesa/main/descrip.mms @@ -0,0 +1,258 @@ +# Makefile for core library for VMS +# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl +# Last revision : 29 September 2008 + +.first + define gl [---.include.gl] + define math [-.math] + define shader [-.shader] + define glapi [-.glapi] + define main [-.main] + +.include [---]mms-config. + +##### MACROS ##### + +VPATH = RCS + +INCDIR = [---.include],[-.glapi],[-.shader] +LIBDIR = [---.lib] +CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm + +SOURCES =accum.c \ + api_arrayelt.c \ + api_exec.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + attrib.c \ + arrayobj.c \ + blend.c \ + bufferobj.c \ + buffers.c \ + clear.c \ + clip.c \ + colortab.c \ + context.c \ + convolve.c \ + debug.c \ + depth.c \ + depthstencil.c \ + dispatch.c \ + dlist.c \ + drawpix.c \ + enable.c \ + enums.c \ + eval.c \ + execmem.c \ + extensions.c \ + fbobject.c \ + feedback.c \ + ffvertex_prog.c \ + fog.c \ + framebuffer.c \ + get.c \ + getstring.c \ + hash.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + matrix.c \ + mipmap.c \ + mm.c \ + multisample.c \ + pixel.c \ + pixelstore.c \ + points.c \ + polygon.c \ + rastpos.c \ + rbadaptors.c \ + readpix.c \ + renderbuffer.c \ + scissor.c \ + shaders.c \ + state.c \ + stencil.c \ + texcompress.c \ + texcompress_fxt1.c \ + texcompress_s3tc.c \ + texenv.c \ + texenvprogram.c \ + texformat.c \ + texgen.c \ + teximage.c \ + texobj.c \ + texparam.c \ + texrender.c \ + texstate.c \ + texstore.c \ + varray.c \ + vtxfmt.c \ + queryobj.c \ + rbadaptors.c + +OBJECTS=accum.obj,\ +api_arrayelt.obj,\ +api_exec.obj,\ +api_loopback.obj,\ +api_noop.obj,\ +api_validate.obj,\ +arrayobj.obj,\ +attrib.obj,\ +blend.obj,\ +bufferobj.obj,\ +buffers.obj,\ +clear.obj,\ +clip.obj,\ +colortab.obj,\ +context.obj,\ +convolve.obj,\ +debug.obj,\ +depth.obj,\ +depthstencil.obj,\ +dispatch.obj,\ +dlist.obj,\ +drawpix.obj,\ +enable.obj,\ +enums.obj,\ +eval.obj,\ +execmem.obj,\ +extensions.obj,\ +fbobject.obj,\ +feedback.obj,\ +ffvertex_prog.obj,\ +fog.obj,\ +framebuffer.obj,\ +get.obj,\ +getstring.obj,\ +hash.obj,\ +hint.obj,\ +histogram.obj,\ +image.obj,\ +imports.obj,\ +light.obj,\ +lines.obj,\ +matrix.obj,\ +mipmap.obj,\ +mm.obj,\ +multisample.obj,\ +pixel.obj,\ +pixelstore.obj,\ +points.obj,\ +polygon.obj,\ +rastpos.obj,\ +readpix.obj,\ +renderbuffer.obj,\ +scissor.obj,\ +shaders.obj,\ +state.obj,\ +stencil.obj,\ +texcompress.obj,\ +texcompress_fxt1.obj,\ +texcompress_s3tc.obj,\ +texenv.obj,\ +texenvprogram.obj,\ +texformat.obj,\ +texgen.obj,\ +teximage.obj,\ +texobj.obj,\ +texparam.obj,\ +texrender.obj,\ +texstate.obj,\ +texstore.obj,\ +varray.obj,\ +vtxfmt.obj,\ +queryobj.obj,\ +rbadaptors.obj + +##### RULES ##### + +VERSION=Mesa V3.4 + +##### TARGETS ##### +# Make the library +$(LIBDIR)$(GL_LIB) : $(OBJECTS) + @ $(MAKELIB) $(LIBDIR)$(GL_LIB) $(OBJECTS) + +clean : + purge + delete *.obj;* + +accum.obj : accum.c +api_arrayelt.obj : api_arrayelt.c +api_loopback.obj : api_loopback.c +api_noop.obj : api_noop.c +api_validate.obj : api_validate.c +arrayobj.obj : arrayobj.c +attrib.obj : attrib.c +blend.obj : blend.c +bufferobj.obj : bufferobj.c +buffers.obj : buffers.c +clip.obj : clip.c +colortab.obj : colortab.c +context.obj : context.c +convolve.obj : convolve.c +debug.obj : debug.c +depth.obj : depth.c +depthstencil.obj : depthstencil.c +dispatch.obj : dispatch.c +dlist.obj : dlist.c +drawpix.obj : drawpix.c +enable.obj : enable.c +enums.obj : enums.c +eval.obj : eval.c +execmem.obj : execmem.c +extensions.obj : extensions.c +fbobject.obj : fbobject.c +feedback.obj : feedback.c +fog.obj : fog.c +framebuffer.obj : framebuffer.c +get.obj : get.c +getstring.obj : getstring.c +hash.obj : hash.c +hint.obj : hint.c +histogram.obj : histogram.c +image.obj : image.c +imports.obj : imports.c vsnprintf.c +light.obj : light.c +lines.obj : lines.c +matrix.obj : matrix.c +mipmap.obj : mipmap.c +mm.obj : mm.c +pixel.obj : pixel.c +points.obj : points.c +polygon.obj : polygon.c +rastpos.obj : rastpos.c +rbadaptors.obj : rbadaptors.c +renderbuffer.obj : renderbuffer.c +state.obj : state.c +stencil.obj : stencil.c +texcompress.obj : texcompress.c +texcompress_fxt1.obj : texcompress_fxt1.c + cc$(CFLAGS)/warn=(disable=SHIFTCOUNT) texcompress_fxt1.c +texcompress_s3tc.obj : texcompress_s3tc.c +texenvprogram.obj : texenvprogram.c +texformat.obj : texformat.c +teximage.obj : teximage.c +texobj.obj : texobj.c +texrender.obj : texrender.c +texstate.obj : texstate.c +texstore.obj : texstore.c +varray.obj : varray.c +vtxfmt.obj : vtxfmt.c +shaders.obj : shaders.c +queryobj.obj : queryobj.c +rbadaptors.obj : rbadaptors.c +clear.obj : clear.c +multisample.obj : multisample.c +scissor.obj : scissor.c +texenv.obj : texenv.c +texgen.obj : texgen.c +texparam.obj : texparam.c +readpix.obj : readpix.c +ffvertex_prog.obj : ffvertex_prog.c +api_exec.obj : api_exec.c +pixelstore.obj : pixelstore.c diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index c12f55a7a1..bf1a013789 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -39,7 +39,8 @@ #ifndef GLX_USE_APPLEGL -#include "glheader.h" +#include "main/glheader.h" +#include "main/compiler.h" #include "glapi/glapi.h" #include "glapi/glapitable.h" #include "glapi/glthread.h" diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 44341c5228..d4bd56be83 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,6 +33,7 @@ #include "api_arrayelt.h" #include "api_loopback.h" #include "config.h" +#include "mfeatures.h" #include "attrib.h" #include "blend.h" #include "buffers.h" @@ -41,7 +42,6 @@ #endif #include "arrayobj.h" #include "clip.h" -#include "colormac.h" #include "colortab.h" #include "context.h" #include "convolve.h" @@ -86,7 +86,6 @@ #endif #include "math/m_matrix.h" -#include "math/m_xform.h" #include "glapi/dispatch.h" @@ -371,7 +370,7 @@ typedef enum * contiguous nodes in memory. * Each node is the union of a variety of data types. */ -union node +union gl_dlist_node { OpCode opcode; GLboolean b; @@ -388,6 +387,9 @@ union node }; +typedef union gl_dlist_node Node; + + /** * How many nodes to allocate at a time. * @@ -415,13 +417,13 @@ void mesa_print_display_list(GLuint list); * Make an empty display list. This is used by glGenLists() to * reserve display list IDs. */ -static struct mesa_display_list * -make_list(GLuint list, GLuint count) +static struct gl_display_list * +make_list(GLuint name, GLuint count) { - struct mesa_display_list *dlist = CALLOC_STRUCT(mesa_display_list); - dlist->id = list; - dlist->node = (Node *) _mesa_malloc(sizeof(Node) * count); - dlist->node[0].opcode = OPCODE_END_OF_LIST; + struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list); + dlist->Name = name; + dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count); + dlist->Head[0].opcode = OPCODE_END_OF_LIST; return dlist; } @@ -429,10 +431,10 @@ make_list(GLuint list, GLuint count) /** * Lookup function to just encapsulate casting. */ -static INLINE struct mesa_display_list * +static INLINE struct gl_display_list * lookup_list(GLcontext *ctx, GLuint list) { - return (struct mesa_display_list *) + return (struct gl_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList, list); } @@ -443,12 +445,12 @@ lookup_list(GLcontext *ctx, GLuint list) * \param dlist - display list pointer */ void -_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist) +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) { Node *n, *block; GLboolean done; - n = block = dlist->node; + n = block = dlist->Head; done = block ? GL_FALSE : GL_TRUE; while (!done) { @@ -597,7 +599,7 @@ _mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist) static void destroy_list(GLcontext *ctx, GLuint list) { - struct mesa_display_list *dlist; + struct gl_display_list *dlist; if (list == 0) return; @@ -612,9 +614,9 @@ destroy_list(GLcontext *ctx, GLuint list) /* - * Translate the nth element of list from type to GLuint. + * Translate the nth element of list from <type> to GLint. */ -static GLuint +static GLint translate_id(GLsizei n, GLenum type, const GLvoid * list) { GLbyte *bptr; @@ -628,37 +630,40 @@ translate_id(GLsizei n, GLenum type, const GLvoid * list) switch (type) { case GL_BYTE: bptr = (GLbyte *) list; - return (GLuint) *(bptr + n); + return (GLint) bptr[n]; case GL_UNSIGNED_BYTE: ubptr = (GLubyte *) list; - return (GLuint) *(ubptr + n); + return (GLint) ubptr[n]; case GL_SHORT: sptr = (GLshort *) list; - return (GLuint) *(sptr + n); + return (GLint) sptr[n]; case GL_UNSIGNED_SHORT: usptr = (GLushort *) list; - return (GLuint) *(usptr + n); + return (GLint) usptr[n]; case GL_INT: iptr = (GLint *) list; - return (GLuint) *(iptr + n); + return iptr[n]; case GL_UNSIGNED_INT: uiptr = (GLuint *) list; - return (GLuint) *(uiptr + n); + return (GLint) uiptr[n]; case GL_FLOAT: fptr = (GLfloat *) list; - return (GLuint) *(fptr + n); + return (GLint) FLOORF(fptr[n]); case GL_2_BYTES: ubptr = ((GLubyte *) list) + 2 * n; - return (GLuint) *ubptr * 256 + (GLuint) * (ubptr + 1); + return (GLint) ubptr[0] * 256 + + (GLint) ubptr[1]; case GL_3_BYTES: ubptr = ((GLubyte *) list) + 3 * n; - return (GLuint) * ubptr * 65536 - + (GLuint) *(ubptr + 1) * 256 + (GLuint) * (ubptr + 2); + return (GLint) ubptr[0] * 65536 + + (GLint) ubptr[1] * 256 + + (GLint) ubptr[2]; case GL_4_BYTES: ubptr = ((GLubyte *) list) + 4 * n; - return (GLuint) *ubptr * 16777216 - + (GLuint) *(ubptr + 1) * 65536 - + (GLuint) *(ubptr + 2) * 256 + (GLuint) * (ubptr + 3); + return (GLint) ubptr[0] * 16777216 + + (GLint) ubptr[1] * 65536 + + (GLint) ubptr[2] * 256 + + (GLint) ubptr[3]; default: return 0; } @@ -1000,10 +1005,10 @@ _mesa_save_CallLists(GLsizei n, GLenum type, const GLvoid * lists) } for (i = 0; i < n; i++) { - GLuint list = translate_id(i, type, lists); + GLint list = translate_id(i, type, lists); Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2); if (n) { - n[1].ui = list; + n[1].i = list; n[2].b = typeErrorFlag; } } @@ -2519,12 +2524,12 @@ save_MultMatrixd(const GLdouble * m) static void GLAPIENTRY -save_NewList(GLuint list, GLenum mode) +save_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); /* It's an error to call this function while building a display list */ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList"); - (void) list; + (void) name; (void) mode; } @@ -2723,21 +2728,20 @@ save_PolygonMode(GLenum face, GLenum mode) } -/* - * Polygon stipple must have been upacked already! - */ static void GLAPIENTRY save_PolygonStipple(const GLubyte * pattern) { GET_CURRENT_CONTEXT(ctx); + GLvoid *image = unpack_image(2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, + pattern, &ctx->Unpack); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1); if (n) { - void *data; - n[1].data = _mesa_malloc(32 * 4); - data = n[1].data; /* This needed for Acorn compiler */ - MEMCPY(data, pattern, 32 * 4); + n[1].data = image; + } + else if (image) { + _mesa_free(image); } if (ctx->ExecuteFlag) { CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern)); @@ -3254,6 +3258,36 @@ save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) static void GLAPIENTRY +save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, + GLuint mask) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + /* GL_FRONT */ + n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + if (n) { + n[1].e = GL_FRONT; + n[2].e = frontfunc; + n[3].i = ref; + n[4].ui = mask; + } + /* GL_BACK */ + n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + if (n) { + n[1].e = GL_BACK; + n[2].e = backfunc; + n[3].i = ref; + n[4].ui = mask; + } + if (ctx->ExecuteFlag) { + CALL_StencilFuncSeparate(ctx->Exec, (GL_FRONT, frontfunc, ref, mask)); + CALL_StencilFuncSeparate(ctx->Exec, (GL_BACK, backfunc, ref, mask)); + } +} + + +static void GLAPIENTRY save_StencilMaskSeparate(GLenum face, GLuint mask) { GET_CURRENT_CONTEXT(ctx); @@ -5587,6 +5621,27 @@ save_VertexAttrib4fvARB(GLuint index, const GLfloat * v) } +/* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */ + +static void GLAPIENTRY +exec_BindAttribLocationARB(GLuint program, GLuint index, const GLchar *name) +{ + GET_CURRENT_CONTEXT(ctx); + FLUSH_VERTICES(ctx, 0); + CALL_BindAttribLocationARB(ctx->Exec, (program, index, name)); +} + +static GLint GLAPIENTRY +exec_GetAttribLocationARB(GLuint program, const GLchar *name) +{ + GET_CURRENT_CONTEXT(ctx); + FLUSH_VERTICES(ctx, 0); + return CALL_GetAttribLocationARB(ctx->Exec, (program, name)); +} +/* XXX more shader functions needed here */ + + + #if FEATURE_EXT_framebuffer_blit static void GLAPIENTRY save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, @@ -5679,7 +5734,7 @@ islist(GLcontext *ctx, GLuint list) static void execute_list(GLcontext *ctx, GLuint list) { - struct mesa_display_list *dlist; + struct gl_display_list *dlist; Node *n; GLboolean done; @@ -5695,12 +5750,12 @@ execute_list(GLcontext *ctx, GLuint list) if (!dlist) return; - ctx->ListState.CallStack[ctx->ListState.CallDepth++] = dlist; + ctx->ListState.CallDepth++; if (ctx->Driver.BeginCallList) ctx->Driver.BeginCallList(ctx, dlist); - n = dlist->node; + n = dlist->Head; done = GL_FALSE; while (!done) { @@ -5762,7 +5817,8 @@ execute_list(GLcontext *ctx, GLuint list) _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)"); } else if (ctx->ListState.CallDepth < MAX_LIST_NESTING) { - execute_list(ctx, ctx->List.ListBase + n[1].ui); + GLuint list = (GLuint) (ctx->List.ListBase + n[1].i); + execute_list(ctx, list); } break; case OPCODE_CLEAR: @@ -6126,7 +6182,12 @@ execute_list(GLcontext *ctx, GLuint list) CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e)); break; case OPCODE_POLYGON_STIPPLE: - CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data)); + { + const struct gl_pixelstore_attrib save = ctx->Unpack; + ctx->Unpack = ctx->DefaultPacking; + CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data)); + ctx->Unpack = save; /* restore */ + } break; case OPCODE_POLYGON_OFFSET: CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f)); @@ -6577,7 +6638,7 @@ execute_list(GLcontext *ctx, GLuint list) if (ctx->Driver.EndCallList) ctx->Driver.EndCallList(ctx); - ctx->ListState.CallStack[ctx->ListState.CallDepth--] = NULL; + ctx->ListState.CallDepth--; } @@ -6665,7 +6726,7 @@ _mesa_GenLists(GLsizei range) * Begin a new display list. */ void GLAPIENTRY -_mesa_NewList(GLuint list, GLenum mode) +_mesa_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); GLint i; @@ -6674,10 +6735,10 @@ _mesa_NewList(GLuint list, GLenum mode) ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glNewList %u %s\n", list, + _mesa_debug(ctx, "glNewList %u %s\n", name, _mesa_lookup_enum_by_nr(mode)); - if (list == 0) { + if (name == 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glNewList"); return; } @@ -6687,7 +6748,7 @@ _mesa_NewList(GLuint list, GLenum mode) return; } - if (ctx->ListState.CurrentListPtr) { + if (ctx->ListState.CurrentList) { /* already compiling a display list */ _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList"); return; @@ -6697,10 +6758,8 @@ _mesa_NewList(GLuint list, GLenum mode) ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE); /* Allocate new display list */ - ctx->ListState.CurrentListNum = list; - ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE); - ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->node; - ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock; + ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE); + ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head; ctx->ListState.CurrentPos = 0; /* Reset acumulated list state: @@ -6712,7 +6771,7 @@ _mesa_NewList(GLuint list, GLenum mode) ctx->ListState.ActiveMaterialSize[i] = 0; ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; - ctx->Driver.NewList(ctx, list, mode); + ctx->Driver.NewList(ctx, name, mode); ctx->CurrentDispatch = ctx->Save; _glapi_set_dispatch(ctx->CurrentDispatch); @@ -6733,7 +6792,7 @@ _mesa_EndList(void) _mesa_debug(ctx, "glEndList\n"); /* Check that a list is under construction */ - if (!ctx->ListState.CurrentListPtr) { + if (!ctx->ListState.CurrentList) { _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList"); return; } @@ -6746,18 +6805,18 @@ _mesa_EndList(void) (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); /* Destroy old list, if any */ - destroy_list(ctx, ctx->ListState.CurrentListNum); - /* Install the list */ - _mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum, + destroy_list(ctx, ctx->ListState.CurrentList->Name); + + /* Install the new list */ + _mesa_HashInsert(ctx->Shared->DisplayList, + ctx->ListState.CurrentList->Name, ctx->ListState.CurrentList); if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) - mesa_print_display_list(ctx->ListState.CurrentListNum); + mesa_print_display_list(ctx->ListState.CurrentList->Name); ctx->ListState.CurrentList = NULL; - ctx->ListState.CurrentListNum = 0; - ctx->ListState.CurrentListPtr = NULL; ctx->ExecuteFlag = GL_TRUE; ctx->CompileFlag = GL_FALSE; @@ -6808,7 +6867,6 @@ void GLAPIENTRY _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) { GET_CURRENT_CONTEXT(ctx); - GLuint list; GLint i; GLboolean save_compile_flag; @@ -6840,8 +6898,8 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) ctx->CompileFlag = GL_FALSE; for (i = 0; i < n; i++) { - list = translate_id(i, type, lists); - execute_list(ctx, ctx->List.ListBase + list); + GLuint list = (GLuint) (ctx->List.ListBase + translate_id(i, type, lists)); + execute_list(ctx, list); } ctx->CompileFlag = save_compile_flag; @@ -7821,6 +7879,9 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_StencilMaskSeparate(table, save_StencilMaskSeparate); SET_StencilOpSeparate(table, save_StencilOpSeparate); + /* ATI_separate_stencil */ + SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI); + /* GL_ARB_imaging */ /* Not all are supported */ SET_BlendColor(table, save_BlendColor); @@ -8118,6 +8179,11 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT); #endif + /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */ + SET_BindAttribLocationARB(table, exec_BindAttribLocationARB); + SET_GetAttribLocationARB(table, exec_GetAttribLocationARB); + /* XXX additional functions need to be implemented here! */ + /* 299. GL_EXT_blend_equation_separate */ SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT); @@ -8144,7 +8210,7 @@ enum_string(GLenum k) static void GLAPIENTRY print_list(GLcontext *ctx, GLuint list) { - struct mesa_display_list *dlist; + struct gl_display_list *dlist; Node *n; GLboolean done; @@ -8157,7 +8223,7 @@ print_list(GLcontext *ctx, GLuint list) if (!dlist) return; - n = dlist->node; + n = dlist->Head; _mesa_printf("START-LIST %u, address %p\n", list, (void *) n); @@ -8519,9 +8585,7 @@ _mesa_init_display_list(GLcontext *ctx) ctx->ListState.CallDepth = 0; ctx->ExecuteFlag = GL_TRUE; ctx->CompileFlag = GL_FALSE; - ctx->ListState.CurrentListPtr = NULL; ctx->ListState.CurrentBlock = NULL; - ctx->ListState.CurrentListNum = 0; ctx->ListState.CurrentPos = 0; /* Display List group */ diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index ef6a10af83..ab7ec2c8db 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -39,7 +39,7 @@ #if _HAVE_FULL_GL extern void -_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist); +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); extern void GLAPIENTRY _mesa_CallList( GLuint list ); diff --git a/src/mesa/main/dlopen.c b/src/mesa/main/dlopen.c new file mode 100644 index 0000000000..94bec4a088 --- /dev/null +++ b/src/mesa/main/dlopen.c @@ -0,0 +1,103 @@ +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/** + * Wrapper functions for dlopen(), dlsym(), dlclose(). + * Note that the #ifdef tests for various environments should be expanded. + */ + + +#include "dlopen.h" + +#if defined(_GNU_SOURCE) && !defined(__MINGW32__) +#include <dlfcn.h> +#endif +#if defined(_WIN32) +#include <windows.h> +#endif +#if defined(__HAIKU__) +/* for NULL */ +#include <stdio.h> +#endif + +/** + * Wrapper for dlopen(). + * Note that 'flags' isn't used at this time. + */ +void * +_mesa_dlopen(const char *libname, int flags) +{ +#if defined(_GNU_SOURCE) + flags = RTLD_LAZY | RTLD_GLOBAL; /* Overriding flags at this time */ + return dlopen(libname, flags); +#elif defined(__MINGW32__) + return LoadLibraryA(libname); +#else + return NULL; +#endif +} + + +/** + * Wrapper for dlsym() that does a cast to a generic function type, + * rather than a void *. This reduces the number of warnings that are + * generated. + */ +GenericFunc +_mesa_dlsym(void *handle, const char *fname) +{ +#if defined(__DJGPP__) + /* need '_' prefix on symbol names */ + char fname2[1000]; + fname2[0] = '_'; + _mesa_strncpy(fname2 + 1, fname, 998); + fname2[999] = 0; + return (GenericFunc) dlsym(handle, fname2); +#elif defined(_GNU_SOURCE) + return (GenericFunc) dlsym(handle, fname); +#elif defined(__MINGW32__) + return (GenericFunc) GetProcAddress(handle, fname); +#else + return (GenericFunc) NULL; +#endif +} + + +/** + * Wrapper for dlclose(). + */ +void +_mesa_dlclose(void *handle) +{ +#if defined(_GNU_SOURCE) + dlclose(handle); +#elif defined(__MINGW32__) + FreeLibrary(handle); +#else + (void) handle; +#endif +} + + + diff --git a/src/mesa/main/dlopen.h b/src/mesa/main/dlopen.h new file mode 100644 index 0000000000..9895a22549 --- /dev/null +++ b/src/mesa/main/dlopen.h @@ -0,0 +1,42 @@ +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef DLOPEN_H +#define DLOPEN_H + + +typedef void (*GenericFunc)(void); + + +extern void * +_mesa_dlopen(const char *libname, int flags); + +extern GenericFunc +_mesa_dlsym(void *handle, const char *fname); + +extern void +_mesa_dlclose(void *handle); + + +#endif diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 6db198ea3b..13cfa0e756 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -218,7 +218,7 @@ _mesa_Bitmap( GLsizei width, GLsizei height, if (ctx->RenderMode == GL_RENDER) { /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */ - const GLfloat epsilon = (const GLfloat)0.0001; + const GLfloat epsilon = 0.0001F; GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig); GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 9dc55d4e69..7ff3b15c84 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.0.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -37,7 +37,7 @@ #include "mtypes.h" #include "enums.h" #include "math/m_matrix.h" -#include "math/m_xform.h" +#include "api_arrayelt.h" @@ -136,6 +136,9 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_ARRAY); ctx->Array.NewState |= flag; + + _ae_invalidate_state(ctx, _NEW_ARRAY); + *var = state; if (state) @@ -197,6 +200,26 @@ _mesa_DisableClientState( GLenum cap ) } + +/** + * Return pointer to current texture unit for setting/getting coordinate + * state. + * Note that we'll set GL_INVALID_OPERATION if the active texture unit is + * higher than the number of supported coordinate units. And we'll return NULL. + */ +static struct gl_texture_unit * +get_texcoord_unit(GLcontext *ctx) +{ + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)"); + return NULL; + } + else { + return &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + } +} + + /** * Helper function to enable or disable a texture target. */ @@ -317,10 +340,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) ctx->Transform.CullVertexFlag = state; break; case GL_DEPTH_TEST: - if (state && ctx->DrawBuffer->Visual.depthBits == 0) { - _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer"); - return; - } if (ctx->Depth.Test == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); @@ -373,18 +392,24 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.Enabled = state; + if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) + ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; + else + ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; break; case GL_LINE_SMOOTH: if (ctx->Line.SmoothFlag == state) return; FLUSH_VERTICES(ctx, _NEW_LINE); ctx->Line.SmoothFlag = state; + ctx->_TriangleCaps ^= DD_LINE_SMOOTH; break; case GL_LINE_STIPPLE: if (ctx->Line.StippleFlag == state) return; FLUSH_VERTICES(ctx, _NEW_LINE); ctx->Line.StippleFlag = state; + ctx->_TriangleCaps ^= DD_LINE_STIPPLE; break; case GL_INDEX_LOGIC_OP: if (ctx->Color.IndexLogicOpEnabled == state) @@ -523,18 +548,21 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_POINT); ctx->Point.SmoothFlag = state; + ctx->_TriangleCaps ^= DD_POINT_SMOOTH; break; case GL_POLYGON_SMOOTH: if (ctx->Polygon.SmoothFlag == state) return; FLUSH_VERTICES(ctx, _NEW_POLYGON); ctx->Polygon.SmoothFlag = state; + ctx->_TriangleCaps ^= DD_TRI_SMOOTH; break; case GL_POLYGON_STIPPLE: if (ctx->Polygon.StippleFlag == state) return; FLUSH_VERTICES(ctx, _NEW_POLYGON); ctx->Polygon.StippleFlag = state; + ctx->_TriangleCaps ^= DD_TRI_STIPPLE; break; case GL_POLYGON_OFFSET_POINT: if (ctx->Polygon.OffsetPoint == state) @@ -599,54 +627,62 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) return; } break; - case GL_TEXTURE_GEN_Q: { - GLuint unit = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT; - if (state) - newenabled |= Q_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; + case GL_TEXTURE_GEN_Q: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT; + if (state) + newenabled |= Q_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } break; - } - case GL_TEXTURE_GEN_R: { - GLuint unit = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT; - if (state) - newenabled |= R_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; + case GL_TEXTURE_GEN_R: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT; + if (state) + newenabled |= R_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } break; - } - case GL_TEXTURE_GEN_S: { - GLuint unit = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT; - if (state) - newenabled |= S_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; + case GL_TEXTURE_GEN_S: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT; + if (state) + newenabled |= S_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } break; - } - case GL_TEXTURE_GEN_T: { - GLuint unit = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT; - if (state) - newenabled |= T_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; + case GL_TEXTURE_GEN_T: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT; + if (state) + newenabled |= T_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } break; - } /* * CLIENT STATE!!! @@ -735,35 +771,30 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_ARB_multisample */ case GL_MULTISAMPLE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.Enabled == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.Enabled = state; break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleAlphaToCoverage == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.SampleAlphaToCoverage = state; break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleAlphaToOne == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.SampleAlphaToOne = state; break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleCoverage == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); ctx->Multisample.SampleCoverage = state; break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXTENSION(ARB_multisample, cap); if (ctx->Multisample.SampleCoverageInvert == state) return; FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); @@ -885,6 +916,13 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) return; FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.TestTwoSide = state; + if (state) { + ctx->Stencil._BackFace = 2; + ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; + } else { + ctx->Stencil._BackFace = 1; + ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; + } break; #if FEATURE_ARB_fragment_program @@ -1138,28 +1176,36 @@ _mesa_IsEnabled( GLenum cap ) return is_texture_enabled(ctx, TEXTURE_3D_BIT); case GL_TEXTURE_GEN_Q: { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE; + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE; + } } + return GL_FALSE; case GL_TEXTURE_GEN_R: { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE; + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE; + } } + return GL_FALSE; case GL_TEXTURE_GEN_S: { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE; + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE; + } } + return GL_FALSE; case GL_TEXTURE_GEN_T: { - const struct gl_texture_unit *texUnit; - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE; + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE; + } } + return GL_FALSE; /* * CLIENT STATE!!! @@ -1234,19 +1280,14 @@ _mesa_IsEnabled( GLenum cap ) /* GL_ARB_multisample */ case GL_MULTISAMPLE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.Enabled; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleAlphaToCoverage; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleAlphaToOne; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleCoverage; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXTENSION(ARB_multisample); return ctx->Multisample.SampleCoverageInvert; /* GL_IBM_rasterpos_clip */ diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 8ce6b51d17..ca5db92265 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -26,6 +26,7 @@ */ #include "glheader.h" +#include "mfeatures.h" #include "enums.h" #include "imports.h" @@ -88,7 +89,6 @@ LONGSTRING static const char enum_string_table[] = "GL_AND_INVERTED\0" "GL_AND_REVERSE\0" "GL_ARRAY_BUFFER\0" - "GL_ARRAY_BUFFER_ARB\0" "GL_ARRAY_BUFFER_BINDING\0" "GL_ARRAY_BUFFER_BINDING_ARB\0" "GL_ATTACHED_SHADERS\0" @@ -181,21 +181,37 @@ LONGSTRING static const char enum_string_table[] = "GL_COLOR_ARRAY_SIZE\0" "GL_COLOR_ARRAY_STRIDE\0" "GL_COLOR_ARRAY_TYPE\0" + "GL_COLOR_ATTACHMENT0\0" "GL_COLOR_ATTACHMENT0_EXT\0" + "GL_COLOR_ATTACHMENT1\0" + "GL_COLOR_ATTACHMENT10\0" "GL_COLOR_ATTACHMENT10_EXT\0" + "GL_COLOR_ATTACHMENT11\0" "GL_COLOR_ATTACHMENT11_EXT\0" + "GL_COLOR_ATTACHMENT12\0" "GL_COLOR_ATTACHMENT12_EXT\0" + "GL_COLOR_ATTACHMENT13\0" "GL_COLOR_ATTACHMENT13_EXT\0" + "GL_COLOR_ATTACHMENT14\0" "GL_COLOR_ATTACHMENT14_EXT\0" + "GL_COLOR_ATTACHMENT15\0" "GL_COLOR_ATTACHMENT15_EXT\0" "GL_COLOR_ATTACHMENT1_EXT\0" + "GL_COLOR_ATTACHMENT2\0" "GL_COLOR_ATTACHMENT2_EXT\0" + "GL_COLOR_ATTACHMENT3\0" "GL_COLOR_ATTACHMENT3_EXT\0" + "GL_COLOR_ATTACHMENT4\0" "GL_COLOR_ATTACHMENT4_EXT\0" + "GL_COLOR_ATTACHMENT5\0" "GL_COLOR_ATTACHMENT5_EXT\0" + "GL_COLOR_ATTACHMENT6\0" "GL_COLOR_ATTACHMENT6_EXT\0" + "GL_COLOR_ATTACHMENT7\0" "GL_COLOR_ATTACHMENT7_EXT\0" + "GL_COLOR_ATTACHMENT8\0" "GL_COLOR_ATTACHMENT8_EXT\0" + "GL_COLOR_ATTACHMENT9\0" "GL_COLOR_ATTACHMENT9_EXT\0" "GL_COLOR_BUFFER_BIT\0" "GL_COLOR_CLEAR_VALUE\0" @@ -349,6 +365,8 @@ LONGSTRING static const char enum_string_table[] = "GL_DECR_WRAP_EXT\0" "GL_DELETE_STATUS\0" "GL_DEPTH\0" + "GL_DEPTH24_STENCIL8\0" + "GL_DEPTH_ATTACHMENT\0" "GL_DEPTH_ATTACHMENT_EXT\0" "GL_DEPTH_BIAS\0" "GL_DEPTH_BITS\0" @@ -370,6 +388,8 @@ LONGSTRING static const char enum_string_table[] = "GL_DEPTH_FUNC\0" "GL_DEPTH_RANGE\0" "GL_DEPTH_SCALE\0" + "GL_DEPTH_STENCIL\0" + "GL_DEPTH_STENCIL_ATTACHMENT\0" "GL_DEPTH_STENCIL_NV\0" "GL_DEPTH_STENCIL_TO_BGRA_NV\0" "GL_DEPTH_STENCIL_TO_RGBA_NV\0" @@ -438,6 +458,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DRAW_BUFFER9\0" "GL_DRAW_BUFFER9_ARB\0" "GL_DRAW_BUFFER9_ATI\0" + "GL_DRAW_FRAMEBUFFER\0" "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0" "GL_DRAW_FRAMEBUFFER_EXT\0" "GL_DRAW_PIXEL_TOKEN\0" @@ -456,7 +477,6 @@ LONGSTRING static const char enum_string_table[] = "GL_EDGE_FLAG_ARRAY_POINTER\0" "GL_EDGE_FLAG_ARRAY_STRIDE\0" "GL_ELEMENT_ARRAY_BUFFER\0" - "GL_ELEMENT_ARRAY_BUFFER_ARB\0" "GL_ELEMENT_ARRAY_BUFFER_BINDING\0" "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB\0" "GL_EMISSION\0" @@ -524,23 +544,44 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAGMENT_SHADER\0" "GL_FRAGMENT_SHADER_ARB\0" "GL_FRAGMENT_SHADER_DERIVATIVE_HINT\0" + "GL_FRAMEBUFFER\0" + "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING\0" + "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE\0" + "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\0" "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\0" "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE\0" + "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0" + "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0" "GL_FRAMEBUFFER_BINDING_EXT\0" + "GL_FRAMEBUFFER_COMPLETE\0" "GL_FRAMEBUFFER_COMPLETE_EXT\0" + "GL_FRAMEBUFFER_DEFAULT\0" "GL_FRAMEBUFFER_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\0" "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\0" "GL_FRAMEBUFFER_STATUS_ERROR_EXT\0" + "GL_FRAMEBUFFER_UNDEFINED\0" + "GL_FRAMEBUFFER_UNSUPPORTED\0" "GL_FRAMEBUFFER_UNSUPPORTED_EXT\0" "GL_FRONT\0" "GL_FRONT_AND_BACK\0" @@ -613,6 +654,7 @@ LONGSTRING static const char enum_string_table[] = "GL_INCR\0" "GL_INCR_WRAP\0" "GL_INCR_WRAP_EXT\0" + "GL_INDEX\0" "GL_INDEX_ARRAY\0" "GL_INDEX_ARRAY_BUFFER_BINDING\0" "GL_INDEX_ARRAY_BUFFER_BINDING_ARB\0" @@ -648,6 +690,7 @@ LONGSTRING static const char enum_string_table[] = "GL_INT_VEC4\0" "GL_INT_VEC4_ARB\0" "GL_INVALID_ENUM\0" + "GL_INVALID_FRAMEBUFFER_OPERATION\0" "GL_INVALID_FRAMEBUFFER_OPERATION_EXT\0" "GL_INVALID_OPERATION\0" "GL_INVALID_VALUE\0" @@ -892,6 +935,7 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0" "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0" "GL_MAX_RENDERBUFFER_SIZE_EXT\0" + "GL_MAX_SAMPLES\0" "GL_MAX_SHININESS_NV\0" "GL_MAX_SPOT_EXPONENT_NV\0" "GL_MAX_TEXTURE_COORDS\0" @@ -1259,6 +1303,7 @@ LONGSTRING static const char enum_string_table[] = "GL_R3_G3_B2\0" "GL_RASTER_POSITION_UNCLIPPED_IBM\0" "GL_READ_BUFFER\0" + "GL_READ_FRAMEBUFFER\0" "GL_READ_FRAMEBUFFER_BINDING_EXT\0" "GL_READ_FRAMEBUFFER_EXT\0" "GL_READ_ONLY\0" @@ -1275,10 +1320,21 @@ LONGSTRING static const char enum_string_table[] = "GL_REFLECTION_MAP_ARB\0" "GL_REFLECTION_MAP_NV\0" "GL_RENDER\0" + "GL_RENDERBUFFER\0" + "GL_RENDERBUFFER_ALPHA_SIZE\0" "GL_RENDERBUFFER_BINDING_EXT\0" + "GL_RENDERBUFFER_BLUE_SIZE\0" + "GL_RENDERBUFFER_DEPTH_SIZE\0" "GL_RENDERBUFFER_EXT\0" + "GL_RENDERBUFFER_GREEN_SIZE\0" + "GL_RENDERBUFFER_HEIGHT\0" "GL_RENDERBUFFER_HEIGHT_EXT\0" + "GL_RENDERBUFFER_INTERNAL_FORMAT\0" "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0" + "GL_RENDERBUFFER_RED_SIZE\0" + "GL_RENDERBUFFER_SAMPLES\0" + "GL_RENDERBUFFER_STENCIL_SIZE\0" + "GL_RENDERBUFFER_WIDTH\0" "GL_RENDERBUFFER_WIDTH_EXT\0" "GL_RENDERER\0" "GL_RENDER_MODE\0" @@ -1422,6 +1478,7 @@ LONGSTRING static const char enum_string_table[] = "GL_SRC_ALPHA\0" "GL_SRC_ALPHA_SATURATE\0" "GL_SRC_COLOR\0" + "GL_SRGB\0" "GL_STACK_OVERFLOW\0" "GL_STACK_UNDERFLOW\0" "GL_STATIC_COPY\0" @@ -1431,6 +1488,7 @@ LONGSTRING static const char enum_string_table[] = "GL_STATIC_READ\0" "GL_STATIC_READ_ARB\0" "GL_STENCIL\0" + "GL_STENCIL_ATTACHMENT\0" "GL_STENCIL_ATTACHMENT_EXT\0" "GL_STENCIL_BACK_FAIL\0" "GL_STENCIL_BACK_FAIL_ATI\0" @@ -1656,6 +1714,7 @@ LONGSTRING static const char enum_string_table[] = "GL_TEXTURE_RED_SIZE_EXT\0" "GL_TEXTURE_RESIDENT\0" "GL_TEXTURE_STACK_DEPTH\0" + "GL_TEXTURE_STENCIL_SIZE\0" "GL_TEXTURE_TOO_LARGE_EXT\0" "GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0" "GL_TEXTURE_WIDTH\0" @@ -1694,10 +1753,12 @@ LONGSTRING static const char enum_string_table[] = "GL_UNSIGNED_BYTE_3_3_2\0" "GL_UNSIGNED_INT\0" "GL_UNSIGNED_INT_10_10_10_2\0" + "GL_UNSIGNED_INT_24_8\0" "GL_UNSIGNED_INT_24_8_NV\0" "GL_UNSIGNED_INT_2_10_10_10_REV\0" "GL_UNSIGNED_INT_8_8_8_8\0" "GL_UNSIGNED_INT_8_8_8_8_REV\0" + "GL_UNSIGNED_NORMALIZED\0" "GL_UNSIGNED_SHORT\0" "GL_UNSIGNED_SHORT_1_5_5_5_REV\0" "GL_UNSIGNED_SHORT_4_4_4_4\0" @@ -1787,7 +1848,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1750] = +static const enum_elt all_enums[1810] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -1842,2995 +1903,3077 @@ static const enum_elt all_enums[1750] = { 830, 0x00001504 }, /* GL_AND_INVERTED */ { 846, 0x00001502 }, /* GL_AND_REVERSE */ { 861, 0x00008892 }, /* GL_ARRAY_BUFFER */ - { 877, 0x00008892 }, /* GL_ARRAY_BUFFER_ARB */ - { 897, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */ - { 921, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */ - { 949, 0x00008B85 }, /* GL_ATTACHED_SHADERS */ - { 969, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */ - { 996, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */ - { 1020, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */ - { 1046, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */ - { 1070, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */ - { 1092, 0x00000D80 }, /* GL_AUTO_NORMAL */ - { 1107, 0x00000409 }, /* GL_AUX0 */ - { 1115, 0x0000040A }, /* GL_AUX1 */ - { 1123, 0x0000040B }, /* GL_AUX2 */ - { 1131, 0x0000040C }, /* GL_AUX3 */ - { 1139, 0x00000C00 }, /* GL_AUX_BUFFERS */ - { 1154, 0x00000405 }, /* GL_BACK */ - { 1162, 0x00000402 }, /* GL_BACK_LEFT */ - { 1175, 0x00000403 }, /* GL_BACK_RIGHT */ - { 1189, 0x000080E0 }, /* GL_BGR */ - { 1196, 0x000080E1 }, /* GL_BGRA */ - { 1204, 0x00001A00 }, /* GL_BITMAP */ - { 1214, 0x00000704 }, /* GL_BITMAP_TOKEN */ - { 1230, 0x00000BE2 }, /* GL_BLEND */ - { 1239, 0x00008005 }, /* GL_BLEND_COLOR */ - { 1254, 0x00008005 }, /* GL_BLEND_COLOR_EXT */ - { 1273, 0x00000BE0 }, /* GL_BLEND_DST */ - { 1286, 0x000080CA }, /* GL_BLEND_DST_ALPHA */ - { 1305, 0x000080C8 }, /* GL_BLEND_DST_RGB */ - { 1322, 0x00008009 }, /* GL_BLEND_EQUATION */ - { 1340, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */ - { 1364, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */ - { 1392, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */ - { 1414, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ - { 1440, 0x00000BE1 }, /* GL_BLEND_SRC */ - { 1453, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ - { 1472, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ - { 1489, 0x00001905 }, /* GL_BLUE */ - { 1497, 0x00000D1B }, /* GL_BLUE_BIAS */ - { 1510, 0x00000D54 }, /* GL_BLUE_BITS */ - { 1523, 0x00000D1A }, /* GL_BLUE_SCALE */ - { 1537, 0x00008B56 }, /* GL_BOOL */ - { 1545, 0x00008B56 }, /* GL_BOOL_ARB */ - { 1557, 0x00008B57 }, /* GL_BOOL_VEC2 */ - { 1570, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ - { 1587, 0x00008B58 }, /* GL_BOOL_VEC3 */ - { 1600, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ - { 1617, 0x00008B59 }, /* GL_BOOL_VEC4 */ - { 1630, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ - { 1647, 0x000088BB }, /* GL_BUFFER_ACCESS */ - { 1664, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ - { 1685, 0x000088BC }, /* GL_BUFFER_MAPPED */ - { 1702, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ - { 1723, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ - { 1745, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ - { 1771, 0x00008764 }, /* GL_BUFFER_SIZE */ - { 1786, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ - { 1805, 0x00008765 }, /* GL_BUFFER_USAGE */ - { 1821, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ - { 1841, 0x00001400 }, /* GL_BYTE */ - { 1849, 0x00002A24 }, /* GL_C3F_V3F */ - { 1860, 0x00002A26 }, /* GL_C4F_N3F_V3F */ - { 1875, 0x00002A22 }, /* GL_C4UB_V2F */ - { 1887, 0x00002A23 }, /* GL_C4UB_V3F */ - { 1899, 0x00000901 }, /* GL_CCW */ - { 1906, 0x00002900 }, /* GL_CLAMP */ - { 1915, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ - { 1934, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ - { 1957, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ - { 1981, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ - { 1998, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ - { 2020, 0x00001500 }, /* GL_CLEAR */ - { 2029, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ - { 2054, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ - { 2083, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ - { 2109, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - { 2138, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ - { 2164, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ - { 2191, 0x00003000 }, /* GL_CLIP_PLANE0 */ - { 2206, 0x00003001 }, /* GL_CLIP_PLANE1 */ - { 2221, 0x00003002 }, /* GL_CLIP_PLANE2 */ - { 2236, 0x00003003 }, /* GL_CLIP_PLANE3 */ - { 2251, 0x00003004 }, /* GL_CLIP_PLANE4 */ - { 2266, 0x00003005 }, /* GL_CLIP_PLANE5 */ - { 2281, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - { 2314, 0x00000A00 }, /* GL_COEFF */ - { 2323, 0x00001800 }, /* GL_COLOR */ - { 2332, 0x00008076 }, /* GL_COLOR_ARRAY */ - { 2347, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - { 2377, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 2411, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ - { 2434, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ - { 2454, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ - { 2476, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ - { 2496, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ - { 2521, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ - { 2547, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ - { 2573, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ - { 2599, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ - { 2625, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ - { 2651, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ - { 2677, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ - { 2702, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ - { 2727, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ - { 2752, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ - { 2777, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ - { 2802, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ - { 2827, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ - { 2852, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ - { 2877, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ - { 2902, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ - { 2922, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ - { 2943, 0x00001900 }, /* GL_COLOR_INDEX */ - { 2958, 0x00001603 }, /* GL_COLOR_INDEXES */ - { 2975, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ - { 2993, 0x00000B57 }, /* GL_COLOR_MATERIAL */ - { 3011, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ - { 3034, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ - { 3062, 0x000080B1 }, /* GL_COLOR_MATRIX */ - { 3078, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ - { 3098, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ - { 3126, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 3158, 0x00008458 }, /* GL_COLOR_SUM */ - { 3171, 0x00008458 }, /* GL_COLOR_SUM_ARB */ - { 3188, 0x000080D0 }, /* GL_COLOR_TABLE */ - { 3203, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ - { 3229, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ - { 3259, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ - { 3289, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ - { 3309, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ - { 3333, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ - { 3358, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ - { 3387, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ - { 3416, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ - { 3438, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ - { 3464, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ - { 3490, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ - { 3516, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ - { 3546, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ - { 3576, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - { 3606, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ - { 3640, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ - { 3674, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - { 3704, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ - { 3738, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ - { 3772, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ - { 3796, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ - { 3824, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ - { 3852, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ - { 3873, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ - { 3898, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ - { 3919, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ - { 3944, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ - { 3969, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ - { 3988, 0x00008570 }, /* GL_COMBINE */ - { 3999, 0x00008503 }, /* GL_COMBINE4 */ - { 4011, 0x00008572 }, /* GL_COMBINE_ALPHA */ - { 4028, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ - { 4049, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ - { 4070, 0x00008570 }, /* GL_COMBINE_ARB */ - { 4085, 0x00008570 }, /* GL_COMBINE_EXT */ - { 4100, 0x00008571 }, /* GL_COMBINE_RGB */ - { 4115, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ - { 4134, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 4153, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ - { 4189, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 4213, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4241, 0x00001300 }, /* GL_COMPILE */ - { 4252, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4275, 0x00008B81 }, /* GL_COMPILE_STATUS */ - { 4293, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4313, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4337, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4361, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4389, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4413, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 4443, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 4477, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 4505, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 4523, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 4542, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 4565, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 4594, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 4627, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 4660, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 4693, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 4715, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 4743, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 4775, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 4805, 0x00008576 }, /* GL_CONSTANT */ - { 4817, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 4835, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 4857, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 4873, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 4897, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 4919, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 4937, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 4959, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 4975, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 4993, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 5011, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 5039, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 5070, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 5097, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 5128, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 5155, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 5186, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 5214, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5246, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5268, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5294, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 5316, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 5342, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 5363, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 5388, 0x00008862 }, /* GL_COORD_REPLACE */ - { 5405, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 5426, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 5446, 0x00001503 }, /* GL_COPY */ - { 5454, 0x0000150C }, /* GL_COPY_INVERTED */ - { 5471, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 5491, 0x00000B44 }, /* GL_CULL_FACE */ - { 5504, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 5522, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 5541, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 5573, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 5608, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 5629, 0x00000001 }, /* GL_CURRENT_BIT */ - { 5644, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 5661, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 5682, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 5708, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 5725, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 5747, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 5775, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 5796, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 5830, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 5863, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 5881, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 5911, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ - { 5930, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 5947, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 5968, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 5992, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 6019, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 6043, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 6070, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 6103, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 6136, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 6163, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 6189, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ - { 6214, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 6243, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 6265, 0x00000900 }, /* GL_CW */ - { 6271, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 6292, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 6313, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 6333, 0x00002101 }, /* GL_DECAL */ - { 6342, 0x00001E03 }, /* GL_DECR */ - { 6350, 0x00008508 }, /* GL_DECR_WRAP */ - { 6363, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 6380, 0x00008B80 }, /* GL_DELETE_STATUS */ - { 6397, 0x00001801 }, /* GL_DEPTH */ - { 6406, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 6430, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 6444, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 6458, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 6478, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 6503, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 6523, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 6541, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 6562, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 6581, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 6602, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 6627, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 6653, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 6674, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 6699, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 6725, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 6746, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 6771, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 6797, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 6811, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 6826, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 6841, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 6861, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 6889, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 6917, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 6931, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 6953, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 6979, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 6998, 0x00001201 }, /* GL_DIFFUSE */ - { 7009, 0x00000BD0 }, /* GL_DITHER */ - { 7019, 0x00000A02 }, /* GL_DOMAIN */ - { 7029, 0x00001100 }, /* GL_DONT_CARE */ - { 7042, 0x000086AE }, /* GL_DOT3_RGB */ - { 7054, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7067, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7084, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7101, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7117, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7133, 0x0000140A }, /* GL_DOUBLE */ - { 7143, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 7159, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 7174, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 7190, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 7210, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 7230, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 7246, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 7263, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 7284, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 7305, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 7322, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 7343, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 7364, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 7381, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 7402, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 7423, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 7440, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 7461, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 7482, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 7499, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 7520, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 7541, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 7558, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 7579, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 7600, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 7620, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 7640, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 7656, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 7676, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 7696, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 7712, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 7732, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 7752, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 7768, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 7788, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 7808, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 7824, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 7844, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 7864, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 7880, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 7900, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 7920, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 7936, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 7956, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 7976, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 7992, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 8012, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8032, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8048, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8068, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8088, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8120, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 8144, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 8164, 0x00000304 }, /* GL_DST_ALPHA */ - { 8177, 0x00000306 }, /* GL_DST_COLOR */ - { 8190, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 8206, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 8226, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 8242, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 8262, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 8278, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 8298, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 8311, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 8330, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 8364, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 8402, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 8429, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 8455, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 8479, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER_ARB */ - { 8507, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 8539, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 8575, 0x00001600 }, /* GL_EMISSION */ - { 8587, 0x00002000 }, /* GL_ENABLE_BIT */ - { 8601, 0x00000202 }, /* GL_EQUAL */ - { 8610, 0x00001509 }, /* GL_EQUIV */ - { 8619, 0x00010000 }, /* GL_EVAL_BIT */ - { 8631, 0x00000800 }, /* GL_EXP */ - { 8638, 0x00000801 }, /* GL_EXP2 */ - { 8646, 0x00001F03 }, /* GL_EXTENSIONS */ - { 8660, 0x00002400 }, /* GL_EYE_LINEAR */ - { 8674, 0x00002502 }, /* GL_EYE_PLANE */ - { 8687, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 8712, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 8729, 0x00000000 }, /* GL_FALSE */ - { 8738, 0x00001101 }, /* GL_FASTEST */ - { 8749, 0x00001C01 }, /* GL_FEEDBACK */ - { 8761, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 8788, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 8812, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 8836, 0x00001B02 }, /* GL_FILL */ - { 8844, 0x00001D00 }, /* GL_FLAT */ - { 8852, 0x00001406 }, /* GL_FLOAT */ - { 8861, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 8875, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 8893, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 8907, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 8925, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 8939, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 8957, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 8971, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 8989, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 9003, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 9021, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 9035, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 9053, 0x00000B60 }, /* GL_FOG */ - { 9060, 0x00000080 }, /* GL_FOG_BIT */ - { 9071, 0x00000B66 }, /* GL_FOG_COLOR */ - { 9084, 0x00008451 }, /* GL_FOG_COORD */ - { 9097, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 9115, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 9139, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 9178, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 9221, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 9253, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 9284, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 9313, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 9338, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 9357, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 9391, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 9418, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 9444, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 9468, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 9485, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 9500, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 9524, 0x00000B64 }, /* GL_FOG_END */ - { 9535, 0x00000C54 }, /* GL_FOG_HINT */ - { 9547, 0x00000B61 }, /* GL_FOG_INDEX */ - { 9560, 0x00000B65 }, /* GL_FOG_MODE */ - { 9572, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 9591, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 9616, 0x00000B63 }, /* GL_FOG_START */ - { 9629, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 9647, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 9671, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 9690, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 9713, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 9748, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 9790, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 9832, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 9881, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 9933, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 9977, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 10021, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 10048, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 10076, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 10095, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 10136, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 10177, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 10219, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 10270, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 10308, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 10357, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 10399, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 10431, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 10462, 0x00000404 }, /* GL_FRONT */ - { 10471, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 10489, 0x00000B46 }, /* GL_FRONT_FACE */ - { 10503, 0x00000400 }, /* GL_FRONT_LEFT */ - { 10517, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 10532, 0x00008006 }, /* GL_FUNC_ADD */ - { 10544, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 10560, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 10585, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 10614, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 10631, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 10652, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 10671, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 10695, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 10724, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 10748, 0x00000206 }, /* GL_GEQUAL */ - { 10758, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ - { 10783, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ - { 10811, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - { 10845, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ - { 10867, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - { 10895, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ - { 10932, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ - { 10951, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ - { 10970, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ - { 10989, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ - { 11008, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ - { 11027, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ - { 11046, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ - { 11070, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - { 11102, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ - { 11128, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 11162, 0x00008C46 }, /* GL_GL_SLUMINANCE */ - { 11179, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ - { 11197, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ - { 11222, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ - { 11245, 0x00008C40 }, /* GL_GL_SRGB */ - { 11256, 0x00008C41 }, /* GL_GL_SRGB8 */ - { 11268, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ - { 11287, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ - { 11304, 0x00000204 }, /* GL_GREATER */ - { 11315, 0x00001904 }, /* GL_GREEN */ - { 11324, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 11338, 0x00000D53 }, /* GL_GREEN_BITS */ - { 11352, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 11367, 0x00008000 }, /* GL_HINT_BIT */ - { 11379, 0x00008024 }, /* GL_HISTOGRAM */ - { 11392, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 11416, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 11444, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 11467, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 11494, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 11511, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 11531, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 11555, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 11579, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 11607, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 11635, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 11667, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 11689, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 11715, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 11733, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 11755, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 11774, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 11797, 0x0000862A }, /* GL_IDENTITY_NV */ - { 11812, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 11832, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 11872, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 11910, 0x00001E02 }, /* GL_INCR */ - { 11918, 0x00008507 }, /* GL_INCR_WRAP */ - { 11931, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 11948, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 11963, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 11993, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 12027, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 12050, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 12072, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 12092, 0x00000D51 }, /* GL_INDEX_BITS */ - { 12106, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 12127, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 12145, 0x00000C30 }, /* GL_INDEX_MODE */ - { 12159, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 12175, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 12190, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 12209, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 12228, 0x00001404 }, /* GL_INT */ - { 12235, 0x00008049 }, /* GL_INTENSITY */ - { 12248, 0x0000804C }, /* GL_INTENSITY12 */ - { 12263, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 12282, 0x0000804D }, /* GL_INTENSITY16 */ - { 12297, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 12316, 0x0000804A }, /* GL_INTENSITY4 */ - { 12330, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 12348, 0x0000804B }, /* GL_INTENSITY8 */ - { 12362, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 12380, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 12397, 0x00008575 }, /* GL_INTERPOLATE */ - { 12412, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 12431, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 12450, 0x00008B53 }, /* GL_INT_VEC2 */ - { 12462, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 12478, 0x00008B54 }, /* GL_INT_VEC3 */ - { 12490, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 12506, 0x00008B55 }, /* GL_INT_VEC4 */ - { 12518, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 12534, 0x00000500 }, /* GL_INVALID_ENUM */ - { 12550, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 12587, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 12608, 0x00000501 }, /* GL_INVALID_VALUE */ - { 12625, 0x0000862B }, /* GL_INVERSE_NV */ - { 12639, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 12663, 0x0000150A }, /* GL_INVERT */ - { 12673, 0x00001E00 }, /* GL_KEEP */ - { 12681, 0x00000406 }, /* GL_LEFT */ - { 12689, 0x00000203 }, /* GL_LEQUAL */ - { 12699, 0x00000201 }, /* GL_LESS */ - { 12707, 0x00004000 }, /* GL_LIGHT0 */ - { 12717, 0x00004001 }, /* GL_LIGHT1 */ - { 12727, 0x00004002 }, /* GL_LIGHT2 */ - { 12737, 0x00004003 }, /* GL_LIGHT3 */ - { 12747, 0x00004004 }, /* GL_LIGHT4 */ - { 12757, 0x00004005 }, /* GL_LIGHT5 */ - { 12767, 0x00004006 }, /* GL_LIGHT6 */ - { 12777, 0x00004007 }, /* GL_LIGHT7 */ - { 12787, 0x00000B50 }, /* GL_LIGHTING */ - { 12799, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 12815, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 12838, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 12867, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 12900, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 12928, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 12952, 0x00001B01 }, /* GL_LINE */ - { 12960, 0x00002601 }, /* GL_LINEAR */ - { 12970, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 12992, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 13022, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 13053, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 13077, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 13102, 0x00000001 }, /* GL_LINES */ - { 13111, 0x00000004 }, /* GL_LINE_BIT */ - { 13123, 0x00000002 }, /* GL_LINE_LOOP */ - { 13136, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 13156, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 13171, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 13191, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 13207, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 13231, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 13254, 0x00000003 }, /* GL_LINE_STRIP */ - { 13268, 0x00000702 }, /* GL_LINE_TOKEN */ - { 13282, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 13296, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 13322, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 13342, 0x00008B82 }, /* GL_LINK_STATUS */ - { 13357, 0x00000B32 }, /* GL_LIST_BASE */ - { 13370, 0x00020000 }, /* GL_LIST_BIT */ - { 13382, 0x00000B33 }, /* GL_LIST_INDEX */ - { 13396, 0x00000B30 }, /* GL_LIST_MODE */ - { 13409, 0x00000101 }, /* GL_LOAD */ - { 13417, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 13429, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 13446, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 13460, 0x00001909 }, /* GL_LUMINANCE */ - { 13473, 0x00008041 }, /* GL_LUMINANCE12 */ - { 13488, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 13511, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 13538, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 13560, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 13586, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 13605, 0x00008042 }, /* GL_LUMINANCE16 */ - { 13620, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 13643, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 13670, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 13689, 0x0000803F }, /* GL_LUMINANCE4 */ - { 13703, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 13724, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 13749, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 13767, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 13788, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 13813, 0x00008040 }, /* GL_LUMINANCE8 */ - { 13827, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 13848, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 13873, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 13891, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 13910, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 13926, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 13946, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 13968, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 13982, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 13997, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 14021, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 14045, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 14069, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 14093, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 14110, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 14127, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 14155, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 14184, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 14213, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 14242, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 14271, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 14300, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 14329, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 14357, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 14385, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 14413, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 14441, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 14469, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 14497, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 14525, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 14553, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 14581, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 14597, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 14617, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 14639, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 14653, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 14668, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 14692, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 14716, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 14740, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 14764, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 14781, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 14798, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 14826, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 14855, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 14884, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 14913, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 14942, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 14971, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 15000, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 15028, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 15056, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 15084, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 15112, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 15140, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 15168, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 15196, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 15224, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 15252, 0x00000D10 }, /* GL_MAP_COLOR */ - { 15265, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 15280, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 15295, 0x00008630 }, /* GL_MATRIX0_NV */ - { 15309, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 15325, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 15341, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 15357, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 15373, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 15389, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 15405, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 15421, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 15437, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 15453, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 15469, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 15484, 0x00008631 }, /* GL_MATRIX1_NV */ - { 15498, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 15514, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 15530, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 15546, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 15562, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 15578, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 15594, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 15610, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 15626, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 15642, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 15658, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 15673, 0x00008632 }, /* GL_MATRIX2_NV */ - { 15687, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 15703, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 15719, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 15734, 0x00008633 }, /* GL_MATRIX3_NV */ - { 15748, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 15763, 0x00008634 }, /* GL_MATRIX4_NV */ - { 15777, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 15792, 0x00008635 }, /* GL_MATRIX5_NV */ - { 15806, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 15821, 0x00008636 }, /* GL_MATRIX6_NV */ - { 15835, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 15850, 0x00008637 }, /* GL_MATRIX7_NV */ - { 15864, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 15879, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 15894, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 15920, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 15954, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 15985, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 16018, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 16049, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 16064, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 16086, 0x00008008 }, /* GL_MAX */ - { 16093, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 16116, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 16148, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 16174, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 16207, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 16233, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 16267, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 16286, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 16315, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 16347, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 16383, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 16419, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 16459, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 16485, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 16515, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 16540, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 16569, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 16598, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 16631, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 16651, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 16675, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 16699, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 16723, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 16748, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 16766, 0x00008008 }, /* GL_MAX_EXT */ - { 16777, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 16812, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 16851, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 16865, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 16885, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 16923, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 16952, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 16976, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 17004, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 17027, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 17064, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 17100, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 17127, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 17156, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 17190, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 17226, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 17253, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 17285, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 17321, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 17350, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 17379, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 17407, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 17445, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 17489, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 17532, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 17566, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 17605, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 17642, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 17680, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 17723, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 17766, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 17796, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 17827, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 17863, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 17899, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 17929, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 17963, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 17996, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 18025, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 18045, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 18069, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 18091, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 18117, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 18144, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 18175, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 18199, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 18233, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 18253, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 18280, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 18301, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 18326, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 18351, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 18386, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 18408, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 18434, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 18456, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 18482, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 18516, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 18554, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 18587, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 18624, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 18648, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 18669, 0x00008007 }, /* GL_MIN */ - { 18676, 0x0000802E }, /* GL_MINMAX */ - { 18686, 0x0000802E }, /* GL_MINMAX_EXT */ - { 18700, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 18717, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 18738, 0x00008030 }, /* GL_MINMAX_SINK */ - { 18753, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 18772, 0x00008007 }, /* GL_MIN_EXT */ - { 18783, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 18802, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 18825, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 18848, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 18868, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 18888, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 18918, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 18946, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 18974, 0x00001700 }, /* GL_MODELVIEW */ - { 18987, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 19005, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 19024, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 19043, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 19062, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 19081, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 19100, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 19119, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 19138, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 19157, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 19176, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 19195, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 19213, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 19232, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 19251, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 19270, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 19289, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 19308, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 19327, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 19346, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 19365, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 19384, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 19403, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 19421, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 19440, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 19459, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 19477, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 19495, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 19513, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 19531, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 19549, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 19567, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 19585, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 19605, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 19632, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 19657, 0x00002100 }, /* GL_MODULATE */ - { 19669, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 19689, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 19716, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 19741, 0x00000103 }, /* GL_MULT */ - { 19749, 0x0000809D }, /* GL_MULTISAMPLE */ - { 19764, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 19784, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 19803, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 19822, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 19846, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 19869, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 19899, 0x00002A25 }, /* GL_N3F_V3F */ - { 19910, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 19930, 0x0000150E }, /* GL_NAND */ - { 19938, 0x00002600 }, /* GL_NEAREST */ - { 19949, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 19980, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 20012, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 20037, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 20063, 0x00000200 }, /* GL_NEVER */ - { 20072, 0x00001102 }, /* GL_NICEST */ - { 20082, 0x00000000 }, /* GL_NONE */ - { 20090, 0x00001505 }, /* GL_NOOP */ - { 20098, 0x00001508 }, /* GL_NOR */ - { 20105, 0x00000BA1 }, /* GL_NORMALIZE */ - { 20118, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 20134, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 20165, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 20200, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 20224, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 20247, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 20268, 0x00008511 }, /* GL_NORMAL_MAP */ - { 20282, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 20300, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 20317, 0x00000205 }, /* GL_NOTEQUAL */ - { 20329, 0x00000000 }, /* GL_NO_ERROR */ - { 20341, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 20375, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 20413, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 20445, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 20487, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 20517, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 20557, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 20588, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 20617, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 20645, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 20675, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 20692, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 20718, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 20734, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 20769, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 20791, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 20810, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 20840, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 20861, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 20889, 0x00000001 }, /* GL_ONE */ - { 20896, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 20924, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 20956, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 20984, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 21016, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 21039, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 21062, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 21085, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 21108, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 21126, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 21148, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 21170, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 21186, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 21206, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 21226, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 21244, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 21266, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 21288, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 21304, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 21324, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 21344, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 21362, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 21384, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 21406, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 21422, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 21442, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 21462, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 21483, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 21502, 0x00001507 }, /* GL_OR */ - { 21508, 0x00000A01 }, /* GL_ORDER */ - { 21517, 0x0000150D }, /* GL_OR_INVERTED */ - { 21532, 0x0000150B }, /* GL_OR_REVERSE */ - { 21546, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 21563, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 21581, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 21602, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 21622, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 21640, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 21659, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 21679, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 21699, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 21717, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 21736, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 21761, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 21785, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 21806, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 21828, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 21850, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 21875, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 21899, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 21920, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 21942, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 21964, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 21986, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 22017, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 22037, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 22062, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 22082, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 22107, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 22127, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 22152, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 22172, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 22197, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 22217, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 22242, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 22262, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 22287, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 22307, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 22332, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 22352, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 22377, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 22397, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 22422, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 22442, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 22467, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 22485, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 22518, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 22543, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 22578, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 22605, 0x00001B00 }, /* GL_POINT */ - { 22614, 0x00000000 }, /* GL_POINTS */ - { 22624, 0x00000002 }, /* GL_POINT_BIT */ - { 22637, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 22667, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 22701, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 22735, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 22770, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 22799, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 22832, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 22865, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 22899, 0x00000B11 }, /* GL_POINT_SIZE */ - { 22913, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 22939, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 22957, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 22979, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 23001, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 23024, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 23042, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 23064, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 23086, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 23109, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 23129, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 23145, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 23166, 0x00008861 }, /* GL_POINT_SPRITE */ - { 23182, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 23202, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 23231, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 23250, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 23276, 0x00000701 }, /* GL_POINT_TOKEN */ - { 23291, 0x00000009 }, /* GL_POLYGON */ - { 23302, 0x00000008 }, /* GL_POLYGON_BIT */ - { 23317, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 23333, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 23356, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 23381, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 23404, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 23427, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 23451, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 23475, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 23493, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 23516, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 23535, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 23558, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 23575, 0x00001203 }, /* GL_POSITION */ - { 23587, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 23619, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 23655, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 23688, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 23725, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 23756, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 23791, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 23823, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 23859, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 23892, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 23924, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 23960, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 23993, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 24030, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 24060, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 24094, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 24125, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 24160, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 24191, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 24226, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 24258, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 24294, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 24324, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 24358, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 24389, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 24424, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 24456, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 24487, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 24522, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 24554, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 24590, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 24619, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 24652, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 24682, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 24716, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 24755, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 24788, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 24828, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 24862, 0x00008578 }, /* GL_PREVIOUS */ - { 24874, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 24890, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 24906, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 24923, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 24944, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 24965, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 24998, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 25030, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 25053, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 25076, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 25106, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 25135, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 25163, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 25185, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 25213, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 25241, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 25263, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 25284, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 25324, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 25363, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 25393, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 25428, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 25461, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 25495, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 25534, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 25573, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 25595, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 25621, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 25645, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 25668, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 25690, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 25711, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 25732, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 25759, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 25791, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 25823, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 25858, 0x00001701 }, /* GL_PROJECTION */ - { 25872, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 25893, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 25919, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 25940, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 25959, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 25982, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 26021, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 26059, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 26079, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 26109, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 26133, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 26153, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 26183, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 26207, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 26227, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 26260, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 26286, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 26316, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 26347, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 26377, 0x00002003 }, /* GL_Q */ - { 26382, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 26407, 0x00000007 }, /* GL_QUADS */ - { 26416, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 26433, 0x00000008 }, /* GL_QUAD_STRIP */ - { 26447, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 26469, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 26495, 0x00008866 }, /* GL_QUERY_RESULT */ - { 26511, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 26531, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 26557, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 26587, 0x00002002 }, /* GL_R */ - { 26592, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 26604, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 26637, 0x00000C02 }, /* GL_READ_BUFFER */ - { 26652, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 26684, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 26708, 0x000088B8 }, /* GL_READ_ONLY */ - { 26721, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 26738, 0x000088BA }, /* GL_READ_WRITE */ - { 26752, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 26770, 0x00001903 }, /* GL_RED */ - { 26777, 0x00008016 }, /* GL_REDUCE */ - { 26787, 0x00008016 }, /* GL_REDUCE_EXT */ - { 26801, 0x00000D15 }, /* GL_RED_BIAS */ - { 26813, 0x00000D52 }, /* GL_RED_BITS */ - { 26825, 0x00000D14 }, /* GL_RED_SCALE */ - { 26838, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 26856, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 26878, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 26899, 0x00001C00 }, /* GL_RENDER */ - { 26909, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 26937, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 26957, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 26984, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 27020, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 27046, 0x00001F01 }, /* GL_RENDERER */ - { 27058, 0x00000C40 }, /* GL_RENDER_MODE */ - { 27073, 0x00002901 }, /* GL_REPEAT */ - { 27083, 0x00001E01 }, /* GL_REPLACE */ - { 27094, 0x00008062 }, /* GL_REPLACE_EXT */ - { 27109, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 27132, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 27150, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 27172, 0x00000102 }, /* GL_RETURN */ - { 27182, 0x00001907 }, /* GL_RGB */ - { 27189, 0x00008052 }, /* GL_RGB10 */ - { 27198, 0x00008059 }, /* GL_RGB10_A2 */ - { 27210, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 27226, 0x00008052 }, /* GL_RGB10_EXT */ - { 27239, 0x00008053 }, /* GL_RGB12 */ - { 27248, 0x00008053 }, /* GL_RGB12_EXT */ - { 27261, 0x00008054 }, /* GL_RGB16 */ - { 27270, 0x00008054 }, /* GL_RGB16_EXT */ - { 27283, 0x0000804E }, /* GL_RGB2_EXT */ - { 27295, 0x0000804F }, /* GL_RGB4 */ - { 27303, 0x0000804F }, /* GL_RGB4_EXT */ - { 27315, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 27328, 0x00008050 }, /* GL_RGB5 */ - { 27336, 0x00008057 }, /* GL_RGB5_A1 */ - { 27347, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 27362, 0x00008050 }, /* GL_RGB5_EXT */ - { 27374, 0x00008051 }, /* GL_RGB8 */ - { 27382, 0x00008051 }, /* GL_RGB8_EXT */ - { 27394, 0x00001908 }, /* GL_RGBA */ - { 27402, 0x0000805A }, /* GL_RGBA12 */ - { 27412, 0x0000805A }, /* GL_RGBA12_EXT */ - { 27426, 0x0000805B }, /* GL_RGBA16 */ - { 27436, 0x0000805B }, /* GL_RGBA16_EXT */ - { 27450, 0x00008055 }, /* GL_RGBA2 */ - { 27459, 0x00008055 }, /* GL_RGBA2_EXT */ - { 27472, 0x00008056 }, /* GL_RGBA4 */ - { 27481, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 27500, 0x00008056 }, /* GL_RGBA4_EXT */ - { 27513, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 27527, 0x00008058 }, /* GL_RGBA8 */ - { 27536, 0x00008058 }, /* GL_RGBA8_EXT */ - { 27549, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 27567, 0x00000C31 }, /* GL_RGBA_MODE */ - { 27580, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 27593, 0x000083A0 }, /* GL_RGB_S3TC */ - { 27605, 0x00008573 }, /* GL_RGB_SCALE */ - { 27618, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 27635, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 27652, 0x00000407 }, /* GL_RIGHT */ - { 27661, 0x00002000 }, /* GL_S */ - { 27666, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 27680, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 27701, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 27715, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 27736, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 27750, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 27766, 0x000080A9 }, /* GL_SAMPLES */ - { 27777, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 27793, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 27808, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 27826, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 27848, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 27876, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 27908, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 27931, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 27958, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 27976, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 27999, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 28021, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 28040, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 28063, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 28089, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 28119, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 28144, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 28173, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 28188, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 28203, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 28219, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 28244, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 28284, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 28328, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 28361, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 28391, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 28423, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 28453, 0x00001C02 }, /* GL_SELECT */ - { 28463, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 28491, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 28516, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 28532, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 28559, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 28590, 0x0000150F }, /* GL_SET */ - { 28597, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 28618, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 28642, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 28657, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 28672, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 28700, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 28723, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 28753, 0x00001601 }, /* GL_SHININESS */ - { 28766, 0x00001402 }, /* GL_SHORT */ - { 28775, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 28791, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 28811, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 28830, 0x00001D01 }, /* GL_SMOOTH */ - { 28840, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 28873, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 28900, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 28933, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 28960, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 28977, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 28998, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 29019, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 29034, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 29053, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 29072, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 29089, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 29110, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 29131, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 29146, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 29165, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 29184, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 29201, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 29222, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 29243, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 29258, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 29277, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 29296, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 29316, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 29334, 0x00001202 }, /* GL_SPECULAR */ - { 29346, 0x00002402 }, /* GL_SPHERE_MAP */ - { 29360, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 29375, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 29393, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 29410, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 29424, 0x00008580 }, /* GL_SRC0_RGB */ - { 29436, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 29450, 0x00008581 }, /* GL_SRC1_RGB */ - { 29462, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 29476, 0x00008582 }, /* GL_SRC2_RGB */ - { 29488, 0x00000302 }, /* GL_SRC_ALPHA */ - { 29501, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 29523, 0x00000300 }, /* GL_SRC_COLOR */ - { 29536, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 29554, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 29573, 0x000088E6 }, /* GL_STATIC_COPY */ - { 29588, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 29607, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 29622, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 29641, 0x000088E5 }, /* GL_STATIC_READ */ - { 29656, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 29675, 0x00001802 }, /* GL_STENCIL */ - { 29686, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 29712, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 29733, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 29758, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 29779, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 29804, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 29836, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 29872, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 29904, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 29940, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 29960, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 29987, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 30013, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 30029, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 30051, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 30074, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 30090, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 30106, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 30123, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 30146, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 30168, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 30190, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 30212, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 30233, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 30260, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 30287, 0x00000B97 }, /* GL_STENCIL_REF */ - { 30302, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 30318, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 30347, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 30369, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 30390, 0x00000C33 }, /* GL_STEREO */ - { 30400, 0x000088E2 }, /* GL_STREAM_COPY */ - { 30415, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 30434, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 30449, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 30468, 0x000088E1 }, /* GL_STREAM_READ */ - { 30483, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 30502, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 30519, 0x000084E7 }, /* GL_SUBTRACT */ - { 30531, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 30547, 0x00002001 }, /* GL_T */ - { 30552, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 30567, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 30586, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 30602, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 30617, 0x00002A27 }, /* GL_T2F_V3F */ - { 30628, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 30647, 0x00002A28 }, /* GL_T4F_V4F */ - { 30658, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 30681, 0x00001702 }, /* GL_TEXTURE */ - { 30692, 0x000084C0 }, /* GL_TEXTURE0 */ - { 30704, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 30720, 0x000084C1 }, /* GL_TEXTURE1 */ - { 30732, 0x000084CA }, /* GL_TEXTURE10 */ - { 30745, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 30762, 0x000084CB }, /* GL_TEXTURE11 */ - { 30775, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 30792, 0x000084CC }, /* GL_TEXTURE12 */ - { 30805, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 30822, 0x000084CD }, /* GL_TEXTURE13 */ - { 30835, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 30852, 0x000084CE }, /* GL_TEXTURE14 */ - { 30865, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 30882, 0x000084CF }, /* GL_TEXTURE15 */ - { 30895, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 30912, 0x000084D0 }, /* GL_TEXTURE16 */ - { 30925, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 30942, 0x000084D1 }, /* GL_TEXTURE17 */ - { 30955, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 30972, 0x000084D2 }, /* GL_TEXTURE18 */ - { 30985, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 31002, 0x000084D3 }, /* GL_TEXTURE19 */ - { 31015, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 31032, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 31048, 0x000084C2 }, /* GL_TEXTURE2 */ - { 31060, 0x000084D4 }, /* GL_TEXTURE20 */ - { 31073, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 31090, 0x000084D5 }, /* GL_TEXTURE21 */ - { 31103, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 31120, 0x000084D6 }, /* GL_TEXTURE22 */ - { 31133, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 31150, 0x000084D7 }, /* GL_TEXTURE23 */ - { 31163, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 31180, 0x000084D8 }, /* GL_TEXTURE24 */ - { 31193, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 31210, 0x000084D9 }, /* GL_TEXTURE25 */ - { 31223, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 31240, 0x000084DA }, /* GL_TEXTURE26 */ - { 31253, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 31270, 0x000084DB }, /* GL_TEXTURE27 */ - { 31283, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 31300, 0x000084DC }, /* GL_TEXTURE28 */ - { 31313, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 31330, 0x000084DD }, /* GL_TEXTURE29 */ - { 31343, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 31360, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 31376, 0x000084C3 }, /* GL_TEXTURE3 */ - { 31388, 0x000084DE }, /* GL_TEXTURE30 */ - { 31401, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 31418, 0x000084DF }, /* GL_TEXTURE31 */ - { 31431, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 31448, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 31464, 0x000084C4 }, /* GL_TEXTURE4 */ - { 31476, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 31492, 0x000084C5 }, /* GL_TEXTURE5 */ - { 31504, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 31520, 0x000084C6 }, /* GL_TEXTURE6 */ - { 31532, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 31548, 0x000084C7 }, /* GL_TEXTURE7 */ - { 31560, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 31576, 0x000084C8 }, /* GL_TEXTURE8 */ - { 31588, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 31604, 0x000084C9 }, /* GL_TEXTURE9 */ - { 31616, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 31632, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 31646, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 31670, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 31684, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 31708, 0x0000806F }, /* GL_TEXTURE_3D */ - { 31722, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 31744, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 31770, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 31792, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 31814, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 31846, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 31868, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 31900, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 31922, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 31950, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 31982, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 32015, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 32047, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 32062, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 32083, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 32108, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 32126, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 32150, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 32181, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 32211, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 32241, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 32276, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 32307, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 32345, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 32372, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 32404, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 32438, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 32462, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 32490, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 32514, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 32542, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 32575, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 32599, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 32621, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 32643, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 32669, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 32703, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 32736, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 32773, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 32801, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 32833, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 32856, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 32894, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 32936, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 32967, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 32995, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 33025, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 33053, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 33073, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 33097, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 33128, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 33163, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 33194, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 33229, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 33260, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 33295, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 33326, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 33361, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 33392, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 33427, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 33458, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 33493, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 33510, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 33532, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 33558, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 33573, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 33594, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 33614, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 33640, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 33660, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 33677, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 33694, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 33711, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 33728, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 33753, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 33775, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 33801, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 33819, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 33845, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 33871, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 33901, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 33928, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 33953, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 33973, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 33997, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 34024, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 34051, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 34078, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 34104, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 34134, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 34156, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 34174, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 34204, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 34232, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 34260, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 34288, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 34309, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 34328, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 34350, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 34369, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 34389, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 34414, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 34438, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 34458, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 34482, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 34502, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 34525, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 34550, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 34584, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 34601, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 34619, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 34637, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 34655, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 34675, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 34694, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 34723, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 34740, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 34766, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 34796, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 34828, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 34858, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 34892, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 34908, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 34939, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 34974, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 35002, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 35034, 0x00000004 }, /* GL_TRIANGLES */ - { 35047, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 35063, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 35084, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 35102, 0x00000001 }, /* GL_TRUE */ - { 35110, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 35130, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 35153, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 35173, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 35194, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 35216, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 35238, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 35258, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 35279, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 35296, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 35323, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 35346, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 35362, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 35389, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 35413, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 35444, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 35468, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 35496, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 35514, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 35544, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 35570, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 35600, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 35626, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 35650, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 35678, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 35706, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 35733, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 35765, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 35796, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 35810, 0x00002A20 }, /* GL_V2F */ - { 35817, 0x00002A21 }, /* GL_V3F */ - { 35824, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 35843, 0x00001F00 }, /* GL_VENDOR */ - { 35853, 0x00001F02 }, /* GL_VERSION */ - { 35864, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 35880, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 35910, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 35941, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 35976, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 36000, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 36021, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 36044, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 36065, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 36092, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 36120, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 36148, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 36176, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 36204, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 36232, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 36260, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 36287, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 36314, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 36341, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 36368, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 36395, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 36422, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 36449, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 36476, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 36503, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 36541, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 36583, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 36614, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 36649, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 36683, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 36721, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 36752, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 36787, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 36815, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 36847, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 36877, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 36911, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 36939, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 36971, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 36991, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 37013, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 37042, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 37063, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 37092, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 37125, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 37157, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 37184, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 37215, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 37245, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 37262, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 37283, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 37310, 0x00000BA2 }, /* GL_VIEWPORT */ - { 37322, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 37338, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 37358, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 37389, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 37424, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 37452, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 37477, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 37504, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 37529, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 37553, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 37572, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 37586, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 37604, 0x00001506 }, /* GL_XOR */ - { 37611, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 37630, 0x00008757 }, /* GL_YCBCR_MESA */ - { 37644, 0x00000000 }, /* GL_ZERO */ - { 37652, 0x00000D16 }, /* GL_ZOOM_X */ - { 37662, 0x00000D17 }, /* GL_ZOOM_Y */ + { 877, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING */ + { 901, 0x00008894 }, /* GL_ARRAY_BUFFER_BINDING_ARB */ + { 929, 0x00008B85 }, /* GL_ATTACHED_SHADERS */ + { 949, 0x00008645 }, /* GL_ATTRIB_ARRAY_POINTER_NV */ + { 976, 0x00008623 }, /* GL_ATTRIB_ARRAY_SIZE_NV */ + { 1000, 0x00008624 }, /* GL_ATTRIB_ARRAY_STRIDE_NV */ + { 1026, 0x00008625 }, /* GL_ATTRIB_ARRAY_TYPE_NV */ + { 1050, 0x00000BB0 }, /* GL_ATTRIB_STACK_DEPTH */ + { 1072, 0x00000D80 }, /* GL_AUTO_NORMAL */ + { 1087, 0x00000409 }, /* GL_AUX0 */ + { 1095, 0x0000040A }, /* GL_AUX1 */ + { 1103, 0x0000040B }, /* GL_AUX2 */ + { 1111, 0x0000040C }, /* GL_AUX3 */ + { 1119, 0x00000C00 }, /* GL_AUX_BUFFERS */ + { 1134, 0x00000405 }, /* GL_BACK */ + { 1142, 0x00000402 }, /* GL_BACK_LEFT */ + { 1155, 0x00000403 }, /* GL_BACK_RIGHT */ + { 1169, 0x000080E0 }, /* GL_BGR */ + { 1176, 0x000080E1 }, /* GL_BGRA */ + { 1184, 0x00001A00 }, /* GL_BITMAP */ + { 1194, 0x00000704 }, /* GL_BITMAP_TOKEN */ + { 1210, 0x00000BE2 }, /* GL_BLEND */ + { 1219, 0x00008005 }, /* GL_BLEND_COLOR */ + { 1234, 0x00008005 }, /* GL_BLEND_COLOR_EXT */ + { 1253, 0x00000BE0 }, /* GL_BLEND_DST */ + { 1266, 0x000080CA }, /* GL_BLEND_DST_ALPHA */ + { 1285, 0x000080C8 }, /* GL_BLEND_DST_RGB */ + { 1302, 0x00008009 }, /* GL_BLEND_EQUATION */ + { 1320, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */ + { 1344, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */ + { 1372, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */ + { 1394, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ + { 1420, 0x00000BE1 }, /* GL_BLEND_SRC */ + { 1433, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ + { 1452, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ + { 1469, 0x00001905 }, /* GL_BLUE */ + { 1477, 0x00000D1B }, /* GL_BLUE_BIAS */ + { 1490, 0x00000D54 }, /* GL_BLUE_BITS */ + { 1503, 0x00000D1A }, /* GL_BLUE_SCALE */ + { 1517, 0x00008B56 }, /* GL_BOOL */ + { 1525, 0x00008B56 }, /* GL_BOOL_ARB */ + { 1537, 0x00008B57 }, /* GL_BOOL_VEC2 */ + { 1550, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ + { 1567, 0x00008B58 }, /* GL_BOOL_VEC3 */ + { 1580, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ + { 1597, 0x00008B59 }, /* GL_BOOL_VEC4 */ + { 1610, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ + { 1627, 0x000088BB }, /* GL_BUFFER_ACCESS */ + { 1644, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ + { 1665, 0x000088BC }, /* GL_BUFFER_MAPPED */ + { 1682, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ + { 1703, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ + { 1725, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ + { 1751, 0x00008764 }, /* GL_BUFFER_SIZE */ + { 1766, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ + { 1785, 0x00008765 }, /* GL_BUFFER_USAGE */ + { 1801, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ + { 1821, 0x00001400 }, /* GL_BYTE */ + { 1829, 0x00002A24 }, /* GL_C3F_V3F */ + { 1840, 0x00002A26 }, /* GL_C4F_N3F_V3F */ + { 1855, 0x00002A22 }, /* GL_C4UB_V2F */ + { 1867, 0x00002A23 }, /* GL_C4UB_V3F */ + { 1879, 0x00000901 }, /* GL_CCW */ + { 1886, 0x00002900 }, /* GL_CLAMP */ + { 1895, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ + { 1914, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ + { 1937, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ + { 1961, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ + { 1978, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ + { 2000, 0x00001500 }, /* GL_CLEAR */ + { 2009, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ + { 2034, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ + { 2063, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ + { 2089, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + { 2118, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ + { 2144, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ + { 2171, 0x00003000 }, /* GL_CLIP_PLANE0 */ + { 2186, 0x00003001 }, /* GL_CLIP_PLANE1 */ + { 2201, 0x00003002 }, /* GL_CLIP_PLANE2 */ + { 2216, 0x00003003 }, /* GL_CLIP_PLANE3 */ + { 2231, 0x00003004 }, /* GL_CLIP_PLANE4 */ + { 2246, 0x00003005 }, /* GL_CLIP_PLANE5 */ + { 2261, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + { 2294, 0x00000A00 }, /* GL_COEFF */ + { 2303, 0x00001800 }, /* GL_COLOR */ + { 2312, 0x00008076 }, /* GL_COLOR_ARRAY */ + { 2327, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + { 2357, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 2391, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ + { 2414, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ + { 2434, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ + { 2456, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ + { 2476, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */ + { 2497, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ + { 2522, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */ + { 2543, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */ + { 2565, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ + { 2591, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */ + { 2613, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ + { 2639, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */ + { 2661, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ + { 2687, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */ + { 2709, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ + { 2735, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */ + { 2757, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ + { 2783, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */ + { 2805, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ + { 2831, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ + { 2856, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */ + { 2877, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ + { 2902, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */ + { 2923, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ + { 2948, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */ + { 2969, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ + { 2994, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */ + { 3015, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ + { 3040, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */ + { 3061, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ + { 3086, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */ + { 3107, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ + { 3132, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */ + { 3153, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ + { 3178, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */ + { 3199, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ + { 3224, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ + { 3244, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ + { 3265, 0x00001900 }, /* GL_COLOR_INDEX */ + { 3280, 0x00001603 }, /* GL_COLOR_INDEXES */ + { 3297, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ + { 3315, 0x00000B57 }, /* GL_COLOR_MATERIAL */ + { 3333, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ + { 3356, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ + { 3384, 0x000080B1 }, /* GL_COLOR_MATRIX */ + { 3400, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ + { 3420, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ + { 3448, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 3480, 0x00008458 }, /* GL_COLOR_SUM */ + { 3493, 0x00008458 }, /* GL_COLOR_SUM_ARB */ + { 3510, 0x000080D0 }, /* GL_COLOR_TABLE */ + { 3525, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ + { 3551, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ + { 3581, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ + { 3611, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ + { 3631, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ + { 3655, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ + { 3680, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ + { 3709, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ + { 3738, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ + { 3760, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ + { 3786, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ + { 3812, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ + { 3838, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ + { 3868, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ + { 3898, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + { 3928, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ + { 3962, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ + { 3996, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + { 4026, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ + { 4060, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ + { 4094, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ + { 4118, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ + { 4146, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ + { 4174, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ + { 4195, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ + { 4220, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ + { 4241, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ + { 4266, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ + { 4291, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ + { 4310, 0x00008570 }, /* GL_COMBINE */ + { 4321, 0x00008503 }, /* GL_COMBINE4 */ + { 4333, 0x00008572 }, /* GL_COMBINE_ALPHA */ + { 4350, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ + { 4371, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ + { 4392, 0x00008570 }, /* GL_COMBINE_ARB */ + { 4407, 0x00008570 }, /* GL_COMBINE_EXT */ + { 4422, 0x00008571 }, /* GL_COMBINE_RGB */ + { 4437, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ + { 4456, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ + { 4475, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ + { 4511, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ + { 4535, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ + { 4563, 0x00001300 }, /* GL_COMPILE */ + { 4574, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ + { 4597, 0x00008B81 }, /* GL_COMPILE_STATUS */ + { 4615, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ + { 4635, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ + { 4659, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ + { 4683, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ + { 4711, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ + { 4735, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + { 4765, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ + { 4799, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ + { 4827, 0x000084ED }, /* GL_COMPRESSED_RGB */ + { 4845, 0x000084EE }, /* GL_COMPRESSED_RGBA */ + { 4864, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ + { 4887, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + { 4916, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + { 4949, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + { 4982, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + { 5015, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ + { 5037, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + { 5065, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + { 5097, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ + { 5127, 0x00008576 }, /* GL_CONSTANT */ + { 5139, 0x00008003 }, /* GL_CONSTANT_ALPHA */ + { 5157, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ + { 5179, 0x00008576 }, /* GL_CONSTANT_ARB */ + { 5195, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ + { 5219, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ + { 5241, 0x00008001 }, /* GL_CONSTANT_COLOR */ + { 5259, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ + { 5281, 0x00008576 }, /* GL_CONSTANT_EXT */ + { 5297, 0x00008010 }, /* GL_CONVOLUTION_1D */ + { 5315, 0x00008011 }, /* GL_CONVOLUTION_2D */ + { 5333, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ + { 5361, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ + { 5392, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ + { 5419, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ + { 5450, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ + { 5477, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ + { 5508, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ + { 5536, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ + { 5568, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ + { 5590, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ + { 5616, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ + { 5638, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ + { 5664, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ + { 5685, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ + { 5710, 0x00008862 }, /* GL_COORD_REPLACE */ + { 5727, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ + { 5748, 0x00008862 }, /* GL_COORD_REPLACE_NV */ + { 5768, 0x00001503 }, /* GL_COPY */ + { 5776, 0x0000150C }, /* GL_COPY_INVERTED */ + { 5793, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ + { 5813, 0x00000B44 }, /* GL_CULL_FACE */ + { 5826, 0x00000B45 }, /* GL_CULL_FACE_MODE */ + { 5844, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ + { 5863, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + { 5895, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + { 5930, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ + { 5951, 0x00000001 }, /* GL_CURRENT_BIT */ + { 5966, 0x00000B00 }, /* GL_CURRENT_COLOR */ + { 5983, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ + { 6004, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ + { 6030, 0x00000B01 }, /* GL_CURRENT_INDEX */ + { 6047, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ + { 6069, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ + { 6097, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ + { 6118, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + { 6152, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ + { 6185, 0x00000B02 }, /* GL_CURRENT_NORMAL */ + { 6203, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + { 6233, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ + { 6252, 0x00008865 }, /* GL_CURRENT_QUERY */ + { 6269, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ + { 6290, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ + { 6314, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ + { 6341, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ + { 6365, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ + { 6392, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ + { 6425, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + { 6458, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ + { 6485, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ + { 6511, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ + { 6536, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ + { 6565, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ + { 6587, 0x00000900 }, /* GL_CW */ + { 6593, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ + { 6614, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ + { 6635, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ + { 6655, 0x00002101 }, /* GL_DECAL */ + { 6664, 0x00001E03 }, /* GL_DECR */ + { 6672, 0x00008508 }, /* GL_DECR_WRAP */ + { 6685, 0x00008508 }, /* GL_DECR_WRAP_EXT */ + { 6702, 0x00008B80 }, /* GL_DELETE_STATUS */ + { 6719, 0x00001801 }, /* GL_DEPTH */ + { 6728, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ + { 6748, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ + { 6768, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 6792, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 6806, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 6820, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 6840, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 6865, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 6885, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 6903, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 6924, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 6943, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 6964, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 6989, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7015, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7036, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7061, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7087, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7108, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7133, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7159, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7173, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7188, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7203, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7220, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7248, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7268, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7296, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7324, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7338, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7360, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7386, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7405, 0x00001201 }, /* GL_DIFFUSE */ + { 7416, 0x00000BD0 }, /* GL_DITHER */ + { 7426, 0x00000A02 }, /* GL_DOMAIN */ + { 7436, 0x00001100 }, /* GL_DONT_CARE */ + { 7449, 0x000086AE }, /* GL_DOT3_RGB */ + { 7461, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7474, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7491, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 7508, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 7524, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 7540, 0x0000140A }, /* GL_DOUBLE */ + { 7550, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 7566, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 7581, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 7597, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 7617, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 7637, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 7653, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 7670, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 7691, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 7712, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 7729, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 7750, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 7771, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 7788, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 7809, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 7830, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 7847, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 7868, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 7889, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 7906, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 7927, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 7948, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 7965, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 7986, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8007, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8027, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8047, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8063, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8083, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8103, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8119, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8139, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8159, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8175, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8195, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8215, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8231, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8251, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8271, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8287, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8307, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8327, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8343, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8363, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8383, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8399, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8419, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8439, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8455, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8475, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8495, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 8515, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 8547, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 8571, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 8591, 0x00000304 }, /* GL_DST_ALPHA */ + { 8604, 0x00000306 }, /* GL_DST_COLOR */ + { 8617, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 8633, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 8653, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 8669, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 8689, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 8705, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 8725, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 8738, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 8757, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 8791, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 8829, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 8856, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 8882, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 8906, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 8938, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 8974, 0x00001600 }, /* GL_EMISSION */ + { 8986, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9000, 0x00000202 }, /* GL_EQUAL */ + { 9009, 0x00001509 }, /* GL_EQUIV */ + { 9018, 0x00010000 }, /* GL_EVAL_BIT */ + { 9030, 0x00000800 }, /* GL_EXP */ + { 9037, 0x00000801 }, /* GL_EXP2 */ + { 9045, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9059, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9073, 0x00002502 }, /* GL_EYE_PLANE */ + { 9086, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9111, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9128, 0x00000000 }, /* GL_FALSE */ + { 9137, 0x00001101 }, /* GL_FASTEST */ + { 9148, 0x00001C01 }, /* GL_FEEDBACK */ + { 9160, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9187, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9211, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9235, 0x00001B02 }, /* GL_FILL */ + { 9243, 0x00001D00 }, /* GL_FLAT */ + { 9251, 0x00001406 }, /* GL_FLOAT */ + { 9260, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9274, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9292, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9306, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9324, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 9338, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 9356, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 9370, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 9388, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 9402, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 9420, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 9434, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 9452, 0x00000B60 }, /* GL_FOG */ + { 9459, 0x00000080 }, /* GL_FOG_BIT */ + { 9470, 0x00000B66 }, /* GL_FOG_COLOR */ + { 9483, 0x00008451 }, /* GL_FOG_COORD */ + { 9496, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 9514, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 9538, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 9577, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 9620, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 9652, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 9683, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 9712, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 9737, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 9756, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 9790, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 9817, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 9843, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 9867, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 9884, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 9899, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 9923, 0x00000B64 }, /* GL_FOG_END */ + { 9934, 0x00000C54 }, /* GL_FOG_HINT */ + { 9946, 0x00000B61 }, /* GL_FOG_INDEX */ + { 9959, 0x00000B65 }, /* GL_FOG_MODE */ + { 9971, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 9990, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10015, 0x00000B63 }, /* GL_FOG_START */ + { 10028, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10046, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10070, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10089, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10112, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10147, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10162, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10199, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10235, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10276, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 10317, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 10354, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 10391, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 10429, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 10471, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 10509, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 10551, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 10586, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 10625, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 10674, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 10722, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 10774, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 10814, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 10858, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 10898, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 10942, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 10969, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 10993, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11021, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11044, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11063, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11100, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11141, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11182, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11224, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 11275, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 11313, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 11358, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 11407, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 11445, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 11487, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 11519, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 11544, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 11571, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 11602, 0x00000404 }, /* GL_FRONT */ + { 11611, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 11629, 0x00000B46 }, /* GL_FRONT_FACE */ + { 11643, 0x00000400 }, /* GL_FRONT_LEFT */ + { 11657, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 11672, 0x00008006 }, /* GL_FUNC_ADD */ + { 11684, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 11700, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 11725, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 11754, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 11771, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 11792, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 11811, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 11835, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 11864, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 11888, 0x00000206 }, /* GL_GEQUAL */ + { 11898, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ + { 11923, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ + { 11951, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + { 11985, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ + { 12007, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + { 12035, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + { 12072, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ + { 12091, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ + { 12110, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ + { 12129, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ + { 12148, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ + { 12167, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ + { 12186, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ + { 12210, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + { 12242, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ + { 12268, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 12302, 0x00008C46 }, /* GL_GL_SLUMINANCE */ + { 12319, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ + { 12337, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ + { 12362, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ + { 12385, 0x00008C40 }, /* GL_GL_SRGB */ + { 12396, 0x00008C41 }, /* GL_GL_SRGB8 */ + { 12408, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ + { 12427, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ + { 12444, 0x00000204 }, /* GL_GREATER */ + { 12455, 0x00001904 }, /* GL_GREEN */ + { 12464, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12478, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12492, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12507, 0x00008000 }, /* GL_HINT_BIT */ + { 12519, 0x00008024 }, /* GL_HISTOGRAM */ + { 12532, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12556, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12584, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12607, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12634, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12651, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12671, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 12695, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 12719, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 12747, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 12775, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 12807, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 12829, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 12855, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 12873, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 12895, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 12914, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 12937, 0x0000862A }, /* GL_IDENTITY_NV */ + { 12952, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 12972, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13012, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13050, 0x00001E02 }, /* GL_INCR */ + { 13058, 0x00008507 }, /* GL_INCR_WRAP */ + { 13071, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13088, 0x00008222 }, /* GL_INDEX */ + { 13097, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13112, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13142, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13176, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13199, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13221, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13241, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13255, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13276, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13294, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13308, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13324, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13339, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13358, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13377, 0x00001404 }, /* GL_INT */ + { 13384, 0x00008049 }, /* GL_INTENSITY */ + { 13397, 0x0000804C }, /* GL_INTENSITY12 */ + { 13412, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13431, 0x0000804D }, /* GL_INTENSITY16 */ + { 13446, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13465, 0x0000804A }, /* GL_INTENSITY4 */ + { 13479, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13497, 0x0000804B }, /* GL_INTENSITY8 */ + { 13511, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13529, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13546, 0x00008575 }, /* GL_INTERPOLATE */ + { 13561, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13580, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13599, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13611, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13627, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13639, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13655, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13667, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13683, 0x00000500 }, /* GL_INVALID_ENUM */ + { 13699, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 13732, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 13769, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 13790, 0x00000501 }, /* GL_INVALID_VALUE */ + { 13807, 0x0000862B }, /* GL_INVERSE_NV */ + { 13821, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 13845, 0x0000150A }, /* GL_INVERT */ + { 13855, 0x00001E00 }, /* GL_KEEP */ + { 13863, 0x00000406 }, /* GL_LEFT */ + { 13871, 0x00000203 }, /* GL_LEQUAL */ + { 13881, 0x00000201 }, /* GL_LESS */ + { 13889, 0x00004000 }, /* GL_LIGHT0 */ + { 13899, 0x00004001 }, /* GL_LIGHT1 */ + { 13909, 0x00004002 }, /* GL_LIGHT2 */ + { 13919, 0x00004003 }, /* GL_LIGHT3 */ + { 13929, 0x00004004 }, /* GL_LIGHT4 */ + { 13939, 0x00004005 }, /* GL_LIGHT5 */ + { 13949, 0x00004006 }, /* GL_LIGHT6 */ + { 13959, 0x00004007 }, /* GL_LIGHT7 */ + { 13969, 0x00000B50 }, /* GL_LIGHTING */ + { 13981, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 13997, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14020, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14049, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14082, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14110, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14134, 0x00001B01 }, /* GL_LINE */ + { 14142, 0x00002601 }, /* GL_LINEAR */ + { 14152, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14174, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14204, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14235, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14259, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14284, 0x00000001 }, /* GL_LINES */ + { 14293, 0x00000004 }, /* GL_LINE_BIT */ + { 14305, 0x00000002 }, /* GL_LINE_LOOP */ + { 14318, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14338, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14353, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14373, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14389, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14413, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14436, 0x00000003 }, /* GL_LINE_STRIP */ + { 14450, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14464, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14478, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14504, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14524, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14539, 0x00000B32 }, /* GL_LIST_BASE */ + { 14552, 0x00020000 }, /* GL_LIST_BIT */ + { 14564, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14578, 0x00000B30 }, /* GL_LIST_MODE */ + { 14591, 0x00000101 }, /* GL_LOAD */ + { 14599, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14611, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14628, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 14642, 0x00001909 }, /* GL_LUMINANCE */ + { 14655, 0x00008041 }, /* GL_LUMINANCE12 */ + { 14670, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 14693, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 14720, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 14742, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 14768, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 14787, 0x00008042 }, /* GL_LUMINANCE16 */ + { 14802, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 14825, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 14852, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 14871, 0x0000803F }, /* GL_LUMINANCE4 */ + { 14885, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 14906, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 14931, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 14949, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 14970, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 14995, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15009, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15030, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15055, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15073, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15092, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15108, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15128, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15150, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15164, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15179, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15203, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15227, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15251, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15275, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15292, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15309, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15337, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15366, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15395, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15424, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15453, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15482, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15511, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15539, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15567, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15595, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15623, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 15651, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 15679, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 15707, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 15735, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 15763, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 15779, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 15799, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 15821, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 15835, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 15850, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 15874, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 15898, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 15922, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 15946, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 15963, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 15980, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16008, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16037, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16066, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16095, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16124, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16153, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16182, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16210, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16238, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16266, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16294, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16322, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16350, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16378, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16406, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16434, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16447, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16462, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16477, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16491, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 16507, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 16523, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 16539, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 16555, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 16571, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 16587, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 16603, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 16619, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 16635, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 16651, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 16666, 0x00008631 }, /* GL_MATRIX1_NV */ + { 16680, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 16696, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 16712, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 16728, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 16744, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 16760, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 16776, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 16792, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 16808, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 16824, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 16840, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 16855, 0x00008632 }, /* GL_MATRIX2_NV */ + { 16869, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 16885, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 16901, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 16916, 0x00008633 }, /* GL_MATRIX3_NV */ + { 16930, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 16945, 0x00008634 }, /* GL_MATRIX4_NV */ + { 16959, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 16974, 0x00008635 }, /* GL_MATRIX5_NV */ + { 16988, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17003, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17017, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17032, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17046, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17061, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17076, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17102, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17136, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17167, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17200, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17231, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17246, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17268, 0x00008008 }, /* GL_MAX */ + { 17275, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17298, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17330, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17356, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17389, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17415, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17449, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17468, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 17497, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 17529, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 17565, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 17601, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 17641, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 17667, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 17697, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 17722, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 17751, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 17780, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 17813, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 17833, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 17857, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 17881, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 17905, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 17930, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 17948, 0x00008008 }, /* GL_MAX_EXT */ + { 17959, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 17994, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18033, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18047, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18067, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18105, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18134, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18158, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18186, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18209, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18246, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18282, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18309, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18338, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18372, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18408, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18435, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18467, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 18503, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 18532, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 18561, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 18589, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 18627, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 18671, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 18714, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 18748, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 18787, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 18824, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 18862, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 18905, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 18948, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 18978, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19009, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19045, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19081, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19111, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19145, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19178, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19207, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19222, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19242, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19266, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19288, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19314, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19341, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19372, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19396, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 19430, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 19450, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 19477, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 19498, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 19523, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 19548, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 19583, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 19605, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 19631, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19653, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 19679, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 19713, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 19751, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 19784, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 19821, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 19845, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 19866, 0x00008007 }, /* GL_MIN */ + { 19873, 0x0000802E }, /* GL_MINMAX */ + { 19883, 0x0000802E }, /* GL_MINMAX_EXT */ + { 19897, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 19914, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 19935, 0x00008030 }, /* GL_MINMAX_SINK */ + { 19950, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 19969, 0x00008007 }, /* GL_MIN_EXT */ + { 19980, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 19999, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20022, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20045, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20065, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20085, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20115, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20143, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20171, 0x00001700 }, /* GL_MODELVIEW */ + { 20184, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20202, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20221, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20240, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20259, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20278, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20297, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20316, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20335, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20354, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20373, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20392, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 20410, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 20429, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 20448, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 20467, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 20486, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 20505, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 20524, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 20543, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 20562, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 20581, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 20600, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 20618, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 20637, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 20656, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 20674, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 20692, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 20710, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 20728, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 20746, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 20764, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 20782, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 20802, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 20829, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 20854, 0x00002100 }, /* GL_MODULATE */ + { 20866, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 20886, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 20913, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 20938, 0x00000103 }, /* GL_MULT */ + { 20946, 0x0000809D }, /* GL_MULTISAMPLE */ + { 20961, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 20981, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21000, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21019, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21043, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21066, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21096, 0x00002A25 }, /* GL_N3F_V3F */ + { 21107, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21127, 0x0000150E }, /* GL_NAND */ + { 21135, 0x00002600 }, /* GL_NEAREST */ + { 21146, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21177, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21209, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21234, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21260, 0x00000200 }, /* GL_NEVER */ + { 21269, 0x00001102 }, /* GL_NICEST */ + { 21279, 0x00000000 }, /* GL_NONE */ + { 21287, 0x00001505 }, /* GL_NOOP */ + { 21295, 0x00001508 }, /* GL_NOR */ + { 21302, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21315, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21331, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21362, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21397, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 21421, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 21444, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 21465, 0x00008511 }, /* GL_NORMAL_MAP */ + { 21479, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 21497, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 21514, 0x00000205 }, /* GL_NOTEQUAL */ + { 21526, 0x00000000 }, /* GL_NO_ERROR */ + { 21538, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 21572, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 21610, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 21642, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 21684, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 21714, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 21754, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 21785, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 21814, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 21842, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 21872, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 21889, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 21915, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 21931, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 21966, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 21988, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22007, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22037, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22058, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22086, 0x00000001 }, /* GL_ONE */ + { 22093, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22121, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22153, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22181, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22213, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22236, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22259, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22282, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22305, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22323, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22345, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22367, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22383, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 22403, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 22423, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 22441, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 22463, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 22485, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 22501, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 22521, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 22541, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 22559, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 22581, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 22603, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 22619, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 22639, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 22659, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 22680, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 22699, 0x00001507 }, /* GL_OR */ + { 22705, 0x00000A01 }, /* GL_ORDER */ + { 22714, 0x0000150D }, /* GL_OR_INVERTED */ + { 22729, 0x0000150B }, /* GL_OR_REVERSE */ + { 22743, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 22760, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 22778, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 22799, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 22819, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 22837, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 22856, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 22876, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 22896, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 22914, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 22933, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 22958, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 22982, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23003, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23025, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23047, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23072, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23096, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23117, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23139, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23161, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23183, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23214, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23234, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23259, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23279, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23304, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23324, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23349, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23369, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 23394, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 23414, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 23439, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 23459, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 23484, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 23504, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 23529, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 23549, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 23574, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 23594, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 23619, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 23639, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 23664, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 23682, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 23715, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 23740, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 23775, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 23802, 0x00001B00 }, /* GL_POINT */ + { 23811, 0x00000000 }, /* GL_POINTS */ + { 23821, 0x00000002 }, /* GL_POINT_BIT */ + { 23834, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 23864, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 23898, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 23932, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 23967, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 23996, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24029, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24062, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24096, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24110, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24136, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24154, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24176, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24198, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24221, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24239, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24261, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 24283, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 24306, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 24326, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 24342, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 24363, 0x00008861 }, /* GL_POINT_SPRITE */ + { 24379, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 24399, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 24428, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 24447, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 24473, 0x00000701 }, /* GL_POINT_TOKEN */ + { 24488, 0x00000009 }, /* GL_POLYGON */ + { 24499, 0x00000008 }, /* GL_POLYGON_BIT */ + { 24514, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 24530, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 24553, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 24578, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 24601, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 24624, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 24648, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 24672, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 24690, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 24713, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 24732, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 24755, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 24772, 0x00001203 }, /* GL_POSITION */ + { 24784, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 24816, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 24852, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 24885, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 24922, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 24953, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 24988, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25020, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25056, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25089, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25121, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25157, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25190, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25227, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25257, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 25291, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 25322, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 25357, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 25388, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 25423, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 25455, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 25491, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 25521, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 25555, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 25586, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 25621, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 25653, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 25684, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 25719, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 25751, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 25787, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 25816, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 25849, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 25879, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 25913, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 25952, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 25985, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26025, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26059, 0x00008578 }, /* GL_PREVIOUS */ + { 26071, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26087, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26103, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26120, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26141, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26162, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26195, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26227, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26250, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26273, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 26303, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 26332, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 26360, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 26382, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 26410, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 26438, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 26460, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 26481, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 26521, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 26560, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 26590, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 26625, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 26658, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 26692, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 26731, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 26770, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 26792, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 26818, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 26842, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 26865, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 26887, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 26908, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 26929, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 26956, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 26988, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27020, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27055, 0x00001701 }, /* GL_PROJECTION */ + { 27069, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27090, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27116, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27137, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27156, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27179, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27218, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 27256, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 27276, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 27306, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 27330, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 27350, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 27380, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 27404, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 27424, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 27457, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 27483, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 27513, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 27544, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 27574, 0x00002003 }, /* GL_Q */ + { 27579, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 27604, 0x00000007 }, /* GL_QUADS */ + { 27613, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 27630, 0x00000008 }, /* GL_QUAD_STRIP */ + { 27644, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 27666, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 27692, 0x00008866 }, /* GL_QUERY_RESULT */ + { 27708, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 27728, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 27754, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 27784, 0x00002002 }, /* GL_R */ + { 27789, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 27801, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 27834, 0x00000C02 }, /* GL_READ_BUFFER */ + { 27849, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 27869, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 27901, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 27925, 0x000088B8 }, /* GL_READ_ONLY */ + { 27938, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 27955, 0x000088BA }, /* GL_READ_WRITE */ + { 27969, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 27987, 0x00001903 }, /* GL_RED */ + { 27994, 0x00008016 }, /* GL_REDUCE */ + { 28004, 0x00008016 }, /* GL_REDUCE_EXT */ + { 28018, 0x00000D15 }, /* GL_RED_BIAS */ + { 28030, 0x00000D52 }, /* GL_RED_BITS */ + { 28042, 0x00000D14 }, /* GL_RED_SCALE */ + { 28055, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28073, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28095, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28116, 0x00001C00 }, /* GL_RENDER */ + { 28126, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 28142, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 28169, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 28197, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 28223, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 28250, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 28270, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 28297, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 28320, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 28347, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 28379, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 28415, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 28440, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 28464, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 28493, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 28515, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 28541, 0x00001F01 }, /* GL_RENDERER */ + { 28553, 0x00000C40 }, /* GL_RENDER_MODE */ + { 28568, 0x00002901 }, /* GL_REPEAT */ + { 28578, 0x00001E01 }, /* GL_REPLACE */ + { 28589, 0x00008062 }, /* GL_REPLACE_EXT */ + { 28604, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 28627, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 28645, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 28667, 0x00000102 }, /* GL_RETURN */ + { 28677, 0x00001907 }, /* GL_RGB */ + { 28684, 0x00008052 }, /* GL_RGB10 */ + { 28693, 0x00008059 }, /* GL_RGB10_A2 */ + { 28705, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 28721, 0x00008052 }, /* GL_RGB10_EXT */ + { 28734, 0x00008053 }, /* GL_RGB12 */ + { 28743, 0x00008053 }, /* GL_RGB12_EXT */ + { 28756, 0x00008054 }, /* GL_RGB16 */ + { 28765, 0x00008054 }, /* GL_RGB16_EXT */ + { 28778, 0x0000804E }, /* GL_RGB2_EXT */ + { 28790, 0x0000804F }, /* GL_RGB4 */ + { 28798, 0x0000804F }, /* GL_RGB4_EXT */ + { 28810, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 28823, 0x00008050 }, /* GL_RGB5 */ + { 28831, 0x00008057 }, /* GL_RGB5_A1 */ + { 28842, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 28857, 0x00008050 }, /* GL_RGB5_EXT */ + { 28869, 0x00008051 }, /* GL_RGB8 */ + { 28877, 0x00008051 }, /* GL_RGB8_EXT */ + { 28889, 0x00001908 }, /* GL_RGBA */ + { 28897, 0x0000805A }, /* GL_RGBA12 */ + { 28907, 0x0000805A }, /* GL_RGBA12_EXT */ + { 28921, 0x0000805B }, /* GL_RGBA16 */ + { 28931, 0x0000805B }, /* GL_RGBA16_EXT */ + { 28945, 0x00008055 }, /* GL_RGBA2 */ + { 28954, 0x00008055 }, /* GL_RGBA2_EXT */ + { 28967, 0x00008056 }, /* GL_RGBA4 */ + { 28976, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 28995, 0x00008056 }, /* GL_RGBA4_EXT */ + { 29008, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 29022, 0x00008058 }, /* GL_RGBA8 */ + { 29031, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29044, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 29062, 0x00000C31 }, /* GL_RGBA_MODE */ + { 29075, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 29088, 0x000083A0 }, /* GL_RGB_S3TC */ + { 29100, 0x00008573 }, /* GL_RGB_SCALE */ + { 29113, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 29130, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 29147, 0x00000407 }, /* GL_RIGHT */ + { 29156, 0x00002000 }, /* GL_S */ + { 29161, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 29175, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 29196, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 29210, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 29231, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 29245, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 29261, 0x000080A9 }, /* GL_SAMPLES */ + { 29272, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 29288, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 29303, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 29321, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 29343, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 29371, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 29403, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 29426, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 29453, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 29471, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 29494, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 29516, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 29535, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 29558, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 29584, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 29614, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 29639, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 29668, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 29683, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 29698, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 29714, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 29739, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 29779, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 29823, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 29856, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 29886, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 29918, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 29948, 0x00001C02 }, /* GL_SELECT */ + { 29958, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 29986, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30011, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30027, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 30054, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 30085, 0x0000150F }, /* GL_SET */ + { 30092, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 30113, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 30137, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 30152, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 30167, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 30195, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 30218, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 30248, 0x00001601 }, /* GL_SHININESS */ + { 30261, 0x00001402 }, /* GL_SHORT */ + { 30270, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 30286, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 30306, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 30325, 0x00001D01 }, /* GL_SMOOTH */ + { 30335, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 30368, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 30395, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 30428, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 30455, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 30472, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 30493, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 30514, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 30529, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 30548, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 30567, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 30584, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 30605, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 30626, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 30641, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 30660, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 30679, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 30696, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 30717, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 30738, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 30753, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 30772, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 30791, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 30811, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 30829, 0x00001202 }, /* GL_SPECULAR */ + { 30841, 0x00002402 }, /* GL_SPHERE_MAP */ + { 30855, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 30870, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 30888, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 30905, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 30919, 0x00008580 }, /* GL_SRC0_RGB */ + { 30931, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 30945, 0x00008581 }, /* GL_SRC1_RGB */ + { 30957, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 30971, 0x00008582 }, /* GL_SRC2_RGB */ + { 30983, 0x00000302 }, /* GL_SRC_ALPHA */ + { 30996, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 31018, 0x00000300 }, /* GL_SRC_COLOR */ + { 31031, 0x00008C40 }, /* GL_SRGB */ + { 31039, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 31057, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 31076, 0x000088E6 }, /* GL_STATIC_COPY */ + { 31091, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 31110, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 31125, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 31144, 0x000088E5 }, /* GL_STATIC_READ */ + { 31159, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 31178, 0x00001802 }, /* GL_STENCIL */ + { 31189, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 31211, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 31237, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 31258, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 31283, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 31304, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 31329, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 31361, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 31397, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 31429, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 31465, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 31485, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 31512, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 31538, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 31554, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 31576, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 31599, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 31615, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 31631, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 31648, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 31671, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 31693, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 31715, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 31737, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 31758, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 31785, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 31812, 0x00000B97 }, /* GL_STENCIL_REF */ + { 31827, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 31843, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 31872, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 31894, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 31915, 0x00000C33 }, /* GL_STEREO */ + { 31925, 0x000088E2 }, /* GL_STREAM_COPY */ + { 31940, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 31959, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 31974, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 31993, 0x000088E1 }, /* GL_STREAM_READ */ + { 32008, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 32027, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 32044, 0x000084E7 }, /* GL_SUBTRACT */ + { 32056, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 32072, 0x00002001 }, /* GL_T */ + { 32077, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 32092, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 32111, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 32127, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 32142, 0x00002A27 }, /* GL_T2F_V3F */ + { 32153, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 32172, 0x00002A28 }, /* GL_T4F_V4F */ + { 32183, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 32206, 0x00001702 }, /* GL_TEXTURE */ + { 32217, 0x000084C0 }, /* GL_TEXTURE0 */ + { 32229, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 32245, 0x000084C1 }, /* GL_TEXTURE1 */ + { 32257, 0x000084CA }, /* GL_TEXTURE10 */ + { 32270, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 32287, 0x000084CB }, /* GL_TEXTURE11 */ + { 32300, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 32317, 0x000084CC }, /* GL_TEXTURE12 */ + { 32330, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 32347, 0x000084CD }, /* GL_TEXTURE13 */ + { 32360, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 32377, 0x000084CE }, /* GL_TEXTURE14 */ + { 32390, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 32407, 0x000084CF }, /* GL_TEXTURE15 */ + { 32420, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 32437, 0x000084D0 }, /* GL_TEXTURE16 */ + { 32450, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 32467, 0x000084D1 }, /* GL_TEXTURE17 */ + { 32480, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 32497, 0x000084D2 }, /* GL_TEXTURE18 */ + { 32510, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 32527, 0x000084D3 }, /* GL_TEXTURE19 */ + { 32540, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 32557, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 32573, 0x000084C2 }, /* GL_TEXTURE2 */ + { 32585, 0x000084D4 }, /* GL_TEXTURE20 */ + { 32598, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 32615, 0x000084D5 }, /* GL_TEXTURE21 */ + { 32628, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 32645, 0x000084D6 }, /* GL_TEXTURE22 */ + { 32658, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 32675, 0x000084D7 }, /* GL_TEXTURE23 */ + { 32688, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 32705, 0x000084D8 }, /* GL_TEXTURE24 */ + { 32718, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 32735, 0x000084D9 }, /* GL_TEXTURE25 */ + { 32748, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 32765, 0x000084DA }, /* GL_TEXTURE26 */ + { 32778, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 32795, 0x000084DB }, /* GL_TEXTURE27 */ + { 32808, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 32825, 0x000084DC }, /* GL_TEXTURE28 */ + { 32838, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 32855, 0x000084DD }, /* GL_TEXTURE29 */ + { 32868, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 32885, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 32901, 0x000084C3 }, /* GL_TEXTURE3 */ + { 32913, 0x000084DE }, /* GL_TEXTURE30 */ + { 32926, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 32943, 0x000084DF }, /* GL_TEXTURE31 */ + { 32956, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 32973, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 32989, 0x000084C4 }, /* GL_TEXTURE4 */ + { 33001, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 33017, 0x000084C5 }, /* GL_TEXTURE5 */ + { 33029, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 33045, 0x000084C6 }, /* GL_TEXTURE6 */ + { 33057, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 33073, 0x000084C7 }, /* GL_TEXTURE7 */ + { 33085, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 33101, 0x000084C8 }, /* GL_TEXTURE8 */ + { 33113, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 33129, 0x000084C9 }, /* GL_TEXTURE9 */ + { 33141, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 33157, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 33171, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 33195, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 33209, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 33233, 0x0000806F }, /* GL_TEXTURE_3D */ + { 33247, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 33269, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 33295, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 33317, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 33339, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 33371, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 33393, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 33425, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 33447, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 33475, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 33507, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 33540, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 33572, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 33587, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 33608, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 33633, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 33651, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 33675, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 33706, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 33736, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 33766, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 33801, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 33832, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 33870, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 33897, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 33929, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 33963, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 33987, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 34015, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 34039, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 34067, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 34100, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 34124, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 34146, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 34168, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 34194, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 34228, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 34261, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 34298, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 34326, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 34358, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 34381, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 34419, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 34461, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 34492, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 34520, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 34550, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 34578, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 34598, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 34622, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 34653, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 34688, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 34719, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 34754, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 34785, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 34820, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 34851, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 34886, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 34917, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 34952, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 34983, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 35018, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 35035, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 35057, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 35083, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 35098, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 35119, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 35139, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 35165, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 35185, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 35202, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 35219, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 35236, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 35253, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 35278, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 35300, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 35326, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 35344, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 35370, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 35396, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 35426, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 35453, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 35478, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 35498, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 35522, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 35549, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 35576, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 35603, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 35629, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 35659, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 35681, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 35699, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 35729, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 35757, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 35785, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 35813, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 35834, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 35853, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 35875, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 35894, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 35914, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 35939, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 35963, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 35983, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 36007, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 36027, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 36050, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 36074, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 36099, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 36133, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 36150, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 36168, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 36186, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 36204, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 36224, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 36243, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 36272, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 36289, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 36315, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 36345, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 36377, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 36407, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 36441, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 36457, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 36488, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 36523, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 36551, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 36583, 0x00000004 }, /* GL_TRIANGLES */ + { 36596, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 36612, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 36633, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 36651, 0x00000001 }, /* GL_TRUE */ + { 36659, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 36679, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 36702, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 36722, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 36743, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 36765, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 36787, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 36807, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 36828, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 36845, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 36872, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 36895, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 36911, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 36938, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 36959, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 36983, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 37014, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 37038, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 37066, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 37089, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 37107, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 37137, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 37163, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 37193, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 37219, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 37243, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 37271, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 37299, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 37326, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 37358, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 37389, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 37403, 0x00002A20 }, /* GL_V2F */ + { 37410, 0x00002A21 }, /* GL_V3F */ + { 37417, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 37436, 0x00001F00 }, /* GL_VENDOR */ + { 37446, 0x00001F02 }, /* GL_VERSION */ + { 37457, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 37473, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 37503, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 37534, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 37569, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 37593, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 37614, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 37637, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 37658, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 37685, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 37713, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 37741, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 37769, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 37797, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 37825, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 37853, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 37880, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 37907, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 37934, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 37961, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 37988, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 38015, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 38042, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 38069, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 38096, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 38134, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 38176, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 38207, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 38242, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 38276, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 38314, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 38345, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 38380, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 38408, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 38440, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 38470, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 38504, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 38532, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 38564, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 38584, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 38606, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 38635, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 38656, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 38685, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 38718, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 38750, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 38777, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 38808, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 38838, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 38855, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 38876, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 38903, 0x00000BA2 }, /* GL_VIEWPORT */ + { 38915, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 38931, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 38951, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 38982, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 39017, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 39045, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 39070, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 39097, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 39122, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 39146, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 39165, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 39179, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 39197, 0x00001506 }, /* GL_XOR */ + { 39204, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 39223, 0x00008757 }, /* GL_YCBCR_MESA */ + { 39237, 0x00000000 }, /* GL_ZERO */ + { 39245, 0x00000D16 }, /* GL_ZOOM_X */ + { 39255, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1284] = +static const unsigned reduced_enums[1308] = { - 436, /* GL_FALSE */ - 645, /* GL_LINES */ - 647, /* GL_LINE_LOOP */ - 654, /* GL_LINE_STRIP */ - 1641, /* GL_TRIANGLES */ - 1644, /* GL_TRIANGLE_STRIP */ - 1642, /* GL_TRIANGLE_FAN */ - 1211, /* GL_QUADS */ - 1213, /* GL_QUAD_STRIP */ - 1099, /* GL_POLYGON */ - 1111, /* GL_POLYGON_STIPPLE_BIT */ - 1064, /* GL_PIXEL_MODE_BIT */ - 632, /* GL_LIGHTING_BIT */ - 458, /* GL_FOG_BIT */ + 455, /* GL_FALSE */ + 687, /* GL_LINES */ + 689, /* GL_LINE_LOOP */ + 696, /* GL_LINE_STRIP */ + 1699, /* GL_TRIANGLES */ + 1702, /* GL_TRIANGLE_STRIP */ + 1700, /* GL_TRIANGLE_FAN */ + 1254, /* GL_QUADS */ + 1256, /* GL_QUAD_STRIP */ + 1142, /* GL_POLYGON */ + 1154, /* GL_POLYGON_STIPPLE_BIT */ + 1107, /* GL_PIXEL_MODE_BIT */ + 674, /* GL_LIGHTING_BIT */ + 477, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 664, /* GL_LOAD */ - 1253, /* GL_RETURN */ - 937, /* GL_MULT */ + 706, /* GL_LOAD */ + 1308, /* GL_RETURN */ + 980, /* GL_MULT */ 23, /* GL_ADD */ - 953, /* GL_NEVER */ - 622, /* GL_LESS */ - 426, /* GL_EQUAL */ - 621, /* GL_LEQUAL */ - 547, /* GL_GREATER */ - 968, /* GL_NOTEQUAL */ - 522, /* GL_GEQUAL */ + 996, /* GL_NEVER */ + 664, /* GL_LESS */ + 445, /* GL_EQUAL */ + 663, /* GL_LEQUAL */ + 587, /* GL_GREATER */ + 1011, /* GL_NOTEQUAL */ + 562, /* GL_GEQUAL */ 46, /* GL_ALWAYS */ - 1386, /* GL_SRC_COLOR */ - 997, /* GL_ONE_MINUS_SRC_COLOR */ - 1384, /* GL_SRC_ALPHA */ - 996, /* GL_ONE_MINUS_SRC_ALPHA */ - 406, /* GL_DST_ALPHA */ - 994, /* GL_ONE_MINUS_DST_ALPHA */ - 407, /* GL_DST_COLOR */ - 995, /* GL_ONE_MINUS_DST_COLOR */ - 1385, /* GL_SRC_ALPHA_SATURATE */ - 510, /* GL_FRONT_LEFT */ - 511, /* GL_FRONT_RIGHT */ - 69, /* GL_BACK_LEFT */ - 70, /* GL_BACK_RIGHT */ - 507, /* GL_FRONT */ - 68, /* GL_BACK */ - 620, /* GL_LEFT */ - 1293, /* GL_RIGHT */ - 508, /* GL_FRONT_AND_BACK */ - 63, /* GL_AUX0 */ - 64, /* GL_AUX1 */ - 65, /* GL_AUX2 */ - 66, /* GL_AUX3 */ - 612, /* GL_INVALID_ENUM */ - 615, /* GL_INVALID_VALUE */ - 614, /* GL_INVALID_OPERATION */ - 1387, /* GL_STACK_OVERFLOW */ - 1388, /* GL_STACK_UNDERFLOW */ - 1022, /* GL_OUT_OF_MEMORY */ - 613, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + 1441, /* GL_SRC_COLOR */ + 1040, /* GL_ONE_MINUS_SRC_COLOR */ + 1439, /* GL_SRC_ALPHA */ + 1039, /* GL_ONE_MINUS_SRC_ALPHA */ + 426, /* GL_DST_ALPHA */ + 1037, /* GL_ONE_MINUS_DST_ALPHA */ + 427, /* GL_DST_COLOR */ + 1038, /* GL_ONE_MINUS_DST_COLOR */ + 1440, /* GL_SRC_ALPHA_SATURATE */ + 550, /* GL_FRONT_LEFT */ + 551, /* GL_FRONT_RIGHT */ + 68, /* GL_BACK_LEFT */ + 69, /* GL_BACK_RIGHT */ + 547, /* GL_FRONT */ + 67, /* GL_BACK */ + 662, /* GL_LEFT */ + 1348, /* GL_RIGHT */ + 548, /* GL_FRONT_AND_BACK */ + 62, /* GL_AUX0 */ + 63, /* GL_AUX1 */ + 64, /* GL_AUX2 */ + 65, /* GL_AUX3 */ + 653, /* GL_INVALID_ENUM */ + 657, /* GL_INVALID_VALUE */ + 656, /* GL_INVALID_OPERATION */ + 1443, /* GL_STACK_OVERFLOW */ + 1444, /* GL_STACK_UNDERFLOW */ + 1065, /* GL_OUT_OF_MEMORY */ + 654, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1042, /* GL_PASS_THROUGH_TOKEN */ - 1098, /* GL_POINT_TOKEN */ - 655, /* GL_LINE_TOKEN */ - 1112, /* GL_POLYGON_TOKEN */ - 74, /* GL_BITMAP_TOKEN */ - 405, /* GL_DRAW_PIXEL_TOKEN */ - 271, /* GL_COPY_PIXEL_TOKEN */ - 648, /* GL_LINE_RESET_TOKEN */ - 429, /* GL_EXP */ - 430, /* GL_EXP2 */ - 304, /* GL_CW */ - 116, /* GL_CCW */ - 137, /* GL_COEFF */ - 1019, /* GL_ORDER */ - 344, /* GL_DOMAIN */ - 279, /* GL_CURRENT_COLOR */ - 282, /* GL_CURRENT_INDEX */ - 288, /* GL_CURRENT_NORMAL */ - 300, /* GL_CURRENT_TEXTURE_COORDS */ - 293, /* GL_CURRENT_RASTER_COLOR */ - 295, /* GL_CURRENT_RASTER_INDEX */ - 298, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - 296, /* GL_CURRENT_RASTER_POSITION */ - 297, /* GL_CURRENT_RASTER_POSITION_VALID */ - 294, /* GL_CURRENT_RASTER_DISTANCE */ - 1091, /* GL_POINT_SMOOTH */ - 1080, /* GL_POINT_SIZE */ - 1090, /* GL_POINT_SIZE_RANGE */ - 1081, /* GL_POINT_SIZE_GRANULARITY */ - 649, /* GL_LINE_SMOOTH */ - 656, /* GL_LINE_WIDTH */ - 658, /* GL_LINE_WIDTH_RANGE */ - 657, /* GL_LINE_WIDTH_GRANULARITY */ - 651, /* GL_LINE_STIPPLE */ - 652, /* GL_LINE_STIPPLE_PATTERN */ - 653, /* GL_LINE_STIPPLE_REPEAT */ - 663, /* GL_LIST_MODE */ - 822, /* GL_MAX_LIST_NESTING */ - 660, /* GL_LIST_BASE */ - 662, /* GL_LIST_INDEX */ - 1101, /* GL_POLYGON_MODE */ - 1108, /* GL_POLYGON_SMOOTH */ - 1110, /* GL_POLYGON_STIPPLE */ - 414, /* GL_EDGE_FLAG */ - 272, /* GL_CULL_FACE */ - 273, /* GL_CULL_FACE_MODE */ - 509, /* GL_FRONT_FACE */ - 631, /* GL_LIGHTING */ - 636, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 637, /* GL_LIGHT_MODEL_TWO_SIDE */ - 633, /* GL_LIGHT_MODEL_AMBIENT */ - 1339, /* GL_SHADE_MODEL */ - 168, /* GL_COLOR_MATERIAL_FACE */ - 169, /* GL_COLOR_MATERIAL_PARAMETER */ - 167, /* GL_COLOR_MATERIAL */ - 457, /* GL_FOG */ - 479, /* GL_FOG_INDEX */ - 475, /* GL_FOG_DENSITY */ - 483, /* GL_FOG_START */ - 477, /* GL_FOG_END */ - 480, /* GL_FOG_MODE */ - 459, /* GL_FOG_COLOR */ - 333, /* GL_DEPTH_RANGE */ - 338, /* GL_DEPTH_TEST */ - 341, /* GL_DEPTH_WRITEMASK */ - 321, /* GL_DEPTH_CLEAR_VALUE */ - 332, /* GL_DEPTH_FUNC */ + 1085, /* GL_PASS_THROUGH_TOKEN */ + 1141, /* GL_POINT_TOKEN */ + 697, /* GL_LINE_TOKEN */ + 1155, /* GL_POLYGON_TOKEN */ + 73, /* GL_BITMAP_TOKEN */ + 425, /* GL_DRAW_PIXEL_TOKEN */ + 286, /* GL_COPY_PIXEL_TOKEN */ + 690, /* GL_LINE_RESET_TOKEN */ + 448, /* GL_EXP */ + 449, /* GL_EXP2 */ + 319, /* GL_CW */ + 115, /* GL_CCW */ + 136, /* GL_COEFF */ + 1062, /* GL_ORDER */ + 363, /* GL_DOMAIN */ + 294, /* GL_CURRENT_COLOR */ + 297, /* GL_CURRENT_INDEX */ + 303, /* GL_CURRENT_NORMAL */ + 315, /* GL_CURRENT_TEXTURE_COORDS */ + 308, /* GL_CURRENT_RASTER_COLOR */ + 310, /* GL_CURRENT_RASTER_INDEX */ + 313, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + 311, /* GL_CURRENT_RASTER_POSITION */ + 312, /* GL_CURRENT_RASTER_POSITION_VALID */ + 309, /* GL_CURRENT_RASTER_DISTANCE */ + 1134, /* GL_POINT_SMOOTH */ + 1123, /* GL_POINT_SIZE */ + 1133, /* GL_POINT_SIZE_RANGE */ + 1124, /* GL_POINT_SIZE_GRANULARITY */ + 691, /* GL_LINE_SMOOTH */ + 698, /* GL_LINE_WIDTH */ + 700, /* GL_LINE_WIDTH_RANGE */ + 699, /* GL_LINE_WIDTH_GRANULARITY */ + 693, /* GL_LINE_STIPPLE */ + 694, /* GL_LINE_STIPPLE_PATTERN */ + 695, /* GL_LINE_STIPPLE_REPEAT */ + 705, /* GL_LIST_MODE */ + 864, /* GL_MAX_LIST_NESTING */ + 702, /* GL_LIST_BASE */ + 704, /* GL_LIST_INDEX */ + 1144, /* GL_POLYGON_MODE */ + 1151, /* GL_POLYGON_SMOOTH */ + 1153, /* GL_POLYGON_STIPPLE */ + 434, /* GL_EDGE_FLAG */ + 287, /* GL_CULL_FACE */ + 288, /* GL_CULL_FACE_MODE */ + 549, /* GL_FRONT_FACE */ + 673, /* GL_LIGHTING */ + 678, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 679, /* GL_LIGHT_MODEL_TWO_SIDE */ + 675, /* GL_LIGHT_MODEL_AMBIENT */ + 1394, /* GL_SHADE_MODEL */ + 183, /* GL_COLOR_MATERIAL_FACE */ + 184, /* GL_COLOR_MATERIAL_PARAMETER */ + 182, /* GL_COLOR_MATERIAL */ + 476, /* GL_FOG */ + 498, /* GL_FOG_INDEX */ + 494, /* GL_FOG_DENSITY */ + 502, /* GL_FOG_START */ + 496, /* GL_FOG_END */ + 499, /* GL_FOG_MODE */ + 478, /* GL_FOG_COLOR */ + 350, /* GL_DEPTH_RANGE */ + 357, /* GL_DEPTH_TEST */ + 360, /* GL_DEPTH_WRITEMASK */ + 338, /* GL_DEPTH_CLEAR_VALUE */ + 349, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1422, /* GL_STENCIL_TEST */ - 1410, /* GL_STENCIL_CLEAR_VALUE */ - 1412, /* GL_STENCIL_FUNC */ - 1424, /* GL_STENCIL_VALUE_MASK */ - 1411, /* GL_STENCIL_FAIL */ - 1419, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1420, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1421, /* GL_STENCIL_REF */ - 1425, /* GL_STENCIL_WRITEMASK */ - 791, /* GL_MATRIX_MODE */ - 958, /* GL_NORMALIZE */ - 1731, /* GL_VIEWPORT */ - 932, /* GL_MODELVIEW_STACK_DEPTH */ - 1191, /* GL_PROJECTION_STACK_DEPTH */ - 1620, /* GL_TEXTURE_STACK_DEPTH */ - 930, /* GL_MODELVIEW_MATRIX */ - 1190, /* GL_PROJECTION_MATRIX */ - 1605, /* GL_TEXTURE_MATRIX */ - 61, /* GL_ATTRIB_STACK_DEPTH */ - 127, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + 1479, /* GL_STENCIL_TEST */ + 1467, /* GL_STENCIL_CLEAR_VALUE */ + 1469, /* GL_STENCIL_FUNC */ + 1481, /* GL_STENCIL_VALUE_MASK */ + 1468, /* GL_STENCIL_FAIL */ + 1476, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1477, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1478, /* GL_STENCIL_REF */ + 1482, /* GL_STENCIL_WRITEMASK */ + 833, /* GL_MATRIX_MODE */ + 1001, /* GL_NORMALIZE */ + 1791, /* GL_VIEWPORT */ + 975, /* GL_MODELVIEW_STACK_DEPTH */ + 1234, /* GL_PROJECTION_STACK_DEPTH */ + 1677, /* GL_TEXTURE_STACK_DEPTH */ + 973, /* GL_MODELVIEW_MATRIX */ + 1233, /* GL_PROJECTION_MATRIX */ + 1662, /* GL_TEXTURE_MATRIX */ + 60, /* GL_ATTRIB_STACK_DEPTH */ + 126, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 343, /* GL_DITHER */ - 78, /* GL_BLEND_DST */ - 86, /* GL_BLEND_SRC */ - 75, /* GL_BLEND */ - 666, /* GL_LOGIC_OP_MODE */ - 586, /* GL_INDEX_LOGIC_OP */ - 166, /* GL_COLOR_LOGIC_OP */ - 67, /* GL_AUX_BUFFERS */ - 354, /* GL_DRAW_BUFFER */ - 1223, /* GL_READ_BUFFER */ - 1320, /* GL_SCISSOR_BOX */ - 1321, /* GL_SCISSOR_TEST */ - 585, /* GL_INDEX_CLEAR_VALUE */ - 590, /* GL_INDEX_WRITEMASK */ - 163, /* GL_COLOR_CLEAR_VALUE */ - 205, /* GL_COLOR_WRITEMASK */ - 587, /* GL_INDEX_MODE */ - 1287, /* GL_RGBA_MODE */ - 353, /* GL_DOUBLEBUFFER */ - 1426, /* GL_STEREO */ - 1246, /* GL_RENDER_MODE */ - 1043, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1092, /* GL_POINT_SMOOTH_HINT */ - 650, /* GL_LINE_SMOOTH_HINT */ - 1109, /* GL_POLYGON_SMOOTH_HINT */ - 478, /* GL_FOG_HINT */ - 1586, /* GL_TEXTURE_GEN_S */ - 1587, /* GL_TEXTURE_GEN_T */ - 1585, /* GL_TEXTURE_GEN_R */ - 1584, /* GL_TEXTURE_GEN_Q */ - 1056, /* GL_PIXEL_MAP_I_TO_I */ - 1062, /* GL_PIXEL_MAP_S_TO_S */ - 1058, /* GL_PIXEL_MAP_I_TO_R */ - 1054, /* GL_PIXEL_MAP_I_TO_G */ - 1052, /* GL_PIXEL_MAP_I_TO_B */ - 1050, /* GL_PIXEL_MAP_I_TO_A */ - 1060, /* GL_PIXEL_MAP_R_TO_R */ - 1048, /* GL_PIXEL_MAP_G_TO_G */ - 1046, /* GL_PIXEL_MAP_B_TO_B */ - 1044, /* GL_PIXEL_MAP_A_TO_A */ - 1057, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1063, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1059, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1055, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1053, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1051, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1061, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1049, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1047, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1045, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1653, /* GL_UNPACK_SWAP_BYTES */ - 1648, /* GL_UNPACK_LSB_FIRST */ - 1649, /* GL_UNPACK_ROW_LENGTH */ - 1652, /* GL_UNPACK_SKIP_ROWS */ - 1651, /* GL_UNPACK_SKIP_PIXELS */ - 1646, /* GL_UNPACK_ALIGNMENT */ - 1031, /* GL_PACK_SWAP_BYTES */ - 1026, /* GL_PACK_LSB_FIRST */ - 1027, /* GL_PACK_ROW_LENGTH */ - 1030, /* GL_PACK_SKIP_ROWS */ - 1029, /* GL_PACK_SKIP_PIXELS */ - 1023, /* GL_PACK_ALIGNMENT */ - 744, /* GL_MAP_COLOR */ - 745, /* GL_MAP_STENCIL */ - 589, /* GL_INDEX_SHIFT */ - 588, /* GL_INDEX_OFFSET */ - 1235, /* GL_RED_SCALE */ - 1233, /* GL_RED_BIAS */ - 1748, /* GL_ZOOM_X */ - 1749, /* GL_ZOOM_Y */ - 551, /* GL_GREEN_SCALE */ - 549, /* GL_GREEN_BIAS */ - 92, /* GL_BLUE_SCALE */ - 90, /* GL_BLUE_BIAS */ + 362, /* GL_DITHER */ + 77, /* GL_BLEND_DST */ + 85, /* GL_BLEND_SRC */ + 74, /* GL_BLEND */ + 708, /* GL_LOGIC_OP_MODE */ + 627, /* GL_INDEX_LOGIC_OP */ + 181, /* GL_COLOR_LOGIC_OP */ + 66, /* GL_AUX_BUFFERS */ + 373, /* GL_DRAW_BUFFER */ + 1266, /* GL_READ_BUFFER */ + 1375, /* GL_SCISSOR_BOX */ + 1376, /* GL_SCISSOR_TEST */ + 626, /* GL_INDEX_CLEAR_VALUE */ + 631, /* GL_INDEX_WRITEMASK */ + 178, /* GL_COLOR_CLEAR_VALUE */ + 220, /* GL_COLOR_WRITEMASK */ + 628, /* GL_INDEX_MODE */ + 1342, /* GL_RGBA_MODE */ + 372, /* GL_DOUBLEBUFFER */ + 1483, /* GL_STEREO */ + 1301, /* GL_RENDER_MODE */ + 1086, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1135, /* GL_POINT_SMOOTH_HINT */ + 692, /* GL_LINE_SMOOTH_HINT */ + 1152, /* GL_POLYGON_SMOOTH_HINT */ + 497, /* GL_FOG_HINT */ + 1643, /* GL_TEXTURE_GEN_S */ + 1644, /* GL_TEXTURE_GEN_T */ + 1642, /* GL_TEXTURE_GEN_R */ + 1641, /* GL_TEXTURE_GEN_Q */ + 1099, /* GL_PIXEL_MAP_I_TO_I */ + 1105, /* GL_PIXEL_MAP_S_TO_S */ + 1101, /* GL_PIXEL_MAP_I_TO_R */ + 1097, /* GL_PIXEL_MAP_I_TO_G */ + 1095, /* GL_PIXEL_MAP_I_TO_B */ + 1093, /* GL_PIXEL_MAP_I_TO_A */ + 1103, /* GL_PIXEL_MAP_R_TO_R */ + 1091, /* GL_PIXEL_MAP_G_TO_G */ + 1089, /* GL_PIXEL_MAP_B_TO_B */ + 1087, /* GL_PIXEL_MAP_A_TO_A */ + 1100, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1106, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1102, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1098, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1096, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1094, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1104, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1092, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1090, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1088, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1711, /* GL_UNPACK_SWAP_BYTES */ + 1706, /* GL_UNPACK_LSB_FIRST */ + 1707, /* GL_UNPACK_ROW_LENGTH */ + 1710, /* GL_UNPACK_SKIP_ROWS */ + 1709, /* GL_UNPACK_SKIP_PIXELS */ + 1704, /* GL_UNPACK_ALIGNMENT */ + 1074, /* GL_PACK_SWAP_BYTES */ + 1069, /* GL_PACK_LSB_FIRST */ + 1070, /* GL_PACK_ROW_LENGTH */ + 1073, /* GL_PACK_SKIP_ROWS */ + 1072, /* GL_PACK_SKIP_PIXELS */ + 1066, /* GL_PACK_ALIGNMENT */ + 786, /* GL_MAP_COLOR */ + 787, /* GL_MAP_STENCIL */ + 630, /* GL_INDEX_SHIFT */ + 629, /* GL_INDEX_OFFSET */ + 1279, /* GL_RED_SCALE */ + 1277, /* GL_RED_BIAS */ + 1808, /* GL_ZOOM_X */ + 1809, /* GL_ZOOM_Y */ + 591, /* GL_GREEN_SCALE */ + 589, /* GL_GREEN_BIAS */ + 91, /* GL_BLUE_SCALE */ + 89, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 334, /* GL_DEPTH_SCALE */ - 315, /* GL_DEPTH_BIAS */ - 817, /* GL_MAX_EVAL_ORDER */ - 821, /* GL_MAX_LIGHTS */ - 800, /* GL_MAX_CLIP_PLANES */ - 865, /* GL_MAX_TEXTURE_SIZE */ - 827, /* GL_MAX_PIXEL_MAP_TABLE */ - 796, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 824, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 825, /* GL_MAX_NAME_STACK_DEPTH */ - 853, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 866, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 880, /* GL_MAX_VIEWPORT_DIMS */ - 797, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1433, /* GL_SUBPIXEL_BITS */ - 584, /* GL_INDEX_BITS */ - 1234, /* GL_RED_BITS */ - 550, /* GL_GREEN_BITS */ - 91, /* GL_BLUE_BITS */ + 351, /* GL_DEPTH_SCALE */ + 332, /* GL_DEPTH_BIAS */ + 859, /* GL_MAX_EVAL_ORDER */ + 863, /* GL_MAX_LIGHTS */ + 842, /* GL_MAX_CLIP_PLANES */ + 908, /* GL_MAX_TEXTURE_SIZE */ + 869, /* GL_MAX_PIXEL_MAP_TABLE */ + 838, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 866, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 867, /* GL_MAX_NAME_STACK_DEPTH */ + 895, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 909, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 923, /* GL_MAX_VIEWPORT_DIMS */ + 839, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1490, /* GL_SUBPIXEL_BITS */ + 625, /* GL_INDEX_BITS */ + 1278, /* GL_RED_BITS */ + 590, /* GL_GREEN_BITS */ + 90, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 316, /* GL_DEPTH_BITS */ - 1408, /* GL_STENCIL_BITS */ + 333, /* GL_DEPTH_BITS */ + 1465, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 946, /* GL_NAME_STACK_DEPTH */ - 62, /* GL_AUTO_NORMAL */ - 690, /* GL_MAP1_COLOR_4 */ - 693, /* GL_MAP1_INDEX */ - 694, /* GL_MAP1_NORMAL */ - 695, /* GL_MAP1_TEXTURE_COORD_1 */ - 696, /* GL_MAP1_TEXTURE_COORD_2 */ - 697, /* GL_MAP1_TEXTURE_COORD_3 */ - 698, /* GL_MAP1_TEXTURE_COORD_4 */ - 699, /* GL_MAP1_VERTEX_3 */ - 700, /* GL_MAP1_VERTEX_4 */ - 717, /* GL_MAP2_COLOR_4 */ - 720, /* GL_MAP2_INDEX */ - 721, /* GL_MAP2_NORMAL */ - 722, /* GL_MAP2_TEXTURE_COORD_1 */ - 723, /* GL_MAP2_TEXTURE_COORD_2 */ - 724, /* GL_MAP2_TEXTURE_COORD_3 */ - 725, /* GL_MAP2_TEXTURE_COORD_4 */ - 726, /* GL_MAP2_VERTEX_3 */ - 727, /* GL_MAP2_VERTEX_4 */ - 691, /* GL_MAP1_GRID_DOMAIN */ - 692, /* GL_MAP1_GRID_SEGMENTS */ - 718, /* GL_MAP2_GRID_DOMAIN */ - 719, /* GL_MAP2_GRID_SEGMENTS */ - 1510, /* GL_TEXTURE_1D */ - 1512, /* GL_TEXTURE_2D */ - 439, /* GL_FEEDBACK_BUFFER_POINTER */ - 440, /* GL_FEEDBACK_BUFFER_SIZE */ - 441, /* GL_FEEDBACK_BUFFER_TYPE */ - 1330, /* GL_SELECTION_BUFFER_POINTER */ - 1331, /* GL_SELECTION_BUFFER_SIZE */ - 1623, /* GL_TEXTURE_WIDTH */ - 1591, /* GL_TEXTURE_HEIGHT */ - 1547, /* GL_TEXTURE_COMPONENTS */ - 1531, /* GL_TEXTURE_BORDER_COLOR */ - 1530, /* GL_TEXTURE_BORDER */ - 345, /* GL_DONT_CARE */ - 437, /* GL_FASTEST */ - 954, /* GL_NICEST */ + 989, /* GL_NAME_STACK_DEPTH */ + 61, /* GL_AUTO_NORMAL */ + 732, /* GL_MAP1_COLOR_4 */ + 735, /* GL_MAP1_INDEX */ + 736, /* GL_MAP1_NORMAL */ + 737, /* GL_MAP1_TEXTURE_COORD_1 */ + 738, /* GL_MAP1_TEXTURE_COORD_2 */ + 739, /* GL_MAP1_TEXTURE_COORD_3 */ + 740, /* GL_MAP1_TEXTURE_COORD_4 */ + 741, /* GL_MAP1_VERTEX_3 */ + 742, /* GL_MAP1_VERTEX_4 */ + 759, /* GL_MAP2_COLOR_4 */ + 762, /* GL_MAP2_INDEX */ + 763, /* GL_MAP2_NORMAL */ + 764, /* GL_MAP2_TEXTURE_COORD_1 */ + 765, /* GL_MAP2_TEXTURE_COORD_2 */ + 766, /* GL_MAP2_TEXTURE_COORD_3 */ + 767, /* GL_MAP2_TEXTURE_COORD_4 */ + 768, /* GL_MAP2_VERTEX_3 */ + 769, /* GL_MAP2_VERTEX_4 */ + 733, /* GL_MAP1_GRID_DOMAIN */ + 734, /* GL_MAP1_GRID_SEGMENTS */ + 760, /* GL_MAP2_GRID_DOMAIN */ + 761, /* GL_MAP2_GRID_SEGMENTS */ + 1567, /* GL_TEXTURE_1D */ + 1569, /* GL_TEXTURE_2D */ + 458, /* GL_FEEDBACK_BUFFER_POINTER */ + 459, /* GL_FEEDBACK_BUFFER_SIZE */ + 460, /* GL_FEEDBACK_BUFFER_TYPE */ + 1385, /* GL_SELECTION_BUFFER_POINTER */ + 1386, /* GL_SELECTION_BUFFER_SIZE */ + 1681, /* GL_TEXTURE_WIDTH */ + 1648, /* GL_TEXTURE_HEIGHT */ + 1604, /* GL_TEXTURE_COMPONENTS */ + 1588, /* GL_TEXTURE_BORDER_COLOR */ + 1587, /* GL_TEXTURE_BORDER */ + 364, /* GL_DONT_CARE */ + 456, /* GL_FASTEST */ + 997, /* GL_NICEST */ 47, /* GL_AMBIENT */ - 342, /* GL_DIFFUSE */ - 1373, /* GL_SPECULAR */ - 1113, /* GL_POSITION */ - 1376, /* GL_SPOT_DIRECTION */ - 1377, /* GL_SPOT_EXPONENT */ - 1375, /* GL_SPOT_CUTOFF */ - 245, /* GL_CONSTANT_ATTENUATION */ - 640, /* GL_LINEAR_ATTENUATION */ - 1210, /* GL_QUADRATIC_ATTENUATION */ - 219, /* GL_COMPILE */ - 220, /* GL_COMPILE_AND_EXECUTE */ - 111, /* GL_BYTE */ - 1654, /* GL_UNSIGNED_BYTE */ - 1344, /* GL_SHORT */ - 1663, /* GL_UNSIGNED_SHORT */ - 592, /* GL_INT */ - 1657, /* GL_UNSIGNED_INT */ - 444, /* GL_FLOAT */ + 361, /* GL_DIFFUSE */ + 1428, /* GL_SPECULAR */ + 1156, /* GL_POSITION */ + 1431, /* GL_SPOT_DIRECTION */ + 1432, /* GL_SPOT_EXPONENT */ + 1430, /* GL_SPOT_CUTOFF */ + 260, /* GL_CONSTANT_ATTENUATION */ + 682, /* GL_LINEAR_ATTENUATION */ + 1253, /* GL_QUADRATIC_ATTENUATION */ + 234, /* GL_COMPILE */ + 235, /* GL_COMPILE_AND_EXECUTE */ + 110, /* GL_BYTE */ + 1712, /* GL_UNSIGNED_BYTE */ + 1399, /* GL_SHORT */ + 1723, /* GL_UNSIGNED_SHORT */ + 633, /* GL_INT */ + 1715, /* GL_UNSIGNED_INT */ + 463, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 352, /* GL_DOUBLE */ - 123, /* GL_CLEAR */ + 371, /* GL_DOUBLE */ + 122, /* GL_CLEAR */ 49, /* GL_AND */ 51, /* GL_AND_REVERSE */ - 269, /* GL_COPY */ + 284, /* GL_COPY */ 50, /* GL_AND_INVERTED */ - 956, /* GL_NOOP */ - 1744, /* GL_XOR */ - 1018, /* GL_OR */ - 957, /* GL_NOR */ - 427, /* GL_EQUIV */ - 618, /* GL_INVERT */ - 1021, /* GL_OR_REVERSE */ - 270, /* GL_COPY_INVERTED */ - 1020, /* GL_OR_INVERTED */ - 947, /* GL_NAND */ - 1335, /* GL_SET */ - 424, /* GL_EMISSION */ - 1343, /* GL_SHININESS */ + 999, /* GL_NOOP */ + 1804, /* GL_XOR */ + 1061, /* GL_OR */ + 1000, /* GL_NOR */ + 446, /* GL_EQUIV */ + 660, /* GL_INVERT */ + 1064, /* GL_OR_REVERSE */ + 285, /* GL_COPY_INVERTED */ + 1063, /* GL_OR_INVERTED */ + 990, /* GL_NAND */ + 1390, /* GL_SET */ + 443, /* GL_EMISSION */ + 1398, /* GL_SHININESS */ 48, /* GL_AMBIENT_AND_DIFFUSE */ - 165, /* GL_COLOR_INDEXES */ - 897, /* GL_MODELVIEW */ - 1189, /* GL_PROJECTION */ - 1445, /* GL_TEXTURE */ - 138, /* GL_COLOR */ - 313, /* GL_DEPTH */ - 1395, /* GL_STENCIL */ - 164, /* GL_COLOR_INDEX */ - 1413, /* GL_STENCIL_INDEX */ - 322, /* GL_DEPTH_COMPONENT */ - 1230, /* GL_RED */ - 548, /* GL_GREEN */ - 89, /* GL_BLUE */ + 180, /* GL_COLOR_INDEXES */ + 940, /* GL_MODELVIEW */ + 1232, /* GL_PROJECTION */ + 1502, /* GL_TEXTURE */ + 137, /* GL_COLOR */ + 328, /* GL_DEPTH */ + 1451, /* GL_STENCIL */ + 179, /* GL_COLOR_INDEX */ + 1470, /* GL_STENCIL_INDEX */ + 339, /* GL_DEPTH_COMPONENT */ + 1274, /* GL_RED */ + 588, /* GL_GREEN */ + 88, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1254, /* GL_RGB */ - 1273, /* GL_RGBA */ - 668, /* GL_LUMINANCE */ - 689, /* GL_LUMINANCE_ALPHA */ - 73, /* GL_BITMAP */ - 1069, /* GL_POINT */ - 638, /* GL_LINE */ - 442, /* GL_FILL */ - 1239, /* GL_RENDER */ - 438, /* GL_FEEDBACK */ - 1329, /* GL_SELECT */ - 443, /* GL_FLAT */ - 1348, /* GL_SMOOTH */ - 619, /* GL_KEEP */ - 1248, /* GL_REPLACE */ - 575, /* GL_INCR */ - 309, /* GL_DECR */ - 1678, /* GL_VENDOR */ - 1245, /* GL_RENDERER */ - 1679, /* GL_VERSION */ - 431, /* GL_EXTENSIONS */ - 1294, /* GL_S */ - 1436, /* GL_T */ - 1220, /* GL_R */ - 1209, /* GL_Q */ - 933, /* GL_MODULATE */ - 308, /* GL_DECAL */ - 1581, /* GL_TEXTURE_ENV_MODE */ - 1580, /* GL_TEXTURE_ENV_COLOR */ - 1579, /* GL_TEXTURE_ENV */ - 432, /* GL_EYE_LINEAR */ - 980, /* GL_OBJECT_LINEAR */ - 1374, /* GL_SPHERE_MAP */ - 1583, /* GL_TEXTURE_GEN_MODE */ - 982, /* GL_OBJECT_PLANE */ - 433, /* GL_EYE_PLANE */ - 948, /* GL_NEAREST */ - 639, /* GL_LINEAR */ - 952, /* GL_NEAREST_MIPMAP_NEAREST */ - 644, /* GL_LINEAR_MIPMAP_NEAREST */ - 951, /* GL_NEAREST_MIPMAP_LINEAR */ - 643, /* GL_LINEAR_MIPMAP_LINEAR */ - 1604, /* GL_TEXTURE_MAG_FILTER */ - 1612, /* GL_TEXTURE_MIN_FILTER */ - 1625, /* GL_TEXTURE_WRAP_S */ - 1626, /* GL_TEXTURE_WRAP_T */ - 117, /* GL_CLAMP */ - 1247, /* GL_REPEAT */ - 1107, /* GL_POLYGON_OFFSET_UNITS */ - 1106, /* GL_POLYGON_OFFSET_POINT */ - 1105, /* GL_POLYGON_OFFSET_LINE */ - 1221, /* GL_R3_G3_B2 */ - 1675, /* GL_V2F */ - 1676, /* GL_V3F */ - 114, /* GL_C4UB_V2F */ - 115, /* GL_C4UB_V3F */ - 112, /* GL_C3F_V3F */ - 945, /* GL_N3F_V3F */ - 113, /* GL_C4F_N3F_V3F */ - 1441, /* GL_T2F_V3F */ - 1443, /* GL_T4F_V4F */ - 1439, /* GL_T2F_C4UB_V3F */ - 1437, /* GL_T2F_C3F_V3F */ - 1440, /* GL_T2F_N3F_V3F */ - 1438, /* GL_T2F_C4F_N3F_V3F */ - 1442, /* GL_T4F_C4F_N3F_V4F */ - 130, /* GL_CLIP_PLANE0 */ - 131, /* GL_CLIP_PLANE1 */ - 132, /* GL_CLIP_PLANE2 */ - 133, /* GL_CLIP_PLANE3 */ - 134, /* GL_CLIP_PLANE4 */ - 135, /* GL_CLIP_PLANE5 */ - 623, /* GL_LIGHT0 */ - 624, /* GL_LIGHT1 */ - 625, /* GL_LIGHT2 */ - 626, /* GL_LIGHT3 */ - 627, /* GL_LIGHT4 */ - 628, /* GL_LIGHT5 */ - 629, /* GL_LIGHT6 */ - 630, /* GL_LIGHT7 */ - 552, /* GL_HINT_BIT */ - 247, /* GL_CONSTANT_COLOR */ - 992, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 242, /* GL_CONSTANT_ALPHA */ - 990, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - 76, /* GL_BLEND_COLOR */ - 512, /* GL_FUNC_ADD */ - 881, /* GL_MIN */ - 793, /* GL_MAX */ - 81, /* GL_BLEND_EQUATION */ - 516, /* GL_FUNC_SUBTRACT */ - 514, /* GL_FUNC_REVERSE_SUBTRACT */ - 250, /* GL_CONVOLUTION_1D */ - 251, /* GL_CONVOLUTION_2D */ - 1332, /* GL_SEPARABLE_2D */ - 254, /* GL_CONVOLUTION_BORDER_MODE */ - 258, /* GL_CONVOLUTION_FILTER_SCALE */ - 256, /* GL_CONVOLUTION_FILTER_BIAS */ - 1231, /* GL_REDUCE */ - 260, /* GL_CONVOLUTION_FORMAT */ - 264, /* GL_CONVOLUTION_WIDTH */ - 262, /* GL_CONVOLUTION_HEIGHT */ - 808, /* GL_MAX_CONVOLUTION_WIDTH */ - 806, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1146, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1142, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1137, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1133, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1144, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1140, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1135, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1131, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 553, /* GL_HISTOGRAM */ - 1193, /* GL_PROXY_HISTOGRAM */ - 569, /* GL_HISTOGRAM_WIDTH */ - 559, /* GL_HISTOGRAM_FORMAT */ - 565, /* GL_HISTOGRAM_RED_SIZE */ - 561, /* GL_HISTOGRAM_GREEN_SIZE */ - 556, /* GL_HISTOGRAM_BLUE_SIZE */ - 554, /* GL_HISTOGRAM_ALPHA_SIZE */ - 563, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 567, /* GL_HISTOGRAM_SINK */ - 882, /* GL_MINMAX */ - 884, /* GL_MINMAX_FORMAT */ - 886, /* GL_MINMAX_SINK */ - 1444, /* GL_TABLE_TOO_LARGE_EXT */ - 1656, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1665, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1667, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1661, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1658, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1104, /* GL_POLYGON_OFFSET_FILL */ - 1103, /* GL_POLYGON_OFFSET_FACTOR */ - 1102, /* GL_POLYGON_OFFSET_BIAS */ - 1251, /* GL_RESCALE_NORMAL */ + 1309, /* GL_RGB */ + 1328, /* GL_RGBA */ + 710, /* GL_LUMINANCE */ + 731, /* GL_LUMINANCE_ALPHA */ + 72, /* GL_BITMAP */ + 1112, /* GL_POINT */ + 680, /* GL_LINE */ + 461, /* GL_FILL */ + 1283, /* GL_RENDER */ + 457, /* GL_FEEDBACK */ + 1384, /* GL_SELECT */ + 462, /* GL_FLAT */ + 1403, /* GL_SMOOTH */ + 661, /* GL_KEEP */ + 1303, /* GL_REPLACE */ + 615, /* GL_INCR */ + 324, /* GL_DECR */ + 1738, /* GL_VENDOR */ + 1300, /* GL_RENDERER */ + 1739, /* GL_VERSION */ + 450, /* GL_EXTENSIONS */ + 1349, /* GL_S */ + 1493, /* GL_T */ + 1263, /* GL_R */ + 1252, /* GL_Q */ + 976, /* GL_MODULATE */ + 323, /* GL_DECAL */ + 1638, /* GL_TEXTURE_ENV_MODE */ + 1637, /* GL_TEXTURE_ENV_COLOR */ + 1636, /* GL_TEXTURE_ENV */ + 451, /* GL_EYE_LINEAR */ + 1023, /* GL_OBJECT_LINEAR */ + 1429, /* GL_SPHERE_MAP */ + 1640, /* GL_TEXTURE_GEN_MODE */ + 1025, /* GL_OBJECT_PLANE */ + 452, /* GL_EYE_PLANE */ + 991, /* GL_NEAREST */ + 681, /* GL_LINEAR */ + 995, /* GL_NEAREST_MIPMAP_NEAREST */ + 686, /* GL_LINEAR_MIPMAP_NEAREST */ + 994, /* GL_NEAREST_MIPMAP_LINEAR */ + 685, /* GL_LINEAR_MIPMAP_LINEAR */ + 1661, /* GL_TEXTURE_MAG_FILTER */ + 1669, /* GL_TEXTURE_MIN_FILTER */ + 1683, /* GL_TEXTURE_WRAP_S */ + 1684, /* GL_TEXTURE_WRAP_T */ + 116, /* GL_CLAMP */ + 1302, /* GL_REPEAT */ + 1150, /* GL_POLYGON_OFFSET_UNITS */ + 1149, /* GL_POLYGON_OFFSET_POINT */ + 1148, /* GL_POLYGON_OFFSET_LINE */ + 1264, /* GL_R3_G3_B2 */ + 1735, /* GL_V2F */ + 1736, /* GL_V3F */ + 113, /* GL_C4UB_V2F */ + 114, /* GL_C4UB_V3F */ + 111, /* GL_C3F_V3F */ + 988, /* GL_N3F_V3F */ + 112, /* GL_C4F_N3F_V3F */ + 1498, /* GL_T2F_V3F */ + 1500, /* GL_T4F_V4F */ + 1496, /* GL_T2F_C4UB_V3F */ + 1494, /* GL_T2F_C3F_V3F */ + 1497, /* GL_T2F_N3F_V3F */ + 1495, /* GL_T2F_C4F_N3F_V3F */ + 1499, /* GL_T4F_C4F_N3F_V4F */ + 129, /* GL_CLIP_PLANE0 */ + 130, /* GL_CLIP_PLANE1 */ + 131, /* GL_CLIP_PLANE2 */ + 132, /* GL_CLIP_PLANE3 */ + 133, /* GL_CLIP_PLANE4 */ + 134, /* GL_CLIP_PLANE5 */ + 665, /* GL_LIGHT0 */ + 666, /* GL_LIGHT1 */ + 667, /* GL_LIGHT2 */ + 668, /* GL_LIGHT3 */ + 669, /* GL_LIGHT4 */ + 670, /* GL_LIGHT5 */ + 671, /* GL_LIGHT6 */ + 672, /* GL_LIGHT7 */ + 592, /* GL_HINT_BIT */ + 262, /* GL_CONSTANT_COLOR */ + 1035, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 257, /* GL_CONSTANT_ALPHA */ + 1033, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 75, /* GL_BLEND_COLOR */ + 552, /* GL_FUNC_ADD */ + 924, /* GL_MIN */ + 835, /* GL_MAX */ + 80, /* GL_BLEND_EQUATION */ + 556, /* GL_FUNC_SUBTRACT */ + 554, /* GL_FUNC_REVERSE_SUBTRACT */ + 265, /* GL_CONVOLUTION_1D */ + 266, /* GL_CONVOLUTION_2D */ + 1387, /* GL_SEPARABLE_2D */ + 269, /* GL_CONVOLUTION_BORDER_MODE */ + 273, /* GL_CONVOLUTION_FILTER_SCALE */ + 271, /* GL_CONVOLUTION_FILTER_BIAS */ + 1275, /* GL_REDUCE */ + 275, /* GL_CONVOLUTION_FORMAT */ + 279, /* GL_CONVOLUTION_WIDTH */ + 277, /* GL_CONVOLUTION_HEIGHT */ + 850, /* GL_MAX_CONVOLUTION_WIDTH */ + 848, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1189, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1185, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1180, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1176, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1187, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1183, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1178, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1174, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 593, /* GL_HISTOGRAM */ + 1236, /* GL_PROXY_HISTOGRAM */ + 609, /* GL_HISTOGRAM_WIDTH */ + 599, /* GL_HISTOGRAM_FORMAT */ + 605, /* GL_HISTOGRAM_RED_SIZE */ + 601, /* GL_HISTOGRAM_GREEN_SIZE */ + 596, /* GL_HISTOGRAM_BLUE_SIZE */ + 594, /* GL_HISTOGRAM_ALPHA_SIZE */ + 603, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 607, /* GL_HISTOGRAM_SINK */ + 925, /* GL_MINMAX */ + 927, /* GL_MINMAX_FORMAT */ + 929, /* GL_MINMAX_SINK */ + 1501, /* GL_TABLE_TOO_LARGE_EXT */ + 1714, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1725, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1727, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1720, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1716, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1147, /* GL_POLYGON_OFFSET_FILL */ + 1146, /* GL_POLYGON_OFFSET_FACTOR */ + 1145, /* GL_POLYGON_OFFSET_BIAS */ + 1306, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 679, /* GL_LUMINANCE4 */ - 685, /* GL_LUMINANCE8 */ - 669, /* GL_LUMINANCE12 */ - 675, /* GL_LUMINANCE16 */ - 680, /* GL_LUMINANCE4_ALPHA4 */ - 683, /* GL_LUMINANCE6_ALPHA2 */ - 686, /* GL_LUMINANCE8_ALPHA8 */ - 672, /* GL_LUMINANCE12_ALPHA4 */ - 670, /* GL_LUMINANCE12_ALPHA12 */ - 676, /* GL_LUMINANCE16_ALPHA16 */ - 593, /* GL_INTENSITY */ - 598, /* GL_INTENSITY4 */ - 600, /* GL_INTENSITY8 */ - 594, /* GL_INTENSITY12 */ - 596, /* GL_INTENSITY16 */ - 1263, /* GL_RGB2_EXT */ - 1264, /* GL_RGB4 */ - 1267, /* GL_RGB5 */ - 1271, /* GL_RGB8 */ - 1255, /* GL_RGB10 */ - 1259, /* GL_RGB12 */ - 1261, /* GL_RGB16 */ - 1278, /* GL_RGBA2 */ - 1280, /* GL_RGBA4 */ - 1268, /* GL_RGB5_A1 */ - 1284, /* GL_RGBA8 */ - 1256, /* GL_RGB10_A2 */ - 1274, /* GL_RGBA12 */ - 1276, /* GL_RGBA16 */ - 1617, /* GL_TEXTURE_RED_SIZE */ - 1589, /* GL_TEXTURE_GREEN_SIZE */ - 1528, /* GL_TEXTURE_BLUE_SIZE */ - 1515, /* GL_TEXTURE_ALPHA_SIZE */ - 1602, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1593, /* GL_TEXTURE_INTENSITY_SIZE */ - 1249, /* GL_REPLACE_EXT */ - 1197, /* GL_PROXY_TEXTURE_1D */ - 1200, /* GL_PROXY_TEXTURE_2D */ - 1621, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1614, /* GL_TEXTURE_PRIORITY */ - 1619, /* GL_TEXTURE_RESIDENT */ - 1518, /* GL_TEXTURE_BINDING_1D */ - 1520, /* GL_TEXTURE_BINDING_2D */ - 1522, /* GL_TEXTURE_BINDING_3D */ - 1028, /* GL_PACK_SKIP_IMAGES */ - 1024, /* GL_PACK_IMAGE_HEIGHT */ - 1650, /* GL_UNPACK_SKIP_IMAGES */ - 1647, /* GL_UNPACK_IMAGE_HEIGHT */ - 1514, /* GL_TEXTURE_3D */ - 1203, /* GL_PROXY_TEXTURE_3D */ - 1576, /* GL_TEXTURE_DEPTH */ - 1624, /* GL_TEXTURE_WRAP_R */ - 794, /* GL_MAX_3D_TEXTURE_SIZE */ - 1680, /* GL_VERTEX_ARRAY */ - 959, /* GL_NORMAL_ARRAY */ - 139, /* GL_COLOR_ARRAY */ - 578, /* GL_INDEX_ARRAY */ - 1555, /* GL_TEXTURE_COORD_ARRAY */ - 415, /* GL_EDGE_FLAG_ARRAY */ - 1685, /* GL_VERTEX_ARRAY_SIZE */ - 1687, /* GL_VERTEX_ARRAY_TYPE */ - 1686, /* GL_VERTEX_ARRAY_STRIDE */ - 964, /* GL_NORMAL_ARRAY_TYPE */ - 963, /* GL_NORMAL_ARRAY_STRIDE */ - 143, /* GL_COLOR_ARRAY_SIZE */ - 145, /* GL_COLOR_ARRAY_TYPE */ - 144, /* GL_COLOR_ARRAY_STRIDE */ - 583, /* GL_INDEX_ARRAY_TYPE */ - 582, /* GL_INDEX_ARRAY_STRIDE */ - 1559, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1561, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1560, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 419, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1684, /* GL_VERTEX_ARRAY_POINTER */ - 962, /* GL_NORMAL_ARRAY_POINTER */ - 142, /* GL_COLOR_ARRAY_POINTER */ - 581, /* GL_INDEX_ARRAY_POINTER */ - 1558, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 418, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 938, /* GL_MULTISAMPLE */ - 1306, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1308, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1313, /* GL_SAMPLE_COVERAGE */ - 1310, /* GL_SAMPLE_BUFFERS */ - 1301, /* GL_SAMPLES */ - 1317, /* GL_SAMPLE_COVERAGE_VALUE */ - 1315, /* GL_SAMPLE_COVERAGE_INVERT */ - 170, /* GL_COLOR_MATRIX */ - 172, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 802, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1129, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1125, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1120, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1116, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1127, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1123, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1118, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1114, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1538, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1204, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1540, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - 80, /* GL_BLEND_DST_RGB */ - 88, /* GL_BLEND_SRC_RGB */ - 79, /* GL_BLEND_DST_ALPHA */ - 87, /* GL_BLEND_SRC_ALPHA */ - 176, /* GL_COLOR_TABLE */ - 1139, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1122, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1192, /* GL_PROXY_COLOR_TABLE */ - 1196, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1195, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - 200, /* GL_COLOR_TABLE_SCALE */ - 180, /* GL_COLOR_TABLE_BIAS */ - 185, /* GL_COLOR_TABLE_FORMAT */ - 202, /* GL_COLOR_TABLE_WIDTH */ - 197, /* GL_COLOR_TABLE_RED_SIZE */ - 188, /* GL_COLOR_TABLE_GREEN_SIZE */ - 182, /* GL_COLOR_TABLE_BLUE_SIZE */ - 177, /* GL_COLOR_TABLE_ALPHA_SIZE */ - 194, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - 191, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - 71, /* GL_BGR */ - 72, /* GL_BGRA */ - 816, /* GL_MAX_ELEMENTS_VERTICES */ - 815, /* GL_MAX_ELEMENTS_INDICES */ - 1592, /* GL_TEXTURE_INDEX_SIZE_EXT */ - 136, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1086, /* GL_POINT_SIZE_MIN */ - 1082, /* GL_POINT_SIZE_MAX */ - 1076, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1072, /* GL_POINT_DISTANCE_ATTENUATION */ - 118, /* GL_CLAMP_TO_BORDER */ - 121, /* GL_CLAMP_TO_EDGE */ - 1613, /* GL_TEXTURE_MIN_LOD */ - 1611, /* GL_TEXTURE_MAX_LOD */ - 1517, /* GL_TEXTURE_BASE_LEVEL */ - 1610, /* GL_TEXTURE_MAX_LEVEL */ - 572, /* GL_IGNORE_BORDER_HP */ - 246, /* GL_CONSTANT_BORDER_HP */ - 1250, /* GL_REPLICATE_BORDER_HP */ - 252, /* GL_CONVOLUTION_BORDER_COLOR */ - 987, /* GL_OCCLUSION_TEST_HP */ - 988, /* GL_OCCLUSION_TEST_RESULT_HP */ - 641, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1532, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1534, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1536, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1537, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1535, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1533, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 798, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 799, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1149, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1151, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1148, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1150, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1600, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1601, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1599, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 518, /* GL_GENERATE_MIPMAP */ - 519, /* GL_GENERATE_MIPMAP_HINT */ - 481, /* GL_FOG_OFFSET_SGIX */ - 482, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1546, /* GL_TEXTURE_COMPARE_SGIX */ - 1545, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1596, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1588, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 323, /* GL_DEPTH_COMPONENT16 */ - 326, /* GL_DEPTH_COMPONENT24 */ - 329, /* GL_DEPTH_COMPONENT32 */ - 274, /* GL_CULL_VERTEX_EXT */ - 276, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - 275, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1741, /* GL_WRAP_BORDER_SUN */ - 1539, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 634, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1345, /* GL_SINGLE_COLOR */ - 1333, /* GL_SEPARATE_SPECULAR_COLOR */ - 1342, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 1655, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1668, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1669, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1666, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1664, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1662, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1660, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1608, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1609, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1607, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 889, /* GL_MIRRORED_REPEAT */ - 1289, /* GL_RGB_S3TC */ - 1266, /* GL_RGB4_S3TC */ - 1288, /* GL_RGBA_S3TC */ - 1283, /* GL_RGBA4_S3TC */ - 1286, /* GL_RGBA_DXT5_S3TC */ - 1281, /* GL_RGBA4_DXT5_S3TC */ - 239, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - 234, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - 235, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - 236, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 950, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 949, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 642, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 468, /* GL_FOG_COORDINATE_SOURCE */ - 460, /* GL_FOG_COORD */ - 484, /* GL_FRAGMENT_DEPTH */ - 280, /* GL_CURRENT_FOG_COORD */ - 467, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 466, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 465, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 462, /* GL_FOG_COORDINATE_ARRAY */ - 174, /* GL_COLOR_SUM */ - 299, /* GL_CURRENT_SECONDARY_COLOR */ - 1326, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1328, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1327, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1325, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1322, /* GL_SECONDARY_COLOR_ARRAY */ - 528, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + 721, /* GL_LUMINANCE4 */ + 727, /* GL_LUMINANCE8 */ + 711, /* GL_LUMINANCE12 */ + 717, /* GL_LUMINANCE16 */ + 722, /* GL_LUMINANCE4_ALPHA4 */ + 725, /* GL_LUMINANCE6_ALPHA2 */ + 728, /* GL_LUMINANCE8_ALPHA8 */ + 714, /* GL_LUMINANCE12_ALPHA4 */ + 712, /* GL_LUMINANCE12_ALPHA12 */ + 718, /* GL_LUMINANCE16_ALPHA16 */ + 634, /* GL_INTENSITY */ + 639, /* GL_INTENSITY4 */ + 641, /* GL_INTENSITY8 */ + 635, /* GL_INTENSITY12 */ + 637, /* GL_INTENSITY16 */ + 1318, /* GL_RGB2_EXT */ + 1319, /* GL_RGB4 */ + 1322, /* GL_RGB5 */ + 1326, /* GL_RGB8 */ + 1310, /* GL_RGB10 */ + 1314, /* GL_RGB12 */ + 1316, /* GL_RGB16 */ + 1333, /* GL_RGBA2 */ + 1335, /* GL_RGBA4 */ + 1323, /* GL_RGB5_A1 */ + 1339, /* GL_RGBA8 */ + 1311, /* GL_RGB10_A2 */ + 1329, /* GL_RGBA12 */ + 1331, /* GL_RGBA16 */ + 1674, /* GL_TEXTURE_RED_SIZE */ + 1646, /* GL_TEXTURE_GREEN_SIZE */ + 1585, /* GL_TEXTURE_BLUE_SIZE */ + 1572, /* GL_TEXTURE_ALPHA_SIZE */ + 1659, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1650, /* GL_TEXTURE_INTENSITY_SIZE */ + 1304, /* GL_REPLACE_EXT */ + 1240, /* GL_PROXY_TEXTURE_1D */ + 1243, /* GL_PROXY_TEXTURE_2D */ + 1679, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1671, /* GL_TEXTURE_PRIORITY */ + 1676, /* GL_TEXTURE_RESIDENT */ + 1575, /* GL_TEXTURE_BINDING_1D */ + 1577, /* GL_TEXTURE_BINDING_2D */ + 1579, /* GL_TEXTURE_BINDING_3D */ + 1071, /* GL_PACK_SKIP_IMAGES */ + 1067, /* GL_PACK_IMAGE_HEIGHT */ + 1708, /* GL_UNPACK_SKIP_IMAGES */ + 1705, /* GL_UNPACK_IMAGE_HEIGHT */ + 1571, /* GL_TEXTURE_3D */ + 1246, /* GL_PROXY_TEXTURE_3D */ + 1633, /* GL_TEXTURE_DEPTH */ + 1682, /* GL_TEXTURE_WRAP_R */ + 836, /* GL_MAX_3D_TEXTURE_SIZE */ + 1740, /* GL_VERTEX_ARRAY */ + 1002, /* GL_NORMAL_ARRAY */ + 138, /* GL_COLOR_ARRAY */ + 619, /* GL_INDEX_ARRAY */ + 1612, /* GL_TEXTURE_COORD_ARRAY */ + 435, /* GL_EDGE_FLAG_ARRAY */ + 1745, /* GL_VERTEX_ARRAY_SIZE */ + 1747, /* GL_VERTEX_ARRAY_TYPE */ + 1746, /* GL_VERTEX_ARRAY_STRIDE */ + 1007, /* GL_NORMAL_ARRAY_TYPE */ + 1006, /* GL_NORMAL_ARRAY_STRIDE */ + 142, /* GL_COLOR_ARRAY_SIZE */ + 144, /* GL_COLOR_ARRAY_TYPE */ + 143, /* GL_COLOR_ARRAY_STRIDE */ + 624, /* GL_INDEX_ARRAY_TYPE */ + 623, /* GL_INDEX_ARRAY_STRIDE */ + 1616, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1618, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1617, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 439, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1744, /* GL_VERTEX_ARRAY_POINTER */ + 1005, /* GL_NORMAL_ARRAY_POINTER */ + 141, /* GL_COLOR_ARRAY_POINTER */ + 622, /* GL_INDEX_ARRAY_POINTER */ + 1615, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 438, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 981, /* GL_MULTISAMPLE */ + 1361, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1363, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1368, /* GL_SAMPLE_COVERAGE */ + 1365, /* GL_SAMPLE_BUFFERS */ + 1356, /* GL_SAMPLES */ + 1372, /* GL_SAMPLE_COVERAGE_VALUE */ + 1370, /* GL_SAMPLE_COVERAGE_INVERT */ + 185, /* GL_COLOR_MATRIX */ + 187, /* GL_COLOR_MATRIX_STACK_DEPTH */ + 844, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1172, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1168, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1163, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1159, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1170, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1166, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1161, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1157, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1595, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1247, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1597, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 79, /* GL_BLEND_DST_RGB */ + 87, /* GL_BLEND_SRC_RGB */ + 78, /* GL_BLEND_DST_ALPHA */ + 86, /* GL_BLEND_SRC_ALPHA */ + 191, /* GL_COLOR_TABLE */ + 1182, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1165, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1235, /* GL_PROXY_COLOR_TABLE */ + 1239, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1238, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 215, /* GL_COLOR_TABLE_SCALE */ + 195, /* GL_COLOR_TABLE_BIAS */ + 200, /* GL_COLOR_TABLE_FORMAT */ + 217, /* GL_COLOR_TABLE_WIDTH */ + 212, /* GL_COLOR_TABLE_RED_SIZE */ + 203, /* GL_COLOR_TABLE_GREEN_SIZE */ + 197, /* GL_COLOR_TABLE_BLUE_SIZE */ + 192, /* GL_COLOR_TABLE_ALPHA_SIZE */ + 209, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + 206, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + 70, /* GL_BGR */ + 71, /* GL_BGRA */ + 858, /* GL_MAX_ELEMENTS_VERTICES */ + 857, /* GL_MAX_ELEMENTS_INDICES */ + 1649, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 135, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + 1129, /* GL_POINT_SIZE_MIN */ + 1125, /* GL_POINT_SIZE_MAX */ + 1119, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1115, /* GL_POINT_DISTANCE_ATTENUATION */ + 117, /* GL_CLAMP_TO_BORDER */ + 120, /* GL_CLAMP_TO_EDGE */ + 1670, /* GL_TEXTURE_MIN_LOD */ + 1668, /* GL_TEXTURE_MAX_LOD */ + 1574, /* GL_TEXTURE_BASE_LEVEL */ + 1667, /* GL_TEXTURE_MAX_LEVEL */ + 612, /* GL_IGNORE_BORDER_HP */ + 261, /* GL_CONSTANT_BORDER_HP */ + 1305, /* GL_REPLICATE_BORDER_HP */ + 267, /* GL_CONVOLUTION_BORDER_COLOR */ + 1030, /* GL_OCCLUSION_TEST_HP */ + 1031, /* GL_OCCLUSION_TEST_RESULT_HP */ + 683, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1589, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1591, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1593, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1594, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1592, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1590, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 840, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 841, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1192, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1194, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1191, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1193, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1657, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1658, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1656, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 558, /* GL_GENERATE_MIPMAP */ + 559, /* GL_GENERATE_MIPMAP_HINT */ + 500, /* GL_FOG_OFFSET_SGIX */ + 501, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1603, /* GL_TEXTURE_COMPARE_SGIX */ + 1602, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1653, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1645, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 340, /* GL_DEPTH_COMPONENT16 */ + 343, /* GL_DEPTH_COMPONENT24 */ + 346, /* GL_DEPTH_COMPONENT32 */ + 289, /* GL_CULL_VERTEX_EXT */ + 291, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + 290, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + 1801, /* GL_WRAP_BORDER_SUN */ + 1596, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 676, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1400, /* GL_SINGLE_COLOR */ + 1388, /* GL_SEPARATE_SPECULAR_COLOR */ + 1397, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 511, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 512, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 519, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 514, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 510, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 509, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 513, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 520, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 531, /* GL_FRAMEBUFFER_DEFAULT */ + 544, /* GL_FRAMEBUFFER_UNDEFINED */ + 353, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 618, /* GL_INDEX */ + 1713, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1728, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1729, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1726, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1724, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1721, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1719, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1665, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1666, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1664, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 932, /* GL_MIRRORED_REPEAT */ + 1344, /* GL_RGB_S3TC */ + 1321, /* GL_RGB4_S3TC */ + 1343, /* GL_RGBA_S3TC */ + 1338, /* GL_RGBA4_S3TC */ + 1341, /* GL_RGBA_DXT5_S3TC */ + 1336, /* GL_RGBA4_DXT5_S3TC */ + 254, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + 249, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + 250, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + 251, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + 993, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 992, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 684, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 487, /* GL_FOG_COORDINATE_SOURCE */ + 479, /* GL_FOG_COORD */ + 503, /* GL_FRAGMENT_DEPTH */ + 295, /* GL_CURRENT_FOG_COORD */ + 486, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 485, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 484, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 481, /* GL_FOG_COORDINATE_ARRAY */ + 189, /* GL_COLOR_SUM */ + 314, /* GL_CURRENT_SECONDARY_COLOR */ + 1381, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1383, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1382, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1380, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1377, /* GL_SECONDARY_COLOR_ARRAY */ + 568, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1446, /* GL_TEXTURE0 */ - 1448, /* GL_TEXTURE1 */ - 1470, /* GL_TEXTURE2 */ - 1492, /* GL_TEXTURE3 */ - 1498, /* GL_TEXTURE4 */ - 1500, /* GL_TEXTURE5 */ - 1502, /* GL_TEXTURE6 */ - 1504, /* GL_TEXTURE7 */ - 1506, /* GL_TEXTURE8 */ - 1508, /* GL_TEXTURE9 */ - 1449, /* GL_TEXTURE10 */ - 1451, /* GL_TEXTURE11 */ - 1453, /* GL_TEXTURE12 */ - 1455, /* GL_TEXTURE13 */ - 1457, /* GL_TEXTURE14 */ - 1459, /* GL_TEXTURE15 */ - 1461, /* GL_TEXTURE16 */ - 1463, /* GL_TEXTURE17 */ - 1465, /* GL_TEXTURE18 */ - 1467, /* GL_TEXTURE19 */ - 1471, /* GL_TEXTURE20 */ - 1473, /* GL_TEXTURE21 */ - 1475, /* GL_TEXTURE22 */ - 1477, /* GL_TEXTURE23 */ - 1479, /* GL_TEXTURE24 */ - 1481, /* GL_TEXTURE25 */ - 1483, /* GL_TEXTURE26 */ - 1485, /* GL_TEXTURE27 */ - 1487, /* GL_TEXTURE28 */ - 1489, /* GL_TEXTURE29 */ - 1493, /* GL_TEXTURE30 */ - 1495, /* GL_TEXTURE31 */ + 1503, /* GL_TEXTURE0 */ + 1505, /* GL_TEXTURE1 */ + 1527, /* GL_TEXTURE2 */ + 1549, /* GL_TEXTURE3 */ + 1555, /* GL_TEXTURE4 */ + 1557, /* GL_TEXTURE5 */ + 1559, /* GL_TEXTURE6 */ + 1561, /* GL_TEXTURE7 */ + 1563, /* GL_TEXTURE8 */ + 1565, /* GL_TEXTURE9 */ + 1506, /* GL_TEXTURE10 */ + 1508, /* GL_TEXTURE11 */ + 1510, /* GL_TEXTURE12 */ + 1512, /* GL_TEXTURE13 */ + 1514, /* GL_TEXTURE14 */ + 1516, /* GL_TEXTURE15 */ + 1518, /* GL_TEXTURE16 */ + 1520, /* GL_TEXTURE17 */ + 1522, /* GL_TEXTURE18 */ + 1524, /* GL_TEXTURE19 */ + 1528, /* GL_TEXTURE20 */ + 1530, /* GL_TEXTURE21 */ + 1532, /* GL_TEXTURE22 */ + 1534, /* GL_TEXTURE23 */ + 1536, /* GL_TEXTURE24 */ + 1538, /* GL_TEXTURE25 */ + 1540, /* GL_TEXTURE26 */ + 1542, /* GL_TEXTURE27 */ + 1544, /* GL_TEXTURE28 */ + 1546, /* GL_TEXTURE29 */ + 1550, /* GL_TEXTURE30 */ + 1552, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ - 124, /* GL_CLIENT_ACTIVE_TEXTURE */ - 867, /* GL_MAX_TEXTURE_UNITS */ - 1634, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1637, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1639, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1631, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1434, /* GL_SUBTRACT */ - 856, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - 222, /* GL_COMPRESSED_ALPHA */ - 226, /* GL_COMPRESSED_LUMINANCE */ - 227, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - 224, /* GL_COMPRESSED_INTENSITY */ - 230, /* GL_COMPRESSED_RGB */ - 231, /* GL_COMPRESSED_RGBA */ - 1553, /* GL_TEXTURE_COMPRESSION_HINT */ - 1615, /* GL_TEXTURE_RECTANGLE_ARB */ - 1525, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1207, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 854, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 335, /* GL_DEPTH_STENCIL_NV */ - 1659, /* GL_UNSIGNED_INT_24_8_NV */ - 863, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1606, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 864, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1582, /* GL_TEXTURE_FILTER_CONTROL */ - 1597, /* GL_TEXTURE_LOD_BIAS */ - 207, /* GL_COMBINE4 */ - 857, /* GL_MAX_SHININESS_NV */ - 858, /* GL_MAX_SPOT_EXPONENT_NV */ - 576, /* GL_INCR_WRAP */ - 310, /* GL_DECR_WRAP */ - 909, /* GL_MODELVIEW1_ARB */ - 965, /* GL_NORMAL_MAP */ - 1236, /* GL_REFLECTION_MAP */ - 1562, /* GL_TEXTURE_CUBE_MAP */ - 1523, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1570, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1564, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1572, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1566, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1574, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1568, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1205, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 810, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 944, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 476, /* GL_FOG_DISTANCE_MODE_NV */ - 435, /* GL_EYE_RADIAL_NV */ - 434, /* GL_EYE_PLANE_ABSOLUTE_NV */ - 206, /* GL_COMBINE */ - 213, /* GL_COMBINE_RGB */ - 208, /* GL_COMBINE_ALPHA */ - 1290, /* GL_RGB_SCALE */ + 123, /* GL_CLIENT_ACTIVE_TEXTURE */ + 910, /* GL_MAX_TEXTURE_UNITS */ + 1692, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1695, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1697, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1689, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1491, /* GL_SUBTRACT */ + 898, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 237, /* GL_COMPRESSED_ALPHA */ + 241, /* GL_COMPRESSED_LUMINANCE */ + 242, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + 239, /* GL_COMPRESSED_INTENSITY */ + 245, /* GL_COMPRESSED_RGB */ + 246, /* GL_COMPRESSED_RGBA */ + 1610, /* GL_TEXTURE_COMPRESSION_HINT */ + 1672, /* GL_TEXTURE_RECTANGLE_ARB */ + 1582, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1250, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 896, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 352, /* GL_DEPTH_STENCIL */ + 1717, /* GL_UNSIGNED_INT_24_8 */ + 906, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1663, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 907, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1639, /* GL_TEXTURE_FILTER_CONTROL */ + 1654, /* GL_TEXTURE_LOD_BIAS */ + 222, /* GL_COMBINE4 */ + 900, /* GL_MAX_SHININESS_NV */ + 901, /* GL_MAX_SPOT_EXPONENT_NV */ + 616, /* GL_INCR_WRAP */ + 325, /* GL_DECR_WRAP */ + 952, /* GL_MODELVIEW1_ARB */ + 1008, /* GL_NORMAL_MAP */ + 1280, /* GL_REFLECTION_MAP */ + 1619, /* GL_TEXTURE_CUBE_MAP */ + 1580, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1627, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1621, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1629, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1623, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1631, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1625, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1248, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 852, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 987, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 495, /* GL_FOG_DISTANCE_MODE_NV */ + 454, /* GL_EYE_RADIAL_NV */ + 453, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 221, /* GL_COMBINE */ + 228, /* GL_COMBINE_RGB */ + 223, /* GL_COMBINE_ALPHA */ + 1345, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 603, /* GL_INTERPOLATE */ - 241, /* GL_CONSTANT */ - 1155, /* GL_PRIMARY_COLOR */ - 1152, /* GL_PREVIOUS */ - 1356, /* GL_SOURCE0_RGB */ - 1362, /* GL_SOURCE1_RGB */ - 1368, /* GL_SOURCE2_RGB */ - 1372, /* GL_SOURCE3_RGB_NV */ - 1353, /* GL_SOURCE0_ALPHA */ - 1359, /* GL_SOURCE1_ALPHA */ - 1365, /* GL_SOURCE2_ALPHA */ - 1371, /* GL_SOURCE3_ALPHA_NV */ - 1001, /* GL_OPERAND0_RGB */ - 1007, /* GL_OPERAND1_RGB */ - 1013, /* GL_OPERAND2_RGB */ - 1017, /* GL_OPERAND3_RGB_NV */ - 998, /* GL_OPERAND0_ALPHA */ - 1004, /* GL_OPERAND1_ALPHA */ - 1010, /* GL_OPERAND2_ALPHA */ - 1016, /* GL_OPERAND3_ALPHA_NV */ - 1681, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - 1745, /* GL_YCBCR_422_APPLE */ - 1670, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1672, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1347, /* GL_SLICE_ACCUM_SUN */ - 1212, /* GL_QUAD_MESH_SUN */ - 1643, /* GL_TRIANGLE_MESH_SUN */ - 1719, /* GL_VERTEX_PROGRAM_ARB */ - 1730, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1706, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1712, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1714, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1716, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - 301, /* GL_CURRENT_VERTEX_ATTRIB */ - 1168, /* GL_PROGRAM_LENGTH_ARB */ - 1182, /* GL_PROGRAM_STRING_ARB */ - 931, /* GL_MODELVIEW_PROJECTION_NV */ - 571, /* GL_IDENTITY_NV */ - 616, /* GL_INVERSE_NV */ - 1636, /* GL_TRANSPOSE_NV */ - 617, /* GL_INVERSE_TRANSPOSE_NV */ - 840, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 839, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 747, /* GL_MATRIX0_NV */ - 759, /* GL_MATRIX1_NV */ - 771, /* GL_MATRIX2_NV */ - 775, /* GL_MATRIX3_NV */ - 777, /* GL_MATRIX4_NV */ - 779, /* GL_MATRIX5_NV */ - 781, /* GL_MATRIX6_NV */ - 783, /* GL_MATRIX7_NV */ - 286, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - 283, /* GL_CURRENT_MATRIX_ARB */ - 1722, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1725, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1180, /* GL_PROGRAM_PARAMETER_NV */ - 1710, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1184, /* GL_PROGRAM_TARGET_NV */ - 1181, /* GL_PROGRAM_RESIDENT_NV */ - 1628, /* GL_TRACK_MATRIX_NV */ - 1629, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1720, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1162, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 320, /* GL_DEPTH_CLAMP_NV */ - 1688, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1695, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1696, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1697, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1698, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1699, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1700, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1701, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1702, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1703, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1689, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1690, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1691, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1692, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1693, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1694, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 701, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 708, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 709, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 710, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 711, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 712, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 713, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 714, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 715, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 716, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 702, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 703, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 704, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 705, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 706, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 707, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 728, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 735, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 736, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 737, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 738, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 739, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 740, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1161, /* GL_PROGRAM_BINDING_ARB */ - 742, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 743, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 729, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 730, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 731, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 732, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 733, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 734, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1551, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1548, /* GL_TEXTURE_COMPRESSED */ - 970, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 240, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 879, /* GL_MAX_VERTEX_UNITS_ARB */ + 644, /* GL_INTERPOLATE */ + 256, /* GL_CONSTANT */ + 1198, /* GL_PRIMARY_COLOR */ + 1195, /* GL_PREVIOUS */ + 1411, /* GL_SOURCE0_RGB */ + 1417, /* GL_SOURCE1_RGB */ + 1423, /* GL_SOURCE2_RGB */ + 1427, /* GL_SOURCE3_RGB_NV */ + 1408, /* GL_SOURCE0_ALPHA */ + 1414, /* GL_SOURCE1_ALPHA */ + 1420, /* GL_SOURCE2_ALPHA */ + 1426, /* GL_SOURCE3_ALPHA_NV */ + 1044, /* GL_OPERAND0_RGB */ + 1050, /* GL_OPERAND1_RGB */ + 1056, /* GL_OPERAND2_RGB */ + 1060, /* GL_OPERAND3_RGB_NV */ + 1041, /* GL_OPERAND0_ALPHA */ + 1047, /* GL_OPERAND1_ALPHA */ + 1053, /* GL_OPERAND2_ALPHA */ + 1059, /* GL_OPERAND3_ALPHA_NV */ + 1741, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + 1805, /* GL_YCBCR_422_APPLE */ + 1730, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1732, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1402, /* GL_SLICE_ACCUM_SUN */ + 1255, /* GL_QUAD_MESH_SUN */ + 1701, /* GL_TRIANGLE_MESH_SUN */ + 1779, /* GL_VERTEX_PROGRAM_ARB */ + 1790, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1766, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1772, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1774, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1776, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 316, /* GL_CURRENT_VERTEX_ATTRIB */ + 1211, /* GL_PROGRAM_LENGTH_ARB */ + 1225, /* GL_PROGRAM_STRING_ARB */ + 974, /* GL_MODELVIEW_PROJECTION_NV */ + 611, /* GL_IDENTITY_NV */ + 658, /* GL_INVERSE_NV */ + 1694, /* GL_TRANSPOSE_NV */ + 659, /* GL_INVERSE_TRANSPOSE_NV */ + 882, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 881, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 789, /* GL_MATRIX0_NV */ + 801, /* GL_MATRIX1_NV */ + 813, /* GL_MATRIX2_NV */ + 817, /* GL_MATRIX3_NV */ + 819, /* GL_MATRIX4_NV */ + 821, /* GL_MATRIX5_NV */ + 823, /* GL_MATRIX6_NV */ + 825, /* GL_MATRIX7_NV */ + 301, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + 298, /* GL_CURRENT_MATRIX_ARB */ + 1782, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1785, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1223, /* GL_PROGRAM_PARAMETER_NV */ + 1770, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1227, /* GL_PROGRAM_TARGET_NV */ + 1224, /* GL_PROGRAM_RESIDENT_NV */ + 1686, /* GL_TRACK_MATRIX_NV */ + 1687, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1780, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1205, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 337, /* GL_DEPTH_CLAMP_NV */ + 1748, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1755, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1756, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1757, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1758, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1759, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1760, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1761, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1762, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1763, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1749, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1750, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1751, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1752, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1753, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1754, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 743, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 750, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 751, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 752, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 753, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 754, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 755, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 756, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 757, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 744, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 745, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 746, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 747, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 748, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 749, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 770, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 777, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 778, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 779, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 780, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 781, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 782, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1204, /* GL_PROGRAM_BINDING_ARB */ + 784, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 771, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 772, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 773, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 774, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 775, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 776, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1608, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1605, /* GL_TEXTURE_COMPRESSED */ + 1013, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 255, /* GL_COMPRESSED_TEXTURE_FORMATS */ + 922, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1740, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1718, /* GL_VERTEX_BLEND_ARB */ - 303, /* GL_CURRENT_WEIGHT_ARB */ - 1739, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1738, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1737, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1736, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1733, /* GL_WEIGHT_ARRAY_ARB */ - 346, /* GL_DOT3_RGB */ - 347, /* GL_DOT3_RGBA */ - 238, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 233, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 939, /* GL_MULTISAMPLE_3DFX */ - 1311, /* GL_SAMPLE_BUFFERS_3DFX */ - 1302, /* GL_SAMPLES_3DFX */ - 920, /* GL_MODELVIEW2_ARB */ - 923, /* GL_MODELVIEW3_ARB */ - 924, /* GL_MODELVIEW4_ARB */ - 925, /* GL_MODELVIEW5_ARB */ - 926, /* GL_MODELVIEW6_ARB */ - 927, /* GL_MODELVIEW7_ARB */ - 928, /* GL_MODELVIEW8_ARB */ - 929, /* GL_MODELVIEW9_ARB */ - 899, /* GL_MODELVIEW10_ARB */ - 900, /* GL_MODELVIEW11_ARB */ - 901, /* GL_MODELVIEW12_ARB */ - 902, /* GL_MODELVIEW13_ARB */ - 903, /* GL_MODELVIEW14_ARB */ - 904, /* GL_MODELVIEW15_ARB */ - 905, /* GL_MODELVIEW16_ARB */ - 906, /* GL_MODELVIEW17_ARB */ - 907, /* GL_MODELVIEW18_ARB */ - 908, /* GL_MODELVIEW19_ARB */ - 910, /* GL_MODELVIEW20_ARB */ - 911, /* GL_MODELVIEW21_ARB */ - 912, /* GL_MODELVIEW22_ARB */ - 913, /* GL_MODELVIEW23_ARB */ - 914, /* GL_MODELVIEW24_ARB */ - 915, /* GL_MODELVIEW25_ARB */ - 916, /* GL_MODELVIEW26_ARB */ - 917, /* GL_MODELVIEW27_ARB */ - 918, /* GL_MODELVIEW28_ARB */ - 919, /* GL_MODELVIEW29_ARB */ - 921, /* GL_MODELVIEW30_ARB */ - 922, /* GL_MODELVIEW31_ARB */ - 351, /* GL_DOT3_RGB_EXT */ - 349, /* GL_DOT3_RGBA_EXT */ - 893, /* GL_MIRROR_CLAMP_EXT */ - 896, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 934, /* GL_MODULATE_ADD_ATI */ - 935, /* GL_MODULATE_SIGNED_ADD_ATI */ - 936, /* GL_MODULATE_SUBTRACT_ATI */ - 1746, /* GL_YCBCR_MESA */ - 1025, /* GL_PACK_INVERT_MESA */ - 306, /* GL_DEBUG_OBJECT_MESA */ - 307, /* GL_DEBUG_PRINT_MESA */ - 305, /* GL_DEBUG_ASSERT_MESA */ - 107, /* GL_BUFFER_SIZE */ - 109, /* GL_BUFFER_USAGE */ - 1399, /* GL_STENCIL_BACK_FUNC */ - 1397, /* GL_STENCIL_BACK_FAIL */ - 1401, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1403, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 485, /* GL_FRAGMENT_PROGRAM_ARB */ - 1159, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1187, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1186, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1171, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1177, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1176, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 829, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 852, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 851, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 842, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 848, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 847, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 812, /* GL_MAX_DRAW_BUFFERS */ - 355, /* GL_DRAW_BUFFER0 */ - 358, /* GL_DRAW_BUFFER1 */ - 379, /* GL_DRAW_BUFFER2 */ - 382, /* GL_DRAW_BUFFER3 */ - 385, /* GL_DRAW_BUFFER4 */ - 388, /* GL_DRAW_BUFFER5 */ - 391, /* GL_DRAW_BUFFER6 */ - 394, /* GL_DRAW_BUFFER7 */ - 397, /* GL_DRAW_BUFFER8 */ - 400, /* GL_DRAW_BUFFER9 */ - 359, /* GL_DRAW_BUFFER10 */ - 362, /* GL_DRAW_BUFFER11 */ - 365, /* GL_DRAW_BUFFER12 */ - 368, /* GL_DRAW_BUFFER13 */ - 371, /* GL_DRAW_BUFFER14 */ - 374, /* GL_DRAW_BUFFER15 */ - 82, /* GL_BLEND_EQUATION_ALPHA */ - 792, /* GL_MATRIX_PALETTE_ARB */ - 823, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 826, /* GL_MAX_PALETTE_MATRICES_ARB */ - 289, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 786, /* GL_MATRIX_INDEX_ARRAY_ARB */ - 284, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 788, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 790, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 789, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 787, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1577, /* GL_TEXTURE_DEPTH_SIZE */ - 339, /* GL_DEPTH_TEXTURE_MODE */ - 1543, /* GL_TEXTURE_COMPARE_MODE */ - 1541, /* GL_TEXTURE_COMPARE_FUNC */ - 217, /* GL_COMPARE_R_TO_TEXTURE */ - 1093, /* GL_POINT_SPRITE */ - 266, /* GL_COORD_REPLACE */ - 1097, /* GL_POINT_SPRITE_R_MODE_NV */ - 1214, /* GL_QUERY_COUNTER_BITS */ - 291, /* GL_CURRENT_QUERY */ - 1216, /* GL_QUERY_RESULT */ - 1218, /* GL_QUERY_RESULT_AVAILABLE */ - 873, /* GL_MAX_VERTEX_ATTRIBS */ - 1708, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 337, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 336, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 859, /* GL_MAX_TEXTURE_COORDS */ - 861, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1164, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1166, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1165, /* GL_PROGRAM_FORMAT_ARB */ - 1622, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 318, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 317, /* GL_DEPTH_BOUNDS_EXT */ + 1800, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1778, /* GL_VERTEX_BLEND_ARB */ + 318, /* GL_CURRENT_WEIGHT_ARB */ + 1799, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1798, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1797, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1796, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1793, /* GL_WEIGHT_ARRAY_ARB */ + 365, /* GL_DOT3_RGB */ + 366, /* GL_DOT3_RGBA */ + 253, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + 248, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + 982, /* GL_MULTISAMPLE_3DFX */ + 1366, /* GL_SAMPLE_BUFFERS_3DFX */ + 1357, /* GL_SAMPLES_3DFX */ + 963, /* GL_MODELVIEW2_ARB */ + 966, /* GL_MODELVIEW3_ARB */ + 967, /* GL_MODELVIEW4_ARB */ + 968, /* GL_MODELVIEW5_ARB */ + 969, /* GL_MODELVIEW6_ARB */ + 970, /* GL_MODELVIEW7_ARB */ + 971, /* GL_MODELVIEW8_ARB */ + 972, /* GL_MODELVIEW9_ARB */ + 942, /* GL_MODELVIEW10_ARB */ + 943, /* GL_MODELVIEW11_ARB */ + 944, /* GL_MODELVIEW12_ARB */ + 945, /* GL_MODELVIEW13_ARB */ + 946, /* GL_MODELVIEW14_ARB */ + 947, /* GL_MODELVIEW15_ARB */ + 948, /* GL_MODELVIEW16_ARB */ + 949, /* GL_MODELVIEW17_ARB */ + 950, /* GL_MODELVIEW18_ARB */ + 951, /* GL_MODELVIEW19_ARB */ + 953, /* GL_MODELVIEW20_ARB */ + 954, /* GL_MODELVIEW21_ARB */ + 955, /* GL_MODELVIEW22_ARB */ + 956, /* GL_MODELVIEW23_ARB */ + 957, /* GL_MODELVIEW24_ARB */ + 958, /* GL_MODELVIEW25_ARB */ + 959, /* GL_MODELVIEW26_ARB */ + 960, /* GL_MODELVIEW27_ARB */ + 961, /* GL_MODELVIEW28_ARB */ + 962, /* GL_MODELVIEW29_ARB */ + 964, /* GL_MODELVIEW30_ARB */ + 965, /* GL_MODELVIEW31_ARB */ + 370, /* GL_DOT3_RGB_EXT */ + 368, /* GL_DOT3_RGBA_EXT */ + 936, /* GL_MIRROR_CLAMP_EXT */ + 939, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 977, /* GL_MODULATE_ADD_ATI */ + 978, /* GL_MODULATE_SIGNED_ADD_ATI */ + 979, /* GL_MODULATE_SUBTRACT_ATI */ + 1806, /* GL_YCBCR_MESA */ + 1068, /* GL_PACK_INVERT_MESA */ + 321, /* GL_DEBUG_OBJECT_MESA */ + 322, /* GL_DEBUG_PRINT_MESA */ + 320, /* GL_DEBUG_ASSERT_MESA */ + 106, /* GL_BUFFER_SIZE */ + 108, /* GL_BUFFER_USAGE */ + 1456, /* GL_STENCIL_BACK_FUNC */ + 1454, /* GL_STENCIL_BACK_FAIL */ + 1458, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1460, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 504, /* GL_FRAGMENT_PROGRAM_ARB */ + 1202, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1230, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1229, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1214, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1220, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1219, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 871, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 894, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 893, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 884, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 890, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 889, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 854, /* GL_MAX_DRAW_BUFFERS */ + 374, /* GL_DRAW_BUFFER0 */ + 377, /* GL_DRAW_BUFFER1 */ + 398, /* GL_DRAW_BUFFER2 */ + 401, /* GL_DRAW_BUFFER3 */ + 404, /* GL_DRAW_BUFFER4 */ + 407, /* GL_DRAW_BUFFER5 */ + 410, /* GL_DRAW_BUFFER6 */ + 413, /* GL_DRAW_BUFFER7 */ + 416, /* GL_DRAW_BUFFER8 */ + 419, /* GL_DRAW_BUFFER9 */ + 378, /* GL_DRAW_BUFFER10 */ + 381, /* GL_DRAW_BUFFER11 */ + 384, /* GL_DRAW_BUFFER12 */ + 387, /* GL_DRAW_BUFFER13 */ + 390, /* GL_DRAW_BUFFER14 */ + 393, /* GL_DRAW_BUFFER15 */ + 81, /* GL_BLEND_EQUATION_ALPHA */ + 834, /* GL_MATRIX_PALETTE_ARB */ + 865, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 868, /* GL_MAX_PALETTE_MATRICES_ARB */ + 304, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + 828, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 299, /* GL_CURRENT_MATRIX_INDEX_ARB */ + 830, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 832, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 831, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 829, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1634, /* GL_TEXTURE_DEPTH_SIZE */ + 358, /* GL_DEPTH_TEXTURE_MODE */ + 1600, /* GL_TEXTURE_COMPARE_MODE */ + 1598, /* GL_TEXTURE_COMPARE_FUNC */ + 232, /* GL_COMPARE_R_TO_TEXTURE */ + 1136, /* GL_POINT_SPRITE */ + 281, /* GL_COORD_REPLACE */ + 1140, /* GL_POINT_SPRITE_R_MODE_NV */ + 1257, /* GL_QUERY_COUNTER_BITS */ + 306, /* GL_CURRENT_QUERY */ + 1259, /* GL_QUERY_RESULT */ + 1261, /* GL_QUERY_RESULT_AVAILABLE */ + 916, /* GL_MAX_VERTEX_ATTRIBS */ + 1768, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 356, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 355, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 902, /* GL_MAX_TEXTURE_COORDS */ + 904, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1207, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1209, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1208, /* GL_PROGRAM_FORMAT_ARB */ + 1680, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 335, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 334, /* GL_DEPTH_BOUNDS_EXT */ 52, /* GL_ARRAY_BUFFER */ - 420, /* GL_ELEMENT_ARRAY_BUFFER */ - 54, /* GL_ARRAY_BUFFER_BINDING */ - 422, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1682, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 960, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - 140, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 579, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1556, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 416, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1323, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 463, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1734, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1704, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1167, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 835, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1173, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 844, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1185, /* GL_PROGRAM_TEMPORARIES_ARB */ - 850, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1175, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 846, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1179, /* GL_PROGRAM_PARAMETERS_ARB */ - 849, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1174, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 845, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1160, /* GL_PROGRAM_ATTRIBS_ARB */ - 830, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1172, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 843, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1158, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 828, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1170, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 841, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 836, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 832, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1188, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1633, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1226, /* GL_READ_ONLY */ - 1742, /* GL_WRITE_ONLY */ - 1228, /* GL_READ_WRITE */ - 101, /* GL_BUFFER_ACCESS */ - 103, /* GL_BUFFER_MAPPED */ - 105, /* GL_BUFFER_MAP_POINTER */ - 1627, /* GL_TIME_ELAPSED_EXT */ - 746, /* GL_MATRIX0_ARB */ - 758, /* GL_MATRIX1_ARB */ - 770, /* GL_MATRIX2_ARB */ - 774, /* GL_MATRIX3_ARB */ - 776, /* GL_MATRIX4_ARB */ - 778, /* GL_MATRIX5_ARB */ - 780, /* GL_MATRIX6_ARB */ - 782, /* GL_MATRIX7_ARB */ - 784, /* GL_MATRIX8_ARB */ - 785, /* GL_MATRIX9_ARB */ - 748, /* GL_MATRIX10_ARB */ - 749, /* GL_MATRIX11_ARB */ - 750, /* GL_MATRIX12_ARB */ - 751, /* GL_MATRIX13_ARB */ - 752, /* GL_MATRIX14_ARB */ - 753, /* GL_MATRIX15_ARB */ - 754, /* GL_MATRIX16_ARB */ - 755, /* GL_MATRIX17_ARB */ - 756, /* GL_MATRIX18_ARB */ - 757, /* GL_MATRIX19_ARB */ - 760, /* GL_MATRIX20_ARB */ - 761, /* GL_MATRIX21_ARB */ - 762, /* GL_MATRIX22_ARB */ - 763, /* GL_MATRIX23_ARB */ - 764, /* GL_MATRIX24_ARB */ - 765, /* GL_MATRIX25_ARB */ - 766, /* GL_MATRIX26_ARB */ - 767, /* GL_MATRIX27_ARB */ - 768, /* GL_MATRIX28_ARB */ - 769, /* GL_MATRIX29_ARB */ - 772, /* GL_MATRIX30_ARB */ - 773, /* GL_MATRIX31_ARB */ - 1429, /* GL_STREAM_DRAW */ - 1431, /* GL_STREAM_READ */ - 1427, /* GL_STREAM_COPY */ - 1391, /* GL_STATIC_DRAW */ - 1393, /* GL_STATIC_READ */ - 1389, /* GL_STATIC_COPY */ - 410, /* GL_DYNAMIC_DRAW */ - 412, /* GL_DYNAMIC_READ */ - 408, /* GL_DYNAMIC_COPY */ - 535, /* GL_GL_PIXEL_PACK_BUFFER */ - 537, /* GL_GL_PIXEL_UNPACK_BUFFER */ - 536, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - 538, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - 833, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 831, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 834, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 838, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 837, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 795, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1423, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 440, /* GL_ELEMENT_ARRAY_BUFFER */ + 53, /* GL_ARRAY_BUFFER_BINDING */ + 441, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1742, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1003, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 139, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + 620, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1613, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 436, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1378, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 482, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1794, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1764, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1210, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 877, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1216, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 886, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1228, /* GL_PROGRAM_TEMPORARIES_ARB */ + 892, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1218, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 888, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1222, /* GL_PROGRAM_PARAMETERS_ARB */ + 891, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1217, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 887, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1203, /* GL_PROGRAM_ATTRIBS_ARB */ + 872, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1215, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 885, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1201, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 870, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1213, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 883, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 878, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 874, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1231, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1691, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1270, /* GL_READ_ONLY */ + 1802, /* GL_WRITE_ONLY */ + 1272, /* GL_READ_WRITE */ + 100, /* GL_BUFFER_ACCESS */ + 102, /* GL_BUFFER_MAPPED */ + 104, /* GL_BUFFER_MAP_POINTER */ + 1685, /* GL_TIME_ELAPSED_EXT */ + 788, /* GL_MATRIX0_ARB */ + 800, /* GL_MATRIX1_ARB */ + 812, /* GL_MATRIX2_ARB */ + 816, /* GL_MATRIX3_ARB */ + 818, /* GL_MATRIX4_ARB */ + 820, /* GL_MATRIX5_ARB */ + 822, /* GL_MATRIX6_ARB */ + 824, /* GL_MATRIX7_ARB */ + 826, /* GL_MATRIX8_ARB */ + 827, /* GL_MATRIX9_ARB */ + 790, /* GL_MATRIX10_ARB */ + 791, /* GL_MATRIX11_ARB */ + 792, /* GL_MATRIX12_ARB */ + 793, /* GL_MATRIX13_ARB */ + 794, /* GL_MATRIX14_ARB */ + 795, /* GL_MATRIX15_ARB */ + 796, /* GL_MATRIX16_ARB */ + 797, /* GL_MATRIX17_ARB */ + 798, /* GL_MATRIX18_ARB */ + 799, /* GL_MATRIX19_ARB */ + 802, /* GL_MATRIX20_ARB */ + 803, /* GL_MATRIX21_ARB */ + 804, /* GL_MATRIX22_ARB */ + 805, /* GL_MATRIX23_ARB */ + 806, /* GL_MATRIX24_ARB */ + 807, /* GL_MATRIX25_ARB */ + 808, /* GL_MATRIX26_ARB */ + 809, /* GL_MATRIX27_ARB */ + 810, /* GL_MATRIX28_ARB */ + 811, /* GL_MATRIX29_ARB */ + 814, /* GL_MATRIX30_ARB */ + 815, /* GL_MATRIX31_ARB */ + 1486, /* GL_STREAM_DRAW */ + 1488, /* GL_STREAM_READ */ + 1484, /* GL_STREAM_COPY */ + 1447, /* GL_STATIC_DRAW */ + 1449, /* GL_STATIC_READ */ + 1445, /* GL_STATIC_COPY */ + 430, /* GL_DYNAMIC_DRAW */ + 432, /* GL_DYNAMIC_READ */ + 428, /* GL_DYNAMIC_COPY */ + 575, /* GL_GL_PIXEL_PACK_BUFFER */ + 577, /* GL_GL_PIXEL_UNPACK_BUFFER */ + 576, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ + 578, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ + 329, /* GL_DEPTH24_STENCIL8 */ + 1678, /* GL_TEXTURE_STENCIL_SIZE */ + 875, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + 873, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 876, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 880, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 879, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 837, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1480, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 894, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1304, /* GL_SAMPLES_PASSED */ - 486, /* GL_FRAGMENT_SHADER */ - 1728, /* GL_VERTEX_SHADER */ - 1178, /* GL_PROGRAM_OBJECT_ARB */ - 1336, /* GL_SHADER_OBJECT_ARB */ - 819, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 877, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 871, /* GL_MAX_VARYING_FLOATS */ - 875, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 804, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 985, /* GL_OBJECT_TYPE_ARB */ - 1338, /* GL_SHADER_TYPE */ - 451, /* GL_FLOAT_VEC2 */ - 453, /* GL_FLOAT_VEC3 */ - 455, /* GL_FLOAT_VEC4 */ - 606, /* GL_INT_VEC2 */ - 608, /* GL_INT_VEC3 */ - 610, /* GL_INT_VEC4 */ - 93, /* GL_BOOL */ - 95, /* GL_BOOL_VEC2 */ - 97, /* GL_BOOL_VEC3 */ - 99, /* GL_BOOL_VEC4 */ - 445, /* GL_FLOAT_MAT2 */ - 447, /* GL_FLOAT_MAT3 */ - 449, /* GL_FLOAT_MAT4 */ - 1295, /* GL_SAMPLER_1D */ - 1297, /* GL_SAMPLER_2D */ - 1299, /* GL_SAMPLER_3D */ - 1300, /* GL_SAMPLER_CUBE */ - 1296, /* GL_SAMPLER_1D_SHADOW */ - 1298, /* GL_SAMPLER_2D_SHADOW */ - 529, /* GL_GL_FLOAT_MAT2x3 */ - 530, /* GL_GL_FLOAT_MAT2x4 */ - 531, /* GL_GL_FLOAT_MAT3x2 */ - 532, /* GL_GL_FLOAT_MAT3x4 */ - 533, /* GL_GL_FLOAT_MAT4x2 */ - 534, /* GL_GL_FLOAT_MAT4x3 */ - 312, /* GL_DELETE_STATUS */ - 221, /* GL_COMPILE_STATUS */ - 659, /* GL_LINK_STATUS */ - 1677, /* GL_VALIDATE_STATUS */ - 591, /* GL_INFO_LOG_LENGTH */ - 56, /* GL_ATTACHED_SHADERS */ + 937, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1359, /* GL_SAMPLES_PASSED */ + 505, /* GL_FRAGMENT_SHADER */ + 1788, /* GL_VERTEX_SHADER */ + 1221, /* GL_PROGRAM_OBJECT_ARB */ + 1391, /* GL_SHADER_OBJECT_ARB */ + 861, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 920, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 914, /* GL_MAX_VARYING_FLOATS */ + 918, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 846, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1028, /* GL_OBJECT_TYPE_ARB */ + 1393, /* GL_SHADER_TYPE */ + 470, /* GL_FLOAT_VEC2 */ + 472, /* GL_FLOAT_VEC3 */ + 474, /* GL_FLOAT_VEC4 */ + 647, /* GL_INT_VEC2 */ + 649, /* GL_INT_VEC3 */ + 651, /* GL_INT_VEC4 */ + 92, /* GL_BOOL */ + 94, /* GL_BOOL_VEC2 */ + 96, /* GL_BOOL_VEC3 */ + 98, /* GL_BOOL_VEC4 */ + 464, /* GL_FLOAT_MAT2 */ + 466, /* GL_FLOAT_MAT3 */ + 468, /* GL_FLOAT_MAT4 */ + 1350, /* GL_SAMPLER_1D */ + 1352, /* GL_SAMPLER_2D */ + 1354, /* GL_SAMPLER_3D */ + 1355, /* GL_SAMPLER_CUBE */ + 1351, /* GL_SAMPLER_1D_SHADOW */ + 1353, /* GL_SAMPLER_2D_SHADOW */ + 569, /* GL_GL_FLOAT_MAT2x3 */ + 570, /* GL_GL_FLOAT_MAT2x4 */ + 571, /* GL_GL_FLOAT_MAT3x2 */ + 572, /* GL_GL_FLOAT_MAT3x4 */ + 573, /* GL_GL_FLOAT_MAT4x2 */ + 574, /* GL_GL_FLOAT_MAT4x3 */ + 327, /* GL_DELETE_STATUS */ + 236, /* GL_COMPILE_STATUS */ + 701, /* GL_LINK_STATUS */ + 1737, /* GL_VALIDATE_STATUS */ + 632, /* GL_INFO_LOG_LENGTH */ + 55, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1337, /* GL_SHADER_SOURCE_LENGTH */ + 1392, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 488, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1340, /* GL_SHADING_LANGUAGE_VERSION */ - 290, /* GL_CURRENT_PROGRAM */ - 1034, /* GL_PALETTE4_RGB8_OES */ - 1036, /* GL_PALETTE4_RGBA8_OES */ - 1032, /* GL_PALETTE4_R5_G6_B5_OES */ - 1035, /* GL_PALETTE4_RGBA4_OES */ - 1033, /* GL_PALETTE4_RGB5_A1_OES */ - 1039, /* GL_PALETTE8_RGB8_OES */ - 1041, /* GL_PALETTE8_RGBA8_OES */ - 1037, /* GL_PALETTE8_R5_G6_B5_OES */ - 1040, /* GL_PALETTE8_RGBA4_OES */ - 1038, /* GL_PALETTE8_RGB5_A1_OES */ - 574, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 573, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1511, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1198, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1513, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1201, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1519, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1521, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 543, /* GL_GL_SRGB */ - 544, /* GL_GL_SRGB8 */ - 546, /* GL_GL_SRGB_ALPHA */ - 545, /* GL_GL_SRGB8_ALPHA8 */ - 542, /* GL_GL_SLUMINANCE_ALPHA */ - 541, /* GL_GL_SLUMINANCE8_ALPHA8 */ - 539, /* GL_GL_SLUMINANCE */ - 540, /* GL_GL_SLUMINANCE8 */ - 526, /* GL_GL_COMPRESSED_SRGB */ - 527, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - 524, /* GL_GL_COMPRESSED_SLUMINANCE */ - 525, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1095, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 667, /* GL_LOWER_LEFT */ - 1674, /* GL_UPPER_LEFT */ - 1405, /* GL_STENCIL_BACK_REF */ - 1406, /* GL_STENCIL_BACK_VALUE_MASK */ - 1407, /* GL_STENCIL_BACK_WRITEMASK */ - 403, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1240, /* GL_RENDERBUFFER_BINDING_EXT */ - 1225, /* GL_READ_FRAMEBUFFER_EXT */ - 404, /* GL_DRAW_FRAMEBUFFER_EXT */ - 1224, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 490, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - 489, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - 494, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - 492, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - 491, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - 496, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - 498, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - 503, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - 501, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 499, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 502, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 500, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 504, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 506, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - 505, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 801, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - 146, /* GL_COLOR_ATTACHMENT0_EXT */ - 153, /* GL_COLOR_ATTACHMENT1_EXT */ - 154, /* GL_COLOR_ATTACHMENT2_EXT */ - 155, /* GL_COLOR_ATTACHMENT3_EXT */ - 156, /* GL_COLOR_ATTACHMENT4_EXT */ - 157, /* GL_COLOR_ATTACHMENT5_EXT */ - 158, /* GL_COLOR_ATTACHMENT6_EXT */ - 159, /* GL_COLOR_ATTACHMENT7_EXT */ - 160, /* GL_COLOR_ATTACHMENT8_EXT */ - 161, /* GL_COLOR_ATTACHMENT9_EXT */ - 147, /* GL_COLOR_ATTACHMENT10_EXT */ - 148, /* GL_COLOR_ATTACHMENT11_EXT */ - 149, /* GL_COLOR_ATTACHMENT12_EXT */ - 150, /* GL_COLOR_ATTACHMENT13_EXT */ - 151, /* GL_COLOR_ATTACHMENT14_EXT */ - 152, /* GL_COLOR_ATTACHMENT15_EXT */ - 314, /* GL_DEPTH_ATTACHMENT_EXT */ - 1396, /* GL_STENCIL_ATTACHMENT_EXT */ - 497, /* GL_FRAMEBUFFER_EXT */ - 1241, /* GL_RENDERBUFFER_EXT */ - 1244, /* GL_RENDERBUFFER_WIDTH_EXT */ - 1242, /* GL_RENDERBUFFER_HEIGHT_EXT */ - 1243, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - 1418, /* GL_STENCIL_INDEX_EXT */ - 1415, /* GL_STENCIL_INDEX1_EXT */ - 1416, /* GL_STENCIL_INDEX4_EXT */ - 1417, /* GL_STENCIL_INDEX8_EXT */ - 1414, /* GL_STENCIL_INDEX16_EXT */ - 428, /* GL_EVAL_BIT */ - 1222, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 661, /* GL_LIST_BIT */ - 1527, /* GL_TEXTURE_BIT */ - 1319, /* GL_SCISSOR_BIT */ + 507, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1395, /* GL_SHADING_LANGUAGE_VERSION */ + 305, /* GL_CURRENT_PROGRAM */ + 1077, /* GL_PALETTE4_RGB8_OES */ + 1079, /* GL_PALETTE4_RGBA8_OES */ + 1075, /* GL_PALETTE4_R5_G6_B5_OES */ + 1078, /* GL_PALETTE4_RGBA4_OES */ + 1076, /* GL_PALETTE4_RGB5_A1_OES */ + 1082, /* GL_PALETTE8_RGB8_OES */ + 1084, /* GL_PALETTE8_RGBA8_OES */ + 1080, /* GL_PALETTE8_R5_G6_B5_OES */ + 1083, /* GL_PALETTE8_RGBA4_OES */ + 1081, /* GL_PALETTE8_RGB5_A1_OES */ + 614, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 613, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1722, /* GL_UNSIGNED_NORMALIZED */ + 1568, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1241, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1570, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1244, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1576, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1578, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 583, /* GL_GL_SRGB */ + 584, /* GL_GL_SRGB8 */ + 586, /* GL_GL_SRGB_ALPHA */ + 585, /* GL_GL_SRGB8_ALPHA8 */ + 582, /* GL_GL_SLUMINANCE_ALPHA */ + 581, /* GL_GL_SLUMINANCE8_ALPHA8 */ + 579, /* GL_GL_SLUMINANCE */ + 580, /* GL_GL_SLUMINANCE8 */ + 566, /* GL_GL_COMPRESSED_SRGB */ + 567, /* GL_GL_COMPRESSED_SRGB_ALPHA */ + 564, /* GL_GL_COMPRESSED_SLUMINANCE */ + 565, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ + 1138, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 709, /* GL_LOWER_LEFT */ + 1734, /* GL_UPPER_LEFT */ + 1462, /* GL_STENCIL_BACK_REF */ + 1463, /* GL_STENCIL_BACK_VALUE_MASK */ + 1464, /* GL_STENCIL_BACK_WRITEMASK */ + 423, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + 1286, /* GL_RENDERBUFFER_BINDING_EXT */ + 1267, /* GL_READ_FRAMEBUFFER */ + 422, /* GL_DRAW_FRAMEBUFFER */ + 1268, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 1296, /* GL_RENDERBUFFER_SAMPLES */ + 517, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 515, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 526, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 522, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 524, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 529, /* GL_FRAMEBUFFER_COMPLETE */ + 533, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 539, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 537, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 535, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 538, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 536, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 542, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 545, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 543, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 843, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 145, /* GL_COLOR_ATTACHMENT0 */ + 147, /* GL_COLOR_ATTACHMENT1 */ + 161, /* GL_COLOR_ATTACHMENT2 */ + 163, /* GL_COLOR_ATTACHMENT3 */ + 165, /* GL_COLOR_ATTACHMENT4 */ + 167, /* GL_COLOR_ATTACHMENT5 */ + 169, /* GL_COLOR_ATTACHMENT6 */ + 171, /* GL_COLOR_ATTACHMENT7 */ + 173, /* GL_COLOR_ATTACHMENT8 */ + 175, /* GL_COLOR_ATTACHMENT9 */ + 148, /* GL_COLOR_ATTACHMENT10 */ + 150, /* GL_COLOR_ATTACHMENT11 */ + 152, /* GL_COLOR_ATTACHMENT12 */ + 154, /* GL_COLOR_ATTACHMENT13 */ + 156, /* GL_COLOR_ATTACHMENT14 */ + 158, /* GL_COLOR_ATTACHMENT15 */ + 330, /* GL_DEPTH_ATTACHMENT */ + 1452, /* GL_STENCIL_ATTACHMENT */ + 508, /* GL_FRAMEBUFFER */ + 1284, /* GL_RENDERBUFFER */ + 1298, /* GL_RENDERBUFFER_WIDTH */ + 1291, /* GL_RENDERBUFFER_HEIGHT */ + 1293, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1475, /* GL_STENCIL_INDEX_EXT */ + 1472, /* GL_STENCIL_INDEX1_EXT */ + 1473, /* GL_STENCIL_INDEX4_EXT */ + 1474, /* GL_STENCIL_INDEX8_EXT */ + 1471, /* GL_STENCIL_INDEX16_EXT */ + 1295, /* GL_RENDERBUFFER_RED_SIZE */ + 1290, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1287, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1285, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1288, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1297, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 541, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 899, /* GL_MAX_SAMPLES */ + 447, /* GL_EVAL_BIT */ + 1265, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 703, /* GL_LIST_BIT */ + 1584, /* GL_TEXTURE_BIT */ + 1374, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 941, /* GL_MULTISAMPLE_BIT */ + 984, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; -#define Elements(x) sizeof(x)/sizeof(*x) - typedef int (*cfunc)(const void *, const void *); /** @@ -4870,8 +5013,10 @@ const char *_mesa_lookup_enum_by_nr( int nr ) { unsigned * i; - i = (unsigned *)_mesa_bsearch( & nr, reduced_enums, Elements(reduced_enums), - sizeof(reduced_enums[0]), (cfunc) compar_nr ); + i = (unsigned *) _mesa_bsearch(& nr, reduced_enums, + Elements(reduced_enums), + sizeof(reduced_enums[0]), + (cfunc) compar_nr); if ( i != NULL ) { return & enum_string_table[ all_enums[ *i ].offset ]; @@ -4888,8 +5033,10 @@ int _mesa_lookup_enum_by_name( const char *symbol ) enum_elt * f = NULL; if ( symbol != NULL ) { - f = (enum_elt *)_mesa_bsearch( symbol, all_enums, Elements(all_enums), - sizeof( enum_elt ), (cfunc) compar_name ); + f = (enum_elt *) _mesa_bsearch(symbol, all_enums, + Elements(all_enums), + sizeof( enum_elt ), + (cfunc) compar_name); } return (f != NULL) ? f->n : -1; diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 0fe85af93e..f95c31862a 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -65,9 +65,17 @@ static struct mem_block *exec_heap = NULL; static unsigned char *exec_mem = NULL; -static void +static int init_heap(void) { +#ifdef MESA_SELINUX + if (is_selinux_enabled()) { + if (!security_get_boolean_active("allow_execmem") || + !security_get_boolean_pending("allow_execmem")) + return 0; + } +#endif + if (!exec_heap) exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); @@ -75,6 +83,8 @@ init_heap(void) exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + return (exec_mem != NULL); } @@ -86,7 +96,8 @@ _mesa_exec_malloc(GLuint size) _glthread_LOCK_MUTEX(exec_mutex); - init_heap(); + if (!init_heap()) + goto bail; if (exec_heap) { size = (size + 31) & ~31; @@ -97,7 +108,8 @@ _mesa_exec_malloc(GLuint size) addr = exec_mem + block->ofs; else _mesa_printf("_mesa_exec_malloc failed\n"); - + +bail: _glthread_UNLOCK_MUTEX(exec_mutex); return addr; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index e5279e7f3e..9c8bd13e69 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -45,13 +45,14 @@ static const struct { int flag_offset; } default_extensions[] = { { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, + { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, + { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) }, { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, { OFF, "GL_ARB_imaging", F(ARB_imaging) }, - { OFF, "GL_ARB_multisample", F(ARB_multisample) }, + { ON, "GL_ARB_multisample", F(ARB_multisample) }, { OFF, "GL_ARB_multitexture", F(ARB_multitexture) }, { OFF, "GL_ARB_occlusion_query", F(ARB_occlusion_query) }, { OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) }, @@ -61,9 +62,9 @@ static const struct { { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, - { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) }, + { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) }, { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, - { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) }, + { ON, "GL_ARB_texture_compression", F(ARB_texture_compression) }, { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, { OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) }, { OFF, "GL_ARB_texture_env_combine", F(ARB_texture_env_combine) }, @@ -74,7 +75,7 @@ static const struct { { OFF, "GL_ARB_texture_non_power_of_two", F(ARB_texture_non_power_of_two)}, { OFF, "GL_ARB_texture_rectangle", F(NV_texture_rectangle) }, { ON, "GL_ARB_transpose_matrix", F(ARB_transpose_matrix) }, - { OFF, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) }, + { ON, "GL_ARB_vertex_buffer_object", F(ARB_vertex_buffer_object) }, { OFF, "GL_ARB_vertex_program", F(ARB_vertex_program) }, { OFF, "GL_ARB_vertex_shader", F(ARB_vertex_shader) }, { ON, "GL_ARB_window_pos", F(ARB_window_pos) }, @@ -98,7 +99,7 @@ static const struct { { OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) }, { OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) }, { OFF, "GL_EXT_histogram", F(EXT_histogram) }, - { OFF, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, + { ON, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) }, { ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) }, { OFF, "GL_EXT_paletted_texture", F(EXT_paletted_texture) }, @@ -126,8 +127,10 @@ static const struct { { ON, "GL_EXT_texture_object", F(EXT_texture_object) }, { OFF, "GL_EXT_texture_rectangle", F(NV_texture_rectangle) }, { OFF, "GL_EXT_texture_sRGB", F(EXT_texture_sRGB) }, + { OFF, "GL_EXT_texture_swizzle", F(EXT_texture_swizzle) }, { OFF, "GL_EXT_timer_query", F(EXT_timer_query) }, { ON, "GL_EXT_vertex_array", F(EXT_vertex_array) }, + { OFF, "GL_EXT_vertex_array_bgra", F(EXT_vertex_array_bgra) }, { OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) }, { OFF, "GL_3DFX_texture_compression_FXT1", F(TDFX_texture_compression_FXT1) }, { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, @@ -138,7 +141,7 @@ static const struct { { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)}, { OFF, "GL_ATI_fragment_shader", F(ATI_fragment_shader)}, { OFF, "GL_ATI_separate_stencil", F(ATI_separate_stencil)}, - { OFF, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) }, + { ON, "GL_IBM_multimode_draw_arrays", F(IBM_multimode_draw_arrays) }, { ON, "GL_IBM_rasterpos_clip", F(IBM_rasterpos_clip) }, { OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, { OFF, "GL_INGR_blend_func_separate", F(EXT_blend_func_separate) }, @@ -153,6 +156,7 @@ static const struct { { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, + { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, { ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) }, { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, @@ -165,10 +169,7 @@ static const struct { { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, - { OFF, "GL_SGIX_depth_texture", F(SGIX_depth_texture) }, - { OFF, "GL_SGIX_shadow", F(SGIX_shadow) }, - { OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) }, - { OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, + { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, }; @@ -182,7 +183,7 @@ void _mesa_enable_sw_extensions(GLcontext *ctx) { ctx->Extensions.ARB_depth_texture = GL_TRUE; - ctx->Extensions.ARB_draw_buffers = GL_TRUE; + /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ #if FEATURE_ARB_fragment_program ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; @@ -190,6 +191,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; #endif +#if FEATURE_ARB_framebuffer_object + ctx->Extensions.ARB_framebuffer_object = GL_TRUE; +#endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; @@ -207,6 +211,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_shading_language_120 = GL_TRUE; #endif ctx->Extensions.ARB_shadow = GL_TRUE; + ctx->Extensions.ARB_shadow_ambient = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; @@ -222,7 +227,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_vertex_shader = GL_TRUE; #endif #if FEATURE_ARB_vertex_buffer_object - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/ #endif ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; #if FEATURE_ATI_fragment_shader @@ -247,7 +252,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; #endif ctx->Extensions.EXT_histogram = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; + /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_paletted_texture = GL_TRUE; #if FEATURE_EXT_pixel_buffer_object @@ -258,7 +263,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_shared_texture_palette = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */ + ctx->Extensions.EXT_stencil_two_side = GL_TRUE; ctx->Extensions.EXT_texture_env_add = GL_TRUE; ctx->Extensions.EXT_texture_env_combine = GL_TRUE; ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; @@ -267,7 +272,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; #endif - ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE; + ctx->Extensions.EXT_texture_swizzle = GL_TRUE; + ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; + /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/ ctx->Extensions.MESA_pack_invert = GL_TRUE; #if FEATURE_MESA_program_debug ctx->Extensions.MESA_program_debug = GL_TRUE; @@ -278,6 +285,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.NV_blend_square = GL_TRUE; /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/ ctx->Extensions.NV_point_sprite = GL_TRUE; + ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; ctx->Extensions.NV_texture_rectangle = GL_TRUE; /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/ #if FEATURE_NV_vertex_program @@ -292,12 +300,18 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.SGI_texture_color_table = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; - ctx->Extensions.SGIX_depth_texture = GL_TRUE; - ctx->Extensions.SGIX_shadow = GL_TRUE; - ctx->Extensions.SGIX_shadow_ambient = GL_TRUE; #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; #endif +#if FEATURE_texture_fxt1 + _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); +#endif +#if FEATURE_texture_s3tc + if (ctx->Mesa_DXTn) { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + _mesa_enable_extension(ctx, "GL_S3_s3tc"); + } +#endif } @@ -309,6 +323,7 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) { ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.EXT_blend_color = GL_TRUE; + ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_convolution = GL_TRUE; @@ -326,10 +341,10 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) void _mesa_enable_1_3_extensions(GLcontext *ctx) { - ctx->Extensions.ARB_multisample = GL_TRUE; + /*ctx->Extensions.ARB_multisample = GL_TRUE;*/ ctx->Extensions.ARB_multitexture = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; - ctx->Extensions.ARB_texture_compression = GL_TRUE; + /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/ ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; @@ -353,11 +368,10 @@ _mesa_enable_1_4_extensions(GLcontext *ctx) ctx->Extensions.ARB_window_pos = GL_TRUE; ctx->Extensions.EXT_blend_color = GL_TRUE; ctx->Extensions.EXT_blend_func_separate = GL_TRUE; - ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; + /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ ctx->Extensions.EXT_point_parameters = GL_TRUE; ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; @@ -374,7 +388,7 @@ void _mesa_enable_1_5_extensions(GLcontext *ctx) { ctx->Extensions.ARB_occlusion_query = GL_TRUE; - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/ ctx->Extensions.EXT_shadow_funcs = GL_TRUE; } @@ -386,7 +400,7 @@ _mesa_enable_1_5_extensions(GLcontext *ctx) void _mesa_enable_2_0_extensions(GLcontext *ctx) { - ctx->Extensions.ARB_draw_buffers = GL_TRUE; + /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ #if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; #endif @@ -398,7 +412,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx) #if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; #endif - ctx->Extensions.EXT_stencil_two_side = GL_FALSE; /* obsolete */ + ctx->Extensions.EXT_stencil_two_side = GL_TRUE; #if FEATURE_ARB_vertex_shader ctx->Extensions.ARB_vertex_shader = GL_TRUE; #endif diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index b5605a199c..23b3fb68fb 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -3,6 +3,7 @@ * Version: 7.1 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,6 +25,8 @@ /* + * GL_EXT/ARB_framebuffer_object extensions + * * Authors: * Brian Paul */ @@ -34,6 +37,7 @@ #include "fbobject.h" #include "framebuffer.h" #include "hash.h" +#include "macros.h" #include "mipmap.h" #include "renderbuffer.h" #include "state.h" @@ -122,8 +126,22 @@ _mesa_lookup_framebuffer(GLcontext *ctx, GLuint id) /** + * Mark the given framebuffer as invalid. This will force the + * test for framebuffer completeness to be done before the framebuffer + * is used. + */ +static void +invalidate_framebuffer(struct gl_framebuffer *fb) +{ + fb->_Status = 0; /* "indeterminate" */ +} + + +/** * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding * gl_renderbuffer_attachment object. + * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to + * the depth buffer attachment point. */ struct gl_renderbuffer_attachment * _mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, @@ -153,6 +171,8 @@ _mesa_get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, return NULL; } return &fb->Attachment[BUFFER_COLOR0 + i]; + case GL_DEPTH_STENCIL_ATTACHMENT: + /* fall-through */ case GL_DEPTH_ATTACHMENT_EXT: return &fb->Attachment[BUFFER_DEPTH]; case GL_STENCIL_ATTACHMENT_EXT: @@ -226,6 +246,8 @@ _mesa_set_texture_attachment(GLcontext *ctx, if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { ctx->Driver.RenderTexture(ctx, fb, att); } + + invalidate_framebuffer(fb); } @@ -263,16 +285,38 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, ASSERT(att); if (rb) { _mesa_set_renderbuffer_attachment(ctx, att, rb); + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* do stencil attachment here (depth already done above) */ + att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT); + assert(att); + _mesa_set_renderbuffer_attachment(ctx, att, rb); + } } else { _mesa_remove_attachment(ctx, att); } + invalidate_framebuffer(fb); + _glthread_UNLOCK_MUTEX(fb->Mutex); } /** + * For debug only. + */ +static void +att_incomplete(const char *msg) +{ +#if 0 + _mesa_printf("attachment incomplete: %s\n", msg); +#else + (void) msg; +#endif +} + + +/** * Test if an attachment point is complete and update its Complete field. * \param format if GL_COLOR, this is a color attachment point, * if GL_DEPTH, this is a depth component attachment point, @@ -293,20 +337,26 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, struct gl_texture_image *texImage; if (!texObj) { + att_incomplete("no texobj"); att->Complete = GL_FALSE; return; } texImage = texObj->Image[att->CubeMapFace][att->TextureLevel]; if (!texImage) { + att_incomplete("no teximage"); att->Complete = GL_FALSE; return; } if (texImage->Width < 1 || texImage->Height < 1) { + att_incomplete("teximage width/height=0"); + _mesa_printf("texobj = %u\n", texObj->Name); + _mesa_printf("level = %d\n", att->TextureLevel); att->Complete = GL_FALSE; return; } if (texObj->Target == GL_TEXTURE_3D && att->Zoffset >= texImage->Depth) { + att_incomplete("bad z offset"); att->Complete = GL_FALSE; return; } @@ -314,6 +364,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, if (format == GL_COLOR) { if (texImage->TexFormat->BaseFormat != GL_RGB && texImage->TexFormat->BaseFormat != GL_RGBA) { + att_incomplete("bad format"); att->Complete = GL_FALSE; return; } @@ -328,11 +379,13 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } else { att->Complete = GL_FALSE; + att_incomplete("bad depth format"); return; } } else { /* no such thing as stencil textures */ + att_incomplete("illegal stencil texture"); att->Complete = GL_FALSE; return; } @@ -342,6 +395,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, if (!att->Renderbuffer->InternalFormat || att->Renderbuffer->Width < 1 || att->Renderbuffer->Height < 1) { + att_incomplete("0x0 renderbuffer"); att->Complete = GL_FALSE; return; } @@ -351,6 +405,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, ASSERT(att->Renderbuffer->RedBits); ASSERT(att->Renderbuffer->GreenBits); ASSERT(att->Renderbuffer->BlueBits); + att_incomplete("bad renderbuffer color format"); att->Complete = GL_FALSE; return; } @@ -365,6 +420,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, /* OK */ } else { + att_incomplete("bad renderbuffer depth format"); att->Complete = GL_FALSE; return; } @@ -381,6 +437,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } else { att->Complete = GL_FALSE; + att_incomplete("bad renderbuffer stencil format"); return; } } @@ -410,15 +467,18 @@ fbo_incomplete(const char *msg, int index) /** * Test if the given framebuffer object is complete and update its * Status field with the results. + * Calls the ctx->Driver.ValidateFramebuffer() function to allow the + * driver to make hardware-specific validation/completeness checks. * Also update the framebuffer's Width and Height fields if the * framebuffer is complete. */ void _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) { - GLuint numImages, width = 0, height = 0; - GLenum intFormat = GL_NONE; - GLuint w = 0, h = 0; + GLuint numImages; + GLenum intFormat = GL_NONE; /* color buffers' internal format */ + GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0; + GLint numSamples = -1; GLint i; GLuint j; @@ -428,11 +488,22 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) fb->Width = 0; fb->Height = 0; - /* Start at -2 to more easily loop over all attachment points */ + /* Start at -2 to more easily loop over all attachment points. + * -2: depth buffer + * -1: stencil buffer + * >=0: color buffer + */ for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { struct gl_renderbuffer_attachment *att; GLenum f; + /* + * XXX for ARB_fbo, only check color buffers that are named by + * GL_READ_BUFFER and GL_DRAW_BUFFERi. + */ + + /* check for attachment completeness + */ if (i == -2) { att = &fb->Attachment[BUFFER_DEPTH]; test_attachment_completeness(ctx, GL_DEPTH, att); @@ -461,11 +532,15 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) } } + /* get width, height, format of the renderbuffer/texture + */ if (att->Type == GL_TEXTURE) { const struct gl_texture_image *texImg = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; - w = texImg->Width; - h = texImg->Height; + minWidth = MIN2(minWidth, texImg->Width); + maxWidth = MAX2(maxWidth, texImg->Width); + minHeight = MIN2(minHeight, texImg->Height); + maxHeight = MAX2(maxHeight, texImg->Height); f = texImg->_BaseFormat; numImages++; if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT @@ -476,8 +551,10 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) } } else if (att->Type == GL_RENDERBUFFER_EXT) { - w = att->Renderbuffer->Width; - h = att->Renderbuffer->Height; + minWidth = MIN2(minWidth, att->Renderbuffer->Width); + maxWidth = MAX2(minWidth, att->Renderbuffer->Width); + minHeight = MIN2(minHeight, att->Renderbuffer->Height); + maxHeight = MAX2(minHeight, att->Renderbuffer->Height); f = att->Renderbuffer->InternalFormat; numImages++; } @@ -486,25 +563,41 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) continue; } + if (numSamples < 0) { + /* first buffer */ + numSamples = att->Renderbuffer->NumSamples; + } + + /* Error-check width, height, format, samples + */ if (numImages == 1) { - /* set required width, height and format */ - width = w; - height = h; - if (i >= 0) + /* save format, num samples */ + if (i >= 0) { intFormat = f; + } } else { - /* check that width, height, format are same */ - if (w != width || h != height) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; - fbo_incomplete("width or height mismatch", -1); - return; + if (!ctx->Extensions.ARB_framebuffer_object) { + /* check that width, height, format are same */ + if (minWidth != maxWidth || minHeight != maxHeight) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; + fbo_incomplete("width or height mismatch", -1); + return; + } + /* check that all color buffer have same format */ + if (intFormat != GL_NONE && f != intFormat) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; + fbo_incomplete("format mismatch", -1); + return; + } } - if (intFormat != GL_NONE && f != intFormat) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; - fbo_incomplete("format mismatch", -1); + if (att->Renderbuffer && + att->Renderbuffer->NumSamples != numSamples) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; + fbo_incomplete("inconsistant number of samples", i); return; - } + } + } } @@ -542,12 +635,32 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) return; } - /* - * If we get here, the framebuffer is complete! - */ + /* Provisionally set status = COMPLETE ... */ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - fb->Width = w; - fb->Height = h; + + /* ... but the driver may say the FB is incomplete. + * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED + * if anything. + */ + if (ctx->Driver.ValidateFramebuffer) { + ctx->Driver.ValidateFramebuffer(ctx, fb); + if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + fbo_incomplete("driver marked FBO as incomplete", -1); + } + } + + if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) { + /* + * Note that if ARB_framebuffer_object is supported and the attached + * renderbuffers/textures are different sizes, the framebuffer + * width/height will be set to the smallest width/height. + */ + fb->Width = minWidth; + fb->Height = minHeight; + + /* finally, update the visual info for the framebuffer */ + _mesa_update_framebuffer_visual(fb); + } } @@ -593,6 +706,12 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) /* ID was reserved, but no real renderbuffer object made yet */ newRb = NULL; } + else if (!newRb && ctx->Extensions.ARB_framebuffer_object) { + /* All RB IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); + return; + } + if (!newRb) { /* create new renderbuffer object */ newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); @@ -615,6 +734,27 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) } +/** + * If the given renderbuffer is anywhere attached to the framebuffer, detach + * the renderbuffer. + * This is used when a renderbuffer object is deleted. + * The spec calls for unbinding. + */ +static void +detach_renderbuffer(GLcontext *ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer *rb) +{ + GLuint i; + for (i = 0; i < BUFFER_COUNT; i++) { + if (fb->Attachment[i].Renderbuffer == rb) { + _mesa_remove_attachment(ctx, &fb->Attachment[i]); + } + } + invalidate_framebuffer(fb); +} + + void GLAPIENTRY _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) { @@ -636,6 +776,13 @@ _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); } + if (ctx->DrawBuffer->Name) { + detach_renderbuffer(ctx, ctx->DrawBuffer, rb); + } + if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) { + detach_renderbuffer(ctx, ctx->ReadBuffer, rb); + } + /* Remove from hash table immediately, to free the ID. * But the object will not be freed until it's no longer * referenced anywhere else. @@ -737,10 +884,21 @@ _mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat) } -void GLAPIENTRY -_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height) +/** sentinal value, see below */ +#define NO_SAMPLES 1000 + + +/** + * Helper function used by _mesa_RenderbufferStorageEXT() and + * _mesa_RenderbufferStorageMultisample(). + * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT(). + */ +static void +renderbuffer_storage(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei samples) { + const char *func = samples == NO_SAMPLES ? + "glRenderbufferStorage" : "RenderbufferStorageMultisample"; struct gl_renderbuffer *rb; GLenum baseFormat; GET_CURRENT_CONTEXT(ctx); @@ -748,31 +906,39 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, ASSERT_OUTSIDE_BEGIN_END(ctx); if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func); return; } baseFormat = _mesa_base_fbo_format(ctx, internalFormat); if (baseFormat == 0) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glRenderbufferStorageEXT(internalFormat)"); + _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func); return; } if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(width)"); + _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func); return; } if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRenderbufferStorageEXT(height)"); + _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func); return; } - rb = ctx->CurrentRenderbuffer; + if (samples == NO_SAMPLES) { + /* NumSamples == 0 indicates non-multisampling */ + samples = 0; + } + else if (samples > ctx->Const.MaxSamples) { + /* note: driver may choose to use more samples than what's requested */ + _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func); + return; + } + rb = ctx->CurrentRenderbuffer; if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glRenderbufferStorageEXT"); + _mesa_error(ctx, GL_INVALID_OPERATION, func); return; } @@ -794,6 +960,7 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, rb->IndexBits = rb->DepthBits = rb->StencilBits = 0; + rb->NumSamples = samples; /* Now allocate the storage */ ASSERT(rb->AllocStorage); @@ -820,7 +987,8 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, rb->AlphaBits = rb->IndexBits = rb->DepthBits = - rb->StencilBits = 0; + rb->StencilBits = + rb->NumSamples = 0; } /* @@ -833,8 +1001,31 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, void GLAPIENTRY +_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + /* GL_ARB_fbo says calling this function is equivalent to calling + * glRenderbufferStorageMultisample() with samples=0. We pass in + * a token value here just for error reporting purposes. + */ + renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES); +} + + +void GLAPIENTRY +_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalFormat, + GLsizei width, GLsizei height) +{ + renderbuffer_storage(target, internalFormat, width, height, samples); +} + + + +void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) { + struct gl_renderbuffer *rb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -845,7 +1036,8 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) return; } - if (!ctx->CurrentRenderbuffer) { + rb = ctx->CurrentRenderbuffer; + if (!rb) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetRenderbufferParameterivEXT"); return; @@ -855,32 +1047,38 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) switch (pname) { case GL_RENDERBUFFER_WIDTH_EXT: - *params = ctx->CurrentRenderbuffer->Width; + *params = rb->Width; return; case GL_RENDERBUFFER_HEIGHT_EXT: - *params = ctx->CurrentRenderbuffer->Height; + *params = rb->Height; return; case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT: - *params = ctx->CurrentRenderbuffer->InternalFormat; + *params = rb->InternalFormat; return; case GL_RENDERBUFFER_RED_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->RedBits; + *params = rb->RedBits; break; case GL_RENDERBUFFER_GREEN_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->GreenBits; + *params = rb->GreenBits; break; case GL_RENDERBUFFER_BLUE_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->BlueBits; + *params = rb->BlueBits; break; case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->AlphaBits; + *params = rb->AlphaBits; break; case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->DepthBits; + *params = rb->DepthBits; break; case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - *params = ctx->CurrentRenderbuffer->StencilBits; + *params = rb->StencilBits; break; + case GL_RENDERBUFFER_SAMPLES: + if (ctx->Extensions.ARB_framebuffer_object) { + *params = rb->NumSamples; + break; + } + /* fallthrough */ default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetRenderbufferParameterivEXT(target)"); @@ -946,6 +1144,13 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) GLboolean bindReadBuf, bindDrawBuf; GET_CURRENT_CONTEXT(ctx); +#ifdef DEBUG + if (ctx->Extensions.ARB_framebuffer_object) { + ASSERT(ctx->Extensions.EXT_framebuffer_object); + ASSERT(ctx->Extensions.EXT_framebuffer_blit); + } +#endif + ASSERT_OUTSIDE_BEGIN_END(ctx); if (!ctx->Extensions.EXT_framebuffer_object) { @@ -983,9 +1188,11 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } FLUSH_VERTICES(ctx, _NEW_BUFFERS); + if (ctx->Driver.Flush) { ctx->Driver.Flush(ctx); } + if (framebuffer) { /* Binding a user-created framebuffer object */ newFb = _mesa_lookup_framebuffer(ctx, framebuffer); @@ -993,6 +1200,12 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) /* ID was reserved, but no real framebuffer object made yet */ newFb = NULL; } + else if (!newFb && ctx->Extensions.ARB_framebuffer_object) { + /* All FBO IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); + return; + } + if (!newFb) { /* create new framebuffer object */ newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); @@ -1019,32 +1232,18 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) * XXX check if re-binding same buffer and skip some of this code. */ - /* for window-framebuffers, re-initialize the fbo values, as they - could be wrong (makecurrent with a new drawable while still a fbo - was bound will lead to default init fbo values). - note that therefore the context ReadBuffer/DrawBuffer values are not - valid while fbo's are bound!!! */ if (bindReadBuf) { _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread); - if (!newFbread->Name) { - _mesa_readbuffer_update_fields(ctx, ctx->Pixel.ReadBuffer); - } } if (bindDrawBuf) { /* check if old FB had any texture attachments */ check_end_texture_render(ctx, ctx->DrawBuffer); + /* check if time to delete this framebuffer */ _mesa_reference_framebuffer(&ctx->DrawBuffer, newFb); - if (!newFb->Name) { - GLuint i; - GLenum buffers[MAX_DRAW_BUFFERS]; - for(i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - buffers[i] = ctx->Color.DrawBuffer[i]; - } - _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, buffers, NULL); - } - else { + + if (newFb->Name != 0) { /* check if newly bound framebuffer has any texture attachments */ check_begin_texture_render(ctx, newFb); } @@ -1081,7 +1280,12 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) if (fb == ctx->DrawBuffer) { /* bind default */ ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); + } + if (fb == ctx->ReadBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); } /* remove from hash table immediately, to free the ID */ @@ -1091,7 +1295,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) /* But the object will not be freed until it's no longer * bound in any context. */ - _mesa_unreference_framebuffer(&fb); + _mesa_reference_framebuffer(&fb, NULL); } } } @@ -1170,7 +1374,10 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) FLUSH_VERTICES(ctx, _NEW_BUFFERS); - _mesa_test_framebuffer_completeness(ctx, buffer); + if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_test_framebuffer_completeness(ctx, buffer); + } + return buffer->_Status; } @@ -1187,16 +1394,31 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; struct gl_framebuffer *fb; + GLboolean error = GL_FALSE; ASSERT_OUTSIDE_BEGIN_END(ctx); - if (target != GL_FRAMEBUFFER_EXT) { + switch (target) { + case GL_READ_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + fb = ctx->ReadBuffer; + break; + case GL_DRAW_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + /* fall-through */ + case GL_FRAMEBUFFER_EXT: + fb = ctx->DrawBuffer; + break; + default: + error = GL_TRUE; + } + + if (error) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(target)", caller); + "glFramebufferTexture%sEXT(target=0x%x)", caller, target); return; } - fb = ctx->DrawBuffer; ASSERT(fb); /* check framebuffer binding */ @@ -1251,7 +1473,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, } } - if ((level < 0) || (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1267,6 +1488,18 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, return; } + if (texObj && attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* the texture format must be depth+stencil */ + const struct gl_texture_image *texImg; + texImg = texObj->Image[0][texObj->BaseLevel]; + if (!texImg || texImg->_BaseFormat != GL_DEPTH_STENCIL) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture%sEXT(texture is not" + " DEPTH_STENCIL format)", caller); + return; + } + } + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* The above doesn't fully flush the drivers in the way that a * glFlush does, but that is required here: @@ -1278,10 +1511,22 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, if (texObj) { _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, level, zoffset); + /* Set the render-to-texture flag. We'll check this flag in + * glTexImage() and friends to determine if we need to revalidate + * any FBOs that might be rendering into this texture. + * This flag never gets cleared since it's non-trivial to determine + * when all FBOs might be done rendering to this texture. That's OK + * though since it's uncommon to render to a texture then repeatedly + * call glTexImage() to change images in the texture. + */ + texObj->_RenderToTexture = GL_TRUE; } else { _mesa_remove_attachment(ctx, att); } + + invalidate_framebuffer(fb); + _glthread_UNLOCK_MUTEX(fb->Mutex); } @@ -1315,7 +1560,7 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, (textarget != GL_TEXTURE_RECTANGLE_ARB) && (!IS_CUBE_FACE(textarget))) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture2DEXT(textarget)"); + "glFramebufferTexture2DEXT(textarget=0x%x)", textarget); return; } @@ -1425,6 +1670,17 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, rb = NULL; } + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* make sure the renderbuffer is a depth/stencil format */ + if (rb->_BaseFormat != GL_DEPTH_STENCIL) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferRenderbufferEXT(renderbuffer" + " is not DEPTH_STENCIL format)"); + return; + } + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* The above doesn't fully flush the drivers in the way that a * glFlush does, but that is required here: @@ -1493,6 +1749,19 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; } + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* the depth and stencil attachments must point to the same buffer */ + const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt; + depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT); + stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT); + if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL" + " attachments differ)"); + return; + } + } + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* The above doesn't fully flush the drivers in the way that a * glFlush does, but that is required here: @@ -1553,6 +1822,79 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, "glGetFramebufferAttachmentParameterivEXT(pname)"); } return; + case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->ColorEncoding; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + return; + } + else { + *params = att->Renderbuffer->ComponentType; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->RedBits; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->GreenBits; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->BlueBits; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->AlphaBits; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->DepthBits; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + *params = att->Renderbuffer->StencilBits; + } + return; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferAttachmentParameterivEXT(pname)"); @@ -1586,19 +1928,38 @@ _mesa_GenerateMipmapEXT(GLenum target) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; texObj = _mesa_select_tex_object(ctx, texUnit, target); - /* XXX this might not handle cube maps correctly */ _mesa_lock_texture(ctx, texObj); - ctx->Driver.GenerateMipmap(ctx, target, texObj); + if (target == GL_TEXTURE_CUBE_MAP) { + int face; + + for (face = 0; face < 6; face++) + ctx->Driver.GenerateMipmap(ctx, + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, + texObj); + } else { + ctx->Driver.GenerateMipmap(ctx, target, texObj); + } _mesa_unlock_texture(ctx, texObj); } #if FEATURE_EXT_framebuffer_blit +/** + * Blit rectangular region, optionally from one framebuffer to another. + * + * Note, if the src buffer is multisampled and the dest is not, this is + * when the samples must be resolved to a single color. + */ void GLAPIENTRY _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { + const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT | + GL_DEPTH_BUFFER_BIT | + GL_STENCIL_BUFFER_BIT); + const struct gl_framebuffer *readFb, *drawFb; + const struct gl_renderbuffer *colorReadRb, *colorDrawRb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1608,13 +1969,19 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, _mesa_update_state(ctx); } - if (!ctx->ReadBuffer) { - /* XXX */ + readFb = ctx->ReadBuffer; + drawFb = ctx->DrawBuffer; + + if (!readFb || !drawFb) { + /* This will normally never happen but someday we may want to + * support MakeCurrent() with no drawables. + */ + return; } /* check for complete framebuffers */ - if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || - ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || + readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, "glBlitFramebufferEXT(incomplete draw/read buffers)"); return; @@ -1625,9 +1992,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } - if (mask & ~(GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT | - GL_STENCIL_BUFFER_BIT)) { + if (mask & ~legalMaskBits) { _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)"); return; } @@ -1640,9 +2005,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } + /* get color read/draw renderbuffers */ + if (mask & GL_COLOR_BUFFER_BIT) { + colorReadRb = readFb->_ColorReadBuffer; + colorDrawRb = drawFb->_ColorDrawBuffers[0]; + } + else { + colorReadRb = colorDrawRb = NULL; + } + if (mask & GL_STENCIL_BUFFER_BIT) { - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_StencilBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_StencilBuffer; + struct gl_renderbuffer *readRb = readFb->_StencilBuffer; + struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; if (readRb->StencilBits != drawRb->StencilBits) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(stencil buffer size mismatch"); @@ -1651,8 +2025,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } if (mask & GL_DEPTH_BUFFER_BIT) { - struct gl_renderbuffer *readRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *drawRb = ctx->DrawBuffer->_DepthBuffer; + struct gl_renderbuffer *readRb = readFb->_DepthBuffer; + struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; if (readRb->DepthBits != drawRb->DepthBits) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(depth buffer size mismatch"); @@ -1660,6 +2034,34 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } } + if (readFb->Visual.samples > 0 && + drawFb->Visual.samples > 0 && + readFb->Visual.samples != drawFb->Visual.samples) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(mismatched samples"); + return; + } + + /* extra checks for multisample copies... */ + if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) { + /* src and dest region sizes must be the same */ + if (srcX1 - srcX0 != dstX1 - dstX0 || + srcY1 - srcY0 != dstY1 - dstY0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(bad src/dst multisample region sizes"); + return; + } + + /* color formats must match */ + if (colorReadRb && + colorDrawRb && + colorReadRb->_ActualFormat != colorDrawRb->_ActualFormat) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(bad src/dst multisample pixel formats"); + return; + } + } + if (!ctx->Extensions.EXT_framebuffer_blit) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT"); return; diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index b6154719ab..5409394073 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -84,6 +84,11 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); extern void GLAPIENTRY +_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalformat, + GLsizei width, GLsizei height); + +extern void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params); diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index b87c443fec..42c8cc97c0 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -26,7 +26,7 @@ **************************************************************************/ /** - * \file ffvertex_prog. + * \file ffvertex_prog.c * * Create a vertex program to execute the current fixed function T&L pipeline. * \author Keith Whitwell @@ -101,6 +101,7 @@ static GLuint translate_fog_mode( GLenum mode ) } } + #define TXG_NONE 0 #define TXG_OBJ_LINEAR 1 #define TXG_EYE_LINEAR 2 @@ -145,6 +146,7 @@ tnl_get_per_vertex_materials(GLcontext *ctx) return mask; } + /** * Should fog be computed per-vertex? */ @@ -159,6 +161,7 @@ tnl_get_per_vertex_fog(GLcontext *ctx) #endif } + static GLboolean check_active_shininess( GLcontext *ctx, const struct state_key *key, GLuint side ) @@ -176,16 +179,14 @@ static GLboolean check_active_shininess( GLcontext *ctx, return GL_FALSE; } - - -static struct state_key *make_state_key( GLcontext *ctx ) +static void make_state_key( GLcontext *ctx, struct state_key *key ) { const struct gl_fragment_program *fp; - struct state_key *key = CALLOC_STRUCT(state_key); GLuint i; + memset(key, 0, sizeof(struct state_key)); fp = ctx->FragmentProgram._Current; /* This now relies on texenvprogram.c being active: @@ -278,7 +279,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) ctx->Texture._EnabledUnits) key->texture_enabled_global = 1; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; if (texUnit->_ReallyEnabled) @@ -292,20 +293,18 @@ static struct state_key *make_state_key( GLcontext *ctx ) key->unit[i].texgen_mode0 = translate_texgen( texUnit->TexGenEnabled & (1<<0), - texUnit->GenModeS ); + texUnit->GenS.Mode ); key->unit[i].texgen_mode1 = translate_texgen( texUnit->TexGenEnabled & (1<<1), - texUnit->GenModeT ); + texUnit->GenT.Mode ); key->unit[i].texgen_mode2 = translate_texgen( texUnit->TexGenEnabled & (1<<2), - texUnit->GenModeR ); + texUnit->GenR.Mode ); key->unit[i].texgen_mode3 = translate_texgen( texUnit->TexGenEnabled & (1<<3), - texUnit->GenModeQ ); + texUnit->GenQ.Mode ); } } - - return key; } @@ -412,11 +411,13 @@ static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) return reg; } + static struct ureg swizzle1( struct ureg reg, int x ) { return swizzle(reg, x, x, x, x); } + static struct ureg get_temp( struct tnl_program *p ) { int bit = _mesa_ffs( ~p->temp_in_use ); @@ -432,6 +433,7 @@ static struct ureg get_temp( struct tnl_program *p ) return make_ureg(PROGRAM_TEMPORARY, bit-1); } + static struct ureg reserve_temp( struct tnl_program *p ) { struct ureg temp = get_temp( p ); @@ -439,6 +441,7 @@ static struct ureg reserve_temp( struct tnl_program *p ) return temp; } + static void release_temp( struct tnl_program *p, struct ureg reg ) { if (reg.file == PROGRAM_TEMPORARY) { @@ -495,6 +498,7 @@ static struct ureg register_input( struct tnl_program *p, GLuint input ) } } + /** * \param input one of VERT_RESULT_x tokens. */ @@ -504,6 +508,7 @@ static struct ureg register_output( struct tnl_program *p, GLuint output ) return make_ureg(PROGRAM_OUTPUT, output); } + static struct ureg register_const4f( struct tnl_program *p, GLfloat s0, GLfloat s1, @@ -533,6 +538,7 @@ static GLboolean is_undef( struct ureg reg ) return reg.file == PROGRAM_UNDEFINED; } + static struct ureg get_identity_param( struct tnl_program *p ) { if (is_undef(p->identity)) @@ -573,6 +579,7 @@ static void emit_arg( struct prog_src_register *src, ASSERT(src->Index == reg.idx); } + static void emit_dst( struct prog_dst_register *dst, struct ureg reg, GLuint mask ) { @@ -588,6 +595,7 @@ static void emit_dst( struct prog_dst_register *dst, ASSERT(dst->Index == reg.idx); } + static void debug_insn( struct prog_instruction *inst, const char *fn, GLuint line ) { @@ -698,6 +706,7 @@ static void emit_matrix_transform_vec4( struct tnl_program *p, emit_op2(p, OPCODE_DP4, dest, WRITEMASK_W, src, mat[3]); } + /* This version is much easier to implement if writemasks are not * supported natively on the target or (like SSE), the target doesn't * have a clean/obvious dotproduct implementation. @@ -723,6 +732,7 @@ static void emit_transpose_matrix_transform_vec4( struct tnl_program *p, release_temp(p, tmp); } + static void emit_matrix_transform_vec3( struct tnl_program *p, struct ureg dest, const struct ureg *mat, @@ -738,13 +748,19 @@ static void emit_normalize_vec3( struct tnl_program *p, struct ureg dest, struct ureg src ) { +#if 0 + /* XXX use this when drivers are ready for NRM3 */ + emit_op1(p, OPCODE_NRM3, dest, WRITEMASK_XYZ, src); +#else struct ureg tmp = get_temp(p); emit_op2(p, OPCODE_DP3, tmp, WRITEMASK_X, src, src); emit_op1(p, OPCODE_RSQ, tmp, WRITEMASK_X, tmp); emit_op2(p, OPCODE_MUL, dest, 0, src, swizzle1(tmp, X)); release_temp(p, tmp); +#endif } + static void emit_passthrough( struct tnl_program *p, GLuint input, GLuint output ) @@ -753,6 +769,7 @@ static void emit_passthrough( struct tnl_program *p, emit_op1(p, OPCODE_MOV, out, 0, register_input(p, input)); } + static struct ureg get_eye_position( struct tnl_program *p ) { if (is_undef(p->eye_position)) { @@ -800,7 +817,6 @@ static struct ureg get_eye_position_z( struct tnl_program *p ) } - static struct ureg get_eye_position_normalized( struct tnl_program *p ) { if (is_undef(p->eye_position_normalized)) { @@ -862,7 +878,6 @@ static struct ureg get_transformed_normal( struct tnl_program *p ) } - static void build_hpos( struct tnl_program *p ) { struct ureg pos = register_input( p, VERT_ATTRIB_POS ); @@ -888,7 +903,9 @@ static GLuint material_attrib( GLuint side, GLuint property ) side); } -/* Get a bitmask of which material values vary on a per-vertex basis. + +/** + * Get a bitmask of which material values vary on a per-vertex basis. */ static void set_material_flags( struct tnl_program *p ) { @@ -924,7 +941,9 @@ static struct ureg get_material( struct tnl_program *p, GLuint side, MAT_BIT_FRONT_AMBIENT | \ MAT_BIT_FRONT_DIFFUSE) << (side)) -/* Either return a precalculated constant value or emit code to + +/** + * Either return a precalculated constant value or emit code to * calculate these values dynamically in the case where material calls * are present between begin/end pairs. * @@ -967,6 +986,7 @@ static struct ureg get_lightprod( struct tnl_program *p, GLuint light, return register_param4(p, STATE_LIGHTPROD, light, side, property); } + static struct ureg calculate_light_attenuation( struct tnl_program *p, GLuint i, struct ureg VPpli, @@ -1223,7 +1243,6 @@ static void build_lighting( struct tnl_program *p ) struct ureg res0, res1; GLuint mask0, mask1; - if (count == nr_lights) { if (separate) { mask0 = WRITEMASK_XYZ; @@ -1244,7 +1263,6 @@ static void build_lighting( struct tnl_program *p ) res1 = _col1; } - if (!is_undef(att)) { /* light is attenuated by distance */ emit_op1(p, OPCODE_LIT, lit, 0, dots); @@ -1317,7 +1335,6 @@ static void build_lighting( struct tnl_program *p ) emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0); emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1); - /* restore negate flag for next lighting */ dots = negate(dots); @@ -1392,6 +1409,7 @@ static void build_fog( struct tnl_program *p ) emit_op1(p, useabs ? OPCODE_ABS : OPCODE_MOV, fog, WRITEMASK_X, input); } } + static void build_reflect_texgen( struct tnl_program *p, struct ureg dest, @@ -1411,6 +1429,7 @@ static void build_reflect_texgen( struct tnl_program *p, release_temp(p, tmp); } + static void build_sphere_texgen( struct tnl_program *p, struct ureg dest, GLuint writemask ) @@ -1458,7 +1477,7 @@ static void build_texture_transform( struct tnl_program *p ) { GLuint i, j; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i))) continue; @@ -1521,10 +1540,8 @@ static void build_texture_transform( struct tnl_program *p ) case TXG_NONE: copy_mask |= WRITEMASK_X << j; } - } - if (sphere_mask) { build_sphere_texgen(p, out_texgen, sphere_mask); } @@ -1607,6 +1624,7 @@ static void build_atten_pointsize( struct tnl_program *p ) release_temp(p, ut); } + /** * Emit constant point size. */ @@ -1617,6 +1635,7 @@ static void build_constant_pointsize( struct tnl_program *p ) emit_op1(p, OPCODE_MOV, out, WRITEMASK_X, state_size); } + /** * Pass-though per-vertex point size, from user's point size array. */ @@ -1726,16 +1745,16 @@ struct gl_vertex_program * _mesa_get_fixed_func_vertex_program(GLcontext *ctx) { struct gl_vertex_program *prog; - struct state_key *key; + struct state_key key; /* Grab all the relevent state and put it in a single structure: */ - key = make_state_key(ctx); + make_state_key(ctx, &key); /* Look for an already-prepared program for this state: */ prog = (struct gl_vertex_program *) - _mesa_search_program_cache(ctx->VertexProgram.Cache, key, sizeof(*key)); + _mesa_search_program_cache(ctx->VertexProgram.Cache, &key, sizeof(key)); if (!prog) { /* OK, we'll have to build a new one */ @@ -1747,7 +1766,7 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx) if (!prog) return NULL; - create_new_program( key, prog, + create_new_program( &key, prog, ctx->Const.VertexProgram.MaxTemps ); #if 0 @@ -1756,10 +1775,8 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx) &prog->Base ); #endif _mesa_program_cache_insert(ctx, ctx->VertexProgram.Cache, - key, sizeof(*key), &prog->Base); + &key, sizeof(key), &prog->Base); } - _mesa_free(key); - return prog; } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 494743f134..351bf6959a 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -32,8 +32,10 @@ #include "glheader.h" #include "imports.h" +#include "buffers.h" #include "context.h" #include "depthstencil.h" +#include "macros.h" #include "mtypes.h" #include "fbobject.h" #include "framebuffer.h" @@ -108,8 +110,9 @@ _mesa_new_framebuffer(GLcontext *ctx, GLuint name) if (fb) { fb->Name = name; fb->RefCount = 1; + fb->_NumColorDrawBuffers = 1; fb->ColorDrawBuffer[0] = GL_COLOR_ATTACHMENT0_EXT; - fb->_ColorDrawBufferMask[0] = BUFFER_BIT_COLOR0; + fb->_ColorDrawBufferIndexes[0] = BUFFER_COLOR0; fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT; fb->_ColorReadBufferIndex = BUFFER_COLOR0; fb->Delete = _mesa_destroy_framebuffer; @@ -138,16 +141,18 @@ _mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual) /* save the visual */ fb->Visual = *visual; - /* Init glRead/DrawBuffer state */ + /* Init read/draw renderbuffer state */ if (visual->doubleBufferMode) { + fb->_NumColorDrawBuffers = 1; fb->ColorDrawBuffer[0] = GL_BACK; - fb->_ColorDrawBufferMask[0] = BUFFER_BIT_BACK_LEFT; + fb->_ColorDrawBufferIndexes[0] = BUFFER_BACK_LEFT; fb->ColorReadBuffer = GL_BACK; fb->_ColorReadBufferIndex = BUFFER_BACK_LEFT; } else { + fb->_NumColorDrawBuffers = 1; fb->ColorDrawBuffer[0] = GL_FRONT; - fb->_ColorDrawBufferMask[0] = BUFFER_BIT_FRONT_LEFT; + fb->_ColorDrawBufferIndexes[0] = BUFFER_FRONT_LEFT; fb->ColorReadBuffer = GL_FRONT; fb->_ColorReadBufferIndex = BUFFER_FRONT_LEFT; } @@ -218,19 +223,36 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr, /* no change */ return; } + if (*ptr) { - _mesa_unreference_framebuffer(ptr); + /* unreference old renderbuffer */ + GLboolean deleteFlag = GL_FALSE; + struct gl_framebuffer *oldFb = *ptr; + + _glthread_LOCK_MUTEX(oldFb->Mutex); + ASSERT(oldFb->RefCount > 0); + oldFb->RefCount--; + deleteFlag = (oldFb->RefCount == 0); + _glthread_UNLOCK_MUTEX(oldFb->Mutex); + + if (deleteFlag) + oldFb->Delete(oldFb); + + *ptr = NULL; } assert(!*ptr); - assert(fb); - _glthread_LOCK_MUTEX(fb->Mutex); - fb->RefCount++; - _glthread_UNLOCK_MUTEX(fb->Mutex); - *ptr = fb; + + if (fb) { + _glthread_LOCK_MUTEX(fb->Mutex); + fb->RefCount++; + _glthread_UNLOCK_MUTEX(fb->Mutex); + *ptr = fb; + } } /** + * XXX this function is deprecated. * Undo/remove a reference to a framebuffer object. * Decrement the framebuffer object's reference count and delete it when * the refcount hits zero. @@ -239,21 +261,7 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr, void _mesa_unreference_framebuffer(struct gl_framebuffer **fb) { - assert(fb); - if (*fb) { - GLboolean deleteFlag = GL_FALSE; - - _glthread_LOCK_MUTEX((*fb)->Mutex); - ASSERT((*fb)->RefCount > 0); - (*fb)->RefCount--; - deleteFlag = ((*fb)->RefCount == 0); - _glthread_UNLOCK_MUTEX((*fb)->Mutex); - - if (deleteFlag) - (*fb)->Delete(*fb); - - *fb = NULL; - } + _mesa_reference_framebuffer(fb, NULL); } @@ -414,14 +422,14 @@ _mesa_ResizeBuffersMESA( void ) /** * Examine all the framebuffer's renderbuffers to update the Width/Height * fields of the framebuffer. If we have renderbuffers with different - * sizes, set the framebuffer's width and height to zero. + * sizes, set the framebuffer's width and height to the min size. * Note: this is only intended for user-created framebuffers, not * window-system framebuffes. */ static void -update_framebuffer_size(struct gl_framebuffer *fb) +update_framebuffer_size(GLcontext *ctx, struct gl_framebuffer *fb) { - GLboolean haveSize = GL_FALSE; + GLuint minWidth = ~0, minHeight = ~0; GLuint i; /* user-created framebuffers only */ @@ -431,21 +439,19 @@ update_framebuffer_size(struct gl_framebuffer *fb) struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; const struct gl_renderbuffer *rb = att->Renderbuffer; if (rb) { - if (haveSize) { - if (rb->Width != fb->Width && rb->Height != fb->Height) { - /* size mismatch! */ - fb->Width = 0; - fb->Height = 0; - return; - } - } - else { - fb->Width = rb->Width; - fb->Height = rb->Height; - haveSize = GL_TRUE; - } + minWidth = MIN2(minWidth, rb->Width); + minHeight = MIN2(minHeight, rb->Height); } } + + if (minWidth != ~0) { + fb->Width = minWidth; + fb->Height = minHeight; + } + else { + fb->Width = 0; + fb->Height = 0; + } } @@ -465,7 +471,7 @@ _mesa_update_draw_buffer_bounds(GLcontext *ctx) if (buffer->Name) { /* user-created framebuffer size depends on the renderbuffers */ - update_framebuffer_size(buffer); + update_framebuffer_size(ctx, buffer); } buffer->_Xmin = 0; @@ -540,6 +546,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) fb->Visual.rgbBits = fb->Visual.redBits + fb->Visual.greenBits + fb->Visual.blueBits; fb->Visual.floatMode = GL_FALSE; + fb->Visual.samples = rb->NumSamples; break; } else if (rb->_BaseFormat == GL_COLOR_INDEX) { @@ -660,8 +667,53 @@ _mesa_update_stencil_buffer(GLcontext *ctx, } +/* + * Example DrawBuffers scenarios: + * + * 1. glDrawBuffer(GL_FRONT_AND_BACK), fixed-func or shader writes to + * "gl_FragColor" or program writes to the "result.color" register: + * + * fragment color output renderbuffer + * --------------------- --------------- + * color[0] Front, Back + * + * + * 2. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]), shader writes to + * gl_FragData[i] or program writes to result.color[i] registers: + * + * fragment color output renderbuffer + * --------------------- --------------- + * color[0] Front + * color[1] Aux0 + * color[3] Aux1 + * + * + * 3. glDrawBuffers(3, [GL_FRONT, GL_AUX0, GL_AUX1]) and shader writes to + * gl_FragColor, or fixed function: + * + * fragment color output renderbuffer + * --------------------- --------------- + * color[0] Front, Aux0, Aux1 + * + * + * In either case, the list of renderbuffers is stored in the + * framebuffer->_ColorDrawBuffers[] array and + * framebuffer->_NumColorDrawBuffers indicates the number of buffers. + * The renderer (like swrast) has to look at the current fragment shader + * to see if it writes to gl_FragColor vs. gl_FragData[i] to determine + * how to map color outputs to renderbuffers. + * + * Note that these two calls are equivalent (for fixed function fragment + * shading anyway): + * a) glDrawBuffer(GL_FRONT_AND_BACK); (assuming non-stereo framebuffer) + * b) glDrawBuffers(2, [GL_FRONT_LEFT, GL_BACK_LEFT]); + */ + + + + /** - * Update the list of color drawing renderbuffer pointers. + * Update the (derived) list of color drawing renderbuffer pointers. * Later, when we're rendering we'll loop from 0 to _NumColorDrawBuffers * writing colors. */ @@ -670,42 +722,23 @@ update_color_draw_buffers(GLcontext *ctx, struct gl_framebuffer *fb) { GLuint output; - /* - * Fragment programs can write to multiple colorbuffers with - * the GL_ARB_draw_buffers extension. - */ - for (output = 0; output < ctx->Const.MaxDrawBuffers; output++) { - GLbitfield bufferMask = fb->_ColorDrawBufferMask[output]; - GLuint count = 0; - GLuint i; - if (!fb->DeletePending) { - /* We need the inner loop here because glDrawBuffer(GL_FRONT_AND_BACK) - * can specify writing to two or four color buffers (for example). - */ - for (i = 0; bufferMask && i < BUFFER_COUNT; i++) { - const GLuint bufferBit = 1 << i; - if (bufferBit & bufferMask) { - struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; - if (rb && rb->Width > 0 && rb->Height > 0) { - fb->_ColorDrawBuffers[output][count] = rb; - count++; - } - else { - /* - _mesa_warning(ctx, "DrawBuffer names a missing buffer!\n"); - */ - } - bufferMask &= ~bufferBit; - } - } + /* set 0th buffer to NULL now in case _NumColorDrawBuffers is zero */ + fb->_ColorDrawBuffers[0] = NULL; + + for (output = 0; output < fb->_NumColorDrawBuffers; output++) { + GLint buf = fb->_ColorDrawBufferIndexes[output]; + if (buf >= 0) { + fb->_ColorDrawBuffers[output] = fb->Attachment[buf].Renderbuffer; + } + else { + fb->_ColorDrawBuffers[output] = NULL; } - fb->_NumColorDrawBuffers[output] = count; } } /** - * Update the color read renderbuffer pointer. + * Update the (derived) color read renderbuffer pointer. * Unlike the DrawBuffer, we can only read from one (or zero) color buffers. */ static void @@ -727,19 +760,52 @@ update_color_read_buffer(GLcontext *ctx, struct gl_framebuffer *fb) } +/** + * Update a gl_framebuffer's derived state. + * + * Specifically, update these framebuffer fields: + * _ColorDrawBuffers + * _NumColorDrawBuffers + * _ColorReadBuffer + * _DepthBuffer + * _StencilBuffer + * + * If the framebuffer is user-created, make sure it's complete. + * + * The following functions (at least) can effect framebuffer state: + * glReadBuffer, glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT, + * glRenderbufferStorageEXT. + */ static void update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) { - /* Completeness only matters for user-created framebuffers */ - if (fb->Name != 0) { - /* XXX: EXT_framebuffer_blit: - framebuffer must still be complete wrt read/draw? */ - _mesa_test_framebuffer_completeness(ctx, fb); - _mesa_update_framebuffer_visual(fb); + if (fb->Name == 0) { + /* This is a window-system framebuffer */ + /* Need to update the FB's GL_DRAW_BUFFER state to match the + * context state (GL_READ_BUFFER too). + */ + if (fb->ColorDrawBuffer[0] != ctx->Color.DrawBuffer[0]) { + _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, + ctx->Color.DrawBuffer, NULL); + } + if (fb->ColorReadBuffer != ctx->Pixel.ReadBuffer) { + + } + } + else { + /* This is a user-created framebuffer. + * Completeness only matters for user-created framebuffers. + */ + if (fb->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_test_framebuffer_completeness(ctx, fb); + } } - /* update_color_draw/read_buffers not needed for - read/draw only fb, but shouldn't hurt ??? */ + /* Strictly speaking, we don't need to update the draw-state + * if this FB is bound as ctx->ReadBuffer (and conversely, the + * read-state if this FB is bound as ctx->DrawBuffer), but no + * harm. + */ update_color_draw_buffers(ctx, fb); update_color_read_buffer(ctx, fb); _mesa_update_depth_buffer(ctx, fb, BUFFER_DEPTH); @@ -748,28 +814,19 @@ update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) compute_depth_max(fb); } + /** * Update state related to the current draw/read framebuffers. - * Specifically, update these framebuffer fields: - * _ColorDrawBuffers - * _NumColorDrawBuffers - * _ColorReadBuffer - * _DepthBuffer - * _StencilBuffer - * If the current framebuffer is user-created, make sure it's complete. - * The following functions can effect this state: glReadBuffer, - * glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT, - * glRenderbufferStorageEXT. */ void _mesa_update_framebuffer(GLcontext *ctx) { - struct gl_framebuffer *fb = ctx->DrawBuffer; - struct gl_framebuffer *fbread = ctx->ReadBuffer; + struct gl_framebuffer *drawFb = ctx->DrawBuffer; + struct gl_framebuffer *readFb = ctx->ReadBuffer; - update_framebuffer(ctx, fb); - if (fbread != fb) - update_framebuffer(ctx, fbread); + update_framebuffer(ctx, drawFb); + if (readFb != drawFb) + update_framebuffer(ctx, readFb); } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 8ce9b0ae69..3a8d56140f 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -460,7 +460,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->List.ListBase); break; case GL_LIST_INDEX: - params[0] = INT_TO_BOOLEAN(ctx->ListState.CurrentListNum); + params[0] = INT_TO_BOOLEAN((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)); break; case GL_LIST_MODE: { @@ -884,21 +884,21 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = _mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT); break; case GL_TEXTURE_BINDING_1D: - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name); break; case GL_TEXTURE_BINDING_2D: - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name); break; case GL_TEXTURE_BINDING_3D: - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name); break; case GL_TEXTURE_BINDING_1D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1DArray->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name); break; case GL_TEXTURE_BINDING_2D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2DArray->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name); break; case GL_TEXTURE_GEN_S: params[0] = ((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0); @@ -1071,22 +1071,19 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_TEXTURE_BINDING_CUBE_MAP_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name); break; case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetBooleanv"); params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1))); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression); break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetBooleanv"); { GLint formats[100]; GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); @@ -1368,35 +1365,27 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxTextureMaxAnisotropy); break; case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.Enabled; break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleAlphaToCoverage; break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleAlphaToOne; break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleCoverage; break; case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = FLOAT_TO_BOOLEAN(ctx->Multisample.SampleCoverageValue); break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = ctx->Multisample.SampleCoverageInvert; break; case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: @@ -1569,7 +1558,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_TEXTURE_BINDING_RECTANGLE_NV: CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name); + params[0] = INT_TO_BOOLEAN(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name); break; case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: CHECK_EXT1(NV_texture_rectangle, "GetBooleanv"); @@ -1592,43 +1581,33 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Const.MaxSpotExponent); break; case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayBufferObj->Name); break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Array.ElementArrayBufferObj->Name); break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: @@ -1753,15 +1732,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->VertexProgram.CurrentPosition); break; case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers); break; case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]); break; case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -1773,7 +1749,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -1785,7 +1760,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetBooleanv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -1905,6 +1879,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) CHECK_EXT1(ARB_shader_objects, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); break; + case GL_MAX_SAMPLES: + CHECK_EXT1(ARB_framebuffer_object, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxSamples); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); } @@ -2308,7 +2286,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->List.ListBase); break; case GL_LIST_INDEX: - params[0] = (GLfloat)(ctx->ListState.CurrentListNum); + params[0] = (GLfloat)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)); break; case GL_LIST_MODE: { @@ -2732,21 +2710,21 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = BOOLEAN_TO_FLOAT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)); break; case GL_TEXTURE_BINDING_1D: - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name); break; case GL_TEXTURE_BINDING_2D: - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name); break; case GL_TEXTURE_BINDING_3D: - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name); break; case GL_TEXTURE_BINDING_1D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1DArray->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name); break; case GL_TEXTURE_BINDING_2D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2DArray->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name); break; case GL_TEXTURE_GEN_S: params[0] = BOOLEAN_TO_FLOAT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); @@ -2919,22 +2897,19 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_TEXTURE_BINDING_CUBE_MAP_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name); break; case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetFloatv"); params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1))); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); params[0] = (GLfloat)(ctx->Hint.TextureCompression); break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetFloatv"); { GLint formats[100]; GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); @@ -3216,35 +3191,27 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Const.MaxTextureMaxAnisotropy; break; case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.Enabled); break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToCoverage); break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleAlphaToOne); break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverage); break; case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = ctx->Multisample.SampleCoverageValue; break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Multisample.SampleCoverageInvert); break; case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetFloatv"); params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: @@ -3417,7 +3384,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_TEXTURE_BINDING_RECTANGLE_NV: CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); - params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name); + params[0] = (GLfloat)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name); break; case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: CHECK_EXT1(NV_texture_rectangle, "GetFloatv"); @@ -3440,43 +3407,33 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Const.MaxSpotExponent; break; case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayBufferObj->Name); break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Array.ElementArrayBufferObj->Name); break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: @@ -3601,15 +3558,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->VertexProgram.CurrentPosition); break; case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers); break; case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]); break; case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -3621,7 +3575,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -3633,7 +3586,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetFloatv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -3753,6 +3705,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) CHECK_EXT1(ARB_shader_objects, "GetFloatv"); params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); break; + case GL_MAX_SAMPLES: + CHECK_EXT1(ARB_framebuffer_object, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxSamples); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); } @@ -4156,7 +4112,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->List.ListBase; break; case GL_LIST_INDEX: - params[0] = ctx->ListState.CurrentListNum; + params[0] = (ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0); break; case GL_LIST_MODE: { @@ -4580,21 +4536,21 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = BOOLEAN_TO_INT(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)); break; case GL_TEXTURE_BINDING_1D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name; break; case GL_TEXTURE_BINDING_2D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name; break; case GL_TEXTURE_BINDING_3D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name; break; case GL_TEXTURE_BINDING_1D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1DArray->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name; break; case GL_TEXTURE_BINDING_2D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2DArray->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name; break; case GL_TEXTURE_GEN_S: params[0] = BOOLEAN_TO_INT(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); @@ -4767,22 +4723,19 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_TEXTURE_BINDING_CUBE_MAP_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name; break; case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetIntegerv"); params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1)); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); params[0] = ctx->Hint.TextureCompression; break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: - CHECK_EXT1(ARB_texture_compression, "GetIntegerv"); { GLint formats[100]; GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE); @@ -5064,35 +5017,27 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Const.MaxTextureMaxAnisotropy); break; case GL_MULTISAMPLE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.Enabled); break; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToCoverage); break; case GL_SAMPLE_ALPHA_TO_ONE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleAlphaToOne); break; case GL_SAMPLE_COVERAGE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverage); break; case GL_SAMPLE_COVERAGE_VALUE_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = IROUND(ctx->Multisample.SampleCoverageValue); break; case GL_SAMPLE_COVERAGE_INVERT_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Multisample.SampleCoverageInvert); break; case GL_SAMPLE_BUFFERS_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = ctx->DrawBuffer->Visual.sampleBuffers; break; case GL_SAMPLES_ARB: - CHECK_EXT1(ARB_multisample, "GetIntegerv"); params[0] = ctx->DrawBuffer->Visual.samples; break; case GL_RASTER_POSITION_UNCLIPPED_IBM: @@ -5265,7 +5210,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_TEXTURE_BINDING_RECTANGLE_NV: CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name; + params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name; break; case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: CHECK_EXT1(NV_texture_rectangle, "GetIntegerv"); @@ -5288,43 +5233,33 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Const.MaxSpotExponent); break; case GL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayBufferObj->Name; break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name; break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name; break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name; break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name; break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name; break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name; break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name; break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - CHECK_EXT1(ARB_vertex_buffer_object, "GetIntegerv"); params[0] = ctx->Array.ElementArrayBufferObj->Name; break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: @@ -5449,15 +5384,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->VertexProgram.CurrentPosition; break; case GL_MAX_DRAW_BUFFERS_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); params[0] = ctx->Const.MaxDrawBuffers; break; case GL_DRAW_BUFFER0_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]); break; case GL_DRAW_BUFFER1_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -5469,7 +5401,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_DRAW_BUFFER2_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -5481,7 +5412,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_DRAW_BUFFER3_ARB: - CHECK_EXT1(ARB_draw_buffers, "GetIntegerv"); { GLenum buffer; if (pname - GL_DRAW_BUFFER0_ARB >= ctx->Const.MaxDrawBuffers) { @@ -5601,6 +5531,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) CHECK_EXT1(ARB_shader_objects, "GetIntegerv"); params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0; break; + case GL_MAX_SAMPLES: + CHECK_EXT1(ARB_framebuffer_object, "GetIntegerv"); + params[0] = ctx->Const.MaxSamples; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); } diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index a191b045d3..729f382b4b 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -254,7 +254,7 @@ StateVars = [ ["ctx->Const.MinLineWidth", "ctx->Const.MaxLineWidth"], "", None ), ( "GL_LIST_BASE", GLint, ["ctx->List.ListBase"], "", None ), - ( "GL_LIST_INDEX", GLint, ["ctx->ListState.CurrentListNum"], "", None ), + ( "GL_LIST_INDEX", GLint, ["(ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)"], "", None ), ( "GL_LIST_MODE", GLenum, ["mode"], """GLenum mode; if (!ctx->CompileFlag) @@ -432,15 +432,15 @@ StateVars = [ ( "GL_TEXTURE_1D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), ( "GL_TEXTURE_2D_ARRAY_EXT", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)"], "", ["MESA_texture_array"] ), ( "GL_TEXTURE_BINDING_1D", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1D->Name"], "", None ), + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name"], "", None ), ( "GL_TEXTURE_BINDING_2D", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2D->Name"], "", None ), + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name"], "", None ), ( "GL_TEXTURE_BINDING_3D", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current3D->Name"], "", None ), + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name"], "", None ), ( "GL_TEXTURE_BINDING_1D_ARRAY_EXT", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current1DArray->Name"], "", ["MESA_texture_array"] ), + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name"], "", ["MESA_texture_array"] ), ( "GL_TEXTURE_BINDING_2D_ARRAY_EXT", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].Current2DArray->Name"], "", ["MESA_texture_array"] ), + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name"], "", ["MESA_texture_array"] ), ( "GL_TEXTURE_GEN_S", GLboolean, ["((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)"], "", None ), ( "GL_TEXTURE_GEN_T", GLboolean, @@ -515,7 +515,7 @@ StateVars = [ ( "GL_TEXTURE_CUBE_MAP_ARB", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB)"], "", ["ARB_texture_cube_map"] ), ( "GL_TEXTURE_BINDING_CUBE_MAP_ARB", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentCubeMap->Name"], + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name"], "", ["ARB_texture_cube_map"] ), ( "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB", GLint, ["(1 << (ctx->Const.MaxCubeTextureLevels - 1))"], @@ -523,10 +523,10 @@ StateVars = [ # GL_ARB_texture_compression */ ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint, - ["ctx->Hint.TextureCompression"], "", ["ARB_texture_compression"] ), + ["ctx->Hint.TextureCompression"], "", None ), ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint, ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"], - "", ["ARB_texture_compression"] ), + "", None ), ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum, [], """GLint formats[100]; @@ -534,7 +534,7 @@ StateVars = [ ASSERT(n <= 100); for (i = 0; i < n; i++) params[i] = CONVERSION(formats[i]);""", - ["ARB_texture_compression"] ), + None ), # GL_EXT_compiled_vertex_array ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"], @@ -681,21 +681,21 @@ StateVars = [ # GL_ARB_multisample ( "GL_MULTISAMPLE_ARB", GLboolean, - ["ctx->Multisample.Enabled"], "", ["ARB_multisample"] ), + ["ctx->Multisample.Enabled"], "", None ), ( "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB", GLboolean, - ["ctx->Multisample.SampleAlphaToCoverage"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleAlphaToCoverage"], "", None ), ( "GL_SAMPLE_ALPHA_TO_ONE_ARB", GLboolean, - ["ctx->Multisample.SampleAlphaToOne"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleAlphaToOne"], "", None ), ( "GL_SAMPLE_COVERAGE_ARB", GLboolean, - ["ctx->Multisample.SampleCoverage"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleCoverage"], "", None ), ( "GL_SAMPLE_COVERAGE_VALUE_ARB", GLfloat, - ["ctx->Multisample.SampleCoverageValue"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleCoverageValue"], "", None ), ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean, - ["ctx->Multisample.SampleCoverageInvert"], "", ["ARB_multisample"] ), + ["ctx->Multisample.SampleCoverageInvert"], "", None ), ( "GL_SAMPLE_BUFFERS_ARB", GLint, - ["ctx->DrawBuffer->Visual.sampleBuffers"], "", ["ARB_multisample"] ), + ["ctx->DrawBuffer->Visual.sampleBuffers"], "", None ), ( "GL_SAMPLES_ARB", GLint, - ["ctx->DrawBuffer->Visual.samples"], "", ["ARB_multisample"] ), + ["ctx->DrawBuffer->Visual.samples"], "", None ), # GL_IBM_rasterpos_clip ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean, @@ -795,7 +795,7 @@ StateVars = [ ( "GL_TEXTURE_RECTANGLE_NV", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_RECTANGLE_NV)"], "", ["NV_texture_rectangle"] ), ( "GL_TEXTURE_BINDING_RECTANGLE_NV", GLint, - ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentRect->Name"], + ["ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name"], "", ["NV_texture_rectangle"] ), ( "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV", GLint, ["ctx->Const.MaxTextureRectSize"], "", ["NV_texture_rectangle"] ), @@ -815,30 +815,30 @@ StateVars = [ # GL_ARB_vertex_buffer_object ( "GL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayBufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayBufferObj->Name"], "", None ), ( "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Vertex.BufferObj->Name"], "", None ), ( "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Normal.BufferObj->Name"], "", None ), ( "GL_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Color.BufferObj->Name"], "", None ), ( "GL_INDEX_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->Index.BufferObj->Name"], "", None ), ( "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), ( "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB", GLint, - ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", ["ARB_vertex_buffer_object"] ), + ["ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name"], "", None ), ( "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), ( "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ArrayObj->FogCoord.BufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), # GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB - not supported ( "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB", GLint, ["ctx->Array.ElementArrayBufferObj->Name"], - "", ["ARB_vertex_buffer_object"] ), + "", None ), # GL_EXT_pixel_buffer_object ( "GL_PIXEL_PACK_BUFFER_BINDING_EXT", GLint, @@ -914,9 +914,9 @@ StateVars = [ # GL_ARB_draw_buffers ( "GL_MAX_DRAW_BUFFERS_ARB", GLint, - ["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ), + ["ctx->Const.MaxDrawBuffers"], "", None ), ( "GL_DRAW_BUFFER0_ARB", GLenum, - ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", ["ARB_draw_buffers"] ), + ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ), ( "GL_DRAW_BUFFER1_ARB", GLenum, ["buffer"], """GLenum buffer; @@ -924,7 +924,7 @@ StateVars = [ _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); return; } - buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", ["ARB_draw_buffers"] ), + buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", None ), ( "GL_DRAW_BUFFER2_ARB", GLenum, ["buffer"], """GLenum buffer; @@ -932,7 +932,7 @@ StateVars = [ _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); return; } - buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", ["ARB_draw_buffers"] ), + buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", None ), ( "GL_DRAW_BUFFER3_ARB", GLenum, ["buffer"], """GLenum buffer; @@ -940,7 +940,7 @@ StateVars = [ _mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)"); return; } - buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", ["ARB_draw_buffers"] ), + buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", None ), # XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future # GL_OES_read_format @@ -1009,7 +1009,11 @@ StateVars = [ # close enough for now. ( "GL_CURRENT_PROGRAM", GLint, ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"], - "", ["ARB_shader_objects"] ) + "", ["ARB_shader_objects"] ), + + # GL_ARB_framebuffer_object + ( "GL_MAX_SAMPLES", GLint, ["ctx->Const.MaxSamples"], "", + ["ARB_framebuffer_object"] ) ] diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 89daa0e21d..a42c44686d 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -25,7 +25,6 @@ #include "glheader.h" -#include "colormac.h" #include "context.h" #include "get.h" #include "version.h" @@ -83,7 +82,16 @@ compute_version(const GLcontext *ctx) ctx->Extensions.ARB_vertex_shader && ctx->Extensions.ARB_fragment_shader && ctx->Extensions.ARB_texture_non_power_of_two && - ctx->Extensions.EXT_blend_equation_separate); + ctx->Extensions.EXT_blend_equation_separate && + + /* Technically, 2.0 requires the functionality + * of the EXT version. Enable 2.0 if either + * extension is available, and assume that a + * driver that only exposes the ATI extension + * will fallback to software when necessary. + */ + (ctx->Extensions.EXT_stencil_two_side + || ctx->Extensions.ATI_separate_stencil)); const GLboolean ver_2_1 = (ver_2_0 && ctx->Extensions.ARB_shading_language_120 && ctx->Extensions.EXT_pixel_buffer_object && @@ -121,12 +129,6 @@ _mesa_GetString( GLenum name ) static const char *vendor = "Brian Paul"; static const char *renderer = "Mesa"; -#if FEATURE_ARB_shading_language_120_foo /* support not complete! */ - static const char *sl_version = "1.20"; -#elif FEATURE_ARB_shading_language_100 - static const char *sl_version = "1.10"; -#endif - if (!ctx) return NULL; @@ -154,8 +156,10 @@ _mesa_GetString( GLenum name ) return (const GLubyte *) ctx->Extensions.String; #if FEATURE_ARB_shading_language_100 case GL_SHADING_LANGUAGE_VERSION_ARB: - if (ctx->Extensions.ARB_shading_language_100) - return (const GLubyte *) sl_version; + if (ctx->Extensions.ARB_shading_language_120) + return (const GLubyte *) "1.20"; + else if (ctx->Extensions.ARB_shading_language_100) + return (const GLubyte *) "1.10"; goto error; #endif #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \ diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index f0f97c218c..482a36de93 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -1,28 +1,8 @@ -/** - * \file glheader.h - * Top-most include file. - * - * This is the top-most include file of the Mesa sources. - * It includes gl.h and all system headers which are needed. - * Other Mesa source files should \e not directly include any system - * headers. This allows system-dependent hacks/workarounds to be - * collected in one place. - * - * \note Actually, a lot of system-dependent stuff is now in imports.[ch]. - * - * If you touch this file, everything gets recompiled! - * - * This file should be included before any other header in the .c files. - * - * Put compiler/OS/assembly pragmas and macros here to avoid - * cluttering other source files. - */ - /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.5 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -43,89 +23,22 @@ */ -#ifndef GLHEADER_H -#define GLHEADER_H - -/* This allows Mesa to be integrated into XFree86 */ -#ifdef HAVE_DIX_CONFIG_H -#include "dix-config.h" -#endif - -#include <assert.h> -#include <ctype.h> -#if defined(__alpha__) && defined(CCPML) -#include <cpml.h> /* use Compaq's Fast Math Library on Alpha */ -#else -#include <math.h> -#endif -#include <limits.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#if defined(__linux__) && defined(__i386__) -#include <fpu_control.h> -#endif -#include <float.h> -#include <stdarg.h> - - -/* Get standard integer types */ -#if defined(_MSC_VER) - - typedef __int8 int8_t; - typedef unsigned __int8 uint8_t; - typedef __int16 int16_t; - typedef unsigned __int16 uint16_t; -# ifndef __eglplatform_h_ - typedef __int32 int32_t; -# endif - typedef unsigned __int32 uint32_t; - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; - -# if defined(_WIN64) - typedef __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -# else - typedef __int32 intptr_t; - typedef unsigned __int32 uintptr_t; -# endif - -# define INT64_C(__val) __val##i64 -# define UINT64_C(__val) __val##ui64 +/** + * \file glheader.h + * Wrapper for GL/gl.h and GL/glext.h + */ -#else -# include <stdint.h> -#endif -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) -# define __WIN32__ -# define finite _finite -#endif +#ifndef GLHEADER_H +#define GLHEADER_H -#if defined(__WATCOMC__) -# define finite _finite -# pragma disable_message(201) /* Disable unreachable code warnings */ -#endif #ifdef WGLAPI -# undef WGLAPI +#undef WGLAPI #endif + #if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP) -# if !defined(__GNUC__) /* mingw environment */ -# pragma warning( disable : 4068 ) /* unknown pragma */ -# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ -# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ -# pragma warning( disable : 4127 ) /* conditional expression is constant */ -# if defined(MESA_MINWARN) -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ -# endif -# endif # if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define WGLAPI __declspec(dllexport) # elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ @@ -136,30 +49,10 @@ #endif /* WIN32 / CYGWIN bracket */ -/* - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN. - * Do not use them unless absolutely necessary! - * Try to use a runtime test instead. - * For now, only used by some DRI hardware drivers for color/texel packing. - */ -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN -#if defined(__linux__) -#include <byteswap.h> -#define CPU_TO_LE32( x ) bswap_32( x ) -#else /*__linux__*/ -#define CPU_TO_LE32( x ) ( x ) /* fix me for non-Linux big-endian! */ -#endif /*__linux__*/ -#define MESA_BIG_ENDIAN 1 -#else -#define CPU_TO_LE32( x ) ( x ) -#define MESA_LITTLE_ENDIAN 1 -#endif -#define LE32_TO_CPU( x ) CPU_TO_LE32( x ) - - #define GL_GLEXT_PROTOTYPES #include "GL/gl.h" #include "GL/glext.h" +#include <GL/internal/glcore.h> #ifndef GL_FIXED @@ -181,118 +74,10 @@ #endif -#if !defined(CAPI) && defined(WIN32) && !defined(BUILD_FOR_SNAP) -#define CAPI _cdecl -#endif - - -/* This is a macro on IRIX */ -#ifdef _P -#undef _P -#endif - - -/* Turn off macro checking systems used by other libraries */ -#ifdef CHECK -#undef CHECK -#endif - - -/* Create a macro so that asm functions can be linked into compilers other - * than GNU C - */ -#ifndef _ASMAPI -#if defined(WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/ -#define _ASMAPI __cdecl -#else -#define _ASMAPI -#endif -#ifdef PTR_DECL_IN_FRONT -#define _ASMAPIP * _ASMAPI -#else -#define _ASMAPIP _ASMAPI * -#endif -#endif - -#ifdef USE_X86_ASM -#define _NORMAPI _ASMAPI -#define _NORMAPIP _ASMAPIP -#else -#define _NORMAPI -#define _NORMAPIP * -#endif - - -/* Function inlining */ -#if defined(__GNUC__) -# define INLINE __inline__ -#elif defined(__MSC__) -# define INLINE __inline -#elif defined(_MSC_VER) -# define INLINE __inline -#elif defined(__ICL) -# define INLINE __inline -#elif defined(__INTEL_COMPILER) -# define INLINE inline -#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) -# define INLINE __inline -#else -# define INLINE -#endif - - -/* If we build the library with gcc's -fvisibility=hidden flag, we'll - * use the PUBLIC macro to mark functions that are to be exported. - * - * We also need to define a USED attribute, so the optimizer doesn't - * inline a static function that we later use in an alias. - ajax - */ -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 -# define PUBLIC __attribute__((visibility("default"))) -# define USED __attribute__((used)) -#else -# define PUBLIC -# define USED -#endif - - -/* Some compilers don't like some of Mesa's const usage */ -#ifdef NO_CONST -# define CONST -#else -# define CONST const -#endif - - -#if !defined(_WIN32_WCE) -#if defined(BUILD_FOR_SNAP) && defined(CHECKED) -# define ASSERT(X) _CHECK(X) -#elif defined(DEBUG) -# define ASSERT(X) assert(X) -#else -# define ASSERT(X) -#endif -#endif - - -#if !defined __GNUC__ || __GNUC__ < 3 -# define __builtin_expect(x, y) x -#endif - -/* The __FUNCTION__ gcc variable is generally only used for debugging. - * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. - * Don't define it if using a newer Windows compiler. +/** + * Special, internal token */ -#if defined(__VMS) -# define __FUNCTION__ "VMS$NL:" -#elif __STDC_VERSION__ < 199901L -# if ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ - (!defined(_MSC_VER) || _MSC_VER < 1300) -# define __FUNCTION__ "<unknown>" -# endif -#endif - +#define GL_SHADER_PROGRAM_MESA 0x9999 -#include "config.h" #endif /* GLHEADER_H */ diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index dcfa9c7363..e2d4129a38 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -89,10 +89,6 @@ _mesa_Hint( GLenum target, GLenum mode ) /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSION_HINT_ARB: - if (!ctx->Extensions.ARB_texture_compression) { - _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); - return; - } if (ctx->Hint.TextureCompression == mode) return; FLUSH_VERTICES(ctx, _NEW_HINT); diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index 77c458d540..905c1ad830 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -955,7 +955,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s } } - if (width != 0 && _mesa_bitcount(width) != 1) { + if (width != 0 && !_mesa_is_pow_two(width)) { if (target == GL_PROXY_HISTOGRAM) { error = GL_TRUE; } diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 52c4999e16..4d86c54777 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -61,7 +61,7 @@ /** * \return GL_TRUE if type is packed pixel type, GL_FALSE otherwise. */ -static GLboolean +GLboolean _mesa_type_is_packed(GLenum type) { switch (type) { @@ -849,7 +849,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, return NULL; } - if (packing->SkipPixels == 0) { + if ((packing->SkipPixels & 7) == 0) { _mesa_memcpy( dst, src, width_in_bytes ); if (packing->LsbFirst) { flip_bytes( dst, width_in_bytes ); @@ -941,7 +941,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, if (!dst) return; - if (packing->SkipPixels == 0) { + if ((packing->SkipPixels & 7) == 0) { _mesa_memcpy( dst, src, width_in_bytes ); if (packing->LsbFirst) { flip_bytes( dst, width_in_bytes ); @@ -960,20 +960,20 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, if (*s & srcMask) { *d |= dstMask; } - if (srcMask == 128) { - srcMask = 1; + if (srcMask == 1) { + srcMask = 128; s++; } else { - srcMask = srcMask << 1; + srcMask = srcMask >> 1; } - if (dstMask == 1) { - dstMask = 128; + if (dstMask == 128) { + dstMask = 1; d++; *d = 0; } else { - dstMask = dstMask >> 1; + dstMask = dstMask << 1; } } } @@ -1689,7 +1689,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { /* compute luminance values */ - if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { + if (transferOps & IMAGE_CLAMP_BIT) { for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; luminance[i] = CLAMP(sum, 0.0F, 1.0F); @@ -4214,7 +4214,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, switch (dstType) { case GL_UNSIGNED_BYTE: - if (sizeof(GLstencil) == 8) { + if (sizeof(GLstencil) == 1) { _mesa_memcpy( dest, source, n ); } else { @@ -4226,14 +4226,11 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, } break; case GL_BYTE: - if (sizeof(GLstencil) == 8) { - _mesa_memcpy( dest, source, n ); - } - else { + { GLbyte *dst = (GLbyte *) dest; GLuint i; for (i=0;i<n;i++) { - dst[i] = (GLbyte) source[i]; + dst[i] = (GLbyte) (source[i] & 0x7f); } } break; @@ -4278,7 +4275,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, GLint *dst = (GLint *) dest; GLuint i; for (i=0;i<n;i++) { - *dst++ = (GLint) source[i]; + dst[i] = (GLint) source[i]; } if (dstPacking->SwapBytes) { _mesa_swap4( (GLuint *) dst, n ); @@ -5155,7 +5152,7 @@ _mesa_clip_to_region(GLint xmin, GLint ymin, /* right clipping */ if (*x + *width > xmax) - *width -= (*x + *width - xmax - 1); + *width -= (*x + *width - xmax); if (*width <= 0) return GL_FALSE; @@ -5168,7 +5165,7 @@ _mesa_clip_to_region(GLint xmin, GLint ymin, /* top (or bottom) clipping */ if (*y + *height > ymax) - *height -= (*y + *height - ymax - 1); + *height -= (*y + *height - ymax); if (*height <= 0) return GL_FALSE; diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 38e1374c20..0e0bbd96d8 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -36,6 +36,9 @@ _mesa_swap2( GLushort *p, GLuint n ); extern void _mesa_swap4( GLuint *p, GLuint n ); +extern GLboolean +_mesa_type_is_packed(GLenum type); + extern GLint _mesa_sizeof_type( GLenum type ); diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 27d6df2f85..cb04594c1f 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -104,6 +104,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) (void) posix_memalign(& mem, alignment, bytes); return mem; +#elif defined(_WIN32) && defined(_MSC_VER) + return _aligned_malloc(bytes, alignment); #else uintptr_t ptr, buf; @@ -144,6 +146,15 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) } return mem; +#elif defined(_WIN32) && defined(_MSC_VER) + void *mem; + + mem = _aligned_malloc(bytes, alignment); + if (mem != NULL) { + (void) memset(mem, 0, bytes); + } + + return mem; #else uintptr_t ptr, buf; @@ -180,6 +191,8 @@ _mesa_align_free(void *ptr) { #if defined(HAVE_POSIX_MEMALIGN) free(ptr); +#elif defined(_WIN32) && defined(_MSC_VER) + _aligned_free(ptr); #else void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); void *realAddr = *cubbyHole; @@ -194,6 +207,10 @@ void * _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, unsigned long alignment) { +#if defined(_WIN32) && defined(_MSC_VER) + (void) oldSize; + return _aligned_realloc(oldBuffer, newSize, alignment); +#else const size_t copySize = (oldSize < newSize) ? oldSize : newSize; void *newBuf = _mesa_align_malloc(newSize, alignment); if (newBuf && oldBuffer && copySize > 0) { @@ -202,6 +219,7 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, if (oldBuffer) _mesa_align_free(oldBuffer); return newBuf; +#endif } @@ -541,25 +559,28 @@ _mesa_pow(double x, double y) int _mesa_ffs(int32_t i) { -#if (defined(_WIN32) && !defined(__MINGW32__) ) || defined(__IBMC__) || defined(__IBMCPP__) - register int32_t bit = 1; - if ((i & 0xffff) == 0) { - bit += 16; - i >>= 16; - } - if ((i & 0xff) == 0) { - bit += 8; - i >>= 8; - } - if ((i & 0xf) == 0) { - bit += 4; - i >>= 4; - } - if ((i & 0x3) == 0) { - bit += 2; - i >>= 2; +#if (defined(_WIN32) ) || defined(__IBMC__) || defined(__IBMCPP__) + register int bit = 0; + if (i != 0) { + if ((i & 0xffff) == 0) { + bit += 16; + i >>= 16; + } + if ((i & 0xff) == 0) { + bit += 8; + i >>= 8; + } + if ((i & 0xf) == 0) { + bit += 4; + i >>= 4; + } + while ((i & 1) == 0) { + bit++; + i >>= 1; + } + bit++; } - return (i) ? (bit + ((i + 1) & 0x01)) : 0; + return bit; #else return ffs(i); #endif @@ -931,6 +952,19 @@ _mesa_printf( const char *fmtString, ... ) va_end( args ); } +/** Wrapper around fprintf(), using vsprintf() for the formatting. */ +void +_mesa_fprintf( FILE *f, const char *fmtString, ... ) +{ + char s[MAXSTRING]; + va_list args; + va_start( args, fmtString ); + vsnprintf(s, MAXSTRING, fmtString, args); + va_end( args ); + fprintf(f, "%s", s); +} + + /** Wrapper around vsprintf() */ int _mesa_vsprintf( char *str, const char *fmt, va_list args ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 52d679cadd..4192f037c0 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.5 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -36,10 +36,8 @@ #define IMPORTS_H -/* XXX some of the stuff in glheader.h should be moved into this file. - */ +#include "compiler.h" #include "glheader.h" -#include <GL/internal/glcore.h> #ifdef __cplusplus @@ -48,26 +46,6 @@ extern "C" { /**********************************************************************/ -/** \name General macros */ -/*@{*/ - -#ifndef NULL -#define NULL 0 -#endif - - -/** gcc -pedantic warns about long string literals, LONGSTRING silences that */ -#if !defined(__GNUC__) || (__GNUC__ < 2) || \ - ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) -# define LONGSTRING -#else -# define LONGSTRING __extension__ -#endif - -/*@}*/ - - -/**********************************************************************/ /** Memory macros */ /*@{*/ @@ -130,48 +108,11 @@ typedef union { GLfloat f; GLint i; } fi_type; #define MAX_GLUSHORT 0xffff #define MAX_GLUINT 0xffffffff -#ifndef M_PI -#define M_PI (3.1415926536) -#endif - -#ifndef M_E -#define M_E (2.7182818284590452354) -#endif - -#ifndef ONE_DIV_LN2 -#define ONE_DIV_LN2 (1.442695040888963456) -#endif - -#ifndef ONE_DIV_SQRT_LN2 -#define ONE_DIV_SQRT_LN2 (1.201122408786449815) -#endif - -#ifndef FLT_MAX_EXP -#define FLT_MAX_EXP 128 -#endif - /* Degrees to radians conversion: */ #define DEG2RAD (M_PI/180.0) /*** - *** USE_IEEE: Determine if we're using IEEE floating point - ***/ -#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ - defined(__s390x__) || defined(__powerpc__) || \ - defined(__amd64__) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__hppa__) || defined(hpux) || \ - defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || \ - defined(__sh__) || defined(__m32r__) || \ - (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) -#define USE_IEEE -#define IEEE_ONE 0x3f800000 -#endif - - -/*** *** SQRTF: single-precision square root ***/ #if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */ @@ -324,7 +265,8 @@ static INLINE int iround(float f) } #define IROUND(x) iround(x) #elif defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) && \ - (!defined(__BEOS__) || (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))) + (!(defined(__BEOS__) || defined(__HAIKU__)) || \ + (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))) static INLINE int iround(float f) { int r; @@ -461,6 +403,16 @@ static INLINE int iceil(float f) #endif +/** + * Is x a power of two? + */ +static INLINE int +_mesa_is_pow_two(int x) +{ + return !(x & (x - 1)); +} + + /*** *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255] *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255] @@ -497,113 +449,6 @@ static INLINE int iceil(float f) #endif -/*** - *** START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save - *** original mode to a temporary). - *** END_FAST_MATH: Restore x86 FPU to original mode. - ***/ -#if defined(__GNUC__) && defined(__i386__) -/* - * Set the x86 FPU control word to guarentee only 32 bits of precision - * are stored in registers. Allowing the FPU to store more introduces - * differences between situations where numbers are pulled out of memory - * vs. situations where the compiler is able to optimize register usage. - * - * In the worst case, we force the compiler to use a memory access to - * truncate the float, by specifying the 'volatile' keyword. - */ -/* Hardware default: All exceptions masked, extended double precision, - * round to nearest (IEEE compliant): - */ -#define DEFAULT_X86_FPU 0x037f -/* All exceptions masked, single precision, round to nearest: - */ -#define FAST_X86_FPU 0x003f -/* The fldcw instruction will cause any pending FP exceptions to be - * raised prior to entering the block, and we clear any pending - * exceptions before exiting the block. Hence, asm code has free - * reign over the FPU while in the fast math block. - */ -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) \ -do { \ - static GLuint mask = DEFAULT_X86_FPU; \ - __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \ - __asm__ ( "fldcw %0" : : "m" (mask) ); \ -} while (0) -#else -#define START_FAST_MATH(x) \ -do { \ - static GLuint mask = FAST_X86_FPU; \ - __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \ - __asm__ ( "fldcw %0" : : "m" (mask) ); \ -} while (0) -#endif -/* Restore original FPU mode, and clear any exceptions that may have - * occurred in the FAST_MATH block. - */ -#define END_FAST_MATH(x) \ -do { \ - __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \ -} while (0) - -#elif defined(__WATCOMC__) && defined(__386__) -#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ -#define FAST_X86_FPU 0x003f /* See GCC comments above */ -void _watcom_start_fast_math(unsigned short *x,unsigned short *mask); -#pragma aux _watcom_start_fast_math = \ - "fnstcw word ptr [eax]" \ - "fldcw word ptr [ecx]" \ - parm [eax] [ecx] \ - modify exact []; -void _watcom_end_fast_math(unsigned short *x); -#pragma aux _watcom_end_fast_math = \ - "fnclex" \ - "fldcw word ptr [eax]" \ - parm [eax] \ - modify exact []; -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) \ -do { \ - static GLushort mask = DEFAULT_X86_FPU; \ - _watcom_start_fast_math(&x,&mask); \ -} while (0) -#else -#define START_FAST_MATH(x) \ -do { \ - static GLushort mask = FAST_X86_FPU; \ - _watcom_start_fast_math(&x,&mask); \ -} while (0) -#endif -#define END_FAST_MATH(x) _watcom_end_fast_math(&x) - -#elif defined(_MSC_VER) && defined(_M_IX86) -#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ -#define FAST_X86_FPU 0x003f /* See GCC comments above */ -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) do {\ - static GLuint mask = DEFAULT_X86_FPU;\ - __asm fnstcw word ptr [x]\ - __asm fldcw word ptr [mask]\ -} while(0) -#else -#define START_FAST_MATH(x) do {\ - static GLuint mask = FAST_X86_FPU;\ - __asm fnstcw word ptr [x]\ - __asm fldcw word ptr [mask]\ -} while(0) -#endif -#define END_FAST_MATH(x) do {\ - __asm fnclex\ - __asm fldcw word ptr [x]\ -} while(0) - -#else -#define START_FAST_MATH(x) x = 0 -#define END_FAST_MATH(x) (void)(x) -#endif - - /** * Return 1 if this is a little endian machine, 0 if big endian. */ @@ -758,6 +603,9 @@ _mesa_snprintf( char *str, size_t size, const char *fmt, ... ); extern void _mesa_printf( const char *fmtString, ... ); +extern void +_mesa_fprintf( FILE *f, const char *fmtString, ... ); + extern int _mesa_vsprintf( char *str, const char *fmt, va_list args ); diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index f37d1f216f..a15c1f0be0 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -53,6 +53,11 @@ _mesa_ShadeModel( GLenum mode ) FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.ShadeModel = mode; + if (mode == GL_FLAT) + ctx->_TriangleCaps |= DD_FLATSHADE; + else + ctx->_TriangleCaps &= ~DD_FLATSHADE; + if (ctx->Driver.ShadeModel) ctx->Driver.ShadeModel( ctx, mode ); } @@ -179,6 +184,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) GET_CURRENT_CONTEXT(ctx); GLint i = (GLint) (light - GL_LIGHT0); GLfloat temp[4]; + ASSERT_OUTSIDE_BEGIN_END(ctx); if (i < 0 || i >= (GLint) ctx->Const.MaxLights) { _mesa_error( ctx, GL_INVALID_ENUM, "glLight(light=0x%x)", light ); @@ -202,7 +208,8 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { _math_matrix_analyse(ctx->ModelviewMatrixStack.Top); } - TRANSFORM_NORMAL(temp, params, ctx->ModelviewMatrixStack.Top->inv); + TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m); + NORMALIZE_3FV(temp); params = temp; break; case GL_SPOT_EXPONENT: @@ -441,6 +448,10 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params ) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.Model.TwoSide = newbool; + if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) + ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; + else + ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; break; case GL_LIGHT_MODEL_COLOR_CONTROL: if (params[0] == (GLfloat) GL_SINGLE_COLOR) diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 0c2dbf915a..81d0d33abb 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -56,6 +56,11 @@ _mesa_LineWidth( GLfloat width ) FLUSH_VERTICES(ctx, _NEW_LINE); ctx->Line.Width = width; + if (width != 1.0F) + ctx->_TriangleCaps |= DD_LINE_WIDTH; + else + ctx->_TriangleCaps &= ~DD_LINE_WIDTH; + if (ctx->Driver.LineWidth) ctx->Driver.LineWidth(ctx, width); } diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 0f96f94909..90d142278d 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -42,7 +42,6 @@ #include "matrix.h" #include "mtypes.h" #include "math/m_matrix.h" -#include "math/m_xform.h" /** diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 487493f88e..8fb32dd7e9 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -44,7 +44,6 @@ #define FEATURE_dlist _HAVE_FULL_GL #define FEATURE_draw_read_buffer _HAVE_FULL_GL #define FEATURE_drawpix _HAVE_FULL_GL -#define FEATURE_es2_glsl 0 #define FEATURE_evaluators _HAVE_FULL_GL #define FEATURE_feedback _HAVE_FULL_GL #define FEATURE_fixedpt 0 @@ -56,9 +55,12 @@ #define FEATURE_texture_s3tc _HAVE_FULL_GL #define FEATURE_userclip _HAVE_FULL_GL #define FEATURE_vertex_array_byte 0 +#define FEATURE_windowpos _HAVE_FULL_GL +#define FEATURE_es2_glsl 0 #define FEATURE_ARB_occlusion_query _HAVE_FULL_GL #define FEATURE_ARB_fragment_program _HAVE_FULL_GL +#define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL #define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL #define FEATURE_ARB_vertex_program _HAVE_FULL_GL #define FEATURE_ARB_vertex_shader _HAVE_FULL_GL diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 061378f3b7..3dd4b3391b 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.1 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -41,11 +41,76 @@ bytes_per_pixel(GLenum datatype, GLuint comps) { GLint b = _mesa_sizeof_packed_type(datatype); assert(b >= 0); - return b * comps; + + if (_mesa_type_is_packed(datatype)) + return b; + else + return b * comps; } /** + * \name Support macros for do_row and do_row_3d + * + * The macro madness is here for two reasons. First, it compacts the code + * slightly. Second, it makes it much easier to adjust the specifics of the + * filter to tune the rounding characteristics. + */ +/*@{*/ +#define DECLARE_ROW_POINTERS(t, e) \ + const t(*rowA)[e] = (const t(*)[e]) srcRowA; \ + const t(*rowB)[e] = (const t(*)[e]) srcRowB; \ + const t(*rowC)[e] = (const t(*)[e]) srcRowC; \ + const t(*rowD)[e] = (const t(*)[e]) srcRowD; \ + t(*dst)[e] = (t(*)[e]) dstRow + +#define DECLARE_ROW_POINTERS0(t) \ + const t *rowA = (const t *) srcRowA; \ + const t *rowB = (const t *) srcRowB; \ + const t *rowC = (const t *) srcRowC; \ + const t *rowD = (const t *) srcRowD; \ + t *dst = (t *) dstRow + +#define FILTER_SUM_3D(Aj, Ak, Bj, Bk, Cj, Ck, Dj, Dk) \ + ((unsigned) Aj + (unsigned) Ak \ + + (unsigned) Bj + (unsigned) Bk \ + + (unsigned) Cj + (unsigned) Ck \ + + (unsigned) Dj + (unsigned) Dk \ + + 4) >> 3 + +#define FILTER_3D(e) \ + do { \ + dst[i][e] = FILTER_SUM_3D(rowA[j][e], rowA[k][e], \ + rowB[j][e], rowB[k][e], \ + rowC[j][e], rowC[k][e], \ + rowD[j][e], rowD[k][e]); \ + } while(0) + +#define FILTER_F_3D(e) \ + do { \ + dst[i][e] = (rowA[j][e] + rowA[k][e] \ + + rowB[j][e] + rowB[k][e] \ + + rowC[j][e] + rowC[k][e] \ + + rowD[j][e] + rowD[k][e]) * 0.125F; \ + } while(0) + +#define FILTER_HF_3D(e) \ + do { \ + const GLfloat aj = _mesa_half_to_float(rowA[j][e]); \ + const GLfloat ak = _mesa_half_to_float(rowA[k][e]); \ + const GLfloat bj = _mesa_half_to_float(rowB[j][e]); \ + const GLfloat bk = _mesa_half_to_float(rowB[k][e]); \ + const GLfloat cj = _mesa_half_to_float(rowC[j][e]); \ + const GLfloat ck = _mesa_half_to_float(rowC[k][e]); \ + const GLfloat dj = _mesa_half_to_float(rowD[j][e]); \ + const GLfloat dk = _mesa_half_to_float(rowD[k][e]); \ + dst[i][e] = _mesa_float_to_half((aj + ak + bj + bk + cj + ck + dj + dk) \ + * 0.125F); \ + } while(0) +/*@}*/ + + +/** * Average together two rows of a source image to produce a single new * row in the dest image. It's legal for the two source rows to point * to the same data. The source width must be equal to either the @@ -361,7 +426,7 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, const GLint rowAr0 = rowA[j] & 0x1f; const GLint rowAr1 = rowA[k] & 0x1f; const GLint rowBr0 = rowB[j] & 0x1f; - const GLint rowBr1 = rowB[k] & 0xf; + const GLint rowBr1 = rowB[k] & 0x1f; const GLint rowAg0 = (rowA[j] >> 5) & 0x1f; const GLint rowAg1 = (rowA[k] >> 5) & 0x1f; const GLint rowBg0 = (rowB[j] >> 5) & 0x1f; @@ -412,6 +477,384 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, } +/** + * Average together four rows of a source image to produce a single new + * row in the dest image. It's legal for the two source rows to point + * to the same data. The source width must be equal to either the + * dest width or two times the dest width. + * + * \param datatype GL pixel type \c GL_UNSIGNED_BYTE, \c GL_UNSIGNED_SHORT, + * \c GL_FLOAT, etc. + * \param comps number of components per pixel (1..4) + * \param srcWidth Width of a row in the source data + * \param srcRowA Pointer to one of the rows of source data + * \param srcRowB Pointer to one of the rows of source data + * \param srcRowC Pointer to one of the rows of source data + * \param srcRowD Pointer to one of the rows of source data + * \param dstWidth Width of a row in the destination data + * \param srcRowA Pointer to the row of destination data + */ +static void +do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth, + const GLvoid *srcRowA, const GLvoid *srcRowB, + const GLvoid *srcRowC, const GLvoid *srcRowD, + GLint dstWidth, GLvoid *dstRow) +{ + const GLuint k0 = (srcWidth == dstWidth) ? 0 : 1; + const GLuint colStride = (srcWidth == dstWidth) ? 1 : 2; + GLuint i, j, k; + + ASSERT(comps >= 1); + ASSERT(comps <= 4); + + if ((datatype == GL_UNSIGNED_BYTE) && (comps == 4)) { + DECLARE_ROW_POINTERS(GLubyte, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + FILTER_3D(1); + FILTER_3D(2); + FILTER_3D(3); + } + } + else if ((datatype == GL_UNSIGNED_BYTE) && (comps == 3)) { + DECLARE_ROW_POINTERS(GLubyte, 3); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + FILTER_3D(1); + FILTER_3D(2); + } + } + else if ((datatype == GL_UNSIGNED_BYTE) && (comps == 2)) { + DECLARE_ROW_POINTERS(GLubyte, 2); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + FILTER_3D(1); + } + } + else if ((datatype == GL_UNSIGNED_BYTE) && (comps == 1)) { + DECLARE_ROW_POINTERS(GLubyte, 1); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + } + } + else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 4)) { + DECLARE_ROW_POINTERS(GLushort, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + FILTER_3D(1); + FILTER_3D(2); + FILTER_3D(3); + } + } + else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 3)) { + DECLARE_ROW_POINTERS(GLushort, 3); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + FILTER_3D(1); + FILTER_3D(2); + } + } + else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 2)) { + DECLARE_ROW_POINTERS(GLushort, 2); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + FILTER_3D(1); + } + } + else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 1)) { + DECLARE_ROW_POINTERS(GLushort, 1); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D(0); + } + } + else if ((datatype == GL_FLOAT) && (comps == 4)) { + DECLARE_ROW_POINTERS(GLfloat, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_F_3D(0); + FILTER_F_3D(1); + FILTER_F_3D(2); + FILTER_F_3D(3); + } + } + else if ((datatype == GL_FLOAT) && (comps == 3)) { + DECLARE_ROW_POINTERS(GLfloat, 3); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_F_3D(0); + FILTER_F_3D(1); + FILTER_F_3D(2); + } + } + else if ((datatype == GL_FLOAT) && (comps == 2)) { + DECLARE_ROW_POINTERS(GLfloat, 2); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_F_3D(0); + FILTER_F_3D(1); + } + } + else if ((datatype == GL_FLOAT) && (comps == 1)) { + DECLARE_ROW_POINTERS(GLfloat, 1); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_F_3D(0); + } + } + else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 4)) { + DECLARE_ROW_POINTERS(GLhalfARB, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_HF_3D(0); + FILTER_HF_3D(1); + FILTER_HF_3D(2); + FILTER_HF_3D(3); + } + } + else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 3)) { + DECLARE_ROW_POINTERS(GLhalfARB, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_HF_3D(0); + FILTER_HF_3D(1); + FILTER_HF_3D(2); + } + } + else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 2)) { + DECLARE_ROW_POINTERS(GLhalfARB, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_HF_3D(0); + FILTER_HF_3D(1); + } + } + else if ((datatype == GL_HALF_FLOAT_ARB) && (comps == 1)) { + DECLARE_ROW_POINTERS(GLhalfARB, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_HF_3D(0); + } + } + else if ((datatype == GL_UNSIGNED_INT) && (comps == 1)) { + const GLuint *rowA = (const GLuint *) srcRowA; + const GLuint *rowB = (const GLuint *) srcRowB; + const GLuint *rowC = (const GLuint *) srcRowC; + const GLuint *rowD = (const GLuint *) srcRowD; + GLfloat *dst = (GLfloat *) dstRow; + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const uint64_t tmp = (((uint64_t) rowA[j] + (uint64_t) rowA[k]) + + ((uint64_t) rowB[j] + (uint64_t) rowB[k]) + + ((uint64_t) rowC[j] + (uint64_t) rowC[k]) + + ((uint64_t) rowD[j] + (uint64_t) rowD[k])); + dst[i] = (GLfloat)((double) tmp * 0.125); + } + } + else if ((datatype == GL_UNSIGNED_SHORT_5_6_5) && (comps == 3)) { + DECLARE_ROW_POINTERS0(GLushort); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0x1f; + const GLint rowAr1 = rowA[k] & 0x1f; + const GLint rowBr0 = rowB[j] & 0x1f; + const GLint rowBr1 = rowB[k] & 0x1f; + const GLint rowCr0 = rowC[j] & 0x1f; + const GLint rowCr1 = rowC[k] & 0x1f; + const GLint rowDr0 = rowD[j] & 0x1f; + const GLint rowDr1 = rowD[k] & 0x1f; + const GLint rowAg0 = (rowA[j] >> 5) & 0x3f; + const GLint rowAg1 = (rowA[k] >> 5) & 0x3f; + const GLint rowBg0 = (rowB[j] >> 5) & 0x3f; + const GLint rowBg1 = (rowB[k] >> 5) & 0x3f; + const GLint rowCg0 = (rowC[j] >> 5) & 0x3f; + const GLint rowCg1 = (rowC[k] >> 5) & 0x3f; + const GLint rowDg0 = (rowD[j] >> 5) & 0x3f; + const GLint rowDg1 = (rowD[k] >> 5) & 0x3f; + const GLint rowAb0 = (rowA[j] >> 11) & 0x1f; + const GLint rowAb1 = (rowA[k] >> 11) & 0x1f; + const GLint rowBb0 = (rowB[j] >> 11) & 0x1f; + const GLint rowBb1 = (rowB[k] >> 11) & 0x1f; + const GLint rowCb0 = (rowC[j] >> 11) & 0x1f; + const GLint rowCb1 = (rowC[k] >> 11) & 0x1f; + const GLint rowDb0 = (rowD[j] >> 11) & 0x1f; + const GLint rowDb1 = (rowD[k] >> 11) & 0x1f; + const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, + rowCr0, rowCr1, rowDr0, rowDr1); + const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, + rowCg0, rowCg1, rowDg0, rowDg1); + const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, + rowCb0, rowCb1, rowDb0, rowDb1); + dst[i] = (b << 11) | (g << 5) | r; + } + } + else if ((datatype == GL_UNSIGNED_SHORT_4_4_4_4) && (comps == 4)) { + DECLARE_ROW_POINTERS0(GLushort); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0xf; + const GLint rowAr1 = rowA[k] & 0xf; + const GLint rowBr0 = rowB[j] & 0xf; + const GLint rowBr1 = rowB[k] & 0xf; + const GLint rowCr0 = rowC[j] & 0xf; + const GLint rowCr1 = rowC[k] & 0xf; + const GLint rowDr0 = rowD[j] & 0xf; + const GLint rowDr1 = rowD[k] & 0xf; + const GLint rowAg0 = (rowA[j] >> 4) & 0xf; + const GLint rowAg1 = (rowA[k] >> 4) & 0xf; + const GLint rowBg0 = (rowB[j] >> 4) & 0xf; + const GLint rowBg1 = (rowB[k] >> 4) & 0xf; + const GLint rowCg0 = (rowC[j] >> 4) & 0xf; + const GLint rowCg1 = (rowC[k] >> 4) & 0xf; + const GLint rowDg0 = (rowD[j] >> 4) & 0xf; + const GLint rowDg1 = (rowD[k] >> 4) & 0xf; + const GLint rowAb0 = (rowA[j] >> 8) & 0xf; + const GLint rowAb1 = (rowA[k] >> 8) & 0xf; + const GLint rowBb0 = (rowB[j] >> 8) & 0xf; + const GLint rowBb1 = (rowB[k] >> 8) & 0xf; + const GLint rowCb0 = (rowC[j] >> 8) & 0xf; + const GLint rowCb1 = (rowC[k] >> 8) & 0xf; + const GLint rowDb0 = (rowD[j] >> 8) & 0xf; + const GLint rowDb1 = (rowD[k] >> 8) & 0xf; + const GLint rowAa0 = (rowA[j] >> 12) & 0xf; + const GLint rowAa1 = (rowA[k] >> 12) & 0xf; + const GLint rowBa0 = (rowB[j] >> 12) & 0xf; + const GLint rowBa1 = (rowB[k] >> 12) & 0xf; + const GLint rowCa0 = (rowC[j] >> 12) & 0xf; + const GLint rowCa1 = (rowC[k] >> 12) & 0xf; + const GLint rowDa0 = (rowD[j] >> 12) & 0xf; + const GLint rowDa1 = (rowD[k] >> 12) & 0xf; + const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, + rowCr0, rowCr1, rowDr0, rowDr1); + const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, + rowCg0, rowCg1, rowDg0, rowDg1); + const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, + rowCb0, rowCb1, rowDb0, rowDb1); + const GLint a = FILTER_SUM_3D(rowAa0, rowAa1, rowBa0, rowBa1, + rowCa0, rowCa1, rowDa0, rowDa1); + + dst[i] = (a << 12) | (b << 8) | (g << 4) | r; + } + } + else if ((datatype == GL_UNSIGNED_SHORT_1_5_5_5_REV) && (comps == 4)) { + DECLARE_ROW_POINTERS0(GLushort); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0x1f; + const GLint rowAr1 = rowA[k] & 0x1f; + const GLint rowBr0 = rowB[j] & 0x1f; + const GLint rowBr1 = rowB[k] & 0x1f; + const GLint rowCr0 = rowC[j] & 0x1f; + const GLint rowCr1 = rowC[k] & 0x1f; + const GLint rowDr0 = rowD[j] & 0x1f; + const GLint rowDr1 = rowD[k] & 0x1f; + const GLint rowAg0 = (rowA[j] >> 5) & 0x1f; + const GLint rowAg1 = (rowA[k] >> 5) & 0x1f; + const GLint rowBg0 = (rowB[j] >> 5) & 0x1f; + const GLint rowBg1 = (rowB[k] >> 5) & 0x1f; + const GLint rowCg0 = (rowC[j] >> 5) & 0x1f; + const GLint rowCg1 = (rowC[k] >> 5) & 0x1f; + const GLint rowDg0 = (rowD[j] >> 5) & 0x1f; + const GLint rowDg1 = (rowD[k] >> 5) & 0x1f; + const GLint rowAb0 = (rowA[j] >> 10) & 0x1f; + const GLint rowAb1 = (rowA[k] >> 10) & 0x1f; + const GLint rowBb0 = (rowB[j] >> 10) & 0x1f; + const GLint rowBb1 = (rowB[k] >> 10) & 0x1f; + const GLint rowCb0 = (rowC[j] >> 10) & 0x1f; + const GLint rowCb1 = (rowC[k] >> 10) & 0x1f; + const GLint rowDb0 = (rowD[j] >> 10) & 0x1f; + const GLint rowDb1 = (rowD[k] >> 10) & 0x1f; + const GLint rowAa0 = (rowA[j] >> 15) & 0x1; + const GLint rowAa1 = (rowA[k] >> 15) & 0x1; + const GLint rowBa0 = (rowB[j] >> 15) & 0x1; + const GLint rowBa1 = (rowB[k] >> 15) & 0x1; + const GLint rowCa0 = (rowC[j] >> 15) & 0x1; + const GLint rowCa1 = (rowC[k] >> 15) & 0x1; + const GLint rowDa0 = (rowD[j] >> 15) & 0x1; + const GLint rowDa1 = (rowD[k] >> 15) & 0x1; + const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, + rowCr0, rowCr1, rowDr0, rowDr1); + const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, + rowCg0, rowCg1, rowDg0, rowDg1); + const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, + rowCb0, rowCb1, rowDb0, rowDb1); + const GLint a = FILTER_SUM_3D(rowAa0, rowAa1, rowBa0, rowBa1, + rowCa0, rowCa1, rowDa0, rowDa1); + + dst[i] = (a << 15) | (b << 10) | (g << 5) | r; + } + } + else if ((datatype == GL_UNSIGNED_BYTE_3_3_2) && (comps == 3)) { + DECLARE_ROW_POINTERS0(GLushort); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0x3; + const GLint rowAr1 = rowA[k] & 0x3; + const GLint rowBr0 = rowB[j] & 0x3; + const GLint rowBr1 = rowB[k] & 0x3; + const GLint rowCr0 = rowC[j] & 0x3; + const GLint rowCr1 = rowC[k] & 0x3; + const GLint rowDr0 = rowD[j] & 0x3; + const GLint rowDr1 = rowD[k] & 0x3; + const GLint rowAg0 = (rowA[j] >> 2) & 0x7; + const GLint rowAg1 = (rowA[k] >> 2) & 0x7; + const GLint rowBg0 = (rowB[j] >> 2) & 0x7; + const GLint rowBg1 = (rowB[k] >> 2) & 0x7; + const GLint rowCg0 = (rowC[j] >> 2) & 0x7; + const GLint rowCg1 = (rowC[k] >> 2) & 0x7; + const GLint rowDg0 = (rowD[j] >> 2) & 0x7; + const GLint rowDg1 = (rowD[k] >> 2) & 0x7; + const GLint rowAb0 = (rowA[j] >> 5) & 0x7; + const GLint rowAb1 = (rowA[k] >> 5) & 0x7; + const GLint rowBb0 = (rowB[j] >> 5) & 0x7; + const GLint rowBb1 = (rowB[k] >> 5) & 0x7; + const GLint rowCb0 = (rowC[j] >> 5) & 0x7; + const GLint rowCb1 = (rowC[k] >> 5) & 0x7; + const GLint rowDb0 = (rowD[j] >> 5) & 0x7; + const GLint rowDb1 = (rowD[k] >> 5) & 0x7; + const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, + rowCr0, rowCr1, rowDr0, rowDr1); + const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, + rowCg0, rowCg1, rowDg0, rowDg1); + const GLint b = FILTER_SUM_3D(rowAb0, rowAb1, rowBb0, rowBb1, + rowCb0, rowCb1, rowDb0, rowDb1); + dst[i] = (b << 5) | (g << 2) | r; + } + } + else { + _mesa_problem(NULL, "bad format in do_row()"); + } +} + + /* * These functions generate a 1/2-size mipmap image from a source image. * Texture borders are handled by copying or averaging the source image's @@ -446,34 +889,27 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, } -/** - * Strides are in bytes. If zero, it'll be computed as width * bpp. - */ static void make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, - GLint srcRowStride, const GLubyte *srcPtr, + const GLubyte *srcPtr, GLint srcRowStride, GLint dstWidth, GLint dstHeight, - GLint dstRowStride, GLubyte *dstPtr) + GLubyte *dstPtr, GLint dstRowStride) { const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; + const GLint srcRowBytes = bpt * srcRowStride; + const GLint dstRowBytes = bpt * dstRowStride; const GLubyte *srcA, *srcB; GLubyte *dst; GLint row; - if (!srcRowStride) - srcRowStride = bpt * srcWidth; - - if (!dstRowStride) - dstRowStride = bpt * dstWidth; - /* Compute src and dst pointers, skipping any border */ srcA = srcPtr + border * ((srcWidth + 1) * bpt); if (srcHeight > 1) - srcB = srcA + srcRowStride; + srcB = srcA + srcRowBytes; else srcB = srcA; dst = dstPtr + border * ((dstWidth + 1) * bpt); @@ -481,9 +917,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, for (row = 0; row < dstHeightNB; row++) { do_row(datatype, comps, srcWidthNB, srcA, srcB, dstWidthNB, dst); - srcA += 2 * srcRowStride; - srcB += 2 * srcRowStride; - dst += dstRowStride; + srcA += 2 * srcRowBytes; + srcB += 2 * srcRowBytes; + dst += dstRowBytes; } /* This is ugly but probably won't be used much */ @@ -541,11 +977,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, static void make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLint srcRowStride, - const GLubyte *srcPtr, + const GLubyte *srcPtr, GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLint dstRowStride, - GLubyte *dstPtr) + GLubyte *dstPtr, GLint dstRowStride) { const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ @@ -553,30 +987,19 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; const GLint dstDepthNB = dstDepth - 2 * border; - GLvoid *tmpRowA, *tmpRowB; GLint img, row; GLint bytesPerSrcImage, bytesPerDstImage; + GLint bytesPerSrcRow, bytesPerDstRow; GLint srcImageOffset, srcRowOffset; (void) srcDepthNB; /* silence warnings */ - /* Need two temporary row buffers */ - tmpRowA = _mesa_malloc(srcWidth * bpt); - if (!tmpRowA) - return; - tmpRowB = _mesa_malloc(srcWidth * bpt); - if (!tmpRowB) { - _mesa_free(tmpRowA); - return; - } bytesPerSrcImage = srcWidth * srcHeight * bpt; bytesPerDstImage = dstWidth * dstHeight * bpt; - if (!srcRowStride) - srcRowStride = srcWidth * bpt; - if (!dstRowStride) - dstRowStride = dstWidth * bpt; + bytesPerSrcRow = srcWidth * bpt; + bytesPerDstRow = dstWidth * bpt; /* Offset between adjacent src images to be averaged together */ srcImageOffset = (srcDepth == dstDepth) ? 0 : bytesPerSrcImage; @@ -600,13 +1023,13 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, for (img = 0; img < dstDepthNB; img++) { /* first source image pointer, skipping border */ const GLubyte *imgSrcA = srcPtr - + (bytesPerSrcImage + srcRowStride + border) * bpt * border + + (bytesPerSrcImage + bytesPerSrcRow + border) * bpt * border + img * (bytesPerSrcImage + srcImageOffset); /* second source image pointer, skipping border */ const GLubyte *imgSrcB = imgSrcA + srcImageOffset; /* address of the dest image, skipping border */ GLubyte *imgDst = dstPtr - + (bytesPerDstImage + dstRowStride + border) * bpt * border + + (bytesPerDstImage + bytesPerDstRow + border) * bpt * border + img * bytesPerDstImage; /* setup the four source row pointers and the dest row pointer */ @@ -617,39 +1040,31 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, GLubyte *dstImgRow = imgDst; for (row = 0; row < dstHeightNB; row++) { - /* Average together two rows from first src image */ - do_row(datatype, comps, srcWidthNB, srcImgARowA, srcImgARowB, - srcWidthNB, tmpRowA); - /* Average together two rows from second src image */ - do_row(datatype, comps, srcWidthNB, srcImgBRowA, srcImgBRowB, - srcWidthNB, tmpRowB); - /* Average together the temp rows to make the final row */ - do_row(datatype, comps, srcWidthNB, tmpRowA, tmpRowB, - dstWidthNB, dstImgRow); + do_row_3D(datatype, comps, srcWidthNB, + srcImgARowA, srcImgARowB, + srcImgBRowA, srcImgBRowB, + dstWidthNB, dstImgRow); + /* advance to next rows */ - srcImgARowA += srcRowStride + srcRowOffset; - srcImgARowB += srcRowStride + srcRowOffset; - srcImgBRowA += srcRowStride + srcRowOffset; - srcImgBRowB += srcRowStride + srcRowOffset; - dstImgRow += dstRowStride; + srcImgARowA += bytesPerSrcRow + srcRowOffset; + srcImgARowB += bytesPerSrcRow + srcRowOffset; + srcImgBRowA += bytesPerSrcRow + srcRowOffset; + srcImgBRowB += bytesPerSrcRow + srcRowOffset; + dstImgRow += bytesPerDstRow; } } - _mesa_free(tmpRowA); - _mesa_free(tmpRowB); /* Luckily we can leverage the make_2d_mipmap() function here! */ if (border > 0) { /* do front border image */ - make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, 0, srcPtr, - dstWidth, dstHeight, 0, dstPtr); + make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, srcPtr, srcRowStride, + dstWidth, dstHeight, dstPtr, dstRowStride); /* do back border image */ make_2d_mipmap(datatype, comps, 1, srcWidth, srcHeight, - 0, - srcPtr + bytesPerSrcImage * (srcDepth - 1), + srcPtr + bytesPerSrcImage * (srcDepth - 1), srcRowStride, dstWidth, dstHeight, - 0, - dstPtr + bytesPerDstImage * (dstDepth - 1)); + dstPtr + bytesPerDstImage * (dstDepth - 1), dstRowStride); /* do four remaining border edges that span the image slices */ if (srcDepth == dstDepth) { /* just copy border pixels from src to dst */ @@ -664,9 +1079,9 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, /* do border along [img][row=dstHeight-1][col=0] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcHeight - 1) * srcRowStride; + + (srcHeight - 1) * bytesPerSrcRow; dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstHeight - 1) * dstRowStride; + + (dstHeight - 1) * bytesPerDstRow; MEMCPY(dst, src, bpt); /* do border along [img][row=0][col=dstWidth-1] */ @@ -698,9 +1113,9 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, /* do border along [img][row=dstHeight-1][col=0] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage - + (srcHeight - 1) * srcRowStride; + + (srcHeight - 1) * bytesPerSrcRow; dst = dstPtr + (img + 1) * bytesPerDstImage - + (dstHeight - 1) * dstRowStride; + + (dstHeight - 1) * bytesPerDstRow; do_row(datatype, comps, 1, src, src + srcImageOffset, 1, dst); /* do border along [img][row=0][col=dstWidth-1] */ @@ -724,15 +1139,16 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, static void make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, - GLint srcWidth, const GLubyte *srcPtr, - GLint dstWidth, GLint dstHeight, GLubyte *dstPtr) + GLint srcWidth, const GLubyte *srcPtr, GLuint srcRowStride, + GLint dstWidth, GLint dstHeight, + GLubyte *dstPtr, GLuint dstRowStride ) { const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; - const GLint srcRowStride = bpt * srcWidth; - const GLint dstRowStride = bpt * dstWidth; + const GLint srcRowBytes = bpt * srcRowStride; + const GLint dstRowBytes = bpt * dstRowStride; const GLubyte *src; GLubyte *dst; GLint row; @@ -744,8 +1160,8 @@ make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, for (row = 0; row < dstHeightNB; row++) { do_row(datatype, comps, srcWidthNB, src, src, dstWidthNB, dst); - src += srcRowStride; - dst += dstRowStride; + src += srcRowBytes; + dst += dstRowBytes; } if (border) { @@ -767,32 +1183,26 @@ make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, static void make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, - GLint srcRowStride, - const GLubyte *srcPtr, + const GLubyte *srcPtr, GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLint dstRowStride, - GLubyte *dstPtr) + GLubyte *dstPtr, GLint dstRowStride) { const GLint bpt = bytes_per_pixel(datatype, comps); const GLint srcWidthNB = srcWidth - 2 * border; /* sizes w/out border */ const GLint dstWidthNB = dstWidth - 2 * border; const GLint dstHeightNB = dstHeight - 2 * border; const GLint dstDepthNB = dstDepth - 2 * border; + const GLint srcRowBytes = bpt * srcRowStride; + const GLint dstRowBytes = bpt * dstRowStride; const GLubyte *srcA, *srcB; GLubyte *dst; GLint layer; GLint row; - if (!srcRowStride) - srcRowStride = bpt * srcWidth; - - if (!dstRowStride) - dstRowStride = bpt * dstWidth; - /* Compute src and dst pointers, skipping any border */ srcA = srcPtr + border * ((srcWidth + 1) * bpt); if (srcHeight > 1) - srcB = srcA + srcRowStride; + srcB = srcA + srcRowBytes; else srcB = srcA; dst = dstPtr + border * ((dstWidth + 1) * bpt); @@ -801,9 +1211,9 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, for (row = 0; row < dstHeightNB; row++) { do_row(datatype, comps, srcWidthNB, srcA, srcB, dstWidthNB, dst); - srcA += 2 * srcRowStride; - srcB += 2 * srcRowStride; - dst += dstRowStride; + srcA += 2 * srcRowBytes; + srcB += 2 * srcRowBytes; + dst += dstRowBytes; } /* This is ugly but probably won't be used much */ @@ -867,12 +1277,15 @@ _mesa_generate_mipmap_level(GLenum target, GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLint srcRowStride, const GLubyte *srcData, + GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLint dstRowStride, - GLubyte *dstData) + GLubyte *dstData, + GLint dstRowStride) { + /* + * We use simple 2x2 averaging to compute the next mipmap level. + */ switch (target) { case GL_TEXTURE_1D: make_1d_mipmap(datatype, comps, border, @@ -887,29 +1300,35 @@ _mesa_generate_mipmap_level(GLenum target, case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: make_2d_mipmap(datatype, comps, border, - srcWidth, srcHeight, srcRowStride, srcData, - dstWidth, dstHeight, dstRowStride, dstData); + srcWidth, srcHeight, srcData, srcRowStride, + dstWidth, dstHeight, dstData, dstRowStride); break; case GL_TEXTURE_3D: make_3d_mipmap(datatype, comps, border, - srcWidth, srcHeight, srcDepth, srcRowStride, srcData, - dstWidth, dstHeight, dstDepth, dstRowStride, dstData); + srcWidth, srcHeight, srcDepth, + srcData, srcRowStride, + dstWidth, dstHeight, dstDepth, + dstData, dstRowStride); break; case GL_TEXTURE_1D_ARRAY_EXT: make_1d_stack_mipmap(datatype, comps, border, - srcWidth, srcData, - dstWidth, dstHeight, dstData); + srcWidth, srcData, srcRowStride, + dstWidth, dstHeight, + dstData, dstRowStride); break; case GL_TEXTURE_2D_ARRAY_EXT: make_2d_stack_mipmap(datatype, comps, border, - srcWidth, srcHeight, srcRowStride, srcData, - dstWidth, dstHeight, dstDepth, dstRowStride, dstData); + srcWidth, srcHeight, + srcData, srcRowStride, + dstWidth, dstHeight, + dstDepth, dstData, dstRowStride); break; case GL_TEXTURE_RECTANGLE_NV: /* no mipmaps, do nothing */ break; default: - _mesa_problem(NULL, "bad target in _mesa_generate_mipmap_level"); + _mesa_problem(NULL, "bad dimensions in _mesa_generate_mipmaps"); + return; } } @@ -991,7 +1410,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, GLint components, size; GLchan *dst; - assert(texObj->Target == GL_TEXTURE_2D); + assert(texObj->Target == GL_TEXTURE_2D || + texObj->Target == GL_TEXTURE_CUBE_MAP_ARB); if (srcImage->_BaseFormat == GL_RGB) { convertFormat = &_mesa_texformat_rgb; @@ -1130,10 +1550,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstData = (GLubyte *) dstImage->Data; } - /* Note, 0 indicates default row strides */ _mesa_generate_mipmap_level(target, datatype, comps, border, - srcWidth, srcHeight, srcDepth, 0, srcData, - dstWidth, dstHeight, dstDepth, 0, dstData); + srcWidth, srcHeight, srcDepth, + srcData, srcImage->RowStride, + dstWidth, dstHeight, dstDepth, + dstData, dstImage->RowStride); + if (dstImage->IsCompressed) { GLubyte *temp; diff --git a/src/mesa/main/mipmap.h b/src/mesa/main/mipmap.h index 44ecdddb27..22094c3437 100644 --- a/src/mesa/main/mipmap.h +++ b/src/mesa/main/mipmap.h @@ -34,11 +34,11 @@ _mesa_generate_mipmap_level(GLenum target, GLenum datatype, GLuint comps, GLint border, GLint srcWidth, GLint srcHeight, GLint srcDepth, - GLint srcRowStride, const GLubyte *srcData, + GLint srcRowStride, GLint dstWidth, GLint dstHeight, GLint dstDepth, - GLint dstRowStride, - GLubyte *dstData); + GLubyte *dstData, + GLint dstRowStride); extern void diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index 6f381b02a7..d430bcdb84 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -167,7 +167,7 @@ mmAllocMem(struct mem_block *heap, unsigned size, unsigned align2, unsigned star unsigned startofs = 0; unsigned endofs; - if (!heap || !align2 || !size) + if (!heap || !size) return NULL; for (p = heap->next_free; p != heap; p = p->next_free) { diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e241fe188c..e80d3db043 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,15 +1,9 @@ -/** - * \file mtypes.h - * Main Mesa data structures. - * - * Please try to mark derived values with a leading underscore ('_'). - */ - /* * Mesa 3-D graphics library - * Version: 6.5.3 + * Version: 7.5 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,24 +23,24 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/** + * \file mtypes.h + * Main Mesa data structures. + * + * Please try to mark derived values with a leading underscore ('_'). + */ - -#ifndef TYPES_H -#define TYPES_H +#ifndef MTYPES_H +#define MTYPES_H -#include "glheader.h" -#include <GL/internal/glcore.h> /* __GLcontextModes (GLvisual) */ -#include "config.h" /* Hardwired parameters */ +#include "main/glheader.h" +#include "main/config.h" +#include "main/compiler.h" +#include "main/mfeatures.h" +#include "main/bitset.h" #include "glapi/glapi.h" #include "math/m_matrix.h" /* GLmatrix */ -#include "bitset.h" - - -/** - * Special, internal token - */ -#define GL_SHADER_PROGRAM_MESA 0x9999 /** @@ -127,7 +121,6 @@ struct gl_texture_format; struct gl_texture_image; struct gl_texture_object; struct st_context; -struct pipe_surface; typedef struct __GLcontextRec GLcontext; typedef struct __GLcontextModesRec GLvisual; typedef struct gl_framebuffer GLframebuffer; @@ -227,24 +220,27 @@ enum * Indexes for vertex program result attributes */ /*@{*/ -#define VERT_RESULT_HPOS 0 -#define VERT_RESULT_COL0 1 -#define VERT_RESULT_COL1 2 -#define VERT_RESULT_FOGC 3 -#define VERT_RESULT_TEX0 4 -#define VERT_RESULT_TEX1 5 -#define VERT_RESULT_TEX2 6 -#define VERT_RESULT_TEX3 7 -#define VERT_RESULT_TEX4 8 -#define VERT_RESULT_TEX5 9 -#define VERT_RESULT_TEX6 10 -#define VERT_RESULT_TEX7 11 -#define VERT_RESULT_PSIZ 12 -#define VERT_RESULT_BFC0 13 -#define VERT_RESULT_BFC1 14 -#define VERT_RESULT_EDGE 15 -#define VERT_RESULT_VAR0 16 /**< shader varying */ -#define VERT_RESULT_MAX (VERT_RESULT_VAR0 + MAX_VARYING) +enum +{ + VERT_RESULT_HPOS = 0, + VERT_RESULT_COL0 = 1, + VERT_RESULT_COL1 = 2, + VERT_RESULT_FOGC = 3, + VERT_RESULT_TEX0 = 4, + VERT_RESULT_TEX1 = 5, + VERT_RESULT_TEX2 = 6, + VERT_RESULT_TEX3 = 7, + VERT_RESULT_TEX4 = 8, + VERT_RESULT_TEX5 = 9, + VERT_RESULT_TEX6 = 10, + VERT_RESULT_TEX7 = 11, + VERT_RESULT_PSIZ = 12, + VERT_RESULT_BFC0 = 13, + VERT_RESULT_BFC1 = 14, + VERT_RESULT_EDGE = 15, + VERT_RESULT_VAR0 = 16 /**< shader varying */, + VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) +}; /*@}*/ @@ -641,7 +637,7 @@ struct gl_current_attrib GLfloat RasterColor[4]; GLfloat RasterSecondaryColor[4]; GLfloat RasterIndex; - GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4]; + GLfloat RasterTexCoords[MAX_TEXTURE_UNITS][4]; GLboolean RasterPosValid; /*@}*/ }; @@ -725,10 +721,10 @@ struct gl_enable_attrib GLboolean SampleCoverage; /* GL_ARB_multisample */ GLboolean SampleCoverageInvert; /* GL_ARB_multisample */ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */ - GLuint Texture[MAX_TEXTURE_IMAGE_UNITS]; - GLuint TexGen[MAX_TEXTURE_COORD_UNITS]; + GLuint Texture[MAX_TEXTURE_UNITS]; + GLuint TexGen[MAX_TEXTURE_UNITS]; /* SGI_texture_color_table */ - GLboolean TextureColorTable[MAX_TEXTURE_IMAGE_UNITS]; + GLboolean TextureColorTable[MAX_TEXTURE_UNITS]; /* GL_ARB_vertex_program / GL_NV_vertex_program */ GLboolean VertexProgram; GLboolean VertexProgramPointSize; @@ -904,7 +900,7 @@ struct gl_light_attrib /*@{*/ GLboolean _NeedEyeCoords; GLboolean _NeedVertices; /**< Use fast shader? */ - GLbitfield _Flags; /**< LIGHT_* flags, see above */ + GLbitfield _Flags; /**< LIGHT_* flags, see above */ GLfloat _BaseColor[2][3]; /*@}*/ }; @@ -1071,7 +1067,7 @@ struct gl_point_attrib GLfloat Threshold; /**< GL_EXT_point_parameters */ GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */ GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */ - GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite */ + GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /**< GL_ARB_point_sprite */ GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */ GLenum SpriteOrigin; /**< GL_ARB_point_sprite */ }; @@ -1111,51 +1107,67 @@ struct gl_scissor_attrib /** * Stencil attribute group (GL_STENCIL_BUFFER_BIT). + * + * Three sets of stencil data are tracked so that OpenGL 2.0, + * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported + * simultaneously. In each of the stencil state arrays, element 0 corresponds + * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 / + * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the + * GL_EXT_stencil_two_side GL_BACK state. + * + * The derived value \c _BackFace is either 1 or 2 depending on whether or + * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled. + * + * The derived value \c _TestTwoSide is set when the front-face and back-face + * stencil state are different. */ struct gl_stencil_attrib { GLboolean Enabled; /**< Enabled flag */ GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */ - GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 1) */ + GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */ GLboolean _TestTwoSide; - GLenum Function[2]; /**< Stencil function */ - GLenum FailFunc[2]; /**< Fail function */ - GLenum ZPassFunc[2]; /**< Depth buffer pass function */ - GLenum ZFailFunc[2]; /**< Depth buffer fail function */ - GLint Ref[2]; /**< Reference value */ - GLuint ValueMask[2]; /**< Value mask */ - GLuint WriteMask[2]; /**< Write mask */ + GLubyte _BackFace; /**< Current back stencil state (1 or 2) */ + GLenum Function[3]; /**< Stencil function */ + GLenum FailFunc[3]; /**< Fail function */ + GLenum ZPassFunc[3]; /**< Depth buffer pass function */ + GLenum ZFailFunc[3]; /**< Depth buffer fail function */ + GLint Ref[3]; /**< Reference value */ + GLuint ValueMask[3]; /**< Value mask */ + GLuint WriteMask[3]; /**< Write mask */ GLuint Clear; /**< Clear value */ }; -#define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */ - /** - * An index for each type of texture object + * An index for each type of texture object. These correspond to the GL + * target target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. + * Note: the order is from highest priority to lowest priority. */ -/*@{*/ -#define TEXTURE_1D_INDEX 0 -#define TEXTURE_2D_INDEX 1 -#define TEXTURE_3D_INDEX 2 -#define TEXTURE_CUBE_INDEX 3 -#define TEXTURE_RECT_INDEX 4 -#define TEXTURE_1D_ARRAY_INDEX 5 -#define TEXTURE_2D_ARRAY_INDEX 6 -/*@}*/ +enum { + TEXTURE_2D_ARRAY_INDEX, + TEXTURE_1D_ARRAY_INDEX, + TEXTURE_CUBE_INDEX, + TEXTURE_3D_INDEX, + TEXTURE_RECT_INDEX, + TEXTURE_2D_INDEX, + TEXTURE_1D_INDEX, + NUM_TEXTURE_TARGETS +}; + /** * Bit flags for each type of texture object * Used for Texture.Unit[]._ReallyEnabled flags. */ /*@{*/ -#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) -#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) -#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) +#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) +#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) #define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) +#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) #define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX) -#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) -#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) +#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) +#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) /*@}*/ @@ -1190,27 +1202,12 @@ struct gl_stencil_attrib /*@}*/ -/* A selection of state flags to make driver and module's lives easier. */ -#define ENABLE_TEXGEN0 0x1 -#define ENABLE_TEXGEN1 0x2 -#define ENABLE_TEXGEN2 0x4 -#define ENABLE_TEXGEN3 0x8 -#define ENABLE_TEXGEN4 0x10 -#define ENABLE_TEXGEN5 0x20 -#define ENABLE_TEXGEN6 0x40 -#define ENABLE_TEXGEN7 0x80 -#define ENABLE_TEXMAT0 0x1 /* Ie. not the identity matrix */ -#define ENABLE_TEXMAT1 0x2 -#define ENABLE_TEXMAT2 0x4 -#define ENABLE_TEXMAT3 0x8 -#define ENABLE_TEXMAT4 0x10 -#define ENABLE_TEXMAT5 0x20 -#define ENABLE_TEXMAT6 0x40 -#define ENABLE_TEXMAT7 0x80 +/** Tex-gen enabled for texture unit? */ +#define ENABLE_TEXGEN(unit) (1 << (unit)) -#define ENABLE_TEXGEN(i) (ENABLE_TEXGEN0 << (i)) -#define ENABLE_TEXMAT(i) (ENABLE_TEXMAT0 << (i)) +/** Non-identity texture matrix for texture unit? */ +#define ENABLE_TEXMAT(unit) (1 << (unit)) /** @@ -1369,7 +1366,7 @@ struct gl_texture_image GLboolean IsCompressed; /**< GL_ARB_texture_compression */ GLuint CompressedSize; /**< GL_ARB_texture_compression */ - GLuint RowStride; /**< == Width unless IsClientData and padded */ + GLuint RowStride; /**< Padded width in units of texels */ GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to each 2D slice in 'Data', in texels */ GLvoid *Data; /**< Image data, accessed via FetchTexel() */ @@ -1422,11 +1419,9 @@ struct gl_texture_object GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLboolean CompareFlag; /**< GL_SGIX_shadow */ - GLenum CompareOperator; /**< GL_SGIX_shadow */ - GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ + GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ GLenum _Function; /**< Comparison function derived from * \c CompareOperator, \c CompareMode, and * \c CompareFunc. @@ -1435,8 +1430,11 @@ struct gl_texture_object GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ GLint CropRect[4]; /**< GL_OES_draw_texture */ + GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */ + GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean _Complete; /**< Is texture object complete? */ + GLboolean _RenderToTexture; /**< Any rendering to this texture? */ /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; @@ -1457,23 +1455,32 @@ struct gl_texture_object /** * Texture combine environment state. - * - * \todo - * If GL_NV_texture_env_combine4 is ever supported, the arrays in this - * structure will need to be expanded for 4 elements. + * Up to four combiner sources are possible with GL_NV_texture_env_combine4. */ struct gl_tex_env_combine_state { GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - GLenum SourceRGB[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum SourceA[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum OperandRGB[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ - GLenum OperandA[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ + GLenum SourceRGB[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ + GLenum SourceA[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ + GLenum OperandRGB[4]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ + GLenum OperandA[4]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ GLuint ScaleShiftA; /**< 0, 1 or 2 */ - GLuint _NumArgsRGB; /**< Number of inputs used for the combine mode. */ - GLuint _NumArgsA; /**< Number of inputs used for the combine mode. */ + GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */ + GLuint _NumArgsA; /**< Number of inputs used for the A combiner */ +}; + + +/** + * Texture coord generation state. + */ +struct gl_texgen +{ + GLenum Mode; /**< GL_EYE_LINEAR, GL_SPHERE_MAP, etc */ + GLbitfield _ModeBit; /**< TEXGEN_x bit corresponding to Mode */ + GLfloat ObjectPlane[4]; + GLfloat EyePlane[4]; }; @@ -1489,28 +1496,14 @@ struct gl_texture_unit GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ GLfloat EnvColor[4]; + + struct gl_texgen GenS; + struct gl_texgen GenT; + struct gl_texgen GenR; + struct gl_texgen GenQ; GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */ - /** \name Tex coord generation mode - * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */ - /*@{*/ - GLenum GenModeS; - GLenum GenModeT; - GLenum GenModeR; - GLenum GenModeQ; - /*@}*/ - GLbitfield _GenBitS; - GLbitfield _GenBitT; - GLbitfield _GenBitR; - GLbitfield _GenBitQ; - GLbitfield _GenFlags; /**< bitwise or of _GenBit[STRQ] */ - GLfloat ObjectPlaneS[4]; - GLfloat ObjectPlaneT[4]; - GLfloat ObjectPlaneR[4]; - GLfloat ObjectPlaneQ[4]; - GLfloat EyePlaneS[4]; - GLfloat EyePlaneT[4]; - GLfloat EyePlaneR[4]; - GLfloat EyePlaneQ[4]; + GLbitfield _GenFlags; /**< Bitwise-OR of Gen[STRQ]._ModeBit */ + GLfloat LodBias; /**< for biasing mipmap levels */ /** @@ -1530,26 +1523,11 @@ struct gl_texture_unit */ struct gl_tex_env_combine_state *_CurrentCombine; - struct gl_texture_object *Current1D; - struct gl_texture_object *Current2D; - struct gl_texture_object *Current3D; - struct gl_texture_object *CurrentCubeMap; /**< GL_ARB_texture_cube_map */ - struct gl_texture_object *CurrentRect; /**< GL_NV_texture_rectangle */ - struct gl_texture_object *Current1DArray; /**< GL_MESA_texture_array */ - struct gl_texture_object *Current2DArray; /**< GL_MESA_texture_array */ + /** Current texture object pointers */ + struct gl_texture_object *CurrentTex[NUM_TEXTURE_TARGETS]; - struct gl_texture_object *_Current; /**< Points to really enabled tex obj */ - - /** These are used for glPush/PopAttrib */ - /*@{*/ - struct gl_texture_object Saved1D; - struct gl_texture_object Saved2D; - struct gl_texture_object Saved3D; - struct gl_texture_object SavedCubeMap; - struct gl_texture_object SavedRect; - struct gl_texture_object Saved1DArray; - struct gl_texture_object Saved2DArray; - /*@}*/ + /** Points to highest priority, complete and enabled texture object */ + struct gl_texture_object *_Current; /** GL_SGI_texture_color_table */ /*@{*/ @@ -1560,6 +1538,7 @@ struct gl_texture_unit }; + /** * Texture attribute group (GL_TEXTURE_BIT). */ @@ -1569,27 +1548,17 @@ struct gl_texture_attrib * name multitexture */ /**@{*/ - GLuint CurrentUnit; /**< Active texture unit */ + GLuint CurrentUnit; /**< Active texture unit [0, MaxTextureImageUnits-1] */ GLbitfield _EnabledUnits; /**< one bit set for each really-enabled unit */ GLbitfield _EnabledCoordUnits; /**< one bit per enabled coordinate unit */ GLbitfield _GenFlags; /**< for texgen */ - GLbitfield _TexGenEnabled; - GLbitfield _TexMatEnabled; + GLbitfield _TexGenEnabled; /**< Mask of ENABLE_TEXGEN flags */ + GLbitfield _TexMatEnabled; /**< Mask of ENABLE_TEXMAT flags */ /**@}*/ struct gl_texture_unit Unit[MAX_TEXTURE_UNITS]; -#if 0 - struct gl_texture_object *Proxy1D; - struct gl_texture_object *Proxy2D; - struct gl_texture_object *Proxy3D; - struct gl_texture_object *ProxyCubeMap; - struct gl_texture_object *ProxyRect; - struct gl_texture_object *Proxy1DArray; - struct gl_texture_object *Proxy2DArray; -#else struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS]; -#endif /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; @@ -1683,6 +1652,7 @@ struct gl_client_array { GLint Size; /**< components per element (1,2,3,4) */ GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ + GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */ GLsizei Stride; /**< user-specified stride */ GLsizei StrideB; /**< actual stride in bytes */ const GLubyte *Ptr; /**< Points to array data */ @@ -1896,7 +1866,7 @@ struct gl_program GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */ GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */ GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */ - GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */ + GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */ GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */ GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */ @@ -1978,14 +1948,15 @@ struct gl_program_state */ struct gl_vertex_program_state { - GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */ - GLboolean _Enabled; /**< Enabled and valid program? */ + GLboolean Enabled; /**< User-set GL_VERTEX_PROGRAM_ARB/NV flag */ + GLboolean _Enabled; /**< Enabled and _valid_ user program? */ GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */ GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */ - struct gl_vertex_program *Current; /**< user-bound vertex program */ + struct gl_vertex_program *Current; /**< User-bound vertex program */ - /** Currently enabled and valid program (including internal programs - * and compiled shader programs). + /** Currently enabled and valid vertex program (including internal programs, + * user-defined vertex programs and GLSL vertex shaders). + * This is the program we must use when rendering. */ struct gl_vertex_program *_Current; @@ -2021,12 +1992,12 @@ struct gl_vertex_program_state struct gl_fragment_program_state { GLboolean Enabled; /**< User-set fragment program enable flag */ - GLboolean _Enabled; /**< Fragment program enabled and valid? */ - GLboolean _Active; + GLboolean _Enabled; /**< Enabled and _valid_ user program? */ struct gl_fragment_program *Current; /**< User-bound fragment program */ - /** Currently enabled and valid program (including internal programs - * and compiled shader programs). + /** Currently enabled and valid fragment program (including internal programs, + * user-defined fragment programs and GLSL fragment shaders). + * This is the program we must use when rendering. */ struct gl_fragment_program *_Current; @@ -2034,7 +2005,6 @@ struct gl_fragment_program_state /** Should fixed-function texturing be implemented with a fragment prog? */ GLboolean _MaintainTexEnvProgram; - GLboolean _UseTexEnvProgram; /** Program to emulate fixed-function texture env/combine (see above) */ struct gl_fragment_program *_TexEnvProgram; @@ -2118,6 +2088,13 @@ struct gl_query_state }; +/** Set by #pragma directives */ +struct gl_sl_pragmas +{ + GLboolean Optimize; /**< defaults on */ + GLboolean Debug; /**< defaults off */ +}; + /** * A GLSL vertex or fragment shader object. @@ -2128,12 +2105,12 @@ struct gl_shader GLuint Name; /**< AKA the handle */ GLint RefCount; /**< Reference count */ GLboolean DeletePending; - - const GLchar *Source; /**< Source code string */ GLboolean CompileStatus; + GLboolean Main; /**< shader defines main() */ + const GLchar *Source; /**< Source code string */ struct gl_program *Program; /**< Post-compile assembly code */ GLchar *InfoLog; - GLboolean Main; /**< shader defines main() */ + struct gl_sl_pragmas Pragmas; }; @@ -2165,6 +2142,13 @@ struct gl_shader_program }; +#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ +#define GLSL_LOG 0x2 /**< Write shaders to files */ +#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ +#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ +#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ + + /** * Context state for GLSL vertex/fragment shaders. */ @@ -2176,6 +2160,7 @@ struct gl_shader_state GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ void *MemPool; + GLbitfield Flags; /**< Mask of GLSL_x flags */ }; @@ -2189,18 +2174,8 @@ struct gl_shared_state struct _mesa_HashTable *DisplayList; /**< Display lists hash table */ struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */ - /** - * \name Default texture objects (shared by all multi-texture units) - */ - /*@{*/ - struct gl_texture_object *Default1D; - struct gl_texture_object *Default2D; - struct gl_texture_object *Default3D; - struct gl_texture_object *DefaultCubeMap; - struct gl_texture_object *DefaultRect; - struct gl_texture_object *Default1DArray; - struct gl_texture_object *Default2DArray; - /*@}*/ + /** Default texture objects (shared by all texture units) */ + struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS]; /** * \name Thread safety and statechange notification for texture @@ -2277,7 +2252,9 @@ struct gl_renderbuffer GLenum _ActualFormat; /**< The driver-chosen format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or GL_STENCIL_INDEX. */ - GLenum DataType; /**< Type of values passed to the Get/Put functions */ + GLenum ColorEncoding; /**< GL_LINEAR or GL_SRGB */ + GLenum ComponentType; /**< GL_FLOAT, GL_INT, GL_UNSIGNED_INT, + GL_UNSIGNED_NORMALIZED or GL_INDEX */ GLubyte RedBits; /**< Bits of red per pixel */ GLubyte GreenBits; GLubyte BlueBits; @@ -2285,7 +2262,9 @@ struct gl_renderbuffer GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; - GLubyte Samples; /**< Number of samples - 0 if not multisampled */ + GLubyte NumSamples; + + GLenum DataType; /**< Type of values passed to the Get/Put functions */ GLvoid *Data; /**< This may not be used by some kinds of RBs */ /* Used to wrap one renderbuffer around another: */ @@ -2431,13 +2410,11 @@ struct gl_framebuffer GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS]; GLenum ColorReadBuffer; - /* These are computed from ColorDrawBuffer and ColorReadBuffer */ - GLbitfield _ColorDrawBufferMask[MAX_DRAW_BUFFERS]; /* Mask of BUFFER_BIT_* flags */ + /** Computed from ColorDraw/ReadBuffer above */ + GLuint _NumColorDrawBuffers; + GLint _ColorDrawBufferIndexes[MAX_DRAW_BUFFERS]; /**< BUFFER_x or -1 */ GLint _ColorReadBufferIndex; /* -1 = None */ - - /* These are computed from _ColorDrawBufferMask and _ColorReadBufferIndex */ - GLuint _NumColorDrawBuffers[MAX_DRAW_BUFFERS]; - struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS][4]; + struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS]; struct gl_renderbuffer *_ColorReadBuffer; /** The Actual depth/stencil buffers to use. May be wrappers around the @@ -2493,9 +2470,9 @@ struct gl_constants GLint MaxTextureRectSize; /* GL_NV_texture_rectangle */ GLuint MaxTextureCoordUnits; GLuint MaxTextureImageUnits; - GLuint MaxTextureUnits; /* = MIN(CoordUnits, ImageUnits) */ - GLfloat MaxTextureMaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */ - GLfloat MaxTextureLodBias; /* GL_EXT_texture_lod_bias */ + GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ + GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ + GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ GLuint MaxArrayLockSize; GLint SubPixelBits; GLfloat MinPointSize, MaxPointSize; /* aliased */ @@ -2530,6 +2507,8 @@ struct gl_constants /* GL_ARB_vertex_shader */ GLuint MaxVertexTextureImageUnits; GLuint MaxVarying; /**< Number of float[4] vectors */ + /* GL_ARB_framebuffer_object */ + GLuint MaxSamples; }; @@ -2551,6 +2530,7 @@ struct gl_extensions GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; + GLboolean ARB_framebuffer_object; GLboolean ARB_half_float_pixel; GLboolean ARB_imaging; GLboolean ARB_multisample; @@ -2561,6 +2541,7 @@ struct gl_extensions GLboolean ARB_shading_language_100; GLboolean ARB_shading_language_120; GLboolean ARB_shadow; + GLboolean ARB_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; GLboolean ARB_texture_cube_map; @@ -2621,8 +2602,10 @@ struct gl_extensions GLboolean EXT_texture_lod_bias; GLboolean EXT_texture_mirror_clamp; GLboolean EXT_texture_sRGB; + GLboolean EXT_texture_swizzle; GLboolean EXT_timer_query; GLboolean EXT_vertex_array; + GLboolean EXT_vertex_array_bgra; GLboolean EXT_vertex_array_set; /* vendor extensions */ GLboolean APPLE_client_storage; @@ -2645,6 +2628,7 @@ struct gl_extensions GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; + GLboolean NV_texture_env_combine4; GLboolean NV_texture_rectangle; GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; @@ -2655,9 +2639,6 @@ struct gl_extensions GLboolean SGIS_generate_mipmap; GLboolean SGIS_texture_edge_clamp; GLboolean SGIS_texture_lod; - GLboolean SGIX_depth_texture; - GLboolean SGIX_shadow; - GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean TDFX_texture_compression_FXT1; GLboolean S3_s3tc; /*@}*/ @@ -2832,6 +2813,10 @@ struct gl_matrix_stack /*@}*/ +/** + * Composite state flags + */ +/*@{*/ #define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \ _NEW_TEXTURE | \ _NEW_POINT | \ @@ -2841,16 +2826,11 @@ struct gl_matrix_stack #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ _NEW_TEXTURE) -#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX) - - +#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL | \ + _NEW_COLOR_MATRIX) +/*@}*/ -/* - * Forward declaration of display list data types: - */ -union node; -typedef union node Node; /* This has to be included here. */ @@ -2882,21 +2862,31 @@ struct gl_tnl_module /*@}*/ }; -/* Strictly this is a tnl/ private concept, but it doesn't seem + +/** + * Display list flags. + * Strictly this is a tnl-private concept, but it doesn't seem * worthwhile adding a tnl private structure just to hold this one bit * of information: */ -#define MESA_DLIST_DANGLING_REFS 0x1 +#define DLIST_DANGLING_REFS 0x1 + -/* Provide a location where information about a display list can be +/** Opaque declaration of display list payload data type */ +union gl_dlist_node; + + +/** + * Provide a location where information about a display list can be * collected. Could be extended with driverPrivate structures, * etc. in the future. */ -struct mesa_display_list +struct gl_display_list { - Node *node; - GLuint id; - GLbitfield flags; + GLuint Name; + GLbitfield Flags; /**< DLIST_x flags */ + /** The dlist commands are in a linked list of nodes */ + union gl_dlist_node *Head; }; @@ -2905,13 +2895,10 @@ struct mesa_display_list */ struct gl_dlist_state { - struct mesa_display_list *CallStack[MAX_LIST_NESTING]; GLuint CallDepth; /**< Current recursion calling depth */ - struct mesa_display_list *CurrentList; - Node *CurrentListPtr; /**< Head of list being compiled */ - GLuint CurrentListNum; /**< Number of the list being compiled */ - Node *CurrentBlock; /**< Pointer to current block of nodes */ + struct gl_display_list *CurrentList; /**< List currently being compiled */ + union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */ GLuint CurrentPos; /**< Index into current block of nodes */ GLvertexformat ListVtxfmt; @@ -2973,7 +2960,7 @@ struct __GLcontextRec struct gl_matrix_stack ModelviewMatrixStack; struct gl_matrix_stack ProjectionMatrixStack; struct gl_matrix_stack ColorMatrixStack; - struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_COORD_UNITS]; + struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS]; struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES]; struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */ /*@}*/ @@ -3082,7 +3069,10 @@ struct __GLcontextRec /** \name Derived state */ /*@{*/ - GLbitfield _TriangleCaps; /**< bitwise-or of DD_* flags */ + /** Bitwise-or of DD_* flags. Note that this bitfield may be used before + * state validation so they need to always be current. + */ + GLbitfield _TriangleCaps; GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ GLfloat _EyeZDir[3]; GLfloat _ModelViewInvScale; @@ -3098,12 +3088,6 @@ struct __GLcontextRec struct gl_list_extensions ListExt; /**< driver dlist extensions */ - - GLuint _Facing; /**< This is a hack for 2-sided stencil test. - * - * We don't have a better way to communicate this value from - * swrast_setup to swrast. */ - /** \name For debugging/development only */ /*@{*/ GLboolean FirstTimeCurrent; @@ -3166,8 +3150,6 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, - VERBOSE_GLSL = 0x2000, - VERBOSE_GLSL_DUMP = 0x4000 }; @@ -3178,7 +3160,4 @@ enum _debug -#define Elements(x) sizeof(x)/sizeof(*(x)) - - -#endif /* TYPES_H */ +#endif /* MTYPES_H */ diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index b9cfad9216..01b68df7af 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -37,11 +37,6 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert) { GET_CURRENT_CONTEXT(ctx); - if (!ctx->Extensions.ARB_multisample) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB"); - return; - } - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); ctx->Multisample.SampleCoverageValue = (GLfloat) CLAMP(value, 0.0, 1.0); diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index c98506b2bb..52781e048e 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -150,7 +150,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { /* test that mapsize is a power of two */ - if (_mesa_bitcount((GLuint) mapsize) != 1) { + if (!_mesa_is_pow_two(mapsize)) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); return; } @@ -209,7 +209,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { /* test that mapsize is a power of two */ - if (_mesa_bitcount((GLuint) mapsize) != 1) { + if (!_mesa_is_pow_two(mapsize)) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } @@ -282,7 +282,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) if (map >= GL_PIXEL_MAP_S_TO_S && map <= GL_PIXEL_MAP_I_TO_A) { /* test that mapsize is a power of two */ - if (_mesa_bitcount((GLuint) mapsize) != 1) { + if (!_mesa_is_pow_two(mapsize)) { _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); return; } @@ -828,7 +828,7 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) /* References ColorMatrix.type (derived above). */ - if (new_state & _IMAGE_NEW_TRANSFER_STATE) + if (new_state & _MESA_NEW_TRANSFER_STATE) update_image_transfer_state(ctx); } diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index fbedbcb22c..4c8fc1f72e 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -5,7 +5,7 @@ /* * Mesa 3-D graphics library - * Version: 7.0 + * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -77,8 +77,13 @@ _mesa_PointParameteri( GLenum pname, GLint param ) void GLAPIENTRY _mesa_PointParameteriv( GLenum pname, const GLint *params ) { - const GLfloat value = (GLfloat) params[0]; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) params[0]; + if (pname == GL_DISTANCE_ATTENUATION_EXT) { + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + } + _mesa_PointParameterfv(pname, p); } @@ -105,6 +110,11 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || ctx->Point.Params[1] != 0.0 || ctx->Point.Params[2] != 0.0); + + if (ctx->Point._Attenuated) + ctx->_TriangleCaps |= DD_POINT_ATTEN; + else + ctx->_TriangleCaps &= ~DD_POINT_ATTEN; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -190,7 +200,7 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) } break; case GL_POINT_SPRITE_COORD_ORIGIN: - if (ctx->Extensions.ARB_point_sprite) { + if (ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) { GLenum value = (GLenum) params[0]; if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -247,7 +257,7 @@ _mesa_init_point(GLcontext *ctx) ctx->Point.PointSprite = GL_FALSE; /* GL_ARB/NV_point_sprite */ ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite (only!) */ ctx->Point.SpriteOrigin = GL_UPPER_LEFT; /* GL_ARB_point_sprite */ - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_ARB/NV_point_sprite */ } } diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index fd02e5a652..564250b881 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -167,6 +167,11 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) return; } + if (ctx->Polygon.FrontMode == GL_FILL && ctx->Polygon.BackMode == GL_FILL) + ctx->_TriangleCaps &= ~DD_TRI_UNFILLED; + else + ctx->_TriangleCaps |= DD_TRI_UNFILLED; + if (ctx->Driver.PolygonMode) ctx->Driver.PolygonMode(ctx, face, mode); } diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index e3ba7b6ff7..554e0b0d18 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -90,9 +90,8 @@ _mesa_wait_query(GLcontext *ctx, struct gl_query_object *q) /** - * Delete an occlusion query object. + * Delete a query object. Called via ctx->Driver.DeleteQuery(). * Not removed from hash table here. - * XXX maybe add Delete() method to gl_query_object class and call that instead */ void _mesa_delete_query(GLcontext *ctx, struct gl_query_object *q) diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 155140f3cc..9f309d6ab8 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -50,12 +50,12 @@ rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) p[2] = z; p[3] = w; - if (ctx->NewState) - _mesa_update_state( ctx ); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); FLUSH_CURRENT(ctx, 0); + if (ctx->NewState) + _mesa_update_state( ctx ); + ctx->Driver.RasterPos(ctx, p); } @@ -500,7 +500,7 @@ void _mesa_init_rastpos( GLcontext * ctx ) ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 ); ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterIndex = 1.0; - for (i=0; i<MAX_TEXTURE_UNITS; i++) + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterPosValid = GL_TRUE; } diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index dc22808e5b..dfdd297b6e 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -105,8 +105,7 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, } break; case GL_DEPTH_COMPONENT: - if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) || - (!drawing && !_mesa_source_buffer_exists(ctx, format))) { + if ((drawing && !_mesa_dest_buffer_exists(ctx, format))) { _mesa_error(ctx, GL_INVALID_OPERATION, "gl%sPixels(no depth buffer)", readDraw); return GL_TRUE; diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 3c37d05b40..38be8266e0 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1488,11 +1488,16 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) rb->InternalFormat = GL_NONE; rb->_ActualFormat = GL_NONE; rb->_BaseFormat = GL_NONE; - rb->DataType = GL_NONE; + + rb->ComponentType = GL_UNSIGNED_NORMALIZED; /* ARB_fbo */ + rb->ColorEncoding = GL_LINEAR; /* ARB_fbo */ + rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = 0; rb->IndexBits = 0; rb->DepthBits = 0; rb->StencilBits = 0; + + rb->DataType = GL_NONE; rb->Data = NULL; /* Point back to ourself so that we don't have to check for Wrapped==NULL diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index f0db0d2a81..7491d00c35 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.3 * * Copyright (C) 2004-2008 Brian Paul All Rights Reserved. * @@ -233,13 +233,23 @@ _mesa_GetObjectParameterivARB(GLhandleARB object, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); /* Implement in terms of GetProgramiv, GetShaderiv */ if (ctx->Driver.IsProgram(ctx, object)) { - ctx->Driver.GetProgramiv(ctx, object, pname, params); + if (pname == GL_OBJECT_TYPE_ARB) { + *params = GL_PROGRAM_OBJECT_ARB; + } + else { + ctx->Driver.GetProgramiv(ctx, object, pname, params); + } } else if (ctx->Driver.IsShader(ctx, object)) { - ctx->Driver.GetShaderiv(ctx, object, pname, params); + if (pname == GL_OBJECT_TYPE_ARB) { + *params = GL_SHADER_OBJECT_ARB; + } + else { + ctx->Driver.GetShaderiv(ctx, object, pname, params); + } } else { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetObjectParameterivARB"); + _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectParameterivARB"); } } diff --git a/src/mesa/main/sources b/src/mesa/main/sources index 468121bd1d..4e58702c74 100644 --- a/src/mesa/main/sources +++ b/src/mesa/main/sources @@ -20,6 +20,7 @@ debug.c \ depth.c \ depthstencil.c \ dlist.c \ +dlopen.c \ drawpix.c \ enable.c \ enums.c \ @@ -100,6 +101,7 @@ debug.h \ depth.h \ depthstencil.h \ dlist.h \ +dlopen.h \ drawpix.h \ enable.h \ enums.h \ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index a962f1cb41..0a39279bff 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -51,6 +51,16 @@ #include "texstate.h" +static void +update_separate_specular(GLcontext *ctx) +{ + if (NEED_SECONDARY_COLOR(ctx)) + ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; + else + ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR; +} + + /** * Update state dependent on vertex arrays. */ @@ -163,25 +173,47 @@ update_arrays( GLcontext *ctx ) } +/** + * Update the following fields: + * ctx->VertexProgram._Enabled + * ctx->FragmentProgram._Enabled + * ctx->ATIFragmentShader._Enabled + * This needs to be done before texture state validation. + */ static void -update_program(GLcontext *ctx) +update_program_enables(GLcontext *ctx) { - const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; - const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; - const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; - /* These _Enabled flags indicate if the program is enabled AND valid. */ ctx->VertexProgram._Enabled = ctx->VertexProgram.Enabled && ctx->VertexProgram.Current->Base.Instructions; ctx->FragmentProgram._Enabled = ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current->Base.Instructions; ctx->ATIFragmentShader._Enabled = ctx->ATIFragmentShader.Enabled - && ctx->ATIFragmentShader.Current->Instructions; + && ctx->ATIFragmentShader.Current->Instructions[0]; +} + + +/** + * Update vertex/fragment program state. In particular, update these fields: + * ctx->VertexProgram._Current + * ctx->VertexProgram._TnlProgram, + * These point to the highest priority enabled vertex/fragment program or are + * NULL if fixed-function processing is to be done. + * + * This function needs to be called after texture state validation in case + * we're generating a fragment program from fixed-function texture state. + */ +static void +update_program(GLcontext *ctx) +{ + const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; + const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; + const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; /* * Set the ctx->VertexProgram._Current and ctx->FragmentProgram._Current - * pointers to the programs that should be enabled/used. These will only - * be NULL if we need to use the fixed-function code. + * pointers to the programs that should be used for rendering. If either + * is NULL, use fixed-function code paths. * * These programs may come from several sources. The priority is as * follows: @@ -194,56 +226,37 @@ update_program(GLcontext *ctx) * come up, or matter. */ - /** - ** Fragment program - **/ -#if 1 - /* XXX get rid of this someday? */ - ctx->FragmentProgram._Active = GL_FALSE; -#endif if (shProg && shProg->LinkStatus && shProg->FragmentProgram) { - /* user-defined fragment shader */ + /* Use shader programs */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, shProg->FragmentProgram); } else if (ctx->FragmentProgram._Enabled) { - /* use user-defined fragment program */ + /* use user-defined vertex program */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, ctx->FragmentProgram.Current); } else if (ctx->FragmentProgram._MaintainTexEnvProgram) { - /* fragment program generated from fixed-function state */ + /* Use fragment program generated from fixed-function state. + */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, _mesa_get_fixed_func_fragment_program(ctx)); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, ctx->FragmentProgram._Current); - - /* XXX get rid of this confusing stuff someday? */ - ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled; - if (ctx->FragmentProgram._UseTexEnvProgram) - ctx->FragmentProgram._Active = GL_TRUE; } else { /* no fragment program */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); } - if (ctx->FragmentProgram._Current != prevFP && ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - (struct gl_program *) ctx->FragmentProgram._Current); - } - - /** - ** Vertex program - **/ -#if 1 - /* XXX get rid of this someday? */ - _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL); -#endif + /* Examine vertex program after fragment program as + * _mesa_get_fixed_func_vertex_program() needs to know active + * fragprog inputs. + */ if (shProg && shProg->LinkStatus && shProg->VertexProgram) { - /* user-defined vertex shader */ + /* Use shader programs */ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, - shProg->VertexProgram); + shProg->VertexProgram); } else if (ctx->VertexProgram._Enabled) { /* use user-defined vertex program */ @@ -251,20 +264,28 @@ update_program(GLcontext *ctx) ctx->VertexProgram.Current); } else if (ctx->VertexProgram._MaintainTnlProgram) { - /* vertex program generated from fixed-function state */ + /* Use vertex program generated from fixed-function state. + */ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, _mesa_get_fixed_func_vertex_program(ctx)); _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, ctx->VertexProgram._Current); } else { - /* no vertex program / used fixed-function code */ + /* no vertex program */ _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); } + /* Let the driver know what's happening: + */ + if (ctx->FragmentProgram._Current != prevFP && ctx->Driver.BindProgram) { + ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, + (struct gl_program *) ctx->FragmentProgram._Current); + } + if (ctx->VertexProgram._Current != prevVP && ctx->Driver.BindProgram) { ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, - (struct gl_program *) ctx->VertexProgram._Current); + (struct gl_program *) ctx->VertexProgram._Current); } } @@ -315,6 +336,24 @@ update_color(GLcontext *ctx) } +/* + * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET + * in ctx->_TriangleCaps if needed. + */ +static void +update_polygon(GLcontext *ctx) +{ + ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET); + + if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) + ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK; + + if ( ctx->Polygon.OffsetPoint + || ctx->Polygon.OffsetLine + || ctx->Polygon.OffsetFill) + ctx->_TriangleCaps |= DD_TRI_OFFSET; +} + /** * Update the ctx->_TriangleCaps bitfield. @@ -322,6 +361,7 @@ update_color(GLcontext *ctx) * This function must be called after other update_*() functions since * there are dependencies on some other derived values. */ +#if 0 static void update_tricaps(GLcontext *ctx, GLbitfield new_state) { @@ -387,6 +427,7 @@ update_tricaps(GLcontext *ctx, GLbitfield new_state) if (ctx->Stencil._TestTwoSide) ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; } +#endif /** @@ -413,6 +454,24 @@ _mesa_update_state_locked( GLcontext *ctx ) if (MESA_VERBOSE & VERBOSE_STATE) _mesa_print_state("_mesa_update_state", new_state); + /* Determine which state flags effect vertex/fragment program state */ + if (ctx->FragmentProgram._MaintainTexEnvProgram) { + prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); + } + if (ctx->VertexProgram._MaintainTnlProgram) { + prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | + _NEW_TRANSFORM | _NEW_POINT | + _NEW_FOG | _NEW_LIGHT | + _MESA_NEW_NEED_EYE_COORDS); + } + + /* + * Now update derived state info + */ + + if (new_state & prog_flags) + update_program_enables( ctx ); + if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION)) _mesa_update_modelview_project( ctx, new_state ); @@ -425,6 +484,9 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT)) _mesa_update_draw_buffer_bounds( ctx ); + if (new_state & _NEW_POLYGON) + update_polygon( ctx ); + if (new_state & _NEW_LIGHT) _mesa_update_lighting( ctx ); @@ -432,10 +494,13 @@ _mesa_update_state_locked( GLcontext *ctx ) _mesa_update_stencil( ctx ); #if FEATURE_pixel_transfer - if (new_state & _IMAGE_NEW_TRANSFER_STATE) + if (new_state & _MESA_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); #endif + if (new_state & _DD_NEW_SEPARATE_SPECULAR) + update_separate_specular( ctx ); + if (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) update_arrays( ctx ); @@ -448,9 +513,11 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _NEW_COLOR) update_color( ctx ); +#if 0 if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR)) update_tricaps( ctx, new_state ); +#endif /* ctx->_NeedEyeCoords is now up to date. * @@ -464,23 +531,9 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & _MESA_NEW_NEED_EYE_COORDS) _mesa_update_tnl_spaces( ctx, new_state ); - if (ctx->FragmentProgram._MaintainTexEnvProgram) { - prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE_MATRIX | _NEW_LIGHT | - _NEW_RENDERMODE | - _NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR); - } - if (ctx->VertexProgram._MaintainTnlProgram) { - prog_flags |= (_NEW_ARRAY | _NEW_TEXTURE | _NEW_TEXTURE_MATRIX | - _NEW_RENDERMODE | - _NEW_TRANSFORM | _NEW_POINT | - _NEW_FOG | _NEW_LIGHT | - _MESA_NEW_NEED_EYE_COORDS); - } if (new_state & prog_flags) update_program( ctx ); - - /* * Give the driver a chance to act upon the new_state flags. * The driver might plug in different span functions, for example. diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 2a4c38b1f2..e4a255d0a7 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -27,7 +27,7 @@ * \file stencil.c * Stencil operations. * - * Note: There's an incompatibility between GL_EXT_stencil_two_side and + * Note: There's some conflict between GL_EXT_stencil_two_side and * OpenGL 2.0's two-sided stencil feature. * * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the @@ -36,12 +36,14 @@ * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the * front AND back state. * - * So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL - * 2.0, but not both. - * * Also, note that GL_ATI_separate_stencil is different as well: * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs. * glStencilFuncSeparate(GLenum face, GLenum func, ...). + * + * This problem is solved by keeping three sets of stencil state: + * state[0] = GL_FRONT state. + * state[1] = OpenGL 2.0 / GL_ATI_separate_stencil GL_BACK state. + * state[2] = GL_EXT_stencil_two_side GL_BACK state. */ @@ -198,6 +200,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) { GET_CURRENT_CONTEXT(ctx); const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; + const GLint face = ctx->Stencil.ActiveFace; ASSERT_OUTSIDE_BEGIN_END(ctx); if (!validate_stencil_func(ctx, func)) { @@ -207,9 +210,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ref = CLAMP( ref, 0, stencilMax ); - if (ctx->Extensions.EXT_stencil_two_side) { - /* only set active face state */ - const GLint face = ctx->Stencil.ActiveFace; + if (face != 0) { if (ctx->Stencil.Function[face] == func && ctx->Stencil.ValueMask[face] == mask && ctx->Stencil.Ref[face] == ref) @@ -218,9 +219,12 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ctx->Stencil.Function[face] = func; ctx->Stencil.Ref[face] = ref; ctx->Stencil.ValueMask[face] = mask; - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, face ? GL_BACK : GL_FRONT, - func, ref, mask); + + /* Only propagate the change to the driver if EXT_stencil_two_side + * is enabled. + */ + if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) { + ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask); } } else { @@ -237,7 +241,9 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT_AND_BACK, + ctx->Driver.StencilFuncSeparate(ctx, + ((ctx->Stencil.TestTwoSide) + ? GL_FRONT : GL_FRONT_AND_BACK), func, ref, mask); } } @@ -259,17 +265,23 @@ void GLAPIENTRY _mesa_StencilMask( GLuint mask ) { GET_CURRENT_CONTEXT(ctx); + const GLint face = ctx->Stencil.ActiveFace; + ASSERT_OUTSIDE_BEGIN_END(ctx); - if (ctx->Extensions.EXT_stencil_two_side) { - /* only set active face state */ - const GLint face = ctx->Stencil.ActiveFace; + if (face != 0) { + /* Only modify the EXT_stencil_two_side back-face state. + */ if (ctx->Stencil.WriteMask[face] == mask) return; FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.WriteMask[face] = mask; - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, face ? GL_BACK : GL_FRONT, mask); + + /* Only propagate the change to the driver if EXT_stencil_two_side + * is enabled. + */ + if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) { + ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask); } } else { @@ -280,7 +292,10 @@ _mesa_StencilMask( GLuint mask ) FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask; if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT_AND_BACK, mask); + ctx->Driver.StencilMaskSeparate(ctx, + ((ctx->Stencil.TestTwoSide) + ? GL_FRONT : GL_FRONT_AND_BACK), + mask); } } } @@ -304,6 +319,8 @@ void GLAPIENTRY _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) { GET_CURRENT_CONTEXT(ctx); + const GLint face = ctx->Stencil.ActiveFace; + ASSERT_OUTSIDE_BEGIN_END(ctx); if (!validate_stencil_op(ctx, fail)) { @@ -319,9 +336,8 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) return; } - if (ctx->Extensions.EXT_stencil_two_side) { + if (face != 0) { /* only set active face state */ - const GLint face = ctx->Stencil.ActiveFace; if (ctx->Stencil.ZFailFunc[face] == zfail && ctx->Stencil.ZPassFunc[face] == zpass && ctx->Stencil.FailFunc[face] == fail) @@ -330,9 +346,12 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZFailFunc[face] = zfail; ctx->Stencil.ZPassFunc[face] = zpass; ctx->Stencil.FailFunc[face] = fail; - if (ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, face ? GL_BACK : GL_FRONT, - fail, zfail, zpass); + + /* Only propagate the change to the driver if EXT_stencil_two_side + * is enabled. + */ + if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) { + ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass); } } else { @@ -349,7 +368,9 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass; ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail; if (ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, GL_FRONT_AND_BACK, + ctx->Driver.StencilOpSeparate(ctx, + ((ctx->Stencil.TestTwoSide) + ? GL_FRONT : GL_FRONT_AND_BACK), fail, zfail, zpass); } } @@ -372,7 +393,7 @@ _mesa_ActiveStencilFaceEXT(GLenum face) if (face == GL_FRONT || face == GL_BACK) { FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 1; + ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)"); @@ -513,19 +534,16 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask) void _mesa_update_stencil(GLcontext *ctx) { - if (ctx->Extensions.EXT_stencil_two_side) { - ctx->Stencil._TestTwoSide = ctx->Stencil.TestTwoSide; - } - else { - ctx->Stencil._TestTwoSide = - (ctx->Stencil.Function[0] != ctx->Stencil.Function[1] || - ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[1] || - ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[1] || - ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[1] || - ctx->Stencil.Ref[0] != ctx->Stencil.Ref[1] || - ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[1] || - ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[1]); - } + const GLint face = ctx->Stencil._BackFace; + + ctx->Stencil._TestTwoSide = + (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] || + ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] || + ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] || + ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] || + ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] || + ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] || + ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]); } @@ -541,20 +559,28 @@ _mesa_init_stencil(GLcontext *ctx) { ctx->Stencil.Enabled = GL_FALSE; ctx->Stencil.TestTwoSide = GL_FALSE; - ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 1 = GL_BACK */ + ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 2 = GL_BACK */ ctx->Stencil.Function[0] = GL_ALWAYS; ctx->Stencil.Function[1] = GL_ALWAYS; + ctx->Stencil.Function[2] = GL_ALWAYS; ctx->Stencil.FailFunc[0] = GL_KEEP; ctx->Stencil.FailFunc[1] = GL_KEEP; + ctx->Stencil.FailFunc[2] = GL_KEEP; ctx->Stencil.ZPassFunc[0] = GL_KEEP; ctx->Stencil.ZPassFunc[1] = GL_KEEP; + ctx->Stencil.ZPassFunc[2] = GL_KEEP; ctx->Stencil.ZFailFunc[0] = GL_KEEP; ctx->Stencil.ZFailFunc[1] = GL_KEEP; + ctx->Stencil.ZFailFunc[2] = GL_KEEP; ctx->Stencil.Ref[0] = 0; ctx->Stencil.Ref[1] = 0; + ctx->Stencil.Ref[2] = 0; ctx->Stencil.ValueMask[0] = ~0U; ctx->Stencil.ValueMask[1] = ~0U; + ctx->Stencil.ValueMask[2] = ~0U; ctx->Stencil.WriteMask[0] = ~0U; ctx->Stencil.WriteMask[1] = ~0U; + ctx->Stencil.WriteMask[2] = ~0U; ctx->Stencil.Clear = 0; + ctx->Stencil._BackFace = 1; } diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 5ad936419b..c1b8c7675a 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -56,60 +57,58 @@ GLuint _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) { GLuint n = 0; - if (ctx->Extensions.ARB_texture_compression) { - if (ctx->Extensions.TDFX_texture_compression_FXT1) { - if (formats) { - formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX; - formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX; - } - else { - n += 2; - } + if (ctx->Extensions.TDFX_texture_compression_FXT1) { + if (formats) { + formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX; + formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX; } - if (ctx->Extensions.EXT_texture_compression_s3tc) { - if (formats) { - formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; - /* This format has some restrictions/limitations and so should - * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query. - * Specifically, all transparent pixels become black. NVIDIA - * omits this format too. - */ - if (all) - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - } - else { - n += 3; - if (all) - n += 1; - } + else { + n += 2; } - if (ctx->Extensions.S3_s3tc) { - if (formats) { - formats[n++] = GL_RGB_S3TC; - formats[n++] = GL_RGB4_S3TC; - formats[n++] = GL_RGBA_S3TC; - formats[n++] = GL_RGBA4_S3TC; - } - else { - n += 4; - } + } + if (ctx->Extensions.EXT_texture_compression_s3tc) { + if (formats) { + formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + /* This format has some restrictions/limitations and so should + * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query. + * Specifically, all transparent pixels become black. NVIDIA + * omits this format too. + */ + if (all) + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + } + else { + n += 3; + if (all) + n += 1; + } + } + if (ctx->Extensions.S3_s3tc) { + if (formats) { + formats[n++] = GL_RGB_S3TC; + formats[n++] = GL_RGB4_S3TC; + formats[n++] = GL_RGBA_S3TC; + formats[n++] = GL_RGBA4_S3TC; } + else { + n += 4; + } + } #if FEATURE_EXT_texture_sRGB - if (ctx->Extensions.EXT_texture_sRGB) { - if (formats) { - formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; - } - else { - n += 4; - } + if (ctx->Extensions.EXT_texture_sRGB) { + if (formats) { + formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + } + else { + n += 4; } -#endif /* FEATURE_EXT_texture_sRGB */ } +#endif /* FEATURE_EXT_texture_sRGB */ return n; } @@ -151,13 +150,15 @@ _mesa_compressed_texture_size( GLcontext *ctx, /* Textures smaller than 8x4 will effectively be made into 8x4 and * take 16 bytes. */ - if (size < 16) - size = 16; return size; #endif #if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_RGBA_DXT1: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: +#endif /* round up width, height to next multiple of 4 */ width = (width + 3) & ~3; height = (height + 3) & ~3; @@ -166,11 +167,13 @@ _mesa_compressed_texture_size( GLcontext *ctx, /* Textures smaller than 4x4 will effectively be made into 4x4 and * take 8 bytes. */ - if (size < 8) - size = 8; return size; case MESA_FORMAT_RGBA_DXT3: case MESA_FORMAT_RGBA_DXT5: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: +#endif /* round up width, height to next multiple of 4 */ width = (width + 3) & ~3; height = (height + 3) & ~3; @@ -179,8 +182,6 @@ _mesa_compressed_texture_size( GLcontext *ctx, /* Textures smaller than 4x4 will effectively be made into 4x4 and * take 16 bytes. */ - if (size < 16) - size = 16; return size; #endif default: @@ -232,6 +233,20 @@ _mesa_compressed_texture_size_glenum(GLcontext *ctx, case GL_RGBA4_S3TC: mesaFormat = MESA_FORMAT_RGBA_DXT5; break; +#if FEATURE_EXT_texture_sRGB + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: + mesaFormat = MESA_FORMAT_SRGB_DXT1; + break; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: + mesaFormat = MESA_FORMAT_SRGBA_DXT1; + break; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: + mesaFormat = MESA_FORMAT_SRGBA_DXT3; + break; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: + mesaFormat = MESA_FORMAT_SRGBA_DXT5; + break; +#endif #endif default: return 0; @@ -263,10 +278,18 @@ _mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width) #if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_RGBA_DXT1: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: +#endif stride = ((width + 3) / 4) * 8; /* 8 bytes per 4x4 tile */ break; case MESA_FORMAT_RGBA_DXT3: case MESA_FORMAT_RGBA_DXT5: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: +#endif stride = ((width + 3) / 4) * 16; /* 16 bytes per 4x4 tile */ break; #endif @@ -315,10 +338,18 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, #if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_RGBA_DXT1: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: +#endif addr = (GLubyte *) image + 8 * (((width + 3) / 4) * (row / 4) + col / 4); break; case MESA_FORMAT_RGBA_DXT3: case MESA_FORMAT_RGBA_DXT5: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: +#endif addr = (GLubyte *) image + 16 * (((width + 3) / 4) * (row / 4) + col / 4); break; #endif diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 16a3ba076f..fc151605c9 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 7.1 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index c48063d919..d17e18da6b 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -3,6 +3,7 @@ * Version: 6.5.3 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,7 +30,7 @@ */ #ifndef USE_EXTERNAL_DXTN_LIB -#define USE_EXTERNAL_DXTN_LIB 0 +#define USE_EXTERNAL_DXTN_LIB 1 #endif #include "glheader.h" @@ -37,15 +38,12 @@ #include "colormac.h" #include "context.h" #include "convolve.h" +#include "dlopen.h" #include "image.h" #include "texcompress.h" #include "texformat.h" #include "texstore.h" -#if USE_EXTERNAL_DXTN_LIB && !defined(__MINGW32__) -#include <dlfcn.h> -#endif - #ifdef __MINGW32__ #define DXTN_LIBNAME "dxtn.dll" #define RTLD_LAZY 0 @@ -56,6 +54,34 @@ #define DXTN_LIBNAME "libtxc_dxtn.so" #endif +#if FEATURE_EXT_texture_sRGB +/** + * Convert an 8-bit sRGB value from non-linear space to a + * linear RGB value in [0, 1]. + * Implemented with a 256-entry lookup table. + */ +static INLINE GLfloat +nonlinear_to_linear(GLubyte cs8) +{ + static GLfloat table[256]; + static GLboolean tableReady = GL_FALSE; + if (!tableReady) { + /* compute lookup table now */ + GLuint i; + for (i = 0; i < 256; i++) { + const GLfloat cs = UBYTE_TO_FLOAT(i); + if (cs <= 0.04045) { + table[i] = cs / 12.92f; + } + else { + table[i] = (GLfloat) _mesa_pow((cs + 0.055) / 1.055, 2.4); + } + } + tableReady = GL_TRUE; + } + return table[cs8]; +} +#endif /* FEATURE_EXT_texture_sRGB */ typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut ); @@ -74,72 +100,6 @@ static dxtCompressTexFuncExt ext_tx_compress_dxtn = NULL; static void *dxtlibhandle = NULL; -typedef void (*GenericFunc)(void); - - -/** - * Wrapper for dlopen(). - * XXX Probably move this and the following wrappers into imports.h someday. - */ -static void * -_mesa_dlopen(const char *libname, int flags) -{ -#if USE_EXTERNAL_DXTN_LIB -#ifdef __MINGW32__ - return LoadLibrary(libname); -#else - return dlopen(libname, flags); -#endif -#else - return NULL; -#endif /* USE_EXTERNAL_DXTN_LIB */ -} - - -/** - * Wrapper for dlsym() that does a cast to a generic function type, - * rather than a void *. This reduces the number of warnings that are - * generated. - */ -static GenericFunc -_mesa_dlsym(void *handle, const char *fname) -{ -#if USE_EXTERNAL_DXTN_LIB -#ifdef __MINGW32__ - return (GenericFunc) GetProcAddress(handle, fname); -#elif defined(__DJGPP__) - /* need '_' prefix on symbol names */ - char fname2[1000]; - fname2[0] = '_'; - _mesa_strncpy(fname2 + 1, fname, 998); - fname2[999] = 0; - return (GenericFunc) dlsym(handle, fname2); -#else - return (GenericFunc) dlsym(handle, fname); -#endif -#else - return (GenericFunc) NULL; -#endif /* USE_EXTERNAL_DXTN_LIB */ -} - - -/** - * Wrapper for dlclose(). - */ -static void -_mesa_dlclose(void *handle) -{ -#if USE_EXTERNAL_DXTN_LIB -#ifdef __MINGW32__ - FreeLibrary(handle); -#else - dlclose(handle); -#endif -#endif -} - - - void _mesa_init_texture_s3tc( GLcontext *ctx ) { @@ -147,7 +107,7 @@ _mesa_init_texture_s3tc( GLcontext *ctx ) ctx->Mesa_DXTn = GL_FALSE; #if USE_EXTERNAL_DXTN_LIB if (!dxtlibhandle) { - dxtlibhandle = _mesa_dlopen(DXTN_LIBNAME, RTLD_LAZY | RTLD_GLOBAL); + dxtlibhandle = _mesa_dlopen(DXTN_LIBNAME, 0); if (!dxtlibhandle) { _mesa_warning(ctx, "couldn't open " DXTN_LIBNAME ", software DXTn " "compression/decompression unavailable"); @@ -552,6 +512,59 @@ fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } +#if FEATURE_EXT_texture_sRGB +static void +fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* just sample as GLchan and convert to float here */ + GLchan rgba[4]; + fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba); + texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]); + texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]); + texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); + texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); +} + +static void +fetch_texel_2d_f_srgba_dxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* just sample as GLchan and convert to float here */ + GLchan rgba[4]; + fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba); + texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]); + texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]); + texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); + texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); +} + +static void +fetch_texel_2d_f_srgba_dxt3( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* just sample as GLchan and convert to float here */ + GLchan rgba[4]; + fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba); + texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]); + texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]); + texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); + texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); +} + +static void +fetch_texel_2d_f_srgba_dxt5( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* just sample as GLchan and convert to float here */ + GLchan rgba[4]; + fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba); + texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]); + texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]); + texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); + texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); +} +#endif const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { MESA_FORMAT_RGB_DXT1, /* MesaFormat */ @@ -648,3 +661,101 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; + +#if FEATURE_EXT_texture_sRGB +const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { + MESA_FORMAT_SRGB_DXT1, /* MesaFormat */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 4, /*approx*/ /* RedBits */ + 4, /*approx*/ /* GreenBits */ + 4, /*approx*/ /* BlueBits */ + 0, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 0, /* TexelBytes */ + texstore_rgb_dxt1, /* StoreTexImageFunc */ + NULL, /*impossible*/ /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /*impossible*/ /* FetchTexel3D */ + NULL, /*impossible*/ /* FetchTexel1Df */ + fetch_texel_2d_f_srgb_dxt1, /* FetchTexel2Df */ + NULL, /*impossible*/ /* FetchTexel3Df */ + NULL /* StoreTexel */ +}; + +const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { + MESA_FORMAT_SRGBA_DXT1, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 4, /*approx*/ /* RedBits */ + 4, /*approx*/ /* GreenBits */ + 4, /*approx*/ /* BlueBits */ + 1, /*approx*/ /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 0, /* TexelBytes */ + texstore_rgba_dxt1, /* StoreTexImageFunc */ + NULL, /*impossible*/ /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /*impossible*/ /* FetchTexel3D */ + NULL, /*impossible*/ /* FetchTexel1Df */ + fetch_texel_2d_f_srgba_dxt1, /* FetchTexel2Df */ + NULL, /*impossible*/ /* FetchTexel3Df */ + NULL /* StoreTexel */ +}; + +const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { + MESA_FORMAT_SRGBA_DXT3, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 4, /*approx*/ /* RedBits */ + 4, /*approx*/ /* GreenBits */ + 4, /*approx*/ /* BlueBits */ + 4, /*approx*/ /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 0, /* TexelBytes */ + texstore_rgba_dxt3, /* StoreTexImageFunc */ + NULL, /*impossible*/ /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /*impossible*/ /* FetchTexel3D */ + NULL, /*impossible*/ /* FetchTexel1Df */ + fetch_texel_2d_f_srgba_dxt3, /* FetchTexel2Df */ + NULL, /*impossible*/ /* FetchTexel3Df */ + NULL /* StoreTexel */ +}; + +const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { + MESA_FORMAT_SRGBA_DXT5, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 4,/*approx*/ /* RedBits */ + 4,/*approx*/ /* GreenBits */ + 4,/*approx*/ /* BlueBits */ + 4,/*approx*/ /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 0, /* TexelBytes */ + texstore_rgba_dxt5, /* StoreTexImageFunc */ + NULL, /*impossible*/ /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /*impossible*/ /* FetchTexel3D */ + NULL, /*impossible*/ /* FetchTexel1Df */ + fetch_texel_2d_f_srgba_dxt5, /* FetchTexel2Df */ + NULL, /*impossible*/ /* FetchTexel3Df */ + NULL /* StoreTexel */ +}; +#endif diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index e072cea136..95547a500e 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -34,7 +35,415 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texenv.h" -#include "math/m_xform.h" + + +#define TE_ERROR(errCode, msg, value) \ + _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); + + +/** Set texture env mode */ +static void +set_env_mode(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum mode) +{ + GLboolean legal; + + if (texUnit->EnvMode == mode) + return; + + switch (mode) { + case GL_MODULATE: + case GL_BLEND: + case GL_DECAL: + case GL_REPLACE: + legal = GL_TRUE; + break; + case GL_REPLACE_EXT: + mode = GL_REPLACE; /* GL_REPLACE_EXT != GL_REPLACE */ + legal = GL_TRUE; + break; + case GL_ADD: + legal = ctx->Extensions.EXT_texture_env_add; + break; + case GL_COMBINE: + legal = (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine); + break; + case GL_COMBINE4_NV: + legal = ctx->Extensions.NV_texture_env_combine4; + break; + default: + legal = GL_FALSE; + } + + if (legal) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->EnvMode = mode; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + } +} + + +static void +set_env_color(GLcontext *ctx, + struct gl_texture_unit *texUnit, + const GLfloat *color) +{ + GLfloat tmp[4]; + tmp[0] = CLAMP(color[0], 0.0F, 1.0F); + tmp[1] = CLAMP(color[1], 0.0F, 1.0F); + tmp[2] = CLAMP(color[2], 0.0F, 1.0F); + tmp[3] = CLAMP(color[3], 0.0F, 1.0F); + if (TEST_EQ_4V(tmp, texUnit->EnvColor)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texUnit->EnvColor, tmp); +} + + +/** Set an RGB or A combiner mode/function */ +static void +set_combiner_mode(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLenum mode) +{ + GLboolean legal; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + switch (mode) { + case GL_REPLACE: + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: + legal = GL_TRUE; + break; + case GL_SUBTRACT: + legal = ctx->Extensions.ARB_texture_env_combine; + break; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + legal = (ctx->Extensions.EXT_texture_env_dot3 && + pname == GL_COMBINE_RGB); + break; + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + legal = (ctx->Extensions.ARB_texture_env_dot3 && + pname == GL_COMBINE_RGB); + break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + legal =ctx->Extensions.ATI_texture_env_combine3; + break; + default: + legal = GL_FALSE; + } + + if (!legal) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + + switch (pname) { + case GL_COMBINE_RGB: + if (texUnit->Combine.ModeRGB == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ModeRGB = mode; + break; + + case GL_COMBINE_ALPHA: + if (texUnit->Combine.ModeA == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ModeA = mode; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + } +} + + + +/** Set an RGB or A combiner source term */ +static void +set_combiner_source(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLenum param) +{ + GLuint src; + GLboolean alpha, legal; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + /* + * Translate pname to (src, alpha). + */ + switch (pname) { + case GL_SOURCE0_RGB: + src = 0; + alpha = GL_FALSE; + break; + case GL_SOURCE1_RGB: + src = 1; + alpha = GL_FALSE; + break; + case GL_SOURCE2_RGB: + src = 2; + alpha = GL_FALSE; + break; + case GL_SOURCE3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + src = 3; + alpha = GL_FALSE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_SOURCE0_ALPHA: + src = 0; + alpha = GL_TRUE; + break; + case GL_SOURCE1_ALPHA: + src = 1; + alpha = GL_TRUE; + break; + case GL_SOURCE2_ALPHA: + src = 2; + alpha = GL_TRUE; + break; + case GL_SOURCE3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + src = 3; + alpha = GL_TRUE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + + assert(src < 4); + + /* + * Error-check param (the source term) + */ + switch (param) { + case GL_TEXTURE: + case GL_CONSTANT: + case GL_PRIMARY_COLOR: + case GL_PREVIOUS: + legal = GL_TRUE; + break; + case GL_TEXTURE0: + case GL_TEXTURE1: + case GL_TEXTURE2: + case GL_TEXTURE3: + case GL_TEXTURE4: + case GL_TEXTURE5: + case GL_TEXTURE6: + case GL_TEXTURE7: + legal = (ctx->Extensions.ARB_texture_env_crossbar && + param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits); + break; + case GL_ZERO: + legal = (ctx->Extensions.ATI_texture_env_combine3 || + ctx->Extensions.NV_texture_env_combine4); + break; + case GL_ONE: + legal = ctx->Extensions.ATI_texture_env_combine3; + break; + default: + legal = GL_FALSE; + } + + if (!legal) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param); + return; + } + + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + + if (alpha) + texUnit->Combine.SourceA[src] = param; + else + texUnit->Combine.SourceRGB[src] = param; +} + + +/** Set an RGB or A combiner operand term */ +static void +set_combiner_operand(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLenum param) +{ + GLuint op; + GLboolean alpha, legal; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + switch (pname) { + case GL_OPERAND0_RGB: + op = 0; + alpha = GL_FALSE; + break; + case GL_OPERAND1_RGB: + op = 1; + alpha = GL_FALSE; + break; + case GL_OPERAND2_RGB: + if (ctx->Extensions.ARB_texture_env_combine) { + op = 2; + alpha = GL_FALSE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + op = 3; + alpha = GL_FALSE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND0_ALPHA: + op = 0; + alpha = GL_TRUE; + break; + case GL_OPERAND1_ALPHA: + op = 1; + alpha = GL_TRUE; + break; + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.ARB_texture_env_combine) { + op = 2; + alpha = GL_TRUE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + case GL_OPERAND3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + op = 3; + alpha = GL_TRUE; + } + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + return; + } + + assert(op < 4); + + /* + * Error-check param (the source operand) + */ + switch (param) { + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + legal = !alpha; + break; + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + legal = GL_TRUE; + break; + default: + legal = GL_FALSE; + } + + if (!legal) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", param); + return; + } + + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + + if (alpha) + texUnit->Combine.OperandA[op] = param; + else + texUnit->Combine.OperandRGB[op] = param; +} + + +static void +set_combiner_scale(GLcontext *ctx, + struct gl_texture_unit *texUnit, + GLenum pname, GLfloat scale) +{ + GLuint shift; + + if (!ctx->Extensions.EXT_texture_env_combine && + !ctx->Extensions.ARB_texture_env_combine) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); + return; + } + + if (scale == 1.0F) { + shift = 0; + } + else if (scale == 2.0F) { + shift = 1; + } + else if (scale == 4.0F) { + shift = 2; + } + else { + _mesa_error( ctx, GL_INVALID_VALUE, + "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); + return; + } + + switch (pname) { + case GL_RGB_SCALE: + if (texUnit->Combine.ScaleShiftRGB == shift) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ScaleShiftRGB = shift; + break; + case GL_ALPHA_SCALE: + if (texUnit->Combine.ScaleShiftA == shift) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Combine.ScaleShiftA = shift; + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); + } +} @@ -55,377 +464,41 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; -#define TE_ERROR(errCode, msg, value) \ - _mesa_error(ctx, errCode, msg, _mesa_lookup_enum_by_nr(value)); - if (target == GL_TEXTURE_ENV) { switch (pname) { case GL_TEXTURE_ENV_MODE: - { - GLenum mode = (GLenum) (GLint) *param; - if (mode == GL_REPLACE_EXT) - mode = GL_REPLACE; - if (texUnit->EnvMode == mode) - return; - if (mode == GL_MODULATE || - mode == GL_BLEND || - mode == GL_DECAL || - mode == GL_REPLACE || - (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || - (mode == GL_COMBINE && - (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->EnvMode = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - } + set_env_mode(ctx, texUnit, (GLenum) (GLint) param[0]); break; case GL_TEXTURE_ENV_COLOR: - { - GLfloat tmp[4]; - tmp[0] = CLAMP( param[0], 0.0F, 1.0F ); - tmp[1] = CLAMP( param[1], 0.0F, 1.0F ); - tmp[2] = CLAMP( param[2], 0.0F, 1.0F ); - tmp[3] = CLAMP( param[3], 0.0F, 1.0F ); - if (TEST_EQ_4V(tmp, texUnit->EnvColor)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EnvColor, tmp); - } + set_env_color(ctx, texUnit, param); break; case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeRGB == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - if (!ctx->Extensions.EXT_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - if (!ctx->Extensions.ARB_texture_env_dot3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeRGB = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum mode = (GLenum) (GLint) *param; - if (texUnit->Combine.ModeA == mode) - return; - switch (mode) { - case GL_REPLACE: - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_INTERPOLATE: - /* OK */ - break; - case GL_SUBTRACT: - if (!ctx->Extensions.ARB_texture_env_combine) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - if (!ctx->Extensions.ATI_texture_env_combine3) { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ModeA = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + set_combiner_mode(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_SOURCE0_RGB: case GL_SOURCE1_RGB: case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_RGB; - if (texUnit->Combine.SourceRGB[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceRGB[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; + case GL_SOURCE3_RGB_NV: case GL_SOURCE0_ALPHA: case GL_SOURCE1_ALPHA: case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_ALPHA; - if (texUnit->Combine.SourceA[s] == source) - return; - if (source == GL_TEXTURE || - source == GL_CONSTANT || - source == GL_PRIMARY_COLOR || - source == GL_PREVIOUS || - (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0 && - source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || - (ctx->Extensions.ATI_texture_env_combine3 && - (source == GL_ZERO || source == GL_ONE))) { - /* legal */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.SourceA[s] = source; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", source); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + case GL_SOURCE3_ALPHA_NV: + set_combiner_source(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_OPERAND0_RGB: case GL_OPERAND1_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - const GLuint s = pname - GL_OPERAND0_RGB; - if (texUnit->Combine.OperandRGB[s] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[s] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; + case GL_OPERAND2_RGB: + case GL_OPERAND3_RGB_NV: case GL_OPERAND0_ALPHA: case GL_OPERAND1_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[pname-GL_OPERAND0_ALPHA] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; - case GL_OPERAND2_RGB: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - switch (operand) { - case GL_SRC_COLOR: /* ARB combine only */ - case GL_ONE_MINUS_SRC_COLOR: /* ARB combine only */ - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandRGB[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandRGB[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_OPERAND2_ALPHA: - if (ctx->Extensions.ARB_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - switch (operand) { - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: /* ARB combine only */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.OperandA[2] = operand; - break; - default: - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else if (ctx->Extensions.EXT_texture_env_combine) { - const GLenum operand = (GLenum) (GLint) *param; - if (texUnit->Combine.OperandA[2] == operand) - return; - /* operand must be GL_SRC_ALPHA which is the initial value - thus - don't need to actually compare the operand to the possible value */ - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); - return; - } - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + case GL_OPERAND3_ALPHA_NV: + set_combiner_operand(ctx, texUnit, pname, (GLenum) (GLint) param[0]); break; case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_RGB_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftRGB == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftRGB = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } - break; case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - GLuint newshift; - if (*param == 1.0) { - newshift = 0; - } - else if (*param == 2.0) { - newshift = 1; - } - else if (*param == 4.0) { - newshift = 2; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, - "glTexEnv(GL_ALPHA_SCALE not 1, 2 or 4)" ); - return; - } - if (texUnit->Combine.ScaleShiftA == newshift) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Combine.ScaleShiftA = newshift; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); - return; - } + set_combiner_scale(ctx, texUnit, pname, param[0]); break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname)" ); @@ -533,6 +606,144 @@ _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) } + +/** + * Helper for glGetTexEnvi/f() + * \return value of queried pname or -1 if error. + */ +static GLint +get_texenvi(GLcontext *ctx, const struct gl_texture_unit *texUnit, + GLenum pname) +{ + switch (pname) { + case GL_TEXTURE_ENV_MODE: + return texUnit->EnvMode; + break; + case GL_COMBINE_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return texUnit->Combine.ModeRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_COMBINE_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return texUnit->Combine.ModeA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned rgb_idx = pname - GL_SOURCE0_RGB; + return texUnit->Combine.SourceRGB[rgb_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.SourceRGB[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; + return texUnit->Combine.SourceA[alpha_idx]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_SOURCE3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.SourceA[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: + case GL_OPERAND2_RGB: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_rgb = pname - GL_OPERAND0_RGB; + return texUnit->Combine.OperandRGB[op_rgb]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND3_RGB_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.OperandRGB[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: + case GL_OPERAND2_ALPHA: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; + return texUnit->Combine.OperandA[op_alpha]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_OPERAND3_ALPHA_NV: + if (ctx->Extensions.NV_texture_env_combine4) { + return texUnit->Combine.OperandA[3]; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_RGB_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return 1 << texUnit->Combine.ScaleShiftRGB; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + case GL_ALPHA_SCALE: + if (ctx->Extensions.EXT_texture_env_combine || + ctx->Extensions.ARB_texture_env_combine) { + return 1 << texUnit->Combine.ScaleShiftA; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); + } + break; + default: + ; + } + + return -1; /* error */ +} + + + void GLAPIENTRY _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) { @@ -551,111 +762,14 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = ENUM_TO_FLOAT(texUnit->EnvMode); - break; - case GL_TEXTURE_ENV_COLOR: - COPY_4FV( params, texUnit->EnvColor ); - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLfloat) texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - *params = (GLfloat) texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - *params = (GLfloat) texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - *params = (GLfloat) texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - *params = (GLfloat) texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftRGB == 0) - *params = 1.0; - else if (texUnit->Combine.ScaleShiftRGB == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftA == 0) - *params = 1.0; - else if (texUnit->Combine.ScaleShiftA == 1) - *params = 2.0; - else - *params = 4.0; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname=0x%x)", pname); + if (pname == GL_TEXTURE_ENV_COLOR) { + COPY_4FV( params, texUnit->EnvColor ); + } + else { + GLint val = get_texenvi(ctx, texUnit, pname); + if (val >= 0) { + *params = (GLfloat) val; + } } } else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { @@ -712,115 +826,17 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; if (target == GL_TEXTURE_ENV) { - switch (pname) { - case GL_TEXTURE_ENV_MODE: - *params = (GLint) texUnit->EnvMode; - break; - case GL_TEXTURE_ENV_COLOR: - params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); - params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); - params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); - params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); - break; - case GL_COMBINE_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.ModeRGB; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_COMBINE_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - *params = (GLint) texUnit->Combine.ModeA; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_RGB: - case GL_SOURCE1_RGB: - case GL_SOURCE2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned rgb_idx = pname - GL_SOURCE0_RGB; - *params = (GLint) texUnit->Combine.SourceRGB[rgb_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_SOURCE0_ALPHA: - case GL_SOURCE1_ALPHA: - case GL_SOURCE2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned alpha_idx = pname - GL_SOURCE0_ALPHA; - *params = (GLint) texUnit->Combine.SourceA[alpha_idx]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_RGB: - case GL_OPERAND1_RGB: - case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_rgb = pname - GL_OPERAND0_RGB; - *params = (GLint) texUnit->Combine.OperandRGB[op_rgb]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_OPERAND0_ALPHA: - case GL_OPERAND1_ALPHA: - case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - const unsigned op_alpha = pname - GL_OPERAND0_ALPHA; - *params = (GLint) texUnit->Combine.OperandA[op_alpha]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - } - break; - case GL_RGB_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftRGB == 0) - *params = 1; - else if (texUnit->Combine.ScaleShiftRGB == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - case GL_ALPHA_SCALE: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { - if (texUnit->Combine.ScaleShiftA == 0) - *params = 1; - else if (texUnit->Combine.ScaleShiftA == 1) - *params = 2; - else - *params = 4; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); - return; - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname=0x%x)", - pname); + if (pname == GL_TEXTURE_ENV_COLOR) { + params[0] = FLOAT_TO_INT( texUnit->EnvColor[0] ); + params[1] = FLOAT_TO_INT( texUnit->EnvColor[1] ); + params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); + params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); + } + else { + GLint val = get_texenvi(ctx, texUnit, pname); + if (val >= 0) { + *params = val; + } } } else if (target == GL_TEXTURE_FILTER_CONTROL_EXT) { diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 64b2ab6c13..d2a9e35dd5 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -2,6 +2,7 @@ * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. + * Copyright 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -28,6 +29,7 @@ #include "glheader.h" #include "macros.h" #include "enums.h" +#include "shader/program.h" #include "shader/prog_parameter.h" #include "shader/prog_cache.h" #include "shader/prog_instruction.h" @@ -36,16 +38,44 @@ #include "shader/programopt.h" #include "texenvprogram.h" + +#define MAX_TERMS 4 + + +/* + * Note on texture units: + * + * The number of texture units supported by fixed-function fragment + * processing is MAX_TEXTURE_COORD_UNITS, not MAX_TEXTURE_IMAGE_UNITS. + * That's because there's a one-to-one correspondence between texture + * coordinates and samplers in fixed-function processing. + * + * Since fixed-function vertex processing is limited to MAX_TEXTURE_COORD_UNITS + * sets of texcoords, so is fixed-function fragment processing. + * + * We can safely use ctx->Const.MaxTextureUnits for loop bounds. + */ + + +struct texenvprog_cache_item +{ + GLuint hash; + void *key; + struct gl_fragment_program *data; + struct texenvprog_cache_item *next; +}; + + /** * Up to nine instructions per tex unit, plus fog, specular color. */ -#define MAX_INSTRUCTIONS ((MAX_TEXTURE_UNITS * 9) + 12) +#define MAX_INSTRUCTIONS ((MAX_TEXTURE_COORD_UNITS * 9) + 12) #define DISASSEM (MESA_VERBOSE & VERBOSE_DISASSEM) struct mode_opt { - GLubyte Source:4; - GLubyte Operand:3; + GLuint Source:4; + GLuint Operand:3; }; struct state_key { @@ -59,16 +89,17 @@ struct state_key { struct { GLuint enabled:1; GLuint source_index:3; /* one of TEXTURE_1D/2D/3D/CUBE/RECT_INDEX */ + GLuint shadow:1; GLuint ScaleShiftRGB:2; GLuint ScaleShiftA:2; - GLuint NumArgsRGB:2; + GLuint NumArgsRGB:3; GLuint ModeRGB:4; - GLuint NumArgsA:2; - GLuint ModeA:4; + struct mode_opt OptRGB[MAX_TERMS]; - struct mode_opt OptRGB[3]; - struct mode_opt OptA[3]; + GLuint NumArgsA:3; + GLuint ModeA:4; + struct mode_opt OptA[MAX_TERMS]; } unit[8]; }; @@ -104,7 +135,9 @@ static GLuint translate_operand( GLenum operand ) case GL_ONE_MINUS_SRC_ALPHA: return OPR_ONE_MINUS_SRC_ALPHA; case GL_ZERO: return OPR_ZERO; case GL_ONE: return OPR_ONE; - default: return OPR_UNKNOWN; + default: + assert(0); + return OPR_UNKNOWN; } } @@ -120,6 +153,7 @@ static GLuint translate_operand( GLenum operand ) #define SRC_CONSTANT 9 #define SRC_PRIMARY_COLOR 10 #define SRC_PREVIOUS 11 +#define SRC_ZERO 12 #define SRC_UNKNOWN 15 static GLuint translate_source( GLenum src ) @@ -137,32 +171,49 @@ static GLuint translate_source( GLenum src ) case GL_CONSTANT: return SRC_CONSTANT; case GL_PRIMARY_COLOR: return SRC_PRIMARY_COLOR; case GL_PREVIOUS: return SRC_PREVIOUS; - default: return SRC_UNKNOWN; + case GL_ZERO: + return SRC_ZERO; + default: + assert(0); + return SRC_UNKNOWN; } } -#define MODE_REPLACE 0 -#define MODE_MODULATE 1 -#define MODE_ADD 2 -#define MODE_ADD_SIGNED 3 -#define MODE_INTERPOLATE 4 -#define MODE_SUBTRACT 5 -#define MODE_DOT3_RGB 6 -#define MODE_DOT3_RGB_EXT 7 -#define MODE_DOT3_RGBA 8 -#define MODE_DOT3_RGBA_EXT 9 -#define MODE_MODULATE_ADD_ATI 10 -#define MODE_MODULATE_SIGNED_ADD_ATI 11 -#define MODE_MODULATE_SUBTRACT_ATI 12 -#define MODE_UNKNOWN 15 - -static GLuint translate_mode( GLenum mode ) +#define MODE_REPLACE 0 /* r = a0 */ +#define MODE_MODULATE 1 /* r = a0 * a1 */ +#define MODE_ADD 2 /* r = a0 + a1 */ +#define MODE_ADD_SIGNED 3 /* r = a0 + a1 - 0.5 */ +#define MODE_INTERPOLATE 4 /* r = a0 * a2 + a1 * (1 - a2) */ +#define MODE_SUBTRACT 5 /* r = a0 - a1 */ +#define MODE_DOT3_RGB 6 /* r = a0 . a1 */ +#define MODE_DOT3_RGB_EXT 7 /* r = a0 . a1 */ +#define MODE_DOT3_RGBA 8 /* r = a0 . a1 */ +#define MODE_DOT3_RGBA_EXT 9 /* r = a0 . a1 */ +#define MODE_MODULATE_ADD_ATI 10 /* r = a0 * a2 + a1 */ +#define MODE_MODULATE_SIGNED_ADD_ATI 11 /* r = a0 * a2 + a1 - 0.5 */ +#define MODE_MODULATE_SUBTRACT_ATI 12 /* r = a0 * a2 - a1 */ +#define MODE_ADD_PRODUCTS 13 /* r = a0 * a1 + a2 * a3 */ +#define MODE_ADD_PRODUCTS_SIGNED 14 /* r = a0 * a1 + a2 * a3 - 0.5 */ +#define MODE_UNKNOWN 15 + +/** + * Translate GL combiner state into a MODE_x value + */ +static GLuint translate_mode( GLenum envMode, GLenum mode ) { switch (mode) { case GL_REPLACE: return MODE_REPLACE; case GL_MODULATE: return MODE_MODULATE; - case GL_ADD: return MODE_ADD; - case GL_ADD_SIGNED: return MODE_ADD_SIGNED; + case GL_ADD: + if (envMode == GL_COMBINE4_NV) + return MODE_ADD_PRODUCTS; + else + return MODE_ADD; + case GL_ADD_SIGNED: + if (envMode == GL_COMBINE4_NV) + return MODE_ADD_PRODUCTS_SIGNED; + else + return MODE_ADD_SIGNED; case GL_INTERPOLATE: return MODE_INTERPOLATE; case GL_SUBTRACT: return MODE_SUBTRACT; case GL_DOT3_RGB: return MODE_DOT3_RGB; @@ -172,7 +223,9 @@ static GLuint translate_mode( GLenum mode ) case GL_MODULATE_ADD_ATI: return MODE_MODULATE_ADD_ATI; case GL_MODULATE_SIGNED_ADD_ATI: return MODE_MODULATE_SIGNED_ADD_ATI; case GL_MODULATE_SUBTRACT_ATI: return MODE_MODULATE_SUBTRACT_ATI; - default: return MODE_UNKNOWN; + default: + assert(0); + return MODE_UNKNOWN; } } @@ -182,14 +235,16 @@ static GLuint translate_tex_src_bit( GLbitfield bit ) /* make sure number of switch cases is correct */ assert(NUM_TEXTURE_TARGETS == 7); switch (bit) { - case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX; - case TEXTURE_2D_BIT: return TEXTURE_2D_INDEX; - case TEXTURE_3D_BIT: return TEXTURE_3D_INDEX; - case TEXTURE_CUBE_BIT: return TEXTURE_CUBE_INDEX; - case TEXTURE_RECT_BIT: return TEXTURE_RECT_INDEX; - case TEXTURE_1D_ARRAY_BIT: return TEXTURE_1D_ARRAY_INDEX; - case TEXTURE_2D_ARRAY_BIT: return TEXTURE_2D_ARRAY_INDEX; - default: return TEXTURE_UNKNOWN_INDEX; + case TEXTURE_1D_BIT: return TEXTURE_1D_INDEX; + case TEXTURE_2D_BIT: return TEXTURE_2D_INDEX; + case TEXTURE_RECT_BIT: return TEXTURE_RECT_INDEX; + case TEXTURE_3D_BIT: return TEXTURE_3D_INDEX; + case TEXTURE_CUBE_BIT: return TEXTURE_CUBE_INDEX; + case TEXTURE_1D_ARRAY_BIT: return TEXTURE_1D_ARRAY_INDEX; + case TEXTURE_2D_ARRAY_BIT: return TEXTURE_2D_ARRAY_INDEX; + default: + assert(0); + return TEXTURE_UNKNOWN_INDEX; } } @@ -301,12 +356,15 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) memset(key, 0, sizeof(*key)); - for (i=0;i<MAX_TEXTURE_UNITS;i++) { + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; - - if (!texUnit->_ReallyEnabled) + GLenum format; + + if (!texUnit->_ReallyEnabled || !texUnit->Enabled) continue; + format = texUnit->_Current->Image[0][texUnit->_Current->BaseLevel]->_BaseFormat; + key->unit[i].enabled = 1; key->enabled_units |= (1<<i); key->nr_enabled_units = i+1; @@ -314,19 +372,22 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) key->unit[i].source_index = translate_tex_src_bit(texUnit->_ReallyEnabled); + key->unit[i].shadow = ((texUnit->_Current->CompareMode == GL_COMPARE_R_TO_TEXTURE) && + ((format == GL_DEPTH_COMPONENT) || + (format == GL_DEPTH_STENCIL_EXT))); key->unit[i].NumArgsRGB = texUnit->_CurrentCombine->_NumArgsRGB; key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA; key->unit[i].ModeRGB = - translate_mode(texUnit->_CurrentCombine->ModeRGB); + translate_mode(texUnit->EnvMode, texUnit->_CurrentCombine->ModeRGB); key->unit[i].ModeA = - translate_mode(texUnit->_CurrentCombine->ModeA); + translate_mode(texUnit->EnvMode, texUnit->_CurrentCombine->ModeA); key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB; key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA; - for (j=0;j<3;j++) { + for (j = 0; j < MAX_TERMS; j++) { key->unit[i].OptRGB[j].Operand = translate_operand(texUnit->_CurrentCombine->OperandRGB[j]); key->unit[i].OptA[j].Operand = @@ -398,7 +459,7 @@ struct texenv_fragment_program { GLbitfield temp_in_use; /**< Tracks temporary regs which are in use. */ GLboolean error; - struct ureg src_texture[MAX_TEXTURE_UNITS]; + struct ureg src_texture[MAX_TEXTURE_COORD_UNITS]; /* Reg containing each texture unit's sampled texture color, * else undef. */ @@ -615,7 +676,7 @@ emit_op(struct texenv_fragment_program *p, { GLuint nr = p->program->Base.NumInstructions++; struct prog_instruction *inst = &p->program->Base.Instructions[nr]; - + assert(nr < MAX_INSTRUCTIONS); _mesa_init_instructions(inst, 1); @@ -675,6 +736,7 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, GLuint destmask, GLuint tex_unit, GLuint tex_idx, + GLuint tex_shadow, struct ureg coord ) { struct prog_instruction *inst = emit_op( p, op, @@ -686,6 +748,7 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, inst->TexSrcTarget = tex_idx; inst->TexSrcUnit = tex_unit; + inst->TexShadow = tex_shadow; p->program->Base.NumTexInstructions++; @@ -788,12 +851,17 @@ static struct ureg get_source( struct texenv_fragment_program *p, case SRC_PRIMARY_COLOR: return register_input(p, FRAG_ATTRIB_COL0); + case SRC_ZERO: + return get_zero(p); + case SRC_PREVIOUS: - default: if (is_undef(p->src_previous)) return register_input(p, FRAG_ATTRIB_COL0); else return p->src_previous; + + default: + assert(0); } } @@ -834,7 +902,9 @@ static struct ureg emit_combine_source( struct texenv_fragment_program *p, case OPR_ONE: return get_one(p); case OPR_SRC_COLOR: + return src; default: + assert(0); return src; } } @@ -883,10 +953,12 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, GLuint mode, const struct mode_opt *opt) { - struct ureg src[3]; + struct ureg src[MAX_TERMS]; struct ureg tmp, half; GLuint i; + assert(nr <= MAX_TERMS); + tmp = undef; /* silence warning (bug 5318) */ for (i = 0; i < nr; i++) @@ -962,7 +1034,26 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, /* Arg0 * Arg2 - Arg1 */ emit_arith( p, OPCODE_MAD, dest, mask, 0, src[0], src[2], negate(src[1]) ); return dest; + case MODE_ADD_PRODUCTS: + /* Arg0 * Arg1 + Arg2 * Arg3 */ + { + struct ureg tmp0 = get_temp(p); + emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef ); + emit_arith( p, OPCODE_MAD, dest, mask, saturate, src[2], src[3], tmp0 ); + } + return dest; + case MODE_ADD_PRODUCTS_SIGNED: + /* Arg0 * Arg1 + Arg2 * Arg3 - 0.5 */ + { + struct ureg tmp0 = get_temp(p); + half = get_half(p); + emit_arith( p, OPCODE_MUL, tmp0, mask, 0, src[0], src[1], undef ); + emit_arith( p, OPCODE_MAD, tmp0, mask, 0, src[2], src[3], tmp0 ); + emit_arith( p, OPCODE_SUB, dest, mask, saturate, tmp0, half, undef ); + } + return dest; default: + assert(0); return src[0]; } } @@ -1071,19 +1162,28 @@ emit_texenv(struct texenv_fragment_program *p, GLuint unit) static void load_texture( struct texenv_fragment_program *p, GLuint unit ) { if (is_undef(p->src_texture[unit])) { - GLuint dim = p->state->unit[unit].source_index; + GLuint texTarget = p->state->unit[unit].source_index; struct ureg texcoord = register_input(p, FRAG_ATTRIB_TEX0+unit); struct ureg tmp = get_tex_temp( p ); - if (dim == TEXTURE_UNKNOWN_INDEX) + if (texTarget == TEXTURE_UNKNOWN_INDEX) program_error(p, "TexSrcBit"); /* TODO: Use D0_MASK_XY where possible. */ if (p->state->unit[unit].enabled) { + GLboolean shadow = GL_FALSE; + + if (p->state->unit[unit].shadow) { + p->program->Base.ShadowSamplers |= 1 << unit; + shadow = GL_TRUE; + } + p->src_texture[unit] = emit_texld( p, OPCODE_TXP, tmp, WRITEMASK_XYZW, - unit, dim, texcoord ); + unit, texTarget, shadow, + texcoord ); + p->program->Base.SamplersUsed |= (1 << unit); /* This identity mapping should already be in place * (see _mesa_init_program_struct()) but let's be safe. @@ -1115,6 +1215,7 @@ static GLboolean load_texenv_source( struct texenv_fragment_program *p, break; default: + /* not a texture src - do nothing */ break; } @@ -1179,7 +1280,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, p.program->Base.InputsRead = 0; p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLR; - for (unit = 0; unit < MAX_TEXTURE_UNITS; unit++) + for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) p.src_texture[unit] = undef; p.src_previous = undef; @@ -1311,36 +1412,3 @@ _mesa_get_fixed_func_fragment_program(GLcontext *ctx) return prog; } - - - -/** - * If _MaintainTexEnvProgram is set we'll generate a fragment program that - * implements the current texture env/combine mode. - * This function generates that program and puts it into effect. - */ -void -_mesa_UpdateTexEnvProgram( GLcontext *ctx ) -{ - const struct gl_fragment_program *prev = ctx->FragmentProgram._Current; - - ASSERT(ctx->FragmentProgram._MaintainTexEnvProgram); - - /* If a conventional fragment program/shader isn't in effect... */ - if (!ctx->FragmentProgram._Enabled && - (!ctx->Shader.CurrentProgram || - !ctx->Shader.CurrentProgram->FragmentProgram) ) { - - ctx->FragmentProgram._Current - = ctx->FragmentProgram._TexEnvProgram - = _mesa_get_fixed_func_fragment_program(ctx); - } - - /* Tell the driver about the change. Could define a new target for - * this? - */ - if (ctx->FragmentProgram._Current != prev && ctx->Driver.BindProgram) { - ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - (struct gl_program *) ctx->FragmentProgram._Current); - } -} diff --git a/src/mesa/main/texenvprogram.h b/src/mesa/main/texenvprogram.h index a7aa60cf37..0a162d2e7a 100644 --- a/src/mesa/main/texenvprogram.h +++ b/src/mesa/main/texenvprogram.h @@ -32,6 +32,4 @@ extern struct gl_fragment_program * _mesa_get_fixed_func_fragment_program(GLcontext *ctx); -extern void _mesa_UpdateTexEnvProgram( GLcontext *ctx ); - #endif diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 60f36c4a87..16d05cc7d0 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -333,6 +334,30 @@ const struct gl_texture_format _mesa_texformat_srgba8 = { store_texel_srgba8 /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_sargb8 = { + MESA_FORMAT_SARGB8, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 8, /* RedBits */ + 8, /* GreenBits */ + 8, /* BlueBits */ + 8, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 4, /* TexelBytes */ + _mesa_texstore_sargb8, /* StoreTexImageFunc */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_sargb8, /* FetchTexel1Df */ + fetch_texel_2d_sargb8, /* FetchTexel2Df */ + fetch_texel_3d_sargb8, /* FetchTexel3Df */ + store_texel_sargb8 /* StoreTexel */ +}; + const struct gl_texture_format _mesa_texformat_sl8 = { MESA_FORMAT_SL8, /* MesaFormat */ GL_LUMINANCE, /* BaseFormat */ @@ -871,6 +896,30 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { store_texel_rgb565_rev /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_rgba4444 = { + MESA_FORMAT_RGBA4444, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 4, /* RedBits */ + 4, /* GreenBits */ + 4, /* BlueBits */ + 4, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 2, /* TexelBytes */ + _mesa_texstore_rgba4444, /* StoreTexImageFunc */ + fetch_texel_1d_rgba4444, /* FetchTexel1D */ + fetch_texel_2d_rgba4444, /* FetchTexel2D */ + fetch_texel_3d_rgba4444, /* FetchTexel3D */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ + store_texel_rgba4444 /* StoreTexel */ +}; + const struct gl_texture_format _mesa_texformat_argb4444 = { MESA_FORMAT_ARGB4444, /* MesaFormat */ GL_RGBA, /* BaseFormat */ @@ -919,6 +968,30 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { store_texel_argb4444_rev /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_rgba5551 = { + MESA_FORMAT_RGBA5551, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + 5, /* RedBits */ + 5, /* GreenBits */ + 5, /* BlueBits */ + 1, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 2, /* TexelBytes */ + _mesa_texstore_rgba5551, /* StoreTexImageFunc */ + fetch_texel_1d_rgba5551, /* FetchTexel1D */ + fetch_texel_2d_rgba5551, /* FetchTexel2D */ + fetch_texel_3d_rgba5551, /* FetchTexel3D */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ + store_texel_rgba5551 /* StoreTexel */ +}; + const struct gl_texture_format _mesa_texformat_argb1555 = { MESA_FORMAT_ARGB1555, /* MesaFormat */ GL_RGBA, /* BaseFormat */ @@ -1420,55 +1493,52 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ; /* fallthrough */ } - if (ctx->Extensions.SGIX_depth_texture || - ctx->Extensions.ARB_depth_texture) { + if (ctx->Extensions.ARB_depth_texture) { switch (internalFormat) { case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT24_SGIX: - case GL_DEPTH_COMPONENT32_SGIX: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: return &_mesa_texformat_z32; - case GL_DEPTH_COMPONENT16_SGIX: + case GL_DEPTH_COMPONENT16: return &_mesa_texformat_z16; default: ; /* fallthrough */ } } - if (ctx->Extensions.ARB_texture_compression) { - switch (internalFormat) { - case GL_COMPRESSED_ALPHA_ARB: - return &_mesa_texformat_alpha; - case GL_COMPRESSED_LUMINANCE_ARB: - return &_mesa_texformat_luminance; - case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return &_mesa_texformat_luminance_alpha; - case GL_COMPRESSED_INTENSITY_ARB: - return &_mesa_texformat_intensity; - case GL_COMPRESSED_RGB_ARB: + switch (internalFormat) { + case GL_COMPRESSED_ALPHA_ARB: + return &_mesa_texformat_alpha; + case GL_COMPRESSED_LUMINANCE_ARB: + return &_mesa_texformat_luminance; + case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: + return &_mesa_texformat_luminance_alpha; + case GL_COMPRESSED_INTENSITY_ARB: + return &_mesa_texformat_intensity; + case GL_COMPRESSED_RGB_ARB: #if FEATURE_texture_fxt1 - if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgb_fxt1; + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgb_fxt1; #endif #if FEATURE_texture_s3tc - if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgb_dxt1; + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) + return &_mesa_texformat_rgb_dxt1; #endif - return &_mesa_texformat_rgb; - case GL_COMPRESSED_RGBA_ARB: + return &_mesa_texformat_rgb; + case GL_COMPRESSED_RGBA_ARB: #if FEATURE_texture_fxt1 - if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgba_fxt1; + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgba_fxt1; #endif #if FEATURE_texture_s3tc - if (ctx->Extensions.EXT_texture_compression_s3tc || - ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ + if (ctx->Extensions.EXT_texture_compression_s3tc || + ctx->Extensions.S3_s3tc) + return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ #endif - return &_mesa_texformat_rgba; - default: - ; /* fallthrough */ - } + return &_mesa_texformat_rgba; + default: + ; /* fallthrough */ } if (ctx->Extensions.MESA_ycbcr_texture) { @@ -1579,21 +1649,40 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: return &_mesa_texformat_sla8; - /* NOTE: not supporting any compression of sRGB at this time */ - case GL_COMPRESSED_SRGB_EXT: - return &_mesa_texformat_srgb8; - case GL_COMPRESSED_SRGB_ALPHA_EXT: - return &_mesa_texformat_srgba8; case GL_COMPRESSED_SLUMINANCE_EXT: return &_mesa_texformat_sl8; case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: return &_mesa_texformat_sla8; - case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_SRGB_EXT: +#if FEATURE_texture_s3tc + if (ctx->Extensions.EXT_texture_compression_s3tc) + return &_mesa_texformat_srgb_dxt1; +#endif return &_mesa_texformat_srgb8; + case GL_COMPRESSED_SRGB_ALPHA_EXT: +#if FEATURE_texture_s3tc + if (ctx->Extensions.EXT_texture_compression_s3tc) + return &_mesa_texformat_srgba_dxt3; /* Not srgba_dxt1, see spec */ +#endif + return &_mesa_texformat_srgba8; +#if FEATURE_texture_s3tc + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: + if (ctx->Extensions.EXT_texture_compression_s3tc) + return &_mesa_texformat_srgb_dxt1; + break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: + if (ctx->Extensions.EXT_texture_compression_s3tc) + return &_mesa_texformat_srgba_dxt1; + break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: + if (ctx->Extensions.EXT_texture_compression_s3tc) + return &_mesa_texformat_srgba_dxt3; + break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return &_mesa_texformat_srgba8; + if (ctx->Extensions.EXT_texture_compression_s3tc) + return &_mesa_texformat_srgba_dxt5; + break; +#endif default: ; /* fallthrough */ } @@ -1642,7 +1731,7 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format, case MESA_FORMAT_ARGB1555: case MESA_FORMAT_ARGB1555_REV: *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; - *comps = 3; + *comps = 4; return; case MESA_FORMAT_AL88: @@ -1695,6 +1784,7 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format, *comps = 3; return; case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; @@ -1717,6 +1807,12 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format, case MESA_FORMAT_RGBA_DXT1: case MESA_FORMAT_RGBA_DXT3: case MESA_FORMAT_RGBA_DXT5: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: +#endif /* XXX generate error instead? */ *datatype = GL_UNSIGNED_BYTE; *comps = 0; diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 3b6d05612d..31364c36b1 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -70,8 +71,10 @@ enum _format { MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ + MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ + MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ @@ -96,8 +99,15 @@ enum _format { /*@{*/ MESA_FORMAT_SRGB8, MESA_FORMAT_SRGBA8, + MESA_FORMAT_SARGB8, MESA_FORMAT_SL8, MESA_FORMAT_SLA8, +#if FEATURE_texture_s3tc + MESA_FORMAT_SRGB_DXT1, + MESA_FORMAT_SRGBA_DXT1, + MESA_FORMAT_SRGBA_DXT3, + MESA_FORMAT_SRGBA_DXT5, +#endif /*@}*/ #endif @@ -171,8 +181,15 @@ extern const struct gl_texture_format _mesa_texformat_intensity; /*@{*/ extern const struct gl_texture_format _mesa_texformat_srgb8; extern const struct gl_texture_format _mesa_texformat_srgba8; +extern const struct gl_texture_format _mesa_texformat_sargb8; extern const struct gl_texture_format _mesa_texformat_sl8; extern const struct gl_texture_format _mesa_texformat_sla8; +#if FEATURE_texture_s3tc +extern const struct gl_texture_format _mesa_texformat_srgb_dxt1; +extern const struct gl_texture_format _mesa_texformat_srgba_dxt1; +extern const struct gl_texture_format _mesa_texformat_srgba_dxt3; +extern const struct gl_texture_format _mesa_texformat_srgba_dxt5; +#endif /*@}*/ #endif @@ -202,10 +219,12 @@ extern const struct gl_texture_format _mesa_texformat_rgb888; extern const struct gl_texture_format _mesa_texformat_bgr888; extern const struct gl_texture_format _mesa_texformat_rgb565; extern const struct gl_texture_format _mesa_texformat_rgb565_rev; +extern const struct gl_texture_format _mesa_texformat_rgba4444; extern const struct gl_texture_format _mesa_texformat_argb4444; extern const struct gl_texture_format _mesa_texformat_argb4444_rev; extern const struct gl_texture_format _mesa_texformat_argb1555; extern const struct gl_texture_format _mesa_texformat_argb1555_rev; +extern const struct gl_texture_format _mesa_texformat_rgba5551; extern const struct gl_texture_format _mesa_texformat_al88; extern const struct gl_texture_format _mesa_texformat_al88_rev; extern const struct gl_texture_format _mesa_texformat_rgb332; diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 63939f4011..275340cabd 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -694,7 +695,7 @@ static void store_texel_argb8888_rev(struct gl_texture_image *texImage, { const GLubyte *rgba = (const GLubyte *) texel; GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); + *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); } #endif @@ -803,6 +804,30 @@ static void store_texel_rgb565_rev(struct gl_texture_image *texImage, } #endif +/* MESA_FORMAT_RGBA4444 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ +static void FETCH(rgba4444)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); + texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); + texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); + texel[ACOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); +} + +#if DIM == 3 +static void store_texel_rgba4444(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + /* MESA_FORMAT_ARGB4444 ******************************************************/ @@ -824,7 +849,7 @@ static void store_texel_argb4444(struct gl_texture_image *texImage, { const GLubyte *rgba = (const GLubyte *) texel; GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); } #endif @@ -852,6 +877,29 @@ static void store_texel_argb4444_rev(struct gl_texture_image *texImage, } #endif +/* MESA_FORMAT_RGBA5551 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ +static void FETCH(rgba5551)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); + texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xf8) | ((s >> 8) & 0x7) ); + texel[BCOMP] = UBYTE_TO_CHAN( ((s << 2) & 0xf8) | ((s >> 3) & 0x7) ); + texel[ACOMP] = UBYTE_TO_CHAN( ((s) & 0x01) ? 255 : 0); +} + +#if DIM == 3 +static void store_texel_rgba5551(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif /* MESA_FORMAT_ARGB1555 ******************************************************/ @@ -1117,6 +1165,7 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, break;; default: _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); + return; } #if CHAN_TYPE == GL_UNSIGNED_BYTE COPY_4UBV(texel, texelUB); @@ -1174,11 +1223,11 @@ static void store_texel_srgb8(struct gl_texture_image *texImage, static void FETCH(srgba8)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - texel[RCOMP] = nonlinear_to_linear(src[0]); - texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[2]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[3]); /* linear! */ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s >> 24) ); + texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */ } #if DIM == 3 @@ -1186,10 +1235,29 @@ static void store_texel_srgba8(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) { const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */ +static void FETCH(sargb8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */ +} + +#if DIM == 3 +static void store_texel_sargb8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); } #endif diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 244c7aaafc..e3feb024c3 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -34,15 +35,36 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texgen.h" -#include "math/m_xform.h" +#include "math/m_matrix.h" +/** + * Return texgen state for given coordinate + */ +static struct gl_texgen * +get_texgen(struct gl_texture_unit *texUnit, GLenum coord) +{ + switch (coord) { + case GL_S: + return &texUnit->GenS; + case GL_T: + return &texUnit->GenT; + case GL_R: + return &texUnit->GenR; + case GL_Q: + return &texUnit->GenQ; + default: + return NULL; + } +} + void GLAPIENTRY _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) { - GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit; + struct gl_texgen *texgen; + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) @@ -59,210 +81,79 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bits; - switch (mode) { - case GL_OBJECT_LINEAR: - bits = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bits = TEXGEN_EYE_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bits = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bits = TEXGEN_NORMAL_MAP_NV; - break; - case GL_SPHERE_MAP: - bits = TEXGEN_SPHERE_MAP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeS == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeS = mode; - texUnit->_GenBitS = bits; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneS, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneS, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneS, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneS, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitt; - switch (mode) { - case GL_OBJECT_LINEAR: - bitt = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bitt = TEXGEN_EYE_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bitt = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bitt = TEXGEN_NORMAL_MAP_NV; - break; - case GL_SPHERE_MAP: - bitt = TEXGEN_SPHERE_MAP; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeT == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeT = mode; - texUnit->_GenBitT = bitt; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneT, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneT, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneT, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneT, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitr; - switch (mode) { - case GL_OBJECT_LINEAR: - bitr = TEXGEN_OBJ_LINEAR; - break; - case GL_REFLECTION_MAP_NV: - bitr = TEXGEN_REFLECTION_MAP_NV; - break; - case GL_NORMAL_MAP_NV: - bitr = TEXGEN_NORMAL_MAP_NV; - break; - case GL_EYE_LINEAR: - bitr = TEXGEN_EYE_LINEAR; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeR == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeR = mode; - texUnit->_GenBitR = bitr; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneR, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneR, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneR, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneR, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - GLenum mode = (GLenum) (GLint) *params; - GLbitfield bitq; - switch (mode) { - case GL_OBJECT_LINEAR: - bitq = TEXGEN_OBJ_LINEAR; - break; - case GL_EYE_LINEAR: - bitq = TEXGEN_EYE_LINEAR; - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); - return; - } - if (texUnit->GenModeQ == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->GenModeQ = mode; - texUnit->_GenBitQ = bitq; - } - else if (pname==GL_OBJECT_PLANE) { - if (TEST_EQ_4V(texUnit->ObjectPlaneQ, params)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->ObjectPlaneQ, params); - } - else if (pname==GL_EYE_PLANE) { - GLfloat tmp[4]; - /* Transform plane equation by the inverse modelview matrix */ - if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { - _math_matrix_analyse( ctx->ModelviewMatrixStack.Top ); - } - _mesa_transform_vector( tmp, params, ctx->ModelviewMatrixStack.Top->inv ); - if (TEST_EQ_4V(texUnit->EyePlaneQ, tmp)) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - COPY_4FV(texUnit->EyePlaneQ, tmp); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(coord)" ); - return; + texgen = get_texgen(texUnit, coord); + if (!texgen) { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexGen(coord)"); + return; + } + + switch (pname) { + case GL_TEXTURE_GEN_MODE: + { + GLenum mode = (GLenum) (GLint) params[0]; + GLbitfield bit = 0x0; + if (texgen->Mode == mode) + return; + switch (mode) { + case GL_OBJECT_LINEAR: + bit = TEXGEN_OBJ_LINEAR; + break; + case GL_EYE_LINEAR: + bit = TEXGEN_EYE_LINEAR; + break; + case GL_SPHERE_MAP: + if (coord == GL_S || coord == GL_T) + bit = TEXGEN_SPHERE_MAP; + break; + case GL_REFLECTION_MAP_NV: + if (coord != GL_Q) + bit = TEXGEN_REFLECTION_MAP_NV; + break; + case GL_NORMAL_MAP_NV: + if (coord != GL_Q) + bit = TEXGEN_NORMAL_MAP_NV; + break; + default: + ; /* nop */ + } + if (!bit) { + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); + return; + } + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texgen->Mode = mode; + texgen->_ModeBit = bit; + } + break; + + case GL_OBJECT_PLANE: + { + if (TEST_EQ_4V(texgen->ObjectPlane, params)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texgen->ObjectPlane, params); + } + break; + + case GL_EYE_PLANE: + { + GLfloat tmp[4]; + /* Transform plane equation by the inverse modelview matrix */ + if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top)) { + _math_matrix_analyse(ctx->ModelviewMatrixStack.Top); + } + _mesa_transform_vector(tmp, params, + ctx->ModelviewMatrixStack.Top->inv); + if (TEST_EQ_4V(texgen->EyePlane, tmp)) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + COPY_4FV(texgen->EyePlane, tmp); + } + break; + + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(pname)" ); + return; } if (ctx->Driver.TexGen) @@ -330,7 +221,8 @@ _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) void GLAPIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { - const struct gl_texture_unit *texUnit; + struct gl_texture_unit *texUnit; + struct gl_texgen *texgen; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -341,70 +233,24 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeS); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneS ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneS ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeT); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneT ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneT ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeR); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneR ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneR ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_DOUBLE(texUnit->GenModeQ); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneQ ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneQ ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(coord)" ); - return; + texgen = get_texgen(texUnit, coord); + if (!texgen) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexGendv(coord)"); + return; + } + + switch (pname) { + case GL_TEXTURE_GEN_MODE: + params[0] = ENUM_TO_DOUBLE(texgen->Mode); + break; + case GL_OBJECT_PLANE: + COPY_4V(params, texgen->ObjectPlane); + break; + case GL_EYE_PLANE: + COPY_4V(params, texgen->EyePlane); + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGendv(pname)" ); } } @@ -413,7 +259,8 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) void GLAPIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { - const struct gl_texture_unit *texUnit; + struct gl_texture_unit *texUnit; + struct gl_texgen *texgen; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -424,70 +271,24 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeS); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneS ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneS ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeT); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneT ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneT ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeR); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneR ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneR ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = ENUM_TO_FLOAT(texUnit->GenModeQ); - } - else if (pname==GL_OBJECT_PLANE) { - COPY_4V( params, texUnit->ObjectPlaneQ ); - } - else if (pname==GL_EYE_PLANE) { - COPY_4V( params, texUnit->EyePlaneQ ); - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(coord)" ); - return; + texgen = get_texgen(texUnit, coord); + if (!texgen) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexGenfv(coord)"); + return; + } + + switch (pname) { + case GL_TEXTURE_GEN_MODE: + params[0] = ENUM_TO_FLOAT(texgen->Mode); + break; + case GL_OBJECT_PLANE: + COPY_4V(params, texgen->ObjectPlane); + break; + case GL_EYE_PLANE: + COPY_4V(params, texgen->EyePlane); + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(pname)" ); } } @@ -496,7 +297,8 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) void GLAPIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { - const struct gl_texture_unit *texUnit; + struct gl_texture_unit *texUnit; + struct gl_texgen *texgen; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -507,94 +309,30 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - switch (coord) { - case GL_S: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeS; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneS[0]; - params[1] = (GLint) texUnit->ObjectPlaneS[1]; - params[2] = (GLint) texUnit->ObjectPlaneS[2]; - params[3] = (GLint) texUnit->ObjectPlaneS[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneS[0]; - params[1] = (GLint) texUnit->EyePlaneS[1]; - params[2] = (GLint) texUnit->EyePlaneS[2]; - params[3] = (GLint) texUnit->EyePlaneS[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_T: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeT; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneT[0]; - params[1] = (GLint) texUnit->ObjectPlaneT[1]; - params[2] = (GLint) texUnit->ObjectPlaneT[2]; - params[3] = (GLint) texUnit->ObjectPlaneT[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneT[0]; - params[1] = (GLint) texUnit->EyePlaneT[1]; - params[2] = (GLint) texUnit->EyePlaneT[2]; - params[3] = (GLint) texUnit->EyePlaneT[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_R: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeR; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneR[0]; - params[1] = (GLint) texUnit->ObjectPlaneR[1]; - params[2] = (GLint) texUnit->ObjectPlaneR[2]; - params[3] = (GLint) texUnit->ObjectPlaneR[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneR[0]; - params[1] = (GLint) texUnit->EyePlaneR[1]; - params[2] = (GLint) texUnit->EyePlaneR[2]; - params[3] = (GLint) texUnit->EyePlaneR[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - case GL_Q: - if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = texUnit->GenModeQ; - } - else if (pname==GL_OBJECT_PLANE) { - params[0] = (GLint) texUnit->ObjectPlaneQ[0]; - params[1] = (GLint) texUnit->ObjectPlaneQ[1]; - params[2] = (GLint) texUnit->ObjectPlaneQ[2]; - params[3] = (GLint) texUnit->ObjectPlaneQ[3]; - } - else if (pname==GL_EYE_PLANE) { - params[0] = (GLint) texUnit->EyePlaneQ[0]; - params[1] = (GLint) texUnit->EyePlaneQ[1]; - params[2] = (GLint) texUnit->EyePlaneQ[2]; - params[3] = (GLint) texUnit->EyePlaneQ[3]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); - return; - } - break; - default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(coord)" ); - return; + texgen = get_texgen(texUnit, coord); + if (!texgen) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexGeniv(coord)"); + return; + } + + switch (pname) { + case GL_TEXTURE_GEN_MODE: + params[0] = texgen->Mode; + break; + case GL_OBJECT_PLANE: + params[0] = (GLint) texgen->ObjectPlane[0]; + params[1] = (GLint) texgen->ObjectPlane[1]; + params[2] = (GLint) texgen->ObjectPlane[2]; + params[3] = (GLint) texgen->ObjectPlane[3]; + break; + case GL_EYE_PLANE: + params[0] = (GLint) texgen->EyePlane[0]; + params[1] = (GLint) texgen->EyePlane[1]; + params[2] = (GLint) texgen->EyePlane[2]; + params[3] = (GLint) texgen->EyePlane[3]; + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); } } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 36557f19fd..e3d4404759 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,8 +1,9 @@ /* - * Mesa 3-D graphics library - * Version: 7.1 + * mesa 3-D graphics library + * Version: 7.5 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -37,6 +38,7 @@ #endif #include "fbobject.h" #include "framebuffer.h" +#include "hash.h" #include "image.h" #include "imports.h" #include "macros.h" @@ -241,36 +243,33 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) } } - if (ctx->Extensions.SGIX_depth_texture || - ctx->Extensions.ARB_depth_texture) { + if (ctx->Extensions.ARB_depth_texture) { switch (internalFormat) { case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16_SGIX: - case GL_DEPTH_COMPONENT24_SGIX: - case GL_DEPTH_COMPONENT32_SGIX: + case GL_DEPTH_COMPONENT16: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: return GL_DEPTH_COMPONENT; default: ; /* fallthrough */ } } - if (ctx->Extensions.ARB_texture_compression) { - switch (internalFormat) { - case GL_COMPRESSED_ALPHA: - return GL_ALPHA; - case GL_COMPRESSED_LUMINANCE: - return GL_LUMINANCE; - case GL_COMPRESSED_LUMINANCE_ALPHA: - return GL_LUMINANCE_ALPHA; - case GL_COMPRESSED_INTENSITY: - return GL_INTENSITY; - case GL_COMPRESSED_RGB: - return GL_RGB; - case GL_COMPRESSED_RGBA: - return GL_RGBA; - default: - ; /* fallthrough */ - } + switch (internalFormat) { + case GL_COMPRESSED_ALPHA: + return GL_ALPHA; + case GL_COMPRESSED_LUMINANCE: + return GL_LUMINANCE; + case GL_COMPRESSED_LUMINANCE_ALPHA: + return GL_LUMINANCE_ALPHA; + case GL_COMPRESSED_INTENSITY: + return GL_INTENSITY; + case GL_COMPRESSED_RGB: + return GL_RGB; + case GL_COMPRESSED_RGBA: + return GL_RGBA; + default: + ; /* fallthrough */ } if (ctx->Extensions.TDFX_texture_compression_FXT1) { @@ -389,9 +388,10 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) * index, depth, stencil, etc). * \param format the image format value (may by an internal texture format) * \return GL_TRUE if its a color/RGBA format, GL_FALSE otherwise. + * XXX maybe move this func to image.c */ -static GLboolean -is_color_format(GLenum format) +GLboolean +_mesa_is_color_format(GLenum format) { switch (format) { case GL_RED: @@ -492,6 +492,7 @@ is_color_format(GLenum format) #endif /* FEATURE_EXT_texture_sRGB */ return GL_TRUE; case GL_YCBCR_MESA: /* not considered to be RGB */ + /* fall-through */ default: return GL_FALSE; } @@ -526,9 +527,9 @@ static GLboolean is_depth_format(GLenum format) { switch (format) { - case GL_DEPTH_COMPONENT16_ARB: - case GL_DEPTH_COMPONENT24_ARB: - case GL_DEPTH_COMPONENT32_ARB: + case GL_DEPTH_COMPONENT16: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: case GL_DEPTH_COMPONENT: return GL_TRUE; default: @@ -765,15 +766,15 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, { switch (target) { case GL_TEXTURE_1D: - return texUnit->Current1D; + return texUnit->CurrentTex[TEXTURE_1D_INDEX]; case GL_PROXY_TEXTURE_1D: return ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]; case GL_TEXTURE_2D: - return texUnit->Current2D; + return texUnit->CurrentTex[TEXTURE_2D_INDEX]; case GL_PROXY_TEXTURE_2D: return ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]; case GL_TEXTURE_3D: - return texUnit->Current3D; + return texUnit->CurrentTex[TEXTURE_3D_INDEX]; case GL_PROXY_TEXTURE_3D: return ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]; case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: @@ -784,25 +785,25 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: case GL_TEXTURE_CUBE_MAP_ARB: return ctx->Extensions.ARB_texture_cube_map - ? texUnit->CurrentCubeMap : NULL; + ? texUnit->CurrentTex[TEXTURE_CUBE_INDEX] : NULL; case GL_PROXY_TEXTURE_CUBE_MAP_ARB: return ctx->Extensions.ARB_texture_cube_map ? ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX] : NULL; case GL_TEXTURE_RECTANGLE_NV: return ctx->Extensions.NV_texture_rectangle - ? texUnit->CurrentRect : NULL; + ? texUnit->CurrentTex[TEXTURE_RECT_INDEX] : NULL; case GL_PROXY_TEXTURE_RECTANGLE_NV: return ctx->Extensions.NV_texture_rectangle ? ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX] : NULL; case GL_TEXTURE_1D_ARRAY_EXT: return ctx->Extensions.MESA_texture_array - ? texUnit->Current1DArray : NULL; + ? texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX] : NULL; case GL_PROXY_TEXTURE_1D_ARRAY_EXT: return ctx->Extensions.MESA_texture_array ? ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX] : NULL; case GL_TEXTURE_2D_ARRAY_EXT: return ctx->Extensions.MESA_texture_array - ? texUnit->Current2DArray : NULL; + ? texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX] : NULL; case GL_PROXY_TEXTURE_2D_ARRAY_EXT: return ctx->Extensions.MESA_texture_array ? ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX] : NULL; @@ -924,6 +925,7 @@ struct gl_texture_image * _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) { struct gl_texture_image *texImage; + GLuint texIndex; if (level < 0 ) return NULL; @@ -932,111 +934,54 @@ _mesa_get_proxy_tex_image(GLcontext *ctx, GLenum target, GLint level) case GL_PROXY_TEXTURE_1D: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_INDEX]; - } - return texImage; + texIndex = TEXTURE_1D_INDEX; + break; case GL_PROXY_TEXTURE_2D: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]; - } - return texImage; + texIndex = TEXTURE_2D_INDEX; + break; case GL_PROXY_TEXTURE_3D: if (level >= ctx->Const.Max3DTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_3D_INDEX]; - } - return texImage; + texIndex = TEXTURE_3D_INDEX; + break; case GL_PROXY_TEXTURE_CUBE_MAP: if (level >= ctx->Const.MaxCubeTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_CUBE_INDEX]; - } - return texImage; + texIndex = TEXTURE_CUBE_INDEX; + break; case GL_PROXY_TEXTURE_RECTANGLE_NV: if (level > 0) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_RECT_INDEX]; - } - return texImage; + texIndex = TEXTURE_RECT_INDEX; + break; case GL_PROXY_TEXTURE_1D_ARRAY_EXT: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_1D_ARRAY_INDEX]; - } - return texImage; + texIndex = TEXTURE_1D_ARRAY_INDEX; + break; case GL_PROXY_TEXTURE_2D_ARRAY_EXT: if (level >= ctx->Const.MaxTextureLevels) return NULL; - texImage = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level]; - if (!texImage) { - texImage = ctx->Driver.NewTextureImage(ctx); - if (!texImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); - return NULL; - } - ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]->Image[0][level] = texImage; - /* Set the 'back' pointer */ - texImage->TexObject = ctx->Texture.ProxyTex[TEXTURE_2D_ARRAY_INDEX]; - } - return texImage; + texIndex = TEXTURE_2D_ARRAY_INDEX; + break; default: return NULL; } + + texImage = ctx->Texture.ProxyTex[texIndex]->Image[0][level]; + if (!texImage) { + texImage = ctx->Driver.NewTextureImage(ctx); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation"); + return NULL; + } + ctx->Texture.ProxyTex[texIndex]->Image[0][level] = texImage; + /* Set the 'back' pointer */ + texImage->TexObject = ctx->Texture.ProxyTex[texIndex]; + } + return texImage; } @@ -1243,9 +1188,9 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, img->IsCompressed = GL_FALSE; img->CompressedSize = 0; - if ((width == 1 || _mesa_bitcount(img->Width2) == 1) && - (height == 1 || _mesa_bitcount(img->Height2) == 1) && - (depth == 1 || _mesa_bitcount(img->Depth2) == 1)) + if ((width == 1 || _mesa_is_pow_two(img->Width2)) && + (height == 1 || _mesa_is_pow_two(img->Height2)) && + (depth == 1 || _mesa_is_pow_two(img->Depth2))) img->_IsPowerOfTwo = GL_TRUE; else img->_IsPowerOfTwo = GL_FALSE; @@ -1316,7 +1261,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); if (width < 2 * border || width > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - width >0 && _mesa_bitcount(width - 2 * border) != 1) || + width >0 && !_mesa_is_pow_two(width - 2 * border)) || level >= ctx->Const.MaxTextureLevels) { /* bad width or level */ return GL_FALSE; @@ -1326,10 +1271,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); if (width < 2 * border || width > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && _mesa_bitcount(width - 2 * border) != 1) || + width > 0 && !_mesa_is_pow_two(width - 2 * border)) || height < 2 * border || height > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && _mesa_bitcount(height - 2 * border) != 1) || + height > 0 && !_mesa_is_pow_two(height - 2 * border)) || level >= ctx->Const.MaxTextureLevels) { /* bad width or height or level */ return GL_FALSE; @@ -1339,13 +1284,13 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); if (width < 2 * border || width > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && _mesa_bitcount(width - 2 * border) != 1) || + width > 0 && !_mesa_is_pow_two(width - 2 * border)) || height < 2 * border || height > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && _mesa_bitcount(height - 2 * border) != 1) || + height > 0 && !_mesa_is_pow_two(height - 2 * border)) || depth < 2 * border || depth > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - depth > 0 && _mesa_bitcount(depth - 2 * border) != 1) || + depth > 0 && !_mesa_is_pow_two(depth - 2 * border)) || level >= ctx->Const.Max3DTextureLevels) { /* bad width or height or depth or level */ return GL_FALSE; @@ -1363,10 +1308,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1); if (width < 2 * border || width > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && _mesa_bitcount(width - 2 * border) != 1) || + width > 0 && !_mesa_is_pow_two(width - 2 * border)) || height < 2 * border || height > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && _mesa_bitcount(height - 2 * border) != 1) || + height > 0 && !_mesa_is_pow_two(height - 2 * border)) || level >= ctx->Const.MaxCubeTextureLevels) { /* bad width or height */ return GL_FALSE; @@ -1376,7 +1321,7 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); if (width < 2 * border || width > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && _mesa_bitcount(width - 2 * border) != 1) || + width > 0 && !_mesa_is_pow_two(width - 2 * border)) || level >= ctx->Const.MaxTextureLevels) { /* bad width or level */ return GL_FALSE; @@ -1390,10 +1335,10 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); if (width < 2 * border || width > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - width > 0 && _mesa_bitcount(width - 2 * border) != 1) || + width > 0 && !_mesa_is_pow_two(width - 2 * border)) || height < 2 * border || height > 2 + maxSize || (!ctx->Extensions.ARB_texture_non_power_of_two && - height > 0 && _mesa_bitcount(height - 2 * border) != 1) || + height > 0 && !_mesa_is_pow_two(height - 2 * border)) || level >= ctx->Const.MaxTextureLevels) { /* bad width or height or level */ return GL_FALSE; @@ -1588,9 +1533,9 @@ texture_error_check( GLcontext *ctx, GLenum target, } /* make sure internal format and format basically agree */ - colorFormat = is_color_format(format); + colorFormat = _mesa_is_color_format(format); indexFormat = is_index_format(format); - if ((is_color_format(internalFormat) && !colorFormat && !indexFormat) || + if ((_mesa_is_color_format(internalFormat) && !colorFormat && !indexFormat) || (is_index_format(internalFormat) && !indexFormat) || (is_depth_format(internalFormat) != is_depth_format(format)) || (is_ycbcr_format(internalFormat) != is_ycbcr_format(format)) || @@ -2017,7 +1962,7 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, } if (is_compressed_format(ctx, internalFormat)) { - if (target != GL_TEXTURE_2D) { + if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexImage%d(target)", dimensions); return GL_TRUE; @@ -2052,30 +1997,20 @@ copytexture_error_check( GLcontext *ctx, GLuint dimensions, /** * Test glCopyTexSubImage[12]D() parameters for errors. + * Note that this is the first part of error checking. + * See also copytexsubimage_error_check2() below for the second part. * * \param ctx GL context. * \param dimensions texture image dimensions (must be 1, 2 or 3). * \param target texture target given by the user. * \param level image level given by the user. - * \param xoffset sub-image x offset given by the user. - * \param yoffset sub-image y offset given by the user. - * \param zoffset sub-image z offset given by the user. - * \param width image width given by the user. - * \param height image height given by the user. * * \return GL_TRUE if an error was detected, or GL_FALSE if no errors. - * - * Verifies each of the parameters against the constants specified in - * __GLcontextRec::Const and the supported extensions, and according to the - * OpenGL specification. */ static GLboolean -copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height) +copytexsubimage_error_check1( GLcontext *ctx, GLuint dimensions, + GLenum target, GLint level) { - /* Check target */ /* Check that the source buffer is complete */ if (ctx->ReadBuffer->Name) { _mesa_test_framebuffer_completeness(ctx, ctx->ReadBuffer); @@ -2086,6 +2021,7 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, } } + /* Check target */ if (dimensions == 1) { if (target != GL_TEXTURE_1D) { _mesa_error( ctx, GL_INVALID_ENUM, "glCopyTexSubImage1D(target)" ); @@ -2133,21 +2069,18 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } - /* Check size */ - if (width < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(width=%d)", dimensions, width); - return GL_TRUE; - } - if (dimensions > 1 && height < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCopyTexSubImage%dD(height=%d)", dimensions, height); - return GL_TRUE; - } - return GL_FALSE; } + +/** + * Second part of error checking for glCopyTexSubImage[12]D(). + * \param xoffset sub-image x offset given by the user. + * \param yoffset sub-image y offset given by the user. + * \param zoffset sub-image z offset given by the user. + * \param width image width given by the user. + * \param height image height given by the user. + */ static GLboolean copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, @@ -2155,6 +2088,7 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, GLsizei width, GLsizei height, const struct gl_texture_image *teximage ) { + /* check that dest tex image exists */ if (!teximage) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage%dD(undefined texture level: %d)", @@ -2162,6 +2096,19 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, return GL_TRUE; } + /* Check size */ + if (width < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCopyTexSubImage%dD(width=%d)", dimensions, width); + return GL_TRUE; + } + if (dimensions > 1 && height < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCopyTexSubImage%dD(height=%d)", dimensions, height); + return GL_TRUE; + } + + /* check x/y offsets */ if (xoffset < -((GLint)teximage->Border)) { _mesa_error(ctx, GL_INVALID_VALUE, "glCopyTexSubImage%dD(xoffset=%d)", dimensions, xoffset); @@ -2186,6 +2133,7 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, } } + /* check z offset */ if (dimensions > 2) { if (zoffset < -((GLint)teximage->Border)) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -2200,7 +2148,7 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, } if (teximage->IsCompressed) { - if (target != GL_TEXTURE_2D) { + if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%d(target)", dimensions); return GL_TRUE; @@ -2231,7 +2179,8 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%dD(missing readbuffer)", dimensions); + "glCopyTexSubImage%dD(missing readbuffer, format=0x%x)", + dimensions, teximage->_BaseFormat); return GL_TRUE; } @@ -2308,8 +2257,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } - if (!ctx->Extensions.SGIX_depth_texture && - !ctx->Extensions.ARB_depth_texture && is_depth_format(format)) { + if (!ctx->Extensions.ARB_depth_texture && is_depth_format(format)) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); return; } @@ -2338,8 +2286,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, * texture's format. Note that a color index texture can be converted * to RGBA so that combo is allowed. */ - if (is_color_format(format) - && !is_color_format(texImage->TexFormat->BaseFormat) + if (_mesa_is_color_format(format) + && !_mesa_is_color_format(texImage->TexFormat->BaseFormat) && !is_index_format(texImage->TexFormat->BaseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); goto out; @@ -2388,23 +2336,33 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, } +/** Callback info for walking over FBO hash table */ +struct cb_info +{ + GLcontext *ctx; + struct gl_texture_object *texObj; + GLuint level, face; +}; + /** - * Check if the given texture image is bound to any framebuffer objects - * and update/invalidate them. - * XXX We're only checking the currently bound framebuffer object for now. - * In the future, perhaps struct gl_texture_image should have a pointer (or - * list of pointers (yikes)) to the gl_framebuffer(s) which it's bound to. + * Check render to texture callback. Called from _mesa_HashWalk(). */ static void -update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, - GLuint face, GLuint level) +check_rtt_cb(GLuint key, void *data, void *userData) { - if (ctx->DrawBuffer->Name) { + struct gl_framebuffer *fb = (struct gl_framebuffer *) data; + const struct cb_info *info = (struct cb_info *) userData; + GLcontext *ctx = info->ctx; + const struct gl_texture_object *texObj = info->texObj; + const GLuint level = info->level, face = info->face; + + /* If this is a user-created FBO */ + if (fb->Name) { GLuint i; + /* check if any of the FBO's attachments point to 'texObj' */ for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = - ctx->DrawBuffer->Attachment + i; + struct gl_renderbuffer_attachment *att = fb->Attachment + i; if (att->Type == GL_TEXTURE && att->Texture == texObj && att->TextureLevel == level && @@ -2412,12 +2370,36 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, ASSERT(att->Texture->Image[att->CubeMapFace][att->TextureLevel]); /* Tell driver about the new renderbuffer texture */ ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att); + /* Mark fb status as indeterminate to force re-validation */ + fb->_Status = 0; } } } } +/** + * When a texture image is specified we have to check if it's bound to + * any framebuffer objects (render to texture) in order to detect changes + * in size or format since that effects FBO completeness. + * Any FBOs rendering into the texture must be re-validated. + */ +static void +update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, + GLuint face, GLuint level) +{ + /* Only check this texture if it's been marked as RenderToTexture */ + if (texObj->_RenderToTexture) { + struct cb_info info; + info.ctx = ctx; + info.texObj = texObj; + info.level = level; + info.face = face; + _mesa_HashWalk(ctx->Shared->FrameBuffers, check_rtt_cb, &info); + } +} + + /* * Called from the API. Note that width includes the border. @@ -2432,7 +2414,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); #if FEATURE_convolve - if (is_color_format(internalFormat)) { + if (_mesa_is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } #endif @@ -2449,7 +2431,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -2529,7 +2511,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); #if FEATURE_convolve - if (is_color_format(internalFormat)) { + if (_mesa_is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } @@ -2555,7 +2537,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -2611,7 +2593,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, 1, border)) { /* when error, clear all proxy texture image parameters */ if (texImage) - clear_teximage_fields(ctx->Texture.ProxyTex[TEXTURE_2D_INDEX]->Image[0][level]); + clear_teximage_fields(texImage); } else { /* no error, set the tex image parameters */ @@ -2656,7 +2638,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, return; /* error was recorded */ } - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -2711,8 +2693,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, } else { /* no error, set the tex image parameters */ - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); + _mesa_init_teximage_fields(ctx, target, texImage, width, height, + depth, border, internalFormat); texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, internalFormat, format, type); } @@ -2749,12 +2731,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve /* XXX should test internal format */ - if (is_color_format(format)) { + if (_mesa_is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } #endif @@ -2809,12 +2791,12 @@ _mesa_TexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve /* XXX should test internal format */ - if (is_color_format(format)) { + if (_mesa_is_color_format(format)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } @@ -2869,7 +2851,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset, @@ -2925,11 +2907,11 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve - if (is_color_format(internalFormat)) { + if (_mesa_is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); } #endif @@ -2990,15 +2972,16 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); #if FEATURE_convolve - if (is_color_format(internalFormat)) { + if (_mesa_is_color_format(internalFormat)) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); } #endif + if (copytexture_error_check(ctx, 2, target, level, internalFormat, postConvWidth, postConvHeight, border)) return; @@ -3057,16 +3040,10 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - /* XXX should test internal format */ - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); -#endif - - if (copytexsubimage_error_check(ctx, 1, target, level, - xoffset, 0, 0, postConvWidth, 1)) + if (copytexsubimage_error_check1(ctx, 1, target, level)) return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -3076,6 +3053,12 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); +#if FEATURE_convolve + if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); + } +#endif + if (copytexsubimage_error_check2(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, texImage)) @@ -3112,16 +3095,10 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - /* XXX should test internal format */ - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); -#endif - - if (copytexsubimage_error_check(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight)) + if (copytexsubimage_error_check1(ctx, 2, target, level)) return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -3131,6 +3108,13 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); +#if FEATURE_convolve + if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } +#endif + if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, postConvWidth, postConvHeight, texImage)) goto out; @@ -3166,16 +3150,10 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE) + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); -#if FEATURE_convolve - /* XXX should test internal format */ - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, &postConvHeight); -#endif - - if (copytexsubimage_error_check(ctx, 3, target, level, xoffset, yoffset, - zoffset, postConvWidth, postConvHeight)) + if (copytexsubimage_error_check1(ctx, 3, target, level)) return; texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; @@ -3185,6 +3163,13 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); +#if FEATURE_convolve + if (texImage && _mesa_is_color_format(texImage->InternalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } +#endif + if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight, texImage)) @@ -3278,16 +3263,16 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions, * XXX We should probably use the proxy texture error check function here. */ if (width < 1 || width > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && _mesa_bitcount(width) != 1)) + (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(width))) return GL_INVALID_VALUE; if ((height < 1 || height > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && _mesa_bitcount(height) != 1)) + (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(height))) && dimensions > 1) return GL_INVALID_VALUE; if ((depth < 1 || depth > maxTextureSize || - (!ctx->Extensions.ARB_texture_non_power_of_two && _mesa_bitcount(depth) != 1)) + (!ctx->Extensions.ARB_texture_non_power_of_two && !_mesa_is_pow_two(depth))) && dimensions > 2) return GL_INVALID_VALUE; diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index b718c0046d..eb60a1fa8f 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -111,6 +111,9 @@ extern GLuint _mesa_tex_target_to_face(GLenum target); +extern GLboolean +_mesa_is_color_format(GLenum format); + /** * Lock a texture for updating. See also _mesa_lock_context_textures(). diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 2a54ff7ff9..9ccb8fa100 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -28,7 +28,7 @@ */ -#include "glheader.h" +#include "mfeatures.h" #if FEATURE_colortable #include "colortab.h" #endif @@ -42,6 +42,8 @@ #include "texstate.h" #include "texobj.h" #include "mtypes.h" +#include "shader/prog_instruction.h" + /**********************************************************************/ @@ -132,12 +134,15 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, obj->BaseLevel = 0; obj->MaxLevel = 1000; obj->MaxAnisotropy = 1.0; - obj->CompareFlag = GL_FALSE; /* SGIX_shadow */ - obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; /* SGIX_shadow */ obj->CompareMode = GL_NONE; /* ARB_shadow */ obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */ + obj->CompareFailValue = 0.0F; /* ARB_shadow_ambient */ obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ - obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */ + obj->Swizzle[0] = GL_RED; + obj->Swizzle[1] = GL_GREEN; + obj->Swizzle[2] = GL_BLUE; + obj->Swizzle[3] = GL_ALPHA; + obj->_Swizzle = SWIZZLE_NOOP; } @@ -241,17 +246,17 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, dest->BaseLevel = src->BaseLevel; dest->MaxLevel = src->MaxLevel; dest->MaxAnisotropy = src->MaxAnisotropy; - dest->CompareFlag = src->CompareFlag; - dest->CompareOperator = src->CompareOperator; - dest->ShadowAmbient = src->ShadowAmbient; dest->CompareMode = src->CompareMode; dest->CompareFunc = src->CompareFunc; + dest->CompareFailValue = src->CompareFailValue; dest->DepthMode = src->DepthMode; dest->_MaxLevel = src->_MaxLevel; dest->_MaxLambda = src->_MaxLambda; dest->GenerateMipmap = src->GenerateMipmap; dest->Palette = src->Palette; dest->_Complete = src->_Complete; + COPY_4V(dest->Swizzle, src->Swizzle); + dest->_Swizzle = src->_Swizzle; } @@ -383,11 +388,21 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->_Complete = GL_TRUE; /* be optimistic */ + /* Detect cases where the application set the base level to an invalid + * value. + */ + if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { + char s[100]; + _mesa_sprintf(s, "base level = %d is invalid", baseLevel); + incomplete(t, s); + t->_Complete = GL_FALSE; + return; + } + /* Always need the base level image */ if (!t->Image[0][baseLevel]) { char s[100]; - _mesa_sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL", - (void *) t, t->Name, baseLevel); + _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; @@ -744,30 +759,17 @@ unbind_texobj_from_fbo(GLcontext *ctx, struct gl_texture_object *texObj) static void unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) { - GLuint u; + GLuint u, tex; for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) { struct gl_texture_unit *unit = &ctx->Texture.Unit[u]; - if (texObj == unit->Current1D) { - _mesa_reference_texobj(&unit->Current1D, ctx->Shared->Default1D); - } - else if (texObj == unit->Current2D) { - _mesa_reference_texobj(&unit->Current2D, ctx->Shared->Default2D); - } - else if (texObj == unit->Current3D) { - _mesa_reference_texobj(&unit->Current3D, ctx->Shared->Default3D); - } - else if (texObj == unit->CurrentCubeMap) { - _mesa_reference_texobj(&unit->CurrentCubeMap, ctx->Shared->DefaultCubeMap); - } - else if (texObj == unit->CurrentRect) { - _mesa_reference_texobj(&unit->CurrentRect, ctx->Shared->DefaultRect); - } - else if (texObj == unit->Current1DArray) { - _mesa_reference_texobj(&unit->Current1DArray, ctx->Shared->Default1DArray); - } - else if (texObj == unit->Current2DArray) { - _mesa_reference_texobj(&unit->Current2DArray, ctx->Shared->Default2DArray); + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + if (texObj == unit->CurrentTex[tex]) { + _mesa_reference_texobj(&unit->CurrentTex[tex], + ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]); + ASSERT(unit->CurrentTex[tex]); + break; + } } } } @@ -838,6 +840,35 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) /** + * Convert a GL texture target enum such as GL_TEXTURE_2D or GL_TEXTURE_3D + * into the corresponding Mesa texture target index. + * Return -1 if target is invalid. + */ +static GLint +target_enum_to_index(GLenum target) +{ + switch (target) { + case GL_TEXTURE_1D: + return TEXTURE_1D_INDEX; + case GL_TEXTURE_2D: + return TEXTURE_2D_INDEX; + case GL_TEXTURE_3D: + return TEXTURE_3D_INDEX; + case GL_TEXTURE_CUBE_MAP_ARB: + return TEXTURE_CUBE_INDEX; + case GL_TEXTURE_RECTANGLE_NV: + return TEXTURE_RECT_INDEX; + case GL_TEXTURE_1D_ARRAY_EXT: + return TEXTURE_1D_ARRAY_INDEX; + case GL_TEXTURE_2D_ARRAY_EXT: + return TEXTURE_2D_ARRAY_INDEX; + default: + return -1; + } +} + + +/** * Bind a named texture to a texturing target. * * \param target texture target. @@ -859,38 +890,20 @@ _mesa_BindTexture( GLenum target, GLuint texName ) const GLuint unit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; struct gl_texture_object *newTexObj = NULL, *defaultTexObj = NULL; + GLint targetIndex; ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) _mesa_debug(ctx, "glBindTexture %s %d\n", _mesa_lookup_enum_by_nr(target), (GLint) texName); - switch (target) { - case GL_TEXTURE_1D: - defaultTexObj = ctx->Shared->Default1D; - break; - case GL_TEXTURE_2D: - defaultTexObj = ctx->Shared->Default2D; - break; - case GL_TEXTURE_3D: - defaultTexObj = ctx->Shared->Default3D; - break; - case GL_TEXTURE_CUBE_MAP_ARB: - defaultTexObj = ctx->Shared->DefaultCubeMap; - break; - case GL_TEXTURE_RECTANGLE_NV: - defaultTexObj = ctx->Shared->DefaultRect; - break; - case GL_TEXTURE_1D_ARRAY_EXT: - defaultTexObj = ctx->Shared->Default1DArray; - break; - case GL_TEXTURE_2D_ARRAY_EXT: - defaultTexObj = ctx->Shared->Default2DArray; - break; - default: + targetIndex = target_enum_to_index(target); + if (targetIndex < 0) { _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)"); return; } + assert(targetIndex < NUM_TEXTURE_TARGETS); + defaultTexObj = ctx->Shared->DefaultTex[targetIndex]; /* * Get pointer to new texture object (newTexObj) @@ -938,33 +951,8 @@ _mesa_BindTexture( GLenum target, GLuint texName ) * texture object will be decremented. It'll be deleted if the * count hits zero. */ - switch (target) { - case GL_TEXTURE_1D: - _mesa_reference_texobj(&texUnit->Current1D, newTexObj); - break; - case GL_TEXTURE_2D: - _mesa_reference_texobj(&texUnit->Current2D, newTexObj); - break; - case GL_TEXTURE_3D: - _mesa_reference_texobj(&texUnit->Current3D, newTexObj); - break; - case GL_TEXTURE_CUBE_MAP_ARB: - _mesa_reference_texobj(&texUnit->CurrentCubeMap, newTexObj); - break; - case GL_TEXTURE_RECTANGLE_NV: - _mesa_reference_texobj(&texUnit->CurrentRect, newTexObj); - break; - case GL_TEXTURE_1D_ARRAY_EXT: - texUnit->Current1DArray = newTexObj; - break; - case GL_TEXTURE_2D_ARRAY_EXT: - texUnit->Current2DArray = newTexObj; - break; - default: - /* Bad target should be caught above */ - _mesa_problem(ctx, "bad target in BindTexture"); - return; - } + _mesa_reference_texobj(&texUnit->CurrentTex[targetIndex], newTexObj); + ASSERT(texUnit->CurrentTex[targetIndex]); /* Pass BindTexture call to device driver */ if (ctx->Driver.BindTexture) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 3f3b448dbc..50f867e1c1 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -37,6 +38,7 @@ #include "main/texcompress.h" #include "main/texparam.h" #include "main/teximage.h" +#include "shader/prog_instruction.h" /** @@ -72,403 +74,609 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) } -void GLAPIENTRY -_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) +/** + * Get current texture object for given target. + * Return NULL if any error. + */ +static struct gl_texture_object * +get_texobj(GLcontext *ctx, GLenum target) { - _mesa_TexParameterfv(target, pname, ¶m); + struct gl_texture_unit *texUnit; + + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(current unit)"); + return NULL; + } + + texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + + switch (target) { + case GL_TEXTURE_1D: + return texUnit->CurrentTex[TEXTURE_1D_INDEX]; + case GL_TEXTURE_2D: + return texUnit->CurrentTex[TEXTURE_2D_INDEX]; + case GL_TEXTURE_3D: + return texUnit->CurrentTex[TEXTURE_3D_INDEX]; + case GL_TEXTURE_CUBE_MAP: + if (ctx->Extensions.ARB_texture_cube_map) { + return texUnit->CurrentTex[TEXTURE_CUBE_INDEX]; + } + break; + case GL_TEXTURE_RECTANGLE_NV: + if (ctx->Extensions.NV_texture_rectangle) { + return texUnit->CurrentTex[TEXTURE_RECT_INDEX]; + } + break; + case GL_TEXTURE_1D_ARRAY_EXT: + if (ctx->Extensions.MESA_texture_array) { + return texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX]; + } + break; + case GL_TEXTURE_2D_ARRAY_EXT: + if (ctx->Extensions.MESA_texture_array) { + return texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX]; + } + break; + default: + ; + } + + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(target)"); + return NULL; } -void GLAPIENTRY -_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) +/** + * Convert GL_RED/GREEN/BLUE/ALPHA/ZERO/ONE to SWIZZLE_X/Y/Z/W/ZERO/ONE. + * \return -1 if error. + */ +static GLint +comp_to_swizzle(GLenum comp) { - const GLenum eparam = (GLenum) (GLint) params[0]; - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); + switch (comp) { + case GL_RED: + return SWIZZLE_X; + case GL_GREEN: + return SWIZZLE_Y; + case GL_BLUE: + return SWIZZLE_Z; + case GL_ALPHA: + return SWIZZLE_W; + case GL_ZERO: + return SWIZZLE_ZERO; + case GL_ONE: + return SWIZZLE_ONE; + default: + return -1; + } +} - if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "glTexParameter %s %s %.1f(%s)...\n", - _mesa_lookup_enum_by_nr(target), - _mesa_lookup_enum_by_nr(pname), - *params, - _mesa_lookup_enum_by_nr(eparam)); - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameterfv(current unit)"); - return; +static void +set_swizzle_component(GLuint *swizzle, GLuint comp, GLuint swz) +{ + ASSERT(comp < 4); + ASSERT(swz <= SWIZZLE_NIL); + { + GLuint mask = 0x7 << (3 * comp); + GLuint s = (*swizzle & ~mask) | (swz << (3 * comp)); + *swizzle = s; } +} - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - switch (target) { - case GL_TEXTURE_1D: - texObj = texUnit->Current1D; - break; - case GL_TEXTURE_2D: - texObj = texUnit->Current2D; - break; - case GL_TEXTURE_3D: - texObj = texUnit->Current3D; - break; - case GL_TEXTURE_CUBE_MAP: - if (!ctx->Extensions.ARB_texture_cube_map) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->CurrentCubeMap; - break; - case GL_TEXTURE_RECTANGLE_NV: - if (!ctx->Extensions.NV_texture_rectangle) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->CurrentRect; - break; - case GL_TEXTURE_1D_ARRAY_EXT: - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); - return; - } - texObj = texUnit->Current1DArray; - break; - case GL_TEXTURE_2D_ARRAY_EXT: - if (!ctx->Extensions.MESA_texture_array) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); +/** + * This is called just prior to changing any texture object state. + * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE + * state flag and then mark the texture object as 'incomplete' so that any + * per-texture derived state gets recomputed. + */ +static INLINE void +flush(GLcontext *ctx, struct gl_texture_object *texObj) +{ + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texObj->_Complete = GL_FALSE; +} + + +/** Set an integer-valued texture parameter */ +static void +set_tex_parameteri(GLcontext *ctx, + struct gl_texture_object *texObj, + GLenum pname, const GLint *params) +{ + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + if (texObj->MinFilter == params[0]) + return; + switch (params[0]) { + case GL_NEAREST: + case GL_LINEAR: + flush(ctx, texObj); + texObj->MinFilter = params[0]; + return; + case GL_NEAREST_MIPMAP_NEAREST: + case GL_LINEAR_MIPMAP_NEAREST: + case GL_NEAREST_MIPMAP_LINEAR: + case GL_LINEAR_MIPMAP_LINEAR: + if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) { + flush(ctx, texObj); + texObj->MinFilter = params[0]; return; } - texObj = texUnit->Current2DArray; - break; + /* fall-through */ default: - _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + } + return; + + case GL_TEXTURE_MAG_FILTER: + if (texObj->MagFilter == params[0]) return; - } + switch (params[0]) { + case GL_NEAREST: + case GL_LINEAR: + flush(ctx, texObj); + texObj->MagFilter = params[0]; + return; + default: + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + } + return; - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - /* A small optimization */ - if (texObj->MinFilter == eparam) - return; - if (eparam==GL_NEAREST || eparam==GL_LINEAR) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinFilter = eparam; - } - else if ((eparam==GL_NEAREST_MIPMAP_NEAREST || - eparam==GL_LINEAR_MIPMAP_NEAREST || - eparam==GL_NEAREST_MIPMAP_LINEAR || - eparam==GL_LINEAR_MIPMAP_LINEAR) && - texObj->Target != GL_TEXTURE_RECTANGLE_NV) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinFilter = eparam; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - break; - case GL_TEXTURE_MAG_FILTER: - /* A small optimization */ - if (texObj->MagFilter == eparam) - return; + case GL_TEXTURE_WRAP_S: + if (texObj->WrapS == params[0]) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { + flush(ctx, texObj); + texObj->WrapS = params[0]; + } + return; - if (eparam==GL_NEAREST || eparam==GL_LINEAR) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MagFilter = eparam; - } - else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - break; - case GL_TEXTURE_WRAP_S: - if (texObj->WrapS == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapS = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_WRAP_T: - if (texObj->WrapT == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapT = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_WRAP_R: - if (texObj->WrapR == eparam) - return; - if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapR = eparam; - } - else { - return; - } - break; - case GL_TEXTURE_BORDER_COLOR: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->BorderColor[RCOMP] = params[0]; - texObj->BorderColor[GCOMP] = params[1]; - texObj->BorderColor[BCOMP] = params[2]; - texObj->BorderColor[ACOMP] = params[3]; - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); - break; - case GL_TEXTURE_MIN_LOD: - if (texObj->MinLod == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MinLod = params[0]; - break; - case GL_TEXTURE_MAX_LOD: - if (texObj->MaxLod == params[0]) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MaxLod = params[0]; - break; - case GL_TEXTURE_BASE_LEVEL: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - if (target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->BaseLevel = (GLint) params[0]; - break; - case GL_TEXTURE_MAX_LEVEL: - if (params[0] < 0.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; - } - if (target == GL_TEXTURE_RECTANGLE_ARB) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->MaxLevel = (GLint) params[0]; - break; - case GL_TEXTURE_PRIORITY: - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->Priority = CLAMP( params[0], 0.0F, 1.0F ); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - if (ctx->Extensions.EXT_texture_filter_anisotropic) { - if (params[0] < 1.0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; - } - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - /* clamp to max, that's what NVIDIA does */ - texObj->MaxAnisotropy = MIN2(params[0], - ctx->Const.MaxTextureMaxAnisotropy); + case GL_TEXTURE_WRAP_T: + if (texObj->WrapT == params[0]) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { + flush(ctx, texObj); + texObj->WrapT = params[0]; + } + return; + + case GL_TEXTURE_WRAP_R: + if (texObj->WrapR == params[0]) + return; + if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { + flush(ctx, texObj); + texObj->WrapR = params[0]; + } + return; + + case GL_TEXTURE_BASE_LEVEL: + if (texObj->BaseLevel == params[0]) + return; + if (params[0] < 0 || + (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); + return; + } + flush(ctx, texObj); + texObj->BaseLevel = params[0]; + return; + + case GL_TEXTURE_MAX_LEVEL: + if (texObj->MaxLevel == params[0]) + return; + if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); + return; + } + flush(ctx, texObj); + texObj->MaxLevel = params[0]; + return; + + case GL_GENERATE_MIPMAP_SGIS: + if (ctx->Extensions.SGIS_generate_mipmap) { + if (texObj->GenerateMipmap != params[0]) { + flush(ctx, texObj); + texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); + } + return; + + case GL_TEXTURE_COMPARE_MODE_ARB: + if (ctx->Extensions.ARB_shadow && + (params[0] == GL_NONE || + params[0] == GL_COMPARE_R_TO_TEXTURE_ARB)) { + if (texObj->CompareMode != params[0]) { + flush(ctx, texObj); + texObj->CompareMode = params[0]; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)"); + } + return; + + case GL_TEXTURE_COMPARE_FUNC_ARB: + if (ctx->Extensions.ARB_shadow) { + if (texObj->CompareFunc == params[0]) return; - } - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); + switch (params[0]) { + case GL_LEQUAL: + case GL_GEQUAL: + flush(ctx, texObj); + texObj->CompareFunc = params[0]; return; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - GLenum op = (GLenum) params[0]; - if (op == GL_TEXTURE_LEQUAL_R_SGIX || - op == GL_TEXTURE_GEQUAL_R_SGIX) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareOperator = op; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); + case GL_EQUAL: + case GL_NOTEQUAL: + case GL_LESS: + case GL_GREATER: + case GL_ALWAYS: + case GL_NEVER: + if (ctx->Extensions.EXT_shadow_funcs) { + flush(ctx, texObj); + texObj->CompareFunc = params[0]; + return; } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); - return; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); - } - else { + /* fall-through */ + default: _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); - return; + "glTexParameter(GL_TEXTURE_COMPARE_FUNC_ARB)"); } - break; - case GL_GENERATE_MIPMAP_SGIS: - if (ctx->Extensions.SGIS_generate_mipmap) { - texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); + } + return; + + case GL_DEPTH_TEXTURE_MODE_ARB: + if (ctx->Extensions.ARB_depth_texture && + (params[0] == GL_LUMINANCE || + params[0] == GL_INTENSITY || + params[0] == GL_ALPHA)) { + if (texObj->DepthMode != params[0]) { + flush(ctx, texObj); + texObj->DepthMode = params[0]; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)"); + } + return; + +#ifdef FEATURE_OES_draw_texture + case GL_TEXTURE_CROP_RECT_OES: + texObj->CropRect[0] = params[0]; + texObj->CropRect[1] = params[1]; + texObj->CropRect[2] = params[2]; + texObj->CropRect[3] = params[3]; + return; +#endif + + case GL_TEXTURE_SWIZZLE_R_EXT: + case GL_TEXTURE_SWIZZLE_G_EXT: + case GL_TEXTURE_SWIZZLE_B_EXT: + case GL_TEXTURE_SWIZZLE_A_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + const GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; + const GLint swz = comp_to_swizzle(params[0]); + if (swz < 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTexParameter(swizzle 0x%x)", params[0]); return; } - break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - const GLenum mode = (GLenum) params[0]; - if (mode == GL_NONE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareMode = mode; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_TEXTURE_COMPARE_MODE_ARB: 0x%x)", mode); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_MODE_ARB)"); + ASSERT(comp < 4); + if (swz >= 0) { + flush(ctx, texObj); + texObj->Swizzle[comp] = params[0]; + set_swizzle_component(&texObj->_Swizzle, comp, swz); return; } - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - const GLenum func = (GLenum) params[0]; - if (func == GL_LEQUAL || func == GL_GEQUAL) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFunc = func; - } - else if (ctx->Extensions.EXT_shadow_funcs && - (func == GL_EQUAL || - func == GL_NOTEQUAL || - func == GL_LESS || - func == GL_GREATER || - func == GL_ALWAYS || - func == GL_NEVER)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFunc = func; + } + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + return; + + case GL_TEXTURE_SWIZZLE_RGBA_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp; + flush(ctx, texObj); + for (comp = 0; comp < 4; comp++) { + const GLint swz = comp_to_swizzle(params[comp]); + if (swz >= 0) { + texObj->Swizzle[comp] = params[comp]; + set_swizzle_component(&texObj->_Swizzle, comp, swz); } else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_TEXTURE_COMPARE_FUNC_ARB)"); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTexParameter(swizzle 0x%x)", params[comp]); return; } } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_FUNC_ARB)"); + return; + } + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + return; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); + } +} + + +/** Set a float-valued texture parameter */ +static void +set_tex_parameterf(GLcontext *ctx, + struct gl_texture_object *texObj, + GLenum pname, const GLfloat *params) +{ + switch (pname) { + case GL_TEXTURE_MIN_LOD: + if (texObj->MinLod == params[0]) + return; + flush(ctx, texObj); + texObj->MinLod = params[0]; + return; + + case GL_TEXTURE_MAX_LOD: + if (texObj->MaxLod == params[0]) + return; + flush(ctx, texObj); + texObj->MaxLod = params[0]; + return; + + case GL_TEXTURE_PRIORITY: + flush(ctx, texObj); + texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); + return; + + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + if (ctx->Extensions.EXT_texture_filter_anisotropic) { + if (texObj->MaxAnisotropy == params[0]) return; - } - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - const GLenum result = (GLenum) params[0]; - if (result == GL_LUMINANCE || result == GL_INTENSITY - || result == GL_ALPHA) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->DepthMode = result; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(bad GL_DEPTH_TEXTURE_MODE_ARB)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_DEPTH_TEXTURE_MODE_ARB)"); + if (params[0] < 1.0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); return; } - break; - case GL_TEXTURE_LOD_BIAS: - /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/ - if (ctx->Extensions.EXT_texture_lod_bias) { - if (texObj->LodBias != params[0]) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->LodBias = params[0]; - } - } - break; -#ifdef FEATURE_OES_draw_texture - case GL_TEXTURE_CROP_RECT_OES: - texObj->CropRect[0] = (GLint) params[0]; - texObj->CropRect[1] = (GLint) params[1]; - texObj->CropRect[2] = (GLint) params[2]; - texObj->CropRect[3] = (GLint) params[3]; - break; -#endif + flush(ctx, texObj); + /* clamp to max, that's what NVIDIA does */ + texObj->MaxAnisotropy = MIN2(params[0], + ctx->Const.MaxTextureMaxAnisotropy); + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); + } + return; - default: + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + if (texObj->CompareFailValue != params[0]) { + flush(ctx, texObj); + texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); + } + } + else { _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=0x%x)", pname); - return; + "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)"); + } + return; + + case GL_TEXTURE_LOD_BIAS: + /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */ + if (ctx->Extensions.EXT_texture_lod_bias) { + if (texObj->LodBias != params[0]) { + flush(ctx, texObj); + texObj->LodBias = params[0]; + } + } + break; + + case GL_TEXTURE_BORDER_COLOR: + flush(ctx, texObj); + texObj->BorderColor[RCOMP] = params[0]; + texObj->BorderColor[GCOMP] = params[1]; + texObj->BorderColor[BCOMP] = params[2]; + texObj->BorderColor[ACOMP] = params[3]; + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); + return; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); } +} - texObj->_Complete = GL_FALSE; - if (ctx->Driver.TexParameter) { - (*ctx->Driver.TexParameter)( ctx, target, texObj, pname, params ); +void GLAPIENTRY +_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + case GL_TEXTURE_WRAP_R: + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_GENERATE_MIPMAP_SGIS: + case GL_TEXTURE_COMPARE_MODE_ARB: + case GL_TEXTURE_COMPARE_FUNC_ARB: + case GL_DEPTH_TEXTURE_MODE_ARB: + { + /* convert float param to int */ + GLint p = (GLint) param; + set_tex_parameteri(ctx, texObj, pname, &p); + } + return; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameterf(ctx, texObj, pname, ¶m); + } + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m); } } void GLAPIENTRY -_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ) +_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) { - GLfloat fparam[4]; - if (pname == GL_TEXTURE_PRIORITY) - fparam[0] = INT_TO_FLOAT(param); - else - fparam[0] = (GLfloat) param; - fparam[1] = fparam[2] = fparam[3] = 0.0; - _mesa_TexParameterfv(target, pname, fparam); + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + case GL_TEXTURE_WRAP_R: + case GL_TEXTURE_BASE_LEVEL: + case GL_TEXTURE_MAX_LEVEL: + case GL_GENERATE_MIPMAP_SGIS: + case GL_TEXTURE_COMPARE_MODE_ARB: + case GL_TEXTURE_COMPARE_FUNC_ARB: + case GL_DEPTH_TEXTURE_MODE_ARB: + { + /* convert float param to int */ + GLint p = (GLint) params[0]; + set_tex_parameteri(ctx, texObj, pname, &p); + } + break; + +#ifdef FEATURE_OES_draw_texture + case GL_TEXTURE_CROP_RECT_OES: + { + /* convert float params to int */ + GLint iparams[4]; + iparams[0] = (GLint) params[0]; + iparams[1] = (GLint) params[1]; + iparams[2] = (GLint) params[2]; + iparams[3] = (GLint) params[3]; + set_tex_parameteri(ctx, target, iparams); + } + break; +#endif + + default: + /* this will generate an error if pname is illegal */ + set_tex_parameterf(ctx, texObj, pname, params); + } + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + ctx->Driver.TexParameter(ctx, target, texObj, pname, params); + } } void GLAPIENTRY -_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) +_mesa_TexParameteri(GLenum target, GLenum pname, GLint param) { - GLfloat fparam[4]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - fparam[0] = INT_TO_FLOAT(params[0]); - fparam[1] = INT_TO_FLOAT(params[1]); - fparam[2] = INT_TO_FLOAT(params[2]); - fparam[3] = INT_TO_FLOAT(params[3]); + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + case GL_TEXTURE_PRIORITY: + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + case GL_TEXTURE_LOD_BIAS: + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + { + GLfloat fparam = (GLfloat) param; + /* convert int param to float */ + set_tex_parameterf(ctx, texObj, pname, &fparam); + } + break; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameteri(ctx, texObj, pname, ¶m); } - else if (pname == GL_TEXTURE_CROP_RECT_OES) { - fparam[0] = (GLfloat) params[0]; - fparam[1] = (GLfloat) params[1]; - fparam[2] = (GLfloat) params[2]; - fparam[3] = (GLfloat) params[3]; + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + GLfloat fparam = (GLfloat) param; + ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam); } - else { - if (pname == GL_TEXTURE_PRIORITY) - fparam[0] = INT_TO_FLOAT(params[0]); - else - fparam[0] = (GLfloat) params[0]; - fparam[1] = fparam[2] = fparam[3] = 0.0F; +} + + +void GLAPIENTRY +_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + texObj = get_texobj(ctx, target); + if (!texObj) + return; + + switch (pname) { + case GL_TEXTURE_BORDER_COLOR: + { + /* convert int params to float */ + GLfloat fparams[4]; + fparams[0] = INT_TO_FLOAT(params[0]); + fparams[1] = INT_TO_FLOAT(params[1]); + fparams[2] = INT_TO_FLOAT(params[2]); + fparams[3] = INT_TO_FLOAT(params[3]); + set_tex_parameterf(ctx, texObj, pname, fparams); + } + break; + case GL_TEXTURE_MIN_LOD: + case GL_TEXTURE_MAX_LOD: + case GL_TEXTURE_PRIORITY: + case GL_TEXTURE_MAX_ANISOTROPY_EXT: + case GL_TEXTURE_LOD_BIAS: + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + { + /* convert int param to float */ + GLfloat fparam = (GLfloat) params[0]; + set_tex_parameterf(ctx, texObj, pname, &fparam); + } + break; + default: + /* this will generate an error if pname is illegal */ + set_tex_parameteri(ctx, texObj, pname, params); + } + + if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + GLfloat fparams[4]; + fparams[0] = INT_TO_FLOAT(params[0]); + if (pname == GL_TEXTURE_BORDER_COLOR || + pname == GL_TEXTURE_CROP_RECT_OES) { + fparams[1] = INT_TO_FLOAT(params[1]); + fparams[2] = INT_TO_FLOAT(params[2]); + fparams[3] = INT_TO_FLOAT(params[3]); + } + ctx->Driver.TexParameter(ctx, target, texObj, pname, fparams); } - _mesa_TexParameterfv(target, pname, fparam); } @@ -641,8 +849,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = 0; break; case GL_TEXTURE_DEPTH_SIZE_ARB: - if (ctx->Extensions.SGIX_depth_texture || - ctx->Extensions.ARB_depth_texture) + if (ctx->Extensions.ARB_depth_texture) *params = img->TexFormat->DepthBits; else _mesa_error(ctx, GL_INVALID_ENUM, @@ -660,33 +867,21 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: - if (ctx->Extensions.ARB_texture_compression) { - if (img->IsCompressed && !isProxy) { - /* Don't use ctx->Driver.CompressedTextureSize() since that - * may returned a padded hardware size. - */ - *params = _mesa_compressed_texture_size(ctx, img->Width, - img->Height, img->Depth, - img->TexFormat->MesaFormat); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexLevelParameter[if]v(pname)"); - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } + if (img->IsCompressed && !isProxy) { + /* Don't use ctx->Driver.CompressedTextureSize() since that + * may returned a padded hardware size. + */ + *params = _mesa_compressed_texture_size(ctx, img->Width, + img->Height, img->Depth, + img->TexFormat->MesaFormat); + } + else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexLevelParameter[if]v(pname)"); + } break; case GL_TEXTURE_COMPRESSED: - if (ctx->Extensions.ARB_texture_compression) { - *params = (GLint) img->IsCompressed; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetTexLevelParameter[if]v(pname)"); - } + *params = (GLint) img->IsCompressed; break; /* GL_ARB_texture_float */ @@ -841,76 +1036,89 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = obj->MaxAnisotropy; } else - error = 1; - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareFlag; - } - else - error = 1; - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareOperator; - } - else - error = 1; + error = GL_TRUE; break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = obj->ShadowAmbient; + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + *params = obj->CompareFailValue; } else - error = 1; + error = GL_TRUE; break; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { *params = (GLfloat) obj->GenerateMipmap; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareMode; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLfloat) obj->CompareFunc; } else - error = 1; + error = GL_TRUE; break; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture) { *params = (GLfloat) obj->DepthMode; } else - error = 1; + error = GL_TRUE; break; case GL_TEXTURE_LOD_BIAS: if (ctx->Extensions.EXT_texture_lod_bias) { *params = obj->LodBias; } else - error = 1; + error = GL_TRUE; break; #ifdef FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: params[0] = obj->CropRect[0]; - params[0] = obj->CropRect[1]; - params[0] = obj->CropRect[2]; - params[0] = obj->CropRect[3]; + params[1] = obj->CropRect[1]; + params[2] = obj->CropRect[2]; + params[3] = obj->CropRect[3]; break; #endif + + case GL_TEXTURE_SWIZZLE_R_EXT: + case GL_TEXTURE_SWIZZLE_G_EXT: + case GL_TEXTURE_SWIZZLE_B_EXT: + case GL_TEXTURE_SWIZZLE_A_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; + *params = (GLfloat) obj->Swizzle[comp]; + } + else { + error = GL_TRUE; + } + break; + + case GL_TEXTURE_SWIZZLE_RGBA_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp; + for (comp = 0; comp < 4; comp++) { + params[comp] = (GLfloat) obj->Swizzle[comp]; + } + } + else { + error = GL_TRUE; + } + break; + default: - error = 1; + error = GL_TRUE; break; } + if (error) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname); @@ -924,6 +1132,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) { struct gl_texture_unit *texUnit; struct gl_texture_object *obj; + GLboolean error = GL_FALSE; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -944,19 +1153,19 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) switch (pname) { case GL_TEXTURE_MAG_FILTER: *params = (GLint) obj->MagFilter; - return; + break;; case GL_TEXTURE_MIN_FILTER: *params = (GLint) obj->MinFilter; - return; + break;; case GL_TEXTURE_WRAP_S: *params = (GLint) obj->WrapS; - return; + break;; case GL_TEXTURE_WRAP_T: *params = (GLint) obj->WrapT; - return; + break;; case GL_TEXTURE_WRAP_R: *params = (GLint) obj->WrapR; - return; + break;; case GL_TEXTURE_BORDER_COLOR: { GLfloat b[4]; @@ -969,7 +1178,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) params[2] = FLOAT_TO_INT(b[2]); params[3] = FLOAT_TO_INT(b[3]); } - return; + break;; case GL_TEXTURE_RESIDENT: { GLboolean resident; @@ -979,87 +1188,115 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) resident = GL_TRUE; *params = (GLint) resident; } - return; + break;; case GL_TEXTURE_PRIORITY: *params = FLOAT_TO_INT(obj->Priority); - return; + break;; case GL_TEXTURE_MIN_LOD: *params = (GLint) obj->MinLod; - return; + break;; case GL_TEXTURE_MAX_LOD: *params = (GLint) obj->MaxLod; - return; + break;; case GL_TEXTURE_BASE_LEVEL: *params = obj->BaseLevel; - return; + break;; case GL_TEXTURE_MAX_LEVEL: *params = obj->MaxLevel; - return; + break;; case GL_TEXTURE_MAX_ANISOTROPY_EXT: if (ctx->Extensions.EXT_texture_filter_anisotropic) { *params = (GLint) obj->MaxAnisotropy; - return; } - break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareFlag; - return; + else { + error = GL_TRUE; } break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareOperator; - return; + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + *params = (GLint) FLOAT_TO_INT(obj->CompareFailValue); } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); - return; + else { + error = GL_TRUE; } break; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { *params = (GLint) obj->GenerateMipmap; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLint) obj->CompareMode; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { *params = (GLint) obj->CompareFunc; - return; + } + else { + error = GL_TRUE; } break; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture) { *params = (GLint) obj->DepthMode; - return; + } + else { + error = GL_TRUE; } break; case GL_TEXTURE_LOD_BIAS: if (ctx->Extensions.EXT_texture_lod_bias) { *params = (GLint) obj->LodBias; - return; + } + else { + error = GL_TRUE; } break; #ifdef FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: params[0] = obj->CropRect[0]; - params[0] = obj->CropRect[1]; - params[0] = obj->CropRect[2]; - params[0] = obj->CropRect[3]; + params[1] = obj->CropRect[1]; + params[2] = obj->CropRect[2]; + params[3] = obj->CropRect[3]; break; #endif + case GL_TEXTURE_SWIZZLE_R_EXT: + case GL_TEXTURE_SWIZZLE_G_EXT: + case GL_TEXTURE_SWIZZLE_B_EXT: + case GL_TEXTURE_SWIZZLE_A_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + GLuint comp = pname - GL_TEXTURE_SWIZZLE_R_EXT; + *params = obj->Swizzle[comp]; + } + else { + error = GL_TRUE; + } + break; + + case GL_TEXTURE_SWIZZLE_RGBA_EXT: + if (ctx->Extensions.EXT_texture_swizzle) { + COPY_4V(params, obj->Swizzle); + } + else { + error = GL_TRUE; + } + break; + default: ; /* silence warnings */ } - /* If we get here, pname was an unrecognized enum */ - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname); + + if (error) + _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", + pname); + + _mesa_unlock_texture(ctx, obj); } diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 163bda4501..49de6f5b8a 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -49,6 +49,14 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, trb->TexImage->FetchTexelc(trb->TexImage, x + i, y, z, rgbaOut + 4 * i); } } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort *zValues = (GLushort *) values; + for (i = 0; i < count; i++) { + GLfloat flt; + trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); + zValues[i] = (GLushort) (flt * 0xffff); + } + } else if (rb->DataType == GL_UNSIGNED_INT) { GLuint *zValues = (GLuint *) values; /* @@ -96,6 +104,15 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, z, rgbaOut + 4 * i); } } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort *zValues = (GLushort *) values; + for (i = 0; i < count; i++) { + GLfloat flt; + trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + z, &flt); + zValues[i] = (GLushort) (flt * 0xffff); + } + } else if (rb->DataType == GL_UNSIGNED_INT) { GLuint *zValues = (GLuint *) values; for (i = 0; i < count; i++) { @@ -147,6 +164,67 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, rgba += 4; } } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + const GLushort *zValues = (const GLushort *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, zValues + i); + } + } + } + else if (rb->DataType == GL_UNSIGNED_INT) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, zValues + i); + } + } + } + else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff)); + trb->Store(trb->TexImage, x + i, y, z, &flt); + } + } + } + else { + _mesa_problem(ctx, "invalid rb->DataType in texture_put_row"); + } +} + +/** + * Put row of RGB values into a renderbuffer that wraps a texture image. + */ +static void +texture_put_row_rgb(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const struct texture_renderbuffer *trb + = (const struct texture_renderbuffer *) rb; + const GLint z = trb->Zoffset; + GLuint i; + + y += trb->Yoffset; + + if (rb->DataType == CHAN_TYPE) { + const GLchan *rgb = (const GLchan *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, rgb); + } + rgb += 3; + } + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + const GLushort *zValues = (const GLushort *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, zValues + i); + } + } + } else if (rb->DataType == GL_UNSIGNED_INT) { const GLuint *zValues = (const GLuint *) values; for (i = 0; i < count; i++) { @@ -189,6 +267,14 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + const GLushort zValue = *((const GLushort *) value); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, &zValue); + } + } + } else if (rb->DataType == GL_UNSIGNED_INT) { const GLuint zValue = *((const GLuint *) value); for (i = 0; i < count; i++) { @@ -231,12 +317,19 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, rgba += 4; } } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + const GLushort *zValues = (const GLushort *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i); + } + } + } else if (rb->DataType == GL_UNSIGNED_INT) { const GLuint *zValues = (const GLuint *) values; for (i = 0; i < count; i++) { if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, - zValues + i); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i); } } } @@ -281,6 +374,14 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, } } } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + const GLushort zValue = *((const GLushort *) value); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue); + } + } + } else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { const GLuint zValue = *((const GLuint *) value); const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); @@ -332,6 +433,7 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att) trb->Base.GetRow = texture_get_row; trb->Base.GetValues = texture_get_values; trb->Base.PutRow = texture_put_row; + trb->Base.PutRowRGB = texture_put_row_rgb; trb->Base.PutMonoRow = texture_put_mono_row; trb->Base.PutValues = texture_put_values; trb->Base.PutMonoValues = texture_put_mono_values; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 20f9c4512c..3e6b09baa1 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.5 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -29,6 +29,7 @@ */ #include "glheader.h" +#include "mfeatures.h" #include "colormac.h" #if FEATURE_colortable #include "colortab.h" @@ -42,7 +43,6 @@ #include "texstate.h" #include "texenvprogram.h" #include "mtypes.h" -#include "math/m_xform.h" @@ -53,10 +53,10 @@ */ static const struct gl_tex_env_combine_state default_combine_state = { GL_MODULATE, GL_MODULATE, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA }, - { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, + { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT }, + { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT }, + { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA }, + { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, 0, 0, 2, 2 }; @@ -69,7 +69,7 @@ static const struct gl_tex_env_combine_state default_combine_state = { void _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) { - GLuint i; + GLuint u, tex; ASSERT(src); ASSERT(dst); @@ -81,57 +81,27 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) dst->Texture.SharedPalette = src->Texture.SharedPalette; /* per-unit state */ - for (i = 0; i < src->Const.MaxTextureUnits; i++) { - dst->Texture.Unit[i].Enabled = src->Texture.Unit[i].Enabled; - dst->Texture.Unit[i].EnvMode = src->Texture.Unit[i].EnvMode; - COPY_4V(dst->Texture.Unit[i].EnvColor, src->Texture.Unit[i].EnvColor); - dst->Texture.Unit[i].TexGenEnabled = src->Texture.Unit[i].TexGenEnabled; - dst->Texture.Unit[i].GenModeS = src->Texture.Unit[i].GenModeS; - dst->Texture.Unit[i].GenModeT = src->Texture.Unit[i].GenModeT; - dst->Texture.Unit[i].GenModeR = src->Texture.Unit[i].GenModeR; - dst->Texture.Unit[i].GenModeQ = src->Texture.Unit[i].GenModeQ; - dst->Texture.Unit[i]._GenBitS = src->Texture.Unit[i]._GenBitS; - dst->Texture.Unit[i]._GenBitT = src->Texture.Unit[i]._GenBitT; - dst->Texture.Unit[i]._GenBitR = src->Texture.Unit[i]._GenBitR; - dst->Texture.Unit[i]._GenBitQ = src->Texture.Unit[i]._GenBitQ; - dst->Texture.Unit[i]._GenFlags = src->Texture.Unit[i]._GenFlags; - COPY_4V(dst->Texture.Unit[i].ObjectPlaneS, src->Texture.Unit[i].ObjectPlaneS); - COPY_4V(dst->Texture.Unit[i].ObjectPlaneT, src->Texture.Unit[i].ObjectPlaneT); - COPY_4V(dst->Texture.Unit[i].ObjectPlaneR, src->Texture.Unit[i].ObjectPlaneR); - COPY_4V(dst->Texture.Unit[i].ObjectPlaneQ, src->Texture.Unit[i].ObjectPlaneQ); - COPY_4V(dst->Texture.Unit[i].EyePlaneS, src->Texture.Unit[i].EyePlaneS); - COPY_4V(dst->Texture.Unit[i].EyePlaneT, src->Texture.Unit[i].EyePlaneT); - COPY_4V(dst->Texture.Unit[i].EyePlaneR, src->Texture.Unit[i].EyePlaneR); - COPY_4V(dst->Texture.Unit[i].EyePlaneQ, src->Texture.Unit[i].EyePlaneQ); - dst->Texture.Unit[i].LodBias = src->Texture.Unit[i].LodBias; + for (u = 0; u < src->Const.MaxTextureImageUnits; u++) { + dst->Texture.Unit[u].Enabled = src->Texture.Unit[u].Enabled; + dst->Texture.Unit[u].EnvMode = src->Texture.Unit[u].EnvMode; + COPY_4V(dst->Texture.Unit[u].EnvColor, src->Texture.Unit[u].EnvColor); + dst->Texture.Unit[u].TexGenEnabled = src->Texture.Unit[u].TexGenEnabled; + dst->Texture.Unit[u].GenS = src->Texture.Unit[u].GenS; + dst->Texture.Unit[u].GenT = src->Texture.Unit[u].GenT; + dst->Texture.Unit[u].GenR = src->Texture.Unit[u].GenR; + dst->Texture.Unit[u].GenQ = src->Texture.Unit[u].GenQ; + dst->Texture.Unit[u].LodBias = src->Texture.Unit[u].LodBias; /* GL_EXT_texture_env_combine */ - dst->Texture.Unit[i].Combine.ModeRGB = src->Texture.Unit[i].Combine.ModeRGB; - dst->Texture.Unit[i].Combine.ModeA = src->Texture.Unit[i].Combine.ModeA; - COPY_3V(dst->Texture.Unit[i].Combine.SourceRGB, src->Texture.Unit[i].Combine.SourceRGB); - COPY_3V(dst->Texture.Unit[i].Combine.SourceA, src->Texture.Unit[i].Combine.SourceA); - COPY_3V(dst->Texture.Unit[i].Combine.OperandRGB, src->Texture.Unit[i].Combine.OperandRGB); - COPY_3V(dst->Texture.Unit[i].Combine.OperandA, src->Texture.Unit[i].Combine.OperandA); - dst->Texture.Unit[i].Combine.ScaleShiftRGB = src->Texture.Unit[i].Combine.ScaleShiftRGB; - dst->Texture.Unit[i].Combine.ScaleShiftA = src->Texture.Unit[i].Combine.ScaleShiftA; + dst->Texture.Unit[u].Combine = src->Texture.Unit[u].Combine; /* copy texture object bindings, not contents of texture objects */ _mesa_lock_context_textures(dst); - _mesa_reference_texobj(&dst->Texture.Unit[i].Current1D, - src->Texture.Unit[i].Current1D); - _mesa_reference_texobj(&dst->Texture.Unit[i].Current2D, - src->Texture.Unit[i].Current2D); - _mesa_reference_texobj(&dst->Texture.Unit[i].Current3D, - src->Texture.Unit[i].Current3D); - _mesa_reference_texobj(&dst->Texture.Unit[i].CurrentCubeMap, - src->Texture.Unit[i].CurrentCubeMap); - _mesa_reference_texobj(&dst->Texture.Unit[i].CurrentRect, - src->Texture.Unit[i].CurrentRect); - _mesa_reference_texobj(&dst->Texture.Unit[i].Current1DArray, - src->Texture.Unit[i].Current1DArray); - _mesa_reference_texobj(&dst->Texture.Unit[i].Current2DArray, - src->Texture.Unit[i].Current2DArray); + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex], + src->Texture.Unit[u].CurrentTex[tex]); + } _mesa_unlock_context_textures(dst); } @@ -307,8 +277,7 @@ _mesa_ActiveTextureARB(GLenum texture) _mesa_debug(ctx, "glActiveTexture %s\n", _mesa_lookup_enum_by_nr(texture)); - /* XXX error-check against max(coordunits, imageunits) */ - if (texUnit >= ctx->Const.MaxTextureUnits) { + if (texUnit >= ctx->Const.MaxTextureImageUnits) { _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(texture)"); return; } @@ -365,20 +334,20 @@ _mesa_ClientActiveTextureARB(GLenum texture) static void update_texture_matrices( GLcontext *ctx ) { - GLuint i; + GLuint u; - ctx->Texture._TexMatEnabled = 0; + ctx->Texture._TexMatEnabled = 0x0; - for (i=0; i < ctx->Const.MaxTextureUnits; i++) { - if (_math_matrix_is_dirty(ctx->TextureMatrixStack[i].Top)) { - _math_matrix_analyse( ctx->TextureMatrixStack[i].Top ); + for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) { + if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) { + _math_matrix_analyse( ctx->TextureMatrixStack[u].Top ); - if (ctx->Texture.Unit[i]._ReallyEnabled && - ctx->TextureMatrixStack[i].Top->type != MATRIX_IDENTITY) - ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i); + if (ctx->Texture.Unit[u]._ReallyEnabled && + ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY) + ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u); if (ctx->Driver.TextureMatrix) - ctx->Driver.TextureMatrix( ctx, i, ctx->TextureMatrixStack[i].Top); + ctx->Driver.TextureMatrix( ctx, u, ctx->TextureMatrixStack[u].Top); } } } @@ -405,16 +374,6 @@ update_texture_compare_function(GLcontext *ctx, */ tObj->_Function = GL_NONE; } - else if (tObj->CompareFlag) { - /* GL_SGIX_shadow */ - if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - tObj->_Function = GL_LEQUAL; - } - else { - ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX); - tObj->_Function = GL_GEQUAL; - } - } else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { /* GL_ARB_shadow */ tObj->_Function = tObj->CompareFunc; @@ -448,6 +407,100 @@ texture_override(GLcontext *ctx, /** + * Examine texture unit's combine/env state to update derived state. + */ +static void +update_tex_combine(GLcontext *ctx, struct gl_texture_unit *texUnit) +{ + struct gl_tex_env_combine_state *combine; + + /* Set the texUnit->_CurrentCombine field to point to the user's combiner + * state, or the combiner state which is derived from traditional texenv + * mode. + */ + if (texUnit->EnvMode == GL_COMBINE || + texUnit->EnvMode == GL_COMBINE4_NV) { + texUnit->_CurrentCombine = & texUnit->Combine; + } + else { + const struct gl_texture_object *texObj = texUnit->_Current; + GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; + if (format == GL_COLOR_INDEX) { + format = GL_RGBA; /* a bit of a hack */ + } + else if (format == GL_DEPTH_COMPONENT || + format == GL_DEPTH_STENCIL_EXT) { + format = texObj->DepthMode; + } + calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format); + texUnit->_CurrentCombine = & texUnit->_EnvMode; + } + + combine = texUnit->_CurrentCombine; + + /* Determine number of source RGB terms in the combiner function */ + switch (combine->ModeRGB) { + case GL_REPLACE: + combine->_NumArgsRGB = 1; + break; + case GL_ADD: + case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + combine->_NumArgsRGB = 4; + else + combine->_NumArgsRGB = 2; + break; + case GL_MODULATE: + case GL_SUBTRACT: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + combine->_NumArgsRGB = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + combine->_NumArgsRGB = 3; + break; + default: + combine->_NumArgsRGB = 0; + _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state"); + return; + } + + /* Determine number of source Alpha terms in the combiner function */ + switch (combine->ModeA) { + case GL_REPLACE: + combine->_NumArgsA = 1; + break; + case GL_ADD: + case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + combine->_NumArgsA = 4; + else + combine->_NumArgsA = 2; + break; + case GL_MODULATE: + case GL_SUBTRACT: + combine->_NumArgsA = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + combine->_NumArgsA = 3; + break; + default: + combine->_NumArgsA = 0; + _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state"); + break; + } +} + + +/** * \note This routine refers to derived texture matrix values to * compute the ENABLE_TEXMAT flags, but is only called on * _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT @@ -479,148 +532,98 @@ update_texture_state( GLcontext *ctx ) } } - ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are - * actual changes. - */ + /* TODO: only set this if there are actual changes */ + ctx->NewState |= _NEW_TEXTURE; - ctx->Texture._EnabledUnits = 0; - ctx->Texture._GenFlags = 0; - ctx->Texture._TexMatEnabled = 0; - ctx->Texture._TexGenEnabled = 0; + ctx->Texture._EnabledUnits = 0x0; + ctx->Texture._GenFlags = 0x0; + ctx->Texture._TexMatEnabled = 0x0; + ctx->Texture._TexGenEnabled = 0x0; /* * Update texture unit state. */ - for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { + for (unit = 0; unit < ctx->Const.MaxTextureImageUnits; unit++) { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; GLbitfield enableBits; + GLuint texIndex; texUnit->_Current = NULL; - texUnit->_ReallyEnabled = 0; - texUnit->_GenFlags = 0; + texUnit->_ReallyEnabled = 0x0; + texUnit->_GenFlags = 0x0; - /* Get the bitmask of texture enables. + /* Get the bitmask of texture target enables. * enableBits will be a mask of the TEXTURE_*_BIT flags indicating * which texture targets are enabled (fixed function) or referenced * by a fragment shader/program. When multiple flags are set, we'll * settle on the one with highest priority (see texture_override below). */ - if (fprog || vprog) { - enableBits = 0x0; - if (fprog) - enableBits |= fprog->Base.TexturesUsed[unit]; - if (vprog) - enableBits |= vprog->Base.TexturesUsed[unit]; + enableBits = 0x0; + if (vprog) { + enableBits |= vprog->Base.TexturesUsed[unit]; + } + if (fprog) { + enableBits |= fprog->Base.TexturesUsed[unit]; } else { - if (!texUnit->Enabled) - continue; - enableBits = texUnit->Enabled; + /* fixed-function fragment program */ + enableBits |= texUnit->Enabled; } + if (enableBits == 0x0) + continue; + /* Look for the highest-priority texture target that's enabled and * complete. That's the one we'll use for texturing. If we're using * a fragment program we're guaranteed that bitcount(enabledBits) <= 1. + * Note that the TEXTURE_x_INDEX values are in high to low priority. */ - texture_override(ctx, texUnit, enableBits, - texUnit->Current2DArray, TEXTURE_2D_ARRAY_BIT); - texture_override(ctx, texUnit, enableBits, - texUnit->Current1DArray, TEXTURE_1D_ARRAY_BIT); - texture_override(ctx, texUnit, enableBits, - texUnit->CurrentCubeMap, TEXTURE_CUBE_BIT); - texture_override(ctx, texUnit, enableBits, - texUnit->Current3D, TEXTURE_3D_BIT); - texture_override(ctx, texUnit, enableBits, - texUnit->CurrentRect, TEXTURE_RECT_BIT); - texture_override(ctx, texUnit, enableBits, - texUnit->Current2D, TEXTURE_2D_BIT); - texture_override(ctx, texUnit, enableBits, - texUnit->Current1D, TEXTURE_1D_BIT); + for (texIndex = 0; texIndex < NUM_TEXTURE_TARGETS; texIndex++) { + texture_override(ctx, texUnit, enableBits, + texUnit->CurrentTex[texIndex], 1 << texIndex); + } if (!texUnit->_ReallyEnabled) { continue; } - if (texUnit->_ReallyEnabled) - ctx->Texture._EnabledUnits |= (1 << unit); + /* if we get here, we know this texture unit is enabled */ - if (texUnit->EnvMode == GL_COMBINE) { - texUnit->_CurrentCombine = & texUnit->Combine; - } - else { - const struct gl_texture_object *texObj = texUnit->_Current; - GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; - if (format == GL_COLOR_INDEX) { - format = GL_RGBA; /* a bit of a hack */ - } - else if (format == GL_DEPTH_COMPONENT - || format == GL_DEPTH_STENCIL_EXT) { - format = texObj->DepthMode; - } - calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format); - texUnit->_CurrentCombine = & texUnit->_EnvMode; - } + ctx->Texture._EnabledUnits |= (1 << unit); - switch (texUnit->_CurrentCombine->ModeRGB) { - case GL_REPLACE: - texUnit->_CurrentCombine->_NumArgsRGB = 1; - break; - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_SUBTRACT: - case GL_DOT3_RGB: - case GL_DOT3_RGBA: - case GL_DOT3_RGB_EXT: - case GL_DOT3_RGBA_EXT: - texUnit->_CurrentCombine->_NumArgsRGB = 2; - break; - case GL_INTERPOLATE: - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - texUnit->_CurrentCombine->_NumArgsRGB = 3; - break; - default: - texUnit->_CurrentCombine->_NumArgsRGB = 0; - _mesa_problem(ctx, "invalid RGB combine mode in update_texture_state"); - return; - } + update_tex_combine(ctx, texUnit); + } - switch (texUnit->_CurrentCombine->ModeA) { - case GL_REPLACE: - texUnit->_CurrentCombine->_NumArgsA = 1; - break; - case GL_MODULATE: - case GL_ADD: - case GL_ADD_SIGNED: - case GL_SUBTRACT: - texUnit->_CurrentCombine->_NumArgsA = 2; - break; - case GL_INTERPOLATE: - case GL_MODULATE_ADD_ATI: - case GL_MODULATE_SIGNED_ADD_ATI: - case GL_MODULATE_SUBTRACT_ATI: - texUnit->_CurrentCombine->_NumArgsA = 3; - break; - default: - texUnit->_CurrentCombine->_NumArgsA = 0; - _mesa_problem(ctx, "invalid Alpha combine mode in update_texture_state"); - break; - } + + /* Determine which texture coordinate sets are actually needed */ + if (fprog) { + const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1; + ctx->Texture._EnabledCoordUnits + = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask; + } + else { + ctx->Texture._EnabledCoordUnits = ctx->Texture._EnabledUnits; + } + + /* Setup texgen for those texture coordinate sets that are in use */ + for (unit = 0; unit < ctx->Const.MaxTextureCoordUnits; unit++) { + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + + if (!(ctx->Texture._EnabledCoordUnits & (1 << unit))) + continue; if (texUnit->TexGenEnabled) { if (texUnit->TexGenEnabled & S_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitS; + texUnit->_GenFlags |= texUnit->GenS._ModeBit; } if (texUnit->TexGenEnabled & T_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitT; - } - if (texUnit->TexGenEnabled & Q_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitQ; + texUnit->_GenFlags |= texUnit->GenT._ModeBit; } if (texUnit->TexGenEnabled & R_BIT) { - texUnit->_GenFlags |= texUnit->_GenBitR; + texUnit->_GenFlags |= texUnit->GenR._ModeBit; + } + if (texUnit->TexGenEnabled & Q_BIT) { + texUnit->_GenFlags |= texUnit->GenQ._ModeBit; } ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit); @@ -630,16 +633,6 @@ update_texture_state( GLcontext *ctx ) if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit); } - - /* Determine which texture coordinate sets are actually needed */ - if (fprog) { - const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1; - ctx->Texture._EnabledCoordUnits - = (fprog->Base.InputsRead >> FRAG_ATTRIB_TEX0) & coordMask; - } - else { - ctx->Texture._EnabledCoordUnits = ctx->Texture._EnabledUnits; - } } @@ -713,6 +706,7 @@ static void init_texture_unit( GLcontext *ctx, GLuint unit ) { struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + GLuint tex; texUnit->EnvMode = GL_MODULATE; ASSIGN_4V( texUnit->EnvColor, 0.0, 0.0, 0.0, 0.0 ); @@ -721,34 +715,31 @@ init_texture_unit( GLcontext *ctx, GLuint unit ) texUnit->_EnvMode = default_combine_state; texUnit->_CurrentCombine = & texUnit->_EnvMode; - texUnit->TexGenEnabled = 0; - texUnit->GenModeS = GL_EYE_LINEAR; - texUnit->GenModeT = GL_EYE_LINEAR; - texUnit->GenModeR = GL_EYE_LINEAR; - texUnit->GenModeQ = GL_EYE_LINEAR; - texUnit->_GenBitS = TEXGEN_EYE_LINEAR; - texUnit->_GenBitT = TEXGEN_EYE_LINEAR; - texUnit->_GenBitR = TEXGEN_EYE_LINEAR; - texUnit->_GenBitQ = TEXGEN_EYE_LINEAR; + texUnit->TexGenEnabled = 0x0; + texUnit->GenS.Mode = GL_EYE_LINEAR; + texUnit->GenT.Mode = GL_EYE_LINEAR; + texUnit->GenR.Mode = GL_EYE_LINEAR; + texUnit->GenQ.Mode = GL_EYE_LINEAR; + texUnit->GenS._ModeBit = TEXGEN_EYE_LINEAR; + texUnit->GenT._ModeBit = TEXGEN_EYE_LINEAR; + texUnit->GenR._ModeBit = TEXGEN_EYE_LINEAR; + texUnit->GenQ._ModeBit = TEXGEN_EYE_LINEAR; /* Yes, these plane coefficients are correct! */ - ASSIGN_4V( texUnit->ObjectPlaneS, 1.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->ObjectPlaneT, 0.0, 1.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->ObjectPlaneR, 0.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->ObjectPlaneQ, 0.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneS, 1.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneT, 0.0, 1.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneR, 0.0, 0.0, 0.0, 0.0 ); - ASSIGN_4V( texUnit->EyePlaneQ, 0.0, 0.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenS.ObjectPlane, 1.0, 0.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenT.ObjectPlane, 0.0, 1.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenR.ObjectPlane, 0.0, 0.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenQ.ObjectPlane, 0.0, 0.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenS.EyePlane, 1.0, 0.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenT.EyePlane, 0.0, 1.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenR.EyePlane, 0.0, 0.0, 0.0, 0.0 ); + ASSIGN_4V( texUnit->GenQ.EyePlane, 0.0, 0.0, 0.0, 0.0 ); /* initialize current texture object ptrs to the shared default objects */ - _mesa_reference_texobj(&texUnit->Current1D, ctx->Shared->Default1D); - _mesa_reference_texobj(&texUnit->Current2D, ctx->Shared->Default2D); - _mesa_reference_texobj(&texUnit->Current3D, ctx->Shared->Default3D); - _mesa_reference_texobj(&texUnit->CurrentCubeMap, ctx->Shared->DefaultCubeMap); - _mesa_reference_texobj(&texUnit->CurrentRect, ctx->Shared->DefaultRect); - _mesa_reference_texobj(&texUnit->Current1DArray, ctx->Shared->Default1DArray); - _mesa_reference_texobj(&texUnit->Current2DArray, ctx->Shared->Default2DArray); + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_reference_texobj(&texUnit->CurrentTex[tex], + ctx->Shared->DefaultTex[tex]); + } } @@ -758,26 +749,24 @@ init_texture_unit( GLcontext *ctx, GLuint unit ) GLboolean _mesa_init_texture(GLcontext *ctx) { - GLuint i; - - assert(MAX_TEXTURE_LEVELS >= MAX_3D_TEXTURE_LEVELS); - assert(MAX_TEXTURE_LEVELS >= MAX_CUBE_TEXTURE_LEVELS); + GLuint u; /* Texture group */ ctx->Texture.CurrentUnit = 0; /* multitexture */ - ctx->Texture._EnabledUnits = 0; + ctx->Texture._EnabledUnits = 0x0; ctx->Texture.SharedPalette = GL_FALSE; #if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); #endif - for (i = 0; i < MAX_TEXTURE_UNITS; i++) - init_texture_unit( ctx, i ); + for (u = 0; u < MAX_TEXTURE_UNITS; u++) + init_texture_unit(ctx, u); /* After we're done initializing the context's texture state the default * texture objects' refcounts should be at least MAX_TEXTURE_UNITS + 1. */ - assert(ctx->Shared->Default1D->RefCount >= MAX_TEXTURE_UNITS + 1); + assert(ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]->RefCount + >= MAX_TEXTURE_UNITS + 1); /* Allocate proxy textures */ if (!alloc_proxy_textures( ctx )) @@ -797,26 +786,37 @@ _mesa_free_texture_data(GLcontext *ctx) /* unreference current textures */ for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) { - struct gl_texture_unit *unit = ctx->Texture.Unit + u; - _mesa_reference_texobj(&unit->Current1D, NULL); - _mesa_reference_texobj(&unit->Current2D, NULL); - _mesa_reference_texobj(&unit->Current3D, NULL); - _mesa_reference_texobj(&unit->CurrentCubeMap, NULL); - _mesa_reference_texobj(&unit->CurrentRect, NULL); - _mesa_reference_texobj(&unit->Current1DArray, NULL); - _mesa_reference_texobj(&unit->Current2DArray, NULL); + for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) { + _mesa_reference_texobj(&ctx->Texture.Unit[u].CurrentTex[tgt], NULL); + } } /* Free proxy texture objects */ for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); - #if FEATURE_colortable - { - GLuint i; - for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) - _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable ); - } + for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) + _mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable); #endif } + + +/** + * Update the default texture objects in the given context to reference those + * specified in the shared state and release those referencing the old + * shared state. + */ +void +_mesa_update_default_objects_texture(GLcontext *ctx) +{ + GLuint u, tex; + + for (u = 0; u < MAX_TEXTURE_UNITS; u++) { + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u]; + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_reference_texobj(&texUnit->CurrentTex[tex], + ctx->Shared->DefaultTex[tex]); + } + } +} diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index b5003d5d6e..a7d7088c62 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -73,6 +73,9 @@ _mesa_init_texture( GLcontext *ctx ); extern void _mesa_free_texture_data( GLcontext *ctx ); +extern void +_mesa_update_default_objects_texture(GLcontext *ctx); + /*@}*/ #endif diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 0fd6a2daae..6360ca15f8 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.3 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -1536,10 +1537,10 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { - d4[col] = ((0xff << 24) | - (srcRow[col * 3 + RCOMP] << 16) | - (srcRow[col * 3 + GCOMP] << 8) | - (srcRow[col * 3 + BCOMP] << 0)); + d4[col] = PACK_COLOR_8888(0xff, + srcRow[col * 3 + RCOMP], + srcRow[col * 3 + GCOMP], + srcRow[col * 3 + BCOMP]); } dstRow += dstRowStride; srcRow += srcRowStride; @@ -1551,8 +1552,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) dstFormat == &_mesa_texformat_argb8888 && srcFormat == GL_RGBA && baseInternalFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE && - littleEndian) { + srcType == GL_UNSIGNED_BYTE) { /* same as above case, but src data has alpha too */ GLint img, row, col; /* For some reason, streaming copies to write-combined regions @@ -1573,39 +1573,10 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { - d4[col] = ((srcRow[col * 4 + ACOMP] << 24) | - (srcRow[col * 4 + RCOMP] << 16) | - (srcRow[col * 4 + GCOMP] << 8) | - (srcRow[col * 4 + BCOMP] << 0)); - } - dstRow += dstRowStride; - srcRow += srcRowStride; - } - } - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && - srcFormat == GL_RGBA && - baseInternalFormat == GL_RGBA && - srcType == GL_UNSIGNED_BYTE) { - - GLint img, row, col; - for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes - + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 4 + 0] = srcRow[col * 4 + BCOMP]; - dstRow[col * 4 + 1] = srcRow[col * 4 + GCOMP]; - dstRow[col * 4 + 2] = srcRow[col * 4 + RCOMP]; - dstRow[col * 4 + 3] = srcRow[col * 4 + ACOMP]; + d4[col] = PACK_COLOR_8888(srcRow[col * 4 + ACOMP], + srcRow[col * 4 + RCOMP], + srcRow[col * 4 + GCOMP], + srcRow[col * 4 + BCOMP]); } dstRow += dstRowStride; srcRow += srcRowStride; @@ -1928,6 +1899,60 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) return GL_TRUE; } +GLboolean +_mesa_texstore_rgba4444(TEXSTORE_PARAMS) +{ + ASSERT(dstFormat == &_mesa_texformat_rgba4444); + ASSERT(dstFormat->TexelBytes == 2); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == &_mesa_texformat_rgba4444 && + baseInternalFormat == GL_RGBA && + srcFormat == GL_RGBA && + srcType == GL_UNSIGNED_SHORT_4_4_4_4){ + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, + baseInternalFormat, + dstFormat->BaseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLchan *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstYoffset * dstRowStride + + dstXoffset * dstFormat->TexelBytes; + for (row = 0; row < srcHeight; row++) { + GLushort *dstUS = (GLushort *) dstRow; + for (col = 0; col < srcWidth; col++) { + dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]), + CHAN_TO_UBYTE(src[GCOMP]), + CHAN_TO_UBYTE(src[BCOMP]), + CHAN_TO_UBYTE(src[ACOMP]) ); + src += 4; + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) @@ -1996,7 +2021,60 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) return GL_TRUE; } +GLboolean +_mesa_texstore_rgba5551(TEXSTORE_PARAMS) +{ + ASSERT(dstFormat == &_mesa_texformat_rgba5551); + ASSERT(dstFormat->TexelBytes == 2); + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == &_mesa_texformat_rgba5551 && + baseInternalFormat == GL_RGBA && + srcFormat == GL_RGBA && + srcType == GL_UNSIGNED_SHORT_5_5_5_1) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, + baseInternalFormat, + dstFormat->BaseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLchan *src =tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstYoffset * dstRowStride + + dstXoffset * dstFormat->TexelBytes; + for (row = 0; row < srcHeight; row++) { + GLushort *dstUS = (GLushort *) dstRow; + for (col = 0; col < srcWidth; col++) { + dstUS[col] = PACK_COLOR_5551( CHAN_TO_UBYTE(src[RCOMP]), + CHAN_TO_UBYTE(src[GCOMP]), + CHAN_TO_UBYTE(src[BCOMP]), + CHAN_TO_UBYTE(src[ACOMP]) ); + src += 4; + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) @@ -2692,7 +2770,6 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { - const GLboolean littleEndian = _mesa_little_endian(); const struct gl_texture_format *newDstFormat; StoreTexImageFunc store; GLboolean k; @@ -2700,14 +2777,8 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) ASSERT(dstFormat == &_mesa_texformat_srgb8); /* reuse normal rgb texstore code */ - if (littleEndian) { - newDstFormat = &_mesa_texformat_bgr888; - store = _mesa_texstore_bgr888; - } - else { - newDstFormat = &_mesa_texformat_rgb888; - store = _mesa_texstore_rgb888; - } + newDstFormat = &_mesa_texformat_rgb888; + store = _mesa_texstore_rgb888; k = store(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -2723,17 +2794,13 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS) { - const GLboolean littleEndian = _mesa_little_endian(); const struct gl_texture_format *newDstFormat; GLboolean k; ASSERT(dstFormat == &_mesa_texformat_srgba8); /* reuse normal rgba texstore code */ - if (littleEndian) - newDstFormat = &_mesa_texformat_rgba8888_rev; - else - newDstFormat = &_mesa_texformat_rgba8888; + newDstFormat = &_mesa_texformat_rgba8888; k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -2747,6 +2814,28 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS) GLboolean +_mesa_texstore_sargb8(TEXSTORE_PARAMS) +{ + const struct gl_texture_format *newDstFormat; + GLboolean k; + + ASSERT(dstFormat == &_mesa_texformat_sargb8); + + /* reuse normal rgba texstore code */ + newDstFormat = &_mesa_texformat_argb8888; + + k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat, + newDstFormat, dstAddr, + dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, + srcAddr, srcPacking); + return k; +} + + +GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; @@ -2771,17 +2860,13 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS) { - const GLboolean littleEndian = _mesa_little_endian(); const struct gl_texture_format *newDstFormat; GLboolean k; ASSERT(dstFormat == &_mesa_texformat_sla8); /* reuse normal luminance/alpha texstore code */ - if (littleEndian) - newDstFormat = &_mesa_texformat_al88; - else - newDstFormat = &_mesa_texformat_al88_rev; + newDstFormat = &_mesa_texformat_al88; k = _mesa_texstore_al88(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -3018,10 +3103,13 @@ choose_texture_format(GLcontext *ctx, struct gl_texture_image *texImage, -/* +/** * This is the software fallback for Driver.TexImage1D() * and Driver.CopyTexImage1D(). * \sa _mesa_store_teximage2d() + * Note that the width may not be the actual texture width since it may + * be changed by convolution w/ GL_REDUCE. The texImage->Width field will + * have the actual texture size. */ void _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, @@ -3032,21 +3120,16 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint postConvWidth = width; GLint sizeInBytes; (void) border; - if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { - _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); - } - choose_texture_format(ctx, texImage, 1, format, type, internalFormat); /* allocate memory */ if (texImage->IsCompressed) sizeInBytes = texImage->CompressedSize; else - sizeInBytes = postConvWidth * texImage->TexFormat->TexelBytes; + sizeInBytes = texImage->Width * texImage->TexFormat->TexelBytes; texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); @@ -3106,15 +3189,9 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint postConvWidth = width, postConvHeight = height; GLint texelBytes, sizeInBytes; (void) border; - if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { - _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, - &postConvHeight); - } - choose_texture_format(ctx, texImage, 2, format, type, internalFormat); texelBytes = texImage->TexFormat->TexelBytes; @@ -3123,7 +3200,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, if (texImage->IsCompressed) sizeInBytes = texImage->CompressedSize; else - sizeInBytes = postConvWidth * postConvHeight * texelBytes; + sizeInBytes = texImage->Width * texImage->Height * texelBytes; texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); @@ -3619,16 +3696,40 @@ is_srgb_teximage(const struct gl_texture_image *texImage) switch (texImage->TexFormat->MesaFormat) { case MESA_FORMAT_SRGB8: case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: case MESA_FORMAT_SL8: case MESA_FORMAT_SLA8: + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: return GL_TRUE; default: return GL_FALSE; } } -#endif /* FEATURE_EXT_texture_sRGB */ +/** + * Convert a float value from linear space to a + * non-linear sRGB value in [0, 255]. + * Not terribly efficient. + */ +static INLINE GLfloat +linear_to_nonlinear(GLfloat cl) +{ + /* can't have values outside [0, 1] */ + GLfloat cs; + if (cl < 0.0031308) { + cs = 12.92 * cl; + } + else { + cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055; + } + return cs; +} + +#endif /* FEATURE_EXT_texture_sRGB */ /** * This is the software fallback for Driver.GetTexImage(). @@ -3745,18 +3846,48 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, } #if FEATURE_EXT_texture_sRGB else if (is_srgb_teximage(texImage)) { - /* no pixel transfer and no non-linear to linear conversion */ - const GLint comps = texImage->TexFormat->TexelBytes; - const GLint rowstride = comps * texImage->RowStride; - MEMCPY(dest, - (const GLubyte *) texImage->Data + row * rowstride, - comps * width * sizeof(GLubyte)); + /* special case this since need to backconvert values */ + /* convert row to RGBA format */ + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + GLbitfield transferOps = 0x0; + + for (col = 0; col < width; col++) { + (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); + if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->TexFormat->BaseFormat == GL_RGB || + texImage->TexFormat->BaseFormat == GL_RGBA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); + rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps /*image xfer ops*/); } #endif /* FEATURE_EXT_texture_sRGB */ else { /* general case: convert row to RGBA format */ GLfloat rgba[MAX_WIDTH][4]; GLint col; + GLbitfield transferOps = 0x0; + + if (type == GL_FLOAT && + ((ctx->Color.ClampReadColor == GL_TRUE) || + (ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB && + texImage->TexFormat->DataType != GL_FLOAT))) + transferOps |= IMAGE_CLAMP_BIT; + for (col = 0; col < width; col++) { (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); if (texImage->TexFormat->BaseFormat == GL_ALPHA) { @@ -3781,7 +3912,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, } _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format, type, dest, - &ctx->Pack, 0x0 /*image xfer ops*/); + &ctx->Pack, transferOps /*image xfer ops*/); } /* format */ } /* row */ } /* img */ @@ -3802,8 +3933,8 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, void _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, GLvoid *img, - const struct gl_texture_object *texObj, - const struct gl_texture_image *texImage) + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) { GLuint size; diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index c5813fbeee..b03386b2ac 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -3,6 +3,7 @@ * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -46,8 +47,10 @@ extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS); @@ -71,6 +74,7 @@ extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS); #if FEATURE_EXT_texture_sRGB extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS); #endif @@ -215,8 +219,8 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, extern void _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, GLvoid *img, - const struct gl_texture_object *texObj, - const struct gl_texture_image *texImage); + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); extern const GLvoid * _mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions, diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 9f1fcd9d26..106252e460 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -52,11 +52,13 @@ static void update_array(GLcontext *ctx, struct gl_client_array *array, GLbitfield dirtyBit, GLsizei elementSize, - GLint size, GLenum type, + GLint size, GLenum type, GLenum format, GLsizei stride, GLboolean normalized, const GLvoid *ptr) { + ASSERT(format == GL_RGBA || format == GL_BGRA); array->Size = size; array->Type = type; + array->Format = format; array->Stride = stride; array->StrideB = stride ? stride : elementSize; array->Normalized = normalized; @@ -132,7 +134,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, - elementSize, size, type, stride, GL_FALSE, ptr); + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.VertexPointer) ctx->Driver.VertexPointer( ctx, size, type, stride, ptr ); @@ -182,7 +184,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) } update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, - elementSize, 3, type, stride, GL_TRUE, ptr); + elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr); if (ctx->Driver.NormalPointer) ctx->Driver.NormalPointer( ctx, type, stride, ptr ); @@ -193,12 +195,15 @@ void GLAPIENTRY _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLsizei elementSize; + GLenum format; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (size < 3 || size > 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" ); - return; + if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) { + _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(size)"); + return; + } } if (stride < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glColorPointer(stride)" ); @@ -209,6 +214,18 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) _mesa_debug(ctx, "glColorPointer( sz %d type %s stride %d )\n", size, _mesa_lookup_enum_by_nr( type ), stride); + if (size == GL_BGRA) { + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(GL_BGRA/GLubyte)"); + return; + } + format = GL_BGRA; + size = 4; + } + else { + format = GL_RGBA; + } + switch (type) { case GL_BYTE: elementSize = size * sizeof(GLbyte); @@ -245,7 +262,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, - elementSize, size, type, stride, GL_TRUE, ptr); + elementSize, size, type, format, stride, GL_TRUE, ptr); if (ctx->Driver.ColorPointer) ctx->Driver.ColorPointer( ctx, size, type, stride, ptr ); @@ -277,7 +294,7 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, - elementSize, 1, type, stride, GL_FALSE, ptr); + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.FogCoordPointer) ctx->Driver.FogCoordPointer( ctx, type, stride, ptr ); @@ -318,7 +335,7 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, - elementSize, 1, type, stride, GL_FALSE, ptr); + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.IndexPointer) ctx->Driver.IndexPointer( ctx, type, stride, ptr ); @@ -330,12 +347,15 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLsizei elementSize; + GLenum format; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (size != 3 && size != 4) { - _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)" ); - return; + if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) { + _mesa_error(ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(size)"); + return; + } } if (stride < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glSecondaryColorPointer(stride)" ); @@ -346,6 +366,18 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, _mesa_debug(ctx, "glSecondaryColorPointer( sz %d type %s stride %d )\n", size, _mesa_lookup_enum_by_nr( type ), stride); + if (size == GL_BGRA) { + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(ctx, GL_INVALID_VALUE, "glColorPointer(GL_BGRA/GLubyte)"); + return; + } + format = GL_BGRA; + size = 4; + } + else { + format = GL_RGBA; + } + switch (type) { case GL_BYTE: elementSize = size * sizeof(GLbyte); @@ -377,7 +409,7 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, } update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1, - elementSize, size, type, stride, GL_TRUE, ptr); + elementSize, size, type, format, stride, GL_TRUE, ptr); if (ctx->Driver.SecondaryColorPointer) ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr ); @@ -437,7 +469,7 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], _NEW_ARRAY_TEXCOORD(unit), - elementSize, size, type, stride, GL_FALSE, ptr); + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); if (ctx->Driver.TexCoordPointer) ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr ); @@ -456,7 +488,8 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, - sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, stride, GL_FALSE, ptr); + sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA, + stride, GL_FALSE, ptr); if (ctx->Driver.EdgeFlagPointer) ctx->Driver.EdgeFlagPointer( ctx, stride, ptr ); @@ -490,7 +523,7 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) } update_array(ctx, &ctx->Array.ArrayObj->PointSize, _NEW_ARRAY_POINT_SIZE, - elementSize, 1, type, stride, GL_FALSE, ptr); + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -499,7 +532,7 @@ void GLAPIENTRY _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { - const GLboolean normalized = GL_FALSE; + GLboolean normalized = GL_FALSE; GLsizei elementSize; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -527,6 +560,7 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, /* check for valid 'type' and compute StrideB right away */ switch (type) { case GL_UNSIGNED_BYTE: + normalized = GL_TRUE; elementSize = size * sizeof(GLubyte); break; case GL_SHORT: @@ -545,7 +579,7 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, stride, normalized, ptr); + elementSize, size, type, GL_RGBA, stride, normalized, ptr); if (ctx->Driver.VertexAttribPointer) ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr ); @@ -560,6 +594,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { GLsizei elementSize; + GLenum format; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -569,8 +604,10 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, } if (size < 1 || size > 4) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)"); - return; + if (!ctx->Extensions.EXT_vertex_array_bgra || size != GL_BGRA) { + _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerARB(size)"); + return; + } } if (stride < 0) { @@ -578,6 +615,20 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, return; } + if (size == GL_BGRA) { + if (type != GL_UNSIGNED_BYTE) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glVertexAttribPointerARB(GL_BGRA/type)"); + return; + } + format = GL_BGRA; + size = 4; + normalized = GL_TRUE; + } + else { + format = GL_RGBA; + } + /* check for valid 'type' and compute StrideB right away */ /* NOTE: more types are supported here than in the NV extension */ switch (type) { @@ -617,7 +668,7 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, stride, normalized, ptr); + elementSize, size, type, GL_RGBA, stride, normalized, ptr); if (ctx->Driver.VertexAttribPointer) ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr); @@ -865,16 +916,22 @@ _mesa_LockArraysEXT(GLint first, GLsizei count) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glLockArrays %d %d\n", first, count); - if (first == 0 && count > 0 && - count <= (GLint) ctx->Const.MaxArrayLockSize) { - ctx->Array.LockFirst = first; - ctx->Array.LockCount = count; + if (first < 0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(first)" ); + return; } - else { - ctx->Array.LockFirst = 0; - ctx->Array.LockCount = 0; + if (count <= 0) { + _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(count)" ); + return; + } + if (ctx->Array.LockCount != 0) { + _mesa_error( ctx, GL_INVALID_OPERATION, "glLockArraysEXT(reentry)" ); + return; } + ctx->Array.LockFirst = first; + ctx->Array.LockCount = count; + ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= _NEW_ARRAY_ALL; @@ -892,6 +949,11 @@ _mesa_UnlockArraysEXT( void ) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glUnlockArrays\n"); + if (ctx->Array.LockCount == 0) { + _mesa_error( ctx, GL_INVALID_OPERATION, "glUnlockArraysEXT(reexit)" ); + return; + } + ctx->Array.LockFirst = 0; ctx->Array.LockCount = 0; ctx->NewState |= _NEW_ARRAY; diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index f557940738..97d5c8219d 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -150,6 +150,11 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride ); +extern void GLAPIENTRY +_mesa_LockArraysEXT(GLint first, GLsizei count); + +extern void GLAPIENTRY +_mesa_UnlockArraysEXT( void ); extern void GLAPIENTRY diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 9229077f42..9287e8515c 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,8 +1,12 @@ /* * Mesa 3-D graphics library - * Version: 7.1 +<<<<<<< HEAD:src/mesa/main/version.h + * Version: 7.5 +======= + * Version: 7.4 +>>>>>>> origin/gallium-0.2:src/mesa/main/version.h * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,9 +33,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 1 +#define MESA_MINOR 5 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.1" +#define MESA_VERSION_STRING "7.5-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |