diff options
Diffstat (limited to 'src/mesa')
342 files changed, 21266 insertions, 25913 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index a9f3c8e727..4d21b033f7 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -56,6 +56,7 @@ #include "swrast/swrast.h" #include "driverfuncs.h" +#include "meta.h" @@ -100,12 +101,12 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexSubImage2D = _mesa_store_texsubimage2d; driver->TexSubImage3D = _mesa_store_texsubimage3d; driver->GetTexImage = _mesa_get_teximage; - driver->CopyTexImage1D = _swrast_copy_teximage1d; - driver->CopyTexImage2D = _swrast_copy_teximage2d; - driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; - driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; - driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; - driver->GenerateMipmap = _mesa_generate_mipmap; + driver->CopyTexImage1D = _mesa_meta_CopyTexImage1D; + driver->CopyTexImage2D = _mesa_meta_CopyTexImage2D; + driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; + driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; + driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D; + driver->GenerateMipmap = _mesa_meta_GenerateMipmap; driver->TestProxyTexImage = _mesa_test_proxy_teximage; driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d; @@ -124,15 +125,14 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UnmapTexture = NULL; driver->TextureMemCpy = _mesa_memcpy; driver->IsTextureResident = NULL; - driver->PrioritizeTexture = NULL; driver->ActiveTexture = NULL; driver->UpdateTexturePalette = NULL; /* imaging */ - driver->CopyColorTable = _swrast_CopyColorTable; - driver->CopyColorSubTable = _swrast_CopyColorSubTable; - driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + driver->CopyColorTable = _mesa_meta_CopyColorTable; + driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable; + driver->CopyConvolutionFilter1D = _mesa_meta_CopyConvolutionFilter1D; + driver->CopyConvolutionFilter2D = _mesa_meta_CopyConvolutionFilter2D; /* Vertex/fragment programs */ driver->BindProgram = NULL; @@ -182,7 +182,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; - driver->TextureMatrix = NULL; driver->Viewport = NULL; /* vertex arrays */ diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index b6c6ef70fd..b38f22e130 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -37,18 +37,25 @@ #include "main/arrayobj.h" #include "main/blend.h" #include "main/bufferobj.h" +#include "main/buffers.h" +#include "main/colortab.h" +#include "main/convolve.h" #include "main/depth.h" #include "main/enable.h" +#include "main/fbobject.h" #include "main/image.h" #include "main/macros.h" #include "main/matrix.h" +#include "main/mipmap.h" #include "main/polygon.h" #include "main/readpix.h" #include "main/scissor.h" #include "main/shaders.h" +#include "main/state.h" #include "main/stencil.h" #include "main/texobj.h" #include "main/texenv.h" +#include "main/texformat.h" #include "main/teximage.h" #include "main/texparam.h" #include "main/texstate.h" @@ -60,6 +67,33 @@ #include "drivers/common/meta.h" +/** Return offset in bytes of the field within a vertex struct */ +#define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD)) + + +/** + * Flags passed to _mesa_meta_begin(). + */ +/*@{*/ +#define META_ALL ~0x0 +#define META_ALPHA_TEST 0x1 +#define META_BLEND 0x2 /**< includes logicop */ +#define META_COLOR_MASK 0x4 +#define META_DEPTH_TEST 0x8 +#define META_FOG 0x10 +#define META_PIXEL_STORE 0x20 +#define META_PIXEL_TRANSFER 0x40 +#define META_RASTERIZATION 0x80 +#define META_SCISSOR 0x100 +#define META_SHADER 0x200 +#define META_STENCIL_TEST 0x400 +#define META_TRANSFORM 0x800 /**< modelview, projection, clip planes */ +#define META_TEXTURE 0x1000 +#define META_VERTEX 0x2000 +#define META_VIEWPORT 0x4000 +/*@}*/ + + /** * State which we may save/restore across meta ops. * XXX this may be incomplete... @@ -87,6 +121,17 @@ struct save_state /** META_PIXEL_STORE */ struct gl_pixelstore_attrib Pack, Unpack; + /** META_PIXEL_TRANSFER */ + GLfloat RedBias, RedScale; + GLfloat GreenBias, GreenScale; + GLfloat BlueBias, BlueScale; + GLfloat AlphaBias, AlphaScale; + GLfloat DepthBias, DepthScale; + GLboolean MapColorFlag; + GLboolean Convolution1DEnabled; + GLboolean Convolution2DEnabled; + GLboolean Separable2DEnabled; + /** META_RASTERIZATION */ GLenum FrontPolygonMode, BackPolygonMode; GLboolean PolygonOffset; @@ -138,6 +183,24 @@ struct save_state /** + * Temporary texture used for glBlitFramebuffer, glDrawPixels, etc. + * This is currently shared by all the meta ops. But we could create a + * separate one for each of glDrawPixel, glBlitFramebuffer, glCopyPixels, etc. + */ +struct temp_texture +{ + GLuint TexObj; + GLenum Target; /**< GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE */ + GLsizei MinSize; /**< Min texture size to allocate */ + GLsizei MaxSize; /**< Max possible texture size */ + GLboolean NPOT; /**< Non-power of two size OK? */ + GLsizei Width, Height; /**< Current texture size */ + GLenum IntFormat; + GLfloat Sright, Ttop; /**< right, top texcoords */ +}; + + +/** * State for glBlitFramebufer() */ struct blit_state @@ -181,19 +244,24 @@ struct drawpix_state /** - * Temporary texture used for glBlitFramebuffer, glDrawPixels, etc. - * This is currently shared by all the meta ops. But we could create a - * separate one for each of glDrawPixel, glBlitFramebuffer, glCopyPixels, etc. + * State for glBitmap() */ -struct temp_texture +struct bitmap_state { - GLuint TexObj; - GLenum Target; /**< GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE */ - GLsizei MaxSize; /**< Max possible texture size */ - GLboolean NPOT; /**< Non-power of two size OK? */ - GLsizei Width, Height; /**< Current texture size */ - GLenum IntFormat; - GLfloat Sright, Ttop; /**< right, top texcoords */ + GLuint ArrayObj; + GLuint VBO; + struct temp_texture Tex; /**< separate texture from other meta ops */ +}; + + +/** + * State for _mesa_meta_generate_mipmap() + */ +struct gen_mipmap_state +{ + GLuint ArrayObj; + GLuint VBO; + GLuint FBO; }; @@ -206,15 +274,12 @@ struct gl_meta_state struct temp_texture TempTex; - struct blit_state Blit; /**< For _mesa_meta_blit_framebuffer() */ - struct clear_state Clear; /**< For _mesa_meta_clear() */ - struct copypix_state CopyPix; /**< For _mesa_meta_copy_pixels() */ - struct drawpix_state DrawPix; /**< For _mesa_meta_draw_pixels() */ - - /* other possible meta-ops: - * glBitmap() - * glGenerateMipmap() - */ + struct blit_state Blit; /**< For _mesa_meta_BlitFramebuffer() */ + struct clear_state Clear; /**< For _mesa_meta_Clear() */ + struct copypix_state CopyPix; /**< For _mesa_meta_CopyPixels() */ + struct drawpix_state DrawPix; /**< For _mesa_meta_DrawPixels() */ + struct bitmap_state Bitmap; /**< For _mesa_meta_Bitmap() */ + struct gen_mipmap_state Mipmap; /**< For _mesa_meta_GenerateMipmap() */ }; @@ -264,16 +329,16 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_ALPHA_TEST) { save->AlphaEnabled = ctx->Color.AlphaEnabled; if (ctx->Color.AlphaEnabled) - _mesa_Disable(GL_ALPHA_TEST); + _mesa_set_enable(ctx, GL_ALPHA_TEST, GL_FALSE); } if (state & META_BLEND) { save->BlendEnabled = ctx->Color.BlendEnabled; if (ctx->Color.BlendEnabled) - _mesa_Disable(GL_BLEND); + _mesa_set_enable(ctx, GL_BLEND, GL_FALSE); save->ColorLogicOpEnabled = ctx->Color.ColorLogicOpEnabled; if (ctx->Color.ColorLogicOpEnabled) - _mesa_Disable(GL_COLOR_LOGIC_OP); + _mesa_set_enable(ctx, GL_COLOR_LOGIC_OP, GL_FALSE); } if (state & META_COLOR_MASK) { @@ -288,7 +353,7 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_DEPTH_TEST) { save->Depth = ctx->Depth; /* struct copy */ if (ctx->Depth.Test) - _mesa_Disable(GL_DEPTH_TEST); + _mesa_set_enable(ctx, GL_DEPTH_TEST, GL_FALSE); } if (state & META_FOG) { @@ -304,6 +369,35 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) ctx->Unpack = ctx->DefaultPacking; } + if (state & META_PIXEL_TRANSFER) { + save->RedScale = ctx->Pixel.RedScale; + save->RedBias = ctx->Pixel.RedBias; + save->GreenScale = ctx->Pixel.GreenScale; + save->GreenBias = ctx->Pixel.GreenBias; + save->BlueScale = ctx->Pixel.BlueScale; + save->BlueBias = ctx->Pixel.BlueBias; + save->AlphaScale = ctx->Pixel.AlphaScale; + save->AlphaBias = ctx->Pixel.AlphaBias; + save->MapColorFlag = ctx->Pixel.MapColorFlag; + save->Convolution1DEnabled = ctx->Pixel.Convolution1DEnabled; + save->Convolution2DEnabled = ctx->Pixel.Convolution2DEnabled; + save->Separable2DEnabled = ctx->Pixel.Separable2DEnabled; + ctx->Pixel.RedScale = 1.0F; + ctx->Pixel.RedBias = 0.0F; + ctx->Pixel.GreenScale = 1.0F; + ctx->Pixel.GreenBias = 0.0F; + ctx->Pixel.BlueScale = 1.0F; + ctx->Pixel.BlueBias = 0.0F; + ctx->Pixel.AlphaScale = 1.0F; + ctx->Pixel.AlphaBias = 0.0F; + ctx->Pixel.MapColorFlag = GL_FALSE; + ctx->Pixel.Convolution1DEnabled = GL_FALSE; + ctx->Pixel.Convolution2DEnabled = GL_FALSE; + ctx->Pixel.Separable2DEnabled = GL_FALSE; + /* XXX more state */ + ctx->NewState |=_NEW_PIXEL; + } + if (state & META_RASTERIZATION) { save->FrontPolygonMode = ctx->Polygon.FrontMode; save->BackPolygonMode = ctx->Polygon.BackMode; @@ -345,7 +439,7 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_STENCIL_TEST) { save->Stencil = ctx->Stencil; /* struct copy */ if (ctx->Stencil.Enabled) - _mesa_Disable(GL_STENCIL_TEST); + _mesa_set_enable(ctx, GL_STENCIL_TEST, GL_FALSE); /* NOTE: other stencil state not reset */ } @@ -499,6 +593,23 @@ _mesa_meta_end(GLcontext *ctx) ctx->Unpack = save->Unpack; } + if (state & META_PIXEL_TRANSFER) { + ctx->Pixel.RedScale = save->RedScale; + ctx->Pixel.RedBias = save->RedBias; + ctx->Pixel.GreenScale = save->GreenScale; + ctx->Pixel.GreenBias = save->GreenBias; + ctx->Pixel.BlueScale = save->BlueScale; + ctx->Pixel.BlueBias = save->BlueBias; + ctx->Pixel.AlphaScale = save->AlphaScale; + ctx->Pixel.AlphaBias = save->AlphaBias; + ctx->Pixel.MapColorFlag = save->MapColorFlag; + ctx->Pixel.Convolution1DEnabled = save->Convolution1DEnabled; + ctx->Pixel.Convolution2DEnabled = save->Convolution2DEnabled; + ctx->Pixel.Separable2DEnabled = save->Separable2DEnabled; + /* XXX more state */ + ctx->NewState |=_NEW_PIXEL; + } + if (state & META_RASTERIZATION) { _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode); _mesa_PolygonMode(GL_BACK, save->BackPolygonMode); @@ -669,8 +780,35 @@ _mesa_meta_end(GLcontext *ctx) /** - * Return pointer to temp_texture info. This does some one-time init - * if needed. + * One-time init for a temp_texture object. + * Choose tex target, compute max tex size, etc. + */ +static void +init_temp_texture(GLcontext *ctx, struct temp_texture *tex) +{ + /* prefer texture rectangle */ + if (ctx->Extensions.NV_texture_rectangle) { + tex->Target = GL_TEXTURE_RECTANGLE; + tex->MaxSize = ctx->Const.MaxTextureRectSize; + tex->NPOT = GL_TRUE; + } + else { + /* use 2D texture, NPOT if possible */ + tex->Target = GL_TEXTURE_2D; + tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1); + tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two; + } + tex->MinSize = 16; /* 16 x 16 at least */ + assert(tex->MaxSize > 0); + + _mesa_GenTextures(1, &tex->TexObj); + _mesa_BindTexture(tex->Target, tex->TexObj); +} + + +/** + * Return pointer to temp_texture info for non-bitmap ops. + * This does some one-time init if needed. */ static struct temp_texture * get_temp_texture(GLcontext *ctx) @@ -678,24 +816,25 @@ get_temp_texture(GLcontext *ctx) struct temp_texture *tex = &ctx->Meta->TempTex; if (!tex->TexObj) { - /* do one-time init */ + init_temp_texture(ctx, tex); + } - /* prefer texture rectangle */ - if (ctx->Extensions.NV_texture_rectangle) { - tex->Target = GL_TEXTURE_RECTANGLE; - tex->MaxSize = ctx->Const.MaxTextureRectSize; - tex->NPOT = GL_TRUE; - } - else { - /* use 2D texture, NPOT if possible */ - tex->Target = GL_TEXTURE_2D; - tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1); - tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two; - } - assert(tex->MaxSize > 0); + return tex; +} - _mesa_GenTextures(1, &tex->TexObj); - _mesa_BindTexture(tex->Target, tex->TexObj); + +/** + * Return pointer to temp_texture info for _mesa_meta_bitmap(). + * We use a separate texture for bitmaps to reduce texture + * allocation/deallocation. + */ +static struct temp_texture * +get_bitmap_temp_texture(GLcontext *ctx) +{ + struct temp_texture *tex = &ctx->Meta->Bitmap.Tex; + + if (!tex->TexObj) { + init_temp_texture(ctx, tex); } return tex; @@ -717,6 +856,9 @@ alloc_texture(struct temp_texture *tex, { GLboolean newTex = GL_FALSE; + ASSERT(width <= tex->MaxSize); + ASSERT(height <= tex->MaxSize); + if (width > tex->Width || height > tex->Height || intFormat != tex->IntFormat) { @@ -724,13 +866,13 @@ alloc_texture(struct temp_texture *tex, if (tex->NPOT) { /* use non-power of two size */ - tex->Width = width; - tex->Height = height; + tex->Width = MAX2(tex->MinSize, width); + tex->Height = MAX2(tex->MinSize, height); } else { /* find power of two size */ GLsizei w, h; - w = h = 16; + w = h = tex->MinSize; while (w < width) w *= 2; while (h < height) @@ -803,7 +945,8 @@ setup_copypix_texture(struct temp_texture *tex, * Setup/load texture for glDrawPixels. */ static void -setup_drawpix_texture(struct temp_texture *tex, +setup_drawpix_texture(GLcontext *ctx, + struct temp_texture *tex, GLboolean newTex, GLenum texIntFormat, GLsizei width, GLsizei height, @@ -824,9 +967,17 @@ setup_drawpix_texture(struct temp_texture *tex, tex->Width, tex->Height, 0, format, type, pixels); } else { + struct gl_buffer_object *save_unpack_obj = NULL; + + _mesa_reference_buffer_object(ctx, &save_unpack_obj, + ctx->Unpack.BufferObj); + _mesa_BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); /* create empty texture */ _mesa_TexImage2D(tex->Target, 0, tex->IntFormat, tex->Width, tex->Height, 0, format, type, NULL); + if (save_unpack_obj != NULL) + _mesa_BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + save_unpack_obj->Name); /* load image */ _mesa_TexSubImage2D(tex->Target, 0, 0, 0, width, height, format, type, pixels); @@ -874,14 +1025,143 @@ init_blit_depth_pixels(GLcontext *ctx) /** + * Try to do a glBiltFramebuffer using no-copy texturing. + * We can do this when the src renderbuffer is actually a texture. + * But if the src buffer == dst buffer we cannot do this. + * + * \return new buffer mask indicating the buffers left to blit using the + * normal path. + */ +static GLbitfield +blitframebuffer_texture(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + if (mask & GL_COLOR_BUFFER_BIT) { + const struct gl_framebuffer *drawFb = ctx->DrawBuffer; + const struct gl_framebuffer *readFb = ctx->ReadBuffer; + const struct gl_renderbuffer_attachment *drawAtt = + &drawFb->Attachment[drawFb->_ColorDrawBufferIndexes[0]]; + const struct gl_renderbuffer_attachment *readAtt = + &readFb->Attachment[readFb->_ColorReadBufferIndex]; + + if (readAtt && readAtt->Texture) { + const struct gl_texture_object *texObj = readAtt->Texture; + const GLuint srcLevel = readAtt->TextureLevel; + const GLenum minFilterSave = texObj->MinFilter; + const GLenum magFilterSave = texObj->MagFilter; + const GLint baseLevelSave = texObj->BaseLevel; + const GLint maxLevelSave = texObj->MaxLevel; + const GLenum wrapSSave = texObj->WrapS; + const GLenum wrapTSave = texObj->WrapT; + const GLenum target = texObj->Target; + + if (drawAtt->Texture == readAtt->Texture) { + /* Can't use same texture as both the source and dest. We need + * to handle overlapping blits and besides, some hw may not + * support this. + */ + return mask; + } + + if (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_ARB) { + /* Can't handle other texture types at this time */ + return mask; + } + + /* + printf("Blit from texture!\n"); + printf(" srcAtt %p dstAtt %p\n", readAtt, drawAtt); + printf(" srcTex %p dstText %p\n", texObj, drawAtt->Texture); + */ + + /* Prepare src texture state */ + _mesa_BindTexture(target, texObj->Name); + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + _mesa_set_enable(ctx, target, GL_TRUE); + + /* Prepare vertex data (the VBO was previously created and bound) */ + { + struct vertex { + GLfloat x, y, s, t; + }; + struct vertex verts[4]; + GLfloat s0, t0, s1, t1; + + if (target == GL_TEXTURE_2D) { + const struct gl_texture_image *texImage + = _mesa_select_tex_image(ctx, texObj, target, srcLevel); + s0 = srcX0 / (float) texImage->Width; + s1 = srcX1 / (float) texImage->Width; + t0 = srcY0 / (float) texImage->Height; + t1 = srcY1 / (float) texImage->Height; + } + else { + assert(target == GL_TEXTURE_RECTANGLE_ARB); + s0 = srcX0; + s1 = srcX1; + t0 = srcY0; + t1 = srcY1; + } + + verts[0].x = (GLfloat) dstX0; + verts[0].y = (GLfloat) dstY0; + verts[1].x = (GLfloat) dstX1; + verts[1].y = (GLfloat) dstY0; + verts[2].x = (GLfloat) dstX1; + verts[2].y = (GLfloat) dstY1; + verts[3].x = (GLfloat) dstX0; + verts[3].y = (GLfloat) dstY1; + + verts[0].s = s0; + verts[0].t = t0; + verts[1].s = s1; + verts[1].t = t0; + verts[2].s = s1; + verts[2].t = t1; + verts[3].s = s0; + verts[3].t = t1; + + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + + /* Restore texture object state, the texture binding will + * be restored by _mesa_meta_end(). + */ + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); + + /* Done with color buffer */ + mask &= ~GL_COLOR_BUFFER_BIT; + } + } + + return mask; +} + + +/** * Meta implementation of ctx->Driver.BlitFramebuffer() in terms * of texture mapping and polygon rendering. */ void -_mesa_meta_blit_framebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) +_mesa_meta_BlitFramebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) { struct blit_state *blit = &ctx->Meta->Blit; struct temp_texture *tex = get_temp_texture(ctx); @@ -892,7 +1172,10 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, const GLint srcH = abs(srcY1 - srcY0); const GLboolean srcFlipX = srcX1 < srcX0; const GLboolean srcFlipY = srcY1 < srcY0; - GLfloat verts[4][4]; /* four verts of X,Y,S,T */ + struct vertex { + GLfloat x, y, s, t; + }; + struct vertex verts[4]; GLboolean newTex; if (srcW > maxTexSize || srcH > maxTexSize) { @@ -931,10 +1214,8 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (2 * sizeof(GLfloat))); + _mesa_VertexPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); } @@ -943,33 +1224,45 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, blit->VBO); } + /* Try faster, direct texture approach first */ + mask = blitframebuffer_texture(ctx, srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, mask, filter); + if (mask == 0x0) { + _mesa_meta_end(ctx); + return; + } + + /* Continue with "normal" approach which involves copying the src rect + * into a temporary texture and is "blitted" by drawing a textured quad. + */ + newTex = alloc_texture(tex, srcW, srcH, GL_RGBA); /* vertex positions/texcoords (after texture allocation!) */ { - verts[0][0] = (GLfloat) dstX0; - verts[0][1] = (GLfloat) dstY0; - verts[1][0] = (GLfloat) dstX1; - verts[1][1] = (GLfloat) dstY0; - verts[2][0] = (GLfloat) dstX1; - verts[2][1] = (GLfloat) dstY1; - verts[3][0] = (GLfloat) dstX0; - verts[3][1] = (GLfloat) dstY1; - - verts[0][2] = 0.0F; - verts[0][3] = 0.0F; - verts[1][2] = tex->Sright; - verts[1][3] = 0.0F; - verts[2][2] = tex->Sright; - verts[2][3] = tex->Ttop; - verts[3][2] = 0.0F; - verts[3][3] = tex->Ttop; + verts[0].x = (GLfloat) dstX0; + verts[0].y = (GLfloat) dstY0; + verts[1].x = (GLfloat) dstX1; + verts[1].y = (GLfloat) dstY0; + verts[2].x = (GLfloat) dstX1; + verts[2].y = (GLfloat) dstY1; + verts[3].x = (GLfloat) dstX0; + verts[3].y = (GLfloat) dstY1; + + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; /* upload new vertex data */ _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); } - _mesa_Enable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_TRUE); if (mask & GL_COLOR_BUFFER_BIT) { setup_copypix_texture(tex, newTex, srcX, srcY, srcW, srcH, @@ -990,7 +1283,7 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, _mesa_ReadPixels(srcX, srcY, srcW, srcH, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp); - setup_drawpix_texture(tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH, + setup_drawpix_texture(ctx, tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); @@ -1011,7 +1304,7 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, /* XXX can't easily do stencil */ } - _mesa_Disable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_FALSE); _mesa_meta_end(ctx); @@ -1026,10 +1319,13 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, * Meta implementation of ctx->Driver.Clear() in terms of polygon rendering. */ void -_mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) +_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers) { struct clear_state *clear = &ctx->Meta->Clear; - GLfloat verts[4][7]; /* four verts of X,Y,Z,R,G,B,A */ + struct vertex { + GLfloat x, y, z, r, g, b, a; + }; + struct vertex verts[4]; /* save all state but scissor, pixel pack/unpack */ GLbitfield metaSave = META_ALL - META_SCISSOR - META_PIXEL_STORE; @@ -1050,14 +1346,10 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) /* create vertex array buffer */ _mesa_GenBuffersARB(1, &clear->VBO); _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, clear->VBO); - _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), - NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_ColorPointer(4, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_ColorPointer(4, GL_FLOAT, sizeof(struct vertex), OFFSET(r)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_COLOR_ARRAY); } @@ -1107,26 +1399,30 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) const GLfloat z = 1.0 - 2.0 * ctx->Depth.Clear; GLuint i; - verts[0][0] = x0; - verts[0][1] = y0; - verts[0][2] = z; - verts[1][0] = x1; - verts[1][1] = y0; - verts[1][2] = z; - verts[2][0] = x1; - verts[2][1] = y1; - verts[2][2] = z; - verts[3][0] = x0; - verts[3][1] = y1; - verts[3][2] = z; + verts[0].x = x0; + verts[0].y = y0; + verts[0].z = z; + verts[1].x = x1; + verts[1].y = y0; + verts[1].z = z; + verts[2].x = x1; + verts[2].y = y1; + verts[2].z = z; + verts[3].x = x0; + verts[3].y = y1; + verts[3].z = z; /* vertex colors */ for (i = 0; i < 4; i++) { - COPY_4FV(&verts[i][3], ctx->Color.ClearColor); + verts[i].r = ctx->Color.ClearColor[0]; + verts[i].g = ctx->Color.ClearColor[1]; + verts[i].b = ctx->Color.ClearColor[2]; + verts[i].a = ctx->Color.ClearColor[3]; } /* upload new vertex data */ - _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts, + GL_DYNAMIC_DRAW_ARB); } /* draw quad */ @@ -1141,13 +1437,16 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) * of texture mapping and polygon rendering. */ void -_mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, - GLsizei width, GLsizei height, - GLint dstX, GLint dstY, GLenum type) +_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcX, GLint srcY, + GLsizei width, GLsizei height, + GLint dstX, GLint dstY, GLenum type) { struct copypix_state *copypix = &ctx->Meta->CopyPix; struct temp_texture *tex = get_temp_texture(ctx); - GLfloat verts[4][5]; /* four verts of X,Y,Z,S,T */ + struct vertex { + GLfloat x, y, z, s, t; + }; + struct vertex verts[4]; GLboolean newTex; GLenum intFormat = GL_RGBA; @@ -1185,10 +1484,8 @@ _mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); } @@ -1207,26 +1504,26 @@ _mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, const GLfloat dstY1 = dstY + height * ctx->Pixel.ZoomY; const GLfloat z = ctx->Current.RasterPos[2]; - verts[0][0] = dstX0; - verts[0][1] = dstY0; - verts[0][2] = z; - verts[0][3] = 0.0F; - verts[0][4] = 0.0F; - verts[1][0] = dstX1; - verts[1][1] = dstY0; - verts[1][2] = z; - verts[1][3] = tex->Sright; - verts[1][4] = 0.0F; - verts[2][0] = dstX1; - verts[2][1] = dstY1; - verts[2][2] = z; - verts[2][3] = tex->Sright; - verts[2][4] = tex->Ttop; - verts[3][0] = dstX0; - verts[3][1] = dstY1; - verts[3][2] = z; - verts[3][3] = 0.0F; - verts[3][4] = tex->Ttop; + verts[0].x = dstX0; + verts[0].y = dstY0; + verts[0].z = z; + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].x = dstX1; + verts[1].y = dstY0; + verts[1].z = z; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].x = dstX1; + verts[2].y = dstY1; + verts[2].z = z; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].x = dstX0; + verts[3].y = dstY1; + verts[3].z = z; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; /* upload new vertex data */ _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); @@ -1236,12 +1533,12 @@ _mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, setup_copypix_texture(tex, newTex, srcX, srcY, width, height, GL_RGBA, GL_NEAREST); - _mesa_Enable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_TRUE); /* draw textured quad */ _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - _mesa_Disable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_FALSE); _mesa_meta_end(ctx); } @@ -1279,9 +1576,8 @@ tiled_draw_pixels(GLcontext *ctx, tileUnpack.SkipRows = unpack->SkipRows + j; - _mesa_meta_draw_pixels(ctx, tileX, tileY, - tileWidth, tileHeight, - format, type, &tileUnpack, pixels); + _mesa_meta_DrawPixels(ctx, tileX, tileY, tileWidth, tileHeight, + format, type, &tileUnpack, pixels); } } } @@ -1390,17 +1686,20 @@ init_draw_depth_pixels(GLcontext *ctx) * of texture mapping and polygon rendering. */ void -_mesa_meta_draw_pixels(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) +_mesa_meta_DrawPixels(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels) { struct drawpix_state *drawpix = &ctx->Meta->DrawPix; struct temp_texture *tex = get_temp_texture(ctx); const struct gl_pixelstore_attrib unpackSave = ctx->Unpack; const GLuint origStencilMask = ctx->Stencil.WriteMask[0]; - GLfloat verts[4][5]; /* four verts of X,Y,Z,S,T */ + struct vertex { + GLfloat x, y, z, s, t; + }; + struct vertex verts[4]; GLenum texIntFormat; GLboolean fallback, newTex; GLbitfield metaExtraSave = 0x0; @@ -1494,26 +1793,26 @@ _mesa_meta_draw_pixels(GLcontext *ctx, const GLfloat y1 = y + height * ctx->Pixel.ZoomY; const GLfloat z = ctx->Current.RasterPos[2]; - verts[0][0] = x0; - verts[0][1] = y0; - verts[0][2] = z; - verts[0][3] = 0.0F; - verts[0][4] = 0.0F; - verts[1][0] = x1; - verts[1][1] = y0; - verts[1][2] = z; - verts[1][3] = tex->Sright; - verts[1][4] = 0.0F; - verts[2][0] = x1; - verts[2][1] = y1; - verts[2][2] = z; - verts[2][3] = tex->Sright; - verts[2][4] = tex->Ttop; - verts[3][0] = x0; - verts[3][1] = y1; - verts[3][2] = z; - verts[3][3] = 0.0F; - verts[3][4] = tex->Ttop; + verts[0].x = x0; + verts[0].y = y0; + verts[0].z = z; + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].x = x1; + verts[1].y = y0; + verts[1].z = z; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].x = x1; + verts[2].y = y1; + verts[2].z = z; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].x = x0; + verts[3].y = y1; + verts[3].z = z; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; } if (drawpix->ArrayObj == 0) { @@ -1529,17 +1828,15 @@ _mesa_meta_draw_pixels(GLcontext *ctx, verts, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); _mesa_EnableClientState(GL_VERTEX_ARRAY); _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); /* set given unpack params */ ctx->Unpack = *unpack; - _mesa_Enable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_TRUE); if (_mesa_is_stencil_format(format)) { /* Drawing stencil */ @@ -1548,7 +1845,7 @@ _mesa_meta_draw_pixels(GLcontext *ctx, if (!drawpix->StencilFP) init_draw_stencil_pixels(ctx); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, GL_ALPHA, type, pixels); _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); @@ -1591,19 +1888,19 @@ _mesa_meta_draw_pixels(GLcontext *ctx, _mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, ctx->Current.RasterColor); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, format, type, pixels); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } else { /* Drawing RGBA */ - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, format, type, pixels); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } - _mesa_Disable(tex->Target); + _mesa_set_enable(ctx, tex->Target, GL_FALSE); _mesa_DeleteBuffersARB(1, &vbo); @@ -1612,3 +1909,889 @@ _mesa_meta_draw_pixels(GLcontext *ctx, _mesa_meta_end(ctx); } + + +/** + * Do glBitmap with a alpha texture quad. Use the alpha test to + * cull the 'off' bits. If alpha test is already enabled, fall back + * to swrast (should be a rare case). + * A bitmap cache as in the gallium/mesa state tracker would + * improve performance a lot. + */ +void +_mesa_meta_Bitmap(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap1) +{ + struct bitmap_state *bitmap = &ctx->Meta->Bitmap; + struct temp_texture *tex = get_bitmap_temp_texture(ctx); + const GLenum texIntFormat = GL_ALPHA; + const struct gl_pixelstore_attrib unpackSave = *unpack; + struct vertex { + GLfloat x, y, z, s, t, r, g, b, a; + }; + struct vertex verts[4]; + GLboolean newTex; + GLubyte *bitmap8; + + /* + * Check if swrast fallback is needed. + */ + if (ctx->_ImageTransferState || + ctx->Color.AlphaEnabled || + ctx->Fog.Enabled || + ctx->Texture._EnabledUnits || + width > tex->MaxSize || + height > tex->MaxSize) { + _swrast_Bitmap(ctx, x, y, width, height, unpack, bitmap1); + return; + } + + /* Most GL state applies to glBitmap (like blending, stencil, etc), + * but a there's a few things we need to override: + */ + _mesa_meta_begin(ctx, (META_ALPHA_TEST | + META_PIXEL_STORE | + META_RASTERIZATION | + META_SHADER | + META_TEXTURE | + META_TRANSFORM | + META_VERTEX | + META_VIEWPORT)); + + if (bitmap->ArrayObj == 0) { + /* one-time setup */ + + /* create vertex array object */ + _mesa_GenVertexArraysAPPLE(1, &bitmap->ArrayObj); + _mesa_BindVertexArrayAPPLE(bitmap->ArrayObj); + + /* create vertex array buffer */ + _mesa_GenBuffersARB(1, &bitmap->VBO); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, bitmap->VBO); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), + NULL, GL_DYNAMIC_DRAW_ARB); + + /* setup vertex arrays */ + _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); + _mesa_ColorPointer(4, GL_FLOAT, sizeof(struct vertex), OFFSET(r)); + _mesa_EnableClientState(GL_VERTEX_ARRAY); + _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); + _mesa_EnableClientState(GL_COLOR_ARRAY); + } + else { + _mesa_BindVertexArray(bitmap->ArrayObj); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, bitmap->VBO); + } + + newTex = alloc_texture(tex, width, height, texIntFormat); + + /* vertex positions, texcoords, colors (after texture allocation!) */ + { + const GLfloat x0 = (GLfloat) x; + const GLfloat y0 = (GLfloat) y; + const GLfloat x1 = (GLfloat) (x + width); + const GLfloat y1 = (GLfloat) (y + height); + const GLfloat z = ctx->Current.RasterPos[2]; + GLuint i; + + verts[0].x = x0; + verts[0].y = y0; + verts[0].z = z; + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[1].x = x1; + verts[1].y = y0; + verts[1].z = z; + verts[1].s = tex->Sright; + verts[1].t = 0.0F; + verts[2].x = x1; + verts[2].y = y1; + verts[2].z = z; + verts[2].s = tex->Sright; + verts[2].t = tex->Ttop; + verts[3].x = x0; + verts[3].y = y1; + verts[3].z = z; + verts[3].s = 0.0F; + verts[3].t = tex->Ttop; + + for (i = 0; i < 4; i++) { + verts[i].r = ctx->Current.RasterColor[0]; + verts[i].g = ctx->Current.RasterColor[1]; + verts[i].b = ctx->Current.RasterColor[2]; + verts[i].a = ctx->Current.RasterColor[3]; + } + + /* upload new vertex data */ + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + bitmap1 = _mesa_map_pbo_source(ctx, &unpackSave, bitmap1); + if (!bitmap1) + return; + + bitmap8 = (GLubyte *) _mesa_calloc(width * height); + if (bitmap8) { + _mesa_expand_bitmap(width, height, &unpackSave, bitmap1, + bitmap8, width, 0xff); + + _mesa_set_enable(ctx, tex->Target, GL_TRUE); + + _mesa_set_enable(ctx, GL_ALPHA_TEST, GL_TRUE); + _mesa_AlphaFunc(GL_GREATER, 0.0); + + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, + GL_ALPHA, GL_UNSIGNED_BYTE, bitmap8); + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + + _mesa_set_enable(ctx, tex->Target, GL_FALSE); + + _mesa_free(bitmap8); + } + + _mesa_unmap_pbo_source(ctx, &unpackSave); + + _mesa_meta_end(ctx); +} + + +/** + * Check if the call to _mesa_meta_GenerateMipmap() will require a + * software fallback. The fallback path will require that the texture + * images are mapped. + * \return GL_TRUE if a fallback is needed, GL_FALSE otherwise + */ +GLboolean +_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + const GLuint fboSave = ctx->DrawBuffer->Name; + struct gen_mipmap_state *mipmap = &ctx->Meta->Mipmap; + struct gl_texture_image *baseImage; + GLuint srcLevel; + GLenum status; + + /* check for fallbacks */ + if (!ctx->Extensions.EXT_framebuffer_object || + target == GL_TEXTURE_3D) { + return GL_TRUE; + } + + srcLevel = texObj->BaseLevel; + baseImage = _mesa_select_tex_image(ctx, texObj, target, srcLevel); + if (!baseImage || baseImage->IsCompressed) { + return GL_TRUE; + } + + /* + * Test that we can actually render in the texture's format. + */ + if (!mipmap->FBO) + _mesa_GenFramebuffersEXT(1, &mipmap->FBO); + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); + + if (target == GL_TEXTURE_1D) { + _mesa_FramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel); + } + else if (target == GL_TEXTURE_3D) { + GLint zoffset = 0; + _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel, zoffset); + } + else { + /* 2D / cube */ + _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel); + } + + status = _mesa_CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); + + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + return GL_TRUE; + } + + return GL_FALSE; +} + + +/** + * Called via ctx->Driver.GenerateMipmap() + * Note: texture borders and 3D texture support not yet complete. + */ +void +_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + struct gen_mipmap_state *mipmap = &ctx->Meta->Mipmap; + struct vertex { + GLfloat x, y, s, t, r; + }; + struct vertex verts[4]; + const GLuint baseLevel = texObj->BaseLevel; + const GLuint maxLevel = texObj->MaxLevel; + const GLenum minFilterSave = texObj->MinFilter; + const GLenum magFilterSave = texObj->MagFilter; + const GLint baseLevelSave = texObj->BaseLevel; + const GLint maxLevelSave = texObj->MaxLevel; + const GLboolean genMipmapSave = texObj->GenerateMipmap; + const GLenum wrapSSave = texObj->WrapS; + const GLenum wrapTSave = texObj->WrapT; + const GLenum wrapRSave = texObj->WrapR; + const GLuint fboSave = ctx->DrawBuffer->Name; + GLenum faceTarget; + GLuint dstLevel; + GLuint border = 0; + + if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) { + _mesa_generate_mipmap(ctx, target, texObj); + return; + } + + if (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && + target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) { + faceTarget = target; + target = GL_TEXTURE_CUBE_MAP; + } + else { + faceTarget = target; + } + + _mesa_meta_begin(ctx, META_ALL); + + if (mipmap->ArrayObj == 0) { + /* one-time setup */ + + /* create vertex array object */ + _mesa_GenVertexArraysAPPLE(1, &mipmap->ArrayObj); + _mesa_BindVertexArrayAPPLE(mipmap->ArrayObj); + + /* create vertex array buffer */ + _mesa_GenBuffersARB(1, &mipmap->VBO); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), + NULL, GL_DYNAMIC_DRAW_ARB); + + /* setup vertex arrays */ + _mesa_VertexPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); + _mesa_TexCoordPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(s)); + _mesa_EnableClientState(GL_VERTEX_ARRAY); + _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); + } + else { + _mesa_BindVertexArray(mipmap->ArrayObj); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO); + } + + if (!mipmap->FBO) { + _mesa_GenFramebuffersEXT(1, &mipmap->FBO); + } + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); + + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + _mesa_set_enable(ctx, target, GL_TRUE); + + /* setup texcoords once (XXX what about border?) */ + switch (faceTarget) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + verts[0].s = 0.0F; + verts[0].t = 0.0F; + verts[0].r = 0.0F; + verts[1].s = 1.0F; + verts[1].t = 0.0F; + verts[1].r = 0.0F; + verts[2].s = 1.0F; + verts[2].t = 1.0F; + verts[2].r = 0.0F; + verts[3].s = 0.0F; + verts[3].t = 1.0F; + verts[3].r = 0.0F; + break; + case GL_TEXTURE_3D: + abort(); + break; + default: + /* cube face */ + { + static const GLfloat st[4][2] = { + {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f} + }; + GLuint i; + + /* loop over quad verts */ + for (i = 0; i < 4; i++) { + /* Compute sc = +/-scale and tc = +/-scale. + * Not +/-1 to avoid cube face selection ambiguity near the edges, + * though that can still sometimes happen with this scale factor... + */ + const GLfloat scale = 0.9999f; + const GLfloat sc = (2.0f * st[i][0] - 1.0f) * scale; + const GLfloat tc = (2.0f * st[i][1] - 1.0f) * scale; + + switch (faceTarget) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + verts[i].s = 1.0f; + verts[i].t = -tc; + verts[i].r = -sc; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + verts[i].s = -1.0f; + verts[i].t = -tc; + verts[i].r = sc; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + verts[i].s = sc; + verts[i].t = 1.0f; + verts[i].r = tc; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + verts[i].s = sc; + verts[i].t = -1.0f; + verts[i].r = -tc; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + verts[i].s = sc; + verts[i].t = -tc; + verts[i].r = 1.0f; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + verts[i].s = -sc; + verts[i].t = -tc; + verts[i].r = -1.0f; + break; + default: + assert(0); + } + } + } + } + + _mesa_set_enable(ctx, target, GL_TRUE); + + /* texture is already locked, unlock now */ + _mesa_unlock_texture(ctx, texObj); + + for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) { + const struct gl_texture_image *srcImage; + const GLuint srcLevel = dstLevel - 1; + GLsizei srcWidth, srcHeight, srcDepth; + GLsizei dstWidth, dstHeight, dstDepth; + GLenum status; + + srcImage = _mesa_select_tex_image(ctx, texObj, faceTarget, srcLevel); + assert(srcImage->Border == 0); /* XXX we can fix this */ + + /* src size w/out border */ + srcWidth = srcImage->Width - 2 * border; + srcHeight = srcImage->Height - 2 * border; + srcDepth = srcImage->Depth - 2 * border; + + /* new dst size w/ border */ + dstWidth = MAX2(1, srcWidth / 2) + 2 * border; + dstHeight = MAX2(1, srcHeight / 2) + 2 * border; + dstDepth = MAX2(1, srcDepth / 2) + 2 * border; + + if (dstWidth == srcImage->Width && + dstHeight == srcImage->Height && + dstDepth == srcImage->Depth) { + /* all done */ + break; + } + + /* Create empty dest image */ + if (target == GL_TEXTURE_1D) { + _mesa_TexImage1D(target, dstLevel, srcImage->InternalFormat, + dstWidth, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else if (target == GL_TEXTURE_3D) { + _mesa_TexImage3D(target, dstLevel, srcImage->InternalFormat, + dstWidth, dstHeight, dstDepth, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else { + /* 2D or cube */ + _mesa_TexImage2D(faceTarget, dstLevel, srcImage->InternalFormat, + dstWidth, dstHeight, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + + if (target == GL_TEXTURE_CUBE_MAP) { + /* If texturing from a cube, we need to make sure all src faces + * have been defined (even if we're not sampling from them.) + * Otherwise the texture object will be 'incomplete' and + * texturing from it will not be allowed. + */ + GLuint face; + for (face = 0; face < 6; face++) { + if (!texObj->Image[face][srcLevel] || + texObj->Image[face][srcLevel]->Width != srcWidth) { + _mesa_TexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, + srcLevel, srcImage->InternalFormat, + srcWidth, srcHeight, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + } + } + } + + /* setup vertex positions */ + { + verts[0].x = 0.0F; + verts[0].y = 0.0F; + verts[1].x = (GLfloat) dstWidth; + verts[1].y = 0.0F; + verts[2].x = (GLfloat) dstWidth; + verts[2].y = (GLfloat) dstHeight; + verts[3].x = 0.0F; + verts[3].y = (GLfloat) dstHeight; + + /* upload new vertex data */ + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + /* limit sampling to src level */ + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); + + /* Set to draw into the current dstLevel */ + if (target == GL_TEXTURE_1D) { + _mesa_FramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, + texObj->Name, + dstLevel); + } + else if (target == GL_TEXTURE_3D) { + GLint zoffset = 0; /* XXX unfinished */ + _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, + texObj->Name, + dstLevel, zoffset); + } + else { + /* 2D / cube */ + _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + faceTarget, + texObj->Name, + dstLevel); + } + + _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); + + /* sanity check */ + status = _mesa_CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + abort(); + break; + } + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + } + + _mesa_lock_texture(ctx, texObj); /* relock */ + + _mesa_meta_end(ctx); + + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, wrapRSave); + + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); +} + + +/** + * Determine the GL data type to use for the temporary image read with + * ReadPixels() and passed to Tex[Sub]Image(). + */ +static GLenum +get_temp_image_type(GLcontext *ctx, GLenum baseFormat) +{ + switch (baseFormat) { + case GL_RGBA: + case GL_RGB: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_INTENSITY: + if (ctx->DrawBuffer->Visual.redBits <= 8) + return GL_UNSIGNED_BYTE; + else if (ctx->DrawBuffer->Visual.redBits <= 8) + return GL_UNSIGNED_SHORT; + else + return GL_FLOAT; + case GL_DEPTH_COMPONENT: + return GL_UNSIGNED_INT; + case GL_DEPTH_STENCIL: + return GL_UNSIGNED_INT_24_8; + default: + _mesa_problem(ctx, "Unexpected format in get_temp_image_type()"); + return 0; + } +} + + +/** + * Helper for _mesa_meta_CopyTexImage1/2D() functions. + * Have to be careful with locking and meta state for pixel transfer. + */ +static void +copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLint border) +{ + struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; + struct gl_texture_image *texImage; + GLsizei postConvWidth = width, postConvHeight = height; + GLenum format, type; + GLint bpp; + void *buf; + + texUnit = _mesa_get_current_tex_unit(ctx); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + + format = _mesa_base_tex_format(ctx, internalFormat); + type = get_temp_image_type(ctx, format); + bpp = _mesa_bytes_per_pixel(format, type); + if (bpp <= 0) { + _mesa_problem(ctx, "Bad bpp in meta copy_tex_image()"); + return; + } + + /* + * Alloc image buffer (XXX could use a PBO) + */ + buf = _mesa_malloc(width * height * bpp); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); + return; + } + + if (texImage->TexFormat == &_mesa_null_texformat) + texImage->TexFormat = ctx->Driver.ChooseTextureFormat(ctx, + internalFormat, + format, + type); + + _mesa_unlock_texture(ctx, texObj); /* need to unlock first */ + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, height, + format, type, &ctx->Pack, buf); + _mesa_meta_end(ctx); + + /* + * Prepare for new texture image size/data + */ +#if FEATURE_convolve + if (_mesa_is_color_format(internalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } +#endif + + if (texImage->Data) { + ctx->Driver.FreeTexImageData(ctx, texImage); + } + + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + /* + * Store texture data (with pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE); + + _mesa_update_state(ctx); /* to update pixel transfer state */ + + if (target == GL_TEXTURE_1D) { + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, format, type, + buf, &ctx->Unpack, texObj, texImage); + } + else { + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, format, type, + buf, &ctx->Unpack, texObj, texImage); + } + _mesa_meta_end(ctx); + + _mesa_lock_texture(ctx, texObj); /* re-lock */ + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyTexImage1D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLint border) +{ + copy_tex_image(ctx, 1, target, level, internalFormat, x, y, + width, 1, border); +} + + +void +_mesa_meta_CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLint border) +{ + copy_tex_image(ctx, 2, target, level, internalFormat, x, y, + width, height, border); +} + + + +/** + * Helper for _mesa_meta_CopyTexSubImage1/2/3D() functions. + * Have to be careful with locking and meta state for pixel transfer. + */ +static void +copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; + struct gl_texture_image *texImage; + GLenum format, type; + GLint bpp; + void *buf; + + texUnit = _mesa_get_current_tex_unit(ctx); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + format = texImage->TexFormat->BaseFormat; + type = get_temp_image_type(ctx, format); + bpp = _mesa_bytes_per_pixel(format, type); + if (bpp <= 0) { + _mesa_problem(ctx, "Bad bpp in meta copy_tex_sub_image()"); + return; + } + + /* + * Alloc image buffer (XXX could use a PBO) + */ + buf = _mesa_malloc(width * height * bpp); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage%uD", dims); + return; + } + + _mesa_unlock_texture(ctx, texObj); /* need to unlock first */ + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, height, + format, type, &ctx->Pack, buf); + _mesa_meta_end(ctx); + + _mesa_update_state(ctx); /* to update pixel transfer state */ + + /* + * Store texture data (with pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE); + if (target == GL_TEXTURE_1D) { + ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, + width, format, type, buf, + &ctx->Unpack, texObj, texImage); + } + else if (target == GL_TEXTURE_3D) { + ctx->Driver.TexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, + width, height, 1, format, type, buf, + &ctx->Unpack, texObj, texImage); + } + else { + ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset, + width, height, format, type, buf, + &ctx->Unpack, texObj, texImage); + } + _mesa_meta_end(ctx); + + _mesa_lock_texture(ctx, texObj); /* re-lock */ + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyTexSubImage1D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, + GLint x, GLint y, GLsizei width) +{ + copy_tex_sub_image(ctx, 1, target, level, xoffset, 0, 0, + x, y, width, 1); +} + + +void +_mesa_meta_CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + copy_tex_sub_image(ctx, 2, target, level, xoffset, yoffset, 0, + x, y, width, height); +} + + +void +_mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + copy_tex_sub_image(ctx, 3, target, level, xoffset, yoffset, zoffset, + x, y, width, height); +} + + +void +_mesa_meta_CopyColorTable(GLcontext *ctx, + GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ColorTable(target, internalformat, width, GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ColorSubTable(target, start, width, GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + _mesa_update_state(ctx); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ConvolutionFilter1D(target, internalFormat, width, + GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + _mesa_update_state(ctx); + + ctx->Driver.ReadPixels(ctx, x, y, width, height, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ConvolutionFilter2D(target, internalFormat, width, height, + GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index b03b64c48a..6225b94189 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -27,29 +27,6 @@ #define META_H -/** - * Flags passed to _mesa_meta_begin(). - * XXX these flags may evolve... - */ -/*@{*/ -#define META_ALPHA_TEST 0x1 -#define META_BLEND 0x2 /**< includes logicop */ -#define META_COLOR_MASK 0x4 -#define META_DEPTH_TEST 0x8 -#define META_FOG 0x10 -#define META_RASTERIZATION 0x20 -#define META_SCISSOR 0x40 -#define META_SHADER 0x80 -#define META_STENCIL_TEST 0x100 -#define META_TRANSFORM 0x200 /**< modelview, projection */ -#define META_TEXTURE 0x400 -#define META_VERTEX 0x800 -#define META_VIEWPORT 0x1000 -#define META_PIXEL_STORE 0x2000 -#define META_ALL ~0x0 -/*@}*/ - - extern void _mesa_meta_init(GLcontext *ctx); @@ -57,25 +34,85 @@ extern void _mesa_meta_free(GLcontext *ctx); extern void -_mesa_meta_blit_framebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter); +_mesa_meta_BlitFramebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); + +extern void +_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers); + +extern void +_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type); + +extern void +_mesa_meta_DrawPixels(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels); + +extern void +_mesa_meta_Bitmap(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + const struct gl_pixelstore_attrib *unpack, + const GLubyte *bitmap); + +extern GLboolean +_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj); + +extern void +_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj); + +extern void +_mesa_meta_CopyTexImage1D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLint border); + +extern void +_mesa_meta_CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height, GLint border); + +extern void +_mesa_meta_CopyTexSubImage1D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, + GLint x, GLint y, GLsizei width); + +extern void +_mesa_meta_CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); + +extern void +_mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); + +extern void +_mesa_meta_CopyColorTable(GLcontext *ctx, + GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width); extern void -_mesa_meta_clear(GLcontext *ctx, GLbitfield buffers); +_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width); extern void -_mesa_meta_copy_pixels(GLcontext *ctx, GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type); +_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width); extern void -_mesa_meta_draw_pixels(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels); +_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height); #endif /* META_H */ diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 18dbeba24a..1ce9315530 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -60,18 +60,36 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: symlinks depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) +default: symlinks subdirs depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) -$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template +$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) Makefile \ + $(TOP)/src/mesa/drivers/dri/Makefile.template $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS) + $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) \ + $(DRI_LIB_DEPS) $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) +# If the Makefile defined SUBDIRS, run make in each +.PHONY: subdirs +subdirs: + @if test -n "$(SUBDIRS)" ; then \ + for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1; \ + fi \ + done \ + fi + + +.PHONY: symlinks +symlinks: + + depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) @ echo "running $(MKDEP)" @ rm -f depend diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h index cf55286b30..5ae28cb53a 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -56,7 +56,7 @@ typedef struct { * A handy flag to know if this is the back color buffer. * * \note - * This is currently only used by s3v and tdfx. + * This is currently only used by tdfx. */ GLboolean backBuffer; } driRenderbuffer; diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 40a030ce0d..5e86324eec 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -316,6 +316,13 @@ static const char CombinerOutputNV_names[] = ""; #endif +#if defined(need_GL_NV_vertex_program) +static const char VertexAttribs3fvNV_names[] = + "iip\0" /* Parameter signature */ + "glVertexAttribs3fvNV\0" + ""; +#endif + #if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) static const char Uniform2fARB_names[] = "iff\0" /* Parameter signature */ @@ -575,6 +582,13 @@ static const char MatrixIndexusvARB_names[] = ""; #endif +#if defined(need_GL_ARB_draw_elements_base_vertex) +static const char DrawElementsBaseVertex_names[] = + "iiipi\0" /* Parameter signature */ + "glDrawElementsBaseVertex\0" + ""; +#endif + #if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) static const char DisableVertexAttribArrayARB_names[] = "i\0" /* Parameter signature */ @@ -970,10 +984,10 @@ static const char GlobalAlphaFactordSUN_names[] = ""; #endif -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3fvNV_names[] = +#if defined(need_GL_NV_register_combiners) +static const char GetFinalCombinerInputParameterfvNV_names[] = "iip\0" /* Parameter signature */ - "glVertexAttribs3fvNV\0" + "glGetFinalCombinerInputParameterfvNV\0" ""; #endif @@ -3918,6 +3932,13 @@ static const char MapBufferARB_names[] = ""; #endif +#if defined(need_GL_ARB_draw_elements_base_vertex) +static const char MultiDrawElementsBaseVertex_names[] = + "ipipip\0" /* Parameter signature */ + "glMultiDrawElementsBaseVertex\0" + ""; +#endif + #if defined(need_GL_EXT_coordinate_frame) static const char Binormal3svEXT_names[] = "p\0" /* Parameter signature */ @@ -4396,10 +4417,11 @@ static const char SpriteParameterivSGIX_names[] = ""; #endif -#if defined(need_GL_EXT_provoking_vertex) +#if defined(need_GL_EXT_provoking_vertex) || defined(need_GL_ARB_provoking_vertex) static const char ProvokingVertexEXT_names[] = "i\0" /* Parameter signature */ "glProvokingVertexEXT\0" + "glProvokingVertex\0" ""; #endif @@ -4554,10 +4576,10 @@ static const char UniformMatrix3x4fv_names[] = ""; #endif -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3fvEXT\0" +#if defined(need_GL_ARB_draw_elements_base_vertex) +static const char DrawRangeElementsBaseVertex_names[] = + "iiiiipi\0" /* Parameter signature */ + "glDrawRangeElementsBaseVertex\0" ""; #endif @@ -4710,10 +4732,10 @@ static const char GetFragmentLightfvSGIX_names[] = ""; #endif -#if defined(need_GL_NV_register_combiners) -static const char GetFinalCombinerInputParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFinalCombinerInputParameterfvNV\0" +#if defined(need_GL_EXT_coordinate_frame) +static const char Binormal3fvEXT_names[] = + "p\0" /* Parameter signature */ + "glBinormal3fvEXT\0" ""; #endif @@ -5090,6 +5112,15 @@ static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { }; #endif +#if defined(need_GL_ARB_draw_elements_base_vertex) +static const struct dri_extension_function GL_ARB_draw_elements_base_vertex_functions[] = { + { DrawElementsBaseVertex_names, DrawElementsBaseVertex_remap_index, -1 }, + { MultiDrawElementsBaseVertex_names, MultiDrawElementsBaseVertex_remap_index, -1 }, + { DrawRangeElementsBaseVertex_names, DrawRangeElementsBaseVertex_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + #if defined(need_GL_ARB_framebuffer_object) static const struct dri_extension_function GL_ARB_framebuffer_object_functions[] = { { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 }, @@ -5164,6 +5195,13 @@ static const struct dri_extension_function GL_ARB_point_parameters_functions[] = }; #endif +#if defined(need_GL_ARB_provoking_vertex) +static const struct dri_extension_function GL_ARB_provoking_vertex_functions[] = { + { ProvokingVertexEXT_names, ProvokingVertexEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + #if defined(need_GL_ARB_shader_objects) static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, @@ -5520,8 +5558,8 @@ static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = { Binormal3dvEXT_names, Binormal3dvEXT_remap_index, -1 }, { Tangent3iEXT_names, Tangent3iEXT_remap_index, -1 }, { Tangent3bvEXT_names, Tangent3bvEXT_remap_index, -1 }, - { Binormal3fvEXT_names, Binormal3fvEXT_remap_index, -1 }, { Tangent3bEXT_names, Tangent3bEXT_remap_index, -1 }, + { Binormal3fvEXT_names, Binormal3fvEXT_remap_index, -1 }, { BinormalPointerEXT_names, BinormalPointerEXT_remap_index, -1 }, { Tangent3svEXT_names, Tangent3svEXT_remap_index, -1 }, { Binormal3bEXT_names, Binormal3bEXT_remap_index, -1 }, @@ -5963,6 +6001,7 @@ static const struct dri_extension_function GL_NV_point_sprite_functions[] = { static const struct dri_extension_function GL_NV_register_combiners_functions[] = { { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 }, { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 }, + { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, -1 }, { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 }, { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 }, { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 }, @@ -5971,7 +6010,6 @@ static const struct dri_extension_function GL_NV_register_combiners_functions[] { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 }, { CombinerInputNV_names, CombinerInputNV_remap_index, -1 }, { CombinerParameterfNV_names, CombinerParameterfNV_remap_index, -1 }, - { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, -1 }, { GetCombinerInputParameterivNV_names, GetCombinerInputParameterivNV_remap_index, -1 }, { CombinerParameterivNV_names, CombinerParameterivNV_remap_index, -1 }, { NULL, 0, 0 } @@ -5998,6 +6036,7 @@ static const struct dri_extension_function GL_NV_vertex_array_range_functions[] static const struct dri_extension_function GL_NV_vertex_program_functions[] = { { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 }, { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 }, + { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, -1 }, { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 }, { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 }, { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 }, @@ -6006,7 +6045,6 @@ static const struct dri_extension_function GL_NV_vertex_program_functions[] = { { VertexAttribs3dvNV_names, VertexAttribs3dvNV_remap_index, -1 }, { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, -1 }, { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, -1 }, - { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, -1 }, { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, { LoadProgramNV_names, LoadProgramNV_remap_index, -1 }, { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, -1 }, diff --git a/src/mesa/drivers/dri/fb/Makefile b/src/mesa/drivers/dri/fb/Makefile index 309f50b95f..cf9b3a8556 100644 --- a/src/mesa/drivers/dri/fb/Makefile +++ b/src/mesa/drivers/dri/fb/Makefile @@ -25,5 +25,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: - diff --git a/src/mesa/drivers/dri/ffb/Makefile b/src/mesa/drivers/dri/ffb/Makefile index cb73238c03..e9da8f9066 100644 --- a/src/mesa/drivers/dri/ffb/Makefile +++ b/src/mesa/drivers/dri/ffb/Makefile @@ -33,4 +33,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/ffb/ffb_tex.c b/src/mesa/drivers/dri/ffb/ffb_tex.c index 69d30aedba..95058e9069 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tex.c +++ b/src/mesa/drivers/dri/ffb/ffb_tex.c @@ -30,24 +30,6 @@ #include "ffb_tex.h" /* No texture unit, all software. */ -/* XXX this function isn't needed since _mesa_init_driver_functions() - * will make all these assignments. - */ void ffbDDInitTexFuncs(GLcontext *ctx) { - /* - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = _mesa_store_teximage2d; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - */ } diff --git a/src/mesa/drivers/dri/gamma/Makefile b/src/mesa/drivers/dri/gamma/Makefile index 250d3ac089..09df1578fc 100644 --- a/src/mesa/drivers/dri/gamma/Makefile +++ b/src/mesa/drivers/dri/gamma/Makefile @@ -32,4 +32,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/glcore/Makefile b/src/mesa/drivers/dri/glcore/Makefile deleted file mode 100644 index ac7e1de928..0000000000 --- a/src/mesa/drivers/dri/glcore/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# src/mesa/drivers/dri/glcore/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = glcore_dri.so - -DRIVER_SOURCES = glcore_driver.c \ - $(TOP)/src/mesa/drivers/common/driverfuncs.c \ - ../common/dri_util.c - -C_SOURCES = \ - $(DRIVER_SOURCES) \ - $(DRI_SOURCES) - - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -I../dri_client \ - -I../dri_client/imports \ - -Iserver \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared-core \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/libmesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -lm -lpthread -lc -# LIB_DEPS = -lGL -lm -lpthread -lc - - -ASM_SOURCES = - -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(TOP)/$(LIB_DIR)/$(LIBNAME) - - -$(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(TOP)/$(LIB_DIR) \ - $(OBJECTS) $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - > /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - - -include depend diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile index a7825b49b4..3874faee51 100644 --- a/src/mesa/drivers/dri/i810/Makefile +++ b/src/mesa/drivers/dri/i810/Makefile @@ -29,4 +29,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 9d049dea8f..37f15aa767 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -19,7 +19,6 @@ DRIVER_SOURCES = \ intel_batchbuffer.c \ intel_clear.c \ intel_extensions.c \ - intel_generatemipmap.c \ intel_mipmap_tree.c \ intel_tex_layout.c \ intel_tex_image.c \ @@ -73,4 +72,3 @@ intel_decode.o: ../intel/intel_decode.c intel_tex_layout.o: ../intel/intel_tex_layout.c -symlinks: diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 6f998fa6f7..f270a13781 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -162,9 +162,8 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } else { dri_bo_reference(intelObj->mt->region->buffer); i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, - 0, intelObj-> - firstLevel); + i830->state.tex_offset[unit] = + intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0); format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat); diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 3ab7d682ee..7d4c7cfbab 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -40,6 +40,7 @@ #include "utils.h" #include "i915_reg.h" +#include "i915_program.h" #include "intel_regions.h" #include "intel_batchbuffer.h" @@ -80,6 +81,8 @@ i915InvalidateState(GLcontext * ctx, GLuint new_state) i915_update_stencil(ctx); if (new_state & (_NEW_LIGHT)) i915_update_provoking_vertex(ctx); + if (new_state & (_NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS)) + i915_update_program(ctx); } @@ -139,7 +142,7 @@ i915CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxTextureUnits = I915_TEX_UNITS; ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS; ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS; - + ctx->Const.MaxVarying = I915_TEX_UNITS; /* Advertise the full hardware capabilities. The new memory * manager should cope much better with overload situations: diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index 8de4a9d0d3..082d614442 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -121,10 +121,14 @@ enum { #define I915_MAX_CONSTANT 32 #define I915_CONSTANT_SIZE (2+(4*I915_MAX_CONSTANT)) +#define I915_MAX_INSN (I915_MAX_DECL_INSN + \ + I915_MAX_TEX_INSN + \ + I915_MAX_ALU_INSN) -#define I915_PROGRAM_SIZE 192 - -#define I915_MAX_INSN (I915_MAX_TEX_INSN+I915_MAX_ALU_INSN) +/* Maximum size of the program packet, which matches the limits on + * decl, tex, and ALU instructions. + */ +#define I915_PROGRAM_SIZE (I915_MAX_INSN * 3 + 1) /* Hardware version of a parsed fragment program. "Derived" from the * mesa fragment_program struct. @@ -154,8 +158,9 @@ struct i915_fragment_program */ GLcontext *ctx; - GLuint declarations[I915_PROGRAM_SIZE]; - GLuint program[I915_PROGRAM_SIZE]; + /* declarations contains the packet header. */ + GLuint declarations[I915_MAX_DECL_INSN * 3 + 1]; + GLuint program[(I915_MAX_TEX_INSN + I915_MAX_ALU_INSN) * 3]; GLfloat constant[I915_MAX_CONSTANT][4]; GLuint constant_flags[I915_MAX_CONSTANT]; diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 2db10c60e9..d9c61446f5 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -89,7 +89,8 @@ src_vector(struct i915_fragment_program *p, */ case PROGRAM_TEMPORARY: if (source->Index >= I915_MAX_TEMPORARY) { - i915_program_error(p, "Exceeded max temporary reg"); + i915_program_error(p, "Exceeded max temporary reg: %d/%d", + source->Index, I915_MAX_TEMPORARY); return 0; } src = UREG(REG_TYPE_R, source->Index); @@ -121,10 +122,23 @@ src_vector(struct i915_fragment_program *p, src = i915_emit_decl(p, REG_TYPE_T, T_TEX0 + (source->Index - FRAG_ATTRIB_TEX0), D0_CHANNEL_ALL); + break; + + case FRAG_ATTRIB_VAR0: + case FRAG_ATTRIB_VAR0 + 1: + case FRAG_ATTRIB_VAR0 + 2: + case FRAG_ATTRIB_VAR0 + 3: + case FRAG_ATTRIB_VAR0 + 4: + case FRAG_ATTRIB_VAR0 + 5: + case FRAG_ATTRIB_VAR0 + 6: + case FRAG_ATTRIB_VAR0 + 7: + src = i915_emit_decl(p, REG_TYPE_T, + T_TEX0 + (source->Index - FRAG_ATTRIB_VAR0), + D0_CHANNEL_ALL); break; default: - i915_program_error(p, "Bad source->Index"); + i915_program_error(p, "Bad source->Index: %d", source->Index); return 0; } break; @@ -146,6 +160,7 @@ src_vector(struct i915_fragment_program *p, case PROGRAM_CONSTANT: case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: + case PROGRAM_UNIFORM: src = i915_emit_param4fv(p, program->Base.Parameters->ParameterValues[source-> @@ -153,7 +168,7 @@ src_vector(struct i915_fragment_program *p, break; default: - i915_program_error(p, "Bad source->File"); + i915_program_error(p, "Bad source->File: %d", source->File); return 0; } @@ -186,13 +201,14 @@ get_result_vector(struct i915_fragment_program *p, p->depth_written = 1; return UREG(REG_TYPE_OD, 0); default: - i915_program_error(p, "Bad inst->DstReg.Index"); + i915_program_error(p, "Bad inst->DstReg.Index: %d", + inst->DstReg.Index); return 0; } case PROGRAM_TEMPORARY: return UREG(REG_TYPE_R, inst->DstReg.Index); default: - i915_program_error(p, "Bad inst->DstReg.File"); + i915_program_error(p, "Bad inst->DstReg.File: %d", inst->DstReg.File); return 0; } } @@ -231,7 +247,7 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit) case TEXTURE_CUBE_INDEX: return D0_SAMPLE_TYPE_CUBE; default: - i915_program_error(p, "TexSrcBit"); + i915_program_error(p, "TexSrcBit: %d", bit); return 0; } } @@ -351,7 +367,7 @@ upload_program(struct i915_fragment_program *p) while (1) { GLuint src0, src1, src2, flags; - GLuint tmp = 0, consts0 = 0, consts1 = 0; + GLuint tmp = 0, dst, consts0 = 0, consts1 = 0; switch (inst->Opcode) { case OPCODE_ABS: @@ -503,6 +519,10 @@ upload_program(struct i915_fragment_program *p) EMIT_1ARG_ARITH(A0_FLR); break; + case OPCODE_TRUNC: + EMIT_1ARG_ARITH(A0_TRC); + break; + case OPCODE_FRC: EMIT_1ARG_ARITH(A0_FRC); break; @@ -516,6 +536,22 @@ upload_program(struct i915_fragment_program *p) 0, src0, T0_TEXKILL); break; + case OPCODE_KIL_NV: + if (inst->DstReg.CondMask == COND_TR) { + tmp = i915_get_utemp(p); + + i915_emit_texld(p, get_live_regs(p, inst), + tmp, A0_DEST_CHANNEL_ALL, + 0, /* use a dummy dest reg */ + swizzle(tmp, ONE, ONE, ONE, ONE), /* always */ + T0_TEXKILL); + } else { + p->error = 1; + i915_program_error(p, "Unsupported KIL_NV condition code: %d", + inst->DstReg.CondMask); + } + break; + case OPCODE_LG2: src0 = src_vector(p, &inst->SrcReg[0], program); @@ -615,6 +651,20 @@ upload_program(struct i915_fragment_program *p) EMIT_2ARG_ARITH(A0_MUL); break; + case OPCODE_NOISE1: + case OPCODE_NOISE2: + case OPCODE_NOISE3: + case OPCODE_NOISE4: + /* Don't implement noise because we just don't have the instructions + * to spare. We aren't the first vendor to do so. + */ + i915_program_error(p, "Stubbed-out noise functions"); + i915_emit_arith(p, + A0_MOV, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, ZERO, ZERO, ZERO, ZERO), 0, 0); + case OPCODE_POW: src0 = src_vector(p, &inst->SrcReg[0], program); src1 = src_vector(p, &inst->SrcReg[1], program); @@ -721,9 +771,38 @@ upload_program(struct i915_fragment_program *p) } break; - case OPCODE_SGE: - EMIT_2ARG_ARITH(A0_SGE); - break; + case OPCODE_SEQ: + tmp = i915_get_utemp(p); + flags = get_result_flags(inst); + dst = get_result_vector(p, inst); + + /* dst = src1 >= src2 */ + i915_emit_arith(p, + A0_SGE, + dst, + flags, 0, + src_vector(p, &inst->SrcReg[0], program), + src_vector(p, &inst->SrcReg[1], program), + 0); + /* tmp = src1 <= src2 */ + i915_emit_arith(p, + A0_SGE, + tmp, + flags, 0, + negate(src_vector(p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector(p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + /* dst = tmp && dst */ + i915_emit_arith(p, + A0_MUL, + dst, + flags, 0, + dst, + tmp, + 0); + break; case OPCODE_SIN: src0 = src_vector(p, &inst->SrcReg[0], program); @@ -809,10 +888,71 @@ upload_program(struct i915_fragment_program *p) break; + case OPCODE_SGE: + EMIT_2ARG_ARITH(A0_SGE); + break; + + case OPCODE_SGT: + i915_emit_arith(p, + A0_SLT, + get_result_vector( p, inst ), + get_result_flags( inst ), 0, + negate(src_vector( p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector( p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + break; + + case OPCODE_SLE: + i915_emit_arith(p, + A0_SGE, + get_result_vector( p, inst ), + get_result_flags( inst ), 0, + negate(src_vector( p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector( p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + break; + case OPCODE_SLT: EMIT_2ARG_ARITH(A0_SLT); break; + case OPCODE_SNE: + tmp = i915_get_utemp(p); + flags = get_result_flags(inst); + dst = get_result_vector(p, inst); + + /* dst = src1 < src2 */ + i915_emit_arith(p, + A0_SLT, + dst, + flags, 0, + src_vector(p, &inst->SrcReg[0], program), + src_vector(p, &inst->SrcReg[1], program), + 0); + /* tmp = src1 > src2 */ + i915_emit_arith(p, + A0_SLT, + tmp, + flags, 0, + negate(src_vector(p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector(p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + /* dst = tmp || dst */ + i915_emit_arith(p, + A0_ADD, + dst, + flags | A0_DEST_SATURATE, 0, + dst, + tmp, + 0); + break; + case OPCODE_SUB: src0 = src_vector(p, &inst->SrcReg[0], program); src1 = src_vector(p, &inst->SrcReg[1], program); @@ -869,8 +1009,39 @@ upload_program(struct i915_fragment_program *p) case OPCODE_END: return; + case OPCODE_BGNLOOP: + case OPCODE_BGNSUB: + case OPCODE_BRA: + case OPCODE_BRK: + case OPCODE_CAL: + case OPCODE_CONT: + case OPCODE_DDX: + case OPCODE_DDY: + case OPCODE_ELSE: + case OPCODE_ENDIF: + case OPCODE_ENDLOOP: + case OPCODE_ENDSUB: + case OPCODE_IF: + case OPCODE_RET: + p->error = 1; + i915_program_error(p, "Unsupported opcode: %s", + _mesa_opcode_string(inst->Opcode)); + return; + + case OPCODE_EXP: + case OPCODE_LOG: + /* These opcodes are claimed as GLSL, NV_vp, and ARB_vp in + * prog_instruction.h, but apparently GLSL doesn't ever emit them. + * Instead, it translates to EX2 or LG2. + */ + case OPCODE_TXD: + case OPCODE_TXL: + /* These opcodes are claimed by GLSL in prog_instruction.h, but + * only NV_vp/fp appears to emit them. + */ default: - i915_program_error(p, "bad opcode"); + i915_program_error(p, "bad opcode: %s", + _mesa_opcode_string(inst->Opcode)); return; } @@ -906,7 +1077,7 @@ check_wpos(struct i915_fragment_program *p) p->wpos_tex = -1; for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { - if (inputs & FRAG_BIT_TEX(i)) + if (inputs & (FRAG_BIT_TEX(i) | FRAG_BIT_VAR(i))) continue; else if (inputs & FRAG_BIT_WPOS) { p->wpos_tex = i; @@ -1055,6 +1226,28 @@ i915ProgramStringNotify(GLcontext * ctx, _tnl_program_string(ctx, target, prog); } +void +i915_update_program(GLcontext *ctx) +{ + struct intel_context *intel = intel_context(ctx); + struct i915_context *i915 = i915_context(&intel->ctx); + struct i915_fragment_program *fp = + (struct i915_fragment_program *) ctx->FragmentProgram._Current; + + if (i915->current_program != fp) { + if (i915->current_program) { + i915->current_program->on_hardware = 0; + i915->current_program->params_uptodate = 0; + } + + i915->current_program = fp; + } + + if (!fp->translated) + translate_program(fp); + + FALLBACK(&i915->intel, I915_FALLBACK_PROGRAM, fp->error); +} void i915ValidateFragmentProgram(struct i915_context *i915) @@ -1072,16 +1265,6 @@ i915ValidateFragmentProgram(struct i915_context *i915) GLuint s2 = S2_TEXCOORD_NONE; int i, offset = 0; - if (i915->current_program != p) { - if (i915->current_program) { - i915->current_program->on_hardware = 0; - i915->current_program->params_uptodate = 0; - } - - i915->current_program = p; - } - - /* Important: */ VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; @@ -1125,6 +1308,14 @@ i915ValidateFragmentProgram(struct i915_context *i915) EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, EMIT_SZ(sz), 0, sz * 4); } + else if (inputsRead & FRAG_BIT_VAR(i)) { + int sz = VB->AttribPtr[_TNL_ATTRIB_GENERIC0 + i]->size; + + s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); + s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz)); + + EMIT_ATTR(_TNL_ATTRIB_GENERIC0 + i, EMIT_SZ(sz), 0, sz * 4); + } else if (i == p->wpos_tex) { /* If WPOS is required, duplicate the XYZ position data in an diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index e87700f8e0..e7908bd48f 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -130,6 +130,7 @@ i915_emit_decl(struct i915_fragment_program *p, *(p->decl++) = (D0_DCL | D0_DEST(reg) | d0_flags); *(p->decl++) = D1_MBZ; *(p->decl++) = D2_MBZ; + assert(p->decl <= p->declarations + ARRAY_SIZE(p->declarations)); p->nr_decl_insn++; return reg; @@ -186,6 +187,11 @@ i915_emit_arith(struct i915_fragment_program * p, p->utemp_flag = old_utemp_flag; /* restore */ } + if (p->csr >= p->program + ARRAY_SIZE(p->program)) { + i915_program_error(p, "Program contains too many instructions"); + return UREG_BAD; + } + *(p->csr++) = (op | A0_DEST(dest) | mask | saturate | A0_SRC0(src0)); *(p->csr++) = (A1_SRC0(src0) | A1_SRC1(src1)); *(p->csr++) = (A2_SRC1(src1) | A2_SRC2(src2)); @@ -270,6 +276,11 @@ GLuint i915_emit_texld( struct i915_fragment_program *p, p->register_phases[GET_UREG_NR(coord)] == p->nr_tex_indirect) p->nr_tex_indirect++; + if (p->csr >= p->program + ARRAY_SIZE(p->program)) { + i915_program_error(p, "Program contains too many instructions"); + return UREG_BAD; + } + *(p->csr++) = (op | T0_DEST( dest ) | T0_SAMPLER( sampler )); @@ -424,12 +435,21 @@ i915_emit_param4fv(struct i915_fragment_program * p, const GLfloat * values) return 0; } - - +/* Warning the user about program errors seems to be quite valuable, from + * our bug reports. It unfortunately means piglit reporting errors + * when we fall back to software due to an unsupportable program, though. + */ void -i915_program_error(struct i915_fragment_program *p, const char *msg) +i915_program_error(struct i915_fragment_program *p, const char *fmt, ...) { - _mesa_problem(NULL, "i915_program_error: %s", msg); + va_list args; + + fprintf(stderr, "i915_program_error: "); + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + + fprintf(stderr, "\n"); p->error = 1; } @@ -511,7 +531,8 @@ i915_upload_program(struct i915_context *i915, GLuint program_size = p->csr - p->program; GLuint decl_size = p->decl - p->declarations; - FALLBACK(&i915->intel, I915_FALLBACK_PROGRAM, p->error); + if (p->error) + return; /* Could just go straight to the batchbuffer from here: */ diff --git a/src/mesa/drivers/dri/i915/i915_program.h b/src/mesa/drivers/dri/i915/i915_program.h index 14a3f08801..0d17d04865 100644 --- a/src/mesa/drivers/dri/i915/i915_program.h +++ b/src/mesa/drivers/dri/i915/i915_program.h @@ -145,7 +145,7 @@ extern GLuint i915_emit_param4fv(struct i915_fragment_program *p, const GLfloat * values); extern void i915_program_error(struct i915_fragment_program *p, - const char *msg); + const char *fmt, ...); extern void i915_init_program(struct i915_context *i915, struct i915_fragment_program *p); @@ -155,7 +155,6 @@ extern void i915_upload_program(struct i915_context *i915, extern void i915_fini_program(struct i915_fragment_program *p); - - +extern void i915_update_program(GLcontext *ctx); #endif diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 32d4b30cf9..b2f82f5655 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -173,9 +173,8 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } else { dri_bo_reference(intelObj->mt->region->buffer); i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, - 0, intelObj-> - firstLevel); + i915->state.tex_offset[unit] = + intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0); format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat, diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 9a723d3cd7..9e2523932f 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -54,8 +54,7 @@ i915_render_prevalidate(struct intel_context *intel) { struct i915_context *i915 = i915_context(&intel->ctx); - if (!intel->Fallback) - i915ValidateFragmentProgram(i915); + i915ValidateFragmentProgram(i915); } static void diff --git a/src/mesa/drivers/dri/i915/intel_generatemipmap.c b/src/mesa/drivers/dri/i915/intel_generatemipmap.c deleted file mode 120000 index 4c6b37ada0..0000000000 --- a/src/mesa/drivers/dri/i915/intel_generatemipmap.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_generatemipmap.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index bc6b29281a..c3cbba8404 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1076,7 +1076,9 @@ intelRunPipeline(GLcontext * ctx) intel->NewGLState = 0; } + intel_map_vertex_shader_textures(ctx); _tnl_run_pipeline(ctx); + intel_unmap_vertex_shader_textures(ctx); _mesa_unlock_context_textures(ctx); } diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 6e9a9a29a3..7a55333e89 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -14,7 +14,6 @@ DRIVER_SOURCES = \ intel_decode.c \ intel_extensions.c \ intel_fbo.c \ - intel_generatemipmap.c \ intel_mipmap_tree.c \ intel_regions.c \ intel_screen.c \ @@ -101,6 +100,5 @@ DRI_LIB_DEPS += -ldrm_intel include ../Makefile.template -symlinks: intel_decode.o: ../intel/intel_decode.c intel_tex_layout.o: ../intel/intel_tex_layout.c diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index c724218cf5..1088a7a607 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -39,12 +39,14 @@ static void prepare_cc_vp( struct brw_context *brw ) { + GLcontext *ctx = &brw->intel.ctx; struct brw_cc_viewport ccv; memset(&ccv, 0, sizeof(ccv)); - ccv.min_depth = 0.0; - ccv.max_depth = 1.0; + /* _NEW_VIEWPORT */ + ccv.min_depth = ctx->Viewport.Near; + ccv.max_depth = ctx->Viewport.Far; dri_bo_unreference(brw->cc.vp_bo); brw->cc.vp_bo = brw_cache_data( &brw->cache, BRW_CC_VP, &ccv, NULL, 0 ); @@ -52,7 +54,7 @@ static void prepare_cc_vp( struct brw_context *brw ) const struct brw_tracked_state brw_cc_vp = { .dirty = { - .mesa = 0, + .mesa = _NEW_VIEWPORT, .brw = BRW_NEW_CONTEXT, .cache = 0 }, diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c index 5762c9577c..234b3744bf 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_state.c +++ b/src/mesa/drivers/dri/i965/brw_clip_state.c @@ -43,11 +43,14 @@ struct brw_clip_unit_key { unsigned int curbe_offset; unsigned int nr_urb_entries, urb_size; + + GLboolean depth_clamp; }; static void clip_unit_populate_key(struct brw_context *brw, struct brw_clip_unit_key *key) { + GLcontext *ctx = &brw->intel.ctx; memset(key, 0, sizeof(*key)); /* CACHE_NEW_CLIP_PROG */ @@ -62,6 +65,9 @@ clip_unit_populate_key(struct brw_context *brw, struct brw_clip_unit_key *key) /* BRW_NEW_URB_FENCE */ key->nr_urb_entries = brw->urb.nr_clip_entries; key->urb_size = brw->urb.vsize; + + /* _NEW_TRANSOFORM */ + key->depth_clamp = ctx->Transform.DepthClamp; } static dri_bo * @@ -117,7 +123,8 @@ clip_unit_create_from_key(struct brw_context *brw, clip.clip5.userclip_enable_flags = 0x7f; clip.clip5.userclip_must_clip = 1; clip.clip5.guard_band_enable = 0; - clip.clip5.viewport_z_clip_enable = 1; + if (!key->depth_clamp) + clip.clip5.viewport_z_clip_enable = 1; clip.clip5.viewport_xy_clip_enable = 1; clip.clip5.vertex_position_space = BRW_CLIP_NDCSPACE; clip.clip5.api_mode = BRW_CLIP_API_OGL; @@ -168,7 +175,7 @@ static void upload_clip_unit( struct brw_context *brw ) const struct brw_tracked_state brw_clip_unit = { .dirty = { - .mesa = 0, + .mesa = _NEW_TRANSFORM, .brw = (BRW_NEW_CURBE_OFFSETS | BRW_NEW_URB_FENCE), .cache = CACHE_NEW_CLIP_PROG diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index b1e7ec8465..01b6a4a168 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -706,10 +706,6 @@ void brw_debug_batch(struct intel_context *intel); /*====================================================================== * brw_tex.c */ -void brwUpdateTextureState( struct intel_context *intel ); -void brw_FrameBufferTexInit( struct brw_context *brw, - struct intel_region *region ); -void brw_FrameBufferTexDestroy( struct brw_context *brw ); void brw_validate_textures( struct brw_context *brw ); diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index c53bd47bb5..44bb7bd588 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -25,13 +25,15 @@ * **************************************************************************/ -#include <stdlib.h> #include "main/glheader.h" #include "main/context.h" #include "main/state.h" -#include "main/api_validate.h" #include "main/enums.h" +#include "tnl/tnl.h" +#include "vbo/vbo_context.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" #include "brw_draw.h" #include "brw_defines.h" @@ -42,11 +44,6 @@ #include "intel_batchbuffer.h" #include "intel_buffer_objects.h" -#include "tnl/tnl.h" -#include "vbo/vbo_context.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" - #define FILE_DEBUG_FLAG DEBUG_BATCH static GLuint prim_to_hw_prim[GL_POLYGON+1] = { @@ -145,7 +142,7 @@ static void brw_emit_prim(struct brw_context *brw, prim_packet.start_vert_location += brw->ib.start_vertex_offset; prim_packet.instance_count = 1; prim_packet.start_instance_location = 0; - prim_packet.base_vert_location = 0; + prim_packet.base_vert_location = prim->basevertex; /* Can't wrap here, since we rely on the validated state. */ brw->no_batch_wrap = GL_TRUE; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 4f8ceb37bd..375afadcbe 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -25,9 +25,9 @@ * **************************************************************************/ -#include <stdlib.h> #include "main/glheader.h" +#include "main/bufferobj.h" #include "main/context.h" #include "main/state.h" #include "main/api_validate.h" @@ -385,7 +385,7 @@ static void brw_prepare_vertices(struct brw_context *brw) input->element_size = get_size(input->glarray->Type) * input->glarray->Size; - if (input->glarray->BufferObj->Name != 0) { + if (_mesa_is_bufferobj(input->glarray->BufferObj)) { struct intel_buffer_object *intel_buffer = intel_buffer_object(input->glarray->BufferObj); @@ -625,7 +625,7 @@ static void brw_prepare_indices(struct brw_context *brw) /* Turn into a proper VBO: */ - if (!bufferobj->Name) { + if (!_mesa_is_bufferobj(bufferobj)) { brw->ib.start_vertex_offset = 0; /* Get new bufferobj, offset: diff --git a/src/mesa/drivers/dri/i965/brw_gs_state.c b/src/mesa/drivers/dri/i965/brw_gs_state.c index a761c03153..ed9d2ffe60 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_state.c +++ b/src/mesa/drivers/dri/i965/brw_gs_state.c @@ -93,7 +93,10 @@ gs_unit_create_from_key(struct brw_context *brw, struct brw_gs_unit_key *key) gs.thread4.nr_urb_entries = key->nr_urb_entries; gs.thread4.urb_entry_allocation_size = key->urb_size - 1; - gs.thread4.max_threads = 0; /* Hardware requirement */ + if (key->nr_urb_entries >= 8) + gs.thread4.max_threads = 1; + else + gs.thread4.max_threads = 0; if (BRW_IS_IGDNG(brw)) gs.thread4.rendering_enable = 1; diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index f8e46aacf7..c262e1db8b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -534,14 +534,9 @@ brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) for (i = 0; i < cache->size; i++) { for (prev = &cache->items[i]; *prev;) { struct brw_cache_item *c = *prev; - int j; - - for (j = 0; j < c->nr_reloc_bufs; j++) { - if (c->reloc_bufs[j] == bo) - break; - } - if (j != c->nr_reloc_bufs) { + if (drm_intel_bo_references(c->bo, bo)) { + int j; *prev = c->next; @@ -551,17 +546,8 @@ brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) free((void *)c->key); free(c); cache->n_items--; - - /* Delete up the tree. Notably we're trying to get from - * a request to delete the surface, to deleting the surface state - * object, to deleting the binding table. We're slack and restart - * the deletion process when we do this because the other delete - * may kill our *prev. - */ - brw_state_cache_bo_delete(cache, c->bo); - prev = &cache->items[i]; } else { - prev = &(*prev)->next; + prev = &c->next; } } } diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 71bff166dd..e911b105b2 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -39,38 +39,6 @@ #include "intel_tex.h" #include "brw_context.h" - -void brw_FrameBufferTexInit( struct brw_context *brw, - struct intel_region *region ) -{ - struct intel_context *intel = &brw->intel; - GLcontext *ctx = &intel->ctx; - struct gl_texture_object *obj; - struct gl_texture_image *img; - - intel->frame_buffer_texobj = obj = - ctx->Driver.NewTextureObject( ctx, (GLuint) -1, GL_TEXTURE_2D ); - - obj->MinFilter = GL_NEAREST; - obj->MagFilter = GL_NEAREST; - - img = ctx->Driver.NewTextureImage( ctx ); - - _mesa_init_teximage_fields( ctx, GL_TEXTURE_2D, img, - region->pitch, region->height, 1, 0, - region->cpp == 4 ? GL_RGBA : GL_RGB ); - - _mesa_set_tex_image( obj, GL_TEXTURE_2D, 0, img ); -} - -void brw_FrameBufferTexDestroy( struct brw_context *brw ) -{ - if (brw->intel.frame_buffer_texobj != NULL) - brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx, - brw->intel.frame_buffer_texobj ); - brw->intel.frame_buffer_texobj = NULL; -} - /** * Finalizes all textures, completing any rendering that needs to be done * to prepare them. diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 108e19cdbc..1638ef8111 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1208,7 +1208,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) MIN2(c->nr_outputs + 1 + len_vertext_header, (BRW_MAX_MRF-1)), /* msg len */ 0, /* response len */ eot, /* eot */ - 1, /* writes complete */ + eot, /* writes complete */ 0, /* urb destination offset */ BRW_URB_SWIZZLE_INTERLEAVE); @@ -1270,9 +1270,27 @@ post_vs_emit( struct brw_vs_compile *c, } static uint32_t -get_predicate(uint32_t swizzle) +get_predicate(const struct prog_instruction *inst) { - switch (swizzle) { + if (inst->DstReg.CondMask == COND_TR) + return BRW_PREDICATE_NONE; + + /* All of GLSL only produces predicates for COND_NE and one channel per + * vector. Fail badly if someone starts doing something else, as it might + * mean infinite looping or something. + * + * We'd like to support all the condition codes, but our hardware doesn't + * quite match the Mesa IR, which is modeled after the NV extensions. For + * those, the instruction may update the condition codes or not, then any + * later instruction may use one of those condition codes. For gen4, the + * instruction may update the flags register based on one of the condition + * codes output by the instruction, and then further instructions may + * predicate on that. We can probably support this, but it won't + * necessarily be easy. + */ + assert(inst->DstReg.CondMask == COND_NE); + + switch (inst->DstReg.CondSwizzle) { case SWIZZLE_XXXX: return BRW_PREDICATE_ALIGN16_REPLICATE_X; case SWIZZLE_YYYY: @@ -1282,7 +1300,8 @@ get_predicate(uint32_t swizzle) case SWIZZLE_WWWW: return BRW_PREDICATE_ALIGN16_REPLICATE_W; default: - _mesa_problem(NULL, "Unexpected predicate: 0x%08x\n", swizzle); + _mesa_problem(NULL, "Unexpected predicate: 0x%08x\n", + inst->DstReg.CondMask); return BRW_PREDICATE_NORMAL; } } @@ -1294,6 +1313,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) #define MAX_IF_DEPTH 32 #define MAX_LOOP_DEPTH 32 struct brw_compile *p = &c->func; + struct brw_context *brw = p->brw; const GLuint nr_insns = c->vp->program.Base.NumInstructions; GLuint insn, if_depth = 0, loop_depth = 0; GLuint end_offset = 0; @@ -1492,8 +1512,8 @@ void brw_vs_emit(struct brw_vs_compile *c ) case OPCODE_IF: assert(if_depth < MAX_IF_DEPTH); if_inst[if_depth] = brw_IF(p, BRW_EXECUTE_8); - if_inst[if_depth]->header.predicate_control = - get_predicate(inst->DstReg.CondSwizzle); + /* Note that brw_IF smashes the predicate_control field. */ + if_inst[if_depth]->header.predicate_control = get_predicate(inst); if_depth++; break; case OPCODE_ELSE: @@ -1503,45 +1523,48 @@ void brw_vs_emit(struct brw_vs_compile *c ) assert(if_depth > 0); brw_ENDIF(p, if_inst[--if_depth]); break; -#if 0 case OPCODE_BGNLOOP: loop_inst[loop_depth++] = brw_DO(p, BRW_EXECUTE_8); break; case OPCODE_BRK: + brw_set_predicate_control(p, get_predicate(inst)); brw_BREAK(p); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); + brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; case OPCODE_CONT: + brw_set_predicate_control(p, get_predicate(inst)); brw_CONT(p); brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; case OPCODE_ENDLOOP: { struct brw_instruction *inst0, *inst1; + GLuint br = 1; + loop_depth--; + + if (BRW_IS_IGDNG(brw)) + br = 2; + inst0 = inst1 = brw_WHILE(p, loop_inst[loop_depth]); /* patch all the BREAK/CONT instructions from last BEGINLOOP */ while (inst0 > loop_inst[loop_depth]) { inst0--; if (inst0->header.opcode == BRW_OPCODE_BREAK) { - inst0->bits3.if_else.jump_count = inst1 - inst0 + 1; + inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); inst0->bits3.if_else.pop_count = 0; } else if (inst0->header.opcode == BRW_OPCODE_CONTINUE) { - inst0->bits3.if_else.jump_count = inst1 - inst0; + inst0->bits3.if_else.jump_count = br * (inst1 - inst0); inst0->bits3.if_else.pop_count = 0; } } } break; -#else - (void) loop_inst; - (void) loop_depth; -#endif case OPCODE_BRA: - brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); + brw_set_predicate_control(p, get_predicate(inst)); brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); - brw_set_predicate_control_flag_value(p, 0xff); + brw_set_predicate_control(p, BRW_PREDICATE_NONE); break; case OPCODE_CAL: brw_set_access_mode(p, BRW_ALIGN_1); diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index ac11790151..124fde25fe 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -69,8 +69,6 @@ static void brw_destroy_context( struct intel_context *intel ) _mesa_free(brw->wm.compile_data); - brw_FrameBufferTexDestroy( brw ); - for (i = 0; i < brw->state.nr_color_regions; i++) intel_region_release(&brw->state.color_regions[i]); brw->state.nr_color_regions = 0; diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index ae98b5492d..872b1f3ecf 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -38,6 +38,8 @@ #include "brw_context.h" #include "brw_eu.h" +#define SATURATE (1<<5) + /* A big lookup table is used to figure out which and how many * additional regs will inserted before the main payload in the WM * program execution. These mainly relate to depth and stencil @@ -203,7 +205,6 @@ struct brw_wm_compile { GLuint fp_temp; GLuint fp_interp_emitted; GLuint fp_fragcolor_emitted; - GLuint fp_deriv_emitted; struct prog_src_register pixel_xy; struct prog_src_register delta_xy; @@ -299,5 +300,10 @@ void brw_wm_lookup_iz( GLuint line_aa, GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp); void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c); +void emit_ddxy(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + GLboolean is_ddx, + const struct brw_reg *arg0); #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 268f7965c0..bf80a2942a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -34,8 +34,6 @@ #include "brw_context.h" #include "brw_wm.h" -#define SATURATE (1<<5) - /* Not quite sure how correct this is - need to understand horiz * vs. vertical strides a little better. */ @@ -281,6 +279,79 @@ static void emit_frontfacing( struct brw_compile *p, brw_set_predicate_control_flag_value(p, 0xff); } +/* For OPCODE_DDX and OPCODE_DDY, per channel of output we've got input + * looking like: + * + * arg0: ss0.tl ss0.tr ss0.bl ss0.br ss1.tl ss1.tr ss1.bl ss1.br + * + * and we're trying to produce: + * + * DDX DDY + * dst: (ss0.tr - ss0.tl) (ss0.tl - ss0.bl) + * (ss0.tr - ss0.tl) (ss0.tr - ss0.br) + * (ss0.br - ss0.bl) (ss0.tl - ss0.bl) + * (ss0.br - ss0.bl) (ss0.tr - ss0.br) + * (ss1.tr - ss1.tl) (ss1.tl - ss1.bl) + * (ss1.tr - ss1.tl) (ss1.tr - ss1.br) + * (ss1.br - ss1.bl) (ss1.tl - ss1.bl) + * (ss1.br - ss1.bl) (ss1.tr - ss1.br) + * + * and add another set of two more subspans if in 16-pixel dispatch mode. + * + * For DDX, it ends up being easy: width = 2, horiz=0 gets us the same result + * for each pair, and vertstride = 2 jumps us 2 elements after processing a + * pair. But for DDY, it's harder, as we want to produce the pairs swizzled + * between each other. We could probably do it like ddx and swizzle the right + * order later, but bail for now and just produce + * ((ss0.tl - ss0.bl)x4 (ss1.tl - ss1.bl)x4) + */ +void emit_ddxy(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + GLboolean is_ddx, + const struct brw_reg *arg0) +{ + int i; + struct brw_reg src0, src1; + + if (mask & SATURATE) + brw_set_saturate(p, 1); + for (i = 0; i < 4; i++ ) { + if (mask & (1<<i)) { + if (is_ddx) { + src0 = brw_reg(arg0[i].file, arg0[i].nr, 1, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_2, + BRW_WIDTH_2, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + src1 = brw_reg(arg0[i].file, arg0[i].nr, 0, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_2, + BRW_WIDTH_2, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + } else { + src0 = brw_reg(arg0[i].file, arg0[i].nr, 0, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_4, + BRW_WIDTH_4, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + src1 = brw_reg(arg0[i].file, arg0[i].nr, 2, + BRW_REGISTER_TYPE_F, + BRW_VERTICAL_STRIDE_4, + BRW_WIDTH_4, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, WRITEMASK_XYZW); + } + brw_ADD(p, dst[i], src0, negate(src1)); + } + } + if (mask & SATURATE) + brw_set_saturate(p, 0); +} + static void emit_alu1( struct brw_compile *p, struct brw_instruction *(*func)(struct brw_compile *, struct brw_reg, @@ -908,6 +979,20 @@ static void emit_kil( struct brw_wm_compile *c, } } +/* KIL_NV kills the pixels that are currently executing, not based on a test + * of the arguments. + */ +static void emit_kil_nv( struct brw_wm_compile *c ) +{ + struct brw_compile *p = &c->func; + struct brw_reg r0uw = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); + + brw_push_insn_state(p); + brw_set_mask_control(p, BRW_MASK_DISABLE); + brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); //IMASK + brw_AND(p, r0uw, c->emit_mask_reg, r0uw); + brw_pop_insn_state(p); +} static void fire_fb_write( struct brw_wm_compile *c, GLuint base_reg, @@ -1258,6 +1343,14 @@ void brw_wm_emit( struct brw_wm_compile *c ) emit_alu1(p, brw_RNDD, dst, dst_flags, args[0]); break; + case OPCODE_DDX: + emit_ddxy(p, dst, dst_flags, GL_TRUE, args[0]); + break; + + case OPCODE_DDY: + emit_ddxy(p, dst, dst_flags, GL_FALSE, args[0]); + break; + case OPCODE_DP3: emit_dp3(p, dst, dst_flags, args[0], args[1]); break; @@ -1387,6 +1480,10 @@ void brw_wm_emit( struct brw_wm_compile *c ) emit_kil(c, args[0]); break; + case OPCODE_KIL_NV: + emit_kil_nv(c); + break; + default: _mesa_printf("Unsupported opcode %i (%s) in fragment shader\n", inst->opcode, inst->opcode < MAX_OPCODE ? diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 123fe841c3..4e3edfbbff 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -494,38 +494,6 @@ static void emit_interp( struct brw_wm_compile *c, c->fp_interp_emitted |= 1<<idx; } -static void emit_ddx( struct brw_wm_compile *c, - const struct prog_instruction *inst ) -{ - GLuint idx = inst->SrcReg[0].Index; - struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx); - - c->fp_deriv_emitted |= 1<<idx; - emit_op(c, - OPCODE_DDX, - inst->DstReg, - 0, - interp, - get_pixel_w(c), - src_undef()); -} - -static void emit_ddy( struct brw_wm_compile *c, - const struct prog_instruction *inst ) -{ - GLuint idx = inst->SrcReg[0].Index; - struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx); - - c->fp_deriv_emitted |= 1<<idx; - emit_op(c, - OPCODE_DDY, - inst->DstReg, - 0, - interp, - get_pixel_w(c), - src_undef()); -} - /*********************************************************************** * Hacks to extend the program parameter and constant lists. */ @@ -1186,12 +1154,6 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) */ out->DstReg.WriteMask = 0; break; - case OPCODE_DDX: - emit_ddx(c, inst); - break; - case OPCODE_DDY: - emit_ddy(c, inst); - break; case OPCODE_END: emit_fb_write(c); break; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 7c210abbce..c9fe1dd8ad 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -22,6 +22,7 @@ static struct brw_reg get_dst_reg(struct brw_wm_compile *c, GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp) { int i; + for (i = 0; i < fp->Base.NumInstructions; i++) { const struct prog_instruction *inst = &fp->Base.Instructions[i]; switch (inst->Opcode) { @@ -31,8 +32,6 @@ GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp) case OPCODE_CAL: case OPCODE_BRK: case OPCODE_RET: - case OPCODE_DDX: - case OPCODE_DDY: case OPCODE_NOISE1: case OPCODE_NOISE2: case OPCODE_NOISE3: @@ -293,7 +292,7 @@ static void prealloc_reg(struct brw_wm_compile *c) int i, j; struct brw_reg reg; int urb_read_length = 0; - GLuint inputs = FRAG_BIT_WPOS | c->fp_interp_emitted | c->fp_deriv_emitted; + GLuint inputs = FRAG_BIT_WPOS | c->fp_interp_emitted; GLuint reg_index = 0; memset(c->used_grf, GL_FALSE, sizeof(c->used_grf)); @@ -1474,61 +1473,6 @@ static void emit_sne(struct brw_wm_compile *c, emit_sop(c, inst, BRW_CONDITIONAL_NEQ); } -static void emit_ddx(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg interp[4]; - struct brw_reg dst; - struct brw_reg src0, w; - GLuint nr, i; - src0 = get_src_reg(c, inst, 0, 0); - w = get_src_reg(c, inst, 1, 3); - nr = src0.nr; - interp[0] = brw_vec1_grf(nr, 0); - interp[1] = brw_vec1_grf(nr, 4); - interp[2] = brw_vec1_grf(nr+1, 0); - interp[3] = brw_vec1_grf(nr+1, 4); - brw_set_saturate(p, inst->SaturateMode != SATURATE_OFF); - for(i = 0; i < 4; i++ ) { - if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i); - brw_MOV(p, dst, interp[i]); - brw_MUL(p, dst, dst, w); - } - } - brw_set_saturate(p, 0); -} - -static void emit_ddy(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg interp[4]; - struct brw_reg dst; - struct brw_reg src0, w; - GLuint nr, i; - - src0 = get_src_reg(c, inst, 0, 0); - nr = src0.nr; - w = get_src_reg(c, inst, 1, 3); - interp[0] = brw_vec1_grf(nr, 0); - interp[1] = brw_vec1_grf(nr, 4); - interp[2] = brw_vec1_grf(nr+1, 0); - interp[3] = brw_vec1_grf(nr+1, 4); - brw_set_saturate(p, inst->SaturateMode != SATURATE_OFF); - for(i = 0; i < 4; i++ ) { - if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i); - brw_MOV(p, dst, suboffset(interp[i], 1)); - brw_MUL(p, dst, dst, w); - } - } - brw_set_saturate(p, 0); -} - static INLINE struct brw_reg high_words( struct brw_reg reg ) { return stride( suboffset( retype( reg, BRW_REGISTER_TYPE_W ), 1 ), @@ -2780,6 +2724,21 @@ static void post_wm_emit( struct brw_wm_compile *c ) brw_resolve_cals(&c->func); } +static void +get_argument_regs(struct brw_wm_compile *c, + const struct prog_instruction *inst, + int index, + struct brw_reg *regs, + int mask) +{ + int i; + + for (i = 0; i < 4; i++) { + if (mask & (1 << i)) + regs[i] = get_src_reg(c, inst, index, i); + } +} + static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) { #define MAX_IF_DEPTH 32 @@ -2797,6 +2756,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) for (i = 0; i < c->nr_fp_insns; i++) { const struct prog_instruction *inst = &c->prog_instructions[i]; + int dst_flags; + struct brw_reg args[3][4], dst[4]; + int j; c->cur_inst = i; @@ -2814,6 +2776,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) else brw_set_conditionalmod(p, BRW_CONDITIONAL_NONE); + dst_flags = inst->DstReg.WriteMask; + if (inst->SaturateMode == SATURATE_ZERO_ONE) + dst_flags |= SATURATE; + switch (inst->Opcode) { case WM_PIXELXY: emit_pixel_xy(c, inst); @@ -2899,10 +2865,16 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_min_max(c, inst); break; case OPCODE_DDX: - emit_ddx(c, inst); - break; case OPCODE_DDY: - emit_ddy(c, inst); + for (j = 0; j < 4; j++) { + if (inst->DstReg.WriteMask & (1 << j)) + dst[j] = get_dst_reg(c, inst, j); + else + dst[j] = brw_null_reg(); + } + get_argument_regs(c, inst, 0, args[0], WRITEMASK_XYZW); + emit_ddxy(p, dst, dst_flags, (inst->Opcode == OPCODE_DDX), + args[0]); break; case OPCODE_SLT: emit_slt(c, inst); diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass1.c b/src/mesa/drivers/dri/i965/brw_wm_pass1.c index 3436a24717..b449394029 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c @@ -178,6 +178,11 @@ void brw_wm_pass1( struct brw_wm_compile *c ) read1 = writemask; break; + case OPCODE_DDX: + case OPCODE_DDY: + read0 = writemask; + break; + case OPCODE_MAD: case OPCODE_CMP: case OPCODE_LRP: @@ -270,6 +275,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) case OPCODE_DST: case WM_FRONTFACING: + case OPCODE_KIL_NV: default: break; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 39f8c6d522..361f91292b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -107,6 +107,12 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) /* as far as we can tell */ key->computes_depth = (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) != 0; + /* BRW_NEW_DEPTH_BUFFER + * Override for NULL depthbuffer case, required by the Pixel Shader Computed + * Depth field. + */ + if (brw->state.depth_region == NULL) + key->computes_depth = 0; /* _NEW_COLOR */ key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled; @@ -300,6 +306,7 @@ const struct brw_tracked_state brw_wm_unit = { .brw = (BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_CURBE_OFFSETS | + BRW_NEW_DEPTH_BUFFER | BRW_NEW_NR_WM_SURFACES), .cache = (CACHE_NEW_WM_PROG | diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 3dcc592bde..f7cc5153a8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -545,15 +545,20 @@ brw_update_renderbuffer_surface(struct brw_context *brw, irb->texformat->MesaFormat); } key.tiling = region->tiling; - key.width = region->width; - key.height = region->height; + if (brw->intel.intelScreen->driScrnPriv->dri2.enabled) { + key.width = rb->Width; + key.height = rb->Height; + } else { + key.width = region->width; + key.height = region->height; + } key.pitch = region->pitch; key.cpp = region->cpp; key.draw_offset = region->draw_offset; /* cur 3d or cube face offset */ } else { key.surface_type = BRW_SURFACE_NULL; key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - key.tiling = 0; + key.tiling = I915_TILING_X; key.width = 1; key.height = 1; key.cpp = 4; @@ -655,7 +660,7 @@ brw_wm_get_binding_table(struct brw_context *brw) if (bind_bo == NULL) { GLuint data_size = brw->wm.nr_surfaces * sizeof(GLuint); - uint32_t *data = malloc(data_size); + uint32_t data[BRW_WM_MAX_SURF]; int i; for (i = 0; i < brw->wm.nr_surfaces; i++) @@ -680,8 +685,6 @@ brw_wm_get_binding_table(struct brw_context *brw) brw->wm.surf_bo[i]); } } - - free(data); } return bind_bo; @@ -690,7 +693,6 @@ brw_wm_get_binding_table(struct brw_context *brw) static void prepare_wm_surfaces(struct brw_context *brw ) { GLcontext *ctx = &brw->intel.ctx; - struct intel_context *intel = &brw->intel; GLuint i; int old_nr_surfaces; @@ -719,17 +721,8 @@ static void prepare_wm_surfaces(struct brw_context *brw ) /* _NEW_TEXTURE, BRW_NEW_TEXDATA */ if (texUnit->_ReallyEnabled) { - if (texUnit->_Current == intel->frame_buffer_texobj) { - /* render to texture */ - dri_bo_unreference(brw->wm.surf_bo[surf]); - brw->wm.surf_bo[surf] = brw->wm.surf_bo[0]; - dri_bo_reference(brw->wm.surf_bo[surf]); - brw->wm.nr_surfaces = surf + 1; - } else { - /* regular texture */ - brw_update_texture_surface(ctx, i); - brw->wm.nr_surfaces = surf + 1; - } + brw_update_texture_surface(ctx, i); + brw->wm.nr_surfaces = surf + 1; } else { dri_bo_unreference(brw->wm.surf_bo[surf]); brw->wm.surf_bo[surf] = NULL; diff --git a/src/mesa/drivers/dri/i965/intel_generatemipmap.c b/src/mesa/drivers/dri/i965/intel_generatemipmap.c deleted file mode 120000 index 4c6b37ada0..0000000000 --- a/src/mesa/drivers/dri/i965/intel_generatemipmap.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_generatemipmap.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 51579df09e..d4899aab7f 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -157,7 +157,7 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ - assert((delta) >= 0); \ + assert((unsigned) (delta) < buf->size); \ intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 0c5be4c798..9e114db6c7 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -26,9 +26,6 @@ **************************************************************************/ -#include <stdio.h> -#include <errno.h> - #include "main/mtypes.h" #include "main/context.h" #include "main/enums.h" @@ -374,8 +371,6 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) skipBuffers = BUFFER_BIT_STENCIL; } - /* XXX Move this flush/lock into the following conditional? */ - intelFlush(&intel->ctx); LOCK_HARDWARE(intel); intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index a0225936c8..ea9d5a6276 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -209,7 +209,8 @@ intel_bufferobj_subdata(GLcontext * ctx, memcpy((char *)intel_obj->sys_buffer + offset, data, size); else { /* Flush any existing batchbuffer that might reference this data. */ - intelFlush(ctx); + if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) + intelFlush(ctx); dri_bo_subdata(intel_obj->buffer, offset, size, data); } @@ -257,10 +258,9 @@ intel_bufferobj_map(GLcontext * ctx, return obj->Pointer; } - /* Flush any existing batchbuffer that might have written to this - * buffer. - */ - intelFlush(ctx); + /* Flush any existing batchbuffer that might reference this data. */ + if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) + intelFlush(ctx); if (intel_obj->region) intel_bufferobj_cow(intel, intel_obj); @@ -330,7 +330,8 @@ intel_bufferobj_map_range(GLcontext * ctx, * the batchbuffer so that GEM knows about the buffer access for later * syncing. */ - if (!(access & GL_MAP_UNSYNCHRONIZED_BIT)) + if (!(access & GL_MAP_UNSYNCHRONIZED_BIT) && + drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) intelFlush(ctx); if (intel_obj->buffer == NULL) { diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 1b0e221789..fb62f0f430 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -172,7 +172,7 @@ intelClear(GLcontext *ctx, GLbitfield mask) DBG("\n"); } - _mesa_meta_clear(&intel->ctx, tri_mask); + _mesa_meta_Clear(&intel->ctx, tri_mask); } if (swrast_mask) { diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index ddb0550f77..15f4bc6f69 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -588,11 +588,6 @@ intelInitDriverFunctions(struct dd_function_table *functions) functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; - functions->CopyColorTable = _swrast_CopyColorTable; - functions->CopyColorSubTable = _swrast_CopyColorSubTable; - functions->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - functions->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - intelInitTextureFuncs(functions); intelInitTextureImageFuncs(functions); intelInitTextureSubImageFuncs(functions); @@ -645,10 +640,6 @@ intelInitContext(struct intel_context *intel, intel->maxBatchSize = BATCH_SZ; intel->bufmgr = intelScreen->bufmgr; - - if (0) /* for debug */ - drm_intel_bufmgr_set_debug(intel->bufmgr, 1); - intel->ttm = intelScreen->ttm; if (intel->ttm) { int bo_reuse_mode; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index d3acf6e4b3..2778cc0136 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -260,9 +260,6 @@ struct intel_context intel_line_func draw_line; intel_tri_func draw_tri; - /* These refer to the current drawing buffer: - */ - struct gl_texture_object *frame_buffer_texobj; /** * Set to true if a single constant cliprect should be used in the * batchbuffer. Otherwise, cliprects must be calculated at batchbuffer @@ -302,7 +299,6 @@ struct intel_context GLboolean use_texture_tiling; GLboolean use_early_z; - drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */ int perf_boxes; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 2e61c556d8..2eb08a8f05 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -31,6 +31,7 @@ #define need_GL_ARB_copy_buffer +#define need_GL_ARB_draw_elements_base_vertex #define need_GL_ARB_framebuffer_object #define need_GL_ARB_map_buffer_range #define need_GL_ARB_occlusion_query @@ -73,11 +74,15 @@ */ static const struct dri_extension card_extensions[] = { { "GL_ARB_copy_buffer", GL_ARB_copy_buffer_functions }, + { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, { "GL_ARB_half_float_pixel", NULL }, { "GL_ARB_map_buffer_range", GL_ARB_map_buffer_range_functions }, { "GL_ARB_multitexture", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { "GL_ARB_point_sprite", NULL }, + { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, + { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, + { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, { "GL_ARB_sync", GL_ARB_sync_functions }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_cube_map", NULL }, @@ -89,6 +94,7 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_texture_rectangle", NULL }, { "GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions}, { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, + { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions }, { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, { "GL_EXT_blend_color", GL_EXT_blend_color_functions }, { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions }, @@ -139,6 +145,7 @@ static const struct dri_extension i915_extensions[] = { /** i965-only extensions */ static const struct dri_extension brw_extensions[] = { + { "GL_ARB_depth_clamp", NULL }, { "GL_ARB_depth_texture", NULL }, { "GL_ARB_fragment_program", NULL }, { "GL_ARB_fragment_program_shadow", NULL }, @@ -147,13 +154,9 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_point_sprite", NULL }, { "GL_ARB_seamless_cube_map", NULL }, - { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, - { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, - { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, { "GL_ARB_shadow", NULL }, { "GL_MESA_texture_signed_rgba", NULL }, { "GL_ARB_texture_non_power_of_two", NULL }, - { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions }, { "GL_EXT_shadow_funcs", NULL }, { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, { "GL_EXT_texture_sRGB", NULL }, @@ -168,6 +171,7 @@ static const struct dri_extension brw_extensions[] = { static const struct dri_extension arb_oq_extensions[] = { + { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { NULL, NULL } }; @@ -179,6 +183,10 @@ static const struct dri_extension ttm_extensions[] = { { NULL, NULL } }; +static const struct dri_extension fragment_shader_extensions[] = { + { "GL_ARB_fragment_shader", NULL }, + { NULL, NULL } +}; /** * Initializes potential list of extensions if ctx == NULL, or actually enables @@ -202,6 +210,14 @@ intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) driInitExtensions(ctx, brw_extensions, GL_FALSE); if (intel == NULL || IS_915(intel->intelScreen->deviceID) - || IS_945(intel->intelScreen->deviceID)) + || IS_945(intel->intelScreen->deviceID)) { driInitExtensions(ctx, i915_extensions, GL_FALSE); + + if (intel == NULL || driQueryOptionb(&intel->optionCache, "fragment_shader")) + driInitExtensions(ctx, fragment_shader_extensions, GL_FALSE); + + if (intel == NULL || driQueryOptionb(&intel->optionCache, + "stub_occlusion_query")) + driInitExtensions(ctx, arb_oq_extensions, GL_FALSE); + } } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 804c034840..2e61371805 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -618,15 +618,8 @@ intel_render_texture(GLcontext * ctx, } /* compute offset of the particular 2D image within the texture region */ - imageOffset = intel_miptree_image_offset(intel_image->mt, - att->CubeMapFace, - att->TextureLevel); - - if (att->Texture->Target == GL_TEXTURE_3D) { - const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt, - att->TextureLevel); - imageOffset += offsets[att->Zoffset]; - } + imageOffset = intel_miptree_image_offset(intel_image->mt, att->CubeMapFace, + att->TextureLevel, att->Zoffset); /* store that offset in the region */ intel_image->mt->region->draw_offset = imageOffset; @@ -715,5 +708,5 @@ intel_fbo_init(struct intel_context *intel) intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture; intel->ctx.Driver.ResizeBuffers = intel_resize_buffers; intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer; - intel->ctx.Driver.BlitFramebuffer = _mesa_meta_blit_framebuffer; + intel->ctx.Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer; } diff --git a/src/mesa/drivers/dri/intel/intel_generatemipmap.c b/src/mesa/drivers/dri/intel/intel_generatemipmap.c deleted file mode 100644 index 12059e122c..0000000000 --- a/src/mesa/drivers/dri/intel/intel_generatemipmap.c +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * Copyright © 2009 Intel Corporation - * - * 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 (including the next - * paragraph) 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 - * THE AUTHORS OR COPYRIGHT HOLDERS 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. - * - * Authors: - * Eric Anholt <eric@anholt.net> - * - */ - -#include "main/glheader.h" -#include "main/enums.h" -#include "main/image.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/bufferobj.h" -#include "main/teximage.h" -#include "main/texenv.h" -#include "main/texobj.h" -#include "main/texstate.h" -#include "main/texparam.h" -#include "main/varray.h" -#include "main/attrib.h" -#include "main/enable.h" -#include "main/buffers.h" -#include "main/fbobject.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/depth.h" -#include "main/hash.h" -#include "main/mipmap.h" -#include "main/blend.h" -#include "glapi/dispatch.h" -#include "swrast/swrast.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_batchbuffer.h" -#include "intel_pixel.h" -#include "intel_tex.h" -#include "intel_mipmap_tree.h" - -static const char *intel_fp_tex2d = - "!!ARBfp1.0\n" - "TEX result.color, fragment.texcoord[0], texture[0], 2D;\n" - "END\n"; - -static GLboolean -intel_generate_mipmap_level(GLcontext *ctx, GLuint tex_name, - int level, int width, int height) -{ - struct intel_context *intel = intel_context(ctx); - GLfloat vertices[4][2]; - GLint status; - - /* Set to source from the previous level */ - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level - 1); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level - 1); - - /* Set to draw into the current level */ - _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, - GL_TEXTURE_2D, - tex_name, - level); - /* Choose to render to the color attachment. */ - _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); - - status = _mesa_CheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT); - if (status != GL_FRAMEBUFFER_COMPLETE_EXT) - return GL_FALSE; - - meta_set_passthrough_transform(&intel->meta); - - /* XXX: Doing it right would involve setting up the transformation to do - * 0-1 mapping or something, and not changing the vertex data. - */ - vertices[0][0] = 0; - vertices[0][1] = 0; - vertices[1][0] = width; - vertices[1][1] = 0; - vertices[2][0] = width; - vertices[2][1] = height; - vertices[3][0] = 0; - vertices[3][1] = height; - - _mesa_VertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &vertices); - _mesa_Enable(GL_VERTEX_ARRAY); - meta_set_default_texrect(&intel->meta); - - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - - meta_restore_texcoords(&intel->meta); - meta_restore_transform(&intel->meta); - - return GL_TRUE; -} - -static GLboolean -intel_generate_mipmap_2d(GLcontext *ctx, - GLenum target, - struct gl_texture_object *texObj) -{ - struct intel_context *intel = intel_context(ctx); - GLint old_active_texture; - int level, max_levels, start_level, end_level; - GLuint fb_name; - GLboolean success = GL_FALSE; - struct gl_framebuffer *saved_fbo = NULL; - struct gl_buffer_object *saved_array_buffer = NULL; - struct gl_buffer_object *saved_element_buffer = NULL; - - _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | - GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT); - _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); - old_active_texture = ctx->Texture.CurrentUnit; - _mesa_reference_framebuffer(&saved_fbo, ctx->DrawBuffer); - - /* use default array/index buffers */ - _mesa_reference_buffer_object(ctx, &saved_array_buffer, - ctx->Array.ArrayBufferObj); - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, - ctx->Shared->NullBufferObj); - _mesa_reference_buffer_object(ctx, &saved_element_buffer, - ctx->Array.ElementArrayBufferObj); - _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, - ctx->Shared->NullBufferObj); - - _mesa_Disable(GL_POLYGON_STIPPLE); - _mesa_Disable(GL_DEPTH_TEST); - _mesa_Disable(GL_STENCIL_TEST); - _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - _mesa_DepthMask(GL_FALSE); - - /* Bind the given texture to GL_TEXTURE_2D with linear filtering for our - * minification. - */ - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); - _mesa_Enable(GL_TEXTURE_2D); - _mesa_BindTexture(GL_TEXTURE_2D, texObj->Name); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_NEAREST); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - /* Bind the new renderbuffer to the color attachment point. */ - _mesa_GenFramebuffersEXT(1, &fb_name); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb_name); - - meta_set_fragment_program(&intel->meta, &intel->meta.tex2d_fp, - intel_fp_tex2d); - meta_set_passthrough_vertex_program(&intel->meta); - - max_levels = _mesa_max_texture_levels(ctx, texObj->Target); - start_level = texObj->BaseLevel; - end_level = texObj->MaxLevel; - - /* Loop generating level+1 from level. */ - for (level = start_level; level < end_level && level < max_levels - 1; level++) { - const struct gl_texture_image *srcImage; - int width, height; - - srcImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (srcImage->Border != 0) - goto fail; - - width = srcImage->Width / 2; - if (width < 1) - width = 1; - height = srcImage->Height / 2; - if (height < 1) - height = 1; - - if (width == srcImage->Width && - height == srcImage->Height) { - /* Neither _mesa_max_texture_levels nor texObj->MaxLevel are the - * maximum texture level for the object, so break out when we've gone - * over the edge. - */ - break; - } - - /* Make sure that there's space allocated for the target level. - * We could skip this if there's already space allocated and save some - * time. - */ - _mesa_TexImage2D(GL_TEXTURE_2D, level + 1, srcImage->InternalFormat, - width, height, 0, - GL_RGBA, GL_UNSIGNED_INT, NULL); - - if (!intel_generate_mipmap_level(ctx, texObj->Name, level + 1, - width, height)) - goto fail; - } - - success = GL_TRUE; - -fail: - meta_restore_fragment_program(&intel->meta); - meta_restore_vertex_program(&intel->meta); - - /* restore array/index buffers */ - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, - saved_array_buffer); - _mesa_reference_buffer_object(ctx, &saved_array_buffer, NULL); - _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, - saved_element_buffer); - _mesa_reference_buffer_object(ctx, &saved_element_buffer, NULL); - - - _mesa_DeleteFramebuffersEXT(1, &fb_name); - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); - if (saved_fbo) - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, saved_fbo->Name); - _mesa_reference_framebuffer(&saved_fbo, NULL); - _mesa_PopClientAttrib(); - _mesa_PopAttrib(); - - return success; -} - - -/** - * Generate new mipmap data from BASE+1 to BASE+p (the minimally-sized mipmap - * level). - * - * The texture object's miptree must be mapped. - * - * It would be really nice if this was just called by Mesa whenever mipmaps - * needed to be regenerated, rather than us having to remember to do so in - * each texture image modification path. - * - * This function should also include an accelerated path. - */ -void -intel_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj) -{ - struct intel_context *intel = intel_context(ctx); - struct intel_texture_object *intelObj = intel_texture_object(texObj); - GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - int face, i; - - /* HW path */ - if (target == GL_TEXTURE_2D && - ctx->Extensions.EXT_framebuffer_object && - ctx->Extensions.ARB_fragment_program && - ctx->Extensions.ARB_vertex_program) { - GLboolean success; - - /* We'll be accessing this texture using GL entrypoints, which should - * be resilient against other access to this texture. - */ - _mesa_unlock_texture(ctx, texObj); - success = intel_generate_mipmap_2d(ctx, target, texObj); - _mesa_lock_texture(ctx, texObj); - - if (success) - return; - } - - /* SW path */ - intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); - _mesa_generate_mipmap(ctx, target, texObj); - intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); - - /* Update the level information in our private data in the new images, since - * it didn't get set as part of a normal TexImage path. - */ - for (face = 0; face < nr_faces; face++) { - for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) { - struct intel_texture_image *intelImage; - - intelImage = intel_texture_image(texObj->Image[face][i]); - if (intelImage == NULL) - break; - - intelImage->level = i; - intelImage->face = face; - /* Unreference the miptree to signal that the new Data is a bare - * pointer from mesa. - */ - intel_miptree_release(intel, &intelImage->mt); - } - } -} diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 4f5101a312..01e9d4add3 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -28,6 +28,7 @@ #include "intel_context.h" #include "intel_mipmap_tree.h" #include "intel_regions.h" +#include "intel_tex_layout.h" #include "intel_chipset.h" #ifndef I915 #include "brw_state.h" @@ -36,6 +37,7 @@ #define FILE_DEBUG_FLAG DEBUG_MIPTREE + static GLenum target_to_target(GLenum target) { @@ -52,6 +54,7 @@ target_to_target(GLenum target) } } + static struct intel_mipmap_tree * intel_miptree_create_internal(struct intel_context *intel, GLenum target, @@ -101,6 +104,7 @@ intel_miptree_create_internal(struct intel_context *intel, return mt; } + struct intel_mipmap_tree * intel_miptree_create(struct intel_context *intel, GLenum target, @@ -153,6 +157,7 @@ intel_miptree_create(struct intel_context *intel, return mt; } + struct intel_mipmap_tree * intel_miptree_create_for_region(struct intel_context *intel, GLenum target, @@ -190,7 +195,8 @@ intel_miptree_create_for_region(struct intel_context *intel, intel_region_reference(&mt->region, region); return mt; - } +} + /** * intel_miptree_pitch_align: @@ -204,7 +210,6 @@ intel_miptree_create_for_region(struct intel_context *intel, * Given @pitch, compute a larger value which accounts for * any necessary alignment required by the device */ - int intel_miptree_pitch_align (struct intel_context *intel, struct intel_mipmap_tree *mt, uint32_t tiling, @@ -250,6 +255,7 @@ int intel_miptree_pitch_align (struct intel_context *intel, return pitch; } + void intel_miptree_reference(struct intel_mipmap_tree **dst, struct intel_mipmap_tree *src) @@ -259,6 +265,7 @@ intel_miptree_reference(struct intel_mipmap_tree **dst, DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount); } + void intel_miptree_release(struct intel_context *intel, struct intel_mipmap_tree **mt) @@ -297,9 +304,8 @@ intel_miptree_release(struct intel_context *intel, } - - -/* Can the image be pulled into a unified mipmap tree. This mirrors +/** + * Can the image be pulled into a unified mipmap tree? This mirrors * the completeness test in a lot of ways. * * Not sure whether I want to pass gl_texture_image here. @@ -386,6 +392,7 @@ intel_miptree_set_image_offset_ex(struct intel_mipmap_tree *mt, __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]); } + void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, GLuint level, GLuint img, @@ -395,35 +402,27 @@ intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, } -/* Although we use the image_offset[] array to store relative offsets - * to cube faces, Mesa doesn't know anything about this and expects - * each cube face to be treated as a separate image. - * - * These functions present that view to mesa: +/** + * Return offset to the start of a 2D slice of a texture (a mipmap level, + * cube face, 3D Z slice). + * \param mt the texture object/miptree + * \param face cube map face in [0,5] or zero for non-cube textures + * \param level mipmap level + * \param zslice Z slice of a 3D texture, or zero for non-3D textures */ -const GLuint * -intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, GLuint level) -{ - static const GLuint zero = 0; - - if (mt->target != GL_TEXTURE_3D || mt->level[level].nr_images == 1) - return &zero; - else - return mt->level[level].image_offset; -} - - GLuint -intel_miptree_image_offset(struct intel_mipmap_tree *mt, - GLuint face, GLuint level) +intel_miptree_image_offset(const struct intel_mipmap_tree *mt, + GLuint face, GLuint level, GLuint zslice) { + GLuint offset = mt->level[level].level_offset; + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) - return (mt->level[level].level_offset + - mt->level[level].image_offset[face]); - else - return mt->level[level].level_offset; -} + offset += mt->level[level].image_offset[face]; + else if (mt->target == GL_TEXTURE_3D) + offset += mt->level[level].image_offset[zslice]; + return offset; +} /** @@ -459,9 +458,10 @@ intel_miptree_image_map(struct intel_context * intel, } return (intel_region_map(intel, mt->region) + - intel_miptree_image_offset(mt, face, level)); + intel_miptree_image_offset(mt, face, level, 0)); } + void intel_miptree_image_unmap(struct intel_context *intel, struct intel_mipmap_tree *mt) @@ -471,8 +471,8 @@ intel_miptree_image_unmap(struct intel_context *intel, } - -/* Upload data for a particular image. +/** + * Upload data for a particular image. */ void intel_miptree_image_data(struct intel_context *intel, @@ -483,20 +483,20 @@ intel_miptree_image_data(struct intel_context *intel, GLuint src_row_pitch, GLuint src_image_pitch) { - GLuint depth = dst->level[level].depth; - GLuint dst_offset = intel_miptree_image_offset(dst, face, level); - const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); + const GLuint depth = dst->level[level].depth; GLuint i; - GLuint height = 0; DBG("%s: %d/%d\n", __FUNCTION__, face, level); for (i = 0; i < depth; i++) { - height = dst->level[level].height; - if(dst->compressed) + GLuint dst_offset = intel_miptree_image_offset(dst, face, level, i); + GLuint height = dst->level[level].height; + + if (dst->compressed) height = (height + 3) / 4; + intel_region_data(intel, dst->region, - dst_offset + dst_depth_offset[i], /* dst_offset */ + dst_offset, 0, 0, /* dstx, dsty */ src, src_row_pitch, @@ -507,8 +507,9 @@ intel_miptree_image_data(struct intel_context *intel, } } -extern void intel_get_texture_alignment_unit(GLenum, GLuint *, GLuint *); -/* Copy mipmap image between trees + +/** + * Copy mipmap image between trees */ void intel_miptree_image_copy(struct intel_context *intel, @@ -519,26 +520,26 @@ intel_miptree_image_copy(struct intel_context *intel, GLuint width = src->level[level].width; GLuint height = src->level[level].height; GLuint depth = src->level[level].depth; - GLuint dst_offset = intel_miptree_image_offset(dst, face, level); - GLuint src_offset = intel_miptree_image_offset(src, face, level); - const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); - const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level); GLuint i; GLboolean success; if (dst->compressed) { GLuint align_w, align_h; - intel_get_texture_alignment_unit(dst->internal_format, &align_w, &align_h); + intel_get_texture_alignment_unit(dst->internal_format, + &align_w, &align_h); height = (height + 3) / 4; width = ALIGN(width, align_w); } for (i = 0; i < depth; i++) { + GLuint dst_offset = intel_miptree_image_offset(dst, face, level, i); + GLuint src_offset = intel_miptree_image_offset(src, face, level, i); + success = intel_region_copy(intel, - dst->region, dst_offset + dst_depth_offset[i], + dst->region, dst_offset, 0, 0, - src->region, src_offset + src_depth_offset[i], + src->region, src_offset, 0, 0, width, height, GL_COPY); if (!success) { GLubyte *src_ptr, *dst_ptr; @@ -546,11 +547,11 @@ intel_miptree_image_copy(struct intel_context *intel, src_ptr = intel_region_map(intel, src->region); dst_ptr = intel_region_map(intel, dst->region); - _mesa_copy_rect(dst_ptr + dst_offset + dst_depth_offset[i], + _mesa_copy_rect(dst_ptr + dst_offset, dst->cpp, dst->pitch, 0, 0, width, height, - src_ptr + src_offset + src_depth_offset[i], + src_ptr + src_offset, src->pitch, 0, 0); intel_region_unmap(intel, src->region); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index c890b2a0d0..c08f9cd8b6 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -177,17 +177,9 @@ void intel_miptree_image_unmap(struct intel_context *intel, struct intel_mipmap_tree *mt); -/* Return the linear offset of an image relative to the start of the - * tree: - */ -GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt, - GLuint face, GLuint level); - -/* Return pointers to each 2d slice within an image. Indexed by depth - * value. - */ -const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, - GLuint level); +GLuint +intel_miptree_image_offset(const struct intel_mipmap_tree *mt, + GLuint face, GLuint level, GLuint zslice); void intel_miptree_set_level_info(struct intel_mipmap_tree *mt, diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index a300141655..993e427a99 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -129,20 +129,6 @@ intel_check_blit_fragment_ops(GLcontext * ctx, GLboolean src_alpha_is_one) return GL_TRUE; } - -GLboolean -intel_check_meta_tex_fragment_ops(GLcontext * ctx) -{ - if (ctx->NewState) - _mesa_update_state(ctx); - - /* Some of _ImageTransferState (scale, bias) could be done with - * fragment programs on i915. - */ - return !(ctx->_ImageTransferState || ctx->Fog.Enabled || /* not done yet */ - ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled); -} - /* The intel_region struct doesn't really do enough to capture the * format of the pixels in the region. For now this code assumes that * the region is a display surface and hence is either ARGB8888 or diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h index 96a6dd17b2..743b6497c5 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.h +++ b/src/mesa/drivers/dri/intel/intel_pixel.h @@ -34,8 +34,6 @@ void intelInitPixelFuncs(struct dd_function_table *functions); GLboolean intel_check_blit_fragment_ops(GLcontext * ctx, GLboolean src_alpha_is_one); -GLboolean intel_check_meta_tex_fragment_ops(GLcontext * ctx); - GLboolean intel_check_blit_format(struct intel_region *region, GLenum format, GLenum type); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index b543a0bbc3..9a0bcc07a5 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -209,7 +209,7 @@ do_blit_bitmap( GLcontext *ctx, if (!dst) return GL_FALSE; - if (unpack->BufferObj->Name) { + if (_mesa_is_bufferobj(unpack->BufferObj)) { bitmap = map_pbo(ctx, width, height, unpack, bitmap); if (bitmap == NULL) return GL_TRUE; /* even though this is an error, we're done */ @@ -329,7 +329,7 @@ out: if (INTEL_DEBUG & DEBUG_SYNC) intel_batchbuffer_flush(intel->batch); - if (unpack->BufferObj->Name) { + if (_mesa_is_bufferobj(unpack->BufferObj)) { /* done with PBO so unmap it now */ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, unpack->BufferObj); @@ -418,7 +418,7 @@ intel_texture_bitmap(GLcontext * ctx, return GL_FALSE; } - if (unpack->BufferObj->Name) { + if (_mesa_is_bufferobj(unpack->BufferObj)) { bitmap = map_pbo(ctx, width, height, unpack, bitmap); if (bitmap == NULL) return GL_TRUE; /* even though this is an error, we're done */ @@ -428,7 +428,7 @@ intel_texture_bitmap(GLcontext * ctx, a8_bitmap = _mesa_calloc(width * height); _mesa_expand_bitmap(width, height, unpack, bitmap, a8_bitmap, width, 0xff); - if (unpack->BufferObj->Name) { + if (_mesa_is_bufferobj(unpack->BufferObj)) { /* done with PBO so unmap it now */ ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, unpack->BufferObj); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index 07ca8f7ddb..f058b3c8e4 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -240,5 +240,5 @@ intelCopyPixels(GLcontext * ctx, return; /* this will use swrast if needed */ - _mesa_meta_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type); + _mesa_meta_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type); } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 7fbb89fd6a..5ffa847fd4 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -54,7 +54,7 @@ #include "intel_fbo.h" -/** XXX compare perf of this vs. _mesa_meta_draw_pixels(STENCIL) */ +/** XXX compare perf of this vs. _mesa_meta_DrawPixels(STENCIL) */ static GLboolean intel_stencil_drawpixels(GLcontext * ctx, GLint x, GLint y, @@ -265,7 +265,7 @@ intelDrawPixels(GLcontext * ctx, /* XXX this function doesn't seem to work reliably even when all * the pre-requisite conditions are met. * Note that this function is never hit with conform. - * Fall back to swrast because even the _mesa_meta_draw_pixels() approach + * Fall back to swrast because even the _mesa_meta_DrawPixels() approach * isn't working because of an apparent stencil bug. */ if (intel_stencil_drawpixels(ctx, x, y, width, height, format, type, @@ -280,6 +280,6 @@ intelDrawPixels(GLcontext * ctx, } #endif - _mesa_meta_draw_pixels(ctx, x, y, width, height, format, type, - unpack, pixels); + _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type, + unpack, pixels); } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index e036736323..4707500180 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -180,16 +180,7 @@ do_blit_readpixels(GLcontext * ctx, if (!src) return GL_FALSE; - if (pack->BufferObj->Name) { - /* XXX This validation should be done by core mesa: - */ - if (!_mesa_validate_pbo_access(2, pack, width, height, 1, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels"); - return GL_TRUE; - } - } - else { + if (!_mesa_is_bufferobj(pack->BufferObj)) { /* PBO only for now: */ if (INTEL_DEBUG & DEBUG_PIXEL) @@ -225,9 +216,8 @@ do_blit_readpixels(GLcontext * ctx, rowLength = -rowLength; } - /* XXX 64-bit cast? */ - dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height, - format, type, 0, 0, 0); + dst_offset = (GLintptr) _mesa_image_address(2, pack, pixels, width, height, + format, type, 0, 0, 0); /* Although the blits go on the command buffer, need to do this and diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 1b8c56e68d..24f7fbc992 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -79,6 +79,10 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).") DRI_CONF_OPT_END + DRI_CONF_OPT_BEGIN(fragment_shader, bool, false) + DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.") + DRI_CONF_OPT_END + DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY DRI_CONF_FORCE_S3TC_ENABLE(false) @@ -88,10 +92,14 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_NO_RAST(false) DRI_CONF_ALWAYS_FLUSH_BATCH(false) DRI_CONF_ALWAYS_FLUSH_CACHE(false) + + DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false) + DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.") + DRI_CONF_OPT_END DRI_CONF_SECTION_END DRI_CONF_END; -const GLuint __driNConfigOptions = 10; +const GLuint __driNConfigOptions = 12; #ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 8df4990880..dcfcad1d95 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -444,23 +444,30 @@ intel_renderbuffer_unmap(struct intel_context *intel, * _ColorReadBuffer, _DepthBuffer or _StencilBuffer fields. */ static void -intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) +intel_map_unmap_framebuffer(struct intel_context *intel, + struct gl_framebuffer *fb, + GLboolean map) { - GLcontext *ctx = &intel->ctx; - GLuint i, j; + GLuint i; /* color draw buffers */ - for (j = 0; j < ctx->DrawBuffer->_NumColorDrawBuffers; j++) { + for (i = 0; i < fb->_NumColorDrawBuffers; i++) { if (map) - intel_renderbuffer_map(intel, ctx->DrawBuffer->_ColorDrawBuffers[j]); + intel_renderbuffer_map(intel, fb->_ColorDrawBuffers[i]); else - intel_renderbuffer_unmap(intel, ctx->DrawBuffer->_ColorDrawBuffers[j]); + intel_renderbuffer_unmap(intel, fb->_ColorDrawBuffers[i]); } + /* color read buffer */ + if (map) + intel_renderbuffer_map(intel, fb->_ColorReadBuffer); + else + intel_renderbuffer_unmap(intel, fb->_ColorReadBuffer); + /* check for render to textures */ for (i = 0; i < BUFFER_COUNT; i++) { struct gl_renderbuffer_attachment *att = - ctx->DrawBuffer->Attachment + i; + fb->Attachment + i; struct gl_texture_object *tex = att->Texture; if (tex) { /* render to texture */ @@ -472,34 +479,23 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) } } - /* color read buffers */ - if (map) - intel_renderbuffer_map(intel, ctx->ReadBuffer->_ColorReadBuffer); - else - intel_renderbuffer_unmap(intel, ctx->ReadBuffer->_ColorReadBuffer); - /* depth buffer (Note wrapper!) */ - if (ctx->DrawBuffer->_DepthBuffer) { + if (fb->_DepthBuffer) { if (map) - intel_renderbuffer_map(intel, ctx->DrawBuffer->_DepthBuffer->Wrapped); + intel_renderbuffer_map(intel, fb->_DepthBuffer->Wrapped); else - intel_renderbuffer_unmap(intel, - ctx->DrawBuffer->_DepthBuffer->Wrapped); + intel_renderbuffer_unmap(intel, fb->_DepthBuffer->Wrapped); } /* stencil buffer (Note wrapper!) */ - if (ctx->DrawBuffer->_StencilBuffer) { + if (fb->_StencilBuffer) { if (map) - intel_renderbuffer_map(intel, - ctx->DrawBuffer->_StencilBuffer->Wrapped); + intel_renderbuffer_map(intel, fb->_StencilBuffer->Wrapped); else - intel_renderbuffer_unmap(intel, - ctx->DrawBuffer->_StencilBuffer->Wrapped); + intel_renderbuffer_unmap(intel, fb->_StencilBuffer->Wrapped); } } - - /** * Prepare for software rendering. Map current read/draw framebuffers' * renderbuffes and all currently bound texture objects. @@ -522,7 +518,9 @@ intelSpanRenderStart(GLcontext * ctx) } } - intel_map_unmap_buffers(intel, GL_TRUE); + intel_map_unmap_framebuffer(intel, ctx->DrawBuffer, GL_TRUE); + if (ctx->ReadBuffer != ctx->DrawBuffer) + intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_TRUE); } /** @@ -544,7 +542,9 @@ intelSpanRenderFinish(GLcontext * ctx) } } - intel_map_unmap_buffers(intel, GL_FALSE); + intel_map_unmap_framebuffer(intel, ctx->DrawBuffer, GL_FALSE); + if (ctx->ReadBuffer != ctx->DrawBuffer) + intel_map_unmap_framebuffer(intel, ctx->ReadBuffer, GL_FALSE); UNLOCK_HARDWARE(intel); } @@ -558,6 +558,43 @@ intelInitSpanFuncs(GLcontext * ctx) swdd->SpanRenderFinish = intelSpanRenderFinish; } +void +intel_map_vertex_shader_textures(GLcontext *ctx) +{ + struct intel_context *intel = intel_context(ctx); + int i; + + if (ctx->VertexProgram._Current == NULL) + return; + + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled && + ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; + + intel_tex_map_images(intel, intel_texture_object(texObj)); + } + } +} + +void +intel_unmap_vertex_shader_textures(GLcontext *ctx) +{ + struct intel_context *intel = intel_context(ctx); + int i; + + if (ctx->VertexProgram._Current == NULL) + return; + + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled && + ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; + + intel_tex_unmap_images(intel, intel_texture_object(texObj)); + } + } +} /** * Plug in appropriate span read/write functions for the given renderbuffer. @@ -711,6 +748,9 @@ intel_set_span_functions(struct intel_context *intel, intel_YTile_InitStencilPointers_z24_s8(rb); break; } + } else { + _mesa_problem(NULL, + "Unexpected ActualFormat in intelSetSpanFunctions"); } break; default: diff --git a/src/mesa/drivers/dri/intel/intel_span.h b/src/mesa/drivers/dri/intel/intel_span.h index acbeb4abe1..bffe109aa5 100644 --- a/src/mesa/drivers/dri/intel/intel_span.h +++ b/src/mesa/drivers/dri/intel/intel_span.h @@ -36,5 +36,7 @@ void intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb); void intel_renderbuffer_unmap(struct intel_context *intel, struct gl_renderbuffer *rb); +void intel_map_vertex_shader_textures(GLcontext *ctx); +void intel_unmap_vertex_shader_textures(GLcontext *ctx); #endif diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c index 1286fe929b..0d7889d3c2 100644 --- a/src/mesa/drivers/dri/intel/intel_syncobj.c +++ b/src/mesa/drivers/dri/intel/intel_syncobj.c @@ -114,7 +114,7 @@ static void intel_check_sync(GLcontext *ctx, struct gl_sync_object *s) { struct intel_sync_object *sync = (struct intel_sync_object *)s; - if (sync->bo && drm_intel_bo_busy(sync->bo)) { + if (sync->bo && !drm_intel_bo_busy(sync->bo)) { drm_intel_bo_unreference(sync->bo); sync->bo = NULL; s->StatusFlag = 1; diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index df63f29a42..215a534a5c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -2,6 +2,7 @@ #include "main/texobj.h" #include "main/teximage.h" #include "main/mipmap.h" +#include "drivers/common/meta.h" #include "intel_context.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -158,11 +159,58 @@ timed_memcpy(void *dest, const void *src, size_t n) } #endif /* DO_DEBUG */ + +/** + * Called via ctx->Driver.GenerateMipmap() + * This is basically a wrapper for _mesa_meta_GenerateMipmap() which checks + * if we'll be using software mipmap generation. In that case, we need to + * map/unmap the base level texture image. + */ +static void +intelGenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) { + /* sw path: need to map texture images */ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_object *intelObj = intel_texture_object(texObj); + intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); + _mesa_generate_mipmap(ctx, target, texObj); + intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); + + { + GLuint nr_faces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint face, i; + /* Update the level information in our private data in the new images, + * since it didn't get set as part of a normal TexImage path. + */ + for (face = 0; face < nr_faces; face++) { + for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) { + struct intel_texture_image *intelImage = + intel_texture_image(texObj->Image[face][i]); + if (!intelImage) + break; + intelImage->level = i; + intelImage->face = face; + /* Unreference the miptree to signal that the new Data is a + * bare pointer from mesa. + */ + intel_miptree_release(intel, &intelImage->mt); + } + } + } + } + else { + _mesa_meta_GenerateMipmap(ctx, target, texObj); + } +} + + void intelInitTextureFuncs(struct dd_function_table *functions) { functions->ChooseTextureFormat = intelChooseTextureFormat; - functions->GenerateMipmap = intel_generate_mipmap; + functions->GenerateMipmap = intelGenerateMipmap; functions->NewTextureObject = intelNewTextureObject; functions->NewTextureImage = intelNewTextureImage; diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index 471aa2a240..57ed0b1aab 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -71,7 +71,4 @@ void intel_tex_unmap_images(struct intel_context *intel, int intel_compressed_num_bytes(GLuint mesaFormat); -void intel_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj); - #endif diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index b241c11625..99cd818417 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -30,7 +30,8 @@ #include "main/image.h" #include "main/teximage.h" #include "main/mipmap.h" -#include "swrast/swrast.h" + +#include "drivers/common/meta.h" #include "intel_screen.h" #include "intel_context.h" @@ -91,7 +92,6 @@ do_copy_texsubimage(struct intel_context *intel, GLint x, GLint y, GLsizei width, GLsizei height) { GLcontext *ctx = &intel->ctx; - struct gl_texture_object *texObj = intelImage->base.TexObject; const struct intel_region *src = get_teximage_source(intel, internalFormat); @@ -117,7 +117,7 @@ do_copy_texsubimage(struct intel_context *intel, INTEL_WRITE_PART); GLuint image_offset = intel_miptree_image_offset(intelImage->mt, intelImage->face, - intelImage->level); + intelImage->level, 0); const GLint orig_x = x; const GLint orig_y = y; GLshort src_pitch; @@ -171,11 +171,6 @@ do_copy_texsubimage(struct intel_context *intel, UNLOCK_HARDWARE(intel); - /* GL_SGIS_generate_mipmap */ - if (intelImage->level == texObj->BaseLevel && texObj->GenerateMipmap) { - intel_generate_mipmap(ctx, target, texObj); - } - return GL_TRUE; } @@ -222,8 +217,8 @@ intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level, return; fail: - _swrast_copy_teximage1d(ctx, target, level, internalFormat, x, y, - width, border); + _mesa_meta_CopyTexImage1D(ctx, target, level, internalFormat, x, y, + width, border); } @@ -270,8 +265,8 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, return; fail: - _swrast_copy_teximage2d(ctx, target, level, internalFormat, x, y, - width, height, border); + _mesa_meta_CopyTexImage2D(ctx, target, level, internalFormat, x, y, + width, height, border); } @@ -295,7 +290,7 @@ intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, if (!do_copy_texsubimage(intel_context(ctx), target, intel_texture_image(texImage), internalFormat, xoffset, 0, x, y, width, 1)) { - _swrast_copy_texsubimage1d(ctx, target, level, xoffset, x, y, width); + _mesa_meta_CopyTexSubImage1D(ctx, target, level, xoffset, x, y, width); } } @@ -321,10 +316,10 @@ intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, internalFormat, xoffset, yoffset, x, y, width, height)) { - DBG("%s - fallback to swrast\n", __FUNCTION__); + DBG("%s - fallback to _mesa_meta_CopyTexSubImage2D\n", __FUNCTION__); - _swrast_copy_texsubimage2d(ctx, target, level, - xoffset, yoffset, x, y, width, height); + _mesa_meta_CopyTexSubImage2D(ctx, target, level, + xoffset, yoffset, x, y, width, height); } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index c5f5220837..dcc613449f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -1,15 +1,11 @@ -#include <stdlib.h> -#include <stdio.h> - #include "main/glheader.h" #include "main/macros.h" #include "main/mtypes.h" #include "main/enums.h" -#include "main/colortab.h" +#include "main/bufferobj.h" #include "main/convolve.h" #include "main/context.h" -#include "main/simple_list.h" #include "main/texcompress.h" #include "main/texformat.h" #include "main/texgetimage.h" @@ -205,8 +201,11 @@ try_pbo_upload(struct intel_context *intel, struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); GLuint src_offset, src_stride; GLuint dst_offset, dst_stride; + dri_bo *dst_buffer = intel_region_buffer(intel, + intelImage->mt->region, + INTEL_WRITE_FULL); - if (unpack->BufferObj->Name == 0 || + if (!_mesa_is_bufferobj(unpack->BufferObj) || intel->ctx._ImageTransferState || unpack->SkipPixels || unpack->SkipRows) { DBG("%s: failure 1\n", __FUNCTION__); @@ -223,11 +222,13 @@ try_pbo_upload(struct intel_context *intel, dst_offset = intel_miptree_image_offset(intelImage->mt, intelImage->face, - intelImage->level); + intelImage->level, + 0 /* zslice */); dst_stride = intelImage->mt->pitch; - intelFlush(&intel->ctx); + if (drm_intel_bo_references(intel->batch->buf, dst_buffer)) + intelFlush(&intel->ctx); LOCK_HARDWARE(intel); { dri_bo *src_buffer = intel_bufferobj_buffer(intel, pbo, INTEL_READ); @@ -264,7 +265,7 @@ try_pbo_zcopy(struct intel_context *intel, GLuint src_offset, src_stride; GLuint dst_offset, dst_stride; - if (unpack->BufferObj->Name == 0 || + if (!_mesa_is_bufferobj(unpack->BufferObj) || intel->ctx._ImageTransferState || unpack->SkipPixels || unpack->SkipRows) { DBG("%s: failure 1\n", __FUNCTION__); @@ -281,8 +282,8 @@ try_pbo_zcopy(struct intel_context *intel, dst_offset = intel_miptree_image_offset(intelImage->mt, intelImage->face, - intelImage->level); - + intelImage->level, + 0 /* zslice */); dst_stride = intelImage->mt->pitch; if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) { @@ -320,8 +321,6 @@ intelTexImage(GLcontext * ctx, DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__, _mesa_lookup_enum_by_nr(target), level, width, height, depth, border); - intelFlush(ctx); - intelImage->face = target_to_face(target); intelImage->level = level; @@ -427,7 +426,7 @@ intelTexImage(GLcontext * ctx, */ if (dims <= 2 && intelImage->mt && - unpack->BufferObj->Name != 0 && + _mesa_is_bufferobj(unpack->BufferObj) && check_pbo_format(internalFormat, format, type, intelImage->base.TexFormat)) { @@ -482,13 +481,20 @@ intelTexImage(GLcontext * ctx, LOCK_HARDWARE(intel); if (intelImage->mt) { - if (pixels != NULL) + if (pixels != NULL) { + /* Flush any queued rendering with the texture before mapping. */ + if (drm_intel_bo_references(intel->batch->buf, + intelImage->mt->region->buffer)) { + intelFlush(ctx); + } texImage->Data = intel_miptree_image_map(intel, intelImage->mt, intelImage->face, intelImage->level, &dstRowStride, intelImage->base.ImageOffsets); + } + texImage->RowStride = dstRowStride / intelImage->mt->cpp; } else { @@ -550,11 +556,6 @@ intelTexImage(GLcontext * ctx, } UNLOCK_HARDWARE(intel); - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - intel_generate_mipmap(ctx, target, texObj); - } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h index c9de9b5678..a9ac9e7eb4 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.h +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h @@ -33,7 +33,7 @@ #include "main/macros.h" -static GLuint minify( GLuint d ) +static INLINE GLuint minify( GLuint d ) { return MAX2(1, d>>1); } diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index 89037073f8..751ec2c98c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -129,11 +129,6 @@ intelTexSubimage(GLcontext * ctx, } UNLOCK_HARDWARE(intel); - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - intel_generate_mipmap(ctx, target, texObj); - } } diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile index 7246d51f5d..a8f463e9fd 100644 --- a/src/mesa/drivers/dri/mach64/Makefile +++ b/src/mesa/drivers/dri/mach64/Makefile @@ -30,4 +30,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 225d23179e..5a22c93bd2 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -567,7 +567,6 @@ void mach64InitTextureFuncs( struct dd_function_table *functions ) functions->UpdateTexturePalette = NULL; functions->ActiveTexture = NULL; - functions->PrioritizeTexture = NULL; driInitTextureFormats(); } diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile index a871064c62..0cc329fb22 100644 --- a/src/mesa/drivers/dri/mga/Makefile +++ b/src/mesa/drivers/dri/mga/Makefile @@ -31,4 +31,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile index 796dfbc516..52c5a38a70 100644 --- a/src/mesa/drivers/dri/r128/Makefile +++ b/src/mesa/drivers/dri/r128/Makefile @@ -29,4 +29,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 42635bf9d9..776f1e3f3f 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -55,8 +55,7 @@ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) X86_SOURCES = -DRIVER_DEFINES = -DRADEON_COMMON=1 -DRADEON_COMMON_FOR_R200 \ - -Wall +DRIVER_DEFINES = -DRADEON_R200 -Wall DRI_LIB_DEPS += $(RADEON_LDFLAGS) @@ -67,4 +66,3 @@ include ../Makefile.template #INCLUDES += -I../radeon/server -symlinks: diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 5d8d6f6658..cb0f715fa0 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -54,6 +54,7 @@ DRIVER_SOURCES = \ r300_vertprog.c \ r300_fragprog_common.c \ r300_shader.c \ + radeon_mesa_to_rc.c \ r300_emit.c \ r300_swtcl.c \ $(RADEON_COMMON_SOURCES) \ @@ -62,23 +63,18 @@ DRIVER_SOURCES = \ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) -DRIVER_DEFINES = -DCOMPILE_R300 -DR200_MERGED=0 \ - -DRADEON_COMMON=1 -DRADEON_COMMON_FOR_R300 \ +DRIVER_DEFINES = -DRADEON_R300 # -DRADEON_BO_TRACK \ -Wall DRI_LIB_DEPS += $(RADEON_LDFLAGS) -PIPE_DRIVERS = compiler/libr300compiler.a +SUBDIRS = compiler -##### TARGETS ##### +EXTRA_MODULES = compiler/libr300compiler.a -include ../Makefile.template -symlinks: +##### TARGETS ##### -# Mark the archive phony so that we always check for recompilation -.PHONY : compiler/libr300compiler.a +include ../Makefile.template -compiler/libr300compiler.a: - cd compiler && $(MAKE) diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile b/src/mesa/drivers/dri/r300/compiler/Makefile index d973844192..d83888d90a 100644 --- a/src/mesa/drivers/dri/r300/compiler/Makefile +++ b/src/mesa/drivers/dri/r300/compiler/Makefile @@ -8,10 +8,17 @@ LIBNAME = r300compiler C_SOURCES = \ radeon_code.c \ radeon_compiler.c \ - radeon_nqssadce.c \ radeon_program.c \ + radeon_program_print.c \ + radeon_opcodes.c \ radeon_program_alu.c \ radeon_program_pair.c \ + radeon_pair_translate.c \ + radeon_pair_schedule.c \ + radeon_pair_regalloc.c \ + radeon_dataflow.c \ + radeon_dataflow_deadcode.c \ + radeon_dataflow_swizzles.c \ r3xx_fragprog.c \ r300_fragprog.c \ r300_fragprog_swizzle.c \ diff --git a/src/mesa/drivers/dri/r300/compiler/SConscript b/src/mesa/drivers/dri/r300/compiler/SConscript new file mode 100755 index 0000000000..46075a8aee --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/SConscript @@ -0,0 +1,37 @@ +Import('*') + +env = env.Clone() +env.Append(CPPPATH = '#/include') +env.Append(CPPPATH = '#/src/mesa') + +# temporary fix +env['CFLAGS'] = str(env['CFLAGS']).replace('-Werror=declaration-after-statement', '') + +r300compiler = env.ConvenienceLibrary( + target = 'r300compiler', + source = [ + 'radeon_code.c', + 'radeon_compiler.c', + 'radeon_program.c', + 'radeon_program_print.c', + 'radeon_opcodes.c', + 'radeon_program_alu.c', + 'radeon_program_pair.c', + 'radeon_pair_translate.c', + 'radeon_pair_schedule.c', + 'radeon_pair_regalloc.c', + 'radeon_dataflow.c', + 'radeon_dataflow_deadcode.c', + 'radeon_dataflow_swizzles.c', + 'r3xx_fragprog.c', + 'r300_fragprog.c', + 'r300_fragprog_swizzle.c', + 'r300_fragprog_emit.c', + 'r500_fragprog.c', + 'r500_fragprog_emit.c', + 'r3xx_vertprog.c', + 'r3xx_vertprog_dump.c', + 'memory_pool.c', + ]) + +Return('r300compiler') diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c index 6c9fba4914..aa69b0fc72 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c @@ -27,17 +27,17 @@ #include "r300_fragprog.h" -#include "shader/prog_parameter.h" +#include <stdio.h> #include "../r300_reg.h" -static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int tmu) +static struct rc_src_register shadow_ambient(struct radeon_compiler * c, int tmu) { - struct prog_src_register reg = { 0, }; + struct rc_src_register reg = { 0, }; - reg.File = PROGRAM_STATE_VAR; + reg.File = RC_FILE_CONSTANT; reg.Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_SHADOW_AMBIENT, tmu); - reg.Swizzle = SWIZZLE_WWWW; + reg.Swizzle = RC_SWIZZLE_WWWW; return reg; } @@ -47,7 +47,7 @@ static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int t * - extract operand swizzles * - introduce a temporary register when write masks are needed */ -GLboolean r300_transform_TEX( +int r300_transform_TEX( struct radeon_compiler * c, struct rc_instruction* inst, void* data) @@ -55,77 +55,77 @@ GLboolean r300_transform_TEX( struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; - if (inst->I.Opcode != OPCODE_TEX && - inst->I.Opcode != OPCODE_TXB && - inst->I.Opcode != OPCODE_TXP && - inst->I.Opcode != OPCODE_KIL) - return GL_FALSE; + if (inst->U.I.Opcode != RC_OPCODE_TEX && + inst->U.I.Opcode != RC_OPCODE_TXB && + inst->U.I.Opcode != RC_OPCODE_TXP && + inst->U.I.Opcode != RC_OPCODE_KIL) + return 0; /* ARB_shadow & EXT_shadow_funcs */ - if (inst->I.Opcode != OPCODE_KIL && - c->Program.ShadowSamplers & (1 << inst->I.TexSrcUnit)) { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + if (inst->U.I.Opcode != RC_OPCODE_KIL && + c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) { + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; - if (comparefunc == GL_NEVER || comparefunc == GL_ALWAYS) { - inst->I.Opcode = OPCODE_MOV; + if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->U.I.Opcode = RC_OPCODE_MOV; - if (comparefunc == GL_ALWAYS) { - inst->I.SrcReg[0].File = PROGRAM_BUILTIN; - inst->I.SrcReg[0].Swizzle = SWIZZLE_1111; + if (comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; } else { - inst->I.SrcReg[0] = shadow_ambient(c, inst->I.TexSrcUnit); + inst->U.I.SrcReg[0] = shadow_ambient(c, inst->U.I.TexSrcUnit); } - return GL_TRUE; + return 1; } else { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - GLuint depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; + unsigned int depthmode = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_mode; struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst); struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp); struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad); int pass, fail; - inst_rcp->I.Opcode = OPCODE_RCP; - inst_rcp->I.DstReg.File = PROGRAM_TEMPORARY; - inst_rcp->I.DstReg.Index = rc_find_free_temporary(c); - inst_rcp->I.DstReg.WriteMask = WRITEMASK_W; - inst_rcp->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_rcp->I.SrcReg[0].Swizzle = SWIZZLE_WWWW; - - inst_cmp->I.DstReg = inst->I.DstReg; - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = rc_find_free_temporary(c); - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; - - inst_mad->I.Opcode = OPCODE_MAD; - inst_mad->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mad->I.DstReg.Index = rc_find_free_temporary(c); - inst_mad->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mad->I.SrcReg[0].Swizzle = SWIZZLE_ZZZZ; - inst_mad->I.SrcReg[1].File = PROGRAM_TEMPORARY; - inst_mad->I.SrcReg[1].Index = inst_rcp->I.DstReg.Index; - inst_mad->I.SrcReg[1].Swizzle = SWIZZLE_WWWW; - inst_mad->I.SrcReg[2].File = PROGRAM_TEMPORARY; - inst_mad->I.SrcReg[2].Index = inst->I.DstReg.Index; + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; + inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; + + inst_cmp->U.I.DstReg = inst->U.I.DstReg; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = rc_find_free_temporary(c); + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + + inst_mad->U.I.Opcode = RC_OPCODE_MAD; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mad->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[1].Index = inst_rcp->U.I.DstReg.Index; + inst_mad->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[2].Index = inst->U.I.DstReg.Index; if (depthmode == 0) /* GL_LUMINANCE */ - inst_mad->I.SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z); + inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); else if (depthmode == 2) /* GL_ALPHA */ - inst_mad->I.SrcReg[2].Swizzle = SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; /* Recall that SrcReg[0] is tex, SrcReg[2] is r and: * r < tex <=> -tex+r < 0 * r >= tex <=> not (-tex+r < 0 */ - if (comparefunc == GL_LESS || comparefunc == GL_GEQUAL) - inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ NEGATE_XYZW; + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GEQUAL) + inst_mad->U.I.SrcReg[2].Negate = inst_mad->U.I.SrcReg[2].Negate ^ RC_MASK_XYZW; else - inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ NEGATE_XYZW; + inst_mad->U.I.SrcReg[0].Negate = inst_mad->U.I.SrcReg[0].Negate ^ RC_MASK_XYZW; - inst_cmp->I.Opcode = OPCODE_CMP; + inst_cmp->U.I.Opcode = RC_OPCODE_CMP; /* DstReg has been filled out above */ - inst_cmp->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst_cmp->I.SrcReg[0].Index = inst_mad->I.DstReg.Index; + inst_cmp->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_cmp->U.I.SrcReg[0].Index = inst_mad->U.I.DstReg.Index; - if (comparefunc == GL_LESS || comparefunc == GL_GREATER) { + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GREATER) { pass = 1; fail = 2; } else { @@ -133,9 +133,9 @@ GLboolean r300_transform_TEX( fail = 1; } - inst_cmp->I.SrcReg[pass].File = PROGRAM_BUILTIN; - inst_cmp->I.SrcReg[pass].Swizzle = SWIZZLE_1111; - inst_cmp->I.SrcReg[fail] = shadow_ambient(c, inst->I.TexSrcUnit); + inst_cmp->U.I.SrcReg[pass].File = RC_FILE_NONE; + inst_cmp->U.I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; + inst_cmp->U.I.SrcReg[fail] = shadow_ambient(c, inst->U.I.TexSrcUnit); } } @@ -143,52 +143,52 @@ GLboolean r300_transform_TEX( * instead of [0..Width]x[0..Height]. * Add a scaling instruction. */ - if (inst->I.Opcode != OPCODE_KIL && inst->I.TexSrcTarget == TEXTURE_RECT_INDEX) { + if (inst->U.I.Opcode != RC_OPCODE_KIL && inst->U.I.TexSrcTarget == RC_TEXTURE_RECT) { struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst->Prev); - inst_mul->I.Opcode = OPCODE_MUL; - inst_mul->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mul->I.DstReg.Index = rc_find_free_temporary(c); - inst_mul->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mul->I.SrcReg[1].File = PROGRAM_STATE_VAR; - inst_mul->I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_TEXRECT_FACTOR, inst->I.TexSrcUnit); + inst_mul->U.I.Opcode = RC_OPCODE_MUL; + inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mul->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mul->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mul->U.I.SrcReg[1].File = RC_FILE_CONSTANT; + inst_mul->U.I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_TEXRECT_FACTOR, inst->U.I.TexSrcUnit); - reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[0].Index = inst_mul->I.DstReg.Index; + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = inst_mul->U.I.DstReg.Index; } /* Cannot write texture to output registers or with masks */ - if (inst->I.Opcode != OPCODE_KIL && - (inst->I.DstReg.File != PROGRAM_TEMPORARY || inst->I.DstReg.WriteMask != WRITEMASK_XYZW)) { + if (inst->U.I.Opcode != RC_OPCODE_KIL && + (inst->U.I.DstReg.File != RC_FILE_TEMPORARY || inst->U.I.DstReg.WriteMask != RC_MASK_XYZW)) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg = inst->I.DstReg; - inst_mov->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst_mov->I.SrcReg[0].Index = rc_find_free_temporary(c); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg = inst->U.I.DstReg; + inst_mov->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mov->U.I.SrcReg[0].Index = rc_find_free_temporary(c); - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; } /* Cannot read texture coordinate from constants file */ - if (inst->I.SrcReg[0].File != PROGRAM_TEMPORARY && inst->I.SrcReg[0].File != PROGRAM_INPUT) { + if (inst->U.I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->U.I.SrcReg[0].File != RC_FILE_INPUT) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mov->I.DstReg.Index = rc_find_free_temporary(c); - inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[0].Index = inst_mov->I.DstReg.Index; + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = inst_mov->U.I.DstReg.Index; } - return GL_TRUE; + return 1; } /* just some random things... */ diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h index 0ac46dbd9c..418df36c93 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h @@ -33,9 +33,6 @@ #ifndef __R300_FRAGPROG_H_ #define __R300_FRAGPROG_H_ -#include "shader/program.h" -#include "shader/prog_instruction.h" - #include "radeon_compiler.h" #include "radeon_program.h" @@ -44,6 +41,6 @@ extern void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler extern void r300FragmentProgramDump(struct rX00_fragment_program_code *c); -extern GLboolean r300_transform_TEX(struct radeon_compiler * c, struct rc_instruction* inst, void* data); +extern int r300_transform_TEX(struct radeon_compiler * c, struct rc_instruction* inst, void* data); #endif diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c index c7227bbd15..375838d98e 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c @@ -56,7 +56,6 @@ struct r300_emit_state { }; #define PROG_CODE \ - struct r300_emit_state * emit = (struct r300_emit_state*)data; \ struct r300_fragment_program_compiler *c = emit->compiler; \ struct r300_fragment_program_code *code = &c->code->code.r300 @@ -69,64 +68,76 @@ struct r300_emit_state { /** * Mark a temporary register as used. */ -static void use_temporary(struct r300_fragment_program_code *code, GLuint index) +static void use_temporary(struct r300_fragment_program_code *code, unsigned int index) { if (index > code->pixsize) code->pixsize = index; } +static unsigned int use_source(struct r300_fragment_program_code* code, struct radeon_pair_instruction_source src) +{ + if (src.File == RC_FILE_CONSTANT) { + return src.Index | (1 << 5); + } else if (src.File == RC_FILE_TEMPORARY) { + use_temporary(code, src.Index); + return src.Index; + } + + return 0; +} + -static GLuint translate_rgb_opcode(struct r300_fragment_program_compiler * c, GLuint opcode) +static unsigned int translate_rgb_opcode(struct r300_fragment_program_compiler * c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R300_ALU_OUTC_CMP; - case OPCODE_DP3: return R300_ALU_OUTC_DP3; - case OPCODE_DP4: return R300_ALU_OUTC_DP4; - case OPCODE_FRC: return R300_ALU_OUTC_FRC; + case RC_OPCODE_CMP: return R300_ALU_OUTC_CMP; + case RC_OPCODE_DP3: return R300_ALU_OUTC_DP3; + case RC_OPCODE_DP4: return R300_ALU_OUTC_DP4; + case RC_OPCODE_FRC: return R300_ALU_OUTC_FRC; default: error("translate_rgb_opcode(%i): Unknown opcode", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R300_ALU_OUTC_MAD; - case OPCODE_MAX: return R300_ALU_OUTC_MAX; - case OPCODE_MIN: return R300_ALU_OUTC_MIN; - case OPCODE_REPL_ALPHA: return R300_ALU_OUTC_REPL_ALPHA; + case RC_OPCODE_MAD: return R300_ALU_OUTC_MAD; + case RC_OPCODE_MAX: return R300_ALU_OUTC_MAX; + case RC_OPCODE_MIN: return R300_ALU_OUTC_MIN; + case RC_OPCODE_REPL_ALPHA: return R300_ALU_OUTC_REPL_ALPHA; } } -static GLuint translate_alpha_opcode(struct r300_fragment_program_compiler * c, GLuint opcode) +static unsigned int translate_alpha_opcode(struct r300_fragment_program_compiler * c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R300_ALU_OUTA_CMP; - case OPCODE_DP3: return R300_ALU_OUTA_DP4; - case OPCODE_DP4: return R300_ALU_OUTA_DP4; - case OPCODE_EX2: return R300_ALU_OUTA_EX2; - case OPCODE_FRC: return R300_ALU_OUTA_FRC; - case OPCODE_LG2: return R300_ALU_OUTA_LG2; + case RC_OPCODE_CMP: return R300_ALU_OUTA_CMP; + case RC_OPCODE_DP3: return R300_ALU_OUTA_DP4; + case RC_OPCODE_DP4: return R300_ALU_OUTA_DP4; + case RC_OPCODE_EX2: return R300_ALU_OUTA_EX2; + case RC_OPCODE_FRC: return R300_ALU_OUTA_FRC; + case RC_OPCODE_LG2: return R300_ALU_OUTA_LG2; default: error("translate_rgb_opcode(%i): Unknown opcode", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R300_ALU_OUTA_MAD; - case OPCODE_MAX: return R300_ALU_OUTA_MAX; - case OPCODE_MIN: return R300_ALU_OUTA_MIN; - case OPCODE_RCP: return R300_ALU_OUTA_RCP; - case OPCODE_RSQ: return R300_ALU_OUTA_RSQ; + case RC_OPCODE_MAD: return R300_ALU_OUTA_MAD; + case RC_OPCODE_MAX: return R300_ALU_OUTA_MAX; + case RC_OPCODE_MIN: return R300_ALU_OUTA_MIN; + case RC_OPCODE_RCP: return R300_ALU_OUTA_RCP; + case RC_OPCODE_RSQ: return R300_ALU_OUTA_RSQ; } } /** * Emit one paired ALU instruction. */ -static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) +static int emit_alu(struct r300_emit_state * emit, struct rc_pair_instruction* inst) { PROG_CODE; if (code->alu.length >= R300_PFS_MAX_ALU_INST) { error("Too many ALU instructions"); - return GL_FALSE; + return 0; } int ip = code->alu.length++; @@ -136,17 +147,13 @@ static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) code->alu.inst[ip].alpha_inst = translate_alpha_opcode(c, inst->Alpha.Opcode); for(j = 0; j < 3; ++j) { - GLuint src = inst->RGB.Src[j].Index | (inst->RGB.Src[j].Constant << 5); - if (!inst->RGB.Src[j].Constant) - use_temporary(code, inst->RGB.Src[j].Index); + unsigned int src = use_source(code, inst->RGB.Src[j]); code->alu.inst[ip].rgb_addr |= src << (6*j); - src = inst->Alpha.Src[j].Index | (inst->Alpha.Src[j].Constant << 5); - if (!inst->Alpha.Src[j].Constant) - use_temporary(code, inst->Alpha.Src[j].Index); + src = use_source(code, inst->Alpha.Src[j]); code->alu.inst[ip].alpha_addr |= src << (6*j); - GLuint arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); + unsigned int arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); arg |= inst->RGB.Arg[j].Abs << 6; arg |= inst->RGB.Arg[j].Negate << 5; code->alu.inst[ip].rgb_inst |= arg << (7*j); @@ -186,27 +193,27 @@ static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) if (inst->Alpha.DepthWriteMask) { code->alu.inst[ip].alpha_addr |= R300_ALU_DSTA_DEPTH; emit->node_flags |= R300_W_OUT; - c->code->writes_depth = GL_TRUE; + c->code->writes_depth = 1; } - return GL_TRUE; + return 1; } /** * Finish the current node without advancing to the next one. */ -static GLboolean finish_node(struct r300_emit_state * emit) +static int finish_node(struct r300_emit_state * emit) { struct r300_fragment_program_compiler * c = emit->compiler; struct r300_fragment_program_code *code = &emit->compiler->code->code.r300; if (code->alu.length == emit->node_first_alu) { /* Generate a single NOP for this node */ - struct radeon_pair_instruction inst; - _mesa_bzero(&inst, sizeof(inst)); + struct rc_pair_instruction inst; + memset(&inst, 0, sizeof(inst)); if (!emit_alu(emit, &inst)) - return GL_FALSE; + return 0; } unsigned alu_offset = emit->node_first_alu; @@ -217,7 +224,7 @@ static GLboolean finish_node(struct r300_emit_state * emit) if (code->tex.length == emit->node_first_tex) { if (emit->current_node > 0) { error("Node %i has no TEX instructions", emit->current_node); - return GL_FALSE; + return 0; } tex_end = 0; @@ -240,7 +247,7 @@ static GLboolean finish_node(struct r300_emit_state * emit) (tex_end << R300_TEX_SIZE_SHIFT) | emit->node_flags; - return GL_TRUE; + return 1; } @@ -248,79 +255,72 @@ static GLboolean finish_node(struct r300_emit_state * emit) * Begin a block of texture instructions. * Create the necessary indirection. */ -static GLboolean begin_tex(void* data) +static int begin_tex(struct r300_emit_state * emit) { PROG_CODE; if (code->alu.length == emit->node_first_alu && code->tex.length == emit->node_first_tex) { - return GL_TRUE; + return 1; } if (emit->current_node == 3) { error("Too many texture indirections"); - return GL_FALSE; + return 0; } if (!finish_node(emit)) - return GL_FALSE; + return 0; emit->current_node++; emit->node_first_tex = code->tex.length; emit->node_first_alu = code->alu.length; emit->node_flags = 0; - return GL_TRUE; + return 1; } -static GLboolean emit_tex(void* data, struct radeon_pair_texture_instruction* inst) +static int emit_tex(struct r300_emit_state * emit, struct rc_instruction * inst) { PROG_CODE; if (code->tex.length >= R300_PFS_MAX_TEX_INST) { error("Too many TEX instructions"); - return GL_FALSE; + return 0; } - GLuint unit = inst->TexSrcUnit; - GLuint dest = inst->DestIndex; - GLuint opcode; + unsigned int unit = inst->U.I.TexSrcUnit; + unsigned int dest = inst->U.I.DstReg.Index; + unsigned int opcode; - switch(inst->Opcode) { - case RADEON_OPCODE_KIL: opcode = R300_TEX_OP_KIL; break; - case RADEON_OPCODE_TEX: opcode = R300_TEX_OP_LD; break; - case RADEON_OPCODE_TXB: opcode = R300_TEX_OP_TXB; break; - case RADEON_OPCODE_TXP: opcode = R300_TEX_OP_TXP; break; + switch(inst->U.I.Opcode) { + case RC_OPCODE_KIL: opcode = R300_TEX_OP_KIL; break; + case RC_OPCODE_TEX: opcode = R300_TEX_OP_LD; break; + case RC_OPCODE_TXB: opcode = R300_TEX_OP_TXB; break; + case RC_OPCODE_TXP: opcode = R300_TEX_OP_TXP; break; default: - error("Unknown texture opcode %i", inst->Opcode); - return GL_FALSE; + error("Unknown texture opcode %i", inst->U.I.Opcode); + return 0; } - if (inst->Opcode == RADEON_OPCODE_KIL) { + if (inst->U.I.Opcode == RC_OPCODE_KIL) { unit = 0; dest = 0; } else { use_temporary(code, dest); } - use_temporary(code, inst->SrcIndex); + use_temporary(code, inst->U.I.SrcReg[0].Index); code->tex.inst[code->tex.length++] = - (inst->SrcIndex << R300_SRC_ADDR_SHIFT) | + (inst->U.I.SrcReg[0].Index << R300_SRC_ADDR_SHIFT) | (dest << R300_DST_ADDR_SHIFT) | (unit << R300_TEX_ID_SHIFT) | (opcode << R300_TEX_INST_SHIFT); - return GL_TRUE; + return 1; } -static const struct radeon_pair_handler pair_handler = { - .EmitPaired = &emit_alu, - .EmitTex = &emit_tex, - .BeginTexBlock = &begin_tex, - .MaxHwTemps = R300_PFS_NUM_TEMP_REGS -}; - /** * Final compilation step: Turn the intermediate radeon_program into * machine-readable instructions. @@ -333,9 +333,26 @@ void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi memset(&emit, 0, sizeof(emit)); emit.compiler = compiler; - _mesa_bzero(code, sizeof(struct r300_fragment_program_code)); + memset(code, 0, sizeof(struct r300_fragment_program_code)); + + for(struct rc_instruction * inst = compiler->Base.Program.Instructions.Next; + inst != &compiler->Base.Program.Instructions && !compiler->Base.Error; + inst = inst->Next) { + if (inst->Type == RC_INSTRUCTION_NORMAL) { + if (inst->U.I.Opcode == RC_OPCODE_BEGIN_TEX) { + begin_tex(&emit); + continue; + } + + emit_tex(&emit, inst); + } else { + emit_alu(&emit, &inst->U.P); + } + } + + if (code->pixsize >= R300_PFS_NUM_TEMP_REGS) + rc_error(&compiler->Base, "Too many hardware temporaries used.\n"); - radeonPairProgram(compiler, &pair_handler, &emit); if (compiler->Base.Error) return; diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c index 1b14cc3888..cfa48a59e3 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c @@ -33,16 +33,17 @@ #include "r300_fragprog_swizzle.h" +#include <stdio.h> + #include "../r300_reg.h" -#include "radeon_nqssadce.h" #include "radeon_compiler.h" -#define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, SWIZZLE_##y, SWIZZLE_##z, SWIZZLE_ZERO)) +#define MAKE_SWZ3(x, y, z) (RC_MAKE_SWIZZLE(RC_SWIZZLE_##x, RC_SWIZZLE_##y, RC_SWIZZLE_##z, RC_SWIZZLE_ZERO)) struct swizzle_data { - GLuint hash; /**< swizzle value this matches */ - GLuint base; /**< base value for hw swizzle */ - GLuint stride; /**< difference in base between arg0/1/2 */ + unsigned int hash; /**< swizzle value this matches */ + unsigned int base; /**< base value for hw swizzle */ + unsigned int stride; /**< difference in base between arg0/1/2 */ }; static const struct swizzle_data native_swizzles[] = { @@ -65,15 +66,15 @@ static const int num_native_swizzles = sizeof(native_swizzles)/sizeof(native_swi * Find a native RGB swizzle that matches the given swizzle. * Returns 0 if none found. */ -static const struct swizzle_data* lookup_native_swizzle(GLuint swizzle) +static const struct swizzle_data* lookup_native_swizzle(unsigned int swizzle) { int i, comp; for(i = 0; i < num_native_swizzles; ++i) { const struct swizzle_data* sd = &native_swizzles[i]; for(comp = 0; comp < 3; ++comp) { - GLuint swz = GET_SWZ(swizzle, comp); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(swizzle, comp); + if (swz == RC_SWIZZLE_UNUSED) continue; if (swz != GET_SWZ(sd->hash, comp)) break; @@ -90,71 +91,72 @@ static const struct swizzle_data* lookup_native_swizzle(GLuint swizzle) * Check whether the given instruction supports the swizzle and negate * combinations in the given source register. */ -GLboolean r300FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg) +static int r300_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { if (reg.Abs) - reg.Negate = NEGATE_NONE; + reg.Negate = RC_MASK_NONE; - if (opcode == OPCODE_KIL || - opcode == OPCODE_TEX || - opcode == OPCODE_TXB || - opcode == OPCODE_TXP) { + if (opcode == RC_OPCODE_KIL || + opcode == RC_OPCODE_TEX || + opcode == RC_OPCODE_TXB || + opcode == RC_OPCODE_TXP) { int j; if (reg.Abs || reg.Negate) - return GL_FALSE; + return 0; for(j = 0; j < 4; ++j) { - GLuint swz = GET_SWZ(reg.Swizzle, j); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(reg.Swizzle, j); + if (swz == RC_SWIZZLE_UNUSED) continue; if (swz != j) - return GL_FALSE; + return 0; } - return GL_TRUE; + return 1; } - GLuint relevant = 0; + unsigned int relevant = 0; int j; for(j = 0; j < 3; ++j) - if (GET_SWZ(reg.Swizzle, j) != SWIZZLE_NIL) + if (GET_SWZ(reg.Swizzle, j) != RC_SWIZZLE_UNUSED) relevant |= 1 << j; if ((reg.Negate & relevant) && ((reg.Negate & relevant) != relevant)) - return GL_FALSE; + return 0; if (!lookup_native_swizzle(reg.Swizzle)) - return GL_FALSE; + return 0; - return GL_TRUE; + return 1; } -/** - * Generate MOV dst, src using only native swizzles. - */ -void r300FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, struct prog_src_register src) +static void r300_swizzle_split( + struct rc_src_register src, unsigned int mask, + struct rc_swizzle_split * split) { if (src.Abs) - src.Negate = NEGATE_NONE; + src.Negate = RC_MASK_NONE; + + split->NumPhases = 0; - while(dst.WriteMask) { + while(mask) { const struct swizzle_data *best_swizzle = 0; - GLuint best_matchcount = 0; - GLuint best_matchmask = 0; + unsigned int best_matchcount = 0; + unsigned int best_matchmask = 0; int i, comp; for(i = 0; i < num_native_swizzles; ++i) { const struct swizzle_data *sd = &native_swizzles[i]; - GLuint matchcount = 0; - GLuint matchmask = 0; + unsigned int matchcount = 0; + unsigned int matchmask = 0; for(comp = 0; comp < 3; ++comp) { - if (!GET_BIT(dst.WriteMask, comp)) + if (!GET_BIT(mask, comp)) continue; - GLuint swz = GET_SWZ(src.Swizzle, comp); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(src.Swizzle, comp); + if (swz == RC_SWIZZLE_UNUSED) continue; if (swz == GET_SWZ(sd->hash, comp)) { /* check if the negate bit of current component @@ -170,34 +172,35 @@ void r300FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, best_swizzle = sd; best_matchcount = matchcount; best_matchmask = matchmask; - if (matchmask == (dst.WriteMask & WRITEMASK_XYZ)) + if (matchmask == (mask & RC_MASK_XYZ)) break; } } - struct rc_instruction *inst = rc_insert_new_instruction(s->Compiler, s->IP->Prev); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg = dst; - inst->I.DstReg.WriteMask &= (best_matchmask | WRITEMASK_W); - inst->I.SrcReg[0] = src; - inst->I.SrcReg[0].Negate = (best_matchmask & src.Negate) ? NEGATE_XYZW : NEGATE_NONE; - /* Note: We rely on NqSSA/DCE to set unused swizzle components to NIL */ + if (mask & RC_MASK_W) + best_matchmask |= RC_MASK_W; - dst.WriteMask &= ~inst->I.DstReg.WriteMask; + split->Phase[split->NumPhases++] = best_matchmask; + mask &= ~best_matchmask; } } +struct rc_swizzle_caps r300_swizzle_caps = { + .IsNative = r300_swizzle_is_native, + .Split = r300_swizzle_split +}; + /** * Translate an RGB (XYZ) swizzle into the hardware code for the given * instruction source. */ -GLuint r300FPTranslateRGBSwizzle(GLuint src, GLuint swizzle) +unsigned int r300FPTranslateRGBSwizzle(unsigned int src, unsigned int swizzle) { const struct swizzle_data* sd = lookup_native_swizzle(swizzle); if (!sd) { - _mesa_printf("Not a native swizzle: %08x\n", swizzle); + fprintf(stderr, "Not a native swizzle: %08x\n", swizzle); return 0; } @@ -209,15 +212,15 @@ GLuint r300FPTranslateRGBSwizzle(GLuint src, GLuint swizzle) * Translate an Alpha (W) swizzle into the hardware code for the given * instruction source. */ -GLuint r300FPTranslateAlphaSwizzle(GLuint src, GLuint swizzle) +unsigned int r300FPTranslateAlphaSwizzle(unsigned int src, unsigned int swizzle) { if (swizzle < 3) return swizzle + 3*src; switch(swizzle) { - case SWIZZLE_W: return R300_ALU_ARGA_SRC0A + src; - case SWIZZLE_ONE: return R300_ALU_ARGA_ONE; - case SWIZZLE_ZERO: return R300_ALU_ARGA_ZERO; + case RC_SWIZZLE_W: return R300_ALU_ARGA_SRC0A + src; + case RC_SWIZZLE_ONE: return R300_ALU_ARGA_ONE; + case RC_SWIZZLE_ZERO: return R300_ALU_ARGA_ZERO; default: return R300_ALU_ARGA_ONE; } } diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h index 231bf4eef5..118476af13 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h @@ -28,15 +28,11 @@ #ifndef __R300_FRAGPROG_SWIZZLE_H_ #define __R300_FRAGPROG_SWIZZLE_H_ -#include "main/glheader.h" -#include "shader/prog_instruction.h" +#include "radeon_swizzle.h" -struct nqssadce_state; +extern struct rc_swizzle_caps r300_swizzle_caps; -GLboolean r300FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg); -void r300FPBuildSwizzle(struct nqssadce_state*, struct prog_dst_register dst, struct prog_src_register src); - -GLuint r300FPTranslateRGBSwizzle(GLuint src, GLuint swizzle); -GLuint r300FPTranslateAlphaSwizzle(GLuint src, GLuint swizzle); +unsigned int r300FPTranslateRGBSwizzle(unsigned int src, unsigned int swizzle); +unsigned int r300FPTranslateAlphaSwizzle(unsigned int src, unsigned int swizzle); #endif /* __R300_FRAGPROG_SWIZZLE_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 76c3a7ecfd..5581f25352 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -22,22 +22,21 @@ #include "radeon_compiler.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" +#include <stdio.h> -#include "radeon_nqssadce.h" +#include "radeon_dataflow.h" #include "radeon_program_alu.h" #include "r300_fragprog.h" #include "r300_fragprog_swizzle.h" #include "r500_fragprog.h" -static void nqssadce_init(struct nqssadce_state* s) +static void dataflow_outputs_mark_use(void * userdata, void * data, + void (*callback)(void *, unsigned int, unsigned int)) { - struct r300_fragment_program_compiler * c = s->UserData; - s->Outputs[c->OutputColor].Sourced = WRITEMASK_XYZW; - s->Outputs[c->OutputDepth].Sourced = WRITEMASK_W; + struct r300_fragment_program_compiler * c = userdata; + callback(data, c->OutputColor, RC_MASK_XYZW); + callback(data, c->OutputDepth, RC_MASK_W); } static void rewrite_depth_out(struct r300_fragment_program_compiler * c) @@ -45,35 +44,35 @@ static void rewrite_depth_out(struct r300_fragment_program_compiler * c) struct rc_instruction *rci; for (rci = c->Base.Program.Instructions.Next; rci != &c->Base.Program.Instructions; rci = rci->Next) { - struct prog_instruction * inst = &rci->I; + struct rc_sub_instruction * inst = &rci->U.I; - if (inst->DstReg.File != PROGRAM_OUTPUT || inst->DstReg.Index != c->OutputDepth) + if (inst->DstReg.File != RC_FILE_OUTPUT || inst->DstReg.Index != c->OutputDepth) continue; - if (inst->DstReg.WriteMask & WRITEMASK_Z) { - inst->DstReg.WriteMask = WRITEMASK_W; + if (inst->DstReg.WriteMask & RC_MASK_Z) { + inst->DstReg.WriteMask = RC_MASK_W; } else { inst->DstReg.WriteMask = 0; continue; } switch (inst->Opcode) { - case OPCODE_FRC: - case OPCODE_MOV: - inst->SrcReg[0] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[0]); + case RC_OPCODE_FRC: + case RC_OPCODE_MOV: + inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); break; - case OPCODE_ADD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MUL: - inst->SrcReg[0] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[0]); - inst->SrcReg[1] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[1]); + case RC_OPCODE_ADD: + case RC_OPCODE_MAX: + case RC_OPCODE_MIN: + case RC_OPCODE_MUL: + inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); + inst->SrcReg[1] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[1]); break; - case OPCODE_CMP: - case OPCODE_MAD: - inst->SrcReg[0] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[0]); - inst->SrcReg[1] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[1]); - inst->SrcReg[2] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[2]); + case RC_OPCODE_CMP: + case RC_OPCODE_MAD: + inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); + inst->SrcReg[1] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[1]); + inst->SrcReg[2] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[2]); break; default: // Scalar instructions needn't be reswizzled @@ -89,11 +88,14 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) if (c->is_r500) { struct radeon_program_transformation transformations[] = { { &r500_transform_TEX, c }, + { &r500_transform_IF, 0 }, { &radeonTransformALU, 0 }, { &radeonTransformDeriv, 0 }, { &radeonTransformTrigScale, 0 } }; - radeonLocalTransform(&c->Base, 4, transformations); + radeonLocalTransform(&c->Base, 5, transformations); + + c->Base.SwizzleCaps = &r500_swizzle_caps; } else { struct radeon_program_transformation transformations[] = { { &r300_transform_TEX, c }, @@ -101,32 +103,66 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) { &radeonTransformTrigSimple, 0 } }; radeonLocalTransform(&c->Base, 3, transformations); + + c->Base.SwizzleCaps = &r300_swizzle_caps; } if (c->Base.Debug) { - _mesa_printf("Fragment Program: After native rewrite:\n"); + fprintf(stderr, "Fragment Program: After native rewrite:\n"); rc_print_program(&c->Base.Program); fflush(stderr); } - if (c->is_r500) { - struct radeon_nqssadce_descr nqssadce = { - .Init = &nqssadce_init, - .IsNativeSwizzle = &r500FPIsNativeSwizzle, - .BuildSwizzle = &r500FPBuildSwizzle - }; - radeonNqssaDce(&c->Base, &nqssadce, c); - } else { - struct radeon_nqssadce_descr nqssadce = { - .Init = &nqssadce_init, - .IsNativeSwizzle = &r300FPIsNativeSwizzle, - .BuildSwizzle = &r300FPBuildSwizzle - }; - radeonNqssaDce(&c->Base, &nqssadce, c); + rc_dataflow_deadcode(&c->Base, &dataflow_outputs_mark_use, c); + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Fragment Program: After deadcode:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + + rc_dataflow_swizzles(&c->Base); + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Compiler: after dataflow passes:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + + rc_pair_translate(c); + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Compiler: after pair translate:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); } + rc_pair_schedule(c); + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Compiler: after pair scheduling:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + + if (c->is_r500) + rc_pair_regalloc(c, 128); + else + rc_pair_regalloc(c, R300_PFS_NUM_TEMP_REGS); + + if (c->Base.Error) + return; + if (c->Base.Debug) { - _mesa_printf("Compiler: after NqSSA-DCE:\n"); + fprintf(stderr, "Compiler: after pair register allocation:\n"); rc_print_program(&c->Base.Program); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index dad27fc98e..1b2cb8dde7 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -22,13 +22,13 @@ #include "radeon_compiler.h" +#include <stdio.h> + #include "../r300_reg.h" -#include "radeon_nqssadce.h" -#include "radeon_program.h" +#include "radeon_dataflow.h" #include "radeon_program_alu.h" - -#include "shader/prog_print.h" +#include "radeon_swizzle.h" /* @@ -42,104 +42,83 @@ t_swizzle(y), \ t_swizzle(y), \ t_src_class(vpi->SrcReg[x].File), \ - NEGATE_NONE) | (vpi->SrcReg[x].RelAddr << 4)) + RC_MASK_NONE) | (vpi->SrcReg[x].RelAddr << 4)) -static unsigned long t_dst_mask(GLuint mask) +static unsigned long t_dst_mask(unsigned int mask) { - /* WRITEMASK_* is equivalent to VSF_FLAG_* */ - return mask & WRITEMASK_XYZW; + /* RC_MASK_* is equivalent to VSF_FLAG_* */ + return mask & RC_MASK_XYZW; } -static unsigned long t_dst_class(gl_register_file file) +static unsigned long t_dst_class(rc_register_file file) { - switch (file) { - case PROGRAM_TEMPORARY: + default: + fprintf(stderr, "%s: Bad register file %i\n", __FUNCTION__, file); + /* fall-through */ + case RC_FILE_TEMPORARY: return PVS_DST_REG_TEMPORARY; - case PROGRAM_OUTPUT: + case RC_FILE_OUTPUT: return PVS_DST_REG_OUT; - case PROGRAM_ADDRESS: + case RC_FILE_ADDRESS: return PVS_DST_REG_A0; - /* - case PROGRAM_INPUT: - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_NAMED_PARAM: - case PROGRAM_STATE_VAR: - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - */ - default: - fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(-1); - return -1; } } static unsigned long t_dst_index(struct r300_vertex_program_code *vp, - struct prog_dst_register *dst) + struct rc_dst_register *dst) { - if (dst->File == PROGRAM_OUTPUT) + if (dst->File == RC_FILE_OUTPUT) return vp->outputs[dst->Index]; return dst->Index; } -static unsigned long t_src_class(gl_register_file file) +static unsigned long t_src_class(rc_register_file file) { switch (file) { - case PROGRAM_BUILTIN: - case PROGRAM_TEMPORARY: + default: + fprintf(stderr, "%s: Bad register file %i\n", __FUNCTION__, file); + /* fall-through */ + case RC_FILE_NONE: + case RC_FILE_TEMPORARY: return PVS_SRC_REG_TEMPORARY; - case PROGRAM_INPUT: + case RC_FILE_INPUT: return PVS_SRC_REG_INPUT; - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_NAMED_PARAM: - case PROGRAM_CONSTANT: - case PROGRAM_STATE_VAR: + case RC_FILE_CONSTANT: return PVS_SRC_REG_CONSTANT; - /* - case PROGRAM_OUTPUT: - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - */ - default: - fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(-1); - return -1; } } -static GLboolean t_src_conflict(struct prog_src_register a, struct prog_src_register b) +static int t_src_conflict(struct rc_src_register a, struct rc_src_register b) { unsigned long aclass = t_src_class(a.File); unsigned long bclass = t_src_class(b.File); if (aclass != bclass) - return GL_FALSE; + return 0; if (aclass == PVS_SRC_REG_TEMPORARY) - return GL_FALSE; + return 0; if (a.RelAddr || b.RelAddr) - return GL_TRUE; + return 1; if (a.Index != b.Index) - return GL_TRUE; + return 1; - return GL_FALSE; + return 0; } -static INLINE unsigned long t_swizzle(GLubyte swizzle) +static inline unsigned long t_swizzle(unsigned int swizzle) { - /* this is in fact a NOP as the Mesa SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ + /* this is in fact a NOP as the Mesa RC_SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ return swizzle; } static unsigned long t_src_index(struct r300_vertex_program_code *vp, - struct prog_src_register *src) + struct rc_src_register *src) { - if (src->File == PROGRAM_INPUT) { + if (src->File == RC_FILE_INPUT) { assert(vp->inputs[src->Index] != -1); return vp->inputs[src->Index]; } else { @@ -155,9 +134,9 @@ static unsigned long t_src_index(struct r300_vertex_program_code *vp, /* these two functions should probably be merged... */ static unsigned long t_src(struct r300_vertex_program_code *vp, - struct prog_src_register *src) + struct rc_src_register *src) { - /* src->Negate uses the NEGATE_ flags from program_instruction.h, + /* src->Negate uses the RC_MASK_ flags from program_instruction.h, * which equal our VSF_FLAGS_ values, so it's safe to just pass it here. */ return PVS_SRC_OPERAND(t_src_index(vp, src), @@ -170,9 +149,9 @@ static unsigned long t_src(struct r300_vertex_program_code *vp, } static unsigned long t_src_scalar(struct r300_vertex_program_code *vp, - struct prog_src_register *src) + struct rc_src_register *src) { - /* src->Negate uses the NEGATE_ flags from program_instruction.h, + /* src->Negate uses the RC_MASK_ flags from program_instruction.h, * which equal our VSF_FLAGS_ values, so it's safe to just pass it here. */ return PVS_SRC_OPERAND(t_src_index(vp, src), @@ -181,79 +160,79 @@ static unsigned long t_src_scalar(struct r300_vertex_program_code *vp, t_swizzle(GET_SWZ(src->Swizzle, 0)), t_swizzle(GET_SWZ(src->Swizzle, 0)), t_src_class(src->File), - src->Negate ? NEGATE_XYZW : NEGATE_NONE) | + src->Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (src->RelAddr << 4); } -static GLboolean valid_dst(struct r300_vertex_program_code *vp, - struct prog_dst_register *dst) +static int valid_dst(struct r300_vertex_program_code *vp, + struct rc_dst_register *dst) { - if (dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1) { - return GL_FALSE; - } else if (dst->File == PROGRAM_ADDRESS) { + if (dst->File == RC_FILE_OUTPUT && vp->outputs[dst->Index] == -1) { + return 0; + } else if (dst->File == RC_FILE_ADDRESS) { assert(dst->Index == 0); } - return GL_TRUE; + return 1; } static void ei_vector1(struct r300_vertex_program_code *vp, - GLuint hw_opcode, - struct prog_instruction *vpi, - GLuint * inst) + unsigned int hw_opcode, + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(hw_opcode, - GL_FALSE, - GL_FALSE, + 0, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src(vp, &vpi->SrcReg[0]); - inst[2] = __CONST(0, SWIZZLE_ZERO); - inst[3] = __CONST(0, SWIZZLE_ZERO); + inst[2] = __CONST(0, RC_SWIZZLE_ZERO); + inst[3] = __CONST(0, RC_SWIZZLE_ZERO); } static void ei_vector2(struct r300_vertex_program_code *vp, - GLuint hw_opcode, - struct prog_instruction *vpi, - GLuint * inst) + unsigned int hw_opcode, + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(hw_opcode, - GL_FALSE, - GL_FALSE, + 0, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src(vp, &vpi->SrcReg[0]); inst[2] = t_src(vp, &vpi->SrcReg[1]); - inst[3] = __CONST(1, SWIZZLE_ZERO); + inst[3] = __CONST(1, RC_SWIZZLE_ZERO); } static void ei_math1(struct r300_vertex_program_code *vp, - GLuint hw_opcode, - struct prog_instruction *vpi, - GLuint * inst) + unsigned int hw_opcode, + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(hw_opcode, - GL_TRUE, - GL_FALSE, + 1, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src_scalar(vp, &vpi->SrcReg[0]); - inst[2] = __CONST(0, SWIZZLE_ZERO); - inst[3] = __CONST(0, SWIZZLE_ZERO); + inst[2] = __CONST(0, RC_SWIZZLE_ZERO); + inst[3] = __CONST(0, RC_SWIZZLE_ZERO); } static void ei_lit(struct r300_vertex_program_code *vp, - struct prog_instruction *vpi, - GLuint * inst) + struct rc_sub_instruction *vpi, + unsigned int * inst) { //LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W} inst[0] = PVS_OP_DST_OPERAND(ME_LIGHT_COEFF_DX, - GL_TRUE, - GL_FALSE, + 1, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); @@ -263,27 +242,27 @@ static void ei_lit(struct r300_vertex_program_code *vp, PVS_SRC_SELECT_FORCE_0, // Z t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y t_src_class(vpi->SrcReg[0].File), - vpi->SrcReg[0].Negate ? NEGATE_XYZW : NEGATE_NONE) | + vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (vpi->SrcReg[0].RelAddr << 4); inst[2] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]), t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W PVS_SRC_SELECT_FORCE_0, // Z t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X t_src_class(vpi->SrcReg[0].File), - vpi->SrcReg[0].Negate ? NEGATE_XYZW : NEGATE_NONE) | + vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (vpi->SrcReg[0].RelAddr << 4); inst[3] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]), t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X PVS_SRC_SELECT_FORCE_0, // Z t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W t_src_class(vpi->SrcReg[0].File), - vpi->SrcReg[0].Negate ? NEGATE_XYZW : NEGATE_NONE) | + vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (vpi->SrcReg[0].RelAddr << 4); } static void ei_mad(struct r300_vertex_program_code *vp, - struct prog_instruction *vpi, - GLuint * inst) + struct rc_sub_instruction *vpi, + unsigned int * inst) { /* Remarks about hardware limitations of MAD * (please preserve this comment, as this information is _NOT_ @@ -311,22 +290,22 @@ static void ei_mad(struct r300_vertex_program_code *vp, * according to AMD docs, this should improve performance by one clock * as a nice side bonus. */ - if (vpi->SrcReg[0].File == PROGRAM_TEMPORARY && - vpi->SrcReg[1].File == PROGRAM_TEMPORARY && - vpi->SrcReg[2].File == PROGRAM_TEMPORARY && + if (vpi->SrcReg[0].File == RC_FILE_TEMPORARY && + vpi->SrcReg[1].File == RC_FILE_TEMPORARY && + vpi->SrcReg[2].File == RC_FILE_TEMPORARY && vpi->SrcReg[0].Index != vpi->SrcReg[1].Index && vpi->SrcReg[0].Index != vpi->SrcReg[2].Index && vpi->SrcReg[1].Index != vpi->SrcReg[2].Index) { inst[0] = PVS_OP_DST_OPERAND(PVS_MACRO_OP_2CLK_MADD, - GL_FALSE, - GL_TRUE, + 0, + 1, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); } else { inst[0] = PVS_OP_DST_OPERAND(VE_MULTIPLY_ADD, - GL_FALSE, - GL_FALSE, + 0, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); @@ -337,17 +316,17 @@ static void ei_mad(struct r300_vertex_program_code *vp, } static void ei_pow(struct r300_vertex_program_code *vp, - struct prog_instruction *vpi, - GLuint * inst) + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(ME_POWER_FUNC_FF, - GL_TRUE, - GL_FALSE, + 1, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src_scalar(vp, &vpi->SrcReg[0]); - inst[2] = __CONST(0, SWIZZLE_ZERO); + inst[2] = __CONST(0, RC_SWIZZLE_ZERO); inst[3] = t_src_scalar(vp, &vpi->SrcReg[1]); } @@ -362,8 +341,8 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi compiler->SetHwInputOutput(compiler); for(rci = compiler->Base.Program.Instructions.Next; rci != &compiler->Base.Program.Instructions; rci = rci->Next) { - struct prog_instruction *vpi = &rci->I; - GLuint *inst = compiler->code->body.d + compiler->code->length; + struct rc_sub_instruction *vpi = &rci->U.I; + unsigned int *inst = compiler->code->body.d + compiler->code->length; /* Skip instructions writing to non-existing destination */ if (!valid_dst(compiler->code, &vpi->DstReg)) @@ -375,26 +354,26 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi } switch (vpi->Opcode) { - case OPCODE_ADD: ei_vector2(compiler->code, VE_ADD, vpi, inst); break; - case OPCODE_ARL: ei_vector1(compiler->code, VE_FLT2FIX_DX, vpi, inst); break; - case OPCODE_DP4: ei_vector2(compiler->code, VE_DOT_PRODUCT, vpi, inst); break; - case OPCODE_DST: ei_vector2(compiler->code, VE_DISTANCE_VECTOR, vpi, inst); break; - case OPCODE_EX2: ei_math1(compiler->code, ME_EXP_BASE2_FULL_DX, vpi, inst); break; - case OPCODE_EXP: ei_math1(compiler->code, ME_EXP_BASE2_DX, vpi, inst); break; - case OPCODE_FRC: ei_vector1(compiler->code, VE_FRACTION, vpi, inst); break; - case OPCODE_LG2: ei_math1(compiler->code, ME_LOG_BASE2_FULL_DX, vpi, inst); break; - case OPCODE_LIT: ei_lit(compiler->code, vpi, inst); break; - case OPCODE_LOG: ei_math1(compiler->code, ME_LOG_BASE2_DX, vpi, inst); break; - case OPCODE_MAD: ei_mad(compiler->code, vpi, inst); break; - case OPCODE_MAX: ei_vector2(compiler->code, VE_MAXIMUM, vpi, inst); break; - case OPCODE_MIN: ei_vector2(compiler->code, VE_MINIMUM, vpi, inst); break; - case OPCODE_MOV: ei_vector1(compiler->code, VE_ADD, vpi, inst); break; - case OPCODE_MUL: ei_vector2(compiler->code, VE_MULTIPLY, vpi, inst); break; - case OPCODE_POW: ei_pow(compiler->code, vpi, inst); break; - case OPCODE_RCP: ei_math1(compiler->code, ME_RECIP_DX, vpi, inst); break; - case OPCODE_RSQ: ei_math1(compiler->code, ME_RECIP_SQRT_DX, vpi, inst); break; - case OPCODE_SGE: ei_vector2(compiler->code, VE_SET_GREATER_THAN_EQUAL, vpi, inst); break; - case OPCODE_SLT: ei_vector2(compiler->code, VE_SET_LESS_THAN, vpi, inst); break; + case RC_OPCODE_ADD: ei_vector2(compiler->code, VE_ADD, vpi, inst); break; + case RC_OPCODE_ARL: ei_vector1(compiler->code, VE_FLT2FIX_DX, vpi, inst); break; + case RC_OPCODE_DP4: ei_vector2(compiler->code, VE_DOT_PRODUCT, vpi, inst); break; + case RC_OPCODE_DST: ei_vector2(compiler->code, VE_DISTANCE_VECTOR, vpi, inst); break; + case RC_OPCODE_EX2: ei_math1(compiler->code, ME_EXP_BASE2_FULL_DX, vpi, inst); break; + case RC_OPCODE_EXP: ei_math1(compiler->code, ME_EXP_BASE2_DX, vpi, inst); break; + case RC_OPCODE_FRC: ei_vector1(compiler->code, VE_FRACTION, vpi, inst); break; + case RC_OPCODE_LG2: ei_math1(compiler->code, ME_LOG_BASE2_FULL_DX, vpi, inst); break; + case RC_OPCODE_LIT: ei_lit(compiler->code, vpi, inst); break; + case RC_OPCODE_LOG: ei_math1(compiler->code, ME_LOG_BASE2_DX, vpi, inst); break; + case RC_OPCODE_MAD: ei_mad(compiler->code, vpi, inst); break; + case RC_OPCODE_MAX: ei_vector2(compiler->code, VE_MAXIMUM, vpi, inst); break; + case RC_OPCODE_MIN: ei_vector2(compiler->code, VE_MINIMUM, vpi, inst); break; + case RC_OPCODE_MOV: ei_vector1(compiler->code, VE_ADD, vpi, inst); break; + case RC_OPCODE_MUL: ei_vector2(compiler->code, VE_MULTIPLY, vpi, inst); break; + case RC_OPCODE_POW: ei_pow(compiler->code, vpi, inst); break; + case RC_OPCODE_RCP: ei_math1(compiler->code, ME_RECIP_DX, vpi, inst); break; + case RC_OPCODE_RSQ: ei_math1(compiler->code, ME_RECIP_SQRT_DX, vpi, inst); break; + case RC_OPCODE_SGE: ei_vector2(compiler->code, VE_SET_GREATER_THAN_EQUAL, vpi, inst); break; + case RC_OPCODE_SLT: ei_vector2(compiler->code, VE_SET_LESS_THAN, vpi, inst); break; default: rc_error(&compiler->Base, "Unknown opcode %i\n", vpi->Opcode); return; @@ -408,38 +387,37 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi } struct temporary_allocation { - GLuint Allocated:1; - GLuint HwTemp:15; + unsigned int Allocated:1; + unsigned int HwTemp:15; struct rc_instruction * LastRead; }; static void allocate_temporary_registers(struct r300_vertex_program_compiler * compiler) { struct rc_instruction *inst; - GLuint num_orig_temps = 0; - GLboolean hwtemps[VSF_MAX_FRAGMENT_TEMPS]; + unsigned int num_orig_temps = 0; + char hwtemps[VSF_MAX_FRAGMENT_TEMPS]; struct temporary_allocation * ta; - GLuint i, j; + unsigned int i, j; compiler->code->num_temporaries = 0; memset(hwtemps, 0, sizeof(hwtemps)); /* Pass 1: Count original temporaries and allocate structures */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - GLuint numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); - GLuint numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - for (i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY) { - if (inst->I.SrcReg[i].Index >= num_orig_temps) - num_orig_temps = inst->I.SrcReg[i].Index + 1; + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY) { + if (inst->U.I.SrcReg[i].Index >= num_orig_temps) + num_orig_temps = inst->U.I.SrcReg[i].Index + 1; } } - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_TEMPORARY) { - if (inst->I.DstReg.Index >= num_orig_temps) - num_orig_temps = inst->I.DstReg.Index + 1; + if (opcode->HasDstReg) { + if (inst->U.I.DstReg.File == RC_FILE_TEMPORARY) { + if (inst->U.I.DstReg.Index >= num_orig_temps) + num_orig_temps = inst->U.I.DstReg.Index + 1; } } } @@ -450,32 +428,31 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c /* Pass 2: Determine original temporary lifetimes */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - GLuint numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - for (i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY) - ta[inst->I.SrcReg[i].Index].LastRead = inst; + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY) + ta[inst->U.I.SrcReg[i].Index].LastRead = inst; } } /* Pass 3: Register allocation */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - GLuint numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); - GLuint numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - for (i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY) { - GLuint orig = inst->I.SrcReg[i].Index; - inst->I.SrcReg[i].Index = ta[orig].HwTemp; + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY) { + unsigned int orig = inst->U.I.SrcReg[i].Index; + inst->U.I.SrcReg[i].Index = ta[orig].HwTemp; if (ta[orig].Allocated && inst == ta[orig].LastRead) - hwtemps[ta[orig].HwTemp] = GL_FALSE; + hwtemps[ta[orig].HwTemp] = 0; } } - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_TEMPORARY) { - GLuint orig = inst->I.DstReg.Index; + if (opcode->HasDstReg) { + if (inst->U.I.DstReg.File == RC_FILE_TEMPORARY) { + unsigned int orig = inst->U.I.DstReg.Index; if (!ta[orig].Allocated) { for(j = 0; j < VSF_MAX_FRAGMENT_TEMPS; ++j) { @@ -485,16 +462,16 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c if (j >= VSF_MAX_FRAGMENT_TEMPS) { fprintf(stderr, "Out of hw temporaries\n"); } else { - ta[orig].Allocated = GL_TRUE; + ta[orig].Allocated = 1; ta[orig].HwTemp = j; - hwtemps[j] = GL_TRUE; + hwtemps[j] = 1; if (j >= compiler->code->num_temporaries) compiler->code->num_temporaries = j + 1; } } - inst->I.DstReg.Index = ta[orig].HwTemp; + inst->U.I.DstReg.Index = ta[orig].HwTemp; } } } @@ -505,45 +482,45 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c * Vertex engine cannot read two inputs or two constants at the same time. * Introduce intermediate MOVs to temporary registers to account for this. */ -static GLboolean transform_source_conflicts( +static int transform_source_conflicts( struct radeon_compiler *c, struct rc_instruction* inst, void* unused) { - GLuint num_operands = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - if (num_operands == 3) { - if (t_src_conflict(inst->I.SrcReg[1], inst->I.SrcReg[2]) - || t_src_conflict(inst->I.SrcReg[0], inst->I.SrcReg[2])) { + if (opcode->NumSrcRegs == 3) { + if (t_src_conflict(inst->U.I.SrcReg[1], inst->U.I.SrcReg[2]) + || t_src_conflict(inst->U.I.SrcReg[0], inst->U.I.SrcReg[2])) { int tmpreg = rc_find_free_temporary(c); struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mov->I.DstReg.Index = tmpreg; - inst_mov->I.SrcReg[0] = inst->I.SrcReg[2]; - - reset_srcreg(&inst->I.SrcReg[2]); - inst->I.SrcReg[2].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[2].Index = tmpreg; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = tmpreg; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[2]; + + reset_srcreg(&inst->U.I.SrcReg[2]); + inst->U.I.SrcReg[2].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[2].Index = tmpreg; } } - if (num_operands >= 2) { - if (t_src_conflict(inst->I.SrcReg[1], inst->I.SrcReg[0])) { + if (opcode->NumSrcRegs >= 2) { + if (t_src_conflict(inst->U.I.SrcReg[1], inst->U.I.SrcReg[0])) { int tmpreg = rc_find_free_temporary(c); struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mov->I.DstReg.Index = tmpreg; - inst_mov->I.SrcReg[0] = inst->I.SrcReg[1]; - - reset_srcreg(&inst->I.SrcReg[1]); - inst->I.SrcReg[1].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[1].Index = tmpreg; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = tmpreg; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[1]; + + reset_srcreg(&inst->U.I.SrcReg[1]); + inst->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[1].Index = tmpreg; } } - return GL_TRUE; + return 1; } static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler) @@ -554,44 +531,52 @@ static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler) if ((compiler->RequiredOutputs & (1 << i)) && !(compiler->Base.Program.OutputsWritten & (1 << i))) { struct rc_instruction * inst = rc_insert_new_instruction(&compiler->Base, compiler->Base.Program.Instructions.Prev); - inst->I.Opcode = OPCODE_MOV; + inst->U.I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_OUTPUT; - inst->I.DstReg.Index = i; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = i; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; - inst->I.SrcReg[0].File = PROGRAM_CONSTANT; - inst->I.SrcReg[0].Index = 0; - inst->I.SrcReg[0].Swizzle = SWIZZLE_XYZW; + inst->U.I.SrcReg[0].File = RC_FILE_CONSTANT; + inst->U.I.SrcReg[0].Index = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; compiler->Base.Program.OutputsWritten |= 1 << i; } } } -static void nqssadceInit(struct nqssadce_state* s) +static void dataflow_outputs_mark_used(void * userdata, void * data, + void (*callback)(void *, unsigned int, unsigned int)) { - struct r300_vertex_program_compiler * compiler = s->UserData; + struct r300_vertex_program_compiler * c = userdata; int i; - for(i = 0; i < VERT_RESULT_MAX; ++i) { - if (compiler->RequiredOutputs & (1 << i)) - s->Outputs[i].Sourced = WRITEMASK_XYZW; + for(i = 0; i < 32; ++i) { + if (c->RequiredOutputs & (1 << i)) + callback(data, i, RC_MASK_XYZW); } } -static GLboolean swizzleIsNative(GLuint opcode, struct prog_src_register reg) +static int swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { (void) opcode; (void) reg; - return GL_TRUE; + return 1; } +static struct rc_swizzle_caps r300_vertprog_swizzle_caps = { + .IsNative = &swizzle_is_native, + .Split = 0 /* should never be called */ +}; + void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) { + compiler->Base.SwizzleCaps = &r300_vertprog_swizzle_caps; + addArtificialOutputs(compiler); { @@ -624,22 +609,22 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) fflush(stderr); } - { - struct radeon_nqssadce_descr nqssadce = { - .Init = &nqssadceInit, - .IsNativeSwizzle = &swizzleIsNative, - .BuildSwizzle = NULL - }; - radeonNqssaDce(&compiler->Base, &nqssadce, compiler); + rc_dataflow_deadcode(&compiler->Base, &dataflow_outputs_mark_used, compiler); + + if (compiler->Base.Debug) { + fprintf(stderr, "Vertex program after deadcode:\n"); + rc_print_program(&compiler->Base.Program); + fflush(stderr); + } - /* We need this step for reusing temporary registers */ - allocate_temporary_registers(compiler); + rc_dataflow_swizzles(&compiler->Base); - if (compiler->Base.Debug) { - fprintf(stderr, "Vertex program after NQSSADCE:\n"); - rc_print_program(&compiler->Base.Program); - fflush(stderr); - } + allocate_temporary_registers(compiler); + + if (compiler->Base.Debug) { + fprintf(stderr, "Vertex program after dataflow:\n"); + rc_print_program(&compiler->Base.Program); + fflush(stderr); } translate_vertex_program(compiler); diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c index 980ef3eaea..66f9b0529f 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c @@ -146,7 +146,7 @@ static void r300_vs_op_dump(uint32_t op) static void r300_vs_src_dump(uint32_t src) { fprintf(stderr, " reg: %d%s swiz: %s%s/%s%s/%s%s/%s%s\n", - (src >> 5) & 0x7f, r300_vs_src_debug[src & 0x3], + (src >> 5) & 0xff, r300_vs_src_debug[src & 0x3], src & (1 << 25) ? "-" : " ", r300_vs_swiz_debug[(src >> 13) & 0x7], src & (1 << 26) ? "-" : " ", diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 7e2faed690..d87acecdab 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -27,15 +27,17 @@ #include "r500_fragprog.h" +#include <stdio.h> + #include "../r300_reg.h" -static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int tmu) +static struct rc_src_register shadow_ambient(struct radeon_compiler * c, int tmu) { - struct prog_src_register reg = { 0, }; + struct rc_src_register reg = { 0, }; - reg.File = PROGRAM_STATE_VAR; + reg.File = RC_FILE_CONSTANT; reg.Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_SHADOW_AMBIENT, tmu); - reg.Swizzle = SWIZZLE_WWWW; + reg.Swizzle = RC_SWIZZLE_WWWW; return reg; } @@ -44,7 +46,7 @@ static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int t * - implement texture compare (shadow extensions) * - extract non-native source / destination operands */ -GLboolean r500_transform_TEX( +int r500_transform_TEX( struct radeon_compiler * c, struct rc_instruction * inst, void* data) @@ -52,77 +54,77 @@ GLboolean r500_transform_TEX( struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; - if (inst->I.Opcode != OPCODE_TEX && - inst->I.Opcode != OPCODE_TXB && - inst->I.Opcode != OPCODE_TXP && - inst->I.Opcode != OPCODE_KIL) - return GL_FALSE; + if (inst->U.I.Opcode != RC_OPCODE_TEX && + inst->U.I.Opcode != RC_OPCODE_TXB && + inst->U.I.Opcode != RC_OPCODE_TXP && + inst->U.I.Opcode != RC_OPCODE_KIL) + return 0; /* ARB_shadow & EXT_shadow_funcs */ - if (inst->I.Opcode != OPCODE_KIL && - c->Program.ShadowSamplers & (1 << inst->I.TexSrcUnit)) { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + if (inst->U.I.Opcode != RC_OPCODE_KIL && + c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) { + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; - if (comparefunc == GL_NEVER || comparefunc == GL_ALWAYS) { - inst->I.Opcode = OPCODE_MOV; + if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->U.I.Opcode = RC_OPCODE_MOV; - if (comparefunc == GL_ALWAYS) { - inst->I.SrcReg[0].File = PROGRAM_BUILTIN; - inst->I.SrcReg[0].Swizzle = SWIZZLE_1111; + if (comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; } else { - inst->I.SrcReg[0] = shadow_ambient(c, inst->I.TexSrcUnit); + inst->U.I.SrcReg[0] = shadow_ambient(c, inst->U.I.TexSrcUnit); } - return GL_TRUE; + return 1; } else { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - GLuint depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; + unsigned int depthmode = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_mode; struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst); struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp); struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad); int pass, fail; - inst_rcp->I.Opcode = OPCODE_RCP; - inst_rcp->I.DstReg.File = PROGRAM_TEMPORARY; - inst_rcp->I.DstReg.Index = rc_find_free_temporary(c); - inst_rcp->I.DstReg.WriteMask = WRITEMASK_W; - inst_rcp->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_rcp->I.SrcReg[0].Swizzle = SWIZZLE_WWWW; - - inst_cmp->I.DstReg = inst->I.DstReg; - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = rc_find_free_temporary(c); - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; - - inst_mad->I.Opcode = OPCODE_MAD; - inst_mad->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mad->I.DstReg.Index = rc_find_free_temporary(c); - inst_mad->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mad->I.SrcReg[0].Swizzle = SWIZZLE_ZZZZ; - inst_mad->I.SrcReg[1].File = PROGRAM_TEMPORARY; - inst_mad->I.SrcReg[1].Index = inst_rcp->I.DstReg.Index; - inst_mad->I.SrcReg[1].Swizzle = SWIZZLE_WWWW; - inst_mad->I.SrcReg[2].File = PROGRAM_TEMPORARY; - inst_mad->I.SrcReg[2].Index = inst->I.DstReg.Index; + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; + inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; + + inst_cmp->U.I.DstReg = inst->U.I.DstReg; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = rc_find_free_temporary(c); + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + + inst_mad->U.I.Opcode = RC_OPCODE_MAD; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mad->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[1].Index = inst_rcp->U.I.DstReg.Index; + inst_mad->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[2].Index = inst->U.I.DstReg.Index; if (depthmode == 0) /* GL_LUMINANCE */ - inst_mad->I.SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z); + inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); else if (depthmode == 2) /* GL_ALPHA */ - inst_mad->I.SrcReg[2].Swizzle = SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; /* Recall that SrcReg[0] is tex, SrcReg[2] is r and: * r < tex <=> -tex+r < 0 * r >= tex <=> not (-tex+r < 0 */ - if (comparefunc == GL_LESS || comparefunc == GL_GEQUAL) - inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ NEGATE_XYZW; + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GEQUAL) + inst_mad->U.I.SrcReg[2].Negate = inst_mad->U.I.SrcReg[2].Negate ^ RC_MASK_XYZW; else - inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ NEGATE_XYZW; + inst_mad->U.I.SrcReg[0].Negate = inst_mad->U.I.SrcReg[0].Negate ^ RC_MASK_XYZW; - inst_cmp->I.Opcode = OPCODE_CMP; + inst_cmp->U.I.Opcode = RC_OPCODE_CMP; /* DstReg has been filled out above */ - inst_cmp->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst_cmp->I.SrcReg[0].Index = inst_mad->I.DstReg.Index; + inst_cmp->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_cmp->U.I.SrcReg[0].Index = inst_mad->U.I.DstReg.Index; - if (comparefunc == GL_LESS || comparefunc == GL_GREATER) { + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GREATER) { pass = 1; fail = 2; } else { @@ -130,131 +132,161 @@ GLboolean r500_transform_TEX( fail = 1; } - inst_cmp->I.SrcReg[pass].File = PROGRAM_BUILTIN; - inst_cmp->I.SrcReg[pass].Swizzle = SWIZZLE_1111; - inst_cmp->I.SrcReg[fail] = shadow_ambient(c, inst->I.TexSrcUnit); + inst_cmp->U.I.SrcReg[pass].File = RC_FILE_NONE; + inst_cmp->U.I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; + inst_cmp->U.I.SrcReg[fail] = shadow_ambient(c, inst->U.I.TexSrcUnit); } } /* Cannot write texture to output registers */ - if (inst->I.Opcode != OPCODE_KIL && inst->I.DstReg.File != PROGRAM_TEMPORARY) { + if (inst->U.I.Opcode != RC_OPCODE_KIL && inst->U.I.DstReg.File != RC_FILE_TEMPORARY) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg = inst->I.DstReg; - inst_mov->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst_mov->I.SrcReg[0].Index = rc_find_free_temporary(c); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg = inst->U.I.DstReg; + inst_mov->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mov->U.I.SrcReg[0].Index = rc_find_free_temporary(c); - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; } /* Cannot read texture coordinate from constants file */ - if (inst->I.SrcReg[0].File != PROGRAM_TEMPORARY && inst->I.SrcReg[0].File != PROGRAM_INPUT) { + if (inst->U.I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->U.I.SrcReg[0].File != RC_FILE_INPUT) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mov->I.DstReg.Index = rc_find_free_temporary(c); - inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[0].Index = inst_mov->I.DstReg.Index; + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = inst_mov->U.I.DstReg.Index; } - return GL_TRUE; + return 1; +} + +/** + * Rewrite IF instructions to use the ALU result special register. + */ +int r500_transform_IF( + struct radeon_compiler * c, + struct rc_instruction * inst, + void* data) +{ + if (inst->U.I.Opcode != RC_OPCODE_IF) + return 0; + + struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.WriteMask = 0; + inst_mov->U.I.WriteALUResult = RC_ALURESULT_W; + inst_mov->U.I.ALUResultCompare = RC_COMPARE_FUNC_NOTEQUAL; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mov->U.I.SrcReg[0].Swizzle = combine_swizzles4(inst_mov->U.I.SrcReg[0].Swizzle, + RC_SWIZZLE_UNUSED, RC_SWIZZLE_UNUSED, RC_SWIZZLE_UNUSED, RC_SWIZZLE_X); + + inst->U.I.SrcReg[0].File = RC_FILE_SPECIAL; + inst->U.I.SrcReg[0].Index = RC_SPECIAL_ALU_RESULT; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[0].Negate = 0; + + return 1; } -GLboolean r500FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg) +static int r500_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { - GLuint relevant; + unsigned int relevant; int i; - if (opcode == OPCODE_TEX || - opcode == OPCODE_TXB || - opcode == OPCODE_TXP || - opcode == OPCODE_KIL) { + if (opcode == RC_OPCODE_TEX || + opcode == RC_OPCODE_TXB || + opcode == RC_OPCODE_TXP || + opcode == RC_OPCODE_KIL) { if (reg.Abs) - return GL_FALSE; + return 0; - if (opcode == OPCODE_KIL && (reg.Swizzle != SWIZZLE_NOOP || reg.Negate != NEGATE_NONE)) - return GL_FALSE; + if (opcode == RC_OPCODE_KIL && (reg.Swizzle != RC_SWIZZLE_XYZW || reg.Negate != RC_MASK_NONE)) + return 0; if (reg.Negate) - reg.Negate ^= NEGATE_XYZW; + reg.Negate ^= RC_MASK_XYZW; for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(reg.Swizzle, i); - if (swz == SWIZZLE_NIL) { + unsigned int swz = GET_SWZ(reg.Swizzle, i); + if (swz == RC_SWIZZLE_UNUSED) { reg.Negate &= ~(1 << i); continue; } if (swz >= 4) - return GL_FALSE; + return 0; } if (reg.Negate) - return GL_FALSE; + return 0; - return GL_TRUE; - } else if (opcode == OPCODE_DDX || opcode == OPCODE_DDY) { + return 1; + } else if (opcode == RC_OPCODE_DDX || opcode == RC_OPCODE_DDY) { /* DDX/MDH and DDY/MDV explicitly ignore incoming swizzles; * if it doesn't fit perfectly into a .xyzw case... */ - if (reg.Swizzle == SWIZZLE_NOOP && !reg.Abs && !reg.Negate) - return GL_TRUE; + if (reg.Swizzle == RC_SWIZZLE_XYZW && !reg.Abs && !reg.Negate) + return 1; - return GL_FALSE; + return 0; } else { /* ALU instructions support almost everything */ if (reg.Abs) - return GL_TRUE; + return 1; relevant = 0; for(i = 0; i < 3; ++i) { - GLuint swz = GET_SWZ(reg.Swizzle, i); - if (swz != SWIZZLE_NIL && swz != SWIZZLE_ZERO) + unsigned int swz = GET_SWZ(reg.Swizzle, i); + if (swz != RC_SWIZZLE_UNUSED && swz != RC_SWIZZLE_ZERO) relevant |= 1 << i; } if ((reg.Negate & relevant) && ((reg.Negate & relevant) != relevant)) - return GL_FALSE; + return 0; - return GL_TRUE; + return 1; } } /** - * Implement a MOV with a potentially non-native swizzle. + * Split source register access. * * The only thing we *cannot* do in an ALU instruction is per-component - * negation. Therefore, we split the MOV into two instructions when necessary. + * negation. */ -void r500FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, struct prog_src_register src) +static void r500_swizzle_split(struct rc_src_register src, unsigned int usemask, + struct rc_swizzle_split * split) { - GLuint negatebase[2] = { 0, 0 }; + unsigned int negatebase[2] = { 0, 0 }; int i; for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(src.Swizzle, i); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(src.Swizzle, i); + if (swz == RC_SWIZZLE_UNUSED || !GET_BIT(usemask, i)) continue; negatebase[GET_BIT(src.Negate, i)] |= 1 << i; } + split->NumPhases = 0; + for(i = 0; i <= 1; ++i) { if (!negatebase[i]) continue; - struct rc_instruction *inst = rc_insert_new_instruction(s->Compiler, s->IP->Prev); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg = dst; - inst->I.DstReg.WriteMask = negatebase[i]; - inst->I.SrcReg[0] = src; - inst->I.SrcReg[0].Negate = (i == 0) ? NEGATE_NONE : NEGATE_XYZW; + split->Phase[split->NumPhases++] = negatebase[i]; } } +struct rc_swizzle_caps r500_swizzle_caps = { + .IsNative = r500_swizzle_is_native, + .Split = r500_swizzle_split +}; static char *toswiz(int swiz_val) { switch(swiz_val) { diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h index 9091f65cd2..0918cdf518 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h @@ -33,21 +33,21 @@ #ifndef __R500_FRAGPROG_H_ #define __R500_FRAGPROG_H_ -#include "shader/prog_parameter.h" -#include "shader/prog_instruction.h" - #include "radeon_compiler.h" -#include "radeon_nqssadce.h" +#include "radeon_swizzle.h" extern void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compiler); extern void r500FragmentProgramDump(struct rX00_fragment_program_code *c); -extern GLboolean r500FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg); +extern struct rc_swizzle_caps r500_swizzle_caps; -extern void r500FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, struct prog_src_register src); +extern int r500_transform_TEX( + struct radeon_compiler * c, + struct rc_instruction * inst, + void* data); -extern GLboolean r500_transform_TEX( +extern int r500_transform_IF( struct radeon_compiler * c, struct rc_instruction * inst, void* data); diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index d694725c9b..b1b14394b6 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -37,10 +37,6 @@ * * \author Corbin Simpson <MostAwesomeDude@gmail.com> * - * \todo Depth write, WPOS/FOGC inputs - * - * \todo FogOption - * */ #include "r500_fragprog.h" @@ -51,7 +47,6 @@ #define PROG_CODE \ - struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)data; \ struct r500_fragment_program_code *code = &c->code->code.r500 #define error(fmt, args...) do { \ @@ -60,63 +55,80 @@ } while(0) -static GLuint translate_rgb_op(struct r300_fragment_program_compiler *c, GLuint opcode) +struct branch_info { + int If; + int Else; + int Endif; +}; + +struct emit_state { + struct radeon_compiler * C; + struct r500_fragment_program_code * Code; + + struct branch_info * Branches; + unsigned int CurrentBranchDepth; + unsigned int BranchesReserved; + + unsigned int MaxBranchDepth; +}; + +static unsigned int translate_rgb_op(struct r300_fragment_program_compiler *c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R500_ALU_RGBA_OP_CMP; - case OPCODE_DDX: return R500_ALU_RGBA_OP_MDH; - case OPCODE_DDY: return R500_ALU_RGBA_OP_MDV; - case OPCODE_DP3: return R500_ALU_RGBA_OP_DP3; - case OPCODE_DP4: return R500_ALU_RGBA_OP_DP4; - case OPCODE_FRC: return R500_ALU_RGBA_OP_FRC; + case RC_OPCODE_CMP: return R500_ALU_RGBA_OP_CMP; + case RC_OPCODE_DDX: return R500_ALU_RGBA_OP_MDH; + case RC_OPCODE_DDY: return R500_ALU_RGBA_OP_MDV; + case RC_OPCODE_DP3: return R500_ALU_RGBA_OP_DP3; + case RC_OPCODE_DP4: return R500_ALU_RGBA_OP_DP4; + case RC_OPCODE_FRC: return R500_ALU_RGBA_OP_FRC; default: error("translate_rgb_op(%d): unknown opcode\n", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R500_ALU_RGBA_OP_MAD; - case OPCODE_MAX: return R500_ALU_RGBA_OP_MAX; - case OPCODE_MIN: return R500_ALU_RGBA_OP_MIN; - case OPCODE_REPL_ALPHA: return R500_ALU_RGBA_OP_SOP; + case RC_OPCODE_MAD: return R500_ALU_RGBA_OP_MAD; + case RC_OPCODE_MAX: return R500_ALU_RGBA_OP_MAX; + case RC_OPCODE_MIN: return R500_ALU_RGBA_OP_MIN; + case RC_OPCODE_REPL_ALPHA: return R500_ALU_RGBA_OP_SOP; } } -static GLuint translate_alpha_op(struct r300_fragment_program_compiler *c, GLuint opcode) +static unsigned int translate_alpha_op(struct r300_fragment_program_compiler *c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R500_ALPHA_OP_CMP; - case OPCODE_COS: return R500_ALPHA_OP_COS; - case OPCODE_DDX: return R500_ALPHA_OP_MDH; - case OPCODE_DDY: return R500_ALPHA_OP_MDV; - case OPCODE_DP3: return R500_ALPHA_OP_DP; - case OPCODE_DP4: return R500_ALPHA_OP_DP; - case OPCODE_EX2: return R500_ALPHA_OP_EX2; - case OPCODE_FRC: return R500_ALPHA_OP_FRC; - case OPCODE_LG2: return R500_ALPHA_OP_LN2; + case RC_OPCODE_CMP: return R500_ALPHA_OP_CMP; + case RC_OPCODE_COS: return R500_ALPHA_OP_COS; + case RC_OPCODE_DDX: return R500_ALPHA_OP_MDH; + case RC_OPCODE_DDY: return R500_ALPHA_OP_MDV; + case RC_OPCODE_DP3: return R500_ALPHA_OP_DP; + case RC_OPCODE_DP4: return R500_ALPHA_OP_DP; + case RC_OPCODE_EX2: return R500_ALPHA_OP_EX2; + case RC_OPCODE_FRC: return R500_ALPHA_OP_FRC; + case RC_OPCODE_LG2: return R500_ALPHA_OP_LN2; default: error("translate_alpha_op(%d): unknown opcode\n", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R500_ALPHA_OP_MAD; - case OPCODE_MAX: return R500_ALPHA_OP_MAX; - case OPCODE_MIN: return R500_ALPHA_OP_MIN; - case OPCODE_RCP: return R500_ALPHA_OP_RCP; - case OPCODE_RSQ: return R500_ALPHA_OP_RSQ; - case OPCODE_SIN: return R500_ALPHA_OP_SIN; + case RC_OPCODE_MAD: return R500_ALPHA_OP_MAD; + case RC_OPCODE_MAX: return R500_ALPHA_OP_MAX; + case RC_OPCODE_MIN: return R500_ALPHA_OP_MIN; + case RC_OPCODE_RCP: return R500_ALPHA_OP_RCP; + case RC_OPCODE_RSQ: return R500_ALPHA_OP_RSQ; + case RC_OPCODE_SIN: return R500_ALPHA_OP_SIN; } } -static GLuint fix_hw_swizzle(GLuint swz) +static unsigned int fix_hw_swizzle(unsigned int swz) { if (swz == 5) swz = 6; - if (swz == SWIZZLE_NIL) swz = 4; + if (swz == RC_SWIZZLE_UNUSED) swz = 4; return swz; } -static GLuint translate_arg_rgb(struct radeon_pair_instruction *inst, int arg) +static unsigned int translate_arg_rgb(struct rc_pair_instruction *inst, int arg) { - GLuint t = inst->RGB.Arg[arg].Source; + unsigned int t = inst->RGB.Arg[arg].Source; int comp; t |= inst->RGB.Arg[arg].Negate << 11; t |= inst->RGB.Arg[arg].Abs << 12; @@ -127,39 +139,57 @@ static GLuint translate_arg_rgb(struct radeon_pair_instruction *inst, int arg) return t; } -static GLuint translate_arg_alpha(struct radeon_pair_instruction *inst, int i) +static unsigned int translate_arg_alpha(struct rc_pair_instruction *inst, int i) { - GLuint t = inst->Alpha.Arg[i].Source; + unsigned int t = inst->Alpha.Arg[i].Source; t |= fix_hw_swizzle(inst->Alpha.Arg[i].Swizzle) << 2; t |= inst->Alpha.Arg[i].Negate << 5; t |= inst->Alpha.Arg[i].Abs << 6; return t; } -static void use_temporary(struct r500_fragment_program_code* code, GLuint index) +static uint32_t translate_alu_result_op(struct r300_fragment_program_compiler * c, rc_compare_func func) +{ + switch(func) { + case RC_COMPARE_FUNC_EQUAL: return R500_INST_ALU_RESULT_OP_EQ; + case RC_COMPARE_FUNC_LESS: return R500_INST_ALU_RESULT_OP_LT; + case RC_COMPARE_FUNC_GEQUAL: return R500_INST_ALU_RESULT_OP_GE; + case RC_COMPARE_FUNC_NOTEQUAL: return R500_INST_ALU_RESULT_OP_NE; + default: + rc_error(&c->Base, "%s: unsupported compare func %i\n", __FUNCTION__, func); + return 0; + } +} + +static void use_temporary(struct r500_fragment_program_code* code, unsigned int index) { if (index > code->max_temp_idx) code->max_temp_idx = index; } -static GLuint use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src) +static unsigned int use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src) { - if (!src.Constant) + if (src.File == RC_FILE_CONSTANT) { + return src.Index | 0x100; + } else if (src.File == RC_FILE_TEMPORARY) { use_temporary(code, src.Index); - return src.Index | src.Constant << 8; + return src.Index; + } + + return 0; } /** * Emit a paired ALU instruction. */ -static GLboolean emit_paired(void *data, struct radeon_pair_instruction *inst) +static void emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_instruction *inst) { PROG_CODE; if (code->inst_end >= 511) { error("emit_alu: Too many instructions"); - return GL_FALSE; + return; } int ip = ++code->inst_end; @@ -167,17 +197,22 @@ static GLboolean emit_paired(void *data, struct radeon_pair_instruction *inst) code->inst[ip].inst5 = translate_rgb_op(c, inst->RGB.Opcode); code->inst[ip].inst4 = translate_alpha_op(c, inst->Alpha.Opcode); - if (inst->RGB.OutputWriteMask || inst->Alpha.OutputWriteMask || inst->Alpha.DepthWriteMask) + if (inst->RGB.OutputWriteMask || inst->Alpha.OutputWriteMask || inst->Alpha.DepthWriteMask) { code->inst[ip].inst0 = R500_INST_TYPE_OUT; - else + if (inst->WriteALUResult) { + error("%s: cannot write output and ALU result at the same time"); + return; + } + } else { code->inst[ip].inst0 = R500_INST_TYPE_ALU; + } code->inst[ip].inst0 |= R500_INST_TEX_SEM_WAIT; code->inst[ip].inst0 |= (inst->RGB.WriteMask << 11) | (inst->Alpha.WriteMask << 14); code->inst[ip].inst0 |= (inst->RGB.OutputWriteMask << 15) | (inst->Alpha.OutputWriteMask << 18); if (inst->Alpha.DepthWriteMask) { code->inst[ip].inst4 |= R500_ALPHA_W_OMASK; - c->code->writes_depth = GL_TRUE; + c->code->writes_depth = 1; } code->inst[ip].inst4 |= R500_ALPHA_ADDRD(inst->Alpha.DestIndex); @@ -206,12 +241,21 @@ static GLboolean emit_paired(void *data, struct radeon_pair_instruction *inst) code->inst[ip].inst4 |= translate_arg_alpha(inst, 1) << R500_ALPHA_SEL_B_SHIFT; code->inst[ip].inst5 |= translate_arg_alpha(inst, 2) << R500_ALU_RGBA_ALPHA_SEL_C_SHIFT; - return GL_TRUE; + if (inst->WriteALUResult) { + code->inst[ip].inst3 |= R500_ALU_RGB_WMASK; + + if (inst->WriteALUResult == RC_ALURESULT_X) + code->inst[ip].inst0 |= R500_INST_ALU_RESULT_SEL_RED; + else + code->inst[ip].inst0 |= R500_INST_ALU_RESULT_SEL_ALPHA; + + code->inst[ip].inst0 |= translate_alu_result_op(c, inst->ALUResultCompare); + } } -static GLuint translate_strq_swizzle(GLuint swizzle) +static unsigned int translate_strq_swizzle(unsigned int swizzle) { - GLuint swiz = 0; + unsigned int swiz = 0; int i; for (i = 0; i < 4; i++) swiz |= (GET_SWZ(swizzle, i) & 0x3) << i*2; @@ -221,67 +265,193 @@ static GLuint translate_strq_swizzle(GLuint swizzle) /** * Emit a single TEX instruction */ -static GLboolean emit_tex(void *data, struct radeon_pair_texture_instruction *inst) +static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_instruction *inst) { PROG_CODE; if (code->inst_end >= 511) { error("emit_tex: Too many instructions"); - return GL_FALSE; + return 0; } int ip = ++code->inst_end; code->inst[ip].inst0 = R500_INST_TYPE_TEX - | (inst->WriteMask << 11) + | (inst->DstReg.WriteMask << 11) | R500_INST_TEX_SEM_WAIT; code->inst[ip].inst1 = R500_TEX_ID(inst->TexSrcUnit) | R500_TEX_SEM_ACQUIRE | R500_TEX_IGNORE_UNCOVERED; - if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) - code->inst[ip].inst1 |= R500_TEX_UNSCALED; + if (inst->TexSrcTarget == RC_TEXTURE_RECT) + code->inst[ip].inst1 |= R500_TEX_UNSCALED; switch (inst->Opcode) { - case RADEON_OPCODE_KIL: + case RC_OPCODE_KIL: code->inst[ip].inst1 |= R500_TEX_INST_TEXKILL; break; - case RADEON_OPCODE_TEX: + case RC_OPCODE_TEX: code->inst[ip].inst1 |= R500_TEX_INST_LD; break; - case RADEON_OPCODE_TXB: + case RC_OPCODE_TXB: code->inst[ip].inst1 |= R500_TEX_INST_LODBIAS; break; - case RADEON_OPCODE_TXP: + case RC_OPCODE_TXP: code->inst[ip].inst1 |= R500_TEX_INST_PROJ; break; default: error("emit_tex can't handle opcode %x\n", inst->Opcode); } - code->inst[ip].inst2 = R500_TEX_SRC_ADDR(inst->SrcIndex) - | (translate_strq_swizzle(inst->SrcSwizzle) << 8) - | R500_TEX_DST_ADDR(inst->DestIndex) + use_temporary(code, inst->SrcReg[0].Index); + if (inst->Opcode != RC_OPCODE_KIL) + use_temporary(code, inst->DstReg.Index); + + code->inst[ip].inst2 = R500_TEX_SRC_ADDR(inst->SrcReg[0].Index) + | (translate_strq_swizzle(inst->SrcReg[0].Swizzle) << 8) + | R500_TEX_DST_ADDR(inst->DstReg.Index) | R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G | R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A; - return GL_TRUE; + return 1; } -static const struct radeon_pair_handler pair_handler = { - .EmitPaired = emit_paired, - .EmitTex = emit_tex, - .MaxHwTemps = 128 -}; +static void grow_branches(struct emit_state * s) +{ + unsigned int newreserved = s->BranchesReserved * 2; + struct branch_info * newbranches; + + if (!newreserved) + newreserved = 4; + + newbranches = memory_pool_malloc(&s->C->Pool, newreserved*sizeof(struct branch_info)); + memcpy(newbranches, s->Branches, s->CurrentBranchDepth*sizeof(struct branch_info)); + + s->Branches = newbranches; + s->BranchesReserved = newreserved; +} + +static void emit_flowcontrol(struct emit_state * s, struct rc_instruction * inst) +{ + if (s->Code->inst_end >= 511) { + rc_error(s->C, "emit_tex: Too many instructions"); + return; + } + + unsigned int newip = ++s->Code->inst_end; + + s->Code->inst[newip].inst0 = R500_INST_TYPE_FC | R500_INST_ALU_WAIT; + + if (inst->U.I.Opcode == RC_OPCODE_IF) { + if (s->CurrentBranchDepth >= 32) { + rc_error(s->C, "Branch depth exceeds hardware limit"); + return; + } + + if (s->CurrentBranchDepth >= s->BranchesReserved) + grow_branches(s); + + struct branch_info * branch = &s->Branches[s->CurrentBranchDepth++]; + branch->If = newip; + branch->Else = -1; + branch->Endif = -1; + + if (s->CurrentBranchDepth > s->MaxBranchDepth) + s->MaxBranchDepth = s->CurrentBranchDepth; + + /* actual instruction is filled in at ENDIF time */ + } else if (inst->U.I.Opcode == RC_OPCODE_ELSE) { + if (!s->CurrentBranchDepth) { + rc_error(s->C, "%s: got ELSE outside a branch", __FUNCTION__); + return; + } + + struct branch_info * branch = &s->Branches[s->CurrentBranchDepth - 1]; + branch->Else = newip; + + /* actual instruction is filled in at ENDIF time */ + } else if (inst->U.I.Opcode == RC_OPCODE_ENDIF) { + if (!s->CurrentBranchDepth) { + rc_error(s->C, "%s: got ELSE outside a branch", __FUNCTION__); + return; + } + + struct branch_info * branch = &s->Branches[s->CurrentBranchDepth - 1]; + branch->Endif = newip; + + s->Code->inst[branch->If].inst2 = R500_FC_OP_JUMP + | R500_FC_A_OP_NONE /* no address stack */ + | R500_FC_JUMP_FUNC(0x0f) /* jump if ALU result is false */ + | R500_FC_B_OP0_INCR /* increment branch counter if stay */ + ; + + if (branch->Else >= 0) { + /* increment branch counter also if jump */ + s->Code->inst[branch->If].inst2 |= R500_FC_B_OP1_INCR; + s->Code->inst[branch->If].inst3 = R500_FC_JUMP_ADDR(branch->Else + 1); + + s->Code->inst[branch->Else].inst2 = R500_FC_OP_JUMP + | R500_FC_A_OP_NONE /* no address stack */ + | R500_FC_B_ELSE /* all active pixels want to jump */ + | R500_FC_B_OP0_NONE /* no counter op if stay */ + | R500_FC_B_OP1_DECR /* decrement branch counter if jump */ + | R500_FC_B_POP_CNT(1) + ; + s->Code->inst[branch->Else].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); + } else { + /* don't touch branch counter on jump */ + s->Code->inst[branch->If].inst2 |= R500_FC_B_OP1_NONE; + s->Code->inst[branch->If].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); + } + + s->Code->inst[branch->Endif].inst2 = R500_FC_OP_JUMP + | R500_FC_A_OP_NONE /* no address stack */ + | R500_FC_JUMP_ANY /* docs says set this, but I don't understand why */ + | R500_FC_B_OP0_DECR /* decrement branch counter if stay */ + | R500_FC_B_OP1_NONE /* no branch counter if stay */ + | R500_FC_B_POP_CNT(1) + ; + s->Code->inst[branch->Endif].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); + + s->CurrentBranchDepth--; + } else { + rc_error(s->C, "%s: unknown opcode %i\n", __FUNCTION__, inst->U.I.Opcode); + } +} void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compiler) { + struct emit_state s; struct r500_fragment_program_code *code = &compiler->code->code.r500; - _mesa_bzero(code, sizeof(*code)); + memset(&s, 0, sizeof(s)); + s.C = &compiler->Base; + s.Code = code; + + memset(code, 0, sizeof(*code)); code->max_temp_idx = 1; code->inst_end = -1; - radeonPairProgram(compiler, &pair_handler, compiler); + for(struct rc_instruction * inst = compiler->Base.Program.Instructions.Next; + inst != &compiler->Base.Program.Instructions && !compiler->Base.Error; + inst = inst->Next) { + if (inst->Type == RC_INSTRUCTION_NORMAL) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + + if (opcode->IsFlowControl) { + emit_flowcontrol(&s, inst); + } else if (inst->U.I.Opcode == RC_OPCODE_BEGIN_TEX) { + continue; + } else { + emit_tex(compiler, &inst->U.I); + } + } else { + emit_paired(compiler, &inst->U.P); + } + } + + if (code->max_temp_idx >= 128) + rc_error(&compiler->Base, "Too many hardware temporaries used"); + if (compiler->Base.Error) return; @@ -296,4 +466,11 @@ void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi int ip = ++code->inst_end; code->inst[ip].inst0 = R500_INST_TYPE_OUT | R500_INST_TEX_SEM_WAIT; } + + if (s.MaxBranchDepth >= 4) { + if (code->max_temp_idx < 1) + code->max_temp_idx = 1; + + code->us_fc_ctrl |= R500_FC_FULL_FC_EN; + } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.c b/src/mesa/drivers/dri/r300/compiler/radeon_code.c index c7923004df..1a3d8bb641 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.c @@ -25,11 +25,13 @@ * */ -#include "main/mtypes.h" -#include "shader/prog_instruction.h" - #include "radeon_code.h" +#include <stdlib.h> +#include <string.h> + +#include "radeon_program.h" + void rc_constants_init(struct rc_constant_list * c) { memset(c, 0, sizeof(*c)); @@ -143,7 +145,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da if (c->Constants[index].Type == RC_CONSTANT_IMMEDIATE) { for(unsigned comp = 0; comp < c->Constants[index].Size; ++comp) { if (c->Constants[index].u.Immediate[comp] == data) { - *swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); + *swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp); return index; } } @@ -156,7 +158,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da if (free_index >= 0) { unsigned comp = c->Constants[free_index].Size++; c->Constants[free_index].u.Immediate[comp] = data; - *swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); + *swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp); return free_index; } @@ -164,7 +166,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da constant.Type = RC_CONSTANT_IMMEDIATE; constant.Size = 1; constant.u.Immediate[0] = data; - *swizzle = SWIZZLE_XXXX; + *swizzle = RC_SWIZZLE_XXXX; return rc_constants_add(c, &constant); } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h index 3e88554ba1..902b7cfa53 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h @@ -89,6 +89,23 @@ unsigned rc_constants_add_immediate_vec4(struct rc_constant_list * c, const floa unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float data, unsigned * swizzle); /** + * Compare functions. + * + * \note By design, RC_COMPARE_FUNC_xxx + GL_NEVER gives you + * the correct GL compare function. + */ +typedef enum { + RC_COMPARE_FUNC_NEVER = 0, + RC_COMPARE_FUNC_LESS, + RC_COMPARE_FUNC_EQUAL, + RC_COMPARE_FUNC_LEQUAL, + RC_COMPARE_FUNC_GREATER, + RC_COMPARE_FUNC_NOTEQUAL, + RC_COMPARE_FUNC_GEQUAL, + RC_COMPARE_FUNC_ALWAYS +} rc_compare_func; + +/** * Stores state that influences the compilation of a fragment program. */ struct r300_fragment_program_external_state { @@ -105,10 +122,12 @@ struct r300_fragment_program_external_state { /** * If the sampler is used as a shadow sampler, - * this field is (texture_compare_func - GL_NEVER). - * [e.g. if compare function is GL_LEQUAL, this field is 3] + * this field specifies the compare function. + * + * Otherwise, this field is \ref RC_COMPARE_FUNC_NEVER (aka 0). * * Otherwise, this field is 0. + * \sa rc_compare_func */ unsigned texture_compare_func : 3; } unit[16]; @@ -163,6 +182,8 @@ struct r500_fragment_program_code { int inst_end; /* Number of instructions - 1; also, last instruction to be executed */ int max_temp_idx; + + uint32_t us_fc_ctrl; }; struct rX00_fragment_program_code { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c index da950d5289..c0e7a7f7a0 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c @@ -23,6 +23,8 @@ #include "radeon_compiler.h" #include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> #include "radeon_program.h" @@ -34,7 +36,7 @@ void rc_init(struct radeon_compiler * c) memory_pool_init(&c->Pool); c->Program.Instructions.Prev = &c->Program.Instructions; c->Program.Instructions.Next = &c->Program.Instructions; - c->Program.Instructions.I.Opcode = OPCODE_END; + c->Program.Instructions.U.I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; } void rc_destroy(struct radeon_compiler * c) @@ -60,7 +62,7 @@ void rc_error(struct radeon_compiler * c, const char * fmt, ...) { va_list ap; - c->Error = GL_TRUE; + c->Error = 1; if (!c->ErrorMsg) { /* Only remember the first error */ @@ -91,28 +93,63 @@ void rc_error(struct radeon_compiler * c, const char * fmt, ...) } } +int rc_if_fail_helper(struct radeon_compiler * c, const char * file, int line, const char * assertion) +{ + rc_error(c, "ICE at %s:%i: assertion failed: %s\n", file, line, assertion); + return 1; +} + +/** + * Recompute c->Program.InputsRead and c->Program.OutputsWritten + * based on which inputs and outputs are actually referenced + * in program instructions. + */ +void rc_calculate_inputs_outputs(struct radeon_compiler * c) +{ + struct rc_instruction *inst; + + c->Program.InputsRead = 0; + c->Program.OutputsWritten = 0; + + for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) + { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + int i; + + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT) + c->Program.InputsRead |= 1 << inst->U.I.SrcReg[i].Index; + } + + if (opcode->HasDstReg) { + if (inst->U.I.DstReg.File == RC_FILE_OUTPUT) + c->Program.OutputsWritten |= 1 << inst->U.I.DstReg.Index; + } + } +} + /** * Rewrite the program such that everything that source the given input * register will source new_input instead. */ -void rc_move_input(struct radeon_compiler * c, unsigned input, struct prog_src_register new_input) +void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input) { struct rc_instruction * inst; c->Program.InputsRead &= ~(1 << input); for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned i; - for(i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_INPUT && inst->I.SrcReg[i].Index == input) { - inst->I.SrcReg[i].File = new_input.File; - inst->I.SrcReg[i].Index = new_input.Index; - inst->I.SrcReg[i].Swizzle = combine_swizzles(new_input.Swizzle, inst->I.SrcReg[i].Swizzle); - if (!inst->I.SrcReg[i].Abs) { - inst->I.SrcReg[i].Negate ^= new_input.Negate; - inst->I.SrcReg[i].Abs = new_input.Abs; + for(i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT && inst->U.I.SrcReg[i].Index == input) { + inst->U.I.SrcReg[i].File = new_input.File; + inst->U.I.SrcReg[i].Index = new_input.Index; + inst->U.I.SrcReg[i].Swizzle = combine_swizzles(new_input.Swizzle, inst->U.I.SrcReg[i].Swizzle); + if (!inst->U.I.SrcReg[i].Abs) { + inst->U.I.SrcReg[i].Negate ^= new_input.Negate; + inst->U.I.SrcReg[i].Abs = new_input.Abs; } c->Program.InputsRead |= 1 << new_input.Index; @@ -134,12 +171,12 @@ void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_ou c->Program.OutputsWritten &= ~(1 << output); for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_OUTPUT && inst->I.DstReg.Index == output) { - inst->I.DstReg.Index = new_output; - inst->I.DstReg.WriteMask &= writemask; + if (opcode->HasDstReg) { + if (inst->U.I.DstReg.File == RC_FILE_OUTPUT && inst->U.I.DstReg.Index == output) { + inst->U.I.DstReg.Index = new_output; + inst->U.I.DstReg.WriteMask &= writemask; c->Program.OutputsWritten |= 1 << new_output; } @@ -157,33 +194,33 @@ void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_ou struct rc_instruction * inst; for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_OUTPUT && inst->I.DstReg.Index == output) { - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = tempreg; + if (opcode->HasDstReg) { + if (inst->U.I.DstReg.File == RC_FILE_OUTPUT && inst->U.I.DstReg.Index == output) { + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = tempreg; } } } inst = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_OUTPUT; - inst->I.DstReg.Index = output; + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = output; - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[0].Index = tempreg; - inst->I.SrcReg[0].Swizzle = SWIZZLE_XYZW; + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = tempreg; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; inst = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_OUTPUT; - inst->I.DstReg.Index = dup_output; + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = dup_output; - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[0].Index = tempreg; - inst->I.SrcReg[0].Swizzle = SWIZZLE_XYZW; + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = tempreg; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; c->Program.OutputsWritten |= 1 << dup_output; } @@ -201,60 +238,60 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig /* perspective divide */ struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, &c->Program.Instructions); - inst_rcp->I.Opcode = OPCODE_RCP; + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; - inst_rcp->I.DstReg.File = PROGRAM_TEMPORARY; - inst_rcp->I.DstReg.Index = tempregi; - inst_rcp->I.DstReg.WriteMask = WRITEMASK_W; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = tempregi; + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; - inst_rcp->I.SrcReg[0].File = PROGRAM_INPUT; - inst_rcp->I.SrcReg[0].Index = new_input; - inst_rcp->I.SrcReg[0].Swizzle = SWIZZLE_WWWW; + inst_rcp->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst_rcp->U.I.SrcReg[0].Index = new_input; + inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst_rcp); - inst_mul->I.Opcode = OPCODE_MUL; + inst_mul->U.I.Opcode = RC_OPCODE_MUL; - inst_mul->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mul->I.DstReg.Index = tempregi; - inst_mul->I.DstReg.WriteMask = WRITEMASK_XYZ; + inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mul->U.I.DstReg.Index = tempregi; + inst_mul->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mul->I.SrcReg[0].File = PROGRAM_INPUT; - inst_mul->I.SrcReg[0].Index = new_input; + inst_mul->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst_mul->U.I.SrcReg[0].Index = new_input; - inst_mul->I.SrcReg[1].File = PROGRAM_TEMPORARY; - inst_mul->I.SrcReg[1].Index = tempregi; - inst_mul->I.SrcReg[1].Swizzle = SWIZZLE_WWWW; + inst_mul->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mul->U.I.SrcReg[1].Index = tempregi; + inst_mul->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; /* viewport transformation */ struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_mul); - inst_mad->I.Opcode = OPCODE_MAD; + inst_mad->U.I.Opcode = RC_OPCODE_MAD; - inst_mad->I.DstReg.File = PROGRAM_TEMPORARY; - inst_mad->I.DstReg.Index = tempregi; - inst_mad->I.DstReg.WriteMask = WRITEMASK_XYZ; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = tempregi; + inst_mad->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mad->I.SrcReg[0].File = PROGRAM_TEMPORARY; - inst_mad->I.SrcReg[0].Index = tempregi; - inst_mad->I.SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + inst_mad->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[0].Index = tempregi; + inst_mad->U.I.SrcReg[0].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); - inst_mad->I.SrcReg[1].File = PROGRAM_STATE_VAR; - inst_mad->I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_WINDOW_DIMENSION, 0); - inst_mad->I.SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + inst_mad->U.I.SrcReg[1].File = RC_FILE_CONSTANT; + inst_mad->U.I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_WINDOW_DIMENSION, 0); + inst_mad->U.I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); - inst_mad->I.SrcReg[2].File = PROGRAM_STATE_VAR; - inst_mad->I.SrcReg[2].Index = inst_mad->I.SrcReg[1].Index; - inst_mad->I.SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + inst_mad->U.I.SrcReg[2].File = RC_FILE_CONSTANT; + inst_mad->U.I.SrcReg[2].Index = inst_mad->U.I.SrcReg[1].Index; + inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); struct rc_instruction * inst; for (inst = inst_mad->Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned i; - for(i = 0; i < numsrcs; i++) { - if (inst->I.SrcReg[i].File == PROGRAM_INPUT && - inst->I.SrcReg[i].Index == wpos) { - inst->I.SrcReg[i].File = PROGRAM_TEMPORARY; - inst->I.SrcReg[i].Index = tempregi; + for(i = 0; i < opcode->NumSrcRegs; i++) { + if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT && + inst->U.I.SrcReg[i].Index == wpos) { + inst->U.I.SrcReg[i].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[i].Index = tempregi; } } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index e63ab8840a..87a732cd90 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -23,35 +23,11 @@ #ifndef RADEON_COMPILER_H #define RADEON_COMPILER_H -#include "main/mtypes.h" -#include "shader/prog_instruction.h" - #include "memory_pool.h" #include "radeon_code.h" +#include "radeon_program.h" - -struct rc_instruction { - struct rc_instruction * Prev; - struct rc_instruction * Next; - struct prog_instruction I; -}; - -struct rc_program { - /** - * Instructions.Next points to the first instruction, - * Instructions.Prev points to the last instruction. - */ - struct rc_instruction Instructions; - - /* Long term, we should probably remove InputsRead & OutputsWritten, - * since updating dependent state can be fragile, and they aren't - * actually used very often. */ - uint32_t InputsRead; - uint32_t OutputsWritten; - uint32_t ShadowSamplers; /**< Texture units used for shadow sampling. */ - - struct rc_constant_list Constants; -}; +struct rc_swizzle_caps; struct radeon_compiler { struct memory_pool Pool; @@ -59,6 +35,14 @@ struct radeon_compiler { unsigned Debug:1; unsigned Error:1; char * ErrorMsg; + + /** + * Variables used internally, not be touched by callers + * of the compiler + */ + /*@{*/ + struct rc_swizzle_caps * SwizzleCaps; + /*@}*/ }; void rc_init(struct radeon_compiler * c); @@ -67,11 +51,26 @@ void rc_destroy(struct radeon_compiler * c); void rc_debug(struct radeon_compiler * c, const char * fmt, ...); void rc_error(struct radeon_compiler * c, const char * fmt, ...); -void rc_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program); +int rc_if_fail_helper(struct radeon_compiler * c, const char * file, int line, const char * assertion); + +/** + * This macro acts like an if-statement that can be used to implement + * non-aborting assertions in the compiler. + * + * It checks whether \p cond is true. If not, an internal compiler error is + * flagged and the if-clause is run. + * + * A typical use-case would be: + * + * if (rc_assert(c, condition-that-must-be-true)) + * return; + */ +#define rc_assert(c, cond) \ + (!(cond) && rc_if_fail_helper(c, __FILE__, __LINE__, #cond)) void rc_calculate_inputs_outputs(struct radeon_compiler * c); -void rc_move_input(struct radeon_compiler * c, unsigned input, struct prog_src_register new_input); +void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input); void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_output, unsigned writemask); void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_output); void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsigned new_input); @@ -97,7 +96,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c); struct r300_vertex_program_compiler { struct radeon_compiler Base; struct r300_vertex_program_code *code; - GLbitfield RequiredOutputs; + uint32_t RequiredOutputs; void * UserData; void (*SetHwInputOutput)(struct r300_vertex_program_compiler * c); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c new file mode 100644 index 0000000000..cce9166e64 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_program.h" + + +static void reads_normal(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_sub_instruction * inst = &fullinst->U.I; + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + unsigned int refmask = 0; + + if (inst->SrcReg[src].File == RC_FILE_NONE) + return; + + for(unsigned int chan = 0; chan < 4; ++chan) + refmask |= 1 << GET_SWZ(inst->SrcReg[src].Swizzle, chan); + + refmask &= RC_MASK_XYZW; + + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_BIT(refmask, chan)) { + cb(userdata, fullinst, inst->SrcReg[src].File, inst->SrcReg[src].Index, chan); + } + } + + if (refmask && inst->SrcReg[src].RelAddr) + cb(userdata, fullinst, RC_FILE_ADDRESS, 0, RC_MASK_X); + } +} + +static void reads_pair(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_pair_instruction * inst = &fullinst->U.P; + unsigned int refmasks[3] = { 0, 0, 0 }; + + if (inst->RGB.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->RGB.Opcode); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + for(unsigned int chan = 0; chan < 3; ++chan) { + unsigned int swz = GET_SWZ(inst->RGB.Arg[arg].Swizzle, chan); + if (swz < 4) + refmasks[inst->RGB.Arg[arg].Source] |= 1 << swz; + } + } + } + + if (inst->Alpha.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Alpha.Opcode); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + if (inst->Alpha.Arg[arg].Swizzle < 4) + refmasks[inst->Alpha.Arg[arg].Source] |= 1 << inst->Alpha.Arg[arg].Swizzle; + } + } + + for(unsigned int src = 0; src < 3; ++src) { + if (inst->RGB.Src[src].Used) { + for(unsigned int chan = 0; chan < 3; ++chan) { + if (GET_BIT(refmasks[src], chan)) + cb(userdata, fullinst, inst->RGB.Src[src].File, inst->RGB.Src[src].Index, chan); + } + } + + if (inst->Alpha.Src[src].Used) { + if (GET_BIT(refmasks[src], 3)) + cb(userdata, fullinst, inst->Alpha.Src[src].File, inst->Alpha.Src[src].Index, 3); + } + } +} + +/** + * Calls a callback function for all sourced register channels. + * + * This is conservative, i.e. channels may be called multiple times, + * and the writemask of the instruction is not taken into account. + */ +void rc_for_all_reads(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata) +{ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + reads_normal(inst, cb, userdata); + } else { + reads_pair(inst, cb, userdata); + } +} + + + +static void writes_normal(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_sub_instruction * inst = &fullinst->U.I; + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + + if (opcode->HasDstReg) { + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_BIT(inst->DstReg.WriteMask, chan)) + cb(userdata, fullinst, inst->DstReg.File, inst->DstReg.Index, chan); + } + } + + if (inst->WriteALUResult) + cb(userdata, fullinst, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT, 0); +} + +static void writes_pair(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_pair_instruction * inst = &fullinst->U.P; + + for(unsigned int chan = 0; chan < 3; ++chan) { + if (GET_BIT(inst->RGB.WriteMask, chan)) + cb(userdata, fullinst, RC_FILE_TEMPORARY, inst->RGB.DestIndex, chan); + } + + if (inst->Alpha.WriteMask) + cb(userdata, fullinst, RC_FILE_TEMPORARY, inst->Alpha.DestIndex, 3); + + if (inst->WriteALUResult) + cb(userdata, fullinst, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT, 0); +} + +/** + * Calls a callback function for all written register channels. + * + * \warning Does not report output registers for paired instructions! + */ +void rc_for_all_writes(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata) +{ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + writes_normal(inst, cb, userdata); + } else { + writes_pair(inst, cb, userdata); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h new file mode 100644 index 0000000000..5aa4cb64f3 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_DATAFLOW_H +#define RADEON_DATAFLOW_H + +#include "radeon_program_constants.h" + +struct radeon_compiler; +struct rc_instruction; +struct rc_swizzle_caps; + + +/** + * Help analyze the register accesses of instructions. + */ +/*@{*/ +typedef void (*rc_read_write_fn)(void * userdata, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan); +void rc_for_all_reads(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata); +void rc_for_all_writes(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata); +/*@}*/ + + +/** + * Compiler passes based on dataflow analysis. + */ +/*@{*/ +typedef void (*rc_dataflow_mark_outputs_fn)(void * userdata, void * data, + void (*mark_fn)(void * data, unsigned int index, unsigned int mask)); +void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata); +void rc_dataflow_swizzles(struct radeon_compiler * c); +/*@}*/ + +#endif /* RADEON_DATAFLOW_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c new file mode 100644 index 0000000000..e0c66c4aeb --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -0,0 +1,295 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" + + +struct updatemask_state { + unsigned char Output[RC_REGISTER_MAX_INDEX]; + unsigned char Temporary[RC_REGISTER_MAX_INDEX]; + unsigned char Address; + unsigned char Special[RC_NUM_SPECIAL_REGISTERS]; +}; + +struct instruction_state { + unsigned char WriteMask:4; + unsigned char WriteALUResult:1; + unsigned char SrcReg[3]; +}; + +struct branchinfo { + unsigned int HaveElse:1; + + struct updatemask_state StoreEndif; + struct updatemask_state StoreElse; +}; + +struct deadcode_state { + struct radeon_compiler * C; + struct instruction_state * Instructions; + + struct updatemask_state R; + + struct branchinfo * BranchStack; + unsigned int BranchStackSize; + unsigned int BranchStackReserved; +}; + + +static void or_updatemasks( + struct updatemask_state * dst, + struct updatemask_state * a, + struct updatemask_state * b) +{ + for(unsigned int i = 0; i < RC_REGISTER_MAX_INDEX; ++i) { + dst->Output[i] = a->Output[i] | b->Output[i]; + dst->Temporary[i] = a->Temporary[i] | b->Temporary[i]; + } + + for(unsigned int i = 0; i < RC_NUM_SPECIAL_REGISTERS; ++i) + dst->Special[i] = a->Special[i] | b->Special[i]; + + dst->Address = a->Address | b->Address; +} + +static void push_branch(struct deadcode_state * s) +{ + if (s->BranchStackSize >= s->BranchStackReserved) { + unsigned int new_reserve = 2 * s->BranchStackReserved; + struct branchinfo * new_stack; + + if (!new_reserve) + new_reserve = 4; + + new_stack = memory_pool_malloc(&s->C->Pool, new_reserve * sizeof(struct branchinfo)); + memcpy(new_stack, s->BranchStack, s->BranchStackSize * sizeof(struct branchinfo)); + + s->BranchStack = new_stack; + s->BranchStackReserved = new_reserve; + } + + struct branchinfo * branch = &s->BranchStack[s->BranchStackSize++]; + branch->HaveElse = 0; + memcpy(&branch->StoreEndif, &s->R, sizeof(s->R)); +} + +static unsigned char * get_used_ptr(struct deadcode_state *s, rc_register_file file, unsigned int index) +{ + if (file == RC_FILE_OUTPUT || file == RC_FILE_TEMPORARY) { + if (index >= RC_REGISTER_MAX_INDEX) { + rc_error(s->C, "%s: index %i is out of bounds for file %i\n", __FUNCTION__, index, file); + return 0; + } + + if (file == RC_FILE_OUTPUT) + return &s->R.Output[index]; + else + return &s->R.Temporary[index]; + } else if (file == RC_FILE_ADDRESS) { + return &s->R.Address; + } else if (file == RC_FILE_SPECIAL) { + if (index >= RC_NUM_SPECIAL_REGISTERS) { + rc_error(s->C, "%s: special file index %i out of bounds\n", __FUNCTION__, index); + return 0; + } + + return &s->R.Special[index]; + } + + return 0; +} + +static void mark_used(struct deadcode_state * s, rc_register_file file, unsigned int index, unsigned int mask) +{ + unsigned char * pused = get_used_ptr(s, file, index); + if (pused) + *pused |= mask; +} + +static void update_instruction(struct deadcode_state * s, struct rc_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + struct instruction_state * insts = &s->Instructions[inst->IP]; + unsigned int usedmask = 0; + + if (opcode->HasDstReg) { + unsigned char * pused = get_used_ptr(s, inst->U.I.DstReg.File, inst->U.I.DstReg.Index); + if (pused) { + usedmask = *pused & inst->U.I.DstReg.WriteMask; + *pused &= ~usedmask; + } + } + + insts->WriteMask |= usedmask; + + if (inst->U.I.WriteALUResult) { + unsigned char * pused = get_used_ptr(s, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT); + if (pused && *pused) { + if (inst->U.I.WriteALUResult == RC_ALURESULT_X) + usedmask |= RC_MASK_X; + else if (inst->U.I.WriteALUResult == RC_ALURESULT_W) + usedmask |= RC_MASK_W; + + *pused = 0; + insts->WriteALUResult = 1; + } + } + + unsigned int srcmasks[3]; + rc_compute_sources_for_writemask(opcode, usedmask, srcmasks); + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + unsigned int refmask = 0; + unsigned int newsrcmask = srcmasks[src] & ~insts->SrcReg[src]; + insts->SrcReg[src] |= newsrcmask; + + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_BIT(newsrcmask, chan)) + refmask |= 1 << GET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan); + } + + /* get rid of spurious bits from ZERO, ONE, etc. swizzles */ + refmask &= RC_MASK_XYZW; + + if (!refmask) + continue; + + mark_used(s, inst->U.I.SrcReg[src].File, inst->U.I.SrcReg[src].Index, refmask); + + if (inst->U.I.SrcReg[src].RelAddr) + mark_used(s, RC_FILE_ADDRESS, 0, RC_MASK_X); + } +} + +static void mark_output_use(void * data, unsigned int index, unsigned int mask) +{ + struct deadcode_state * s = data; + + mark_used(s, RC_FILE_OUTPUT, index, mask); +} + +void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata) +{ + struct deadcode_state s; + unsigned int nr_instructions; + + memset(&s, 0, sizeof(s)); + s.C = c; + + nr_instructions = rc_recompute_ips(c); + s.Instructions = memory_pool_malloc(&c->Pool, sizeof(struct instruction_state)*nr_instructions); + memset(s.Instructions, 0, sizeof(struct instruction_state)*nr_instructions); + + dce(userdata, &s, &mark_output_use); + + for(struct rc_instruction * inst = c->Program.Instructions.Prev; + inst != &c->Program.Instructions; + inst = inst->Prev) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + + if (opcode->IsFlowControl) { + if (opcode->Opcode == RC_OPCODE_ENDIF) { + push_branch(&s); + } else { + if (s.BranchStackSize) { + struct branchinfo * branch = &s.BranchStack[s.BranchStackSize-1]; + + if (opcode->Opcode == RC_OPCODE_IF) { + or_updatemasks(&s.R, + &s.R, + branch->HaveElse ? &branch->StoreElse : &branch->StoreEndif); + + s.BranchStackSize--; + } else if (opcode->Opcode == RC_OPCODE_ELSE) { + if (branch->HaveElse) { + rc_error(c, "%s: Multiple ELSE for one IF/ENDIF\n", __FUNCTION__); + } else { + memcpy(&branch->StoreElse, &s.R, sizeof(s.R)); + memcpy(&s.R, &branch->StoreEndif, sizeof(s.R)); + branch->HaveElse = 1; + } + } else { + rc_error(c, "%s: Unhandled control flow instruction %s\n", __FUNCTION__, opcode->Name); + } + } else { + rc_error(c, "%s: Unexpected control flow instruction\n", __FUNCTION__); + } + } + } + + update_instruction(&s, inst); + } + + unsigned int ip = 0; + for(struct rc_instruction * inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; + inst = inst->Next, ++ip) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode);\ + int dead = 1; + + if (!opcode->HasDstReg) { + dead = 0; + } else { + inst->U.I.DstReg.WriteMask = s.Instructions[ip].WriteMask; + if (s.Instructions[ip].WriteMask) + dead = 0; + + if (s.Instructions[ip].WriteALUResult) + dead = 0; + else + inst->U.I.WriteALUResult = RC_ALURESULT_NONE; + } + + if (dead) { + struct rc_instruction * todelete = inst; + inst = inst->Prev; + rc_remove_instruction(todelete); + continue; + } + + unsigned int srcmasks[3]; + unsigned int usemask = s.Instructions[ip].WriteMask; + + if (inst->U.I.WriteALUResult == RC_ALURESULT_X) + usemask |= RC_MASK_X; + else if (inst->U.I.WriteALUResult == RC_ALURESULT_W) + usemask |= RC_MASK_W; + + rc_compute_sources_for_writemask(opcode, usemask, srcmasks); + + for(unsigned int src = 0; src < 3; ++src) { + for(unsigned int chan = 0; chan < 4; ++chan) { + if (!GET_BIT(srcmasks[src], chan)) + SET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan, RC_SWIZZLE_UNUSED); + } + } + } + + rc_calculate_inputs_outputs(c); +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c new file mode 100644 index 0000000000..33acbd30f4 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" +#include "radeon_swizzle.h" + + +static void rewrite_source(struct radeon_compiler * c, + struct rc_instruction * inst, unsigned src) +{ + struct rc_swizzle_split split; + unsigned int tempreg = rc_find_free_temporary(c); + unsigned int usemask; + + usemask = 0; + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan) != RC_SWIZZLE_UNUSED) + usemask |= 1 << chan; + } + + c->SwizzleCaps->Split(inst->U.I.SrcReg[src], usemask, &split); + + for(unsigned int phase = 0; phase < split.NumPhases; ++phase) { + struct rc_instruction * mov = rc_insert_new_instruction(c, inst->Prev); + unsigned int phase_refmask; + unsigned int masked_negate; + + mov->U.I.Opcode = RC_OPCODE_MOV; + mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + mov->U.I.DstReg.Index = tempreg; + mov->U.I.DstReg.WriteMask = split.Phase[phase]; + mov->U.I.SrcReg[0] = inst->U.I.SrcReg[src]; + + phase_refmask = 0; + for(unsigned int chan = 0; chan < 4; ++chan) { + if (!GET_BIT(split.Phase[phase], chan)) + SET_SWZ(mov->U.I.SrcReg[0].Swizzle, chan, RC_SWIZZLE_UNUSED); + else + phase_refmask |= 1 << GET_SWZ(mov->U.I.SrcReg[0].Swizzle, chan); + } + + phase_refmask &= RC_MASK_XYZW; + + masked_negate = split.Phase[phase] & mov->U.I.SrcReg[0].Negate; + if (masked_negate == 0) + mov->U.I.SrcReg[0].Negate = 0; + else if (masked_negate == split.Phase[phase]) + mov->U.I.SrcReg[0].Negate = RC_MASK_XYZW; + + } + + inst->U.I.SrcReg[src].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[src].Index = tempreg; + inst->U.I.SrcReg[src].Swizzle = 0; + inst->U.I.SrcReg[src].Negate = RC_MASK_NONE; + inst->U.I.SrcReg[src].Abs = 0; + for(unsigned int chan = 0; chan < 4; ++chan) { + SET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan, + GET_BIT(usemask, chan) ? chan : RC_SWIZZLE_UNUSED); + } +} + +void rc_dataflow_swizzles(struct radeon_compiler * c) +{ + struct rc_instruction * inst; + + for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + unsigned int src; + + for(src = 0; src < opcode->NumSrcRegs; ++src) { + if (!c->SwizzleCaps->IsNative(inst->U.I.Opcode, inst->U.I.SrcReg[src])) + rewrite_source(c, inst, src); + } + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c deleted file mode 100644 index aaaa50ad1f..0000000000 --- a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (C) 2008 Nicolai Haehnle. - * - * 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 (including the - * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 - * - * "Not-quite SSA" and Dead-Code Elimination. - * - * @note This code uses SWIZZLE_NIL in a source register to indicate that - * the corresponding component is ignored by the corresponding instruction. - */ - -#include "radeon_nqssadce.h" - -#include "radeon_compiler.h" - - -/** - * Return the @ref register_state for the given register (or 0 for untracked - * registers, i.e. constants). - */ -static struct register_state *get_reg_state(struct nqssadce_state* s, GLuint file, GLuint index) -{ - switch(file) { - case PROGRAM_TEMPORARY: return &s->Temps[index]; - case PROGRAM_OUTPUT: return &s->Outputs[index]; - case PROGRAM_ADDRESS: return &s->Address; - default: return 0; - } -} - - -/** - * Left multiplication of a register with a swizzle - * - * @note Works correctly only for X, Y, Z, W swizzles, not for constant swizzles. - */ -struct prog_src_register lmul_swizzle(GLuint swizzle, struct prog_src_register srcreg) -{ - struct prog_src_register tmp = srcreg; - int i; - tmp.Swizzle = 0; - tmp.Negate = NEGATE_NONE; - for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(swizzle, i); - if (swz < 4) { - tmp.Swizzle |= GET_SWZ(srcreg.Swizzle, swz) << (i*3); - tmp.Negate |= GET_BIT(srcreg.Negate, swz) << i; - } else { - tmp.Swizzle |= swz << (i*3); - } - } - return tmp; -} - - -static void track_used_srcreg(struct nqssadce_state* s, - GLint src, GLuint sourced) -{ - struct prog_instruction * inst = &s->IP->I; - int i; - GLuint deswz_source = 0; - - for(i = 0; i < 4; ++i) { - if (GET_BIT(sourced, i)) { - GLuint swz = GET_SWZ(inst->SrcReg[src].Swizzle, i); - deswz_source |= 1 << swz; - } else { - inst->SrcReg[src].Swizzle &= ~(7 << (3*i)); - inst->SrcReg[src].Swizzle |= SWIZZLE_NIL << (3*i); - } - } - - if (!s->Descr->IsNativeSwizzle(inst->Opcode, inst->SrcReg[src])) { - struct prog_dst_register dstreg = inst->DstReg; - dstreg.File = PROGRAM_TEMPORARY; - dstreg.Index = rc_find_free_temporary(s->Compiler); - dstreg.WriteMask = sourced; - - s->Descr->BuildSwizzle(s, dstreg, inst->SrcReg[src]); - - inst->SrcReg[src].File = PROGRAM_TEMPORARY; - inst->SrcReg[src].Index = dstreg.Index; - inst->SrcReg[src].Swizzle = 0; - inst->SrcReg[src].Negate = NEGATE_NONE; - inst->SrcReg[src].Abs = 0; - for(i = 0; i < 4; ++i) { - if (GET_BIT(sourced, i)) - inst->SrcReg[src].Swizzle |= i << (3*i); - else - inst->SrcReg[src].Swizzle |= SWIZZLE_NIL << (3*i); - } - deswz_source = sourced; - } - - struct register_state *regstate; - - if (inst->SrcReg[src].RelAddr) { - regstate = get_reg_state(s, PROGRAM_ADDRESS, 0); - if (regstate) - regstate->Sourced |= WRITEMASK_X; - } else { - regstate = get_reg_state(s, inst->SrcReg[src].File, inst->SrcReg[src].Index); - if (regstate) - regstate->Sourced |= deswz_source & 0xf; - } -} - -static void unalias_srcregs(struct rc_instruction *inst, GLuint oldindex, GLuint newindex) -{ - int nsrc = _mesa_num_inst_src_regs(inst->I.Opcode); - int i; - for(i = 0; i < nsrc; ++i) - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY && inst->I.SrcReg[i].Index == oldindex) - inst->I.SrcReg[i].Index = newindex; -} - -static void unalias_temporary(struct nqssadce_state* s, GLuint oldindex) -{ - GLuint newindex = rc_find_free_temporary(s->Compiler); - struct rc_instruction * inst; - for(inst = s->Compiler->Program.Instructions.Next; inst != s->IP; inst = inst->Next) { - if (inst->I.DstReg.File == PROGRAM_TEMPORARY && inst->I.DstReg.Index == oldindex) - inst->I.DstReg.Index = newindex; - unalias_srcregs(inst, oldindex, newindex); - } - unalias_srcregs(s->IP, oldindex, newindex); -} - - -/** - * Handle one instruction. - */ -static void process_instruction(struct nqssadce_state* s) -{ - struct prog_instruction *inst = &s->IP->I; - GLuint WriteMask; - - if (inst->Opcode == OPCODE_END) - return; - - if (inst->Opcode != OPCODE_KIL) { - struct register_state *regstate = get_reg_state(s, inst->DstReg.File, inst->DstReg.Index); - if (!regstate) { - rc_error(s->Compiler, "NqssaDce: bad destination register (%i[%i])\n", - inst->DstReg.File, inst->DstReg.Index); - return; - } - - inst->DstReg.WriteMask &= regstate->Sourced; - regstate->Sourced &= ~inst->DstReg.WriteMask; - - if (inst->DstReg.WriteMask == 0) { - struct rc_instruction * inst_remove = s->IP; - s->IP = s->IP->Prev; - rc_remove_instruction(inst_remove); - return; - } - - if (inst->DstReg.File == PROGRAM_TEMPORARY && !regstate->Sourced) - unalias_temporary(s, inst->DstReg.Index); - } - - WriteMask = inst->DstReg.WriteMask; - - switch (inst->Opcode) { - case OPCODE_ARL: - case OPCODE_DDX: - case OPCODE_DDY: - case OPCODE_FRC: - case OPCODE_MOV: - track_used_srcreg(s, 0, WriteMask); - break; - case OPCODE_ADD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MUL: - case OPCODE_SGE: - case OPCODE_SLT: - track_used_srcreg(s, 0, WriteMask); - track_used_srcreg(s, 1, WriteMask); - break; - case OPCODE_CMP: - case OPCODE_MAD: - track_used_srcreg(s, 0, WriteMask); - track_used_srcreg(s, 1, WriteMask); - track_used_srcreg(s, 2, WriteMask); - break; - case OPCODE_COS: - case OPCODE_EX2: - case OPCODE_LG2: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_SIN: - track_used_srcreg(s, 0, 0x1); - break; - case OPCODE_DP3: - track_used_srcreg(s, 0, 0x7); - track_used_srcreg(s, 1, 0x7); - break; - case OPCODE_DP4: - track_used_srcreg(s, 0, 0xf); - track_used_srcreg(s, 1, 0xf); - break; - case OPCODE_KIL: - case OPCODE_TEX: - case OPCODE_TXB: - case OPCODE_TXP: - track_used_srcreg(s, 0, 0xf); - break; - case OPCODE_DST: - track_used_srcreg(s, 0, 0x6); - track_used_srcreg(s, 1, 0xa); - break; - case OPCODE_EXP: - case OPCODE_LOG: - case OPCODE_POW: - track_used_srcreg(s, 0, 0x3); - break; - case OPCODE_LIT: - track_used_srcreg(s, 0, 0xb); - break; - default: - rc_error(s->Compiler, "NqssaDce: Unknown opcode %d\n", inst->Opcode); - return; - } - - s->IP = s->IP->Prev; -} - -void rc_calculate_inputs_outputs(struct radeon_compiler * c) -{ - struct rc_instruction *inst; - - c->Program.InputsRead = 0; - c->Program.OutputsWritten = 0; - - for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) - { - int i; - int num_src_regs = _mesa_num_inst_src_regs(inst->I.Opcode); - - for (i = 0; i < num_src_regs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_INPUT) - c->Program.InputsRead |= 1 << inst->I.SrcReg[i].Index; - } - - if (_mesa_num_inst_dst_regs(inst->I.Opcode)) { - if (inst->I.DstReg.File == PROGRAM_OUTPUT) - c->Program.OutputsWritten |= 1 << inst->I.DstReg.Index; - } - } -} - -void radeonNqssaDce(struct radeon_compiler * c, struct radeon_nqssadce_descr* descr, void * data) -{ - struct nqssadce_state s; - - _mesa_bzero(&s, sizeof(s)); - s.Compiler = c; - s.Descr = descr; - s.UserData = data; - s.Descr->Init(&s); - s.IP = c->Program.Instructions.Prev; - - while(s.IP != &c->Program.Instructions && !c->Error) - process_instruction(&s); - - rc_calculate_inputs_outputs(c); -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h deleted file mode 100644 index b3fc77a35a..0000000000 --- a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2008 Nicolai Haehnle. - * - * 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 (including the - * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 __RADEON_PROGRAM_NQSSADCE_H_ -#define __RADEON_PROGRAM_NQSSADCE_H_ - -#include "radeon_program.h" - -struct register_state { - /** - * Bitmask indicating which components of the register are sourced - * by later instructions. - */ - GLuint Sourced : 4; -}; - -/** - * Maintain state such as which registers are used, which registers are - * read from, etc. - */ -struct nqssadce_state { - struct radeon_compiler *Compiler; - struct radeon_nqssadce_descr *Descr; - - /** - * All instructions after this instruction pointer have been dealt with. - */ - struct rc_instruction * IP; - - /** - * Which registers are read by subsequent instructions? - */ - struct register_state Temps[MAX_PROGRAM_TEMPS]; - struct register_state Outputs[VERT_RESULT_MAX]; - struct register_state Address; - - void * UserData; -}; - - -/** - * This structure contains a description of the hardware in-so-far as - * it is required for the NqSSA-DCE pass. - */ -struct radeon_nqssadce_descr { - /** - * Fill in which outputs - */ - void (*Init)(struct nqssadce_state *); - - /** - * Check whether the given swizzle, absolute and negate combination - * can be implemented natively by the hardware for this opcode. - */ - GLboolean (*IsNativeSwizzle)(GLuint opcode, struct prog_src_register reg); - - /** - * Emit (at the current IP) the instruction MOV dst, src; - * The transformation will work recursively on the emitted instruction(s). - */ - void (*BuildSwizzle)(struct nqssadce_state*, struct prog_dst_register dst, struct prog_src_register src); -}; - -void radeonNqssaDce(struct radeon_compiler * c, struct radeon_nqssadce_descr* descr, void * data); -struct prog_src_register lmul_swizzle(GLuint swizzle, struct prog_src_register srcreg); - -#endif /* __RADEON_PROGRAM_NQSSADCE_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c new file mode 100644 index 0000000000..c1c0181fac --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -0,0 +1,429 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_opcodes.h" + +#include "radeon_program_constants.h" + +struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { + { + .Opcode = RC_OPCODE_NOP, + .Name = "NOP" + }, + { + .Opcode = RC_OPCODE_ILLEGAL_OPCODE, + .Name = "ILLEGAL OPCODE" + }, + { + .Opcode = RC_OPCODE_ABS, + .Name = "ABS", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_ADD, + .Name = "ADD", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_ARL, + .Name = "ARL", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_CMP, + .Name = "CMP", + .NumSrcRegs = 3, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_COS, + .Name = "COS", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_DDX, + .Name = "DDX", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_DDY, + .Name = "DDY", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_DP3, + .Name = "DP3", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DP4, + .Name = "DP4", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DPH, + .Name = "DPH", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DST, + .Name = "DST", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_EX2, + .Name = "EX2", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_EXP, + .Name = "EXP", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_FLR, + .Name = "FLR", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_FRC, + .Name = "FRC", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_KIL, + .Name = "KIL", + .NumSrcRegs = 1 + }, + { + .Opcode = RC_OPCODE_LG2, + .Name = "LG2", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_LIT, + .Name = "LIT", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_LOG, + .Name = "LOG", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_LRP, + .Name = "LRP", + .NumSrcRegs = 3, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_MAD, + .Name = "MAD", + .NumSrcRegs = 3, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_MAX, + .Name = "MAX", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_MIN, + .Name = "MIN", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_MOV, + .Name = "MOV", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_MUL, + .Name = "MUL", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_POW, + .Name = "POW", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_RCP, + .Name = "RCP", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_RSQ, + .Name = "RSQ", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_SCS, + .Name = "SCS", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SEQ, + .Name = "SEQ", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SFL, + .Name = "SFL", + .NumSrcRegs = 0, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SGE, + .Name = "SGE", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SGT, + .Name = "SGT", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SIN, + .Name = "SIN", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsStandardScalar = 1 + }, + { + .Opcode = RC_OPCODE_SLE, + .Name = "SLE", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SLT, + .Name = "SLT", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SNE, + .Name = "SNE", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SUB, + .Name = "SUB", + .NumSrcRegs = 2, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_SWZ, + .Name = "SWZ", + .NumSrcRegs = 1, + .HasDstReg = 1, + .IsComponentwise = 1 + }, + { + .Opcode = RC_OPCODE_XPD, + .Name = "XPD", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TEX, + .Name = "TEX", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXB, + .Name = "TXB", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXD, + .Name = "TXD", + .HasTexture = 1, + .NumSrcRegs = 3, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXL, + .Name = "TXL", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXP, + .Name = "TXP", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_IF, + .Name = "IF", + .IsFlowControl = 1, + .NumSrcRegs = 1 + }, + { + .Opcode = RC_OPCODE_ELSE, + .Name = "ELSE", + .IsFlowControl = 1, + .NumSrcRegs = 0 + }, + { + .Opcode = RC_OPCODE_ENDIF, + .Name = "ENDIF", + .IsFlowControl = 1, + .NumSrcRegs = 0 + }, + { + .Opcode = RC_OPCODE_REPL_ALPHA, + .Name = "REPL_ALPHA", + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_BEGIN_TEX, + .Name = "BEGIN_TEX" + } +}; + +void rc_compute_sources_for_writemask( + const struct rc_opcode_info * opcode, + unsigned int writemask, + unsigned int *srcmasks) +{ + srcmasks[0] = 0; + srcmasks[1] = 0; + srcmasks[2] = 0; + + if (opcode->Opcode == RC_OPCODE_KIL) + srcmasks[0] |= RC_MASK_XYZW; + else if (opcode->Opcode == RC_OPCODE_IF) + srcmasks[0] |= RC_MASK_X; + + if (!writemask) + return; + + if (opcode->IsComponentwise) { + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) + srcmasks[src] |= writemask; + } else if (opcode->IsStandardScalar) { + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) + srcmasks[src] |= RC_MASK_X; + } else { + switch(opcode->Opcode) { + case RC_OPCODE_ARL: + srcmasks[0] |= RC_MASK_X; + break; + case RC_OPCODE_DP3: + srcmasks[0] |= RC_MASK_XYZ; + srcmasks[1] |= RC_MASK_XYZ; + break; + case RC_OPCODE_DP4: + srcmasks[0] |= RC_MASK_XYZW; + srcmasks[1] |= RC_MASK_XYZW; + break; + case RC_OPCODE_TEX: + case RC_OPCODE_TXB: + case RC_OPCODE_TXP: + srcmasks[0] |= RC_MASK_XYZW; + break; + case RC_OPCODE_DST: + srcmasks[0] |= 0x6; + srcmasks[1] |= 0xa; + break; + case RC_OPCODE_EXP: + case RC_OPCODE_LOG: + srcmasks[0] |= RC_MASK_XY; + break; + case RC_OPCODE_LIT: + srcmasks[0] |= 0xb; + break; + default: + break; + } + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h new file mode 100644 index 0000000000..a3c5b86954 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_OPCODES_H +#define RADEON_OPCODES_H + +#include <assert.h> + +/** + * Opcodes understood by the Radeon compiler. + */ +typedef enum { + RC_OPCODE_NOP = 0, + RC_OPCODE_ILLEGAL_OPCODE, + + /** vec4 instruction: dst.c = abs(src0.c); */ + RC_OPCODE_ABS, + + /** vec4 instruction: dst.c = src0.c + src1.c; */ + RC_OPCODE_ADD, + + /** special instruction: load address register + * dst.x = floor(src.x), where dst must be an address register */ + RC_OPCODE_ARL, + + /** vec4 instruction: dst.c = src0.c < 0.0 ? src1.c : src2.c */ + RC_OPCODE_CMP, + + /** scalar instruction: dst = cos(src0.x) */ + RC_OPCODE_COS, + + /** special instruction: take vec4 partial derivative in X direction + * dst.c = d src0.c / dx */ + RC_OPCODE_DDX, + + /** special instruction: take vec4 partial derivative in Y direction + * dst.c = d src0.c / dy */ + RC_OPCODE_DDY, + + /** scalar instruction: dst = src0.x*src1.x + src0.y*src1.y + src0.z*src1.z */ + RC_OPCODE_DP3, + + /** scalar instruction: dst = src0.x*src1.x + src0.y*src1.y + src0.z*src1.z + src0.w*src1.w */ + RC_OPCODE_DP4, + + /** scalar instruction: dst = src0.x*src1.x + src0.y*src1.y + src0.z*src1.z + src1.w */ + RC_OPCODE_DPH, + + /** special instruction, see ARB_fragment_program */ + RC_OPCODE_DST, + + /** scalar instruction: dst = 2**src0.x */ + RC_OPCODE_EX2, + + /** special instruction, see ARB_vertex_program */ + RC_OPCODE_EXP, + + /** vec4 instruction: dst.c = floor(src0.c) */ + RC_OPCODE_FLR, + + /** vec4 instruction: dst.c = src0.c - floor(src0.c) */ + RC_OPCODE_FRC, + + /** special instruction: stop execution if any component of src0 is negative */ + RC_OPCODE_KIL, + + /** scalar instruction: dst = log_2(src0.x) */ + RC_OPCODE_LG2, + + /** special instruction, see ARB_vertex_program */ + RC_OPCODE_LIT, + + /** special instruction, see ARB_vertex_program */ + RC_OPCODE_LOG, + + /** vec4 instruction: dst.c = src0.c*src1.c + (1 - src0.c)*src2.c */ + RC_OPCODE_LRP, + + /** vec4 instruction: dst.c = src0.c*src1.c + src2.c */ + RC_OPCODE_MAD, + + /** vec4 instruction: dst.c = max(src0.c, src1.c) */ + RC_OPCODE_MAX, + + /** vec4 instruction: dst.c = min(src0.c, src1.c) */ + RC_OPCODE_MIN, + + /** vec4 instruction: dst.c = src0.c */ + RC_OPCODE_MOV, + + /** vec4 instruction: dst.c = src0.c*src1.c */ + RC_OPCODE_MUL, + + /** scalar instruction: dst = src0.x ** src1.x */ + RC_OPCODE_POW, + + /** scalar instruction: dst = 1 / src0.x */ + RC_OPCODE_RCP, + + /** scalar instruction: dst = 1 / sqrt(src0.x) */ + RC_OPCODE_RSQ, + + /** special instruction, see ARB_fragment_program */ + RC_OPCODE_SCS, + + /** vec4 instruction: dst.c = (src0.c == src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SEQ, + + /** vec4 instruction: dst.c = 0.0 */ + RC_OPCODE_SFL, + + /** vec4 instruction: dst.c = (src0.c >= src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SGE, + + /** vec4 instruction: dst.c = (src0.c > src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SGT, + + /** scalar instruction: dst = sin(src0.x) */ + RC_OPCODE_SIN, + + /** vec4 instruction: dst.c = (src0.c <= src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SLE, + + /** vec4 instruction: dst.c = (src0.c < src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SLT, + + /** vec4 instruction: dst.c = (src0.c != src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SNE, + + /** vec4 instruction: dst.c = src0.c - src1.c */ + RC_OPCODE_SUB, + + /** vec4 instruction: dst.c = src0.c */ + RC_OPCODE_SWZ, + + /** special instruction, see ARB_fragment_program */ + RC_OPCODE_XPD, + + RC_OPCODE_TEX, + RC_OPCODE_TXB, + RC_OPCODE_TXD, + RC_OPCODE_TXL, + RC_OPCODE_TXP, + + /** branch instruction: + * If src0.x != 0.0, continue with the next instruction; + * otherwise, jump to matching RC_OPCODE_ELSE or RC_OPCODE_ENDIF. + */ + RC_OPCODE_IF, + + /** branch instruction: jump to matching RC_OPCODE_ENDIF */ + RC_OPCODE_ELSE, + + /** branch instruction: has no effect */ + RC_OPCODE_ENDIF, + + /** special instruction, used in R300-R500 fragment program pair instructions + * indicates that the result of the alpha operation shall be replicated + * across all other channels */ + RC_OPCODE_REPL_ALPHA, + + /** special instruction, used in R300-R500 fragment programs + * to indicate the start of a block of texture instructions that + * can run simultaneously. */ + RC_OPCODE_BEGIN_TEX, + + MAX_RC_OPCODE +} rc_opcode; + + +struct rc_opcode_info { + rc_opcode Opcode; + const char * Name; + + /** true if the instruction reads from a texture. + * + * \note This is false for the KIL instruction, even though KIL is + * a texture instruction from a hardware point of view. */ + unsigned int HasTexture:1; + + unsigned int NumSrcRegs:2; + unsigned int HasDstReg:1; + + /** true if this instruction affects control flow */ + unsigned int IsFlowControl:1; + + /** true if this is a vector instruction that operates on components in parallel + * without any cross-component interaction */ + unsigned int IsComponentwise:1; + + /** true if this instruction sources only its operands X components + * to compute one result which is smeared across all output channels */ + unsigned int IsStandardScalar:1; +}; + +extern struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE]; + +static inline const struct rc_opcode_info * rc_get_opcode_info(rc_opcode opcode) +{ + assert((unsigned int)opcode < MAX_RC_OPCODE); + assert(rc_opcodes[opcode].Opcode == opcode); + + return &rc_opcodes[opcode]; +} + +void rc_compute_sources_for_writemask( + const struct rc_opcode_info * opcode, + unsigned int writemask, + unsigned int *srcmasks); + +#endif /* RADEON_OPCODES_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c new file mode 100644 index 0000000000..828d0c8e28 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_program_pair.h" + +#include <stdio.h> + +#include "radeon_compiler.h" +#include "radeon_dataflow.h" + + +#define VERBOSE 0 + +#define DBG(...) do { if (VERBOSE) fprintf(stderr, __VA_ARGS__); } while(0) + + +struct live_intervals { + int Start; + int End; + struct live_intervals * Next; +}; + +struct register_info { + struct live_intervals Live; + + unsigned int Used:1; + unsigned int Allocated:1; + rc_register_file File:3; + unsigned int Index:RC_REGISTER_INDEX_BITS; +}; + +struct hardware_register { + struct live_intervals * Used; +}; + +struct regalloc_state { + struct radeon_compiler * C; + + struct register_info Input[RC_REGISTER_MAX_INDEX]; + struct register_info Temporary[RC_REGISTER_MAX_INDEX]; + + struct hardware_register * HwTemporary; + unsigned int NumHwTemporaries; +}; + +static void print_live_intervals(struct live_intervals * src) +{ + if (!src) { + DBG("(null)"); + return; + } + + while(src) { + DBG("(%i,%i)", src->Start, src->End); + src = src->Next; + } +} + +static void add_live_intervals(struct regalloc_state * s, + struct live_intervals ** dst, struct live_intervals * src) +{ + struct live_intervals ** dst_backup = dst; + + if (VERBOSE) { + DBG("add_live_intervals: "); + print_live_intervals(*dst); + DBG(" to "); + print_live_intervals(src); + DBG("\n"); + } + + while(src) { + if (*dst && (*dst)->End < src->Start) { + dst = &(*dst)->Next; + } else if (!*dst || (*dst)->Start > src->End) { + struct live_intervals * li = memory_pool_malloc(&s->C->Pool, sizeof(*li)); + li->Start = src->Start; + li->End = src->End; + li->Next = *dst; + *dst = li; + src = src->Next; + } else { + if (src->End > (*dst)->End) + (*dst)->End = src->End; + if (src->Start < (*dst)->Start) + (*dst)->Start = src->Start; + src = src->Next; + } + } + + if (VERBOSE) { + DBG(" result: "); + print_live_intervals(*dst_backup); + DBG("\n"); + } +} + +static int overlap_live_intervals(struct live_intervals * dst, struct live_intervals * src) +{ + if (VERBOSE) { + DBG("overlap_live_intervals: "); + print_live_intervals(dst); + DBG(" to "); + print_live_intervals(src); + DBG("\n"); + } + + while(src && dst) { + if (dst->End <= src->Start) { + dst = dst->Next; + } else if (dst->End <= src->End) { + DBG(" overlap\n"); + return 1; + } else if (dst->Start < src->End) { + DBG(" overlap\n"); + return 1; + } else { + src = src->Next; + } + } + + DBG(" no overlap\n"); + + return 0; +} + +static int try_add_live_intervals(struct regalloc_state * s, + struct live_intervals ** dst, struct live_intervals * src) +{ + if (overlap_live_intervals(*dst, src)) + return 0; + + add_live_intervals(s, dst, src); + return 1; +} + +static void scan_callback(void * data, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct regalloc_state * s = data; + struct register_info * reg; + + if (file == RC_FILE_TEMPORARY) + reg = &s->Temporary[index]; + else if (file == RC_FILE_INPUT) + reg = &s->Input[index]; + else + return; + + if (!reg->Used) { + reg->Used = 1; + if (file == RC_FILE_INPUT) + reg->Live.Start = -1; + else + reg->Live.Start = inst->IP; + reg->Live.End = inst->IP; + } else { + if (inst->IP > reg->Live.End) + reg->Live.End = inst->IP; + } +} + +static void compute_live_intervals(struct regalloc_state * s) +{ + rc_recompute_ips(s->C); + + for(struct rc_instruction * inst = s->C->Program.Instructions.Next; + inst != &s->C->Program.Instructions; + inst = inst->Next) { + rc_for_all_reads(inst, scan_callback, s); + rc_for_all_writes(inst, scan_callback, s); + } +} + +static void rewrite_register(struct regalloc_state * s, + rc_register_file * file, unsigned int * index) +{ + const struct register_info * reg; + + if (*file == RC_FILE_TEMPORARY) + reg = &s->Temporary[*index]; + else if (*file == RC_FILE_INPUT) + reg = &s->Input[*index]; + else + return; + + if (reg->Allocated) { + *file = reg->File; + *index = reg->Index; + } +} + +static void rewrite_normal_instruction(struct regalloc_state * s, struct rc_sub_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + + if (opcode->HasDstReg) { + rc_register_file file = inst->DstReg.File; + unsigned int index = inst->DstReg.Index; + + rewrite_register(s, &file, &index); + + inst->DstReg.File = file; + inst->DstReg.Index = index; + } + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + rc_register_file file = inst->SrcReg[src].File; + unsigned int index = inst->SrcReg[src].Index; + + rewrite_register(s, &file, &index); + + inst->SrcReg[src].File = file; + inst->SrcReg[src].Index = index; + } +} + +static void rewrite_pair_instruction(struct regalloc_state * s, struct rc_pair_instruction * inst) +{ + if (inst->RGB.WriteMask) { + rc_register_file file = RC_FILE_TEMPORARY; + unsigned int index = inst->RGB.DestIndex; + + rewrite_register(s, &file, &index); + + inst->RGB.DestIndex = index; + } + + if (inst->Alpha.WriteMask) { + rc_register_file file = RC_FILE_TEMPORARY; + unsigned int index = inst->Alpha.DestIndex; + + rewrite_register(s, &file, &index); + + inst->Alpha.DestIndex = index; + } + + for(unsigned int src = 0; src < 3; ++src) { + if (inst->RGB.Src[src].Used) { + rc_register_file file = inst->RGB.Src[src].File; + unsigned int index = inst->RGB.Src[src].Index; + + rewrite_register(s, &file, &index); + + inst->RGB.Src[src].File = file; + inst->RGB.Src[src].Index = index; + } + + if (inst->Alpha.Src[src].Used) { + rc_register_file file = inst->Alpha.Src[src].File; + unsigned int index = inst->Alpha.Src[src].Index; + + rewrite_register(s, &file, &index); + + inst->Alpha.Src[src].File = file; + inst->Alpha.Src[src].Index = index; + } + } +} + +static void do_regalloc(struct regalloc_state * s) +{ + /* Simple and stupid greedy register allocation */ + for(unsigned int index = 0; index < RC_REGISTER_MAX_INDEX; ++index) { + struct register_info * reg = &s->Temporary[index]; + + if (!reg->Used) + continue; + + for(unsigned int hwreg = 0; hwreg < s->NumHwTemporaries; ++hwreg) { + if (try_add_live_intervals(s, &s->HwTemporary[hwreg].Used, ®->Live)) { + reg->Allocated = 1; + reg->File = RC_FILE_TEMPORARY; + reg->Index = hwreg; + goto success; + } + } + + rc_error(s->C, "Ran out of hardware temporaries\n"); + return; + + success:; + } + + /* Rewrite all instructions based on the translation table we built */ + for(struct rc_instruction * inst = s->C->Program.Instructions.Next; + inst != &s->C->Program.Instructions; + inst = inst->Next) { + if (inst->Type == RC_INSTRUCTION_NORMAL) + rewrite_normal_instruction(s, &inst->U.I); + else + rewrite_pair_instruction(s, &inst->U.P); + } +} + +static void alloc_input(void * data, unsigned int input, unsigned int hwreg) +{ + struct regalloc_state * s = data; + + if (!s->Input[input].Used) + return; + + add_live_intervals(s, &s->HwTemporary[hwreg].Used, &s->Input[input].Live); + + s->Input[input].Allocated = 1; + s->Input[input].File = RC_FILE_TEMPORARY; + s->Input[input].Index = hwreg; + +} + +void rc_pair_regalloc(struct r300_fragment_program_compiler *c, unsigned maxtemps) +{ + struct regalloc_state s; + + memset(&s, 0, sizeof(s)); + s.C = &c->Base; + s.NumHwTemporaries = maxtemps; + s.HwTemporary = memory_pool_malloc(&s.C->Pool, maxtemps*sizeof(struct hardware_register)); + memset(s.HwTemporary, 0, maxtemps*sizeof(struct hardware_register)); + + compute_live_intervals(&s); + + c->AllocateHwInputs(c, &alloc_input, &s); + + do_regalloc(&s); +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c new file mode 100644 index 0000000000..df67aafe02 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -0,0 +1,501 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_program_pair.h" + +#include <stdio.h> + +#include "radeon_compiler.h" +#include "radeon_dataflow.h" + + +#define VERBOSE 0 + +#define DBG(...) do { if (VERBOSE) fprintf(stderr, __VA_ARGS__); } while(0) + +struct schedule_instruction { + struct rc_instruction * Instruction; + + /** Next instruction in the linked list of ready instructions. */ + struct schedule_instruction *NextReady; + + /** Values that this instruction reads and writes */ + struct reg_value * WriteValues[4]; + struct reg_value * ReadValues[12]; + unsigned int NumWriteValues:3; + unsigned int NumReadValues:4; + + /** + * Number of (read and write) dependencies that must be resolved before + * this instruction can be scheduled. + */ + unsigned int NumDependencies:5; +}; + + +/** + * Used to keep track of which instructions read a value. + */ +struct reg_value_reader { + struct schedule_instruction *Reader; + struct reg_value_reader *Next; +}; + +/** + * Used to keep track which values are stored in each component of a + * RC_FILE_TEMPORARY. + */ +struct reg_value { + struct schedule_instruction * Writer; + + /** + * Unordered linked list of instructions that read from this value. + * When this value becomes available, we increase all readers' + * dependency count. + */ + struct reg_value_reader *Readers; + + /** + * Number of readers of this value. This is decremented each time + * a reader of the value is committed. + * When the reader cound reaches zero, the dependency count + * of the instruction writing \ref Next is decremented. + */ + unsigned int NumReaders; + + struct reg_value *Next; /**< Pointer to the next value to be written to the same register */ +}; + +struct register_state { + struct reg_value * Values[4]; +}; + +struct schedule_state { + struct radeon_compiler * C; + struct schedule_instruction * Current; + + struct register_state Temporary[RC_REGISTER_MAX_INDEX]; + + /** + * Linked lists of instructions that can be scheduled right now, + * based on which ALU/TEX resources they require. + */ + /*@{*/ + struct schedule_instruction *ReadyFullALU; + struct schedule_instruction *ReadyRGB; + struct schedule_instruction *ReadyAlpha; + struct schedule_instruction *ReadyTEX; + /*@}*/ +}; + +static struct reg_value ** get_reg_valuep(struct schedule_state * s, + rc_register_file file, unsigned int index, unsigned int chan) +{ + if (file != RC_FILE_TEMPORARY) + return 0; + + if (index >= RC_REGISTER_MAX_INDEX) { + rc_error(s->C, "%s: index %i out of bounds\n", __FUNCTION__, index); + return 0; + } + + return &s->Temporary[index].Values[chan]; +} + +static struct reg_value * get_reg_value(struct schedule_state * s, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct reg_value ** pv = get_reg_valuep(s, file, index, chan); + if (!pv) + return 0; + return *pv; +} + +static void add_inst_to_list(struct schedule_instruction ** list, struct schedule_instruction * inst) +{ + inst->NextReady = *list; + *list = inst; +} + +static void instruction_ready(struct schedule_state * s, struct schedule_instruction * sinst) +{ + DBG("%i is now ready\n", sinst->Instruction->IP); + + if (sinst->Instruction->Type == RC_INSTRUCTION_NORMAL) + add_inst_to_list(&s->ReadyTEX, sinst); + else if (sinst->Instruction->U.P.Alpha.Opcode == RC_OPCODE_NOP) + add_inst_to_list(&s->ReadyRGB, sinst); + else if (sinst->Instruction->U.P.RGB.Opcode == RC_OPCODE_NOP) + add_inst_to_list(&s->ReadyAlpha, sinst); + else + add_inst_to_list(&s->ReadyFullALU, sinst); +} + +static void decrease_dependencies(struct schedule_state * s, struct schedule_instruction * sinst) +{ + assert(sinst->NumDependencies > 0); + sinst->NumDependencies--; + if (!sinst->NumDependencies) + instruction_ready(s, sinst); +} + +static void commit_instruction(struct schedule_state * s, struct schedule_instruction * sinst) +{ + DBG("%i: commit\n", sinst->Instruction->IP); + + for(unsigned int i = 0; i < sinst->NumReadValues; ++i) { + struct reg_value * v = sinst->ReadValues[i]; + assert(v->NumReaders > 0); + v->NumReaders--; + if (!v->NumReaders) { + if (v->Next) + decrease_dependencies(s, v->Next->Writer); + } + } + + for(unsigned int i = 0; i < sinst->NumWriteValues; ++i) { + struct reg_value * v = sinst->WriteValues[i]; + if (v->NumReaders) { + for(struct reg_value_reader * r = v->Readers; r; r = r->Next) { + decrease_dependencies(s, r->Reader); + } + } else { + /* This happens in instruction sequences of the type + * OP r.x, ...; + * OP r.x, r.x, ...; + * See also the subtlety in how instructions that both + * read and write the same register are scanned. + */ + if (v->Next) + decrease_dependencies(s, v->Next->Writer); + } + } +} + +/** + * Emit all ready texture instructions in a single block. + * + * Emit as a single block to (hopefully) sample many textures in parallel, + * and to avoid hardware indirections on R300. + */ +static void emit_all_tex(struct schedule_state * s, struct rc_instruction * before) +{ + struct schedule_instruction *readytex; + + assert(s->ReadyTEX); + + /* Don't let the ready list change under us! */ + readytex = s->ReadyTEX; + s->ReadyTEX = 0; + + /* Node marker for R300 */ + struct rc_instruction * inst_begin = rc_insert_new_instruction(s->C, before->Prev); + inst_begin->U.I.Opcode = RC_OPCODE_BEGIN_TEX; + + /* Link texture instructions back in */ + while(readytex) { + struct schedule_instruction * tex = readytex; + readytex = readytex->NextReady; + + rc_insert_instruction(before->Prev, tex->Instruction); + commit_instruction(s, tex); + } +} + + +static int destructive_merge_instructions( + struct rc_pair_instruction * rgb, + struct rc_pair_instruction * alpha) +{ + assert(rgb->Alpha.Opcode == RC_OPCODE_NOP); + assert(alpha->RGB.Opcode == RC_OPCODE_NOP); + + /* Copy alpha args into rgb */ + const struct rc_opcode_info * opcode = rc_get_opcode_info(alpha->Alpha.Opcode); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + unsigned int oldsrc = alpha->Alpha.Arg[arg].Source; + rc_register_file file = 0; + unsigned int index = 0; + + if (alpha->Alpha.Arg[arg].Swizzle < 3) { + srcrgb = 1; + file = alpha->RGB.Src[oldsrc].File; + index = alpha->RGB.Src[oldsrc].Index; + } else if (alpha->Alpha.Arg[arg].Swizzle < 4) { + srcalpha = 1; + file = alpha->Alpha.Src[oldsrc].File; + index = alpha->Alpha.Src[oldsrc].Index; + } + + int source = rc_pair_alloc_source(rgb, srcrgb, srcalpha, file, index); + if (source < 0) + return 0; + + rgb->Alpha.Arg[arg].Source = source; + rgb->Alpha.Arg[arg].Swizzle = alpha->Alpha.Arg[arg].Swizzle; + rgb->Alpha.Arg[arg].Abs = alpha->Alpha.Arg[arg].Abs; + rgb->Alpha.Arg[arg].Negate = alpha->Alpha.Arg[arg].Negate; + } + + /* Copy alpha opcode into rgb */ + rgb->Alpha.Opcode = alpha->Alpha.Opcode; + rgb->Alpha.DestIndex = alpha->Alpha.DestIndex; + rgb->Alpha.WriteMask = alpha->Alpha.WriteMask; + rgb->Alpha.OutputWriteMask = alpha->Alpha.OutputWriteMask; + rgb->Alpha.DepthWriteMask = alpha->Alpha.DepthWriteMask; + rgb->Alpha.Saturate = alpha->Alpha.Saturate; + + /* Merge ALU result writing */ + if (alpha->WriteALUResult) { + if (rgb->WriteALUResult) + return 0; + + rgb->WriteALUResult = alpha->WriteALUResult; + rgb->ALUResultCompare = alpha->ALUResultCompare; + } + + return 1; +} + +/** + * Try to merge the given instructions into the rgb instructions. + * + * Return true on success; on failure, return false, and keep + * the instructions untouched. + */ +static int merge_instructions(struct rc_pair_instruction * rgb, struct rc_pair_instruction * alpha) +{ + struct rc_pair_instruction backup; + + memcpy(&backup, rgb, sizeof(struct rc_pair_instruction)); + + if (destructive_merge_instructions(rgb, alpha)) + return 1; + + memcpy(rgb, &backup, sizeof(struct rc_pair_instruction)); + return 0; +} + + +/** + * Find a good ALU instruction or pair of ALU instruction and emit it. + * + * Prefer emitting full ALU instructions, so that when we reach a point + * where no full ALU instruction can be emitted, we have more candidates + * for RGB/Alpha pairing. + */ +static void emit_one_alu(struct schedule_state *s, struct rc_instruction * before) +{ + struct schedule_instruction * sinst; + + if (s->ReadyFullALU || !(s->ReadyRGB && s->ReadyAlpha)) { + if (s->ReadyFullALU) { + sinst = s->ReadyFullALU; + s->ReadyFullALU = s->ReadyFullALU->NextReady; + } else if (s->ReadyRGB) { + sinst = s->ReadyRGB; + s->ReadyRGB = s->ReadyRGB->NextReady; + } else { + sinst = s->ReadyAlpha; + s->ReadyAlpha = s->ReadyAlpha->NextReady; + } + + rc_insert_instruction(before->Prev, sinst->Instruction); + commit_instruction(s, sinst); + } else { + struct schedule_instruction **prgb; + struct schedule_instruction **palpha; + + /* Some pairings might fail because they require too + * many source slots; try all possible pairings if necessary */ + for(prgb = &s->ReadyRGB; *prgb; prgb = &(*prgb)->NextReady) { + for(palpha = &s->ReadyAlpha; *palpha; palpha = &(*palpha)->NextReady) { + struct schedule_instruction * psirgb = *prgb; + struct schedule_instruction * psialpha = *palpha; + + if (!merge_instructions(&psirgb->Instruction->U.P, &psialpha->Instruction->U.P)) + continue; + + *prgb = (*prgb)->NextReady; + *palpha = (*palpha)->NextReady; + rc_insert_instruction(before->Prev, psirgb->Instruction); + commit_instruction(s, psirgb); + commit_instruction(s, psialpha); + goto success; + } + } + + /* No success in pairing; just take the first RGB instruction */ + sinst = s->ReadyRGB; + s->ReadyRGB = s->ReadyRGB->NextReady; + + rc_insert_instruction(before->Prev, sinst->Instruction); + commit_instruction(s, sinst); + success: ; + } +} + +static void scan_read(void * data, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct schedule_state * s = data; + struct reg_value * v = get_reg_value(s, file, index, chan); + + if (!v) + return; + + if (v->Writer == s->Current) { + /* The instruction reads and writes to a register component. + * In this case, we only want to increment dependencies by one. + */ + return; + } + + DBG("%i: read %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); + + struct reg_value_reader * reader = memory_pool_malloc(&s->C->Pool, sizeof(*reader)); + reader->Reader = s->Current; + reader->Next = v->Readers; + v->Readers = reader; + v->NumReaders++; + + s->Current->NumDependencies++; + + if (s->Current->NumReadValues >= 12) { + rc_error(s->C, "%s: NumReadValues overflow\n", __FUNCTION__); + } else { + s->Current->ReadValues[s->Current->NumReadValues++] = v; + } +} + +static void scan_write(void * data, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct schedule_state * s = data; + struct reg_value ** pv = get_reg_valuep(s, file, index, chan); + + if (!pv) + return; + + DBG("%i: write %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); + + struct reg_value * newv = memory_pool_malloc(&s->C->Pool, sizeof(*newv)); + memset(newv, 0, sizeof(*newv)); + + newv->Writer = s->Current; + + if (*pv) { + (*pv)->Next = newv; + s->Current->NumDependencies++; + } + + *pv = newv; + + if (s->Current->NumWriteValues >= 4) { + rc_error(s->C, "%s: NumWriteValues overflow\n", __FUNCTION__); + } else { + s->Current->WriteValues[s->Current->NumWriteValues++] = newv; + } +} + +static void schedule_block(struct r300_fragment_program_compiler * c, + struct rc_instruction * begin, struct rc_instruction * end) +{ + struct schedule_state s; + + memset(&s, 0, sizeof(s)); + s.C = &c->Base; + + /* Scan instructions for data dependencies */ + unsigned int ip = 0; + for(struct rc_instruction * inst = begin; inst != end; inst = inst->Next) { + s.Current = memory_pool_malloc(&c->Base.Pool, sizeof(*s.Current)); + memset(s.Current, 0, sizeof(struct schedule_instruction)); + + s.Current->Instruction = inst; + inst->IP = ip++; + + DBG("%i: Scanning\n", inst->IP); + + /* The order of things here is subtle and maybe slightly + * counter-intuitive, to account for the case where an + * instruction writes to the same register as it reads + * from. */ + rc_for_all_writes(inst, &scan_write, &s); + rc_for_all_reads(inst, &scan_read, &s); + + DBG("%i: Has %i dependencies\n", inst->IP, s.Current->NumDependencies); + + if (!s.Current->NumDependencies) + instruction_ready(&s, s.Current); + } + + /* Temporarily unlink all instructions */ + begin->Prev->Next = end; + end->Prev = begin->Prev; + + /* Schedule instructions back */ + while(!s.C->Error && + (s.ReadyTEX || s.ReadyRGB || s.ReadyAlpha || s.ReadyFullALU)) { + if (s.ReadyTEX) + emit_all_tex(&s, end); + + while(!s.C->Error && (s.ReadyFullALU || s.ReadyRGB || s.ReadyAlpha)) + emit_one_alu(&s, end); + } +} + +static int is_controlflow(struct rc_instruction * inst) +{ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + return opcode->IsFlowControl; + } + return 0; +} + +void rc_pair_schedule(struct r300_fragment_program_compiler *c) +{ + struct rc_instruction * inst = c->Base.Program.Instructions.Next; + while(inst != &c->Base.Program.Instructions) { + if (is_controlflow(inst)) { + inst = inst->Next; + continue; + } + + struct rc_instruction * first = inst; + + while(inst != &c->Base.Program.Instructions && !is_controlflow(inst)) + inst = inst->Next; + + DBG("Schedule one block\n"); + schedule_block(c, first, inst); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c new file mode 100644 index 0000000000..7211768272 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c @@ -0,0 +1,253 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_program_pair.h" + +#include "radeon_compiler.h" + + +/** + * Finally rewrite ADD, MOV, MUL as the appropriate native instruction + * and reverse the order of arguments for CMP. + */ +static void final_rewrite(struct rc_sub_instruction *inst) +{ + struct rc_src_register tmp; + + switch(inst->Opcode) { + case RC_OPCODE_ADD: + inst->SrcReg[2] = inst->SrcReg[1]; + inst->SrcReg[1].File = RC_FILE_NONE; + inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; + inst->SrcReg[1].Negate = RC_MASK_NONE; + inst->Opcode = RC_OPCODE_MAD; + break; + case RC_OPCODE_CMP: + tmp = inst->SrcReg[2]; + inst->SrcReg[2] = inst->SrcReg[0]; + inst->SrcReg[0] = tmp; + break; + case RC_OPCODE_MOV: + /* AMD say we should use CMP. + * However, when we transform + * KIL -r0; + * into + * CMP tmp, -r0, -r0, 0; + * KIL tmp; + * we get incorrect behaviour on R500 when r0 == 0.0. + * It appears that the R500 KIL hardware treats -0.0 as less + * than zero. + */ + inst->SrcReg[1].File = RC_FILE_NONE; + inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; + inst->SrcReg[2].File = RC_FILE_NONE; + inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; + inst->Opcode = RC_OPCODE_MAD; + break; + case RC_OPCODE_MUL: + inst->SrcReg[2].File = RC_FILE_NONE; + inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; + inst->Opcode = RC_OPCODE_MAD; + break; + default: + /* nothing to do */ + break; + } +} + + +/** + * Classify an instruction according to which ALUs etc. it needs + */ +static void classify_instruction(struct rc_sub_instruction * inst, + int * needrgb, int * needalpha, int * istranscendent) +{ + *needrgb = (inst->DstReg.WriteMask & RC_MASK_XYZ) ? 1 : 0; + *needalpha = (inst->DstReg.WriteMask & RC_MASK_W) ? 1 : 0; + *istranscendent = 0; + + if (inst->WriteALUResult == RC_ALURESULT_X) + *needrgb = 1; + else if (inst->WriteALUResult == RC_ALURESULT_W) + *needalpha = 1; + + switch(inst->Opcode) { + case RC_OPCODE_ADD: + case RC_OPCODE_CMP: + case RC_OPCODE_DDX: + case RC_OPCODE_DDY: + case RC_OPCODE_FRC: + case RC_OPCODE_MAD: + case RC_OPCODE_MAX: + case RC_OPCODE_MIN: + case RC_OPCODE_MOV: + case RC_OPCODE_MUL: + break; + case RC_OPCODE_COS: + case RC_OPCODE_EX2: + case RC_OPCODE_LG2: + case RC_OPCODE_RCP: + case RC_OPCODE_RSQ: + case RC_OPCODE_SIN: + *istranscendent = 1; + *needalpha = 1; + break; + case RC_OPCODE_DP4: + *needalpha = 1; + /* fall through */ + case RC_OPCODE_DP3: + *needrgb = 1; + break; + default: + break; + } +} + + +/** + * Fill the given ALU instruction's opcodes and source operands into the given pair, + * if possible. + */ +static void set_pair_instruction(struct r300_fragment_program_compiler *c, + struct rc_pair_instruction * pair, + struct rc_sub_instruction * inst) +{ + memset(pair, 0, sizeof(struct rc_pair_instruction)); + + int needrgb, needalpha, istranscendent; + classify_instruction(inst, &needrgb, &needalpha, &istranscendent); + + if (needrgb) { + if (istranscendent) + pair->RGB.Opcode = RC_OPCODE_REPL_ALPHA; + else + pair->RGB.Opcode = inst->Opcode; + if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) + pair->RGB.Saturate = 1; + } + if (needalpha) { + pair->Alpha.Opcode = inst->Opcode; + if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) + pair->Alpha.Saturate = 1; + } + + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + int nargs = opcode->NumSrcRegs; + int i; + + /* Special case for DDX/DDY (MDH/MDV). */ + if (inst->Opcode == RC_OPCODE_DDX || inst->Opcode == RC_OPCODE_DDY) { + nargs++; + } + + for(i = 0; i < opcode->NumSrcRegs; ++i) { + int source; + if (needrgb && !istranscendent) { + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + int j; + for(j = 0; j < 3; ++j) { + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); + if (swz < 3) + srcrgb = 1; + else if (swz < 4) + srcalpha = 1; + } + source = rc_pair_alloc_source(pair, srcrgb, srcalpha, + inst->SrcReg[i].File, inst->SrcReg[i].Index); + pair->RGB.Arg[i].Source = source; + pair->RGB.Arg[i].Swizzle = inst->SrcReg[i].Swizzle & 0x1ff; + pair->RGB.Arg[i].Abs = inst->SrcReg[i].Abs; + pair->RGB.Arg[i].Negate = !!(inst->SrcReg[i].Negate & (RC_MASK_X | RC_MASK_Y | RC_MASK_Z)); + } + if (needalpha) { + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, istranscendent ? 0 : 3); + if (swz < 3) + srcrgb = 1; + else if (swz < 4) + srcalpha = 1; + source = rc_pair_alloc_source(pair, srcrgb, srcalpha, + inst->SrcReg[i].File, inst->SrcReg[i].Index); + pair->Alpha.Arg[i].Source = source; + pair->Alpha.Arg[i].Swizzle = swz; + pair->Alpha.Arg[i].Abs = inst->SrcReg[i].Abs; + pair->Alpha.Arg[i].Negate = !!(inst->SrcReg[i].Negate & RC_MASK_W); + } + } + + /* Destination handling */ + if (inst->DstReg.File == RC_FILE_OUTPUT) { + if (inst->DstReg.Index == c->OutputColor) { + pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; + pair->Alpha.OutputWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); + } else if (inst->DstReg.Index == c->OutputDepth) { + pair->Alpha.DepthWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); + } + } else { + if (needrgb) { + pair->RGB.DestIndex = inst->DstReg.Index; + pair->RGB.WriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; + } + if (needalpha) { + pair->Alpha.DestIndex = inst->DstReg.Index; + pair->Alpha.WriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); + } + } + + if (inst->WriteALUResult) { + pair->WriteALUResult = inst->WriteALUResult; + pair->ALUResultCompare = inst->ALUResultCompare; + } +} + + +/** + * Translate all ALU instructions into corresponding pair instructions, + * performing no other changes. + */ +void rc_pair_translate(struct r300_fragment_program_compiler *c) +{ + for(struct rc_instruction * inst = c->Base.Program.Instructions.Next; + inst != &c->Base.Program.Instructions; + inst = inst->Next) { + if (inst->Type != RC_INSTRUCTION_NORMAL) + continue; + + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + + if (opcode->HasTexture || opcode->IsFlowControl || opcode->Opcode == RC_OPCODE_KIL) + continue; + + struct rc_sub_instruction copy = inst->U.I; + + final_rewrite(©); + inst->Type = RC_INSTRUCTION_PAIR; + set_pair_instruction(c, &inst->U.P, ©); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index b636f90a96..0dbc5380bb 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -27,9 +27,9 @@ #include "radeon_program.h" +#include <stdio.h> + #include "radeon_compiler.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" /** @@ -69,37 +69,57 @@ void radeonLocalTransform( } } +/** + * Left multiplication of a register with a swizzle + */ +struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg) +{ + struct rc_src_register tmp = srcreg; + int i; + tmp.Swizzle = 0; + tmp.Negate = 0; + for(i = 0; i < 4; ++i) { + rc_swizzle swz = GET_SWZ(swizzle, i); + if (swz < 4) { + tmp.Swizzle |= GET_SWZ(srcreg.Swizzle, swz) << (i*3); + tmp.Negate |= GET_BIT(srcreg.Negate, swz) << i; + } else { + tmp.Swizzle |= swz << (i*3); + } + } + return tmp; +} -GLint rc_find_free_temporary(struct radeon_compiler * c) +unsigned int rc_find_free_temporary(struct radeon_compiler * c) { - GLboolean used[MAX_PROGRAM_TEMPS]; - GLuint i; + char used[RC_REGISTER_MAX_INDEX]; + unsigned int i; memset(used, 0, sizeof(used)); for (struct rc_instruction * rcinst = c->Program.Instructions.Next; rcinst != &c->Program.Instructions; rcinst = rcinst->Next) { - const struct prog_instruction *inst = &rcinst->I; - const GLuint nsrc = _mesa_num_inst_src_regs(inst->Opcode); - const GLuint ndst = _mesa_num_inst_dst_regs(inst->Opcode); - GLuint k; - - for (k = 0; k < nsrc; k++) { - if (inst->SrcReg[k].File == PROGRAM_TEMPORARY) - used[inst->SrcReg[k].Index] = GL_TRUE; + const struct rc_sub_instruction *inst = &rcinst->U.I; + const struct rc_opcode_info *opcode = rc_get_opcode_info(inst->Opcode); + unsigned int k; + + for (k = 0; k < opcode->NumSrcRegs; k++) { + if (inst->SrcReg[k].File == RC_FILE_TEMPORARY) + used[inst->SrcReg[k].Index] = 1; } - if (ndst) { - if (inst->DstReg.File == PROGRAM_TEMPORARY) - used[inst->DstReg.Index] = GL_TRUE; + if (opcode->HasDstReg) { + if (inst->DstReg.File == RC_FILE_TEMPORARY) + used[inst->DstReg.Index] = 1; } } - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { + for (i = 0; i < RC_REGISTER_MAX_INDEX; i++) { if (!used[i]) return i; } - return -1; + rc_error(c, "Ran out of temporary registers\n"); + return 0; } @@ -107,24 +127,31 @@ struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c) { struct rc_instruction * inst = memory_pool_malloc(&c->Pool, sizeof(struct rc_instruction)); - inst->Prev = 0; - inst->Next = 0; + memset(inst, 0, sizeof(struct rc_instruction)); - _mesa_init_instructions(&inst->I, 1); + inst->U.I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_XYZW; return inst; } - -struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after) +void rc_insert_instruction(struct rc_instruction * after, struct rc_instruction * inst) { - struct rc_instruction * inst = rc_alloc_instruction(c); - inst->Prev = after; inst->Next = after->Next; inst->Prev->Next = inst; inst->Next->Prev = inst; +} + +struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after) +{ + struct rc_instruction * inst = rc_alloc_instruction(c); + + rc_insert_instruction(after, inst); return inst; } @@ -135,76 +162,20 @@ void rc_remove_instruction(struct rc_instruction * inst) inst->Next->Prev = inst->Prev; } - -void rc_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program) -{ - struct prog_instruction *source; - unsigned int i; - - for(source = program->Instructions; source->Opcode != OPCODE_END; ++source) { - struct rc_instruction * dest = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - dest->I = *source; - } - - c->Program.ShadowSamplers = program->ShadowSamplers; - c->Program.InputsRead = program->InputsRead; - c->Program.OutputsWritten = program->OutputsWritten; - - int isNVProgram = 0; - - if (program->Target == GL_VERTEX_PROGRAM_ARB) { - struct gl_vertex_program * vp = (struct gl_vertex_program *) program; - isNVProgram = vp->IsNVProgram; - } - - if (isNVProgram) { - /* NV_vertex_program has a fixed-sized constant environment. - * This could be handled more efficiently for programs that - * do not use relative addressing. - */ - for(i = 0; i < 96; ++i) { - struct rc_constant constant; - - constant.Type = RC_CONSTANT_EXTERNAL; - constant.Size = 4; - constant.u.External = i; - - rc_constants_add(&c->Program.Constants, &constant); - } - } else { - for(i = 0; i < program->Parameters->NumParameters; ++i) { - struct rc_constant constant; - - constant.Type = RC_CONSTANT_EXTERNAL; - constant.Size = 4; - constant.u.External = i; - - rc_constants_add(&c->Program.Constants, &constant); - } - } -} - - /** - * Print program to stderr, default options. + * Return the number of instructions in the program. */ -void rc_print_program(const struct rc_program *prog) +unsigned int rc_recompute_ips(struct radeon_compiler * c) { - GLuint indent = 0; - GLuint linenum = 1; - struct rc_instruction *inst; - - fprintf(stderr, "# Radeon Compiler Program\n"); + unsigned int ip = 0; - for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { - fprintf(stderr, "%3d: ", linenum); + for(struct rc_instruction * inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; + inst = inst->Next) { + inst->IP = ip++; + } - /* Massive hack: We rely on the fact that the printers do not actually - * use the gl_program argument (last argument) in debug mode */ - indent = _mesa_fprint_instruction_opt( - stderr, &inst->I, - indent, PROG_PRINT_DEBUG, 0); + c->Program.Instructions.IP = 0xcafedead; - linenum++; - } + return ip; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index 561958608c..33db3ea0ff 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -28,37 +28,144 @@ #ifndef __RADEON_PROGRAM_H_ #define __RADEON_PROGRAM_H_ -#include "main/glheader.h" -#include "main/macros.h" -#include "main/enums.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" +#include <stdint.h> +#include <string.h> + +#include "radeon_opcodes.h" +#include "radeon_code.h" +#include "radeon_program_constants.h" +#include "radeon_program_pair.h" struct radeon_compiler; -struct rc_instruction; -struct rc_program; -enum { - PROGRAM_BUILTIN = PROGRAM_FILE_MAX /**< not a real register, but a special swizzle constant */ +struct rc_src_register { + rc_register_file File:3; + + /** Negative values may be used for relative addressing. */ + signed int Index:(RC_REGISTER_INDEX_BITS+1); + unsigned int RelAddr:1; + + unsigned int Swizzle:12; + + /** Take the component-wise absolute value */ + unsigned int Abs:1; + + /** Post-Abs negation. */ + unsigned int Negate:4; +}; + +struct rc_dst_register { + rc_register_file File:3; + + /** Negative values may be used for relative addressing. */ + signed int Index:(RC_REGISTER_INDEX_BITS+1); + unsigned int RelAddr:1; + + unsigned int WriteMask:4; +}; + +/** + * Instructions are maintained by the compiler in a doubly linked list + * of these structures. + * + * This instruction format is intended to be expanded for hardware-specific + * trickery. At different stages of compilation, a different set of + * instruction types may be valid. + */ +struct rc_sub_instruction { + struct rc_src_register SrcReg[3]; + struct rc_dst_register DstReg; + + /** + * Opcode of this instruction, according to \ref rc_opcode enums. + */ + rc_opcode Opcode:8; + + /** + * Saturate each value of the result to the range [0,1] or [-1,1], + * according to \ref rc_saturate_mode enums. + */ + rc_saturate_mode SaturateMode:2; + + /** + * Writing to the special register RC_SPECIAL_ALU_RESULT + */ + /*@{*/ + rc_write_aluresult WriteALUResult:2; + rc_compare_func ALUResultCompare:3; + /*@}*/ + + /** + * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. + */ + /*@{*/ + /** Source texture unit. */ + unsigned int TexSrcUnit:5; + + /** Source texture target, one of the \ref rc_texture_target enums */ + rc_texture_target TexSrcTarget:3; + + /** True if tex instruction should do shadow comparison */ + unsigned int TexShadow:1; + /*@}*/ +}; + +typedef enum { + RC_INSTRUCTION_NORMAL = 0, + RC_INSTRUCTION_PAIR +} rc_instruction_type; + +struct rc_instruction { + struct rc_instruction * Prev; + struct rc_instruction * Next; + + rc_instruction_type Type; + union { + struct rc_sub_instruction I; + struct rc_pair_instruction P; + } U; + + /** + * Warning: IPs are not stable. If you want to use them, + * you need to recompute them at the beginning of each pass + * using \ref rc_recompute_ips + */ + unsigned int IP; +}; + +struct rc_program { + /** + * Instructions.Next points to the first instruction, + * Instructions.Prev points to the last instruction. + */ + struct rc_instruction Instructions; + + /* Long term, we should probably remove InputsRead & OutputsWritten, + * since updating dependent state can be fragile, and they aren't + * actually used very often. */ + uint32_t InputsRead; + uint32_t OutputsWritten; + uint32_t ShadowSamplers; /**< Texture units used for shadow sampling. */ + + struct rc_constant_list Constants; }; enum { - OPCODE_REPL_ALPHA = MAX_OPCODE /**< used in paired instructions */ + OPCODE_REPL_ALPHA = MAX_RC_OPCODE /**< used in paired instructions */ }; -#define SWIZZLE_0000 MAKE_SWIZZLE4(SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO) -#define SWIZZLE_1111 MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE) -static inline GLuint get_swz(GLuint swz, GLuint idx) +static inline rc_swizzle get_swz(unsigned int swz, rc_swizzle idx) { if (idx & 0x4) return idx; return GET_SWZ(swz, idx); } -static inline GLuint combine_swizzles4(GLuint src, GLuint swz_x, GLuint swz_y, GLuint swz_z, GLuint swz_w) +static inline unsigned int combine_swizzles4(unsigned int src, + rc_swizzle swz_x, rc_swizzle swz_y, rc_swizzle swz_z, rc_swizzle swz_w) { - GLuint ret = 0; + unsigned int ret = 0; ret |= get_swz(src, swz_x); ret |= get_swz(src, swz_y) << 3; @@ -68,22 +175,24 @@ static inline GLuint combine_swizzles4(GLuint src, GLuint swz_x, GLuint swz_y, G return ret; } -static inline GLuint combine_swizzles(GLuint src, GLuint swz) +static inline unsigned int combine_swizzles(unsigned int src, unsigned int swz) { - GLuint ret = 0; + unsigned int ret = 0; - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_X)); - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_Y)) << 3; - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_Z)) << 6; - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_W)) << 9; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_X)); + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Y)) << 3; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Z)) << 6; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_W)) << 9; return ret; } -static INLINE void reset_srcreg(struct prog_src_register* reg) +struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg); + +static inline void reset_srcreg(struct rc_src_register* reg) { - _mesa_bzero(reg, sizeof(*reg)); - reg->Swizzle = SWIZZLE_NOOP; + memset(reg, 0, sizeof(reg)); + reg->Swizzle = RC_SWIZZLE_XYZW; } @@ -92,13 +201,13 @@ static INLINE void reset_srcreg(struct prog_src_register* reg) * * The function will be called once for each instruction. * It has to either emit the appropriate transformed code for the instruction - * and return GL_TRUE, or return GL_FALSE if it doesn't understand the + * and return true, or return false if it doesn't understand the * instruction. * * The function gets passed the userData as last parameter. */ struct radeon_program_transformation { - GLboolean (*function)( + int (*function)( struct radeon_compiler*, struct rc_instruction*, void*); @@ -110,12 +219,15 @@ void radeonLocalTransform( int num_transformations, struct radeon_program_transformation* transformations); -GLint rc_find_free_temporary(struct radeon_compiler * c); +unsigned int rc_find_free_temporary(struct radeon_compiler * c); struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c); struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after); +void rc_insert_instruction(struct rc_instruction * after, struct rc_instruction * inst); void rc_remove_instruction(struct rc_instruction * inst); +unsigned int rc_recompute_ips(struct radeon_compiler * c); + void rc_print_program(const struct rc_program *prog); #endif diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index f23ce301ca..0326d25233 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -40,175 +40,164 @@ static struct rc_instruction *emit1( struct radeon_compiler * c, struct rc_instruction * after, - gl_inst_opcode Opcode, GLuint Saturate, struct prog_dst_register DstReg, - struct prog_src_register SrcReg) + rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg, + struct rc_src_register SrcReg) { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); - fpi->I.Opcode = Opcode; - fpi->I.SaturateMode = Saturate; - fpi->I.DstReg = DstReg; - fpi->I.SrcReg[0] = SrcReg; + fpi->U.I.Opcode = Opcode; + fpi->U.I.SaturateMode = Saturate; + fpi->U.I.DstReg = DstReg; + fpi->U.I.SrcReg[0] = SrcReg; return fpi; } static struct rc_instruction *emit2( struct radeon_compiler * c, struct rc_instruction * after, - gl_inst_opcode Opcode, GLuint Saturate, struct prog_dst_register DstReg, - struct prog_src_register SrcReg0, struct prog_src_register SrcReg1) + rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg, + struct rc_src_register SrcReg0, struct rc_src_register SrcReg1) { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); - fpi->I.Opcode = Opcode; - fpi->I.SaturateMode = Saturate; - fpi->I.DstReg = DstReg; - fpi->I.SrcReg[0] = SrcReg0; - fpi->I.SrcReg[1] = SrcReg1; + fpi->U.I.Opcode = Opcode; + fpi->U.I.SaturateMode = Saturate; + fpi->U.I.DstReg = DstReg; + fpi->U.I.SrcReg[0] = SrcReg0; + fpi->U.I.SrcReg[1] = SrcReg1; return fpi; } static struct rc_instruction *emit3( struct radeon_compiler * c, struct rc_instruction * after, - gl_inst_opcode Opcode, GLuint Saturate, struct prog_dst_register DstReg, - struct prog_src_register SrcReg0, struct prog_src_register SrcReg1, - struct prog_src_register SrcReg2) + rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg, + struct rc_src_register SrcReg0, struct rc_src_register SrcReg1, + struct rc_src_register SrcReg2) { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); - fpi->I.Opcode = Opcode; - fpi->I.SaturateMode = Saturate; - fpi->I.DstReg = DstReg; - fpi->I.SrcReg[0] = SrcReg0; - fpi->I.SrcReg[1] = SrcReg1; - fpi->I.SrcReg[2] = SrcReg2; + fpi->U.I.Opcode = Opcode; + fpi->U.I.SaturateMode = Saturate; + fpi->U.I.DstReg = DstReg; + fpi->U.I.SrcReg[0] = SrcReg0; + fpi->U.I.SrcReg[1] = SrcReg1; + fpi->U.I.SrcReg[2] = SrcReg2; return fpi; } -static struct prog_dst_register dstreg(int file, int index) +static struct rc_dst_register dstreg(int file, int index) { - struct prog_dst_register dst; + struct rc_dst_register dst; dst.File = file; dst.Index = index; - dst.WriteMask = WRITEMASK_XYZW; - dst.CondMask = COND_TR; + dst.WriteMask = RC_MASK_XYZW; dst.RelAddr = 0; - dst.CondSwizzle = SWIZZLE_NOOP; - dst.CondSrc = 0; - dst.pad = 0; return dst; } -static struct prog_dst_register dstregtmpmask(int index, int mask) +static struct rc_dst_register dstregtmpmask(int index, int mask) { - struct prog_dst_register dst = {0}; - dst.File = PROGRAM_TEMPORARY; + struct rc_dst_register dst = {0}; + dst.File = RC_FILE_TEMPORARY; dst.Index = index; dst.WriteMask = mask; dst.RelAddr = 0; - dst.CondMask = COND_TR; - dst.CondSwizzle = SWIZZLE_NOOP; - dst.CondSrc = 0; - dst.pad = 0; return dst; } -static const struct prog_src_register builtin_zero = { - .File = PROGRAM_BUILTIN, +static const struct rc_src_register builtin_zero = { + .File = RC_FILE_NONE, .Index = 0, - .Swizzle = SWIZZLE_0000 + .Swizzle = RC_SWIZZLE_0000 }; -static const struct prog_src_register builtin_one = { - .File = PROGRAM_BUILTIN, +static const struct rc_src_register builtin_one = { + .File = RC_FILE_NONE, .Index = 0, - .Swizzle = SWIZZLE_1111 + .Swizzle = RC_SWIZZLE_1111 }; -static const struct prog_src_register srcreg_undefined = { - .File = PROGRAM_UNDEFINED, +static const struct rc_src_register srcreg_undefined = { + .File = RC_FILE_NONE, .Index = 0, - .Swizzle = SWIZZLE_NOOP + .Swizzle = RC_SWIZZLE_XYZW }; -static struct prog_src_register srcreg(int file, int index) +static struct rc_src_register srcreg(int file, int index) { - struct prog_src_register src = srcreg_undefined; + struct rc_src_register src = srcreg_undefined; src.File = file; src.Index = index; return src; } -static struct prog_src_register srcregswz(int file, int index, int swz) +static struct rc_src_register srcregswz(int file, int index, int swz) { - struct prog_src_register src = srcreg_undefined; + struct rc_src_register src = srcreg_undefined; src.File = file; src.Index = index; src.Swizzle = swz; return src; } -static struct prog_src_register absolute(struct prog_src_register reg) +static struct rc_src_register absolute(struct rc_src_register reg) { - struct prog_src_register newreg = reg; + struct rc_src_register newreg = reg; newreg.Abs = 1; - newreg.Negate = NEGATE_NONE; + newreg.Negate = RC_MASK_NONE; return newreg; } -static struct prog_src_register negate(struct prog_src_register reg) +static struct rc_src_register negate(struct rc_src_register reg) { - struct prog_src_register newreg = reg; - newreg.Negate = newreg.Negate ^ NEGATE_XYZW; + struct rc_src_register newreg = reg; + newreg.Negate = newreg.Negate ^ RC_MASK_XYZW; return newreg; } -static struct prog_src_register swizzle(struct prog_src_register reg, GLuint x, GLuint y, GLuint z, GLuint w) +static struct rc_src_register swizzle(struct rc_src_register reg, + rc_swizzle x, rc_swizzle y, rc_swizzle z, rc_swizzle w) { - struct prog_src_register swizzled = reg; - swizzled.Swizzle = MAKE_SWIZZLE4( - x >= 4 ? x : GET_SWZ(reg.Swizzle, x), - y >= 4 ? y : GET_SWZ(reg.Swizzle, y), - z >= 4 ? z : GET_SWZ(reg.Swizzle, z), - w >= 4 ? w : GET_SWZ(reg.Swizzle, w)); + struct rc_src_register swizzled = reg; + swizzled.Swizzle = combine_swizzles4(reg.Swizzle, x, y, z, w); return swizzled; } -static struct prog_src_register scalar(struct prog_src_register reg) +static struct rc_src_register scalar(struct rc_src_register reg) { - return swizzle(reg, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X); + return swizzle(reg, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X); } static void transform_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { - struct prog_src_register src = inst->I.SrcReg[0]; + struct rc_src_register src = inst->U.I.SrcReg[0]; src.Abs = 1; - src.Negate = NEGATE_NONE; - emit1(c, inst->Prev, OPCODE_MOV, inst->I.SaturateMode, inst->I.DstReg, src); + src.Negate = RC_MASK_NONE; + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, inst->U.I.DstReg, src); rc_remove_instruction(inst); } static void transform_DP3(struct radeon_compiler* c, struct rc_instruction* inst) { - struct prog_src_register src0 = inst->I.SrcReg[0]; - struct prog_src_register src1 = inst->I.SrcReg[1]; - src0.Negate &= ~NEGATE_W; + struct rc_src_register src0 = inst->U.I.SrcReg[0]; + struct rc_src_register src1 = inst->U.I.SrcReg[1]; + src0.Negate &= ~RC_MASK_W; src0.Swizzle &= ~(7 << (3 * 3)); - src0.Swizzle |= SWIZZLE_ZERO << (3 * 3); - src1.Negate &= ~NEGATE_W; + src0.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3); + src1.Negate &= ~RC_MASK_W; src1.Swizzle &= ~(7 << (3 * 3)); - src1.Swizzle |= SWIZZLE_ZERO << (3 * 3); - emit2(c, inst->Prev, OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, src1); + src1.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3); + emit2(c, inst->Prev, RC_OPCODE_DP4, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, src1); rc_remove_instruction(inst); } static void transform_DPH(struct radeon_compiler* c, struct rc_instruction* inst) { - struct prog_src_register src0 = inst->I.SrcReg[0]; - src0.Negate &= ~NEGATE_W; + struct rc_src_register src0 = inst->U.I.SrcReg[0]; + src0.Negate &= ~RC_MASK_W; src0.Swizzle &= ~(7 << (3 * 3)); - src0.Swizzle |= SWIZZLE_ONE << (3 * 3); - emit2(c, inst->Prev, OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, inst->I.SrcReg[1]); + src0.Swizzle |= RC_SWIZZLE_ONE << (3 * 3); + emit2(c, inst->Prev, RC_OPCODE_DP4, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, inst->U.I.SrcReg[1]); rc_remove_instruction(inst); } @@ -219,9 +208,9 @@ static void transform_DPH(struct radeon_compiler* c, static void transform_DST(struct radeon_compiler* c, struct rc_instruction* inst) { - emit2(c, inst->Prev, OPCODE_MUL, inst->I.SaturateMode, inst->I.DstReg, - swizzle(inst->I.SrcReg[0], SWIZZLE_ONE, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE), - swizzle(inst->I.SrcReg[1], SWIZZLE_ONE, SWIZZLE_Y, SWIZZLE_ONE, SWIZZLE_W)); + emit2(c, inst->Prev, RC_OPCODE_MUL, inst->U.I.SaturateMode, inst->U.I.DstReg, + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ONE), + swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_ONE, RC_SWIZZLE_W)); rc_remove_instruction(inst); } @@ -229,9 +218,9 @@ static void transform_FLR(struct radeon_compiler* c, struct rc_instruction* inst) { int tempreg = rc_find_free_temporary(c); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[0]); - emit2(c, inst->Prev, OPCODE_ADD, inst->I.SaturateMode, inst->I.DstReg, - inst->I.SrcReg[0], negate(srcreg(PROGRAM_TEMPORARY, tempreg))); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0]); + emit2(c, inst->Prev, RC_OPCODE_ADD, inst->U.I.SaturateMode, inst->U.I.DstReg, + inst->U.I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, tempreg))); rc_remove_instruction(inst); } @@ -256,64 +245,64 @@ static void transform_FLR(struct radeon_compiler* c, static void transform_LIT(struct radeon_compiler* c, struct rc_instruction* inst) { - GLuint constant; - GLuint constant_swizzle; - GLuint temp; - struct prog_src_register srctemp; + unsigned int constant; + unsigned int constant_swizzle; + unsigned int temp; + struct rc_src_register srctemp; constant = rc_constants_add_immediate_scalar(&c->Program.Constants, -127.999999, &constant_swizzle); - if (inst->I.DstReg.WriteMask != WRITEMASK_XYZW || inst->I.DstReg.File != PROGRAM_TEMPORARY) { + if (inst->U.I.DstReg.WriteMask != RC_MASK_XYZW || inst->U.I.DstReg.File != RC_FILE_TEMPORARY) { struct rc_instruction * inst_mov; inst_mov = emit1(c, inst, - OPCODE_MOV, 0, inst->I.DstReg, - srcreg(PROGRAM_TEMPORARY, rc_find_free_temporary(c))); + RC_OPCODE_MOV, 0, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, rc_find_free_temporary(c))); - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; } - temp = inst->I.DstReg.Index; - srctemp = srcreg(PROGRAM_TEMPORARY, temp); + temp = inst->U.I.DstReg.Index; + srctemp = srcreg(RC_FILE_TEMPORARY, temp); // tmp.x = max(0.0, Src.x); // tmp.y = max(0.0, Src.y); // tmp.w = clamp(Src.z, -128+eps, 128-eps); - emit2(c, inst->Prev, OPCODE_MAX, 0, - dstregtmpmask(temp, WRITEMASK_XYW), - inst->I.SrcReg[0], - swizzle(srcreg(PROGRAM_CONSTANT, constant), - SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO, constant_swizzle&3)); - emit2(c, inst->Prev, OPCODE_MIN, 0, - dstregtmpmask(temp, WRITEMASK_Z), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(srcregswz(PROGRAM_CONSTANT, constant, constant_swizzle))); + emit2(c, inst->Prev, RC_OPCODE_MAX, 0, + dstregtmpmask(temp, RC_MASK_XYW), + inst->U.I.SrcReg[0], + swizzle(srcreg(RC_FILE_CONSTANT, constant), + RC_SWIZZLE_ZERO, RC_SWIZZLE_ZERO, RC_SWIZZLE_ZERO, constant_swizzle&3)); + emit2(c, inst->Prev, RC_OPCODE_MIN, 0, + dstregtmpmask(temp, RC_MASK_Z), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle))); // tmp.w = Pow(tmp.y, tmp.w) - emit1(c, inst->Prev, OPCODE_LG2, 0, - dstregtmpmask(temp, WRITEMASK_W), - swizzle(srctemp, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y)); - emit2(c, inst->Prev, OPCODE_MUL, 0, - dstregtmpmask(temp, WRITEMASK_W), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srctemp, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z)); - emit1(c, inst->Prev, OPCODE_EX2, 0, - dstregtmpmask(temp, WRITEMASK_W), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)); + emit1(c, inst->Prev, RC_OPCODE_LG2, 0, + dstregtmpmask(temp, RC_MASK_W), + swizzle(srctemp, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y)); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, + dstregtmpmask(temp, RC_MASK_W), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srctemp, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z)); + emit1(c, inst->Prev, RC_OPCODE_EX2, 0, + dstregtmpmask(temp, RC_MASK_W), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); // tmp.z = (tmp.x > 0) ? tmp.w : 0.0 - emit3(c, inst->Prev, OPCODE_CMP, inst->I.SaturateMode, - dstregtmpmask(temp, WRITEMASK_Z), - negate(swizzle(srctemp, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, + dstregtmpmask(temp, RC_MASK_Z), + negate(swizzle(srctemp, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), builtin_zero); // tmp.x, tmp.y, tmp.w = 1.0, tmp.x, 1.0 - emit1(c, inst->Prev, OPCODE_MOV, inst->I.SaturateMode, - dstregtmpmask(temp, WRITEMASK_XYW), - swizzle(srctemp, SWIZZLE_ONE, SWIZZLE_X, SWIZZLE_ONE, SWIZZLE_ONE)); + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, + dstregtmpmask(temp, RC_MASK_XYW), + swizzle(srctemp, RC_SWIZZLE_ONE, RC_SWIZZLE_X, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE)); rc_remove_instruction(inst); } @@ -323,12 +312,12 @@ static void transform_LRP(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_ADD, 0, - dstreg(PROGRAM_TEMPORARY, tempreg), - inst->I.SrcReg[1], negate(inst->I.SrcReg[2])); - emit3(c, inst->Prev, OPCODE_MAD, inst->I.SaturateMode, - inst->I.DstReg, - inst->I.SrcReg[0], srcreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[2]); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, + dstreg(RC_FILE_TEMPORARY, tempreg), + inst->U.I.SrcReg[1], negate(inst->U.I.SrcReg[2])); + emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, + inst->U.I.DstReg, + inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[2]); rc_remove_instruction(inst); } @@ -337,14 +326,14 @@ static void transform_POW(struct radeon_compiler* c, struct rc_instruction* inst) { int tempreg = rc_find_free_temporary(c); - struct prog_dst_register tempdst = dstreg(PROGRAM_TEMPORARY, tempreg); - struct prog_src_register tempsrc = srcreg(PROGRAM_TEMPORARY, tempreg); - tempdst.WriteMask = WRITEMASK_W; - tempsrc.Swizzle = SWIZZLE_WWWW; + struct rc_dst_register tempdst = dstreg(RC_FILE_TEMPORARY, tempreg); + struct rc_src_register tempsrc = srcreg(RC_FILE_TEMPORARY, tempreg); + tempdst.WriteMask = RC_MASK_W; + tempsrc.Swizzle = RC_SWIZZLE_WWWW; - emit1(c, inst->Prev, OPCODE_LG2, 0, tempdst, scalar(inst->I.SrcReg[0])); - emit2(c, inst->Prev, OPCODE_MUL, 0, tempdst, tempsrc, scalar(inst->I.SrcReg[1])); - emit1(c, inst->Prev, OPCODE_EX2, inst->I.SaturateMode, inst->I.DstReg, tempsrc); + emit1(c, inst->Prev, RC_OPCODE_LG2, 0, tempdst, scalar(inst->U.I.SrcReg[0])); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, tempdst, tempsrc, scalar(inst->U.I.SrcReg[1])); + emit1(c, inst->Prev, RC_OPCODE_EX2, inst->U.I.SaturateMode, inst->U.I.DstReg, tempsrc); rc_remove_instruction(inst); } @@ -352,7 +341,26 @@ static void transform_POW(struct radeon_compiler* c, static void transform_RSQ(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.SrcReg[0] = absolute(inst->I.SrcReg[0]); + inst->U.I.SrcReg[0] = absolute(inst->U.I.SrcReg[0]); +} + +static void transform_SEQ(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + negate(absolute(srcreg(RC_FILE_TEMPORARY, tempreg))), builtin_zero, builtin_one); + + rc_remove_instruction(inst); +} + +static void transform_SFL(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, inst->U.I.DstReg, builtin_zero); + rc_remove_instruction(inst); } static void transform_SGE(struct radeon_compiler* c, @@ -360,9 +368,33 @@ static void transform_SGE(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_ADD, 0, dstreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); - emit3(c, inst->Prev, OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, - srcreg(PROGRAM_TEMPORARY, tempreg), builtin_zero, builtin_one); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); + + rc_remove_instruction(inst); +} + +static void transform_SGT(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); + + rc_remove_instruction(inst); +} + +static void transform_SLE(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); rc_remove_instruction(inst); } @@ -372,9 +404,21 @@ static void transform_SLT(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_ADD, 0, dstreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); - emit3(c, inst->Prev, OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, - srcreg(PROGRAM_TEMPORARY, tempreg), builtin_one, builtin_zero); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); + + rc_remove_instruction(inst); +} + +static void transform_SNE(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + negate(absolute(srcreg(RC_FILE_TEMPORARY, tempreg))), builtin_one, builtin_zero); rc_remove_instruction(inst); } @@ -382,14 +426,14 @@ static void transform_SLT(struct radeon_compiler* c, static void transform_SUB(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.Opcode = OPCODE_ADD; - inst->I.SrcReg[1] = negate(inst->I.SrcReg[1]); + inst->U.I.Opcode = RC_OPCODE_ADD; + inst->U.I.SrcReg[1] = negate(inst->U.I.SrcReg[1]); } static void transform_SWZ(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.Opcode = OPCODE_MOV; + inst->U.I.Opcode = RC_OPCODE_MOV; } static void transform_XPD(struct radeon_compiler* c, @@ -397,13 +441,13 @@ static void transform_XPD(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_MUL, 0, dstreg(PROGRAM_TEMPORARY, tempreg), - swizzle(inst->I.SrcReg[0], SWIZZLE_Z, SWIZZLE_X, SWIZZLE_Y, SWIZZLE_W), - swizzle(inst->I.SrcReg[1], SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_X, SWIZZLE_W)); - emit3(c, inst->Prev, OPCODE_MAD, inst->I.SaturateMode, inst->I.DstReg, - swizzle(inst->I.SrcReg[0], SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_X, SWIZZLE_W), - swizzle(inst->I.SrcReg[1], SWIZZLE_Z, SWIZZLE_X, SWIZZLE_Y, SWIZZLE_W), - negate(srcreg(PROGRAM_TEMPORARY, tempreg))); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstreg(RC_FILE_TEMPORARY, tempreg), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), + swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, inst->U.I.DstReg, + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W), + swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), + negate(srcreg(RC_FILE_TEMPORARY, tempreg))); rc_remove_instruction(inst); } @@ -414,7 +458,7 @@ static void transform_XPD(struct radeon_compiler* c, * no userData necessary. * * Eliminates the following ALU instructions: - * ABS, DPH, DST, FLR, LIT, LRP, POW, SGE, SLT, SUB, SWZ, XPD + * ABS, DPH, DST, FLR, LIT, LRP, POW, SEQ, SFL, SGE, SGT, SLE, SLT, SNE, SUB, SWZ, XPD * using: * MOV, ADD, MUL, MAD, FRC, DP3, LG2, EX2, CMP * @@ -423,27 +467,32 @@ static void transform_XPD(struct radeon_compiler* c, * * @note should be applicable to R300 and R500 fragment programs. */ -GLboolean radeonTransformALU( +int radeonTransformALU( struct radeon_compiler * c, struct rc_instruction* inst, void* unused) { - switch(inst->I.Opcode) { - case OPCODE_ABS: transform_ABS(c, inst); return GL_TRUE; - case OPCODE_DPH: transform_DPH(c, inst); return GL_TRUE; - case OPCODE_DST: transform_DST(c, inst); return GL_TRUE; - case OPCODE_FLR: transform_FLR(c, inst); return GL_TRUE; - case OPCODE_LIT: transform_LIT(c, inst); return GL_TRUE; - case OPCODE_LRP: transform_LRP(c, inst); return GL_TRUE; - case OPCODE_POW: transform_POW(c, inst); return GL_TRUE; - case OPCODE_RSQ: transform_RSQ(c, inst); return GL_TRUE; - case OPCODE_SGE: transform_SGE(c, inst); return GL_TRUE; - case OPCODE_SLT: transform_SLT(c, inst); return GL_TRUE; - case OPCODE_SUB: transform_SUB(c, inst); return GL_TRUE; - case OPCODE_SWZ: transform_SWZ(c, inst); return GL_TRUE; - case OPCODE_XPD: transform_XPD(c, inst); return GL_TRUE; + switch(inst->U.I.Opcode) { + case RC_OPCODE_ABS: transform_ABS(c, inst); return 1; + case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; + case RC_OPCODE_DST: transform_DST(c, inst); return 1; + case RC_OPCODE_FLR: transform_FLR(c, inst); return 1; + case RC_OPCODE_LIT: transform_LIT(c, inst); return 1; + case RC_OPCODE_LRP: transform_LRP(c, inst); return 1; + case RC_OPCODE_POW: transform_POW(c, inst); return 1; + case RC_OPCODE_RSQ: transform_RSQ(c, inst); return 1; + case RC_OPCODE_SEQ: transform_SEQ(c, inst); return 1; + case RC_OPCODE_SFL: transform_SFL(c, inst); return 1; + case RC_OPCODE_SGE: transform_SGE(c, inst); return 1; + case RC_OPCODE_SGT: transform_SGT(c, inst); return 1; + case RC_OPCODE_SLE: transform_SLE(c, inst); return 1; + case RC_OPCODE_SLT: transform_SLT(c, inst); return 1; + case RC_OPCODE_SNE: transform_SNE(c, inst); return 1; + case RC_OPCODE_SUB: transform_SUB(c, inst); return 1; + case RC_OPCODE_SWZ: transform_SWZ(c, inst); return 1; + case RC_OPCODE_XPD: transform_XPD(c, inst); return 1; default: - return GL_FALSE; + return 0; } } @@ -452,37 +501,37 @@ static void transform_r300_vertex_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { /* Note: r500 can take absolute values, but r300 cannot. */ - inst->I.Opcode = OPCODE_MAX; - inst->I.SrcReg[1] = inst->I.SrcReg[0]; - inst->I.SrcReg[1].Negate ^= NEGATE_XYZW; + inst->U.I.Opcode = RC_OPCODE_MAX; + inst->U.I.SrcReg[1] = inst->U.I.SrcReg[0]; + inst->U.I.SrcReg[1].Negate ^= RC_MASK_XYZW; } /** * For use with radeonLocalTransform, this transforms non-native ALU * instructions of the r300 up to r500 vertex engine. */ -GLboolean r300_transform_vertex_alu( +int r300_transform_vertex_alu( struct radeon_compiler * c, struct rc_instruction* inst, void* unused) { - switch(inst->I.Opcode) { - case OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return GL_TRUE; - case OPCODE_DP3: transform_DP3(c, inst); return GL_TRUE; - case OPCODE_DPH: transform_DPH(c, inst); return GL_TRUE; - case OPCODE_FLR: transform_FLR(c, inst); return GL_TRUE; - case OPCODE_LRP: transform_LRP(c, inst); return GL_TRUE; - case OPCODE_SUB: transform_SUB(c, inst); return GL_TRUE; - case OPCODE_SWZ: transform_SWZ(c, inst); return GL_TRUE; - case OPCODE_XPD: transform_XPD(c, inst); return GL_TRUE; + switch(inst->U.I.Opcode) { + case RC_OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return 1; + case RC_OPCODE_DP3: transform_DP3(c, inst); return 1; + case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; + case RC_OPCODE_FLR: transform_FLR(c, inst); return 1; + case RC_OPCODE_LRP: transform_LRP(c, inst); return 1; + case RC_OPCODE_SUB: transform_SUB(c, inst); return 1; + case RC_OPCODE_SWZ: transform_SWZ(c, inst); return 1; + case RC_OPCODE_XPD: transform_XPD(c, inst); return 1; default: - return GL_FALSE; + return 0; } } -static void sincos_constants(struct radeon_compiler* c, GLuint *constants) +static void sincos_constants(struct radeon_compiler* c, unsigned int *constants) { - static const GLfloat SinCosConsts[2][4] = { + static const float SinCosConsts[2][4] = { { 1.273239545, // 4/PI -0.405284735, // -4/(PI*PI) @@ -512,25 +561,25 @@ static void sincos_constants(struct radeon_compiler* c, GLuint *constants) */ static void sin_approx( struct radeon_compiler* c, struct rc_instruction * before, - struct prog_dst_register dst, struct prog_src_register src, const GLuint* constants) -{ - GLuint tempreg = rc_find_free_temporary(c); - - emit2(c, before->Prev, OPCODE_MUL, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - swizzle(src, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - srcreg(PROGRAM_CONSTANT, constants[0])); - emit3(c, before->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_X), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), - absolute(swizzle(src, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); - emit3(c, before->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_Y), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - absolute(swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), - negate(swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X))); - emit3(c, before->Prev, OPCODE_MAD, 0, dst, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), - swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); + struct rc_dst_register dst, struct rc_src_register src, const unsigned int* constants) +{ + unsigned int tempreg = rc_find_free_temporary(c); + + emit2(c, before, RC_OPCODE_MUL, 0, dstregtmpmask(tempreg, RC_MASK_XY), + swizzle(src, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + srcreg(RC_FILE_CONSTANT, constants[0])); + emit3(c, before, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_X), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), + absolute(swizzle(src, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); + emit3(c, before, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_Y), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + absolute(swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), + negate(swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X))); + emit3(c, before, RC_OPCODE_MAD, 0, dst, + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), + swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); } /** @@ -538,81 +587,81 @@ static void sin_approx( * using only the basic instructions * MOV, ADD, MUL, MAD, FRC */ -GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, +int radeonTransformTrigSimple(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != OPCODE_COS && - inst->I.Opcode != OPCODE_SIN && - inst->I.Opcode != OPCODE_SCS) - return GL_FALSE; + if (inst->U.I.Opcode != RC_OPCODE_COS && + inst->U.I.Opcode != RC_OPCODE_SIN && + inst->U.I.Opcode != RC_OPCODE_SCS) + return 0; - GLuint constants[2]; - GLuint tempreg = rc_find_free_temporary(c); + unsigned int constants[2]; + unsigned int tempreg = rc_find_free_temporary(c); sincos_constants(c, constants); - if (inst->I.Opcode == OPCODE_COS) { + if (inst->U.I.Opcode == RC_OPCODE_COS) { // MAD tmp.x, src, 1/(2*PI), 0.75 // FRC tmp.x, tmp.x // MAD tmp.z, tmp.x, 2*PI, -PI - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)); - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); - - sin_approx(c, inst, inst->I.DstReg, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); + + sin_approx(c, inst, inst->U.I.DstReg, + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), constants); - } else if (inst->I.Opcode == OPCODE_SIN) { - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)); - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); - - sin_approx(c, inst, inst->I.DstReg, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), + } else if (inst->U.I.Opcode == RC_OPCODE_SIN) { + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); + + sin_approx(c, inst, inst->U.I.DstReg, + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), constants); } else { - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - srcreg(PROGRAM_TEMPORARY, tempreg)); - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - srcreg(PROGRAM_TEMPORARY, tempreg), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); - - struct prog_dst_register dst = inst->I.DstReg; - - dst.WriteMask = inst->I.DstReg.WriteMask & WRITEMASK_X; + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_XY), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_XY), + srcreg(RC_FILE_TEMPORARY, tempreg)); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_XY), + srcreg(RC_FILE_TEMPORARY, tempreg), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); + + struct rc_dst_register dst = inst->U.I.DstReg; + + dst.WriteMask = inst->U.I.DstReg.WriteMask & RC_MASK_X; sin_approx(c, inst, dst, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), constants); - dst.WriteMask = inst->I.DstReg.WriteMask & WRITEMASK_Y; + dst.WriteMask = inst->U.I.DstReg.WriteMask & RC_MASK_Y; sin_approx(c, inst, dst, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), constants); } rc_remove_instruction(inst); - return GL_TRUE; + return 1; } @@ -624,53 +673,53 @@ GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, * * @warning This transformation implicitly changes the semantics of SIN and COS! */ -GLboolean radeonTransformTrigScale(struct radeon_compiler* c, +int radeonTransformTrigScale(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != OPCODE_COS && - inst->I.Opcode != OPCODE_SIN && - inst->I.Opcode != OPCODE_SCS) - return GL_FALSE; + if (inst->U.I.Opcode != RC_OPCODE_COS && + inst->U.I.Opcode != RC_OPCODE_SIN && + inst->U.I.Opcode != RC_OPCODE_SCS) + return 0; - static const GLfloat RCP_2PI = 0.15915494309189535; - GLuint temp; - GLuint constant; - GLuint constant_swizzle; + static const float RCP_2PI = 0.15915494309189535; + unsigned int temp; + unsigned int constant; + unsigned int constant_swizzle; temp = rc_find_free_temporary(c); constant = rc_constants_add_immediate_scalar(&c->Program.Constants, RCP_2PI, &constant_swizzle); - emit2(c, inst->Prev, OPCODE_MUL, 0, dstregtmpmask(temp, WRITEMASK_W), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - srcregswz(PROGRAM_CONSTANT, constant, constant_swizzle)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(temp, WRITEMASK_W), - srcreg(PROGRAM_TEMPORARY, temp)); - - if (inst->I.Opcode == OPCODE_COS) { - emit1(c, inst->Prev, OPCODE_COS, inst->I.SaturateMode, inst->I.DstReg, - srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); - } else if (inst->I.Opcode == OPCODE_SIN) { - emit1(c, inst->Prev, OPCODE_SIN, inst->I.SaturateMode, - inst->I.DstReg, srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); - } else if (inst->I.Opcode == OPCODE_SCS) { - struct prog_dst_register moddst = inst->I.DstReg; - - if (inst->I.DstReg.WriteMask & WRITEMASK_X) { - moddst.WriteMask = WRITEMASK_X; - emit1(c, inst->Prev, OPCODE_COS, inst->I.SaturateMode, moddst, - srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstregtmpmask(temp, RC_MASK_W), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(temp, RC_MASK_W), + srcreg(RC_FILE_TEMPORARY, temp)); + + if (inst->U.I.Opcode == RC_OPCODE_COS) { + emit1(c, inst->Prev, RC_OPCODE_COS, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); + } else if (inst->U.I.Opcode == RC_OPCODE_SIN) { + emit1(c, inst->Prev, RC_OPCODE_SIN, inst->U.I.SaturateMode, + inst->U.I.DstReg, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); + } else if (inst->U.I.Opcode == RC_OPCODE_SCS) { + struct rc_dst_register moddst = inst->U.I.DstReg; + + if (inst->U.I.DstReg.WriteMask & RC_MASK_X) { + moddst.WriteMask = RC_MASK_X; + emit1(c, inst->Prev, RC_OPCODE_COS, inst->U.I.SaturateMode, moddst, + srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); } - if (inst->I.DstReg.WriteMask & WRITEMASK_Y) { - moddst.WriteMask = WRITEMASK_Y; - emit1(c, inst->Prev, OPCODE_SIN, inst->I.SaturateMode, moddst, - srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); + if (inst->U.I.DstReg.WriteMask & RC_MASK_Y) { + moddst.WriteMask = RC_MASK_Y; + emit1(c, inst->Prev, RC_OPCODE_SIN, inst->U.I.SaturateMode, moddst, + srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); } } rc_remove_instruction(inst); - return GL_TRUE; + return 1; } /** @@ -681,15 +730,15 @@ GLboolean radeonTransformTrigScale(struct radeon_compiler* c, * @warning This explicitly changes the form of DDX and DDY! */ -GLboolean radeonTransformDeriv(struct radeon_compiler* c, +int radeonTransformDeriv(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != OPCODE_DDX && inst->I.Opcode != OPCODE_DDY) - return GL_FALSE; + if (inst->U.I.Opcode != RC_OPCODE_DDX && inst->U.I.Opcode != RC_OPCODE_DDY) + return 0; - inst->I.SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE); - inst->I.SrcReg[1].Negate = NEGATE_XYZW; + inst->U.I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE); + inst->U.I.SrcReg[1].Negate = RC_MASK_XYZW; - return GL_TRUE; + return 1; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h index 147efec6fc..7cb5f84b7f 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h @@ -30,27 +30,27 @@ #include "radeon_program.h" -GLboolean radeonTransformALU( +int radeonTransformALU( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean r300_transform_vertex_alu( +int r300_transform_vertex_alu( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean radeonTransformTrigSimple( +int radeonTransformTrigSimple( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean radeonTransformTrigScale( +int radeonTransformTrigScale( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean radeonTransformDeriv( +int radeonTransformDeriv( struct radeon_compiler * c, struct rc_instruction * inst, void*); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h new file mode 100644 index 0000000000..7c0d6720b1 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_PROGRAM_CONSTANTS_H +#define RADEON_PROGRAM_CONSTANTS_H + +typedef enum { + RC_SATURATE_NONE = 0, + RC_SATURATE_ZERO_ONE, + RC_SATURATE_MINUS_PLUS_ONE +} rc_saturate_mode; + +typedef enum { + RC_TEXTURE_2D_ARRAY, + RC_TEXTURE_1D_ARRAY, + RC_TEXTURE_CUBE, + RC_TEXTURE_3D, + RC_TEXTURE_RECT, + RC_TEXTURE_2D, + RC_TEXTURE_1D +} rc_texture_target; + +typedef enum { + /** + * Used to indicate unused register descriptions and + * source register that use a constant swizzle. + */ + RC_FILE_NONE = 0, + RC_FILE_TEMPORARY, + + /** + * Input register. + * + * \note The compiler attaches no implicit semantics to input registers. + * Fragment/vertex program specific semantics must be defined explicitly + * using the appropriate compiler interfaces. + */ + RC_FILE_INPUT, + + /** + * Output register. + * + * \note The compiler attaches no implicit semantics to input registers. + * Fragment/vertex program specific semantics must be defined explicitly + * using the appropriate compiler interfaces. + */ + RC_FILE_OUTPUT, + RC_FILE_ADDRESS, + + /** + * Indicates a constant from the \ref rc_constant_list . + */ + RC_FILE_CONSTANT, + + /** + * Indicates a special register, see RC_SPECIAL_xxx. + */ + RC_FILE_SPECIAL +} rc_register_file; + +enum { + /** R500 fragment program ALU result "register" */ + RC_SPECIAL_ALU_RESULT = 0, + + /** Must be last */ + RC_NUM_SPECIAL_REGISTERS +}; + +#define RC_REGISTER_INDEX_BITS 10 +#define RC_REGISTER_MAX_INDEX (1 << RC_REGISTER_INDEX_BITS) + +typedef enum { + RC_SWIZZLE_X = 0, + RC_SWIZZLE_Y, + RC_SWIZZLE_Z, + RC_SWIZZLE_W, + RC_SWIZZLE_ZERO, + RC_SWIZZLE_ONE, + RC_SWIZZLE_HALF, + RC_SWIZZLE_UNUSED +} rc_swizzle; + +#define RC_MAKE_SWIZZLE(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9)) +#define RC_MAKE_SWIZZLE_SMEAR(a) RC_MAKE_SWIZZLE((a),(a),(a),(a)) +#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7) +#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) +#define SET_SWZ(swz, idx, newv) \ + do { \ + (swz) = ((swz) & ~(7 << ((idx)*3))) | ((newv) << ((idx)*3)); \ + } while(0) + +#define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W) +#define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X) +#define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y) +#define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z) +#define RC_SWIZZLE_WWWW RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_W) +#define RC_SWIZZLE_0000 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ZERO) +#define RC_SWIZZLE_1111 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ONE) + +/** + * \name Bitmasks for components of vectors. + * + * Used for write masks, negation masks, etc. + */ +/*@{*/ +#define RC_MASK_NONE 0 +#define RC_MASK_X 1 +#define RC_MASK_Y 2 +#define RC_MASK_Z 4 +#define RC_MASK_W 8 +#define RC_MASK_XY (RC_MASK_X|RC_MASK_Y) +#define RC_MASK_XYZ (RC_MASK_X|RC_MASK_Y|RC_MASK_Z) +#define RC_MASK_XYW (RC_MASK_X|RC_MASK_Y|RC_MASK_W) +#define RC_MASK_XYZW (RC_MASK_X|RC_MASK_Y|RC_MASK_Z|RC_MASK_W) +/*@}*/ + +typedef enum { + RC_ALURESULT_NONE = 0, + RC_ALURESULT_X, + RC_ALURESULT_W +} rc_write_aluresult; + +#endif /* RADEON_PROGRAM_CONSTANTS_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c index 4c26db5d24..ee839596aa 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Nicolai Haehnle. + * Copyright (C) 2008-2009 Nicolai Haehnle. * * All Rights Reserved. * @@ -25,584 +25,29 @@ * */ -/** - * @file - * - * Perform temporary register allocation and attempt to pair off instructions - * in RGB and Alpha pairs. Also attempts to optimize the TEX instruction - * vs. ALU instruction scheduling. - */ - #include "radeon_program_pair.h" -#include "memory_pool.h" -#include "radeon_compiler.h" -#include "shader/prog_print.h" - -#define error(fmt, args...) do { \ - rc_error(&s->Compiler->Base, "%s::%s(): " fmt "\n", \ - __FILE__, __FUNCTION__, ##args); \ -} while(0) - -struct pair_state_instruction { - struct prog_instruction Instruction; - GLuint IP; /**< Position of this instruction in original program */ - - GLuint IsTex:1; /**< Is a texture instruction */ - GLuint NeedRGB:1; /**< Needs the RGB ALU */ - GLuint NeedAlpha:1; /**< Needs the Alpha ALU */ - GLuint IsTranscendent:1; /**< Is a special transcendent instruction */ - - /** - * Number of (read and write) dependencies that must be resolved before - * this instruction can be scheduled. - */ - GLuint NumDependencies:5; - - /** - * Next instruction in the linked list of ready instructions. - */ - struct pair_state_instruction *NextReady; - - /** - * Values that this instruction writes - */ - struct reg_value *Values[4]; -}; - - -/** - * Used to keep track of which instructions read a value. - */ -struct reg_value_reader { - struct pair_state_instruction *Reader; - struct reg_value_reader *Next; -}; - -/** - * Used to keep track which values are stored in each component of a - * PROGRAM_TEMPORARY. - */ -struct reg_value { - struct pair_state_instruction *Writer; - struct reg_value *Next; /**< Pointer to the next value to be written to the same PROGRAM_TEMPORARY component */ - - /** - * Unordered linked list of instructions that read from this value. - */ - struct reg_value_reader *Readers; - - /** - * Number of readers of this value. This is calculated during @ref scan_instructions - * and continually decremented during code emission. - * When this count reaches zero, the instruction that writes the @ref Next value - * can be scheduled. - */ - GLuint NumReaders; -}; - -/** - * Used to translate a PROGRAM_INPUT or PROGRAM_TEMPORARY Mesa register - * to the proper hardware temporary. - */ -struct pair_register_translation { - GLuint Allocated:1; - GLuint HwIndex:8; - GLuint RefCount:23; /**< # of times this occurs in an unscheduled instruction SrcReg or DstReg */ - - /** - * Notes the value that is currently contained in each component - * (only used for PROGRAM_TEMPORARY registers). - */ - struct reg_value *Value[4]; -}; - -struct pair_state { - struct r300_fragment_program_compiler * Compiler; - const struct radeon_pair_handler *Handler; - GLboolean Verbose; - void *UserData; - - /** - * Translate Mesa registers to hardware registers - */ - struct pair_register_translation Inputs[FRAG_ATTRIB_MAX]; - struct pair_register_translation Temps[MAX_PROGRAM_TEMPS]; - - struct { - GLuint RefCount; /**< # of times this occurs in an unscheduled SrcReg or DstReg */ - } HwTemps[128]; - - /** - * Linked list of instructions that can be scheduled right now, - * based on which ALU/TEX resources they require. - */ - struct pair_state_instruction *ReadyFullALU; - struct pair_state_instruction *ReadyRGB; - struct pair_state_instruction *ReadyAlpha; - struct pair_state_instruction *ReadyTEX; -}; - - -static struct pair_register_translation *get_register(struct pair_state *s, GLuint file, GLuint index) -{ - switch(file) { - case PROGRAM_TEMPORARY: return &s->Temps[index]; - case PROGRAM_INPUT: return &s->Inputs[index]; - default: return 0; - } -} - -static void alloc_hw_reg(struct pair_state *s, GLuint file, GLuint index, GLuint hwindex) -{ - struct pair_register_translation *t = get_register(s, file, index); - ASSERT(!s->HwTemps[hwindex].RefCount); - ASSERT(!t->Allocated); - s->HwTemps[hwindex].RefCount = t->RefCount; - t->Allocated = 1; - t->HwIndex = hwindex; -} - -static GLuint get_hw_reg(struct pair_state *s, GLuint file, GLuint index) -{ - GLuint hwindex; - - struct pair_register_translation *t = get_register(s, file, index); - if (!t) { - error("get_hw_reg: %i[%i]\n", file, index); - return 0; - } - - if (t->Allocated) - return t->HwIndex; - - for(hwindex = 0; hwindex < s->Handler->MaxHwTemps; ++hwindex) - if (!s->HwTemps[hwindex].RefCount) - break; - - if (hwindex >= s->Handler->MaxHwTemps) { - error("Ran out of hardware temporaries"); - return 0; - } - - alloc_hw_reg(s, file, index, hwindex); - return hwindex; -} - - -static void deref_hw_reg(struct pair_state *s, GLuint hwindex) -{ - if (!s->HwTemps[hwindex].RefCount) { - error("Hwindex %i refcount error", hwindex); - return; - } - - s->HwTemps[hwindex].RefCount--; -} - -static void add_pairinst_to_list(struct pair_state_instruction **list, struct pair_state_instruction *pairinst) -{ - pairinst->NextReady = *list; - *list = pairinst; -} - -/** - * The given instruction has become ready. Link it into the ready - * instructions. - */ -static void instruction_ready(struct pair_state *s, struct pair_state_instruction *pairinst) -{ - if (s->Verbose) - _mesa_printf("instruction_ready(%i)\n", pairinst->IP); - - if (pairinst->IsTex) - add_pairinst_to_list(&s->ReadyTEX, pairinst); - else if (!pairinst->NeedAlpha) - add_pairinst_to_list(&s->ReadyRGB, pairinst); - else if (!pairinst->NeedRGB) - add_pairinst_to_list(&s->ReadyAlpha, pairinst); - else - add_pairinst_to_list(&s->ReadyFullALU, pairinst); -} - - -/** - * Finally rewrite ADD, MOV, MUL as the appropriate native instruction - * and reverse the order of arguments for CMP. - */ -static void final_rewrite(struct pair_state *s, struct prog_instruction *inst) -{ - struct prog_src_register tmp; - - switch(inst->Opcode) { - case OPCODE_ADD: - inst->SrcReg[2] = inst->SrcReg[1]; - inst->SrcReg[1].File = PROGRAM_BUILTIN; - inst->SrcReg[1].Swizzle = SWIZZLE_1111; - inst->SrcReg[1].Negate = NEGATE_NONE; - inst->Opcode = OPCODE_MAD; - break; - case OPCODE_CMP: - tmp = inst->SrcReg[2]; - inst->SrcReg[2] = inst->SrcReg[0]; - inst->SrcReg[0] = tmp; - break; - case OPCODE_MOV: - /* AMD say we should use CMP. - * However, when we transform - * KIL -r0; - * into - * CMP tmp, -r0, -r0, 0; - * KIL tmp; - * we get incorrect behaviour on R500 when r0 == 0.0. - * It appears that the R500 KIL hardware treats -0.0 as less - * than zero. - */ - inst->SrcReg[1].File = PROGRAM_BUILTIN; - inst->SrcReg[1].Swizzle = SWIZZLE_1111; - inst->SrcReg[2].File = PROGRAM_BUILTIN; - inst->SrcReg[2].Swizzle = SWIZZLE_0000; - inst->Opcode = OPCODE_MAD; - break; - case OPCODE_MUL: - inst->SrcReg[2].File = PROGRAM_BUILTIN; - inst->SrcReg[2].Swizzle = SWIZZLE_0000; - inst->Opcode = OPCODE_MAD; - break; - default: - /* nothing to do */ - break; - } -} - - -/** - * Classify an instruction according to which ALUs etc. it needs - */ -static void classify_instruction(struct pair_state *s, - struct pair_state_instruction *psi) -{ - psi->NeedRGB = (psi->Instruction.DstReg.WriteMask & WRITEMASK_XYZ) ? 1 : 0; - psi->NeedAlpha = (psi->Instruction.DstReg.WriteMask & WRITEMASK_W) ? 1 : 0; - - switch(psi->Instruction.Opcode) { - case OPCODE_ADD: - case OPCODE_CMP: - case OPCODE_DDX: - case OPCODE_DDY: - case OPCODE_FRC: - case OPCODE_MAD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MOV: - case OPCODE_MUL: - break; - case OPCODE_COS: - case OPCODE_EX2: - case OPCODE_LG2: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_SIN: - psi->IsTranscendent = 1; - psi->NeedAlpha = 1; - break; - case OPCODE_DP4: - psi->NeedAlpha = 1; - /* fall through */ - case OPCODE_DP3: - psi->NeedRGB = 1; - break; - case OPCODE_KIL: - case OPCODE_TEX: - case OPCODE_TXB: - case OPCODE_TXP: - case OPCODE_END: - psi->IsTex = 1; - break; - default: - error("Unknown opcode %d\n", psi->Instruction.Opcode); - break; - } -} - - -/** - * Count which (input, temporary) register is read and written how often, - * and scan the instruction stream to find dependencies. - */ -static void scan_instructions(struct pair_state *s) -{ - struct rc_instruction *source; - GLuint ip; - - for(source = s->Compiler->Base.Program.Instructions.Next, ip = 0; - source != &s->Compiler->Base.Program.Instructions; - source = source->Next, ++ip) { - struct pair_state_instruction *pairinst = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*pairinst)); - memset(pairinst, 0, sizeof(struct pair_state_instruction)); - - pairinst->Instruction = source->I; - pairinst->IP = ip; - final_rewrite(s, &pairinst->Instruction); - classify_instruction(s, pairinst); - - int nsrc = _mesa_num_inst_src_regs(pairinst->Instruction.Opcode); - int j; - for(j = 0; j < nsrc; j++) { - struct pair_register_translation *t = - get_register(s, pairinst->Instruction.SrcReg[j].File, pairinst->Instruction.SrcReg[j].Index); - if (!t) - continue; - - t->RefCount++; - - if (pairinst->Instruction.SrcReg[j].File == PROGRAM_TEMPORARY) { - int i; - for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(pairinst->Instruction.SrcReg[j].Swizzle, i); - if (swz >= 4) - continue; /* constant or NIL swizzle */ - if (!t->Value[swz]) - continue; /* this is an undefined read */ - - /* Do not add a dependency if this instruction - * also rewrites the value. The code below adds - * a dependency for the DstReg, which is a superset - * of the SrcReg dependency. */ - if (pairinst->Instruction.DstReg.File == PROGRAM_TEMPORARY && - pairinst->Instruction.DstReg.Index == pairinst->Instruction.SrcReg[j].Index && - GET_BIT(pairinst->Instruction.DstReg.WriteMask, swz)) - continue; - - struct reg_value_reader* r = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*r)); - pairinst->NumDependencies++; - t->Value[swz]->NumReaders++; - r->Reader = pairinst; - r->Next = t->Value[swz]->Readers; - t->Value[swz]->Readers = r; - } - } - } - - int ndst = _mesa_num_inst_dst_regs(pairinst->Instruction.Opcode); - if (ndst) { - struct pair_register_translation *t = - get_register(s, pairinst->Instruction.DstReg.File, pairinst->Instruction.DstReg.Index); - if (t) { - t->RefCount++; - - if (pairinst->Instruction.DstReg.File == PROGRAM_TEMPORARY) { - int j; - for(j = 0; j < 4; ++j) { - if (!GET_BIT(pairinst->Instruction.DstReg.WriteMask, j)) - continue; - - struct reg_value* v = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*v)); - memset(v, 0, sizeof(struct reg_value)); - v->Writer = pairinst; - if (t->Value[j]) { - pairinst->NumDependencies++; - t->Value[j]->Next = v; - } - t->Value[j] = v; - pairinst->Values[j] = v; - } - } - } - } - - if (s->Verbose) - _mesa_printf("scan(%i): NumDeps = %i\n", ip, pairinst->NumDependencies); - - if (!pairinst->NumDependencies) - instruction_ready(s, pairinst); - } - - /* Clear the PROGRAM_TEMPORARY state */ - int i, j; - for(i = 0; i < MAX_PROGRAM_TEMPS; ++i) { - for(j = 0; j < 4; ++j) - s->Temps[i].Value[j] = 0; - } -} - - -static void decrement_dependencies(struct pair_state *s, struct pair_state_instruction *pairinst) -{ - ASSERT(pairinst->NumDependencies > 0); - if (!--pairinst->NumDependencies) - instruction_ready(s, pairinst); -} /** - * Update the dependency tracking state based on what the instruction - * at the given IP does. + * Return the source slot where we installed the given register access, + * or -1 if no slot was free anymore. */ -static void commit_instruction(struct pair_state *s, struct pair_state_instruction *pairinst) -{ - struct prog_instruction *inst = &pairinst->Instruction; - - if (s->Verbose) - _mesa_printf("commit_instruction(%i)\n", pairinst->IP); - - if (inst->DstReg.File == PROGRAM_TEMPORARY) { - struct pair_register_translation *t = &s->Temps[inst->DstReg.Index]; - deref_hw_reg(s, t->HwIndex); - - int i; - for(i = 0; i < 4; ++i) { - if (!GET_BIT(inst->DstReg.WriteMask, i)) - continue; - - t->Value[i] = pairinst->Values[i]; - if (t->Value[i]->NumReaders) { - struct reg_value_reader *r; - for(r = pairinst->Values[i]->Readers; r; r = r->Next) - decrement_dependencies(s, r->Reader); - } else if (t->Value[i]->Next) { - /* This happens when the only reader writes - * the register at the same time */ - decrement_dependencies(s, t->Value[i]->Next->Writer); - } - } - } - - int nsrc = _mesa_num_inst_src_regs(inst->Opcode); - int i; - for(i = 0; i < nsrc; i++) { - struct pair_register_translation *t = get_register(s, inst->SrcReg[i].File, inst->SrcReg[i].Index); - if (!t) - continue; - - deref_hw_reg(s, get_hw_reg(s, inst->SrcReg[i].File, inst->SrcReg[i].Index)); - - if (inst->SrcReg[i].File != PROGRAM_TEMPORARY) - continue; - - int j; - for(j = 0; j < 4; ++j) { - GLuint swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); - if (swz >= 4) - continue; - if (!t->Value[swz]) - continue; - - /* Do not free a dependency if this instruction - * also rewrites the value. See scan_instructions. */ - if (inst->DstReg.File == PROGRAM_TEMPORARY && - inst->DstReg.Index == inst->SrcReg[i].Index && - GET_BIT(inst->DstReg.WriteMask, swz)) - continue; - - if (!--t->Value[swz]->NumReaders) { - if (t->Value[swz]->Next) - decrement_dependencies(s, t->Value[swz]->Next->Writer); - } - } - } -} - - -/** - * Emit all ready texture instructions in a single block. - * - * Emit as a single block to (hopefully) sample many textures in parallel, - * and to avoid hardware indirections on R300. - * - * In R500, we don't really know when the result of a texture instruction - * arrives. So allocate all destinations first, to make sure they do not - * arrive early and overwrite a texture coordinate we're going to use later - * in the block. - */ -static void emit_all_tex(struct pair_state *s) -{ - struct pair_state_instruction *readytex; - struct pair_state_instruction *pairinst; - - ASSERT(s->ReadyTEX); - - // Don't let the ready list change under us! - readytex = s->ReadyTEX; - s->ReadyTEX = 0; - - // Allocate destination hardware registers in one block to avoid conflicts. - for(pairinst = readytex; pairinst; pairinst = pairinst->NextReady) { - struct prog_instruction *inst = &pairinst->Instruction; - if (inst->Opcode != OPCODE_KIL) - get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); - } - - if (s->Compiler->Base.Debug) - _mesa_printf(" BEGIN_TEX\n"); - - if (s->Handler->BeginTexBlock) - s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->BeginTexBlock(s->UserData); - - for(pairinst = readytex; pairinst; pairinst = pairinst->NextReady) { - struct prog_instruction *inst = &pairinst->Instruction; - commit_instruction(s, pairinst); - - if (inst->Opcode != OPCODE_KIL) - inst->DstReg.Index = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); - inst->SrcReg[0].Index = get_hw_reg(s, inst->SrcReg[0].File, inst->SrcReg[0].Index); - - if (s->Compiler->Base.Debug) { - _mesa_printf(" "); - _mesa_print_instruction(inst); - fflush(stderr); - } - - struct radeon_pair_texture_instruction rpti; - - switch(inst->Opcode) { - case OPCODE_TEX: rpti.Opcode = RADEON_OPCODE_TEX; break; - case OPCODE_TXB: rpti.Opcode = RADEON_OPCODE_TXB; break; - case OPCODE_TXP: rpti.Opcode = RADEON_OPCODE_TXP; break; - default: - case OPCODE_KIL: rpti.Opcode = RADEON_OPCODE_KIL; break; - } - - rpti.DestIndex = inst->DstReg.Index; - rpti.WriteMask = inst->DstReg.WriteMask; - rpti.TexSrcUnit = inst->TexSrcUnit; - rpti.TexSrcTarget = inst->TexSrcTarget; - rpti.SrcIndex = inst->SrcReg[0].Index; - rpti.SrcSwizzle = inst->SrcReg[0].Swizzle; - - s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->EmitTex(s->UserData, &rpti); - } - - if (s->Compiler->Base.Debug) - _mesa_printf(" END_TEX\n"); -} - - -static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instruction *pair, - struct prog_src_register src, GLboolean rgb, GLboolean alpha) +int rc_pair_alloc_source(struct rc_pair_instruction *pair, + unsigned int rgb, unsigned int alpha, + rc_register_file file, unsigned int index) { int candidate = -1; int candidate_quality = -1; int i; - if (!rgb && !alpha) + if ((!rgb && !alpha) || file == RC_FILE_NONE) return 0; - GLuint constant; - GLuint index; - - if (src.File == PROGRAM_TEMPORARY || src.File == PROGRAM_INPUT) { - constant = 0; - index = get_hw_reg(s, src.File, src.Index); - } else { - constant = 1; - index = src.Index; - } - for(i = 0; i < 3; ++i) { int q = 0; if (rgb) { if (pair->RGB.Src[i].Used) { - if (pair->RGB.Src[i].Constant != constant || + if (pair->RGB.Src[i].File != file || pair->RGB.Src[i].Index != index) continue; q++; @@ -610,7 +55,7 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio } if (alpha) { if (pair->Alpha.Src[i].Used) { - if (pair->Alpha.Src[i].Constant != constant || + if (pair->Alpha.Src[i].File != file || pair->Alpha.Src[i].Index != index) continue; q++; @@ -625,334 +70,15 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio if (candidate >= 0) { if (rgb) { pair->RGB.Src[candidate].Used = 1; - pair->RGB.Src[candidate].Constant = constant; + pair->RGB.Src[candidate].File = file; pair->RGB.Src[candidate].Index = index; } if (alpha) { pair->Alpha.Src[candidate].Used = 1; - pair->Alpha.Src[candidate].Constant = constant; + pair->Alpha.Src[candidate].File = file; pair->Alpha.Src[candidate].Index = index; } } return candidate; } - -/** - * Fill the given ALU instruction's opcodes and source operands into the given pair, - * if possible. - */ -static GLboolean fill_instruction_into_pair( - struct pair_state *s, - struct radeon_pair_instruction *pair, - struct pair_state_instruction *pairinst) -{ - struct prog_instruction *inst = &pairinst->Instruction; - - ASSERT(!pairinst->NeedRGB || pair->RGB.Opcode == OPCODE_NOP); - ASSERT(!pairinst->NeedAlpha || pair->Alpha.Opcode == OPCODE_NOP); - - if (pairinst->NeedRGB) { - if (pairinst->IsTranscendent) - pair->RGB.Opcode = OPCODE_REPL_ALPHA; - else - pair->RGB.Opcode = inst->Opcode; - if (inst->SaturateMode == SATURATE_ZERO_ONE) - pair->RGB.Saturate = 1; - } - if (pairinst->NeedAlpha) { - pair->Alpha.Opcode = inst->Opcode; - if (inst->SaturateMode == SATURATE_ZERO_ONE) - pair->Alpha.Saturate = 1; - } - - int nargs = _mesa_num_inst_src_regs(inst->Opcode); - int i; - - /* Special case for DDX/DDY (MDH/MDV). */ - if (inst->Opcode == OPCODE_DDX || inst->Opcode == OPCODE_DDY) { - if (pair->RGB.Src[0].Used || pair->Alpha.Src[0].Used) - return GL_FALSE; - else - nargs++; - } - - for(i = 0; i < nargs; ++i) { - int source; - if (pairinst->NeedRGB && !pairinst->IsTranscendent) { - GLboolean srcrgb = GL_FALSE; - GLboolean srcalpha = GL_FALSE; - int j; - for(j = 0; j < 3; ++j) { - GLuint swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); - if (swz < 3) - srcrgb = GL_TRUE; - else if (swz < 4) - srcalpha = GL_TRUE; - } - source = alloc_pair_source(s, pair, inst->SrcReg[i], srcrgb, srcalpha); - if (source < 0) - return GL_FALSE; - pair->RGB.Arg[i].Source = source; - pair->RGB.Arg[i].Swizzle = inst->SrcReg[i].Swizzle & 0x1ff; - pair->RGB.Arg[i].Abs = inst->SrcReg[i].Abs; - pair->RGB.Arg[i].Negate = !!(inst->SrcReg[i].Negate & (NEGATE_X | NEGATE_Y | NEGATE_Z)); - } - if (pairinst->NeedAlpha) { - GLboolean srcrgb = GL_FALSE; - GLboolean srcalpha = GL_FALSE; - GLuint swz = GET_SWZ(inst->SrcReg[i].Swizzle, pairinst->IsTranscendent ? 0 : 3); - if (swz < 3) - srcrgb = GL_TRUE; - else if (swz < 4) - srcalpha = GL_TRUE; - source = alloc_pair_source(s, pair, inst->SrcReg[i], srcrgb, srcalpha); - if (source < 0) - return GL_FALSE; - pair->Alpha.Arg[i].Source = source; - pair->Alpha.Arg[i].Swizzle = swz; - pair->Alpha.Arg[i].Abs = inst->SrcReg[i].Abs; - pair->Alpha.Arg[i].Negate = !!(inst->SrcReg[i].Negate & NEGATE_W); - } - } - - return GL_TRUE; -} - - -/** - * Fill in the destination register information. - * - * This is split from filling in source registers because we want - * to avoid allocating hardware temporaries for destinations until - * we are absolutely certain that we're going to emit a certain - * instruction pairing. - */ -static void fill_dest_into_pair( - struct pair_state *s, - struct radeon_pair_instruction *pair, - struct pair_state_instruction *pairinst) -{ - struct prog_instruction *inst = &pairinst->Instruction; - - if (inst->DstReg.File == PROGRAM_OUTPUT) { - if (inst->DstReg.Index == s->Compiler->OutputColor) { - pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & WRITEMASK_XYZ; - pair->Alpha.OutputWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } else if (inst->DstReg.Index == s->Compiler->OutputDepth) { - pair->Alpha.DepthWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } - } else { - GLuint hwindex = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); - if (pairinst->NeedRGB) { - pair->RGB.DestIndex = hwindex; - pair->RGB.WriteMask |= inst->DstReg.WriteMask & WRITEMASK_XYZ; - } - if (pairinst->NeedAlpha) { - pair->Alpha.DestIndex = hwindex; - pair->Alpha.WriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } - } -} - - -/** - * Find a good ALU instruction or pair of ALU instruction and emit it. - * - * Prefer emitting full ALU instructions, so that when we reach a point - * where no full ALU instruction can be emitted, we have more candidates - * for RGB/Alpha pairing. - */ -static void emit_alu(struct pair_state *s) -{ - struct radeon_pair_instruction pair; - struct pair_state_instruction *psi; - - if (s->ReadyFullALU || !(s->ReadyRGB && s->ReadyAlpha)) { - if (s->ReadyFullALU) { - psi = s->ReadyFullALU; - s->ReadyFullALU = s->ReadyFullALU->NextReady; - } else if (s->ReadyRGB) { - psi = s->ReadyRGB; - s->ReadyRGB = s->ReadyRGB->NextReady; - } else { - psi = s->ReadyAlpha; - s->ReadyAlpha = s->ReadyAlpha->NextReady; - } - - _mesa_bzero(&pair, sizeof(pair)); - fill_instruction_into_pair(s, &pair, psi); - fill_dest_into_pair(s, &pair, psi); - commit_instruction(s, psi); - } else { - struct pair_state_instruction **prgb; - struct pair_state_instruction **palpha; - - /* Some pairings might fail because they require too - * many source slots; try all possible pairings if necessary */ - for(prgb = &s->ReadyRGB; *prgb; prgb = &(*prgb)->NextReady) { - for(palpha = &s->ReadyAlpha; *palpha; palpha = &(*palpha)->NextReady) { - struct pair_state_instruction * psirgb = *prgb; - struct pair_state_instruction * psialpha = *palpha; - _mesa_bzero(&pair, sizeof(pair)); - fill_instruction_into_pair(s, &pair, psirgb); - if (!fill_instruction_into_pair(s, &pair, psialpha)) - continue; - *prgb = (*prgb)->NextReady; - *palpha = (*palpha)->NextReady; - fill_dest_into_pair(s, &pair, psirgb); - fill_dest_into_pair(s, &pair, psialpha); - commit_instruction(s, psirgb); - commit_instruction(s, psialpha); - goto success; - } - } - - /* No success in pairing; just take the first RGB instruction */ - psi = s->ReadyRGB; - s->ReadyRGB = s->ReadyRGB->NextReady; - - _mesa_bzero(&pair, sizeof(pair)); - fill_instruction_into_pair(s, &pair, psi); - fill_dest_into_pair(s, &pair, psi); - commit_instruction(s, psi); - success: ; - } - - if (s->Compiler->Base.Debug) - radeonPrintPairInstruction(&pair); - - s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->EmitPaired(s->UserData, &pair); -} - -/* Callback function for assigning input registers to hardware registers */ -static void alloc_helper(void * data, unsigned input, unsigned hwreg) -{ - struct pair_state * s = data; - alloc_hw_reg(s, PROGRAM_INPUT, input, hwreg); -} - -void radeonPairProgram( - struct r300_fragment_program_compiler * compiler, - const struct radeon_pair_handler* handler, void *userdata) -{ - struct pair_state s; - - _mesa_bzero(&s, sizeof(s)); - s.Compiler = compiler; - s.Handler = handler; - s.UserData = userdata; - s.Verbose = GL_FALSE && s.Compiler->Base.Debug; - - if (s.Compiler->Base.Debug) - _mesa_printf("Emit paired program\n"); - - scan_instructions(&s); - s.Compiler->AllocateHwInputs(s.Compiler, &alloc_helper, &s); - - while(!s.Compiler->Base.Error && - (s.ReadyTEX || s.ReadyRGB || s.ReadyAlpha || s.ReadyFullALU)) { - if (s.ReadyTEX) - emit_all_tex(&s); - - while(s.ReadyFullALU || s.ReadyRGB || s.ReadyAlpha) - emit_alu(&s); - } - - if (s.Compiler->Base.Debug) - _mesa_printf(" END\n"); -} - - -static void print_pair_src(int i, struct radeon_pair_instruction_source* src) -{ - _mesa_printf(" Src%i = %s[%i]", i, src->Constant ? "CNST" : "TEMP", src->Index); -} - -static const char* opcode_string(GLuint opcode) -{ - if (opcode == OPCODE_REPL_ALPHA) - return "SOP"; - else - return _mesa_opcode_string(opcode); -} - -static int num_pairinst_args(GLuint opcode) -{ - if (opcode == OPCODE_REPL_ALPHA) - return 0; - else - return _mesa_num_inst_src_regs(opcode); -} - -static char swizzle_char(GLuint swz) -{ - switch(swz) { - case SWIZZLE_X: return 'x'; - case SWIZZLE_Y: return 'y'; - case SWIZZLE_Z: return 'z'; - case SWIZZLE_W: return 'w'; - case SWIZZLE_ZERO: return '0'; - case SWIZZLE_ONE: return '1'; - case SWIZZLE_NIL: return '_'; - default: return '?'; - } -} - -void radeonPrintPairInstruction(struct radeon_pair_instruction *inst) -{ - int nargs; - int i; - - _mesa_printf(" RGB: "); - for(i = 0; i < 3; ++i) { - if (inst->RGB.Src[i].Used) - print_pair_src(i, inst->RGB.Src + i); - } - _mesa_printf("\n"); - _mesa_printf(" Alpha:"); - for(i = 0; i < 3; ++i) { - if (inst->Alpha.Src[i].Used) - print_pair_src(i, inst->Alpha.Src + i); - } - _mesa_printf("\n"); - - _mesa_printf(" %s%s", opcode_string(inst->RGB.Opcode), inst->RGB.Saturate ? "_SAT" : ""); - if (inst->RGB.WriteMask) - _mesa_printf(" TEMP[%i].%s%s%s", inst->RGB.DestIndex, - (inst->RGB.WriteMask & 1) ? "x" : "", - (inst->RGB.WriteMask & 2) ? "y" : "", - (inst->RGB.WriteMask & 4) ? "z" : ""); - if (inst->RGB.OutputWriteMask) - _mesa_printf(" COLOR.%s%s%s", - (inst->RGB.OutputWriteMask & 1) ? "x" : "", - (inst->RGB.OutputWriteMask & 2) ? "y" : "", - (inst->RGB.OutputWriteMask & 4) ? "z" : ""); - nargs = num_pairinst_args(inst->RGB.Opcode); - for(i = 0; i < nargs; ++i) { - const char* abs = inst->RGB.Arg[i].Abs ? "|" : ""; - const char* neg = inst->RGB.Arg[i].Negate ? "-" : ""; - _mesa_printf(", %s%sSrc%i.%c%c%c%s", neg, abs, inst->RGB.Arg[i].Source, - swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 0)), - swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 1)), - swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 2)), - abs); - } - _mesa_printf("\n"); - - _mesa_printf(" %s%s", opcode_string(inst->Alpha.Opcode), inst->Alpha.Saturate ? "_SAT" : ""); - if (inst->Alpha.WriteMask) - _mesa_printf(" TEMP[%i].w", inst->Alpha.DestIndex); - if (inst->Alpha.OutputWriteMask) - _mesa_printf(" COLOR.w"); - if (inst->Alpha.DepthWriteMask) - _mesa_printf(" DEPTH.w"); - nargs = num_pairinst_args(inst->Alpha.Opcode); - for(i = 0; i < nargs; ++i) { - const char* abs = inst->Alpha.Arg[i].Abs ? "|" : ""; - const char* neg = inst->Alpha.Arg[i].Negate ? "-" : ""; - _mesa_printf(", %s%sSrc%i.%c%s", neg, abs, inst->Alpha.Arg[i].Source, - swizzle_char(inst->Alpha.Arg[i].Swizzle), abs); - } - _mesa_printf("\n"); -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h index ff76178551..1600598428 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h @@ -28,116 +28,97 @@ #ifndef __RADEON_PROGRAM_PAIR_H_ #define __RADEON_PROGRAM_PAIR_H_ -#include "radeon_program.h" +#include "radeon_code.h" +#include "radeon_opcodes.h" +#include "radeon_program_constants.h" struct r300_fragment_program_compiler; /** - * Represents a paired instruction, as found in R300 and R500 + * \file + * Represents a paired ALU instruction, as found in R300 and R500 * fragment programs. + * + * Note that this representation is taking some liberties as far + * as register files are concerned, to allow separate register + * allocation. + * + * Also note that there are some subtleties in that the semantics + * of certain opcodes are implicitly changed in this representation; + * see \ref rc_pair_translate */ + + struct radeon_pair_instruction_source { - GLuint Index:8; - GLuint Constant:1; - GLuint Used:1; + unsigned int Used:1; + rc_register_file File:3; + unsigned int Index:RC_REGISTER_INDEX_BITS; }; struct radeon_pair_instruction_rgb { - GLuint Opcode:8; - GLuint DestIndex:8; - GLuint WriteMask:3; - GLuint OutputWriteMask:3; - GLuint Saturate:1; + rc_opcode Opcode:8; + unsigned int DestIndex:RC_REGISTER_INDEX_BITS; + unsigned int WriteMask:3; + unsigned int OutputWriteMask:3; + unsigned int Saturate:1; struct radeon_pair_instruction_source Src[3]; struct { - GLuint Source:2; - GLuint Swizzle:9; - GLuint Abs:1; - GLuint Negate:1; + unsigned int Source:2; + unsigned int Swizzle:9; + unsigned int Abs:1; + unsigned int Negate:1; } Arg[3]; }; struct radeon_pair_instruction_alpha { - GLuint Opcode:8; - GLuint DestIndex:8; - GLuint WriteMask:1; - GLuint OutputWriteMask:1; - GLuint DepthWriteMask:1; - GLuint Saturate:1; + rc_opcode Opcode:8; + unsigned int DestIndex:RC_REGISTER_INDEX_BITS; + unsigned int WriteMask:1; + unsigned int OutputWriteMask:1; + unsigned int DepthWriteMask:1; + unsigned int Saturate:1; struct radeon_pair_instruction_source Src[3]; struct { - GLuint Source:2; - GLuint Swizzle:3; - GLuint Abs:1; - GLuint Negate:1; + unsigned int Source:2; + unsigned int Swizzle:3; + unsigned int Abs:1; + unsigned int Negate:1; } Arg[3]; }; -struct radeon_pair_instruction { +struct rc_pair_instruction { struct radeon_pair_instruction_rgb RGB; struct radeon_pair_instruction_alpha Alpha; -}; - -enum { - RADEON_OPCODE_TEX = 0, - RADEON_OPCODE_TXB, - RADEON_OPCODE_TXP, - RADEON_OPCODE_KIL + rc_write_aluresult WriteALUResult:2; + rc_compare_func ALUResultCompare:3; }; -struct radeon_pair_texture_instruction { - GLuint Opcode:2; /**< one of RADEON_OPCODE_xxx */ - - GLuint DestIndex:8; - GLuint WriteMask:4; - GLuint TexSrcUnit:5; - GLuint TexSrcTarget:3; - - GLuint SrcIndex:8; - GLuint SrcSwizzle:12; -}; +/** + * General helper functions for dealing with the paired instruction format. + */ +/*@{*/ +int rc_pair_alloc_source(struct rc_pair_instruction *pair, + unsigned int rgb, unsigned int alpha, + rc_register_file file, unsigned int index); +/*@}*/ /** - * + * Compiler passes that operate with the paired format. */ -struct radeon_pair_handler { - /** - * Write a paired instruction to the hardware. - * - * @return GL_FALSE on error. - */ - GLboolean (*EmitPaired)(void*, struct radeon_pair_instruction*); - - /** - * Write a texture instruction to the hardware. - * Register indices have already been rewritten to the allocated - * hardware register numbers. - * - * @return GL_FALSE on error. - */ - GLboolean (*EmitTex)(void*, struct radeon_pair_texture_instruction*); - - /** - * Called before a block of contiguous, independent texture - * instructions is emitted. - */ - GLboolean (*BeginTexBlock)(void*); - - unsigned MaxHwTemps; -}; - -void radeonPairProgram( - struct r300_fragment_program_compiler * compiler, - const struct radeon_pair_handler*, void *userdata); +/*@{*/ +struct radeon_pair_handler; -void radeonPrintPairInstruction(struct radeon_pair_instruction *inst); +void rc_pair_translate(struct r300_fragment_program_compiler *c); +void rc_pair_schedule(struct r300_fragment_program_compiler *c); +void rc_pair_regalloc(struct r300_fragment_program_compiler *c, unsigned maxtemps); +/*@}*/ #endif /* __RADEON_PROGRAM_PAIR_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c new file mode 100644 index 0000000000..d863b82d53 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c @@ -0,0 +1,300 @@ +/* + * Copyright 2009 Nicolai Hähnle <nhaehnle@gmail.com> + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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. */ + +#include "radeon_program.h" + +#include <stdio.h> + +static const char * textarget_to_string(rc_texture_target target) +{ + switch(target) { + case RC_TEXTURE_2D_ARRAY: return "2D_ARRAY"; + case RC_TEXTURE_1D_ARRAY: return "1D_ARRAY"; + case RC_TEXTURE_CUBE: return "CUBE"; + case RC_TEXTURE_3D: return "3D"; + case RC_TEXTURE_RECT: return "RECT"; + case RC_TEXTURE_2D: return "2D"; + case RC_TEXTURE_1D: return "1D"; + default: return "BAD_TEXTURE_TARGET"; + } +} + +static void rc_print_comparefunc(FILE * f, const char * lhs, rc_compare_func func, const char * rhs) +{ + if (func == RC_COMPARE_FUNC_NEVER) { + fprintf(f, "false"); + } else if (func == RC_COMPARE_FUNC_ALWAYS) { + fprintf(f, "true"); + } else { + const char * op; + switch(func) { + case RC_COMPARE_FUNC_LESS: op = "<"; break; + case RC_COMPARE_FUNC_EQUAL: op = "=="; break; + case RC_COMPARE_FUNC_LEQUAL: op = "<="; break; + case RC_COMPARE_FUNC_GREATER: op = ">"; break; + case RC_COMPARE_FUNC_NOTEQUAL: op = "!="; break; + case RC_COMPARE_FUNC_GEQUAL: op = ">="; break; + default: op = "???"; break; + } + fprintf(f, "%s %s %s", lhs, op, rhs); + } +} + +static void rc_print_register(FILE * f, rc_register_file file, int index, unsigned int reladdr) +{ + if (file == RC_FILE_NONE) { + fprintf(f, "none"); + } else if (file == RC_FILE_SPECIAL) { + switch(index) { + case RC_SPECIAL_ALU_RESULT: fprintf(f, "aluresult"); break; + default: fprintf(f, "special[%i]", index); break; + } + } else { + const char * filename; + switch(file) { + case RC_FILE_TEMPORARY: filename = "temp"; break; + case RC_FILE_INPUT: filename = "input"; break; + case RC_FILE_OUTPUT: filename = "output"; break; + case RC_FILE_ADDRESS: filename = "addr"; break; + case RC_FILE_CONSTANT: filename = "const"; break; + default: filename = "BAD FILE"; break; + } + fprintf(f, "%s[%i%s]", filename, index, reladdr ? " + addr[0]" : ""); + } +} + +static void rc_print_mask(FILE * f, unsigned int mask) +{ + if (mask & RC_MASK_X) fprintf(f, "x"); + if (mask & RC_MASK_Y) fprintf(f, "y"); + if (mask & RC_MASK_Z) fprintf(f, "z"); + if (mask & RC_MASK_W) fprintf(f, "w"); +} + +static void rc_print_dst_register(FILE * f, struct rc_dst_register dst) +{ + rc_print_register(f, dst.File, dst.Index, dst.RelAddr); + if (dst.WriteMask != RC_MASK_XYZW) { + fprintf(f, "."); + rc_print_mask(f, dst.WriteMask); + } +} + +static char rc_swizzle_char(unsigned int swz) +{ + switch(swz) { + case RC_SWIZZLE_X: return 'x'; + case RC_SWIZZLE_Y: return 'y'; + case RC_SWIZZLE_Z: return 'z'; + case RC_SWIZZLE_W: return 'w'; + case RC_SWIZZLE_ZERO: return '0'; + case RC_SWIZZLE_ONE: return '1'; + case RC_SWIZZLE_HALF: return 'H'; + case RC_SWIZZLE_UNUSED: return '_'; + } + return '?'; +} + +static void rc_print_swizzle(FILE * f, unsigned int swizzle, unsigned int negate) +{ + unsigned int comp; + for(comp = 0; comp < 4; ++comp) { + rc_swizzle swz = GET_SWZ(swizzle, comp); + if (GET_BIT(negate, comp)) + fprintf(f, "-"); + fprintf(f, "%c", rc_swizzle_char(swz)); + } +} + +static void rc_print_src_register(FILE * f, struct rc_src_register src) +{ + int trivial_negate = (src.Negate == RC_MASK_NONE || src.Negate == RC_MASK_XYZW); + + if (src.Negate == RC_MASK_XYZW) + fprintf(f, "-"); + if (src.Abs) + fprintf(f, "|"); + + rc_print_register(f, src.File, src.Index, src.RelAddr); + + if (src.Abs && !trivial_negate) + fprintf(f, "|"); + + if (src.Swizzle != RC_SWIZZLE_XYZW || !trivial_negate) { + fprintf(f, "."); + rc_print_swizzle(f, src.Swizzle, trivial_negate ? 0 : src.Negate); + } + + if (src.Abs && trivial_negate) + fprintf(f, "|"); +} + +static void rc_print_normal_instruction(FILE * f, struct rc_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + unsigned int reg; + + fprintf(f, "%s", opcode->Name); + + switch(inst->U.I.SaturateMode) { + case RC_SATURATE_NONE: break; + case RC_SATURATE_ZERO_ONE: fprintf(f, "_SAT"); break; + case RC_SATURATE_MINUS_PLUS_ONE: fprintf(f, "_SAT2"); break; + default: fprintf(f, "_BAD_SAT"); break; + } + + if (opcode->HasDstReg) { + fprintf(f, " "); + rc_print_dst_register(f, inst->U.I.DstReg); + if (opcode->NumSrcRegs) + fprintf(f, ","); + } + + for(reg = 0; reg < opcode->NumSrcRegs; ++reg) { + if (reg > 0) + fprintf(f, ","); + fprintf(f, " "); + rc_print_src_register(f, inst->U.I.SrcReg[reg]); + } + + if (opcode->HasTexture) { + fprintf(f, ", %s%s[%u]", + textarget_to_string(inst->U.I.TexSrcTarget), + inst->U.I.TexShadow ? "SHADOW" : "", + inst->U.I.TexSrcUnit); + } + + fprintf(f, ";"); + + if (inst->U.I.WriteALUResult) { + fprintf(f, " [aluresult = ("); + rc_print_comparefunc(f, + (inst->U.I.WriteALUResult == RC_ALURESULT_X) ? "x" : "w", + inst->U.I.ALUResultCompare, "0"); + fprintf(f, ")]"); + } + + fprintf(f, "\n"); +} + +static void rc_print_pair_instruction(FILE * f, struct rc_instruction * fullinst) +{ + struct rc_pair_instruction * inst = &fullinst->U.P; + int printedsrc = 0; + + for(unsigned int src = 0; src < 3; ++src) { + if (inst->RGB.Src[src].Used) { + if (printedsrc) + fprintf(f, ", "); + fprintf(f, "src%i.xyz = ", src); + rc_print_register(f, inst->RGB.Src[src].File, inst->RGB.Src[src].Index, 0); + printedsrc = 1; + } + if (inst->Alpha.Src[src].Used) { + if (printedsrc) + fprintf(f, ", "); + fprintf(f, "src%i.w = ", src); + rc_print_register(f, inst->Alpha.Src[src].File, inst->Alpha.Src[src].Index, 0); + printedsrc = 1; + } + } + fprintf(f, "\n"); + + if (inst->RGB.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->RGB.Opcode); + + fprintf(f, " %s%s", opcode->Name, inst->RGB.Saturate ? "_SAT" : ""); + if (inst->RGB.WriteMask) + fprintf(f, " temp[%i].%s%s%s", inst->RGB.DestIndex, + (inst->RGB.WriteMask & 1) ? "x" : "", + (inst->RGB.WriteMask & 2) ? "y" : "", + (inst->RGB.WriteMask & 4) ? "z" : ""); + if (inst->RGB.OutputWriteMask) + fprintf(f, " color.%s%s%s", + (inst->RGB.OutputWriteMask & 1) ? "x" : "", + (inst->RGB.OutputWriteMask & 2) ? "y" : "", + (inst->RGB.OutputWriteMask & 4) ? "z" : ""); + if (inst->WriteALUResult == RC_ALURESULT_X) + fprintf(f, " aluresult"); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + const char* abs = inst->RGB.Arg[arg].Abs ? "|" : ""; + const char* neg = inst->RGB.Arg[arg].Negate ? "-" : ""; + fprintf(f, ", %s%ssrc%i.%c%c%c%s", neg, abs, inst->RGB.Arg[arg].Source, + rc_swizzle_char(GET_SWZ(inst->RGB.Arg[arg].Swizzle, 0)), + rc_swizzle_char(GET_SWZ(inst->RGB.Arg[arg].Swizzle, 1)), + rc_swizzle_char(GET_SWZ(inst->RGB.Arg[arg].Swizzle, 2)), + abs); + } + fprintf(f, "\n"); + } + + if (inst->Alpha.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Alpha.Opcode); + + fprintf(f, " %s%s", opcode->Name, inst->Alpha.Saturate ? "_SAT" : ""); + if (inst->Alpha.WriteMask) + fprintf(f, " temp[%i].w", inst->Alpha.DestIndex); + if (inst->Alpha.OutputWriteMask) + fprintf(f, " color.w"); + if (inst->Alpha.DepthWriteMask) + fprintf(f, " depth.w"); + if (inst->WriteALUResult == RC_ALURESULT_W) + fprintf(f, " aluresult"); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + const char* abs = inst->Alpha.Arg[arg].Abs ? "|" : ""; + const char* neg = inst->Alpha.Arg[arg].Negate ? "-" : ""; + fprintf(f, ", %s%ssrc%i.%c%s", neg, abs, inst->Alpha.Arg[arg].Source, + rc_swizzle_char(inst->Alpha.Arg[arg].Swizzle), abs); + } + fprintf(f, "\n"); + } + + if (inst->WriteALUResult) { + fprintf(f, " [aluresult = ("); + rc_print_comparefunc(f, "result", inst->ALUResultCompare, "0"); + fprintf(f, ")]\n"); + } +} + +/** + * Print program to stderr, default options. + */ +void rc_print_program(const struct rc_program *prog) +{ + unsigned int linenum = 0; + struct rc_instruction *inst; + + fprintf(stderr, "# Radeon Compiler Program\n"); + + for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { + fprintf(stderr, "%3d: ", linenum); + + if (inst->Type == RC_INSTRUCTION_PAIR) + rc_print_pair_instruction(stderr, inst); + else + rc_print_normal_instruction(stderr, inst); + + linenum++; + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h b/src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h new file mode 100644 index 0000000000..c81d5f7a5e --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_SWIZZLE_H +#define RADEON_SWIZZLE_H + +#include "radeon_program.h" + +struct rc_swizzle_split { + unsigned char NumPhases; + unsigned char Phase[4]; +}; + +/** + * Describe the swizzling capability of target hardware. + */ +struct rc_swizzle_caps { + /** + * Check whether the given swizzle, absolute and negate combination + * can be implemented natively by the hardware for this opcode. + * + * \return 1 if the swizzle is native for the given opcode + */ + int (*IsNative)(rc_opcode opcode, struct rc_src_register reg); + + /** + * Determine how to split access to the masked channels of the + * given source register to obtain ALU-native swizzles. + */ + void (*Split)(struct rc_src_register reg, unsigned int mask, struct rc_swizzle_split * split); +}; + +#endif /* RADEON_SWIZZLE_H */ diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 0fe32a5443..da5b7ba642 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -684,11 +684,7 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.rb3d_dither_ctl.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_DITHER_CTL, 9); ALLOC_STATE(rb3d_aaresolve_ctl, always, 2, 0); r300->hw.rb3d_aaresolve_ctl.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_AARESOLVE_CTL, 1); - if ((r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) || - ( !r300->radeon.radeonScreen->kernel_mm && ( - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS400) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV410) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R420) ) ) ) { + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV350) { ALLOC_STATE(rb3d_discard_src_pixel_lte_threshold, always, 3, 0); } else { ALLOC_STATE(rb3d_discard_src_pixel_lte_threshold, never, 3, 0); @@ -697,6 +693,14 @@ void r300InitCmdBuf(r300ContextPtr r300) ALLOC_STATE(zs, always, R300_ZS_CMDSIZE, 0); r300->hw.zs.cmd[R300_ZS_CMD_0] = cmdpacket0(r300->radeon.radeonScreen, R300_ZB_CNTL, 3); + if (is_r500) { + if (r300->radeon.radeonScreen->kernel_mm) + ALLOC_STATE(zsb, always, R300_ZSB_CMDSIZE, 0); + else + ALLOC_STATE(zsb, never, R300_ZSB_CMDSIZE, 0); + r300->hw.zsb.cmd[R300_ZSB_CMD_0] = + cmdpacket0(r300->radeon.radeonScreen, R500_ZB_STENCILREFMASK_BF, 1); + } ALLOC_STATE(zstencil_format, always, 5, 0); r300->hw.zstencil_format.cmd[0] = diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 9df3897e65..2c2b16aa98 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -84,6 +84,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_EXT_framebuffer_object #define need_GL_EXT_fog_coord #define need_GL_EXT_gpu_program_parameters +#define need_GL_EXT_provoking_vertex #define need_GL_EXT_secondary_color #define need_GL_EXT_stencil_two_side #define need_GL_ATI_separate_stencil @@ -116,6 +117,7 @@ const struct dri_extension card_extensions[] = { {"GL_EXT_packed_depth_stencil", NULL}, {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, {"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions}, + {"GL_EXT_provoking_vertex", GL_EXT_provoking_vertex_functions }, {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, {"GL_EXT_shadow_funcs", NULL}, {"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions}, diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 1dadcc0a69..518d5cdbf4 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -234,6 +234,10 @@ typedef struct r300_context *r300ContextPtr; #define R300_ZS_CNTL_2 3 #define R300_ZS_CMDSIZE 4 +#define R300_ZSB_CMD_0 0 +#define R300_ZSB_CNTL_0 1 +#define R300_ZSB_CMDSIZE 2 + #define R300_ZB_CMD_0 0 #define R300_ZB_OFFSET 1 #define R300_ZB_PITCH 2 @@ -343,6 +347,7 @@ struct r300_hw_state { struct radeon_state_atom rb3d_aaresolve_ctl; /* (4E88) */ struct radeon_state_atom rb3d_discard_src_pixel_lte_threshold; /* (4E88) I saw it only written on RV350 hardware.. */ struct radeon_state_atom zs; /* zstencil control (4F00) */ + struct radeon_state_atom zsb; /* zstencil bf */ struct radeon_state_atom zstencil_format; struct radeon_state_atom zb; /* z buffer (4F20) */ struct radeon_state_atom zb_depthclearvalue; /* (4F28) */ diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 70c9252894..267ee81a7a 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -44,6 +44,7 @@ #include "compiler/radeon_compiler.h" +#include "radeon_mesa_to_rc.h" #include "r300_state.h" @@ -131,7 +132,7 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler, */ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r300_fragment_program * fp) { - struct prog_src_register src; + struct rc_src_register src; int i; fp->fog_attr = FRAG_ATTRIB_MAX; @@ -155,7 +156,7 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r } memset(&src, 0, sizeof(src)); - src.File = PROGRAM_INPUT; + src.File = RC_FILE_INPUT; src.Index = fp->fog_attr; src.Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ONE); rc_move_input(&compiler->Base, FRAG_ATTRIB_FOGC, src); @@ -232,7 +233,7 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog fflush(stderr); } - rc_mesa_to_rc_program(&compiler.Base, &cont->Base.Base); + radeon_mesa_to_rc_program(&compiler.Base, &cont->Base.Base); insert_WPOS_trailer(&compiler, fp); diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 39b4b61a10..623da60333 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -1022,15 +1022,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. R300_GA_COLOR_CONTROL_RGB0_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA0_SHADING_GOURAUD | \ R300_GA_COLOR_CONTROL_RGB1_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD | \ R300_GA_COLOR_CONTROL_RGB2_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA2_SHADING_GOURAUD | \ - R300_GA_COLOR_CONTROL_RGB3_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD | \ - R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST ) + R300_GA_COLOR_CONTROL_RGB3_SHADING_GOURAUD | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD) /** TODO: might be candidate for removal, the GOURAUD stuff also looks buggy to me */ # define R300_RE_SHADE_MODEL_FLAT ( \ R300_GA_COLOR_CONTROL_RGB0_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA0_SHADING_FLAT | \ R300_GA_COLOR_CONTROL_RGB1_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA1_SHADING_GOURAUD | \ R300_GA_COLOR_CONTROL_RGB2_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA2_SHADING_FLAT | \ - R300_GA_COLOR_CONTROL_RGB3_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD | \ - R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST ) + R300_GA_COLOR_CONTROL_RGB3_SHADING_FLAT | R300_GA_COLOR_CONTROL_ALPHA3_SHADING_GOURAUD) /* Specifies red & green components of fill color -- S312 format -- Backwards comp. */ #define R300_GA_SOLID_RG 0x427c @@ -2315,6 +2313,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_Z_WRITE_ENABLE (1 << 2) # define R300_Z_SIGNED_COMPARE (1 << 3) # define R300_STENCIL_FRONT_BACK (1 << 4) +# define R400_ZSIGNED_MAGNITUDE (1 << 5) +# define R500_STENCIL_REFMASK_FRONT_BACK (1 << 6) #define R300_ZB_ZSTENCILCNTL 0x4f04 /* functions */ @@ -3002,6 +3002,8 @@ enum { # define R500_INST_RGB_CLAMP (1 << 19) # define R500_INST_ALPHA_CLAMP (1 << 20) # define R500_INST_ALU_RESULT_SEL (1 << 21) +# define R500_INST_ALU_RESULT_SEL_RED (0 << 21) +# define R500_INST_ALU_RESULT_SEL_ALPHA (1 << 21) # define R500_INST_ALPHA_PRED_INV (1 << 22) # define R500_INST_ALU_RESULT_OP_EQ (0 << 23) # define R500_INST_ALU_RESULT_OP_LT (1 << 23) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 9301543d38..3060f49aaf 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -590,7 +590,9 @@ static void r300SetDepthState(GLcontext * ctx) r300ContextPtr r300 = R300_CONTEXT(ctx); R300_STATECHANGE(r300, zs); - r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_STENCIL_ENABLE|R300_STENCIL_FRONT_BACK; + r300->hw.zs.cmd[R300_ZS_CNTL_0] &= (R300_STENCIL_ENABLE | + R300_STENCIL_FRONT_BACK | + R500_STENCIL_REFMASK_FRONT_BACK); r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_Z_FUNC_SHIFT); if (ctx->Depth.Test) { @@ -604,11 +606,16 @@ static void r300SetDepthState(GLcontext * ctx) static void r300CatchStencilFallback(GLcontext *ctx) { + r300ContextPtr rmesa = R300_CONTEXT(ctx); const unsigned back = ctx->Stencil._BackFace; - if (ctx->Stencil._Enabled && (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[back] - || ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[back] - || ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[back])) { + if (rmesa->radeon.radeonScreen->kernel_mm && + (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515)) { + r300SwitchFallback(ctx, R300_FALLBACK_STENCIL_TWOSIDE, GL_FALSE); + } else if (ctx->Stencil._Enabled && + (ctx->Stencil.Ref[0] != ctx->Stencil.Ref[back] + || ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[back] + || ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[back])) { r300SwitchFallback(ctx, R300_FALLBACK_STENCIL_TWOSIDE, GL_TRUE); } else { r300SwitchFallback(ctx, R300_FALLBACK_STENCIL_TWOSIDE, GL_FALSE); @@ -915,11 +922,24 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= (flag << R300_S_BACK_FUNC_SHIFT); rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= refmask; + + if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + rmesa->hw.zs.cmd[R300_ZS_CNTL_0] |= R500_STENCIL_REFMASK_FRONT_BACK; + R300_STATECHANGE(rmesa, zsb); + refmask = ((ctx->Stencil.Ref[back] & 0xff) << R300_STENCILREF_SHIFT) + | ((ctx->Stencil.ValueMask[back] & 0xff) << R300_STENCILMASK_SHIFT); + + rmesa->hw.zsb.cmd[R300_ZSB_CNTL_0] &= + ~((R300_STENCILREF_MASK << R300_STENCILREF_SHIFT) | + (R300_STENCILREF_MASK << R300_STENCILMASK_SHIFT)); + rmesa->hw.zsb.cmd[R300_ZSB_CNTL_0] |= refmask; + } } static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) { r300ContextPtr rmesa = R300_CONTEXT(ctx); + const unsigned back = ctx->Stencil._BackFace; r300CatchStencilFallback(ctx); @@ -931,6 +951,13 @@ static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) (ctx->Stencil. WriteMask[0] & R300_STENCILREF_MASK) << R300_STENCILWRITEMASK_SHIFT; + if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + R300_STATECHANGE(rmesa, zsb); + rmesa->hw.zsb.cmd[R300_ZSB_CNTL_0] |= + (ctx->Stencil. + WriteMask[back] & R300_STENCILREF_MASK) << + R300_STENCILWRITEMASK_SHIFT; + } } static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, @@ -2253,6 +2280,14 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) R300_STATECHANGE(r300, zb); } + if (new_state & (_NEW_LIGHT)) { + R300_STATECHANGE(r300, shade2); + if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION) + r300->hw.shade2.cmd[1] |= R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST; + else + r300->hw.shade2.cmd[1] &= ~R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST; + } + r300->radeon.NewGLState |= new_state; } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index ed8b788108..c2f96af2c1 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -41,7 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "compiler/radeon_compiler.h" -#include "compiler/radeon_nqssadce.h" +#include "radeon_mesa_to_rc.h" #include "r300_context.h" #include "r300_fragprog_common.h" #include "r300_state.h" @@ -211,20 +211,20 @@ static void initialize_NV_registers(struct radeon_compiler * compiler) for(reg = 0; reg < 12; ++reg) { inst = rc_insert_new_instruction(compiler, &compiler->Program.Instructions); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_TEMPORARY; - inst->I.DstReg.Index = reg; - inst->I.SrcReg[0].File = PROGRAM_BUILTIN; - inst->I.SrcReg[0].Swizzle = SWIZZLE_0000; + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = reg; + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000; } inst = rc_insert_new_instruction(compiler, &compiler->Program.Instructions); - inst->I.Opcode = OPCODE_ARL; - inst->I.DstReg.File = PROGRAM_ADDRESS; - inst->I.DstReg.Index = 0; - inst->I.DstReg.WriteMask = WRITEMASK_X; - inst->I.SrcReg[0].File = PROGRAM_BUILTIN; - inst->I.SrcReg[0].Swizzle = SWIZZLE_0000; + inst->U.I.Opcode = RC_OPCODE_ARL; + inst->U.I.DstReg.File = RC_FILE_ADDRESS; + inst->U.I.DstReg.Index = 0; + inst->U.I.DstReg.WriteMask = WRITEMASK_X; + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000; } static struct r300_vertex_program *build_program(GLcontext *ctx, @@ -255,7 +255,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, _mesa_insert_mvp_code(ctx, vp->Base); } - rc_mesa_to_rc_program(&compiler.Base, &vp->Base->Base); + radeon_mesa_to_rc_program(&compiler.Base, &vp->Base->Base); if (mesa_vp->IsNVProgram) initialize_NV_registers(&compiler.Base); diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index 250570f6b8..da4812d323 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -51,26 +51,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_screen.h" -#if R200_MERGED -extern void radeonFallback(GLcontext * ctx, GLuint bit, GLboolean mode); - -#define FALLBACK( radeon, bit, mode ) do { \ - if ( 0 ) fprintf( stderr, "FALLBACK in %s: #%d=%d\n", \ - __FUNCTION__, bit, mode ); \ - radeonFallback( (radeon)->glCtx, bit, mode ); \ -} while (0) -#else #define FALLBACK( radeon, bit, mode ) fprintf(stderr, "%s:%s\n", __LINE__, __FILE__); -#endif /* TCL fallbacks */ extern void radeonTclFallback(GLcontext * ctx, GLuint bit, GLboolean mode); -#if R200_MERGED -#define TCL_FALLBACK( ctx, bit, mode ) radeonTclFallback( ctx, bit, mode ) -#else #define TCL_FALLBACK( ctx, bit, mode ) ; -#endif #endif /* __RADEON_CONTEXT_H__ */ diff --git a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c new file mode 100644 index 0000000000..9f9dec840b --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. + * + */ + +#include "radeon_mesa_to_rc.h" + +#include "main/mtypes.h" +#include "shader/prog_instruction.h" +#include "shader/prog_parameter.h" + +#include "compiler/radeon_compiler.h" +#include "compiler/radeon_program.h" + + +static rc_opcode translate_opcode(gl_inst_opcode opcode) +{ + switch(opcode) { + case OPCODE_NOP: return RC_OPCODE_NOP; + case OPCODE_ABS: return RC_OPCODE_ABS; + case OPCODE_ADD: return RC_OPCODE_ADD; + case OPCODE_ARL: return RC_OPCODE_ARL; + case OPCODE_CMP: return RC_OPCODE_CMP; + case OPCODE_COS: return RC_OPCODE_COS; + case OPCODE_DDX: return RC_OPCODE_DDX; + case OPCODE_DDY: return RC_OPCODE_DDY; + case OPCODE_DP3: return RC_OPCODE_DP3; + case OPCODE_DP4: return RC_OPCODE_DP4; + case OPCODE_DPH: return RC_OPCODE_DPH; + case OPCODE_DST: return RC_OPCODE_DST; + case OPCODE_EX2: return RC_OPCODE_EX2; + case OPCODE_EXP: return RC_OPCODE_EXP; + case OPCODE_FLR: return RC_OPCODE_FLR; + case OPCODE_FRC: return RC_OPCODE_FRC; + case OPCODE_KIL: return RC_OPCODE_KIL; + case OPCODE_LG2: return RC_OPCODE_LG2; + case OPCODE_LIT: return RC_OPCODE_LIT; + case OPCODE_LOG: return RC_OPCODE_LOG; + case OPCODE_LRP: return RC_OPCODE_LRP; + case OPCODE_MAD: return RC_OPCODE_MAD; + case OPCODE_MAX: return RC_OPCODE_MAX; + case OPCODE_MIN: return RC_OPCODE_MIN; + case OPCODE_MOV: return RC_OPCODE_MOV; + case OPCODE_MUL: return RC_OPCODE_MUL; + case OPCODE_POW: return RC_OPCODE_POW; + case OPCODE_RCP: return RC_OPCODE_RCP; + case OPCODE_RSQ: return RC_OPCODE_RSQ; + case OPCODE_SCS: return RC_OPCODE_SCS; + case OPCODE_SEQ: return RC_OPCODE_SEQ; + case OPCODE_SFL: return RC_OPCODE_SFL; + case OPCODE_SGE: return RC_OPCODE_SGE; + case OPCODE_SGT: return RC_OPCODE_SGT; + case OPCODE_SIN: return RC_OPCODE_SIN; + case OPCODE_SLE: return RC_OPCODE_SLE; + case OPCODE_SLT: return RC_OPCODE_SLT; + case OPCODE_SNE: return RC_OPCODE_SNE; + case OPCODE_SUB: return RC_OPCODE_SUB; + case OPCODE_SWZ: return RC_OPCODE_SWZ; + case OPCODE_TEX: return RC_OPCODE_TEX; + case OPCODE_TXB: return RC_OPCODE_TXB; + case OPCODE_TXD: return RC_OPCODE_TXD; + case OPCODE_TXL: return RC_OPCODE_TXL; + case OPCODE_TXP: return RC_OPCODE_TXP; + case OPCODE_XPD: return RC_OPCODE_XPD; + default: return RC_OPCODE_ILLEGAL_OPCODE; + } +} + +static rc_saturate_mode translate_saturate(unsigned int saturate) +{ + switch(saturate) { + default: + case SATURATE_OFF: return RC_SATURATE_NONE; + case SATURATE_ZERO_ONE: return RC_SATURATE_ZERO_ONE; + } +} + +static rc_register_file translate_register_file(unsigned int file) +{ + switch(file) { + case PROGRAM_TEMPORARY: return RC_FILE_TEMPORARY; + case PROGRAM_INPUT: return RC_FILE_INPUT; + case PROGRAM_OUTPUT: return RC_FILE_OUTPUT; + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_STATE_VAR: + case PROGRAM_NAMED_PARAM: + case PROGRAM_CONSTANT: + case PROGRAM_UNIFORM: return RC_FILE_CONSTANT; + case PROGRAM_ADDRESS: return RC_FILE_ADDRESS; + default: return RC_FILE_NONE; + } +} + +static void translate_srcreg(struct rc_src_register * dest, struct prog_src_register * src) +{ + dest->File = translate_register_file(src->File); + dest->Index = src->Index; + dest->RelAddr = src->RelAddr; + dest->Swizzle = src->Swizzle; + dest->Abs = src->Abs; + dest->Negate = src->Negate; +} + +static void translate_dstreg(struct rc_dst_register * dest, struct prog_dst_register * src) +{ + dest->File = translate_register_file(src->File); + dest->Index = src->Index; + dest->RelAddr = src->RelAddr; + dest->WriteMask = src->WriteMask; +} + +static rc_texture_target translate_tex_target(gl_texture_index target) +{ + switch(target) { + case TEXTURE_2D_ARRAY_INDEX: return RC_TEXTURE_2D_ARRAY; + case TEXTURE_1D_ARRAY_INDEX: return RC_TEXTURE_1D_ARRAY; + case TEXTURE_CUBE_INDEX: return RC_TEXTURE_CUBE; + case TEXTURE_3D_INDEX: return RC_TEXTURE_3D; + case TEXTURE_RECT_INDEX: return RC_TEXTURE_RECT; + default: + case TEXTURE_2D_INDEX: return RC_TEXTURE_2D; + case TEXTURE_1D_INDEX: return RC_TEXTURE_1D; + } +} + +static void translate_instruction(struct radeon_compiler * c, + struct rc_instruction * dest, struct prog_instruction * src) +{ + const struct rc_opcode_info * opcode; + unsigned int i; + + dest->U.I.Opcode = translate_opcode(src->Opcode); + if (dest->U.I.Opcode == RC_OPCODE_ILLEGAL_OPCODE) { + rc_error(c, "Unsupported opcode %i\n", src->Opcode); + return; + } + dest->U.I.SaturateMode = translate_saturate(src->SaturateMode); + + opcode = rc_get_opcode_info(dest->U.I.Opcode); + + for(i = 0; i < opcode->NumSrcRegs; ++i) + translate_srcreg(&dest->U.I.SrcReg[i], &src->SrcReg[i]); + + if (opcode->HasDstReg) + translate_dstreg(&dest->U.I.DstReg, &src->DstReg); + + if (opcode->HasTexture) { + dest->U.I.TexSrcUnit = src->TexSrcUnit; + dest->U.I.TexSrcTarget = translate_tex_target(src->TexSrcTarget); + dest->U.I.TexShadow = src->TexShadow; + } +} + +void radeon_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program) +{ + struct prog_instruction *source; + unsigned int i; + + for(source = program->Instructions; source->Opcode != OPCODE_END; ++source) { + struct rc_instruction * dest = rc_insert_new_instruction(c, c->Program.Instructions.Prev); + translate_instruction(c, dest, source); + } + + c->Program.ShadowSamplers = program->ShadowSamplers; + c->Program.InputsRead = program->InputsRead; + c->Program.OutputsWritten = program->OutputsWritten; + + int isNVProgram = 0; + + if (program->Target == GL_VERTEX_PROGRAM_ARB) { + struct gl_vertex_program * vp = (struct gl_vertex_program *) program; + isNVProgram = vp->IsNVProgram; + } + + if (isNVProgram) { + /* NV_vertex_program has a fixed-sized constant environment. + * This could be handled more efficiently for programs that + * do not use relative addressing. + */ + for(i = 0; i < 96; ++i) { + struct rc_constant constant; + + constant.Type = RC_CONSTANT_EXTERNAL; + constant.Size = 4; + constant.u.External = i; + + rc_constants_add(&c->Program.Constants, &constant); + } + } else { + for(i = 0; i < program->Parameters->NumParameters; ++i) { + struct rc_constant constant; + + constant.Type = RC_CONSTANT_EXTERNAL; + constant.Size = 4; + constant.u.External = i; + + rc_constants_add(&c->Program.Constants, &constant); + } + } +} diff --git a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h new file mode 100644 index 0000000000..9511a04f36 --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * 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 (including the + * next paragraph) 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 RADEON_MESA_TO_RC_H +#define RADEON_MESA_TO_RC_H + +struct gl_program; +struct radeon_compiler; + +void radeon_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program); + +#endif /* RADEON_MESA_TO_RC_H */ diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index d925a2dfe3..9b7c42042e 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -29,6 +29,7 @@ COMMON_SOURCES = \ RADEON_COMMON_SOURCES = \ radeon_bo_legacy.c \ radeon_common_context.c \ + radeon_buffer_objects.c \ radeon_common.c \ radeon_cs_legacy.c \ radeon_dma.c \ @@ -65,8 +66,7 @@ DRIVER_SOURCES = \ C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) -DRIVER_DEFINES = -DCOMPILE_R600 -DR200_MERGED=0 \ - -DRADEON_COMMON=1 -DRADEON_COMMON_FOR_R600 \ +DRIVER_DEFINES = -DRADEON_R600 \ # -DRADEON_BO_TRACK \ -Wall @@ -76,4 +76,3 @@ DRI_LIB_DEPS += $(RADEON_LDFLAGS) include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index e0b77d4385..ba0d450cbb 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -59,6 +59,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_debug.h" #include "r600_context.h" #include "radeon_common_context.h" +#include "radeon_buffer_objects.h" #include "radeon_span.h" #include "r600_cmdbuf.h" #include "r600_emit.h" @@ -85,6 +86,7 @@ int hw_tcl_on = 1; #define need_GL_EXT_framebuffer_object #define need_GL_EXT_fog_coord #define need_GL_EXT_gpu_program_parameters +#define need_GL_EXT_provoking_vertex #define need_GL_EXT_secondary_color #define need_GL_EXT_stencil_two_side #define need_GL_ATI_separate_stencil @@ -117,6 +119,7 @@ const struct dri_extension card_extensions[] = { {"GL_EXT_packed_depth_stencil", NULL}, {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, {"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions}, + {"GL_EXT_provoking_vertex", GL_EXT_provoking_vertex_functions }, {"GL_EXT_secondary_color", GL_EXT_secondary_color_functions}, {"GL_EXT_shadow_funcs", NULL}, {"GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions}, @@ -128,6 +131,8 @@ const struct dri_extension card_extensions[] = { {"GL_EXT_texture_lod_bias", NULL}, {"GL_EXT_texture_mirror_clamp", NULL}, {"GL_EXT_texture_rectangle", NULL}, + {"GL_EXT_vertex_array_bgra", NULL}, + {"GL_EXT_texture_sRGB", NULL}, {"GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions}, {"GL_ATI_texture_env_combine3", NULL}, {"GL_ATI_texture_mirror_once", NULL}, @@ -254,6 +259,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, r600InitTextureFuncs(&functions); r700InitShaderFuncs(&functions); r700InitIoctlFuncs(&functions); + radeonInitBufferObjectFuncs(&functions); if (!radeonInitContext(&r600->radeon, &functions, glVisual, driContextPriv, @@ -372,6 +378,8 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } + r700InitDraw(ctx); + radeon_fbo_init(&r600->radeon); radeonInitSpanFuncs( ctx ); @@ -383,9 +391,6 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, if (driQueryOptionb(&r600->radeon.optionCache, "no_rast")) { radeon_warning("disabling 3D acceleration\n"); -#if R200_MERGED - FALLBACK(&r600->radeon, RADEON_FALLBACK_DISABLE, 1); -#endif } return GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 9397ecde81..7f68820fda 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -126,6 +126,32 @@ struct r600_hw_state { struct radeon_state_atom tx_brdr_clr; }; +typedef struct StreamDesc +{ + GLint size; //number of data element + GLenum type; //data element type + GLsizei stride; + + struct radeon_bo *bo; + GLint bo_offset; + + GLuint dwords; + GLuint dst_loc; + GLuint _signed; + GLboolean normalize; + GLboolean is_named_bo; + GLubyte element; +} StreamDesc; + +typedef struct r700_index_buffer +{ + struct radeon_bo *bo; + int bo_offset; + + GLboolean is_32bit; + GLuint count; +} r700_index_buffer; + /** * \brief R600 context structure. */ @@ -144,6 +170,9 @@ struct r600_context { GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; + GLint nNumActiveAos; + StreamDesc stream_desc[VERT_ATTRIB_MAX]; + struct r700_index_buffer ind_buf; }; #define R700_CONTEXT(ctx) ((context_t *)(ctx->DriverCtx)) @@ -177,6 +206,7 @@ extern GLboolean r700SyncSurf(context_t *context, extern void r700SetupStreams(GLcontext * ctx); extern void r700Start3D(context_t *context); extern void r600InitAtoms(context_t *context); +extern void r700InitDraw(GLcontext *ctx); #define RADEON_D_CAPTURE 0 #define RADEON_D_PLAYBACK 1 diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index a30703e41b..ba1371bf95 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -531,6 +531,49 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, GLuint mesa_fo return GL_FALSE; } break; + /* EXT_texture_sRGB */ + case MESA_FORMAT_SRGBA8: + SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + SETbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit); + break; + case MESA_FORMAT_SLA8: + SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + SETbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit); + break; + case MESA_FORMAT_SL8: /* X, X, X, ONE */ + SETfield(t->SQ_TEX_RESOURCE1, FMT_8, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1, + SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + SETbit(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__FORCE_DEGAMMA_bit); + break; default: /* Not supported format */ return GL_FALSE; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 6ff08e1cfb..917318c02a 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -791,6 +791,133 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, return GL_TRUE; } +GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, + GLuint destination_register, + GLenum type, + GLint size, + GLubyte element, + GLuint _signed, + GLboolean normalize, + VTX_FETCH_METHOD * pFetchMethod) +{ + GLuint client_size_inbyte; + GLuint data_format; + GLuint mega_fetch_count; + GLuint is_mega_fetch_flag; + + R700VertexGenericFetch* vfetch_instruction_ptr; + R700VertexGenericFetch* assembled_vfetch_instruction_ptr + = pAsm->vfetch_instruction_ptr_array[element]; + + if (assembled_vfetch_instruction_ptr == NULL) + { + vfetch_instruction_ptr = (R700VertexGenericFetch*) CALLOC_STRUCT(R700VertexGenericFetch); + if (vfetch_instruction_ptr == NULL) + { + return GL_FALSE; + } + Init_R700VertexGenericFetch(vfetch_instruction_ptr); + } + else + { + vfetch_instruction_ptr = assembled_vfetch_instruction_ptr; + } + + data_format = GetSurfaceFormat(type, size, &client_size_inbyte); + + if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here + { + //TODO : mini fetch + } + else + { + mega_fetch_count = MEGA_FETCH_BYTES - 1; + is_mega_fetch_flag = 0x1; + pFetchMethod->mega_fetch_remainder = MEGA_FETCH_BYTES - client_size_inbyte; + } + + vfetch_instruction_ptr->m_Word0.f.vtx_inst = SQ_VTX_INST_FETCH; + vfetch_instruction_ptr->m_Word0.f.fetch_type = SQ_VTX_FETCH_VERTEX_DATA; + vfetch_instruction_ptr->m_Word0.f.fetch_whole_quad = 0x0; + + vfetch_instruction_ptr->m_Word0.f.buffer_id = element; + vfetch_instruction_ptr->m_Word0.f.src_gpr = 0x0; + vfetch_instruction_ptr->m_Word0.f.src_rel = SQ_ABSOLUTE; + vfetch_instruction_ptr->m_Word0.f.src_sel_x = SQ_SEL_X; + vfetch_instruction_ptr->m_Word0.f.mega_fetch_count = mega_fetch_count; + + vfetch_instruction_ptr->m_Word1.f.dst_sel_x = (size < 1) ? SQ_SEL_0 : SQ_SEL_X; + vfetch_instruction_ptr->m_Word1.f.dst_sel_y = (size < 2) ? SQ_SEL_0 : SQ_SEL_Y; + vfetch_instruction_ptr->m_Word1.f.dst_sel_z = (size < 3) ? SQ_SEL_0 : SQ_SEL_Z; + vfetch_instruction_ptr->m_Word1.f.dst_sel_w = (size < 4) ? SQ_SEL_1 : SQ_SEL_W; + + vfetch_instruction_ptr->m_Word1.f.use_const_fields = 1; + vfetch_instruction_ptr->m_Word1.f.data_format = data_format; + vfetch_instruction_ptr->m_Word2.f.endian_swap = SQ_ENDIAN_NONE; + + if(1 == _signed) + { + vfetch_instruction_ptr->m_Word1.f.format_comp_all = SQ_FORMAT_COMP_SIGNED; + } + else + { + vfetch_instruction_ptr->m_Word1.f.format_comp_all = SQ_FORMAT_COMP_UNSIGNED; + } + + if(GL_TRUE == normalize) + { + vfetch_instruction_ptr->m_Word1.f.num_format_all = SQ_NUM_FORMAT_NORM; + } + else + { + vfetch_instruction_ptr->m_Word1.f.num_format_all = SQ_NUM_FORMAT_INT; + } + + // Destination register + vfetch_instruction_ptr->m_Word1_GPR.f.dst_gpr = destination_register; + vfetch_instruction_ptr->m_Word1_GPR.f.dst_rel = SQ_ABSOLUTE; + + vfetch_instruction_ptr->m_Word2.f.offset = 0; + vfetch_instruction_ptr->m_Word2.f.const_buf_no_stride = 0x0; + + vfetch_instruction_ptr->m_Word2.f.mega_fetch = is_mega_fetch_flag; + + if (assembled_vfetch_instruction_ptr == NULL) + { + if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) + { + return GL_FALSE; + } + + if (pAsm->vfetch_instruction_ptr_array[element] != NULL) + { + return GL_FALSE; + } + else + { + pAsm->vfetch_instruction_ptr_array[element] = vfetch_instruction_ptr; + } + } + + return GL_TRUE; +} + +GLboolean cleanup_vfetch_instructions(r700_AssemblerBase* pAsm) +{ + GLint i; + pAsm->cf_current_clause_type = CF_EMPTY_CLAUSE; + pAsm->cf_current_vtx_clause_ptr = NULL; + + for (i=0; i<VERT_ATTRIB_MAX; i++) + { + pAsm->vfetch_instruction_ptr_array[ i ] = NULL; + } + + cleanup_vfetch_shaderinst(pAsm->pR700Shader); + + return GL_TRUE; +} + GLuint gethelpr(r700_AssemblerBase* pAsm) { GLuint r = pAsm->uHelpReg; @@ -1963,9 +2090,9 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) GLuint contiguous_slots_needed; GLuint uNumSrc = r700GetNumOperands(pAsm); - GLuint channel_swizzle, j; - GLuint chan_counter[4] = {0, 0, 0, 0}; - PVSSRC * pSource[3]; + //GLuint channel_swizzle, j; + //GLuint chan_counter[4] = {0, 0, 0, 0}; + //PVSSRC * pSource[3]; GLboolean bSplitInst = GL_FALSE; if (1 == pAsm->D.dst.math) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index d639592702..8cbca066e9 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -415,6 +415,15 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, GLuint number_of_elements, GLenum dataElementType, VTX_FETCH_METHOD* pFetchMethod); +GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, + GLuint destination_register, + GLenum type, + GLint size, + GLubyte element, + GLuint _signed, + GLboolean normalize, + VTX_FETCH_METHOD * pFetchMethod); +GLboolean cleanup_vfetch_instructions(r700_AssemblerBase* pAsm); GLuint gethelpr(r700_AssemblerBase* pAsm); void resethelpr(r700_AssemblerBase* pAsm); void checkop_init(r700_AssemblerBase* pAsm); diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 06d7e9c9ab..3b7f6fffe0 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -208,6 +208,93 @@ static void r700SetupVTXConstants(GLcontext * ctx, } +extern int getTypeSize(GLenum type); +static void r700SetupVTXConstants2(GLcontext * ctx, + void * pAos, + StreamDesc * pStreamDesc) +{ + context_t *context = R700_CONTEXT(ctx); + struct radeon_aos * paos = (struct radeon_aos *)pAos; + unsigned int nVBsize; + BATCH_LOCALS(&context->radeon); + + unsigned int uSQ_VTX_CONSTANT_WORD0_0; + unsigned int uSQ_VTX_CONSTANT_WORD1_0; + unsigned int uSQ_VTX_CONSTANT_WORD2_0 = 0; + unsigned int uSQ_VTX_CONSTANT_WORD3_0 = 0; + unsigned int uSQ_VTX_CONSTANT_WORD6_0 = 0; + + if (!paos->bo) + return; + + if ((context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV610) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV620) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS780) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS880) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV710)) + r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, TC_ACTION_ENA_bit); + else + r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, VC_ACTION_ENA_bit); + + if(0 == pStreamDesc->stride) + { + nVBsize = paos->count * pStreamDesc->size * getTypeSize(pStreamDesc->type); + } + else + { + nVBsize = paos->count * pStreamDesc->stride; + } + + uSQ_VTX_CONSTANT_WORD0_0 = paos->offset; + uSQ_VTX_CONSTANT_WORD1_0 = nVBsize - 1; + + SETfield(uSQ_VTX_CONSTANT_WORD2_0, 0, BASE_ADDRESS_HI_shift, BASE_ADDRESS_HI_mask); /* TODO */ + SETfield(uSQ_VTX_CONSTANT_WORD2_0, pStreamDesc->stride, SQ_VTX_CONSTANT_WORD2_0__STRIDE_shift, + SQ_VTX_CONSTANT_WORD2_0__STRIDE_mask); + SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(pStreamDesc->type, pStreamDesc->size, NULL), + SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, + SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */ + + if(GL_TRUE == pStreamDesc->normalize) + { + SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM, + SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + } + //else + //{ + // SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT, + // SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + //} + + if(1 == pStreamDesc->_signed) + { + SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); + } + + SETfield(uSQ_VTX_CONSTANT_WORD3_0, 1, MEM_REQUEST_SIZE_shift, MEM_REQUEST_SIZE_mask); + SETfield(uSQ_VTX_CONSTANT_WORD6_0, SQ_TEX_VTX_VALID_BUFFER, + SQ_TEX_RESOURCE_WORD6_0__TYPE_shift, SQ_TEX_RESOURCE_WORD6_0__TYPE_mask); + + BEGIN_BATCH_NO_AUTOSTATE(9 + 2); + + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); + R600_OUT_BATCH((pStreamDesc->element + SQ_FETCH_RESOURCE_VS_OFFSET) * FETCH_RESOURCE_STRIDE); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD0_0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD1_0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD2_0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD3_0); + R600_OUT_BATCH(0); + R600_OUT_BATCH(0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD6_0); + R600_OUT_BATCH_RELOC(uSQ_VTX_CONSTANT_WORD0_0, + paos->bo, + uSQ_VTX_CONSTANT_WORD0_0, + RADEON_GEM_DOMAIN_GTT, 0, 0); + END_BATCH(); + COMMIT_BATCH(); + +} + void r700SetupStreams(GLcontext *ctx) { context_t *context = R700_CONTEXT(ctx); @@ -256,14 +343,24 @@ static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); for(i=0; i<VERT_ATTRIB_MAX; i++) { - if(vp->mesa_program->Base.InputsRead & (1 << i)) { - /* currently aos are packed */ - r700SetupVTXConstants(ctx, - i, - (void*)(&context->radeon.tcl.aos[j]), - (unsigned int)context->radeon.tcl.aos[j].components, - (unsigned int)context->radeon.tcl.aos[j].stride * 4, - (unsigned int)context->radeon.tcl.aos[j].count); + if(vp->mesa_program->Base.InputsRead & (1 << i)) + { + if(1 == context->selected_vp->uiVersion) + { + /* currently aos are packed */ + r700SetupVTXConstants(ctx, + i, + (void*)(&context->radeon.tcl.aos[j]), + (unsigned int)context->radeon.tcl.aos[j].components, + (unsigned int)context->radeon.tcl.aos[j].stride * 4, + (unsigned int)context->radeon.tcl.aos[j].count); + } + else + { /* context->selected_vp->uiVersion == 2 : aos not always packed */ + r700SetupVTXConstants2(ctx, + (void*)(&context->radeon.tcl.aos[j]), + &(context->stream_desc[j])); + } j++; } } diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index b1c3648ca5..4f39d9f1bd 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -43,6 +43,7 @@ #include "tnl/t_context.h" #include "tnl/t_vertex.h" #include "tnl/t_pipeline.h" +#include "vbo/vbo_context.h" #include "r600_context.h" #include "r600_cmdbuf.h" @@ -53,6 +54,7 @@ #include "r700_fragprog.h" #include "r700_state.h" +#include "radeon_buffer_objects.h" #include "radeon_common_context.h" void r700WaitForIdle(context_t *context); @@ -249,78 +251,134 @@ static int r700NumVerts(int num_verts, int prim) static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) { - context_t *context = R700_CONTEXT(ctx); - BATCH_LOCALS(&context->radeon); - int type, i, total_emit; - int num_indices; - uint32_t vgt_draw_initiator = 0; - uint32_t vgt_index_type = 0; - uint32_t vgt_primitive_type = 0; - uint32_t vgt_num_indices = 0; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - - type = r700PrimitiveType(prim); - num_indices = r700NumVerts(end - start, prim); - - radeon_print(RADEON_RENDER, RADEON_TRACE, - "%s type %x num_indices %d\n", - __func__, type, num_indices); - - if (type < 0 || num_indices <= 0) - return; + context_t *context = R700_CONTEXT(ctx); + BATCH_LOCALS(&context->radeon); + int type, i, total_emit; + int num_indices; + uint32_t vgt_draw_initiator = 0; + uint32_t vgt_index_type = 0; + uint32_t vgt_primitive_type = 0; + uint32_t vgt_num_indices = 0; + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; + GLboolean bUseDrawIndex; + + if(NULL != context->ind_buf.bo) + { + bUseDrawIndex = GL_TRUE; + } + else + { + bUseDrawIndex = GL_FALSE; + } + + type = r700PrimitiveType(prim); + num_indices = r700NumVerts(end - start, prim); + + radeon_print(RADEON_RENDER, RADEON_TRACE, + "%s type %x num_indices %d\n", + __func__, type, num_indices); + + if (type < 0 || num_indices <= 0) + return; + if(GL_TRUE == bUseDrawIndex) + { + total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + 5 + 2; /* DRAW_INDEX */ + } + else + { total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ + + 2 /* NUM_INSTANCES */ + num_indices + 3; /* DRAW_INDEX_IMMD */ + } - BEGIN_BATCH_NO_AUTOSTATE(total_emit); - // prim - SETfield(vgt_primitive_type, type, - VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); - R600_OUT_BATCH(mmVGT_PRIMITIVE_TYPE - ASIC_CONFIG_BASE_INDEX); - R600_OUT_BATCH(vgt_primitive_type); + BEGIN_BATCH_NO_AUTOSTATE(total_emit); + // prim + SETfield(vgt_primitive_type, type, + VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); + R600_OUT_BATCH(mmVGT_PRIMITIVE_TYPE - ASIC_CONFIG_BASE_INDEX); + R600_OUT_BATCH(vgt_primitive_type); // index type - SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); - R600_OUT_BATCH(vgt_index_type); + SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); - // num instances - R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); - R600_OUT_BATCH(1); + if(GL_TRUE == bUseDrawIndex) + { + if(GL_TRUE != context->ind_buf.is_32bit) + { + SETfield(vgt_index_type, DI_INDEX_SIZE_16_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); + } + } + + R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); + R600_OUT_BATCH(vgt_index_type); + + // num instances + R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); + R600_OUT_BATCH(1); + + // draw packet + vgt_num_indices = num_indices; - // draw packet - vgt_num_indices = num_indices; + if(GL_TRUE == bUseDrawIndex) + { + SETfield(vgt_draw_initiator, DI_SRC_SEL_DMA, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + } + else + { SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + } + SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); + if(GL_TRUE == bUseDrawIndex) + { + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); + R600_OUT_BATCH(context->ind_buf.bo_offset); + R600_OUT_BATCH(0); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + R600_OUT_BATCH_RELOC(context->ind_buf.bo_offset, + context->ind_buf.bo, + context->ind_buf.bo_offset, + RADEON_GEM_DOMAIN_GTT, 0, 0); + } + else + { R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); R600_OUT_BATCH(vgt_num_indices); R600_OUT_BATCH(vgt_draw_initiator); - for (i = start; i < (start + num_indices); i++) { - if(vb->Elts) - R600_OUT_BATCH(vb->Elts[i]); - else - R600_OUT_BATCH(i); + for (i = start; i < (start + num_indices); i++) + { + if(vb->Elts) + { + R600_OUT_BATCH(vb->Elts[i]); + } + else + { + R600_OUT_BATCH(i); + } } - END_BATCH(); - COMMIT_BATCH(); + } + END_BATCH(); + COMMIT_BATCH(); } /* start 3d, idle, cb/db flush */ #define PRE_EMIT_STATE_BUFSZ 10 + 5 + 14 -static GLuint r700PredictRenderSize(GLcontext* ctx) +static GLuint r700PredictRenderSize(GLcontext* ctx, GLuint nr_prims) { context_t *context = R700_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); struct r700_vertex_program *vp = context->selected_vp; - struct vertex_buffer *vb = &tnl->vb; GLboolean flushed; GLuint dwords, i; GLuint state_size; @@ -328,8 +386,15 @@ static GLuint r700PredictRenderSize(GLcontext* ctx) context->radeon.tcl.aos_count = _mesa_bitcount(vp->mesa_program->Base.InputsRead); dwords = PRE_EMIT_STATE_BUFSZ; - for (i = 0; i < vb->PrimitiveCount; i++) - dwords += vb->Primitive[i].count + 10; + if (nr_prims) + dwords += nr_prims * 14; + else { + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; + + for (i = 0; i < vb->PrimitiveCount; i++) + dwords += vb->Primitive[i].count + 10; + } state_size = radeonCountStateEmitSize(&context->radeon); flushed = rcommonEnsureCmdBufSpace(&context->radeon, dwords + state_size, __FUNCTION__); @@ -369,7 +434,7 @@ static GLboolean r700RunRender(GLcontext * ctx, r700SetupFragmentProgram(ctx); r600UpdateTextureState(ctx); - GLuint emit_end = r700PredictRenderSize(ctx) + GLuint emit_end = r700PredictRenderSize(ctx, 0) + context->radeon.cmdbuf.cs->cdw; r700SetupStreams(ctx); @@ -477,4 +542,544 @@ const struct tnl_pipeline_stage *r700_pipeline[] = 0, }; +#define CONVERT( TYPE, MACRO ) do { \ + GLuint i, j, sz; \ + sz = input->Size; \ + if (input->Normalized) { \ + for (i = 0; i < count; i++) { \ + const TYPE *in = (TYPE *)src_ptr; \ + for (j = 0; j < sz; j++) { \ + *dst_ptr++ = MACRO(*in); \ + in++; \ + } \ + src_ptr += stride; \ + } \ + } else { \ + for (i = 0; i < count; i++) { \ + const TYPE *in = (TYPE *)src_ptr; \ + for (j = 0; j < sz; j++) { \ + *dst_ptr++ = (GLfloat)(*in); \ + in++; \ + } \ + src_ptr += stride; \ + } \ + } \ +} while (0) + +/** + * Convert attribute data type to float + * If the attribute uses named buffer object replace the bo with newly allocated bo + */ +static void r700ConvertAttrib(GLcontext *ctx, int count, + const struct gl_client_array *input, + struct StreamDesc *attr) +{ + context_t *context = R700_CONTEXT(ctx); + const GLvoid *src_ptr; + GLboolean mapped_named_bo = GL_FALSE; + GLfloat *dst_ptr; + GLuint stride; + + stride = (input->StrideB == 0) ? getTypeSize(input->Type) * input->Size : input->StrideB; + + /* Convert value for first element only */ + if (input->StrideB == 0) + { + count = 1; + } + + if (input->BufferObj->Name) + { + if (!input->BufferObj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); + mapped_named_bo = GL_TRUE; + } + + src_ptr = ADD_POINTERS(input->BufferObj->Pointer, input->Ptr); + } + else + { + src_ptr = input->Ptr; + } + + radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, + sizeof(GLfloat) * input->Size * count, 32); + dst_ptr = (GLfloat *)ADD_POINTERS(attr->bo->ptr, attr->bo_offset); + + assert(src_ptr != NULL); + + switch (input->Type) + { + case GL_DOUBLE: + CONVERT(GLdouble, (GLfloat)); + break; + case GL_UNSIGNED_INT: + CONVERT(GLuint, UINT_TO_FLOAT); + break; + case GL_INT: + CONVERT(GLint, INT_TO_FLOAT); + break; + case GL_UNSIGNED_SHORT: + CONVERT(GLushort, USHORT_TO_FLOAT); + break; + case GL_SHORT: + CONVERT(GLshort, SHORT_TO_FLOAT); + break; + case GL_UNSIGNED_BYTE: + assert(input->Format != GL_BGRA); + CONVERT(GLubyte, UBYTE_TO_FLOAT); + break; + case GL_BYTE: + CONVERT(GLbyte, BYTE_TO_FLOAT); + break; + default: + assert(0); + break; + } + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); + } +} + +static void r700AlignDataToDword(GLcontext *ctx, + const struct gl_client_array *input, + int count, + struct StreamDesc *attr) +{ + context_t *context = R700_CONTEXT(ctx); + const int dst_stride = (input->StrideB + 3) & ~3; + const int size = getTypeSize(input->Type) * input->Size * count; + GLboolean mapped_named_bo = GL_FALSE; + + radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, size, 32); + + if (!input->BufferObj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); + mapped_named_bo = GL_TRUE; + } + + { + GLvoid *src_ptr = ADD_POINTERS(input->BufferObj->Pointer, input->Ptr); + GLvoid *dst_ptr = ADD_POINTERS(attr->bo->ptr, attr->bo_offset); + int i; + + for (i = 0; i < count; ++i) + { + _mesa_memcpy(dst_ptr, src_ptr, input->StrideB); + src_ptr += input->StrideB; + dst_ptr += dst_stride; + } + } + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); + } + + attr->stride = dst_stride; +} + +static void r700SetupStreams2(GLcontext *ctx, const struct gl_client_array *input[], int count) +{ + context_t *context = R700_CONTEXT(ctx); + GLuint stride; + int ret; + int i, index; + + R600_STATECHANGE(context, vtx); + + for(index = 0; index < context->nNumActiveAos; index++) + { + struct radeon_aos *aos = &context->radeon.tcl.aos[index]; + i = context->stream_desc[index].element; + + stride = (input[i]->StrideB == 0) ? getTypeSize(input[i]->Type) * input[i]->Size : input[i]->StrideB; + + if (input[i]->Type == GL_DOUBLE || input[i]->Type == GL_UNSIGNED_INT || input[i]->Type == GL_INT || +#if MESA_BIG_ENDIAN + getTypeSize(input[i]->Type) != 4 || +#endif + stride < 4) + { + r700ConvertAttrib(ctx, count, input[i], &context->stream_desc[index]); + } + else + { + if (input[i]->BufferObj->Name) + { + if (stride % 4 != 0) + { + assert(((intptr_t) input[i]->Ptr) % input[i]->StrideB == 0); + r700AlignDataToDword(ctx, input[i], count, &context->stream_desc[index]); + context->stream_desc[index].is_named_bo = GL_FALSE; + } + else + { + context->stream_desc[index].stride = input[i]->StrideB; + context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; + context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; + context->stream_desc[index].is_named_bo = GL_TRUE; + } + } + else + { + int size; + int local_count = count; + uint32_t *dst; + + if (input[i]->StrideB == 0) + { + size = getTypeSize(input[i]->Type) * input[i]->Size; + local_count = 1; + } + else + { + size = getTypeSize(input[i]->Type) * input[i]->Size * local_count; + } + + radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, + &context->stream_desc[index].bo_offset, size, 32); + assert(context->stream_desc[index].bo->ptr != NULL); + dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, + context->stream_desc[index].bo_offset); + + switch (context->stream_desc[index].dwords) + { + case 1: + radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 4; + break; + case 2: + radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 8; + break; + case 3: + radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 12; + break; + case 4: + radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 16; + break; + default: + assert(0); + break; + } + } + } + + aos->count = context->stream_desc[index].stride == 0 ? 1 : count; + aos->stride = context->stream_desc[index].stride / sizeof(float); + aos->components = context->stream_desc[index].dwords; + aos->bo = context->stream_desc[index].bo; + aos->offset = context->stream_desc[index].bo_offset; + + if(context->stream_desc[index].is_named_bo) + { + radeon_cs_space_add_persistent_bo(context->radeon.cmdbuf.cs, + context->stream_desc[index].bo, + RADEON_GEM_DOMAIN_GTT, 0); + } + } + + context->radeon.tcl.aos_count = context->nNumActiveAos; + ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, + first_elem(&context->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); +} + +static void r700FreeData(GLcontext *ctx) +{ + /* Need to zero tcl.aos[n].bo and tcl.elt_dma_bo + * to prevent double unref in radeonReleaseArrays + * called during context destroy + */ + context_t *context = R700_CONTEXT(ctx); + + int i; + + for (i = 0; i < context->nNumActiveAos; i++) + { + if (!context->stream_desc[i].is_named_bo) + { + radeon_bo_unref(context->stream_desc[i].bo); + } + context->radeon.tcl.aos[i].bo = NULL; + } + + if (context->ind_buf.bo != NULL) + { + radeon_bo_unref(context->ind_buf.bo); + } +} + +static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +{ + context_t *context = R700_CONTEXT(ctx); + GLvoid *src_ptr; + GLuint *out; + int i; + GLboolean mapped_named_bo = GL_FALSE; + + if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, mesa_ind_buf->obj); + mapped_named_bo = GL_TRUE; + assert(mesa_ind_buf->obj->Pointer != NULL); + } + src_ptr = ADD_POINTERS(mesa_ind_buf->obj->Pointer, mesa_ind_buf->ptr); + + if (mesa_ind_buf->type == GL_UNSIGNED_BYTE) + { + GLuint size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); + GLubyte *in = (GLubyte *)src_ptr; + + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + + assert(context->ind_buf.bo->ptr != NULL); + out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + + for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) + { + *out++ = in[i] | in[i + 1] << 16; + } + + if (i < mesa_ind_buf->count) + { + *out++ = in[i]; + } + +#if MESA_BIG_ENDIAN + } + else + { /* if (mesa_ind_buf->type == GL_UNSIGNED_SHORT) */ + GLushort *in = (GLushort *)src_ptr; + GLuint size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); + + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + + assert(context->ind_buf.bo->ptr != NULL); + out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + + for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) + { + *out++ = in[i] | in[i + 1] << 16; + } + + if (i < mesa_ind_buf->count) + { + *out++ = in[i]; + } +#endif + } + + context->ind_buf.is_32bit = GL_FALSE; + context->ind_buf.count = mesa_ind_buf->count; + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, mesa_ind_buf->obj); + } +} + +static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +{ + context_t *context = R700_CONTEXT(ctx); + + if (!mesa_ind_buf) { + context->ind_buf.bo = NULL; + return; + } + +#if MESA_BIG_ENDIAN + if (mesa_ind_buf->type == GL_UNSIGNED_INT) + { +#else + if (mesa_ind_buf->type != GL_UNSIGNED_BYTE) + { +#endif + const GLvoid *src_ptr; + GLvoid *dst_ptr; + GLboolean mapped_named_bo = GL_FALSE; + + if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, mesa_ind_buf->obj); + assert(mesa_ind_buf->obj->Pointer != NULL); + mapped_named_bo = GL_TRUE; + } + + src_ptr = ADD_POINTERS(mesa_ind_buf->obj->Pointer, mesa_ind_buf->ptr); + + const GLuint size = mesa_ind_buf->count * getTypeSize(mesa_ind_buf->type); + + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + assert(context->ind_buf.bo->ptr != NULL); + dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + + _mesa_memcpy(dst_ptr, src_ptr, size); + + context->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); + context->ind_buf.count = mesa_ind_buf->count; + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, mesa_ind_buf->obj); + } + } + else + { + r700FixupIndexBuffer(ctx, mesa_ind_buf); + } +} + +static GLboolean r700TryDrawPrims(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLuint min_index, + GLuint max_index ) +{ + context_t *context = R700_CONTEXT(ctx); + radeonContextPtr radeon = &context->radeon; + GLuint i, id = 0; + struct radeon_renderbuffer *rrb; + + if (ctx->NewState) + { + _mesa_update_state( ctx ); + } + + _tnl_UpdateFixedFunctionProgram(ctx); + r700SetVertexFormat(ctx, arrays, max_index + 1); + /* shaders need to be updated before buffers are validated */ + r700UpdateShaders2(ctx); + if (!r600ValidateBuffers(ctx)) + return GL_FALSE; + + /* always emit CB base to prevent + * lock ups on some chips. + */ + R600_STATECHANGE(context, cb_target); + /* mark vtx as dirty since it changes per-draw */ + R600_STATECHANGE(context, vtx); + + r700SetScissor(context); + r700SetupVertexProgram(ctx); + r700SetupFragmentProgram(ctx); + r600UpdateTextureState(ctx); + + GLuint emit_end = r700PredictRenderSize(ctx, nr_prims) + + context->radeon.cmdbuf.cs->cdw; + + r700SetupIndexBuffer(ctx, ib); + r700SetupStreams2(ctx, arrays, max_index + 1); + + radeonEmitState(radeon); + + radeon_debug_add_indent(); + for (i = 0; i < nr_prims; ++i) + { + r700RunRenderPrimitive(ctx, + prim[i].start, + prim[i].start + prim[i].count, + prim[i].mode); + } + radeon_debug_remove_indent(); + + /* Flush render op cached for last several quads. */ + r700WaitForIdleClean(context); + + rrb = radeon_get_colorbuffer(&context->radeon); + if (rrb && rrb->bo) + r700SyncSurf(context, rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM, + CB_ACTION_ENA_bit | (1 << (id + 6))); + + rrb = radeon_get_depthbuffer(&context->radeon); + if (rrb && rrb->bo) + r700SyncSurf(context, rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM, + DB_ACTION_ENA_bit | DB_DEST_BASE_ENA_bit); + + r700FreeData(ctx); + + if (emit_end < context->radeon.cmdbuf.cs->cdw) + { + WARN_ONCE("Rendering was %d commands larger than predicted size." + " We might overflow command buffer.\n", context->radeon.cmdbuf.cs->cdw - emit_end); + } + + return GL_TRUE; +} + +static void r700DrawPrimsRe(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, + GLuint min_index, + GLuint max_index) +{ + GLboolean retval = GL_FALSE; + + /* This check should get folded into just the places that + * min/max index are really needed. + */ + if (!index_bounds_valid) { + vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); + } + + if (min_index) { + vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, r700DrawPrimsRe ); + return; + } + + /* Make an attempt at drawing */ + retval = r700TryDrawPrims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); + + /* If failed run tnl pipeline - it should take care of fallbacks */ + if (!retval) + _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); +} + +static void r700DrawPrims(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, + GLuint min_index, + GLuint max_index) +{ + context_t *context = R700_CONTEXT(ctx); + + /* For non indexed drawing, using tnl pipe. */ + if(!ib) + { + context->ind_buf.bo = NULL; + + _tnl_vbo_draw_prims(ctx, arrays, prim, nr_prims, ib, + index_bounds_valid, min_index, max_index); + return; + } + + r700DrawPrimsRe(ctx, arrays, prim, nr_prims, ib, index_bounds_valid, min_index, max_index); +} + +void r700InitDraw(GLcontext *ctx) +{ + struct vbo_context *vbo = vbo_context(ctx); + + /* to be enabled */ + vbo->draw_prims = r700DrawPrims; +} + diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index b4fd51c137..955ea4e4e1 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -60,6 +60,55 @@ void AddInstToList(TypedShaderList * plstCFInstructions, R700ShaderInstruction * plstCFInstructions->uNumOfNode++; } +void TakeInstOutFromList(TypedShaderList * plstCFInstructions, R700ShaderInstruction * pInst) +{ + GLuint ulIndex = 0; + GLboolean bFound = GL_FALSE; + R700ShaderInstruction * pPrevInst = NULL; + R700ShaderInstruction * pCurInst = plstCFInstructions->pHead; + + /* Need go thro list to make sure pInst is there. */ + while(NULL != pCurInst) + { + if(pCurInst == pInst) + { + bFound = GL_TRUE; + break; + } + + pPrevInst = pCurInst; + pCurInst = pCurInst->pNextInst; + } + if(GL_TRUE == bFound) + { + plstCFInstructions->uNumOfNode--; + + pCurInst = pInst->pNextInst; + ulIndex = pInst->m_uIndex; + while(NULL != pCurInst) + { + pCurInst->m_uIndex = ulIndex; + ulIndex++; + pCurInst = pCurInst->pNextInst; + } + + if(plstCFInstructions->pHead == pInst) + { + plstCFInstructions->pHead = pInst->pNextInst; + } + if(plstCFInstructions->pTail == pInst) + { + plstCFInstructions->pTail = pPrevInst; + } + if(NULL != pPrevInst) + { + pPrevInst->pNextInst = pInst->pNextInst; + } + + FREE(pInst); + } +} + void Init_R700_Shader(R700_Shader * pShader) { pShader->Type = R700_SHADER_INVALID; @@ -488,6 +537,47 @@ void DebugPrint(void) { } +void cleanup_vfetch_shaderinst(R700_Shader *pShader) +{ + R700ShaderInstruction *pInst; + R700ShaderInstruction *pInstToFree; + R700VertexInstruction *pVTXInst; + R700ControlFlowInstruction *pCFInst; + + pInst = pShader->lstVTXInstructions.pHead; + while(NULL != pInst) + { + pVTXInst = (R700VertexInstruction *)pInst; + pShader->uShaderBinaryDWORDSize -= GetInstructionSize(pVTXInst->m_ShaderInstType); + + if(NULL != pVTXInst->m_pLinkedGenericClause) + { + pCFInst = (R700ControlFlowInstruction*)(pVTXInst->m_pLinkedGenericClause); + + TakeInstOutFromList(&(pShader->lstCFInstructions), + (R700ShaderInstruction*)pCFInst); + + pShader->uShaderBinaryDWORDSize -= GetInstructionSize(pCFInst->m_ShaderInstType); + } + + pInst = pInst->pNextInst; + }; + + //destroy each item in pShader->lstVTXInstructions; + pInst = pShader->lstVTXInstructions.pHead; + while(NULL != pInst) + { + pInstToFree = pInst; + pInst = pInst->pNextInst; + FREE(pInstToFree); + }; + + //set NULL pShader->lstVTXInstructions + pShader->lstVTXInstructions.pHead=NULL; + pShader->lstVTXInstructions.pTail=NULL; + pShader->lstVTXInstructions.uNumOfNode=0; +} + void Clean_Up_Shader(R700_Shader *pShader) { FREE(pShader->pProgram); diff --git a/src/mesa/drivers/dri/r600/r700_shader.h b/src/mesa/drivers/dri/r600/r700_shader.h index bfd01e1a93..997cb05aaf 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.h +++ b/src/mesa/drivers/dri/r600/r700_shader.h @@ -143,6 +143,7 @@ void LoadProgram(R700_Shader *pShader); void UpdateShaderRegisters(R700_Shader *pShader); void DeleteInstructions(R700_Shader *pShader); void DebugPrint(void); +void cleanup_vfetch_shaderinst(R700_Shader *pShader); void Clean_Up_Shader(R700_Shader *pShader); diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 244a016e07..3d3c8b958f 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -92,7 +92,25 @@ void r700UpdateShaders (GLcontext * ctx) //---------------------------------- } } - r700SelectVertexShader(ctx); + r700SelectVertexShader(ctx, 1); + r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); + context->radeon.NewGLState = 0; +} + +void r700UpdateShaders2(GLcontext * ctx) +{ + context_t *context = R700_CONTEXT(ctx); + + /* should only happenen once, just after context is created */ + /* TODO: shouldn't we fallback to sw here? */ + if (!ctx->FragmentProgram._Current) { + _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); + return; + } + + r700SelectFragmentShader(ctx); + + r700SelectVertexShader(ctx, 2); r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); context->radeon.NewGLState = 0; } @@ -171,6 +189,14 @@ static void r700InvalidateState(GLcontext * ctx, GLuint new_state) //----------- R600_STATECHANGE(context, db_target); } + if (new_state & (_NEW_LIGHT)) { + R600_STATECHANGE(context, su); + if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION) + SETbit(r700->PA_SU_SC_MODE_CNTL.u32All, PROVOKING_VTX_LAST_bit); + else + CLEARbit(r700->PA_SU_SC_MODE_CNTL.u32All, PROVOKING_VTX_LAST_bit); + } + r700UpdateStateParameters(ctx, new_state); R600_STATECHANGE(context, cl); diff --git a/src/mesa/drivers/dri/r600/r700_state.h b/src/mesa/drivers/dri/r600/r700_state.h index 0f53d5b4c5..209189d8d7 100644 --- a/src/mesa/drivers/dri/r600/r700_state.h +++ b/src/mesa/drivers/dri/r600/r700_state.h @@ -35,6 +35,7 @@ extern void r700UpdateStateParameters(GLcontext * ctx, GLuint new_state); extern void r700UpdateShaders (GLcontext * ctx); +extern void r700UpdateShaders2(GLcontext * ctx); extern void r700UpdateViewportOffset(GLcontext * ctx); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 9ee26286d9..d12c39c9f7 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -159,7 +159,35 @@ GLboolean Process_Vertex_Program_Vfetch_Instructions( return GL_TRUE; } -void Map_Vertex_Program(struct r700_vertex_program *vp, +GLboolean Process_Vertex_Program_Vfetch_Instructions2( + GLcontext *ctx, + struct r700_vertex_program *vp, + struct gl_vertex_program *mesa_vp) +{ + int i; + context_t *context = R700_CONTEXT(ctx); + + VTX_FETCH_METHOD vtxFetchMethod; + vtxFetchMethod.bEnableMini = GL_FALSE; + vtxFetchMethod.mega_fetch_remainder = 0; + + for(i=0; i<context->nNumActiveAos; i++) + { + assemble_vfetch_instruction2(&vp->r700AsmCode, + vp->r700AsmCode.ucVP_AttributeMap[context->stream_desc[i].element], + context->stream_desc[i].type, + context->stream_desc[i].size, + context->stream_desc[i].element, + context->stream_desc[i]._signed, + context->stream_desc[i].normalize, + &vtxFetchMethod); + } + + return GL_TRUE; +} + +void Map_Vertex_Program(GLcontext *ctx, + struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp) { GLuint ui; @@ -175,11 +203,22 @@ void Map_Vertex_Program(struct r700_vertex_program *vp, pAsm->number_used_registers += num_inputs; // Create VFETCH instructions for inputs - if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions(vp, mesa_vp) ) - { - radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions return error. \n"); - return; //error - } + if(1 == vp->uiVersion) + { + if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions(vp, mesa_vp) ) + { + radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions return error. \n"); + return; + } + } + else + { + if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions2(ctx, vp, mesa_vp) ) + { + radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions2 return error. \n"); + return; + } + } // Map Outputs pAsm->number_of_exports = Map_Vertex_Output(pAsm, mesa_vp, pAsm->number_used_registers); @@ -261,7 +300,8 @@ GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, } struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, - struct gl_vertex_program *mesa_vp) + struct gl_vertex_program *mesa_vp, + GLint nVer) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vp; @@ -271,6 +311,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, unsigned int i; vp = _mesa_calloc(sizeof(*vp)); + vp->uiVersion = nVer; vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base); if (mesa_vp->IsPositionInvariant) @@ -278,8 +319,10 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, _mesa_insert_mvp_code(ctx, vp->mesa_program); } - for(i=0; i<VERT_ATTRIB_MAX; i++) + if( 1 == nVer ) { + for(i=0; i<VERT_ATTRIB_MAX; i++) + { unBit = 1 << i; if(vp->mesa_program->Base.InputsRead & unBit) /* ctx->Array.ArrayObj->xxxxxxx */ { @@ -287,7 +330,17 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, vp->aos_desc[i].stride = vb->AttribPtr[i]->size * sizeof(GL_FLOAT);/* when emit array, data is packed. vb->AttribPtr[i]->stride;*/ vp->aos_desc[i].type = GL_FLOAT; } + } } + else + { + for(i=0; i<context->nNumActiveAos; i++) + { + vp->aos_desc[i].size = context->stream_desc[i].size; + vp->aos_desc[i].stride = context->stream_desc[i].stride; + vp->aos_desc[i].type = context->stream_desc[i].type; + } + } if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) { @@ -296,7 +349,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, //Init_Program Init_r700_AssemblerBase(SPT_VP, &(vp->r700AsmCode), &(vp->r700Shader) ); - Map_Vertex_Program( vp, vp->mesa_program ); + Map_Vertex_Program(ctx, vp, vp->mesa_program ); if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, vp->mesa_program)) { @@ -325,7 +378,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return vp; } -void r700SelectVertexShader(GLcontext *ctx) +void r700SelectVertexShader(GLcontext *ctx, GLint nVersion) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program_cont *vpc; @@ -347,17 +400,35 @@ void r700SelectVertexShader(GLcontext *ctx) for (vp = vpc->progs; vp; vp = vp->next) { + if (vp->uiVersion != nVersion ) + continue; match = GL_TRUE; - for(i=0; i<VERT_ATTRIB_MAX; i++) + if ( 1 == nVersion ) { + for(i=0; i<VERT_ATTRIB_MAX; i++) + { unBit = 1 << i; if(InputsRead & unBit) { - if (vp->aos_desc[i].size != vb->AttribPtr[i]->size) - match = GL_FALSE; - break; + if (vp->aos_desc[i].size != vb->AttribPtr[i]->size) + { + match = GL_FALSE; + break; + } } + } } + else + { + for(i=0; i<context->nNumActiveAos; i++) + { + if (vp->aos_desc[i].size != context->stream_desc[i].size) + { + match = GL_FALSE; + break; + } + } + } if (match) { context->selected_vp = vp; @@ -365,7 +436,7 @@ void r700SelectVertexShader(GLcontext *ctx) } } - vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program) ); + vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program), nVersion); if(!vp) { radeon_error("Failed to translate vertex shader. \n"); @@ -377,6 +448,140 @@ void r700SelectVertexShader(GLcontext *ctx) return; } +int getTypeSize(GLenum type) +{ + switch (type) + { + case GL_DOUBLE: + return sizeof(GLdouble); + case GL_FLOAT: + return sizeof(GLfloat); + case GL_INT: + return sizeof(GLint); + case GL_UNSIGNED_INT: + return sizeof(GLuint); + case GL_SHORT: + return sizeof(GLshort); + case GL_UNSIGNED_SHORT: + return sizeof(GLushort); + case GL_BYTE: + return sizeof(GLbyte); + case GL_UNSIGNED_BYTE: + return sizeof(GLubyte); + default: + assert(0); + return 0; + } +} + +static void r700TranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, const struct gl_client_array *input) +{ + context_t *context = R700_CONTEXT(ctx); + + StreamDesc * pStreamDesc = &(context->stream_desc[context->nNumActiveAos]); + + GLuint stride; + + stride = (input->StrideB == 0) ? getTypeSize(input->Type) * input->Size + : input->StrideB; + + if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT || +#if MESA_BIG_ENDIAN + getTypeSize(input->Type) != 4 || +#endif + stride < 4) + { + pStreamDesc->type = GL_FLOAT; + + if (input->StrideB == 0) + { + pStreamDesc->stride = 0; + } + else + { + pStreamDesc->stride = sizeof(GLfloat) * input->Size; + } + pStreamDesc->dwords = input->Size; + pStreamDesc->is_named_bo = GL_FALSE; + } + else + { + pStreamDesc->type = input->Type; + pStreamDesc->dwords = (getTypeSize(input->Type) * input->Size + 3)/ 4; + if (!input->BufferObj->Name) + { + if (input->StrideB == 0) + { + pStreamDesc->stride = 0; + } + else + { + pStreamDesc->stride = (getTypeSize(pStreamDesc->type) * input->Size + 3) & ~3; + } + + pStreamDesc->is_named_bo = GL_FALSE; + } + } + + pStreamDesc->size = input->Size; + pStreamDesc->dst_loc = context->nNumActiveAos; + pStreamDesc->element = unLoc; + + switch (pStreamDesc->type) + { //GetSurfaceFormat + case GL_FLOAT: + pStreamDesc->_signed = 0; + pStreamDesc->normalize = GL_FALSE; + break; + case GL_SHORT: + pStreamDesc->_signed = 1; + pStreamDesc->normalize = input->Normalized; + break; + case GL_BYTE: + pStreamDesc->_signed = 1; + pStreamDesc->normalize = input->Normalized; + break; + case GL_UNSIGNED_SHORT: + pStreamDesc->_signed = 0; + pStreamDesc->normalize = input->Normalized; + break; + case GL_UNSIGNED_BYTE: + pStreamDesc->_signed = 0; + pStreamDesc->normalize = input->Normalized; + break; + default: + case GL_INT: + case GL_UNSIGNED_INT: + case GL_DOUBLE: + assert(0); + break; + } + context->nNumActiveAos++; +} + +void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count) +{ + context_t *context = R700_CONTEXT(ctx); + struct r700_vertex_program *vpc + = (struct r700_vertex_program *)ctx->VertexProgram._Current; + + struct gl_vertex_program * mesa_vp = (struct gl_vertex_program *)&(vpc->mesa_program); + unsigned int unLoc = 0; + unsigned int unBit = mesa_vp->Base.InputsRead; + context->nNumActiveAos = 0; + + while(unBit) + { + if(unBit & 1) + { + r700TranslateAttrib(ctx, unLoc, count, arrays[unLoc]); + } + + unBit >>= 1; + ++unLoc; + } +} + void * r700GetActiveVpShaderBo(GLcontext * ctx) { context_t *context = R700_CONTEXT(ctx); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index c48764c43b..f9a3e395ee 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -52,7 +52,7 @@ struct r700_vertex_program GLboolean translated; GLboolean loaded; - GLboolean needUpdateVF; + GLint uiVersion; void * shaderbo; @@ -76,19 +76,28 @@ unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm, GLboolean Process_Vertex_Program_Vfetch_Instructions( struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); -void Map_Vertex_Program(struct r700_vertex_program *vp, +GLboolean Process_Vertex_Program_Vfetch_Instructions2( + GLcontext *ctx, + struct r700_vertex_program *vp, + struct gl_vertex_program *mesa_vp); +void Map_Vertex_Program(GLcontext *ctx, + struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, - struct gl_vertex_program *mesa_vp); + struct gl_vertex_program *mesa_vp, + GLint nVer); /* Interface */ -extern void r700SelectVertexShader(GLcontext *ctx); +extern void r700SelectVertexShader(GLcontext *ctx, GLint nVersion); +extern void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count); extern GLboolean r700SetupVertexProgram(GLcontext * ctx); extern void * r700GetActiveVpShaderBo(GLcontext * ctx); +extern int getTypeSize(GLenum type); + #endif /* _R700_VERTPROG_H_ */ diff --git a/src/mesa/drivers/dri/r600/radeon_buffer_objects.c b/src/mesa/drivers/dri/r600/radeon_buffer_objects.c new file mode 120000 index 0000000000..f6a5f66470 --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_buffer_objects.c @@ -0,0 +1 @@ +../radeon/radeon_buffer_objects.c
\ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/radeon_buffer_objects.h b/src/mesa/drivers/dri/r600/radeon_buffer_objects.h new file mode 120000 index 0000000000..2f134fd17b --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_buffer_objects.h @@ -0,0 +1 @@ +../radeon/radeon_buffer_objects.h
\ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index 1f286776b5..ae2e695bfc 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -47,8 +47,7 @@ C_SOURCES = \ $(DRIVER_SOURCES) \ $(CS_SOURCES) -DRIVER_DEFINES = -DRADEON_COMMON=0 \ - -Wall +DRIVER_DEFINES = -DRADEON_R100 -Wall DRI_LIB_DEPS += $(RADEON_LDFLAGS) @@ -56,4 +55,3 @@ X86_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 8032cbcd69..097ab7cf61 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1344,5 +1344,5 @@ void rcommonBeginBatch(radeonContextPtr rmesa, int n, void radeonUserClear(GLcontext *ctx, GLuint mask) { - _mesa_meta_clear(ctx, mask); + _mesa_meta_Clear(ctx, mask); } diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 330721acee..6b9b1e3c5e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -47,7 +47,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) /* +r6/r7 */ +#if defined(RADEON_R600) #include "r600_context.h" #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 2012cbcf83..0ae906a6ce 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -584,7 +584,7 @@ void radeon_fbo_init(struct radeon_context *radeon) radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture; radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers; radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer; - radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_blit_framebuffer; + radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer; } diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 5ffb55db5e..573eb6c9c1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -48,17 +48,17 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_screen.h" #include "radeon_common.h" #include "radeon_span.h" -#if !RADEON_COMMON +#if defined(RADEON_R100) #include "radeon_context.h" #include "radeon_tex.h" -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #include "r200_context.h" #include "r200_ioctl.h" #include "r200_tex.h" -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) +#elif defined(RADEON_R300) #include "r300_context.h" #include "r300_tex.h" -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #include "r600_context.h" #include "r700_driconf.h" /* +r6/r7 */ #include "r600_tex.h" /* +r6/r7 */ @@ -82,7 +82,7 @@ DRI_CONF_OPT_BEGIN_V(command_buffer_size,int,def, # min ":" # max ) \ DRI_CONF_DESC(de,"Grösse des Befehlspuffers (in KB)") \ DRI_CONF_OPT_END -#if !RADEON_COMMON /* R100 */ +#if defined(RADEON_R100) /* R100 */ PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN DRI_CONF_SECTION_PERFORMANCE @@ -109,7 +109,7 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 15; -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN @@ -147,7 +147,7 @@ extern const struct dri_extension NV_vp_extension[]; extern const struct dri_extension ATI_fs_extension[]; extern const struct dri_extension point_extensions[]; -#elif RADEON_COMMON && (defined(RADEON_COMMON_FOR_R300) || defined(RADEON_COMMON_FOR_R600)) +#elif defined(RADEON_R300) || defined(RADEON_R600) #define DRI_CONF_FP_OPTIMIZATION_SPEED 0 #define DRI_CONF_FP_OPTIMIZATION_QUALITY 1 @@ -220,7 +220,7 @@ static const GLuint __driNConfigOptions = 17; extern const struct dri_extension gl_20_extension[]; -#endif /* RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) */ +#endif extern const struct dri_extension card_extensions[]; extern const struct dri_extension mm_extensions[]; @@ -337,7 +337,7 @@ radeonFillInModes( __DRIscreenPrivate *psp, return (const __DRIconfig **) configs; } -#if !RADEON_COMMON +#if defined(RADEON_R100) static const __DRItexOffsetExtension radeonTexOffsetExtension = { { __DRI_TEX_OFFSET, __DRI_TEX_OFFSET_VERSION }, radeonSetTexOffset, @@ -350,7 +350,7 @@ static const __DRItexBufferExtension radeonTexBufferExtension = { }; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) static const __DRIallocateExtension r200AllocateExtension = { { __DRI_ALLOCATE, __DRI_ALLOCATE_VERSION }, r200AllocateMemoryMESA, @@ -370,7 +370,7 @@ static const __DRItexBufferExtension r200TexBufferExtension = { }; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) +#if defined(RADEON_R300) static const __DRItexOffsetExtension r300texOffsetExtension = { { __DRI_TEX_OFFSET, __DRI_TEX_OFFSET_VERSION }, r300SetTexOffset, @@ -383,7 +383,7 @@ static const __DRItexBufferExtension r300TexBufferExtension = { }; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) static const __DRItexOffsetExtension r600texOffsetExtension = { { __DRI_TEX_OFFSET, __DRI_TEX_OFFSET_VERSION }, r600SetTexOffset, /* +r6/r7 */ @@ -1222,22 +1222,22 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) screen->extensions[i++] = &driMediaStreamCounterExtension.base; } -#if !RADEON_COMMON +#if defined(RADEON_R100) screen->extensions[i++] = &radeonTexOffsetExtension.base; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) if (IS_R200_CLASS(screen)) screen->extensions[i++] = &r200AllocateExtension.base; screen->extensions[i++] = &r200texOffsetExtension.base; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) +#if defined(RADEON_R300) screen->extensions[i++] = &r300texOffsetExtension.base; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) screen->extensions[i++] = &r600texOffsetExtension.base; #endif @@ -1376,22 +1376,22 @@ radeonCreateScreen2(__DRIscreenPrivate *sPriv) screen->extensions[i++] = &driMediaStreamCounterExtension.base; } -#if !RADEON_COMMON +#if defined(RADEON_R100) screen->extensions[i++] = &radeonTexBufferExtension.base; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) if (IS_R200_CLASS(screen)) screen->extensions[i++] = &r200AllocateExtension.base; screen->extensions[i++] = &r200TexBufferExtension.base; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) +#if defined(RADEON_R300) screen->extensions[i++] = &r300TexBufferExtension.base; #endif -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) screen->extensions[i++] = &r600TexBufferExtension.base; #endif @@ -1589,22 +1589,22 @@ radeonDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) static const __DRIconfig ** radeonInitScreen(__DRIscreenPrivate *psp) { -#if !RADEON_COMMON +#if defined(RADEON_R100) static const char *driver_name = "Radeon"; static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 6, 0 }; -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) static const char *driver_name = "R200"; static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 6, 0 }; -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) +#elif defined(RADEON_R300) static const char *driver_name = "R300"; static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 24, 0 }; -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) static const char *driver_name = "R600"; static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 }; static const __DRIversion dri_expected = { 4, 0, 0 }; @@ -1630,13 +1630,13 @@ radeonInitScreen(__DRIscreenPrivate *psp) * Hello chicken. Hello egg. How are you two today? */ driInitExtensions( NULL, card_extensions, GL_FALSE ); -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) driInitExtensions( NULL, blend_extensions, GL_FALSE ); driInitSingleExtension( NULL, ARB_vp_extension ); driInitSingleExtension( NULL, NV_vp_extension ); driInitSingleExtension( NULL, ATI_fs_extension ); driInitExtensions( NULL, point_extensions, GL_FALSE ); -#elif (defined(RADEON_COMMON_FOR_R300) || defined(RADEON_COMMON_FOR_R600)) +#elif (defined(RADEON_R300) || defined(RADEON_R600)) driInitSingleExtension( NULL, gl_20_extension ); #endif @@ -1684,13 +1684,13 @@ __DRIconfig **radeonInitScreen2(__DRIscreenPrivate *psp) */ driInitExtensions( NULL, card_extensions, GL_FALSE ); driInitExtensions( NULL, mm_extensions, GL_FALSE ); -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) driInitExtensions( NULL, blend_extensions, GL_FALSE ); driInitSingleExtension( NULL, ARB_vp_extension ); driInitSingleExtension( NULL, NV_vp_extension ); driInitSingleExtension( NULL, ATI_fs_extension ); driInitExtensions( NULL, point_extensions, GL_FALSE ); -#elif (defined(RADEON_COMMON_FOR_R300) || defined(RADEON_COMMON_FOR_R600)) +#elif (defined(RADEON_R300) || defined(RADEON_R600)) driInitSingleExtension( NULL, gl_20_extension ); #endif @@ -1772,13 +1772,13 @@ getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ) const struct __DriverAPIRec driDriverAPI = { .InitScreen = radeonInitScreen, .DestroyScreen = radeonDestroyScreen, -#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) .CreateContext = r200CreateContext, .DestroyContext = r200DestroyContext, -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) .CreateContext = r600CreateContext, .DestroyContext = radeonDestroyContext, -#elif RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) +#elif defined(RADEON_R300) .CreateContext = r300CreateContext, .DestroyContext = radeonDestroyContext, #else diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index d603f52df7..0c49c3713a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -55,7 +55,7 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb); /* r200 depth buffer is always tiled - this is the formula according to the docs unless I typo'ed in it */ -#if defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) static GLubyte *r200_depth_2byte(const struct radeon_renderbuffer * rrb, GLint x, GLint y) { @@ -112,7 +112,7 @@ static GLubyte *r200_depth_4byte(const struct radeon_renderbuffer * rrb, * - 2D (akin to macro-tiled/micro-tiled on older asics) * only 1D tiling is implemented below */ -#if defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) static inline GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, GLint x, GLint y, GLint is_depth, GLint is_stencil) { @@ -334,8 +334,8 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #endif -#ifndef COMPILE_R300 -#ifndef COMPILE_R600 +#ifndef RADEON_R300 +#ifndef RADEON_R600 static uint32_t z24s8_to_s8z24(uint32_t val) { @@ -409,7 +409,7 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_RGB565 #define TAG2(x,y) radeon##x##_RGB565##y -#if defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) #define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) #else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) @@ -423,7 +423,7 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_ARGB1555 #define TAG2(x,y) radeon##x##_ARGB1555##y -#if defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) #define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) #else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) @@ -437,7 +437,7 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_ARGB4444 #define TAG2(x,y) radeon##x##_ARGB4444##y -#if defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) #define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) #else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) @@ -451,7 +451,7 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_xRGB8888 #define TAG2(x,y) radeon##x##_xRGB8888##y -#if defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) #define GET_VALUE(_x, _y) ((*(GLuint*)(r600_ptr_color(rrb, _x + x_off, _y + y_off)) | 0xff000000)) #define PUT_VALUE(_x, _y, d) { \ GLuint *_ptr = (GLuint*)r600_ptr_color( rrb, _x + x_off, _y + y_off ); \ @@ -473,7 +473,7 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_ARGB8888 #define TAG2(x,y) radeon##x##_ARGB8888##y -#if defined(RADEON_COMMON_FOR_R600) +#if defined(RADEON_R600) #define GET_VALUE(_x, _y) (*(GLuint*)(r600_ptr_color(rrb, _x + x_off, _y + y_off))) #define PUT_VALUE(_x, _y, d) { \ GLuint *_ptr = (GLuint*)r600_ptr_color( rrb, _x + x_off, _y + y_off ); \ @@ -506,10 +506,10 @@ s8z24_to_z24s8(uint32_t val) */ #define VALUE_TYPE GLushort -#if defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)r200_depth_2byte(rrb, _x + x_off, _y + y_off) = d -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)r600_ptr_depth(rrb, _x + x_off, _y + y_off) = d #else @@ -517,10 +517,10 @@ s8z24_to_z24s8(uint32_t val) *(GLushort *)radeon_ptr_2byte_8x2(rrb, _x + x_off, _y + y_off) = d #endif -#if defined(RADEON_COMMON_FOR_R200) +#if defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ d = *(GLushort *)r200_depth_2byte(rrb, _x + x_off, _y + y_off) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ d = *(GLushort *)r600_ptr_depth(rrb, _x + x_off, _y + y_off) #else @@ -538,7 +538,7 @@ s8z24_to_z24s8(uint32_t val) */ #define VALUE_TYPE GLuint -#if defined(COMPILE_R300) +#if defined(RADEON_R300) #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ @@ -547,7 +547,7 @@ do { \ tmp |= ((d << 8) & 0xffffff00); \ *_ptr = tmp; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r600_ptr_depth( rrb, _x + x_off, _y + y_off ); \ @@ -556,7 +556,7 @@ do { \ tmp |= ((d) & 0x00ffffff); \ *_ptr = tmp; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ @@ -576,17 +576,17 @@ do { \ } while (0) #endif -#if defined(COMPILE_R300) +#if defined(RADEON_R300) #define READ_DEPTH( d, _x, _y ) \ do { \ d = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) & 0xffffff00) >> 8; \ }while(0) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ do { \ d = (*(GLuint*)(r600_ptr_depth(rrb, _x + x_off, _y + y_off)) & 0x00ffffff); \ }while(0) -#elif defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ d = *(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off)) & 0x00ffffff; \ @@ -607,13 +607,13 @@ do { \ */ #define VALUE_TYPE GLuint -#if defined(COMPILE_R300) +#if defined(RADEON_R300) #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ *_ptr = d; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r600_ptr_depth( rrb, _x + x_off, _y + y_off ); \ @@ -627,7 +627,7 @@ do { \ tmp |= (d) & 0xff; \ *_ptr = tmp; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ @@ -643,18 +643,18 @@ do { \ } while (0) #endif -#if defined(COMPILE_R300) +#if defined(RADEON_R300) #define READ_DEPTH( d, _x, _y ) \ do { \ d = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ }while(0) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ do { \ d = ((*(GLuint*)(r600_ptr_depth(rrb, _x + x_off, _y + y_off))) << 8) & 0xffffff00; \ d |= (*(GLuint*)(r600_ptr_stencil(rrb, _x + x_off, _y + y_off))) & 0x000000ff; \ }while(0) -#elif defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ d = s8z24_to_z24s8(*(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off))); \ @@ -674,7 +674,7 @@ do { \ /* 24 bit depth, 8 bit stencil depthbuffer functions */ -#ifdef COMPILE_R300 +#ifdef RADEON_R300 #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte(rrb, _x + x_off, _y + y_off); \ @@ -683,7 +683,7 @@ do { \ tmp |= (d) & 0xff; \ *_ptr = tmp; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r600_ptr_stencil(rrb, _x + x_off, _y + y_off); \ @@ -692,7 +692,7 @@ do { \ tmp |= (d) & 0xff; \ *_ptr = tmp; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte(rrb, _x + x_off, _y + y_off); \ @@ -712,21 +712,21 @@ do { \ } while (0) #endif -#ifdef COMPILE_R300 +#ifdef RADEON_R300 #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ GLuint tmp = *_ptr; \ d = tmp & 0x000000ff; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R600) +#elif defined(RADEON_R600) #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint *_ptr = (GLuint*)r600_ptr_stencil( rrb, _x + x_off, _y + y_off ); \ GLuint tmp = *_ptr; \ d = tmp & 0x000000ff; \ } while (0) -#elif defined(RADEON_COMMON_FOR_R200) +#elif defined(RADEON_R200) #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 9d252aa74c..ae41b90efe 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -833,11 +833,14 @@ static void import_tex_obj_state( r100ContextPtr rmesa, cmd[TEX_PP_TXFORMAT] |= texobj->pp_txformat & TEXOBJ_TXFORMAT_MASK; cmd[TEX_PP_BORDER_COLOR] = texobj->pp_border_color; - if (texobj->base.Target == GL_TEXTURE_RECTANGLE_NV) { - GLuint *txr_cmd = RADEON_DB_STATE( txr[unit] ); + if (texobj->pp_txformat & RADEON_TXFORMAT_NON_POWER2) { + uint32_t *txr_cmd = &rmesa->hw.txr[unit].cmd[TXR_CMD_0]; txr_cmd[TXR_PP_TEX_SIZE] = texobj->pp_txsize; /* NPOT only! */ txr_cmd[TXR_PP_TEX_PITCH] = texobj->pp_txpitch; /* NPOT only! */ - RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.txr[unit] ); + RADEON_STATECHANGE( rmesa, txr[unit] ); + } + + if (texobj->base.Target == GL_TEXTURE_RECTANGLE_NV) { se_coord_fmt |= RADEON_VTX_ST0_NONPARAMETRIC << unit; } else { @@ -1114,7 +1117,6 @@ static GLboolean radeon_validate_texture(GLcontext *ctx, struct gl_texture_objec RADEON_STATECHANGE( rmesa, ctx ); rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= (RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE) << unit; - RADEON_STATECHANGE( rmesa, tcl ); rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] |= RADEON_ST_BIT(unit); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index fad3d1ceda..7b7392b217 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -101,7 +101,12 @@ void radeonFreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage) /* Set Data pointer and additional data for mapped texture image */ static void teximage_set_map_data(radeon_texture_image *image) { - radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; + radeon_mipmap_level *lvl; + + if (!image->mt) + return; + + lvl = &image->mt->levels[image->mtlevel]; image->base.Data = image->mt->bo->ptr + lvl->faces[image->mtface].offset; image->base.RowStride = lvl->rowstride / image->mt->bpp; @@ -659,11 +664,6 @@ static void radeon_teximage( if (dims == 3) _mesa_free(dstImageOffsets); } - - /* SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - radeon_generate_mipmap(ctx, target, texObj); - } } _mesa_unmap_teximage_pbo(ctx, packing); @@ -792,11 +792,6 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve format, type, pixels, packing)) _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - radeon_generate_mipmap(ctx, target, texObj); - } } radeon_teximage_unmap(image); @@ -979,7 +974,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]); if (RADEON_DEBUG & RADEON_TEXTURE) fprintf(stderr, " face %i, level %i... %p vs %p ", face, level, t->mt, image->mt); - if (t->mt == image->mt) { + if (t->mt == image->mt || (!image->mt && !image->base.Data)) { if (RADEON_DEBUG & RADEON_TEXTURE) fprintf(stderr, "OK\n"); diff --git a/src/mesa/drivers/dri/s3v/Makefile b/src/mesa/drivers/dri/s3v/Makefile deleted file mode 100644 index 9bd7973154..0000000000 --- a/src/mesa/drivers/dri/s3v/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# src/mesa/drivers/dri/s3v/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = s3v_dri.so - -# Doesn't exist yet. -#MINIGLX_SOURCES = server/savage_dri.c - -DRIVER_SOURCES = \ - s3v_context.c \ - s3v_dd.c \ - s3v_inithw.c \ - s3v_lock.c \ - s3v_render.c \ - s3v_screen.c \ - s3v_span.c \ - s3v_state.c \ - s3v_tex.c \ - s3v_texmem.c \ - s3v_texstate.c \ - s3v_tris.c \ - s3v_vb.c \ - s3v_xmesa.c - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - - -include ../Makefile.template - -symlinks: diff --git a/src/mesa/drivers/dri/s3v/s3v_common.h b/src/mesa/drivers/dri/s3v/s3v_common.h deleted file mode 100644 index b66cdf1df0..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_common.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -/* WARNING: If you change any of these defines, make sure to change - * the kernel include file as well (s3v_drm.h) - */ - -#ifndef _XF86DRI_S3V_H_ -#define _XF86DRI_S3V_H_ - -#ifndef _S3V_DEFINES_ -#define _S3V_DEFINES_ -#define S3V_USE_BATCH 1 - -/* #define S3V_BUF_4K 1 */ - -#ifdef S3V_BUF_4K -#define S3V_DMA_BUF_ORDER 12 -#define S3V_DMA_BUF_NR 256 -#else -#define S3V_DMA_BUF_ORDER 16 /* -much- better */ -#define S3V_DMA_BUF_NR 16 -#endif -/* on s3virge you can only choose between * - * 4k (2^12) and 64k (2^16) dma bufs */ -#define S3V_DMA_BUF_SZ (1<<S3V_DMA_BUF_ORDER) - -#define S3V_NR_SAREA_CLIPRECTS 8 - -/* Each region is a minimum of 16k (64*64@4bpp) - * and there are at most 40 of them. - */ -#define S3V_NR_TEX_REGIONS 64 /* was 40 */ -#define S3V_LOG_TEX_GRANULARITY 16 /* was 4 */ -/* 40 * (2 ^ 4) = 640k, that's all we have for tex on 4mb gfx card */ -/* FIXME: will it work with card with less than 4mb? */ -/* FIXME: we should set this at run time */ - -#endif /* _S3V_DEFINES */ - -/* - * WARNING: If you change any of these defines, make sure to change - * the kernel include file as well (gamma_drm.h) - */ - -/* Driver specific DRM command indices - * NOTE: these are not OS specific, but they are driver specific - */ -#define DRM_S3V_INIT_DMA 0x00 -#define DRM_S3V_CLEANUP_DMA 0x01 - -typedef struct _drmS3VInit { - enum { - S3V_INIT_DMA = 0x01, - S3V_CLEANUP_DMA = 0x02 - } func; - - unsigned int pcimode; /* bool: 1=pci 0=agp */ - - unsigned int mmio_offset; - unsigned int buffers_offset; - unsigned int sarea_priv_offset; - - unsigned int front_offset; - unsigned int front_width; - unsigned int front_height; - unsigned int front_pitch; - - unsigned int back_offset; - unsigned int back_width; - unsigned int back_height; - unsigned int back_pitch; - - unsigned int depth_offset; - unsigned int depth_width; - unsigned int depth_height; - unsigned int depth_pitch; - - unsigned int texture_offset; -} drmS3VInit; - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_context.c b/src/mesa/drivers/dri/s3v/s3v_context.c deleted file mode 100644 index 0a3bf7258d..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_context.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "main/context.h" -#include "main/simple_list.h" -#include "main/matrix.h" -#include "main/extensions.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif -#include "main/simple_list.h" -#include "main/mm.h" - -#include "drivers/common/driverfuncs.h" -#include "s3v_vb.h" -#include "s3v_tris.h" - -#if 0 -extern const struct tnl_pipeline_stage _s3v_render_stage; - -static const struct tnl_pipeline_stage *s3v_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - /* REMOVE: point attenuation stage */ -#if 1 - &_s3v_render_stage, /* ADD: unclipped rastersetup-to-dma */ -#endif - &_tnl_render_stage, - 0, -}; -#endif - -GLboolean s3vCreateContext(const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) -{ - GLcontext *ctx, *shareCtx; - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - s3vContextPtr vmesa; - s3vScreenPtr s3vScrn; - S3VSAREAPtr saPriv=(S3VSAREAPtr)(((char*)sPriv->pSAREA) + - sizeof(drm_sarea_t)); - struct dd_function_table functions; - - DEBUG_WHERE(("*** s3vCreateContext ***\n")); - - vmesa = (s3vContextPtr) CALLOC( sizeof(*vmesa) ); - if ( !vmesa ) return GL_FALSE; - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((s3vContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - _mesa_init_driver_functions(&functions); - - vmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, - (void *)vmesa); - if (!vmesa->glCtx) { - FREE(vmesa); - return GL_FALSE; - } - - vmesa->driContext = driContextPriv; - vmesa->driScreen = sPriv; - vmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ - - vmesa->hHWContext = driContextPriv->hHWContext; - vmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock; - vmesa->driFd = sPriv->fd; - vmesa->sarea = saPriv; - - s3vScrn = vmesa->s3vScreen = (s3vScreenPtr)(sPriv->private); - - ctx = vmesa->glCtx; - - ctx->Const.MaxTextureLevels = 11; /* it is (11-1) -> 1024 * 1024 FIXME */ - - ctx->Const.MaxTextureUnits = 1; /* FIXME: or 2 ? */ - - /* No wide points. - */ - ctx->Const.MinPointSize = 1.0; - ctx->Const.MinPointSizeAA = 1.0; - ctx->Const.MaxPointSize = 1.0; - ctx->Const.MaxPointSizeAA = 1.0; - - /* No wide lines. - */ - ctx->Const.MinLineWidth = 1.0; - ctx->Const.MinLineWidthAA = 1.0; - ctx->Const.MaxLineWidth = 1.0; - ctx->Const.MaxLineWidthAA = 1.0; - ctx->Const.LineWidthGranularity = 1.0; - - ctx->Const.MaxDrawBuffers = 1; - - vmesa->texHeap = mmInit( 0, vmesa->s3vScreen->textureSize ); - DEBUG(("vmesa->s3vScreen->textureSize = 0x%x\n", - vmesa->s3vScreen->textureSize)); - - /* NOTE */ - /* mmInit(offset, size); */ - - /* allocates a structure like this: - - struct mem_block_t { - struct mem_block_t *next; - struct mem_block_t *heap; - int ofs,size; - int align; - int free:1; - int reserved:1; - }; - - */ - - make_empty_list(&vmesa->TexObjList); - make_empty_list(&vmesa->SwappedOut); - - vmesa->CurrentTexObj[0] = 0; - vmesa->CurrentTexObj[1] = 0; /* FIXME */ - - vmesa->RenderIndex = ~0; - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* Install the customized pipeline: - */ -#if 0 - _tnl_destroy_pipeline( ctx ); - _tnl_install_pipeline( ctx, s3v_pipeline ); -#endif - /* Configure swrast to match hardware characteristics: - */ -#if 0 - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); -#endif - vmesa->_3d_mode = 0; - - /* 3D lines / gouraud tris */ - vmesa->CMD = ( AUTO_EXEC_ON | HW_CLIP_ON | DEST_COL_1555 - | FOG_OFF | ALPHA_OFF | Z_OFF | Z_UPDATE_OFF - | Z_LESS | TEX_WRAP_ON | TEX_MODULATE | LINEAR - | TEX_COL_ARGB1555 | CMD_3D ); - - vmesa->_alpha[0] = vmesa->_alpha[1] = ALPHA_OFF; - vmesa->alpha_cmd = vmesa->_alpha[0]; - vmesa->_tri[0] = DO_GOURAUD_TRI; - vmesa->_tri[1] = DO_TEX_LIT_TRI; - vmesa->prim_cmd = vmesa->_tri[0]; - - /* printf("first vmesa->CMD = 0x%x\n", vmesa->CMD); */ - - vmesa->TexOffset = vmesa->s3vScreen->texOffset; - - s3vInitVB( ctx ); - s3vInitExtensions( ctx ); - s3vInitDriverFuncs( ctx ); - s3vInitStateFuncs( ctx ); - s3vInitSpanFuncs( ctx ); - s3vInitTextureFuncs( ctx ); - s3vInitTriFuncs( ctx ); - s3vInitState( vmesa ); - - driContextPriv->driverPrivate = (void *)vmesa; - - /* HACK */ - vmesa->bufSize = S3V_DMA_BUF_SZ; - - DEBUG(("vmesa->bufSize = %i\n", vmesa->bufSize)); - DEBUG(("vmesa->bufCount = %i\n", vmesa->bufCount)); - - - /* dma init */ - DEBUG_BUFS(("GET_FIRST_DMA\n")); - - vmesa->_bufNum = 0; - - GET_FIRST_DMA(vmesa->driFd, vmesa->hHWContext, - 1, &(vmesa->bufIndex[0]), &(vmesa->bufSize), - &vmesa->_buf[0], &vmesa->bufCount, s3vScrn); - - GET_FIRST_DMA(vmesa->driFd, vmesa->hHWContext, - 1, &(vmesa->bufIndex[1]), &(vmesa->bufSize), - &vmesa->_buf[1], &vmesa->bufCount, s3vScrn); - - vmesa->buf = vmesa->_buf[vmesa->_bufNum]; - -/* - vmesa->CMD = (AUTO_EXEC_ON | HW_CLIP_ON | DEST_COL_1555 - | FOG_OFF | ALPHA_OFF | Z_OFF | Z_UPDATE_OFF - | DO_GOURAUD_TRI | CMD_3D); - - vmesa->TexOffset = vmesa->s3vScreen->texOffset; -*/ - -/* ... but we should support only 15 bit in virge (out of 8/15/24)... */ - - DEBUG(("glVisual->depthBits = %i\n", glVisual->depthBits)); - - switch (glVisual->depthBits) { - case 8: - break; - - case 15: - case 16: - vmesa->depth_scale = 1.0f / 0xffff; - break; - case 24: - vmesa->depth_scale = 1.0f / 0xffffff; - break; - default: - break; - } - - vmesa->cull_zero = 0.0f; - - vmesa->DepthSize = glVisual->depthBits; - vmesa->Flags = S3V_FRONT_BUFFER; - vmesa->Flags |= (glVisual->doubleBufferMode ? S3V_BACK_BUFFER : 0); - vmesa->Flags |= (vmesa->DepthSize > 0 ? S3V_DEPTH_BUFFER : 0); - - vmesa->EnabledFlags = S3V_FRONT_BUFFER; - vmesa->EnabledFlags |= (glVisual->doubleBufferMode ? S3V_BACK_BUFFER : 0); - - - if (vmesa->Flags & S3V_BACK_BUFFER) { - vmesa->readOffset = vmesa->drawOffset = vmesa->s3vScreen->backOffset; - } else { - vmesa->readOffset = vmesa->drawOffset = 0; - } - - s3vInitHW( vmesa ); - - driContextPriv->driverPrivate = (void *)vmesa; - - return GL_TRUE; -} diff --git a/src/mesa/drivers/dri/s3v/s3v_context.h b/src/mesa/drivers/dri/s3v/s3v_context.h deleted file mode 100644 index 671ba90d78..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_context.h +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef _S3V_CONTEXT_H_ -#define _S3V_CONTEXT_H_ - -#include "dri_util.h" - -#include "s3v_dri.h" -#include "s3v_regs.h" -#include "s3v_macros.h" -#include "s3v_screen.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "drm.h" -#include "main/mm.h" -#include "drirenderbuffer.h" - -/* Flags for context */ -#define S3V_FRONT_BUFFER 0x00000001 -#define S3V_BACK_BUFFER 0x00000002 -#define S3V_DEPTH_BUFFER 0x00000004 - - /* FIXME: check */ -#define S3V_MAX_TEXTURE_SIZE 2048 - -/* These are the minimum requirements and should probably be increased */ -#define MAX_MODELVIEW_STACK 16 -#define MAX_PROJECTION_STACK 2 -#define MAX_TEXTURE_STACK 2 - -extern void s3vDDUpdateHWState(GLcontext *ctx); -extern s3vScreenPtr s3vCreateScreen(__DRIscreenPrivate *sPriv); -extern void s3vDestroyScreen(__DRIscreenPrivate *sPriv); -extern GLboolean s3vCreateContext(const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate); - -#define S3V_UPLOAD_ALL 0xffffffff -/* #define S3V_UPLOAD_CLIPRECTS 0x00000002 */ -#define S3V_UPLOAD_ALPHA 0x00000004 -#define S3V_UPLOAD_BLEND 0x00000008 -#define S3V_UPLOAD_DEPTH 0x00000010 -#define S3V_UPLOAD_VIEWPORT 0x00000020 -#define S3V_UPLOAD_SHADE 0x00000040 -#define S3V_UPLOAD_CLIP 0x00000080 -#define S3V_UPLOAD_MASKS 0x00000100 -#define S3V_UPLOAD_WINDOW 0x00000200 /* defunct */ -#define S3V_UPLOAD_GEOMETRY 0x00000400 -#define S3V_UPLOAD_POLYGON 0x00000800 -#define S3V_UPLOAD_DITHER 0x00001000 -#define S3V_UPLOAD_LOGICOP 0x00002000 -#define S3V_UPLOAD_FOG 0x00004000 -#define S3V_UPLOAD_LIGHT 0x00008000 -#define S3V_UPLOAD_CONTEXT 0x00010000 -#define S3V_UPLOAD_TEX0 0x00020000 -#define S3V_UPLOAD_STIPPLE 0x00040000 -#define S3V_UPLOAD_TRANSFORM 0x00080000 -#define S3V_UPLOAD_LINEMODE 0x00100000 -#define S3V_UPLOAD_POINTMODE 0x00200000 -#define S3V_UPLOAD_TRIMODE 0x00400000 - -#define S3V_NEW_CLIP 0x00000001 -#define S3V_NEW_WINDOW 0x00000002 -#define S3V_NEW_CONTEXT 0x00000004 -#define S3V_NEW_TEXTURE 0x00000008 /* defunct */ -#define S3V_NEW_ALPHA 0x00000010 -#define S3V_NEW_DEPTH 0x00000020 -#define S3V_NEW_MASKS 0x00000040 -#define S3V_NEW_POLYGON 0x00000080 -#define S3V_NEW_CULL 0x00000100 -#define S3V_NEW_LOGICOP 0x00000200 -#define S3V_NEW_FOG 0x00000400 -#define S3V_NEW_LIGHT 0x00000800 -#define S3V_NEW_STIPPLE 0x00001000 -#define S3V_NEW_ALL 0xffffffff - -#define S3V_FALLBACK_TRI 0x00000001 -#define S3V_FALLBACK_TEXTURE 0x00000002 - -struct s3v_context; -typedef struct s3v_context s3vContextRec; -typedef struct s3v_context *s3vContextPtr; -typedef struct s3v_texture_object_t *s3vTextureObjectPtr; - -#define VALID_S3V_TEXTURE_OBJECT(tobj) (tobj) - -#define S3V_TEX_MAXLEVELS 12 - -/* For shared texture space managment, these texture objects may also - * be used as proxies for regions of texture memory containing other - * client's textures. Such proxy textures (not to be confused with GL - * proxy textures) are subject to the same LRU aging we use for our - * own private textures, and thus we have a mechanism where we can - * fairly decide between kicking out our own textures and those of - * other clients. - * - * Non-local texture objects have a valid MemBlock to describe the - * region managed by the other client, and can be identified by - * 't->globj == 0' - */ -struct s3v_texture_object_t { - struct s3v_texture_object_t *next, *prev; - - GLuint age; - struct gl_texture_object *globj; - - int Pitch; - int Height; - int WidthLog2; - int texelBytes; - int totalSize; - int bound; - - struct mem_block *MemBlock; - GLuint BufAddr; - - GLuint min_level; - GLuint max_level; - GLuint dirty_images; - - GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */ - - struct { - const struct gl_texture_image *image; - int offset; /* into BufAddr */ - int height; - int internalFormat; - } image[S3V_TEX_MAXLEVELS]; - - GLuint TextureCMD; - - GLuint TextureColorMode; - GLuint TextureFilterMode; - GLuint TextureBorderColor; - GLuint TextureWrap; - GLuint TextureMipSize; - - GLuint TextureBaseAddr[S3V_TEX_MAXLEVELS]; - GLuint TextureFormat; - GLuint TextureReadMode; -}; - -#define S3V_NO_PALETTE 0x0 -#define S3V_USE_PALETTE 0x1 -#define S3V_UPDATE_PALETTE 0x2 -#define S3V_FALLBACK_PALETTE 0x4 - -void s3vUpdateTextureState( GLcontext *ctx ); - -void s3vDestroyTexObj( s3vContextPtr vmesa, s3vTextureObjectPtr t); -void s3vUploadTexImages( s3vContextPtr vmesa, s3vTextureObjectPtr t ); - -void s3vResetGlobalLRU( s3vContextPtr vmesa ); -void s3vTexturesGone( s3vContextPtr vmesa, - GLuint start, GLuint end, - GLuint in_use ); - -void s3vEmitHwState( s3vContextPtr vmesa ); -void s3vGetLock( s3vContextPtr vmesa, GLuint flags ); -void s3vInitExtensions( GLcontext *ctx ); -void s3vInitDriverFuncs( GLcontext *ctx ); -void s3vSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); -void s3vInitState( s3vContextPtr vmesa ); -void s3vInitHW( s3vContextPtr vmesa ); -void s3vInitStateFuncs( GLcontext *ctx ); -void s3vInitTextureFuncs( GLcontext *ctx ); -void s3vInitTriFuncs( GLcontext *ctx ); - -void s3vUpdateWindow( GLcontext *ctx ); -void s3vUpdateViewportOffset( GLcontext *ctx ); - -void s3vPrintLocalLRU( s3vContextPtr vmesa ); -void s3vPrintGlobalLRU( s3vContextPtr vmesa ); - -extern void s3vFallback( s3vContextPtr vmesa, GLuint bit, GLboolean mode ); -#define FALLBACK( imesa, bit, mode ) s3vFallback( imesa, bit, mode ) - -/* Use the templated vertex formats. Only one of these is used in s3v. - */ -#define TAG(x) s3v##x -#include "tnl_dd/t_dd_vertex.h" -#undef TAG - -typedef void (*s3v_quad_func)( s3vContextPtr, - const s3vVertex *, - const s3vVertex *, - const s3vVertex *, - const s3vVertex * ); -typedef void (*s3v_tri_func)( s3vContextPtr, - const s3vVertex *, - const s3vVertex *, - const s3vVertex * ); -typedef void (*s3v_line_func)( s3vContextPtr, - const s3vVertex *, - const s3vVertex * ); -typedef void (*s3v_point_func)( s3vContextPtr, - const s3vVertex * ); - - -/* static void s3v_lines_emit(GLcontext *ctx, GLuint start, GLuint end); */ -typedef void (*emit_func)( GLcontext *, GLuint, GLuint); - -struct s3v_context { - GLcontext *glCtx; /* Mesa context */ - - __DRIcontextPrivate *driContext; - __DRIscreenPrivate *driScreen; - __DRIdrawablePrivate *driDrawable; - - GLuint new_gl_state; - GLuint new_state; - GLuint dirty; - - S3VSAREAPtr sarea; - - /* Temporaries for translating away float colors - */ - struct gl_client_array UbyteColor; - struct gl_client_array UbyteSecondaryColor; - - /* Mirrors of some DRI state - */ - - drm_context_t hHWContext; - drmLock *driHwLock; - int driFd; - - GLuint numClipRects; /* Cliprects for the draw buffer */ - drm_clip_rect_t *pClipRects; - - GLuint* buf; /* FIXME */ - GLuint* _buf[2]; - int _bufNum; - int bufIndex[2]; - int bufSize; - int bufCount; - - s3vScreenPtr s3vScreen; /* Screen private DRI data */ - - int drawOffset; - int readOffset; - - s3v_point_func draw_point; - s3v_line_func draw_line; - s3v_tri_func draw_tri; - s3v_quad_func draw_quad; - - GLuint Fallback; - GLuint RenderIndex; - GLuint SetupNewInputs; - GLuint SetupIndex; - - GLuint vertex_format; - GLuint vertex_size; - GLuint vertex_stride_shift; - char *verts; - - GLfloat hw_viewport[16]; - GLuint hw_primitive; - GLenum render_primitive; - - GLfloat depth_scale; - - s3vTextureObjectPtr CurrentTexObj[2]; - struct s3v_texture_object_t TexObjList; - struct s3v_texture_object_t SwappedOut; - GLenum TexEnvImageFmt[2]; - - struct mem_block *texHeap; - - int lastSwap; - int texAge; - int ctxAge; - int dirtyAge; - int lastStamp; - - /* max was here: don't touch */ - - unsigned int S3V_REG[S3V_REGS_NUM]; - - GLuint texMode; - GLuint alphaMode; - GLuint lightMode; - - GLuint SrcBase; - GLuint DestBase; - GLuint DestBlit; - GLuint ScissorLR; - GLuint ScissorTB; - GLuint ScissorWH; /* SubScissorWH */ /* RectWH */ - GLuint FrontStride; - GLuint BackStride; - GLuint SrcStride; - GLuint DestStride; - GLuint SrcXY; - GLuint DestXY; - - GLuint ClearColor; - GLuint Color; - GLuint DitherMode; - GLuint ClearDepth; - - GLuint TextureBorderColor; - GLuint TexOffset; - GLuint TexStride; - - GLuint CMD; - GLuint prim_cmd; - GLuint _tri[2]; /* 0 = gouraud; 1 = tex (lit or unlit) */ - GLuint alpha_cmd; /* actual alpha cmd */ - GLuint _alpha[2]; - GLuint _alpha_tex; /* tex alpha type */ - /* (3d_mode) 0 = 3d line/gourad tri; 1 = 3d tex tri */ - GLuint _3d_mode; - - GLfloat backface_sign; - GLfloat cull_zero; - - int restore_primitive; - -/* *** 2check *** */ - - GLuint FogMode; - GLuint AreaStippleMode; - GLuint LBReadFormat; - GLuint LBWriteFormat; - GLuint LineMode; - GLuint PointMode; - GLuint TriangleMode; - GLuint AntialiasMode; - GLfloat ViewportScaleX; - GLfloat ViewportScaleY; - GLfloat ViewportScaleZ; - GLfloat ViewportOffsetX; - GLfloat ViewportOffsetY; - GLfloat ViewportOffsetZ; - int MatrixMode; - int DepthMode; - int TransformMode; - int LBReadMode; - int FBReadMode; - int FBWindowBase; - int LBWindowBase; - int ColorDDAMode; - int GeometryMode; - int AlphaTestMode; - int AlphaBlendMode; - int AB_FBReadMode; - int AB_FBReadMode_Save; - int DeltaMode; - int ColorMaterialMode; - int FBHardwareWriteMask; - int MaterialMode; - int NormalizeMode; - int LightingMode; - int Light0Mode; - int Light1Mode; - int Light2Mode; - int Light3Mode; - int Light4Mode; - int Light5Mode; - int Light6Mode; - int Light7Mode; - int Light8Mode; - int Light9Mode; - int Light10Mode; - int Light11Mode; - int Light12Mode; - int Light13Mode; - int Light14Mode; - int Light15Mode; - int LogicalOpMode; - int ScissorMode; - int ScissorMaxXY; - int ScissorMinXY; - int Window; /* GID part probably should be in draw priv */ - int WindowOrigin; - int x, y, w, h; /* Probably should be in drawable priv */ - int FrameCount; /* Probably should be in drawable priv */ - int NotClipped; /* Probably should be in drawable priv */ - int WindowChanged; /* Probably should be in drawabl... */ - int Flags; - int EnabledFlags; - int DepthSize; - int Begin; - GLenum ErrorValue; - int Texture1DEnabled; - int Texture2DEnabled; - - float ModelView[16]; - float Proj[16]; - float ModelViewProj[16]; - float Texture[16]; - - float ModelViewStack[(MAX_MODELVIEW_STACK-1)*16]; - int ModelViewCount; - float ProjStack[(MAX_PROJECTION_STACK-1)*16]; - int ProjCount; - float TextureStack[(MAX_TEXTURE_STACK-1)*16]; - int TextureCount; -}; - -#define S3VIRGEPACKCOLOR555( r, g, b, a ) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) - -#define S3VIRGEPACKCOLOR565( r, g, b ) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) - -#define S3VIRGEPACKCOLOR888( r, g, b ) \ - (((r) << 16) | ((g) << 8) | (b)) - -#define S3VIRGEPACKCOLOR8888( r, g, b, a ) \ - (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) - -#define S3VIRGEPACKCOLOR4444( r, g, b, a ) \ - ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) - -static INLINE GLuint s3vPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) -{ - unsigned int ret; - DEBUG(("cpp = %i, r=0x%x, g=0x%x, b=0x%x, a=0x%x\n", cpp, r, g, b, a)); - - switch ( cpp ) { - case 2: - ret = S3VIRGEPACKCOLOR555( r, g, b, a ); - DEBUG(("ret = 0x%x\n", ret)); - return ret; - case 4: - return PACK_COLOR_8888( a, r, g, b ); - default: - return 0; - } -} - -#define S3V_CONTEXT(ctx) ((s3vContextPtr)(ctx->DriverCtx)) - -#endif /* _S3V_CONTEXT_H_ */ diff --git a/src/mesa/drivers/dri/s3v/s3v_dd.c b/src/mesa/drivers/dri/s3v/s3v_dd.c deleted file mode 100644 index e340116f5e..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_dd.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_lock.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif - -#include "main/context.h" -#include "main/framebuffer.h" -#include "swrast/swrast.h" - -#define S3V_DATE "20020207" - - -/* Return the width and height of the current color buffer. - */ -static void s3vDDGetBufferSize( GLframebuffer *buffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - -/* S3VHW_LOCK( vmesa ); */ - *width = vmesa->driDrawable->w; - *height = vmesa->driDrawable->h; -/* S3VHW_UNLOCK( vmesa ); */ -} - - -/* Return various strings for glGetString(). - */ -static const GLubyte *s3vDDGetString( GLcontext *ctx, GLenum name ) -{ - static char buffer[128]; - - switch ( name ) { - case GL_VENDOR: - return (GLubyte *)"Max Lingua (ladybug)"; - - case GL_RENDERER: - sprintf( buffer, "Mesa DRI S3 Virge " S3V_DATE ); - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - -} -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - return (GLubyte *)buffer; - - default: - return NULL; - } -} - -/* Enable the extensions supported by this driver. - */ -void s3vInitExtensions( GLcontext *ctx ) -{ - /* None... */ -} - -/* Initialize the driver's misc functions. - */ -void s3vInitDriverFuncs( GLcontext *ctx ) -{ - ctx->Driver.GetBufferSize = s3vDDGetBufferSize; - ctx->Driver.GetString = s3vDDGetString; -} diff --git a/src/mesa/drivers/dri/s3v/s3v_dri.h b/src/mesa/drivers/dri/s3v/s3v_dri.h deleted file mode 100644 index 339c579f7f..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_dri.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef _S3V_DRI -#define _S3V_DRI - -#include "s3v_common.h" - -#define S3V_MAX_DRAWABLES (S3V_DMA_BUF_NR/2) /* 32 */ /* 256 */ /* FIXME */ - -typedef struct -{ - int deviceID; - int width; - int height; - int mem; - int cpp; - int bitsPerPixel; - - int fbOffset; - int fbStride; - - int logTextureGranularity; - int textureOffset; - - drm_handle_t regs; - drmSize regsSize; - - unsigned int sarea_priv_offset; -/* - drmAddress regsMap; - - drmSize textureSize; - drm_handle_t textures; -*/ - -#if 0 - drm_handle_t agp_buffers; - drmSize agp_buf_size; -#endif - -/* - drmBufMapPtr drmBufs; - int irq; - unsigned int sarea_priv_offset; -*/ - -/* FIXME: cleanup ! */ - - drmSize registerSize; /* == S3V_MMIO_REGSIZE */ - drm_handle_t registerHandle; - - drmSize pciSize; - drm_handle_t pciMemHandle; - - drmSize frontSize; /* == videoRambytes */ -/* drm_handle_t frontHandle; */ - unsigned long frontOffset; /* == fbOffset */ - int frontPitch; -/* unsigned char *front; */ - - unsigned int bufferSize; /* size of depth/back buffer */ - - drmSize backSize; -/* drm_handle_t backHandle; */ - unsigned long backOffset; - int backPitch; -/* unsigned char *back; */ - - drmSize depthSize; -/* drm_handle_t depthHandle; */ - unsigned long depthOffset; - int depthPitch; -/* unsigned char *depth; */ - - drmSize texSize; -/* drm_handle_t texHandle; */ - unsigned long texOffset; - int texPitch; -/* unsigned char *tex; */ - - drmSize dmaBufSize; /* Size of buffers (in bytes) */ - drm_handle_t dmaBufHandle; /* Handle from drmAddMap */ - unsigned long dmaBufOffset; /* Offset/Start */ - int dmaBufPitch; /* Pitch */ - unsigned char *dmaBuf; /* Map */ - int bufNumBufs; /* Number of buffers */ - drmBufMapPtr buffers; /* Buffer map */ - -} S3VDRIRec, *S3VDRIPtr; - -/* WARNING: Do not change the SAREA structure without changing the kernel - * as well */ - -typedef struct { - unsigned char next, prev; /* indices to form a circular LRU */ - unsigned char in_use; /* owned by a client, or free? */ - int age; /* tracked by clients to update local LRU's */ -} S3VTexRegionRec, *S3VTexRegionPtr; - -typedef struct { - unsigned int nbox; - drm_clip_rect_t boxes[S3V_NR_SAREA_CLIPRECTS]; - - /* Maintain an LRU of contiguous regions of texture space. If - * you think you own a region of texture memory, and it has an - * age different to the one you set, then you are mistaken and - * it has been stolen by another client. If global texAge - * hasn't changed, there is no need to walk the list. - * - * These regions can be used as a proxy for the fine-grained - * texture information of other clients - by maintaining them - * in the same lru which is used to age their own textures, - * clients have an approximate lru for the whole of global - * texture space, and can make informed decisions as to which - * areas to kick out. There is no need to choose whether to - * kick out your own texture or someone else's - simply eject - * them all in LRU order. - */ - S3VTexRegionRec texList[S3V_NR_TEX_REGIONS+1]; /* Last elt is sentinal */ - - int texAge; /* last time texture was uploaded */ - - int last_enqueue; /* last time a buffer was enqueued */ - int last_dispatch; /* age of the most recently dispatched buffer */ - int last_quiescent; /* */ - - int ctxOwner; /* last context to upload state */ -} S3VSAREARec, *S3VSAREAPtr; - -typedef struct { - /* Nothing here yet */ - int dummy; -} S3VConfigPrivRec, *S3VConfigPrivPtr; - -typedef struct { - /* Nothing here yet */ - int dummy; -} S3VDRIContextRec, *S3VDRIContextPtr; - - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_inithw.c b/src/mesa/drivers/dri/s3v/s3v_inithw.c deleted file mode 100644 index bdc9effb79..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_inithw.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include <sys/ioctl.h> - -#include "s3v_context.h" - -void s3vInitHW( s3vContextPtr vmesa ) -{ - int i; - static short _reset = 1; - - DEBUG(("vmesa->driDrawable = %p\n", vmesa->driDrawable)); - DEBUG(("stride = %i\n", - vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp)); - DEBUG(("frontOffset = 0x%x\n", vmesa->s3vScreen->frontOffset)); - DEBUG(("backOffset = 0x%x\n", vmesa->s3vScreen->backOffset)); - DEBUG(("depthOffset = 0x%x\n", vmesa->s3vScreen->depthOffset)); - DEBUG(("textureOffset = 0x%x\n", vmesa->s3vScreen->texOffset)); - -/* if (_reset) { */ -/* ioctl(vmesa->driFd, 0x4a); */ - ioctl(vmesa->driFd, 0x41); /* reset */ - _reset = 0; -/* ioctl(vmesa->driFd, 0x4c); */ -/* } */ - - /* FIXME */ - switch (vmesa->s3vScreen->cpp) { - case 2: - break; - case 4: - break; - } - - /* FIXME for stencil, gid, etc */ - switch (vmesa->DepthSize) { - case 15: - case 16: - break; - case 24: - break; - case 32: - break; - } - - vmesa->FogMode = 1; - vmesa->ClearDepth = 0xffff; - vmesa->x = 0; - vmesa->y = 0; - vmesa->w = 0; - vmesa->h = 0; - vmesa->FrameCount = 0; - vmesa->MatrixMode = GL_MODELVIEW; - vmesa->ModelViewCount = 0; - vmesa->ProjCount = 0; - vmesa->TextureCount = 0; - - - /* FIXME: do we need the following? */ - - for (i = 0; i < 16; i++) - if (i % 5 == 0) - vmesa->ModelView[i] = - vmesa->Proj[i] = - vmesa->ModelViewProj[i] = - vmesa->Texture[i] = 1.0; - else - vmesa->ModelView[i] = - vmesa->Proj[i] = - vmesa->ModelViewProj[i] = - vmesa->Texture[i] = 0.0; - - vmesa->LBWindowBase = vmesa->driScreen->fbWidth * - (vmesa->driScreen->fbHeight - 1); - vmesa->FBWindowBase = vmesa->driScreen->fbWidth * - (vmesa->driScreen->fbHeight - 1); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_lock.c b/src/mesa/drivers/dri/s3v/s3v_lock.c deleted file mode 100644 index 52bb87ecec..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_lock.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" - -#if DEBUG_LOCKING -char *prevLockFile = NULL; -int prevLockLine = 0; -#endif - - -/* Update the hardware state. This is called if another context has - * grabbed the hardware lock, which includes the X server. This - * function also updates the driver's window state after the X server - * moves, resizes or restacks a window -- the change will be reflected - * in the drawable position and clip rects. Since the X server grabs - * the hardware lock when it changes the window state, this routine will - * automatically be called after such a change. - */ -void s3vGetLock( s3vContextPtr vmesa, GLuint flags ) -{ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; -/* __DRIscreenPrivate *sPriv = vmesa->driScreen; */ - - printf("s3vGetLock <- ***\n"); - - drmGetLock( vmesa->driFd, vmesa->hHWContext, flags ); - - /* The window might have moved, so we might need to get new clip - * rects. - * - * NOTE: This releases and regrabs the hw lock to allow the X server - * to respond to the DRI protocol request for new drawable info. - * Since the hardware state depends on having the latest drawable - * clip rects, all state checking must be done _after_ this call. - */ - /* DRI_VALIDATE_DRAWABLE_INFO( vmesa->display, sPriv, dPriv ); */ - - if ( vmesa->lastStamp != dPriv->lastStamp ) { - vmesa->lastStamp = dPriv->lastStamp; - vmesa->new_state |= S3V_NEW_WINDOW | S3V_NEW_CLIP; - } - - vmesa->numClipRects = dPriv->numClipRects; - vmesa->pClipRects = dPriv->pClipRects; - -#if 0 - vmesa->dirty = ~0; - - if ( sarea->ctxOwner != vmesa->hHWContext ) { - sarea->ctxOwner = vmesa->hHWContext; - vmesa->dirty = S3V_UPLOAD_ALL; - } - - for ( i = 0 ; i < vmesa->lastTexHeap ; i++ ) { - if ( sarea->texAge[i] != vmesa->lastTexAge[i] ) { - s3vAgeTextures( vmesa, i ); - } - } -#endif -} diff --git a/src/mesa/drivers/dri/s3v/s3v_lock.h b/src/mesa/drivers/dri/s3v/s3v_lock.h deleted file mode 100644 index c39d24a38a..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_lock.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef __S3V_LOCK_H__ -#define __S3V_LOCK_H__ - -#include <sys/ioctl.h> - -extern void s3vGetLock( s3vContextPtr vmesa, GLuint flags ); - -/* Turn DEBUG_LOCKING on to find locking conflicts. - */ -#define DEBUG_LOCKING 0 - -#if DEBUG_LOCKING -extern char *prevLockFile; -extern int prevLockLine; - -#define DEBUG_LOCK() \ - do { \ - prevLockFile = (__FILE__); \ - prevLockLine = (__LINE__); \ - } while (0) - -#define DEBUG_RESET() \ - do { \ - prevLockFile = 0; \ - prevLockLine = 0; \ - } while (0) - -#define DEBUG_CHECK_LOCK() \ - do { \ - if ( prevLockFile ) { \ - fprintf( stderr, \ - "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \ - prevLockFile, prevLockLine, __FILE__, __LINE__ ); \ - exit(1); \ - } \ - } while (0) - -#else - -#define DEBUG_LOCK() -#define DEBUG_RESET() -#define DEBUG_CHECK_LOCK() - -#endif - -/* - * !!! We may want to separate locks from locks with validation. This - * could be used to improve performance for those things commands that - * do not do any drawing !!! - */ - -/* Lock the hardware and validate our state. - */ -#define LOCK_HARDWARE( vmesa ) \ - do { \ - char __ret = 0; \ - DEBUG_CHECK_LOCK(); \ - DRM_CAS( vmesa->driHwLock, vmesa->hHWContext, \ - (DRM_LOCK_HELD | vmesa->hHWContext), __ret ); \ - if ( __ret ) \ - s3vGetLock( vmesa, 0 ); \ - DEBUG_LOCK(); \ - } while (0) - -/* Unlock the hardware. - */ -#define UNLOCK_HARDWARE( vmesa ) \ - do { \ - DRM_UNLOCK( vmesa->driFd, \ - vmesa->driHwLock, \ - vmesa->hHWContext ); \ - DEBUG_RESET(); \ - } while (0) - -#define S3VHW_LOCK( vmesa ) \ - DRM_UNLOCK(vmesa->driFd, vmesa->driHwLock, vmesa->hHWContext); \ - DRM_SPINLOCK(&vmesa->driScreen->pSAREA->drawable_lock, \ - vmesa->driScreen->drawLockID); \ - /* VALIDATE_DRAWABLE_INFO_NO_LOCK(vmesa); */ - -#define S3VHW_UNLOCK( vmesa ) \ - DRM_SPINUNLOCK(&vmesa->driScreen->pSAREA->drawable_lock, \ - vmesa->driScreen->drawLockID); \ - /* VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(vmesa); */ - -#define S3V_SIMPLE_LOCK( vmesa ) \ - ioctl(vmesa->driFd, 0x4a) - -#define S3V_SIMPLE_FLUSH_LOCK( vmesa ) \ - ioctl(vmesa->driFd, 0x4b) - -#define S3V_SIMPLE_UNLOCK( vmesa ) \ - ioctl(vmesa->driFd, 0x4c) - -#endif /* __S3V_LOCK_H__ */ diff --git a/src/mesa/drivers/dri/s3v/s3v_macros.h b/src/mesa/drivers/dri/s3v/s3v_macros.h deleted file mode 100644 index 7e9b4529df..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_macros.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef _S3V_MACROS_H_ -#define _S3V_MACROS_H_ - -/**************/ -/* DRI macros */ -/**************/ - -#define GENERIC_DEBUG 0 -#define FLOW_DEBUG 0 -#define DMABUFS_DEBUG 0 - -/* Note: The argument to DEBUG*() _must_ be enclosed in parenthesis */ - -#if (GENERIC_DEBUG || FLOW_DEBUG || DMABUFS_DEBUG) -#include <stdio.h> -#endif - -#undef DEBUG -#if GENERIC_DEBUG -#define DEBUG(str) printf str -#else -#define DEBUG(str) -#endif - -#if FLOW_DEBUG -#define DEBUG_WHERE(str) printf str -#else -#define DEBUG_WHERE(str) -#endif - -#if DMABUFS_DEBUG -#define DEBUG_BUFS(str) printf str -#else -#define DEBUG_BUFS(str) -#endif - - -#if 0 -#define S3V_DMA_SEND_FLAGS DRM_DMA_PRIORITY -#define S3V_DMA_SEND_FLAGS DRM_DMA_BLOCK -#else -#define S3V_DMA_SEND_FLAGS 0 -#endif - -#if 0 -#define S3V_DMA_GET_FLAGS \ - (DRM_DMA_SMALLER_OK | DRM_DMA_LARGER_OK | DRM_DMA_WAIT) -#else -#define S3V_DMA_GET_FLAGS DRM_DMA_WAIT -#endif - - -#define DMAOUT_CHECK(reg,len) \ -do { \ - DEBUG(("DMAOUT_CHECK: reg = 0x%x\n", S3V_##reg##_REG)); \ - DEBUG_BUFS(("DMAOUT_CHECK (was): ")); \ - DEBUG_BUFS(("vmesa->bufCount=%i of vmesa->bufSize=%i\n", \ - vmesa->bufCount, vmesa->bufSize)); \ - /* FIXME: > or >= */ \ - if (vmesa->bufCount+(len+1) >= vmesa->bufSize) \ - DMAFLUSH(); \ -\ - vmesa->bufCount += (len+1); \ - DEBUG_BUFS(("DMAOUT_CHECK (is): vmesa->bufCount=%i len=%i, reg=%x\n", \ - vmesa->bufCount, len, S3V_##reg##_REG)); \ - DMAOUT( ((len & 0xffff) | ((S3V_##reg##_REG & 0xfffc) << 14)) ); \ -} while (0) - -#define DMAOUT(val) \ -do { \ - *(vmesa->buf++)=val; \ - DEBUG_BUFS(("DMAOUT: val=0x%x\n", (unsigned int)val)); \ -} while(0) - -#define DMAFINISH() \ -do { \ - /* NOTE: it does nothing - it just prints some summary infos */ \ - DEBUG(("DMAFINISH: vmesa->bufCount=%i\n", vmesa->bufCount)); \ - DEBUG(("buf: index=%i; addr=%p\n", vmesa->bufIndex[vmesa->_bufNum], \ - vmesa->s3vScreen->bufs->list[vmesa->bufIndex[vmesa->_bufNum]].address)); \ -} while(0) - -#define DMAFLUSH() \ -do { \ - if (vmesa->bufCount) { \ - SEND_DMA(vmesa->driFd, vmesa->hHWContext, 1, \ - &vmesa->bufIndex[vmesa->_bufNum], &vmesa->bufCount); \ -/* - GET_DMA(vmesa->driFd, vmesa->hHWContext, 1, \ - &vmesa->bufIndex, &vmesa->bufSize); \ -*/ \ - vmesa->_bufNum = !(vmesa->_bufNum); \ - vmesa->buf = vmesa->_buf[vmesa->_bufNum]; \ -/* - vmesa->buf = \ - vmesa->s3vScreen->bufs->list[vmesa->bufIndex].address; \ -*/ \ - vmesa->bufCount = 0; \ - } \ -} while (0) - -#define CMDCHANGE() \ -do { \ - DMAOUT_CHECK(3DTRI_CMDSET, 1); /* FIXME: TRI/LINE */ \ - DMAOUT(vmesa->CMD); \ - DMAFINISH(); \ -} while (0) - -#ifdef DONT_SEND_DMA -#define GET_DMA(fd, hHWCtx, n, idx, size) -#define SEND_DMA(fd, hHWCtx,n, idx, cnt) -#else -#define GET_DMA(fd, hHWCtx, n, idx, size) \ -do { \ - drmDMAReq dma; \ - int retcode, i; \ -\ - DEBUG(("GET_DMA: ")); \ - DEBUG(("req_count=%i; req_list[#0]=%i; req_size[#0]=%i\n", \ - n, (idx)[n-1], (size)[n-1])); \ -\ - dma.context = (hHWCtx); \ - dma.send_count = 0; \ - dma.send_list = NULL; \ - dma.send_sizes = NULL; \ - dma.flags = S3V_DMA_GET_FLAGS; \ - dma.request_count = (n); \ - dma.request_size = S3V_DMA_BUF_SZ; \ - dma.request_list = (idx); \ - dma.request_sizes = (size); \ -\ - do { \ - if ((retcode = drmDMA((fd), &dma))) { \ - DEBUG_BUFS(("drmDMA (get) returned %d\n", retcode)); \ - } \ -} while (!(dma).granted_count); \ -\ - for (i = 0; i < (n); i++) { \ - DEBUG(("Got buffer %i (index #%i)\n", (idx)[i], i)); \ - DEBUG(("of %i bytes (%i words) size\n", \ - (size)[i], (size)[i] >>2)); \ - /* Convert from bytes to words */ \ - (size)[i] >>= 2; \ - } \ -} while (0) - -#define SEND_DMA(fd, hHWCtx, n, idx, cnt) \ -do { \ - drmDMAReq dma; \ - int retcode, i; \ -\ - DEBUG(("SEND_DMA: ")); \ - DEBUG(("send_count=%i; send_list[#0]=%i; send_sizes[#0]=%i\n", \ - n, (idx)[n-1], (cnt)[n-1])); \ -\ - for (i = 0; i < (n); i++) { \ - /* Convert from words to bytes */ \ - (cnt)[i] <<= 2; \ - } \ -\ - dma.context = (hHWCtx); \ - dma.send_count = (n); \ - dma.send_list = (idx); \ - dma.send_sizes = (cnt); \ - dma.flags = S3V_DMA_SEND_FLAGS; \ - dma.request_count = 0; \ - dma.request_size = 0; \ - dma.request_list = NULL; \ - dma.request_sizes = NULL; \ -\ - if ((retcode = drmDMA((fd), &dma))) { \ - DEBUG_BUFS(("drmDMA (send) returned %d\n", retcode)); \ - } \ -\ - for (i = 0; i < (n); i++) { \ - DEBUG(("Sent buffer %i (index #%i)\n", (idx)[i], i)); \ - DEBUG(("of %i bytes (%i words) size\n", \ - (cnt)[i], (cnt)[i] >>2)); \ - (cnt)[i] = 0; \ - } \ -} while (0) -#endif /* DONT_SEND_DMA */ - -#define GET_FIRST_DMA(fd, hHWCtx, n, idx, size, buf, cnt, vPriv) \ -do { \ - int i; \ - DEBUG_BUFS(("GET_FIRST_DMA\n")); \ - DEBUG_BUFS(("n=%i idx=%i size=%i\n", n, *idx, *size)); \ - DEBUG_BUFS(("going to GET_DMA\n")); \ - GET_DMA(fd, hHWCtx, n, idx, size); \ - DEBUG_BUFS(("coming from GET_DMA\n")); \ - DEBUG_BUFS(("n=%i idx=%i size=%i\n", n, (idx)[0], (size)[0])); \ - for (i = 0; i < (n); i++) { \ - DEBUG_BUFS(("buf #%i @%p\n", \ - i, (vPriv)->bufs->list[(idx)[i]].address)); \ - (buf)[i] = (vPriv)->bufs->list[(idx)[i]].address; \ - (cnt)[i] = 0; \ - } \ - DEBUG(("GOING HOME\n")); \ -} while (0) - -/**************************/ -/* generic, global macros */ -/**************************/ - -#define CALC_LOG2(l2,s) \ -do { \ - int __s = s; \ - l2 = 0; \ - while (__s > 1) { ++l2; __s >>= 1; } \ -} while (0) - -#define PrimType_Null 0x00000000 -#define PrimType_Points 0x10000000 -#define PrimType_Lines 0x20000000 -#define PrimType_LineLoop 0x30000000 -#define PrimType_LineStrip 0x40000000 -#define PrimType_Triangles 0x50000000 -#define PrimType_TriangleStrip 0x60000000 -#define PrimType_TriangleFan 0x70000000 -#define PrimType_Quads 0x80000000 -#define PrimType_QuadStrip 0x90000000 -#define PrimType_Polygon 0xa0000000 -#define PrimType_Mask 0xf0000000 - -#endif /* _S3V_MACROS_H_ */ diff --git a/src/mesa/drivers/dri/s3v/s3v_regs.h b/src/mesa/drivers/dri/s3v/s3v_regs.h deleted file mode 100644 index 26a7c54af5..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_regs.h +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef _S3V_REG_H -#define _S3V_REG_H - -#define S3V_REGS_NUM 256 - -/************ - * DMA REGS * - ************/ - -#define S3V_DMA_ID 0 -#define S3V_DMA_REG 0x8590 -#define S3V_DMA_WRITEP_ID 1 -#define S3V_DMA_WRITEP_REG 0x8594 -#define S3V_DMA_READP_ID 2 -#define S3V_DMA_READP_REG 0x8598 -#define S3V_DMA_ENABLE_ID 3 -#define S3V_DMA_ENABLE_REG 0x859C -#define S3V_DMA_UPDATE_ID 4 -#define S3V_DMA_UPDATE_REG 0x10000 - -/*************** - * STATUS REGS * - ***************/ - -#define S3V_STAT_ID 10 -#define S3V_STAT_REG 0x8504 -#define S3V_STAT_VSYNC_ID 11 -#define S3V_STAT_VSYNC_REG 0x8505 -#define S3V_STAT_3D_DONE_ID 12 -#define S3V_STAT_3D_DONE_REG 0x8506 -#define S3V_STAT_FIFO_OVER_ID 13 -#define S3V_STAT_FIFO_OVER_REG 0x8508 -#define S3V_STAT_FIFO_EMPTY_ID 14 -#define S3V_STAT_FIFO_EMPTY_REG 0x850C -#define S3V_STAT_HDMA_DONE_ID 15 -#define S3V_STAT_HDMA_DONE_REG 0x8514 -#define S3V_STAT_CDMA_DONE_ID 16 -#define S3V_STAT_CDMA_DONE_REG 0x8524 -#define S3V_STAT_3D_FIFO_EMPTY_ID 17 -#define S3V_STAT_3D_FIFO_EMPTY_REG 0x8544 -#define S3V_STAT_LPB_ID 18 -#define S3V_STAT_LPB_REG 0x8584 -#define S3V_STAT_3D_BUSY_ID 19 -#define S3V_STAT_3D_BUSY_REG 0x8704 - -/*********** - * 2D REGS * - ***********/ - -#define S3V_BITBLT_ID 30 -#define S3V_BITBLT_REG 0xA400 -#define S3V_BITBLT_SRC_BASE_ID 31 -#define S3V_BITBLT_SRC_BASE_REG 0xA4D4 -#define S3V_BITBLT_DEST_BASE_ID 32 -#define S3V_BITBLT_DEST_BASE_REG 0xA4D8 -#define S3V_BITBLT_CLIP_L_R_ID 33 -#define S3V_BITBLT_CLIP_L_R_REG 0xA4DC -#define S3V_BITBLT_CLIP_T_B_ID 34 -#define S3V_BITBLT_CLIP_T_B_REG 0xA4E0 -#define S3V_BITBLT_DEST_SRC_STRIDE_ID 35 -#define S3V_BITBLT_DEST_SRC_STRIDE_REG 0xA4E4 -#define S3V_BITBLT_MONO_PAT0_ID 36 -#define S3V_BITBLT_MONO_PAT0_REG 0xA4E8 -#define S3V_BITBLT_MONO_PAT1_ID 37 -#define S3V_BITBLT_MONO_PAT1_REG 0xA4EC -#define S3V_BITBLT_PAT_BG_COLOR_ID 38 -#define S3V_BITBLT_PAT_BG_COLOR_REG 0xA4F0 -#define S3V_BITBLT_PAT_FG_COLOR_ID 39 -#define S3V_BITBLT_PAT_FG_COLOR_REG 0xA4F4 -#define S3V_BITBLT_CMDSET_ID 40 -#define S3V_BITBLT_CMDSET_REG 0xA500 -#define S3V_BITBLT_WIDTH_HEIGHT_ID 41 -#define S3V_BITBLT_WIDTH_HEIGHT_REG 0xA504 -#define S3V_BITBLT_SRC_X_Y_ID 42 -#define S3V_BITBLT_SRC_X_Y_REG 0xA508 -#define S3V_BITBLT_DEST_X_Y_ID 43 -#define S3V_BITBLT_DEST_X_Y_REG 0xA50C -#define S3V_2DLINE_ID 44 -#define S3V_2DLINE_REG 0xA800 -#define S3V_2DPOLY_ID 45 -#define S3V_2DPOLY_REG 0xAC00 - -/*************** - * 3DLINE REGS * - ***************/ -/* base regs */ -#define S3V_3DLINE_ID 50 -#define S3V_3DLINE_REG 0xB000 -#define S3V_3DLINE_Z_BASE_ID 51 -#define S3V_3DLINE_Z_BASE_REG 0xB0D4 -#define S3V_3DLINE_SRC_BASE_ID 52 /* it is the same reg */ -#define S3V_3DLINE_SRC_BASE_REG 0xB0D4 -#define S3V_3DLINE_DEST_BASE_ID 53 -#define S3V_3DLINE_DEST_BASE_REG 0xB0D8 -#define S3V_3DLINE_CLIP_L_R_ID 54 -#define S3V_3DLINE_CLIP_L_R_REG 0xB0DC -#define S3V_3DLINE_CLIP_T_B_ID 55 -#define S3V_3DLINE_CLIP_T_B_REG 0xB0E0 -#define S3V_3DLINE_DEST_SRC_STRIDE_ID 56 -#define S3V_3DLINE_DEST_SRC_STRIDE_REG 0xB0E4 -#define S3V_3DLINE_Z_STRIDE_ID 57 -#define S3V_3DLINE_Z_STRIDE_REG 0xB0E8 -#define S3V_3DLINE_TEX_BASE_ID 58 -#define S3V_3DLINE_TEX_BASE_REG 0xB0EC -#define S3V_3DLINE_TEX_B_COLOR_ID 59 -#define S3V_3DLINE_TEX_B_COLOR_REG 0xB0F0 -#define S3V_3DLINE_FOG_COLOR_ID 60 -#define S3V_3DLINE_FOG_COLOR_REG 0xB0F4 -#define S3V_3DLINE_COLOR0_ID 61 -#define S3V_3DLINE_COLOR0_REG 0xB0F8 -#define S3V_3DLINE_COLOR1_ID 62 -#define S3V_3DLINE_COLOR1_REG 0xB0FC -#define S3V_3DLINE_CMDSET_ID 63 -#define S3V_3DLINE_CMDSET_REG 0xB100 /* special */ -/* tex regs */ -/* FIXME: shouldn't it be a 1D tex for lines? */ -#define S3V_3DLINE_BASEV_ID 64 -#define S3V_3DLINE_BASEV_REG 0xB104 -#define S3V_3DLINE_BASEU_ID 65 -#define S3V_3DLINE_BASEU_REG 0xB108 -#define S3V_3DLINE_WXD_ID 66 -#define S3V_3DLINE_WXD_REG 0xB10C -#define S3V_3DLINE_WYD_ID 67 -#define S3V_3DLINE_WYD_REG 0xB110 -#define S3V_3DLINE_WSTART_ID 68 -#define S3V_3DLINE_WSTART_REG 0xB114 -#define S3V_3DLINE_DXD_ID 69 -#define S3V_3DLINE_DXD_REG 0xB118 -#define S3V_3DLINE_VXD_ID 70 -#define S3V_3DLINE_VXD_REG 0xB11C -#define S3V_3DLINE_UXD_ID 71 -#define S3V_3DLINE_UXD_REG 0xB120 -#define S3V_3DLINE_DYD_ID 72 -#define S3V_3DLINE_DYD_REG 0xB124 -#define S3V_3DLINE_VYD_ID 73 -#define S3V_3DLINE_VYD_REG 0xB128 -#define S3V_3DLINE_UYD_ID 74 -#define S3V_3DLINE_UYD_REG 0xB12C -#define S3V_3DLINE_DSTART_ID 75 -#define S3V_3DLINE_DSTART_REG 0xB130 -#define S3V_3DLINE_VSTART_ID 76 -#define S3V_3DLINE_VSTART_REG 0xB134 -#define S3V_3DLINE_USTART_ID 77 -#define S3V_3DLINE_USTART_REG 0xB138 -/* gourad regs */ -#define S3V_3DLINE_GBD_ID 78 -#define S3V_3DLINE_GBD_REG 0xB144 -#define S3V_3DLINE_ARD_ID 79 -#define S3V_3DLINE_ARD_REG 0xB148 -#define S3V_3DLINE_GS_BS_ID 80 -#define S3V_3DLINE_GS_BS_REG 0xB14C -#define S3V_3DLINE_AS_RS_ID 81 -#define S3V_3DLINE_AS_RS_REG 0xB150 -/* vertex regs */ -#define S3V_3DLINE_DZ_ID 82 -#define S3V_3DLINE_DZ_REG 0xB158 -#define S3V_3DLINE_ZSTART_ID 83 -#define S3V_3DLINE_ZSTART_REG 0xB15C -#define S3V_3DLINE_XEND0_END1_ID 84 -#define S3V_3DLINE_XEND0_END1_REG 0xB16C -#define S3V_3DLINE_DX_ID 85 -#define S3V_3DLINE_DX_REG 0xB170 -#define S3V_3DLINE_XSTART_ID 86 -#define S3V_3DLINE_XSTART_REG 0xB174 -#define S3V_3DLINE_YSTART_ID 87 -#define S3V_3DLINE_YSTART_REG 0xB178 -#define S3V_3DLINE_YCNT_ID 88 -#define S3V_3DLINE_YCNT_REG 0xB17C - -/************** - * 3DTRI REGS * - **************/ -/* base regs */ -#define S3V_3DTRI_ID 100 -#define S3V_3DTRI_REG 0xB400 -#define S3V_3DTRI_Z_BASE_ID 101 -#define S3V_3DTRI_Z_BASE_REG 0xB4D4 -#define S3V_3DTRI_SRC_BASE_ID 102 /* it is the same reg */ -#define S3V_3DTRI_SRC_BASE_REG 0xB4D4 -#define S3V_3DTRI_DEST_BASE_ID 103 -#define S3V_3DTRI_DEST_BASE_REG 0xB4D8 -#define S3V_3DTRI_CLIP_L_R_ID 104 -#define S3V_3DTRI_CLIP_L_R_REG 0xB4DC -#define S3V_3DTRI_CLIP_T_B_ID 105 -#define S3V_3DTRI_CLIP_T_B_REG 0xB4E0 -#define S3V_3DTRI_DEST_SRC_STRIDE_ID 106 -#define S3V_3DTRI_DEST_SRC_STRIDE_REG 0xB4E4 -#define S3V_3DTRI_Z_STRIDE_ID 107 -#define S3V_3DTRI_Z_STRIDE_REG 0xB4E8 -#define S3V_3DTRI_TEX_BASE_ID 108 -#define S3V_3DTRI_TEX_BASE_REG 0xB4EC -#define S3V_3DTRI_TEX_B_COLOR_ID 109 -#define S3V_3DTRI_TEX_B_COLOR_REG 0xB4F0 -#define S3V_3DTRI_FOG_COLOR_ID 110 -#define S3V_3DTRI_FOG_COLOR_REG 0xB4F4 -#define S3V_3DTRI_COLOR0_ID 111 -#define S3V_3DTRI_COLOR0_REG 0xB4F8 -#define S3V_3DTRI_COLOR1_ID 112 -#define S3V_3DTRI_COLOR1_REG 0xB4FC -#define S3V_3DTRI_CMDSET_ID 113 /* special */ -#define S3V_3DTRI_CMDSET_REG 0xB500 -/* tex regs */ -#define S3V_3DTRI_BASEV_ID 114 -#define S3V_3DTRI_BASEV_REG 0xB504 -#define S3V_3DTRI_BASEU_ID 115 -#define S3V_3DTRI_BASEU_REG 0xB508 -#define S3V_3DTRI_WXD_ID 116 -#define S3V_3DTRI_WXD_REG 0xB50C -#define S3V_3DTRI_WYD_ID 117 -#define S3V_3DTRI_WYD_REG 0xB510 -#define S3V_3DTRI_WSTART_ID 118 -#define S3V_3DTRI_WSTART_REG 0xB514 -#define S3V_3DTRI_DXD_ID 119 -#define S3V_3DTRI_DXD_REG 0xB518 -#define S3V_3DTRI_VXD_ID 120 -#define S3V_3DTRI_VXD_REG 0xB51C -#define S3V_3DTRI_UXD_ID 121 -#define S3V_3DTRI_UXD_REG 0xB520 -#define S3V_3DTRI_DYD_ID 122 -#define S3V_3DTRI_DYD_REG 0xB524 -#define S3V_3DTRI_VYD_ID 123 -#define S3V_3DTRI_VYD_REG 0xB528 -#define S3V_3DTRI_UYD_ID 124 -#define S3V_3DTRI_UYD_REG 0xB52C -#define S3V_3DTRI_DSTART_ID 125 -#define S3V_3DTRI_DSTART_REG 0xB530 -#define S3V_3DTRI_VSTART_ID 126 -#define S3V_3DTRI_VSTART_REG 0xB534 -#define S3V_3DTRI_USTART_ID 127 -#define S3V_3DTRI_USTART_REG 0xB538 -/* gourad regs */ -#define S3V_3DTRI_GBX_ID 128 -#define S3V_3DTRI_GBX_REG 0xB53C -#define S3V_3DTRI_ARX_ID 129 -#define S3V_3DTRI_ARX_REG 0xB540 -#define S3V_3DTRI_GBY_ID 130 -#define S3V_3DTRI_GBY_REG 0xB544 -#define S3V_3DTRI_ARY_ID 131 -#define S3V_3DTRI_ARY_REG 0xB548 -#define S3V_3DTRI_GS_BS_ID 132 -#define S3V_3DTRI_GS_BS_REG 0xB54C -#define S3V_3DTRI_AS_RS_ID 133 -#define S3V_3DTRI_AS_RS_REG 0xB550 -/* vertex regs */ -#define S3V_3DTRI_ZXD_ID 134 -#define S3V_3DTRI_ZXD_REG 0xB554 -#define S3V_3DTRI_ZYD_ID 135 -#define S3V_3DTRI_ZYD_REG 0xB558 -#define S3V_3DTRI_ZSTART_ID 136 -#define S3V_3DTRI_ZSTART_REG 0xB55C -#define S3V_3DTRI_TXDELTA12_ID 137 -#define S3V_3DTRI_TXDELTA12_REG 0xB560 -#define S3V_3DTRI_TXEND12_ID 138 -#define S3V_3DTRI_TXEND12_REG 0xB564 -#define S3V_3DTRI_TXDELTA01_ID 139 -#define S3V_3DTRI_TXDELTA01_REG 0xB568 -#define S3V_3DTRI_TXEND01_ID 140 -#define S3V_3DTRI_TXEND01_REG 0xB56C -#define S3V_3DTRI_TXDELTA02_ID 141 -#define S3V_3DTRI_TXDELTA02_REG 0xB570 -#define S3V_3DTRI_TXSTART02_ID 142 -#define S3V_3DTRI_TXSTART02_REG 0xB574 -#define S3V_3DTRI_TYS_ID 143 -#define S3V_3DTRI_TYS_REG 0xB578 -#define S3V_3DTRI_TY01_Y12_ID 144 -#define S3V_3DTRI_TY01_Y12_REG 0xB57C - -/* COMMANDS (to 0xB100 [lines] or 0xB500 [tris]) */ - -/* Auto execute */ -#define AUTO_EXEC_MASK 0x00000001 -#define AUTO_EXEC_OFF (0x0) -#define AUTO_EXEC_ON (0x1) -/* HW clipping */ -#define HW_CLIP_MASK 0x00000002 -#define HW_CLIP_OFF (0x0 << 1) -#define HW_CLIP_ON (0x1 << 1) -/* Destination color */ -#define DEST_COL_MASK 0x0000001c -#define DEST_COL_PAL (0x0 << 2) /* 8 bpp - palettized */ -#define DEST_COL_1555 (0x1 << 2) /* 16 bpp - ZRGB */ -#define DEST_COL_888 (0x2 << 2) /* 24 bpp - RGB */ -/* Texture color */ -#define TEX_COL_MASK 0x000000e0 -#define TEX_COL_ARGB8888 (0x0 << 5) /* 32 bpp - ARGB */ -#define TEX_COL_ARGB4444 (0x1 << 5) /* 16 bpp - ARGB */ -#define TEX_COL_ARGB1555 (0x2 << 5) /* 16 bpp - ARGB */ -#define TEX_COL_ALPHA4 (0x3 << 5) /* 8 bpp - ALPHA4 */ -#define TEX_COL_BLEND4_LOW (0x4 << 5) /* 4 bpp - BLEND4 low nibble */ -#define TEX_COL_BLEND4_HIGH (0x5 << 5) /* 4 bpp - BLEND4 high nibble */ -#define TEX_COL_PAL (0x6 << 5) /* 8 bpp - palettized */ -#define TEX_COL_YUV (0x7 << 5) /* 16 bpp - YUV */ -/* Mipmap level */ -#define MIP_MASK 0x00000f00 -#define MIPMAP_LEVEL(s) (s << 8) /* 8 -> 11 bits */ -/* Texture filtering */ -#define TEX_FILTER_MASK 0x00007000 -#define MIP_NEAREST (0x0 << 12) -#define LINEAR_MIP_NEAREST (0x1 << 12) -#define MIP_LINEAR (0x2 << 12) -#define LINEAR_MIP_LINEAR (0x3 << 12) -#define NEAREST (0x4 << 12) -#define FAST_BILINEAR (0x5 << 12) -#define LINEAR (0x6 << 12) -/* Texture blending */ -#define TEX_BLEND_MAKS 0x00018000 -#define TEX_REFLECT (0x0 << 15) -#define TEX_MODULATE (0x1 << 15) -#define TEX_DECAL (0x2 << 15) -/* Fog */ -#define FOG_MASK 0x00020000 -#define FOG_OFF (0x0 << 17) -#define FOG_ON (0x1 << 17) -/* Alpha blending */ -#define ALPHA_BLEND_MASK 0x000c0000 -#define ALPHA_OFF (0x0 << 18) | (0x0 << 19) -#define ALPHA_TEX (0x2 << 18) -#define ALPHA_SRC (0x3 << 18) -/* Depth compare mode */ -#define Z_MODE_MASK 0x00700000 -#define Z_NEVER (0x0 << 20) -#define Z_GREATER (0x1 << 20) -#define Z_EQUAL (0x2 << 20) -#define Z_GEQUAL (0x3 << 20) -#define Z_LESS (0x4 << 20) -#define Z_NOTEQUAL (0x5 << 20) -#define Z_LEQUAL (0x6 << 20) -#define Z_ALWAYS (0x7 << 20) -/* Depth update */ -#define Z_UPDATE_MASK 0x00800000 -#define Z_UPDATE_OFF (0x0 << 23) /* disable z update */ -#define Z_UPDATE_ON (0x1 << 23) -/* Depth buffering mode */ -#define Z_BUFFER_MASK 0x03000000 -#define Z_BUFFER (0x0 << 24) | (0x0 << 25) -#define Z_MUX_BUF (0x1 << 24) | (0x0 << 25) -#define Z_MUX_DRAW (0x2 << 24) -#define Z_OFF (0x3 << 24) /* no z buffering */ -/* Texture wrapping */ -#define TEX_WRAP_MASK 0x04000000 -#define TEX_WRAP_OFF (0x0 << 26) -#define TEX_WRAP_ON (0x1 << 26) -/* 3d command */ -#define DO_MASK 0x78000000 -#define DO_GOURAUD_TRI (0x0 << 27) -#define DO_TEX_LIT_TRI_OLD (0x1 << 27) -#define DO_TEX_UNLIT_TRI_OLD (0x2 << 27) -#define DO_TEX_LIT_TRI (0x5 << 27) -#define DO_TEX_UNLIT_TRI (0x6 << 27) -#define DO_3D_LINE (0x8 << 27) -#define DO_NOP (0xf << 27) /* turn on autoexec */ -/* status */ -#define CMD_MASK 0x80000000 -#define CMD_2D (0x0 << 31) /* execute a 2d cmd */ -#define CMD_3D (0x1 << 31) /* execute a 3d cmd */ - -/* global masks */ -#define TEX_MASK ( TEX_COL_MASK | TEX_WRAP_MASK | MIP_MASK \ - | TEX_FILTER_MASK | TEX_BLEND_MAKS \ - | TEX_WRAP_MASK ) -#define Z_MASK ( Z_MODE_MASK | Z_UPDATE_MASK | Z_BUFFER_MASK ) - -#endif /* _S3V_REG_H */ diff --git a/src/mesa/drivers/dri/s3v/s3v_render.c b/src/mesa/drivers/dri/s3v/s3v_render.c deleted file mode 100644 index 5023f3c464..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_render.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/mtypes.h" - -#include "tnl/t_context.h" - -#include "s3v_context.h" -#include "s3v_tris.h" -#include "s3v_vb.h" - - -#define HAVE_POINTS 0 -#define HAVE_LINES 0 -#define HAVE_LINE_STRIPS 0 -#define HAVE_TRIANGLES 0 -#define HAVE_TRI_STRIPS 0 -#define HAVE_TRI_STRIP_1 0 -#define HAVE_TRI_FANS 0 -#define HAVE_QUADS 0 -#define HAVE_QUAD_STRIPS 0 -#define HAVE_POLYGONS 0 - -#define HAVE_ELTS 0 - -#if 0 -static void VERT_FALLBACK( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); -/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - int _flags; - - DEBUG(("VERT_FALLBACK: flags & PRIM_MODE_MASK = %i\n", - flags & PRIM_MODE_MASK)); - DEBUG(("VERT_FALLBACK: flags=%i PRIM_MODE_MASK=%i\n", - flags, PRIM_MODE_MASK)); -#if 0 - tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); -#endif - tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); - - _flags = flags & PRIM_MODE_MASK; - - tnl->Driver.Render.PrimTabVerts[_flags]( ctx, start, count, flags ); - S3V_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS; -} -#endif - -static const GLuint hw_prim[GL_POLYGON+1] = { - PrimType_Points, - PrimType_Lines, - PrimType_LineLoop, - PrimType_LineStrip, - PrimType_Triangles, - PrimType_TriangleStrip, - PrimType_TriangleFan, - PrimType_Quads, - PrimType_QuadStrip, - PrimType_Polygon -}; - -static INLINE void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim ) -{ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - int _hw_prim = hw_prim[prim]; - - DEBUG(("s3vStartPrimitive (new #%i) ", prim)); - - if (_hw_prim != vmesa->restore_primitive) { - - if (prim == 4) { /* TRI */ - DEBUG(("switching to tri\n")); - vmesa->prim_cmd = vmesa->_tri[vmesa->_3d_mode]; - vmesa->alpha_cmd = vmesa->_alpha[vmesa->_3d_mode]; - DMAOUT_CHECK(3DTRI_Z_BASE, 12); - } else if (prim == 1) { /* LINE */ - DEBUG(("switching to line\n")); - vmesa->prim_cmd = DO_3D_LINE; - vmesa->alpha_cmd = vmesa->_alpha[0]; - DMAOUT_CHECK(3DLINE_Z_BASE, 12); - } else { - DEBUG(("Never mind the bollocks!\n")); - } - - DMAOUT(vmesa->s3vScreen->depthOffset & 0x003FFFF8); - DMAOUT(vmesa->DestBase); - /* DMAOUT(vmesa->ScissorLR); */ - /* DMAOUT(vmesa->ScissorTB); */ - DMAOUT( (0 << 16) | (dPriv->w-1) ); - DMAOUT( (0 << 16) | (dPriv->h-1) ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->TexStride ); - DMAOUT(vmesa->SrcStride); - DMAOUT(vmesa->TexOffset); - DMAOUT(vmesa->TextureBorderColor); - DMAOUT(0); /* FOG */ - DMAOUT(0); - DMAOUT(0); - DMAOUT(vmesa->CMD | vmesa->prim_cmd | vmesa->alpha_cmd); - DMAFINISH(); - } - - vmesa->restore_primitive = _hw_prim; -} - -static INLINE void s3vEndPrimitive( s3vContextPtr vmesa ) -{ -/* GLcontext *ctx = vmesa->glCtx; */ - DEBUG(("s3vEndPrimitive\n")); -} - -#define LOCAL_VARS s3vContextPtr vmesa = S3V_CONTEXT(ctx) -#define INIT( prim ) s3vStartPrimitive( vmesa, prim ) -#define FINISH s3vEndPrimitive( vmesa ) -#define NEW_PRIMITIVE() (void) vmesa -#define NEW_BUFFER() (void) vmesa -#define FIRE_VERTICES() (void) vmesa -#define GET_CURRENT_VB_MAX_VERTS() \ - (vmesa->bufSize - vmesa->bufCount) / 2 -#define GET_SUBSEQUENT_VB_MAX_VERTS() \ - S3V_DMA_BUF_SZ / 2 -/* XXX */ -#define ALLOC_VERTS(nr) NULL -#define EMIT_VERTS(ctx, start, count, buf) NULL -#define FLUSH() s3vEndPrimitive( vmesa ) - -#define TAG(x) s3v_##x - -#include "tnl_dd/t_dd_dmatmp.h" - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - -static GLboolean s3v_run_render( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint i; - tnl_render_func *tab; - - DEBUG(("s3v_run_render\n")); - - /* FIXME: hw clip */ - if (VB->ClipOrMask || vmesa->RenderIndex != 0) { - DEBUG(("*** CLIPPED in render ***\n")); -#if 1 - return GL_TRUE; /* don't handle clipping here */ -#endif - } - - - /* We don't do elts */ - if (VB->Elts) - return GL_TRUE; - - tab = TAG(render_tab_verts); - - tnl->Driver.Render.Start( ctx ); - - for (i = 0 ; i < VB->PrimitiveCount ; i++ ) - { - GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); - GLuint start = VB->Primitive[i].start; - GLuint length = VB->Primitive[i].count; - - DEBUG(("s3v_run_render (loop=%i) (lenght=%i)\n", i, length)); - - if (length) { - tnl->Driver.Render.BuildVertices( ctx, start, - start+length, ~0 /*stage->inputs*/); /* XXX */ - tnl->Driver.Render.PrimTabVerts[prim & PRIM_MODE_MASK] - ( ctx, start, start + length, prim ); - vmesa->SetupNewInputs = VERT_BIT_POS; - } - } - - tnl->Driver.Render.Finish( ctx ); - - return GL_FALSE; /* finished the pipe */ -} - - - -const struct tnl_pipeline_stage _s3v_render_stage = -{ - "s3v render", - NULL, - NULL, - NULL, - NULL, - s3v_run_render /* run */ -}; diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.c b/src/mesa/drivers/dri/s3v/s3v_screen.c deleted file mode 100644 index f1810597e6..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_screen.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_dri.h" - -s3vScreenPtr s3vCreateScreen( __DRIscreenPrivate *sPriv ) -{ - s3vScreenPtr s3vScreen; - S3VDRIPtr vDRIPriv = (S3VDRIPtr)sPriv->pDevPriv; - -/* int i; */ - - DEBUG(("s3vCreateScreen\n")); - DEBUG(("sPriv->pDevPriv at %p\n", sPriv->pDevPriv)); - DEBUG(("size = %i\n", sizeof(*vDRIPriv))); - - if (sPriv->devPrivSize != sizeof(S3VDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(S3VDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area */ - s3vScreen = (s3vScreenPtr) CALLOC( sizeof(*s3vScreen) ); - if ( !s3vScreen ) return NULL; - - s3vScreen->regionCount = 4; /* Magic number. Can we fix this? */ - - s3vScreen->regions = _mesa_malloc(s3vScreen->regionCount * - sizeof(s3vRegion)); - DEBUG(("sPriv->fd = %i\nvDRIPriv->dmaBufHandle = %x\n", - sPriv->fd, vDRIPriv->dmaBufHandle)); - - DEBUG(("vDRIPriv->dmaBufSize=%i\nvDRIPriv->dmaBuf=%p\n", - vDRIPriv->dmaBufSize, vDRIPriv->dmaBuf)); - - - /* Get the list of dma buffers */ - s3vScreen->bufs = drmMapBufs(sPriv->fd); - - if (!s3vScreen->bufs) { - DEBUG(("Helter/skelter with drmMapBufs\n")); - return GL_FALSE; - } - - s3vScreen->textureSize = vDRIPriv->texSize; - s3vScreen->logTextureGranularity = vDRIPriv->logTextureGranularity; - s3vScreen->cpp = vDRIPriv->cpp; - s3vScreen->frontOffset = vDRIPriv->frontOffset; - s3vScreen->frontPitch = vDRIPriv->frontPitch; - s3vScreen->backOffset = vDRIPriv->backOffset; - s3vScreen->backPitch = vDRIPriv->frontPitch; /* FIXME: check */ - s3vScreen->depthOffset = vDRIPriv->depthOffset; - s3vScreen->depthPitch = vDRIPriv->frontPitch; - s3vScreen->texOffset = vDRIPriv->texOffset; - - s3vScreen->driScreen = sPriv; - - DEBUG(("vDRIPriv->width =%i; vDRIPriv->deviceID =%x\n", vDRIPriv->width, - vDRIPriv->deviceID)); - DEBUG(("vDRIPriv->mem =%i\n", vDRIPriv->mem)); - DEBUG(("vDRIPriv->fbOffset =%i\n", vDRIPriv->fbOffset)); - DEBUG((" ps3vDRI->fbStride =%i\n", vDRIPriv->fbStride)); - DEBUG(("s3vScreen->cpp = %i\n", s3vScreen->cpp)); - DEBUG(("s3vScreen->backOffset = %x\n", s3vScreen->backOffset)); - DEBUG(("s3vScreen->depthOffset = %x\n", s3vScreen->depthOffset)); - DEBUG(("s3vScreen->texOffset = %x\n", s3vScreen->texOffset)); - DEBUG(("I will return from s3vCreateScreen now\n")); - - DEBUG(("s3vScreen->bufs = 0x%x\n", s3vScreen->bufs)); - return s3vScreen; -} - -/* Destroy the device specific screen private data struct. - */ -void s3vDestroyScreen( __DRIscreenPrivate *sPriv ) -{ - s3vScreenPtr s3vScreen = (s3vScreenPtr)sPriv->private; - - DEBUG(("s3vDestroyScreen\n")); - - /* First, unmap the dma buffers */ -/* - drmUnmapBufs( s3vScreen->bufs ); -*/ - /* Next, unmap all the regions */ -/* while (s3vScreen->regionCount > 0) { - - (void)drmUnmap(s3vScreen->regions[s3vScreen->regionCount].map, - s3vScreen->regions[s3vScreen->regionCount].size); - s3vScreen->regionCount--; - - } - FREE(s3vScreen->regions); */ - if (s3vScreen) - FREE(s3vScreen); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.h b/src/mesa/drivers/dri/s3v/s3v_screen.h deleted file mode 100644 index c49bc8587d..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_screen.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "main/mtypes.h" - -typedef struct _s3vRegion { - drm_handle_t handle; - drmSize size; - drmAddress map; -} s3vRegion, *s3vRegionPtr; - -typedef struct { - - int regionCount; /* Count of register regions */ - s3vRegion *regions; /* Vector of mapped region info */ - - drmBufMapPtr bufs; /* Map of DMA buffers */ - - __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */ - - int cpp; - int frontPitch; - int frontOffset; - - int backPitch; - int backOffset; - int backX; - int backY; - - int depthOffset; - int depthPitch; - - int texOffset; - int textureOffset; - int textureSize; - int logTextureGranularity; -} s3vScreenRec, *s3vScreenPtr; - diff --git a/src/mesa/drivers/dri/s3v/s3v_span.c b/src/mesa/drivers/dri/s3v/s3v_span.c deleted file mode 100644 index f9f7c0d1ee..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_span.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" -#include "s3v_lock.h" - -#include "swrast/swrast.h" - -#define _SPANLOCK 1 -#define DBG 0 - -#define LOCAL_VARS \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - __DRIscreenPrivate *sPriv = vmesa->driScreen; \ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \ - driRenderbuffer *drb = (driRenderbuffer *) rb; \ - GLuint cpp = drb->cpp; \ - GLuint pitch = ( (drb->backBuffer) ? \ - ((dPriv->w+31)&~31) * cpp \ - : sPriv->fbWidth * cpp); \ - GLuint height = dPriv->h; \ - char *buf = (char *)(sPriv->pFB + drb->offset \ - + (drb->backBuffer ? 0 : dPriv->x * cpp + dPriv->y * pitch));\ - GLuint p; \ - (void) p - -/* FIXME! Depth/Stencil read/writes don't work ! */ -#define LOCAL_DEPTH_VARS \ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \ - __DRIscreenPrivate *sPriv = vmesa->driScreen; \ - driRenderbuffer *drb = (driRenderbuffer *) rb; \ - GLuint pitch = drb->pitch; \ - GLuint height = dPriv->h; \ - char *buf = (char *)(sPriv->pFB + drb->offset); \ - (void) pitch - -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS - -#define Y_FLIP( _y ) (height - _y - 1) - -#if _SPANLOCK /* OK, we lock */ - -#define HW_LOCK() \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - (void) vmesa; \ - DMAFLUSH(); \ - S3V_SIMPLE_FLUSH_LOCK(vmesa); -#define HW_UNLOCK() S3V_SIMPLE_UNLOCK(vmesa); - -#else /* plz, don't lock */ - -#define HW_LOCK() \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - (void) vmesa; \ - DMAFLUSH(); -#define HW_UNLOCK() - -#endif - - -/* ================================================================ - * Color buffer - */ - -/* 16 bit, RGB565 color spanline and pixel functions - */ -#define INIT_MONO_PIXEL(p, color) \ - p = S3VIRGEPACKCOLOR555( color[0], color[1], color[2], color[3] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ -do { \ - *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 7) | \ - (((int)g & 0xf8) << 2) | \ - (((int)b & 0xf8) >> 3)); \ - DEBUG(("buf=0x%x drawOffset=0x%x dPriv->x=%i drb->cpp=%i dPriv->y=%i pitch=%i\n", \ - sPriv->pFB, vmesa->drawOffset, dPriv->x, drb->cpp, dPriv->y, pitch)); \ - DEBUG(("dPriv->w = %i\n", dPriv->w)); \ -} while(0) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \ - rgba[0] = (p >> 7) & 0xf8; \ - rgba[1] = (p >> 2) & 0xf8; \ - rgba[2] = (p << 3) & 0xf8; \ - rgba[3] = 0xff; /* - if ( rgba[0] & 0x08 ) rgba[0] |= 0x07; \ - if ( rgba[1] & 0x04 ) rgba[1] |= 0x03; \ - if ( rgba[2] & 0x08 ) rgba[2] |= 0x07; */ \ - } while (0) - -#define TAG(x) s3v##x##_RGB555 -#include "spantmp.h" - - -/* 32 bit, ARGB8888 color spanline and pixel functions - */ - -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \ - (g << 8) | \ - (r << 16) | \ - (a << 24) ) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ -do { \ - GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch); \ - rgba[0] = (p >> 16) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ -} while (0) - -#define TAG(x) s3v##x##_ARGB8888 -#include "spantmp.h" - - -/* 16 bit depthbuffer functions. - */ -#define VALUE_TYPE GLushort - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLushort *)(buf + _x*2 + _y*dPriv->w*2) = d - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLushort *)(buf + _x*2 + _y*dPriv->w*2); - -#define TAG(x) s3v##x##_z16 -#include "depthtmp.h" - - - - -/* 32 bit depthbuffer functions. - */ -#if 0 -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = d; - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch); - -#define TAG(x) s3v##x##_32 -#include "depthtmp.h" -#endif - - -/* 24/8 bit interleaved depth/stencil functions - */ -#if 0 -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) { \ - GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \ - tmp &= 0xff; \ - tmp |= (d) & 0xffffff00; \ - *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \ -} - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch) & ~0xff - - -#define TAG(x) s3v##x##_24_8 -#include "depthtmp.h" - -#define WRITE_STENCIL( _x, _y, d ) { \ - GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \ - tmp &= 0xffffff00; \ - tmp |= d & 0xff; \ - *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \ -} - -#define READ_STENCIL( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xff - -#define TAG(x) s3v##x##_24_8 -#include "stenciltmp.h" - -#endif - - -/** - * Plug in the Get/Put routines for the given driRenderbuffer. - */ -void -s3vSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) -{ - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - s3vInitPointers_RGB555(&drb->Base); - } - else { - s3vInitPointers_ARGB8888(&drb->Base); - } - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { - s3vInitDepthPointers_z16(&drb->Base); - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { - /* not done yet */ - } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { - /* not done yet */ - } -} diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c deleted file mode 100644 index 561f42c705..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_state.c +++ /dev/null @@ -1,888 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" -#include "s3v_macros.h" -#include "s3v_dri.h" -#include "main/macros.h" -#include "main/colormac.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" -#include "tnl/tnl.h" - -/* #define DEBUG(str) printf str */ -#define ENABLELIGHTING 0 - - -/* ============================================================= - * Alpha blending - */ - -static void s3vUpdateAlphaMode( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - uint32_t cmd = vmesa->CMD; - cmd &= ~ALPHA_BLEND_MASK; - - if ( ctx->Color.BlendEnabled ) { - DEBUG(("ctx->Color.AlphaEnabled = 1")); - vmesa->_alpha[0] = ALPHA_SRC; - vmesa->_alpha[1] = vmesa->_alpha_tex; /* FIXME: not all tex modes - support alpha */ - } else { - DEBUG(("ctx->Color.AlphaEnabled = 0")); - vmesa->_alpha[0] = vmesa->_alpha[1] = ALPHA_OFF; - } -#if 1 - if ((cmd & DO_MASK) & DO_3D_LINE) { /* we are drawing 3d lines */ - /* which don't support tex */ - cmd |= vmesa->_alpha[0]; - } else { - cmd |= vmesa->_alpha[vmesa->_3d_mode]; - } - - vmesa->CMD = cmd; /* FIXME: enough? */ -#else - vmesa->restore_primitive = -1; -#endif - -} - -static void s3vDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("s3vDDAlphaFunc\n")); - - vmesa->new_state |= S3V_NEW_ALPHA; -} - -static void s3vDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("s3vDDBlendFunc\n")); - - vmesa->new_state |= S3V_NEW_ALPHA; -} - -/* ================================================================ - * Buffer clear - */ - -static void s3vDDClear( GLcontext *ctx, GLbitfield mask ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - unsigned int _stride; - GLint cx = ctx->DrawBuffer->_Xmin; - GLint cy = ctx->DrawBuffer->_Ymin; - GLint cw = ctx->DrawBuffer->_Xmax - cx; - GLint ch = ctx->DrawBuffer->_Ymax - cy; - - /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */ - - vmesa->restore_primitive = -1; - - /* Update and emit any new state. We need to do this here to catch - * changes to the masks. - * FIXME: Just update the masks? - */ - - if ( vmesa->new_state ) - s3vDDUpdateHWState( ctx ); - -/* s3vUpdateMasks( ctx ); */ -/* s3vUpdateClipping( ctx ); */ -/* s3vEmitHwState( vmesa ); */ - - -#if 1 /* soft (0)/hw (1)*/ - - DEBUG(("*** s3vDDClear ***\n")); - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(vmesa->SrcBase); - DMAOUT(vmesa->DestBlit); - DMAOUT( vmesa->ScissorLR ); - DMAOUT( vmesa->ScissorTB ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->SrcStride ); /* FIXME: unify */ - DMAOUT( (~(0)) ); /* masks */ - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(vmesa->ClearColor); - DMAOUT(0); - DMAOUT(0); - /* FIXME */ - DMAOUT(0x16000122 | 0x5 | (0xF0 << 17)); /* black magic to me */ - DMAOUT(vmesa->ScissorWH); - DMAOUT(vmesa->SrcXY); - DMAOUT(vmesa->DestXY); - DMAFINISH(); - - if (mask & BUFFER_BIT_DEPTH) { /* depth */ - DEBUG(("BUFFER_BIT_DEPTH\n")); - - _stride = ((cw+31)&~31) * 2; /* XXX cw or Buffer->Width??? */ - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(0); - DMAOUT(vmesa->s3vScreen->depthOffset); - DMAOUT( (0 << 16) | cw ); - DMAOUT( (0 << 16) | ch ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->DestStride ); - DMAOUT( (~(0)) ); /* masks */ - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(vmesa->ClearDepth); /* 0x7FFF */ - /* FIXME */ - DMAOUT(0); - DMAOUT(0); - DMAOUT(0x16000122 | 0x5 | (0xF0 << 17)); - DMAOUT( ((cw-1) << 16) | (ch-1) ); - DMAOUT(0); - DMAOUT( (0 << 16) | 0 ); - DMAFINISH(); - - DEBUG(("vmesa->ClearDepth = 0x%x\n", vmesa->ClearDepth)); - mask &= ~BUFFER_BIT_DEPTH; - } - - if (!vmesa->NotClipped) { - DEBUG(("vmesa->NotClipped\n")); /* yes */ - } - - if (!(vmesa->EnabledFlags & S3V_BACK_BUFFER)) { - DEBUG(("!S3V_BACK_BUFFER -> flush\n")); - DMAFLUSH(); - } -/* - if ( mask ) - DEBUG(("still masked ;3(\n")); */ /* yes */ -#else - _swrast_Clear( ctx, mask ); -#endif -} - -/* ============================================================= - * Depth testing - */ - -static void s3vUpdateZMode( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - uint32_t cmd = vmesa->CMD; - - DEBUG(("Depth.Test = %i\n", ctx->Depth.Test)); - DEBUG(("CMD was = 0x%x ", cmd)); - -/* printf("depth --- CMD was = 0x%x \n", cmd); */ - - cmd &= ~Z_MASK; /* 0xfc0fffff; */ - /* Z_BUFFER */ /* 000 mode */ /* Z_UPDATE_OFF */ - - if (!ctx->Depth.Test) - cmd |= Z_OFF; - - if ( ctx->Depth.Mask ) - cmd |= Z_UPDATE_ON; - - switch ( ctx->Depth.Func ) { - case GL_NEVER: - cmd |= Z_NEVER; - break; - case GL_ALWAYS: - cmd |= Z_ALWAYS; - break; - case GL_LESS: - cmd |= Z_LESS; - break; - case GL_LEQUAL: - cmd |= Z_LEQUAL; - break; - case GL_EQUAL: - cmd |= Z_EQUAL; - break; - case GL_GEQUAL: - cmd |= Z_GEQUAL; - break; - case GL_GREATER: - cmd |= Z_GREATER; - break; - case GL_NOTEQUAL: - cmd |= Z_NOTEQUAL; - break; - } - - DEBUG(("CMD is 0x%x\n", cmd)); - - vmesa->dirty |= S3V_UPLOAD_DEPTH; - vmesa->CMD = cmd; -} - -static void s3vDDDepthFunc( GLcontext *ctx, GLenum func ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - -/* FLUSH_BATCH( vmesa ); */ - DEBUG(("s3vDDDepthFunc\n")); - vmesa->new_state |= S3V_NEW_DEPTH; -} - -static void s3vDDDepthMask( GLcontext *ctx, GLboolean flag ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - /* FLUSH_BATCH( vmesa ); */ - DEBUG(("s3vDDDepthMask\n")); - vmesa->new_state |= S3V_NEW_DEPTH; -} - -static void s3vDDClearDepth( GLcontext *ctx, GLclampd d ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - switch ( vmesa->DepthSize ) { - case 15: - case 16: - vmesa->ClearDepth = d * 0x0000ffff; /* 65536 */ - DEBUG(("GLclampd d = %f\n", d)); - DEBUG(("ctx->Depth.Clear = %f\n", ctx->Depth.Clear)); - DEBUG(("(They should be the same)\n")); - break; - case 24: - vmesa->ClearDepth = d * 0x00ffffff; - break; - case 32: - vmesa->ClearDepth = d * 0xffffffff; - break; - } -} - -static void s3vDDFinish( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - DMAFLUSH(); -} - -static void s3vDDFlush( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - DMAFLUSH(); -} - -/* ============================================================= - * Fog - */ - -static void s3vUpdateFogAttrib( GLcontext *ctx ) -{ -/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - - if (ctx->Fog.Enabled) { - } else { - } - - switch (ctx->Fog.Mode) { - case GL_LINEAR: - break; - case GL_EXP: - break; - case GL_EXP2: - break; - } -} - -static void s3vDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - vmesa->new_state |= S3V_NEW_FOG; -} - -/* ============================================================= - * Lines - */ -static void s3vDDLineWidth( GLcontext *ctx, GLfloat width ) -{ - /* FIXME: on virge you only have one size of 3d lines * - * if we wanted more, we should start using tris instead * - * but virge has problem with some tris when all of the * - * vertices stay on a line */ -} - -/* ============================================================= - * Points - */ -static void s3vDDPointSize( GLcontext *ctx, GLfloat size ) -{ - /* FIXME: we use 3d line to fake points. So same limitations - * as above apply */ -} - -/* ============================================================= - * Polygon - */ - -static void s3vUpdatePolygon( GLcontext *ctx ) -{ - /* FIXME: I don't think we could do much here */ - - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - vmesa->dirty |= S3V_UPLOAD_POLYGON; -} - -/* ============================================================= - * Clipping - */ - -static void s3vUpdateClipping( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - int x0,y0,x1,y1; - - DEBUG((">>> s3vUpdateClipping <<<\n")); -/* - if ( vmesa->driDrawable ) { - DEBUG(("s3vUpdateClipping\n")); -*/ - if (vmesa->EnabledFlags & S3V_BACK_BUFFER) { - DEBUG(("S3V_BACK_BUFFER\n")); - - x0 = 0; - y0 = 0; - x1 = dPriv->w - 1; - y1 = dPriv->h - 1; - - vmesa->SrcBase = 0; - vmesa->DestBase = vmesa->s3vScreen->backOffset; - vmesa->DestBlit = vmesa->DestBase; - vmesa->ScissorLR = ( (0 << 16) | (dPriv->w-1) ); - vmesa->ScissorTB = ( (0 << 16) | (dPriv->h-1) ); -/* - vmesa->ScissorLR = ( (x0 << 16) | x1 ); - vmesa->ScissorTB = ( (y0 << 16) | y1 ); -*/ - vmesa->SrcStride = ( ((dPriv->w+31)&~31) * vmesa->s3vScreen->cpp ); - vmesa->DestStride = vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp; - vmesa->ScissorWH = ( (dPriv->w << 16) | dPriv->h ); - vmesa->SrcXY = 0; -/* vmesa->DestXY = ( (dPriv->x << 16) | dPriv->y ); */ - vmesa->DestXY = ( (0 << 16) | 0 ); - } else { - DEBUG(("S3V_FRONT_BUFFER\n")); - - x0 = dPriv->x; - y0 = dPriv->y; - x1 = x0 + dPriv->w - 1; - y1 = y0 + dPriv->h - 1; - - vmesa->SrcBase = 0; - vmesa->DestBase = 0; - vmesa->ScissorLR = ( (x0 << 16) | x1 ); - vmesa->ScissorTB = ( (y0 << 16) | y1 ); - vmesa->DestStride = vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp; - vmesa->SrcStride = vmesa->DestStride; - vmesa->DestBase = (y0 * vmesa->DestStride) - + x0*vmesa->s3vScreen->cpp; - vmesa->DestBlit = 0; - vmesa->ScissorWH = ( (x1 << 16) | y1 ); - vmesa->SrcXY = 0; - vmesa->DestXY = ( (0 << 16) | 0 ); -/* vmesa->DestXY = ( (dPriv->x << 16) | dPriv->y ); */ - } - - DEBUG(("x0=%i y0=%i x1=%i y1=%i\n", x0, y0, x1, y1)); - DEBUG(("stride=%i rectWH=0x%x\n\n", vmesa->DestStride, vmesa->ScissorWH)); - - /* FIXME: how could we use the following info? */ - /* if (ctx->Scissor.Enabled) {} */ - - vmesa->dirty |= S3V_UPLOAD_CLIP; -/* } */ -} - -static void s3vDDScissor( GLcontext *ctx, - GLint x, GLint y, GLsizei w, GLsizei h ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG((">>> s3vDDScissor <<<")); - /* FLUSH_BATCH( vmesa ); */ - vmesa->new_state |= S3V_NEW_CLIP; -} - -/* ============================================================= - * Culling - */ - -static void s3vUpdateCull( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLfloat backface_sign = 1; - - DEBUG(("s3vUpdateCull\n")); - /* FIXME: GL_FRONT_AND_BACK */ - - switch ( ctx->Polygon.CullFaceMode ) { - case GL_BACK: - if (ctx->Polygon.FrontFace == GL_CCW) - backface_sign = -1; - break; - - case GL_FRONT: - if (ctx->Polygon.FrontFace != GL_CCW) - backface_sign = -1; - break; - - default: - break; - } - - vmesa->backface_sign = backface_sign; - vmesa->dirty |= S3V_UPLOAD_GEOMETRY; -} - - -static void s3vDDCullFace( GLcontext *ctx, GLenum mode ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - /* FLUSH_BATCH( vmesa ); */ - vmesa->new_state |= S3V_NEW_CULL; -} - -static void s3vDDFrontFace( GLcontext *ctx, GLenum mode ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - /* FLUSH_BATCH( vmesa ); */ - vmesa->new_state |= S3V_NEW_CULL; -} - -/* ============================================================= - * Masks - */ - -static void s3vUpdateMasks( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - GLuint mask = s3vPackColor( vmesa->s3vScreen->cpp, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP] ); - - if (vmesa->s3vScreen->cpp == 2) mask |= mask << 16; - - /* FIXME: can we do something in virge? */ -} -/* -static void s3vDDColorMask( GLcontext *ctx, GLboolean r, GLboolean g, - GLboolean b, GLboolean a) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - FLUSH_BATCH( vmesa ); - vmesa->new_state |= S3V_NEW_MASKS; -} -*/ -/* ============================================================= - * Rendering attributes - */ - -/* ============================================================= - * Miscellaneous - */ - -static void s3vDDClearColor( GLcontext *ctx, const GLfloat color[4]) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("*** s3vDDClearColor\n")); - - vmesa->ClearColor = s3vPackColor( 2, /* vmesa->s3vScreen->cpp, */ - color[0], color[1], color[2], color[3] ); - -#if 0 - if (vmesa->s3vScreen->cpp == 2) vmesa->ClearColor |= vmesa->ClearColor<<16; -#endif -} - -static void s3vDDSetDrawBuffer( GLcontext *ctx, GLenum mode ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - int found = GL_TRUE; - - DEBUG(("*** s3vDDSetDrawBuffer ***\n")); - - /* FLUSH_BATCH( vmesa ); */ - - switch ( mode ) { - case GL_FRONT_LEFT: - vmesa->drawOffset = vmesa->s3vScreen->frontOffset; - break; - case GL_BACK_LEFT: - vmesa->drawOffset = vmesa->s3vScreen->backOffset; - /* vmesa->driScreen->fbHeight * - * vmesa->driScreen->fbWidth * - * vmesa->s3vScreen->cpp; */ - break; - default: - found = GL_FALSE; - break; - } - - DEBUG(("vmesa->drawOffset = 0x%x\n", vmesa->drawOffset)); -/* return GL_TRUE; */ -} - -/* ============================================================= - * Window position and viewport transformation - */ - -void s3vUpdateWindow( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = - vmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h; - const GLfloat *v = ctx->Viewport._WindowMap.m; - - GLfloat sx = v[MAT_SX]; - GLfloat tx = v[MAT_TX] + xoffset; - GLfloat sy = v[MAT_SY]; - GLfloat ty = v[MAT_TY] + yoffset; - GLfloat sz = v[MAT_SZ] * vmesa->depth_scale; - GLfloat tz = v[MAT_TZ] * vmesa->depth_scale; - - vmesa->dirty |= S3V_UPLOAD_VIEWPORT; - - vmesa->ViewportScaleX = sx; - vmesa->ViewportScaleY = sy; - vmesa->ViewportScaleZ = sz; - vmesa->ViewportOffsetX = tx; - vmesa->ViewportOffsetY = ty; - vmesa->ViewportOffsetZ = tz; -} - - -/* -static void s3vDDViewport( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - s3vUpdateWindow( ctx ); -} - -static void s3vDDDepthRange( GLcontext *ctx, GLclampd nearval, - GLclampd farval ) -{ - s3vUpdateWindow( ctx ); -} -*/ -void s3vUpdateViewportOffset( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = - vmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h; - const GLfloat *v = ctx->Viewport._WindowMap.m; - - GLfloat tx = v[MAT_TX] + xoffset; - GLfloat ty = v[MAT_TY] + yoffset; - - DEBUG(("*** s3vUpdateViewportOffset ***\n")); - - if ( vmesa->ViewportOffsetX != tx || - vmesa->ViewportOffsetY != ty ) - { - vmesa->ViewportOffsetX = tx; - vmesa->ViewportOffsetY = ty; - - vmesa->new_state |= S3V_NEW_WINDOW; - } - -/* vmesa->new_state |= S3V_NEW_CLIP; */ -} - -/* ============================================================= - * State enable/disable - */ - -static void s3vDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - switch ( cap ) { - case GL_ALPHA_TEST: - case GL_BLEND: - vmesa->new_state |= S3V_NEW_ALPHA; - DEBUG(("s3vDDEnable: GL_BLEND\n")); - break; - - case GL_CULL_FACE: - vmesa->new_state |= S3V_NEW_CULL; - DEBUG(("s3vDDEnable: GL_CULL_FACE\n")); - break; - - case GL_DEPTH_TEST: - vmesa->new_state |= S3V_NEW_DEPTH; - DEBUG(("s3vDDEnable: GL_DEPTH\n")); - break; -#if 0 - case GL_FOG: - vmesa->new_state |= S3V_NEW_FOG; - break; -#endif - - case GL_SCISSOR_TEST: - vmesa->new_state |= S3V_NEW_CLIP; - break; - - case GL_TEXTURE_2D: - DEBUG(("*** GL_TEXTURE_2D: %i\n", state)); - vmesa->_3d_mode = state; - vmesa->restore_primitive = -1; - break; - - default: - return; - } -} - -/* ============================================================= - * State initialization, management - */ - - -/* - * Load the current context's state into the hardware. - * - * NOTE: Be VERY careful about ensuring the context state is marked for - * upload, the only place it shouldn't be uploaded is when the setup - * state has changed in ReducedPrimitiveChange as this comes right after - * a state update. - * - * Blits of any type should always upload the context and masks after - * they are done. - */ -void s3vEmitHwState( s3vContextPtr vmesa ) -{ - if (!vmesa->driDrawable) return; - if (!vmesa->dirty) return; - - DEBUG(("**********************\n")); - DEBUG(("*** s3vEmitHwState ***\n")); - DEBUG(("**********************\n")); - - if (vmesa->dirty & S3V_UPLOAD_VIEWPORT) { - vmesa->dirty &= ~S3V_UPLOAD_VIEWPORT; - DEBUG(("S3V_UPLOAD_VIEWPORT\n")); - } - - if ( (vmesa->dirty & S3V_UPLOAD_POINTMODE) || - (vmesa->dirty & S3V_UPLOAD_LINEMODE) || - (vmesa->dirty & S3V_UPLOAD_TRIMODE) ) { - - } - - if (vmesa->dirty & S3V_UPLOAD_POINTMODE) { - vmesa->dirty &= ~S3V_UPLOAD_POINTMODE; - } - - if (vmesa->dirty & S3V_UPLOAD_LINEMODE) { - vmesa->dirty &= ~S3V_UPLOAD_LINEMODE; - } - - if (vmesa->dirty & S3V_UPLOAD_TRIMODE) { - vmesa->dirty &= ~S3V_UPLOAD_TRIMODE; - } - - if (vmesa->dirty & S3V_UPLOAD_FOG) { - GLchan c[3], col; - UNCLAMPED_FLOAT_TO_RGB_CHAN( c, vmesa->glCtx->Fog.Color ); - DEBUG(("uploading ** FOG **\n")); - col = s3vPackColor(2, c[0], c[1], c[2], 0); - vmesa->dirty &= ~S3V_UPLOAD_FOG; - } - - if (vmesa->dirty & S3V_UPLOAD_DITHER) { - vmesa->dirty &= ~S3V_UPLOAD_DITHER; - } - - if (vmesa->dirty & S3V_UPLOAD_LOGICOP) { - vmesa->dirty &= ~S3V_UPLOAD_LOGICOP; - } - - if (vmesa->dirty & S3V_UPLOAD_CLIP) { - vmesa->dirty &= ~S3V_UPLOAD_CLIP; - DEBUG(("S3V_UPLOAD_CLIP\n")); - DEBUG(("vmesa->ScissorLR: %i\n", vmesa->ScissorLR)); - DEBUG(("vmesa->ScissorTB: %i\n", vmesa->ScissorTB)); - } - - if (vmesa->dirty & S3V_UPLOAD_MASKS) { - vmesa->dirty &= ~S3V_UPLOAD_MASKS; - DEBUG(("S3V_UPLOAD_BLEND\n")); - } - - if (vmesa->dirty & S3V_UPLOAD_ALPHA) { - vmesa->dirty &= ~S3V_UPLOAD_ALPHA; - DEBUG(("S3V_UPLOAD_ALPHA\n")); - } - - if (vmesa->dirty & S3V_UPLOAD_SHADE) { - vmesa->dirty &= ~S3V_UPLOAD_SHADE; - } - - if (vmesa->dirty & S3V_UPLOAD_POLYGON) { - vmesa->dirty &= ~S3V_UPLOAD_POLYGON; - } - - if (vmesa->dirty & S3V_UPLOAD_DEPTH) { - vmesa->dirty &= ~S3V_UPLOAD_DEPTH; - DEBUG(("S3V_UPLOAD_DEPTH: DepthMode = 0x%x08\n", vmesa->DepthMode)); - } - - if (vmesa->dirty & S3V_UPLOAD_GEOMETRY) { - vmesa->dirty &= ~S3V_UPLOAD_GEOMETRY; - } - - if (vmesa->dirty & S3V_UPLOAD_TRANSFORM) { - vmesa->dirty &= ~S3V_UPLOAD_TRANSFORM; - } - - if (vmesa->dirty & S3V_UPLOAD_TEX0) { - s3vTextureObjectPtr curTex = vmesa->CurrentTexObj[0]; - vmesa->dirty &= ~S3V_UPLOAD_TEX0; - DEBUG(("S3V_UPLOAD_TEX0\n")); - if (curTex) { - DEBUG(("S3V_UPLOAD_TEX0: curTex\n")); - } else { - DEBUG(("S3V_UPLOAD_TEX0: !curTex\n")); - } - } -} - -void s3vDDUpdateHWState( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - int new_state = vmesa->new_state; - - /* s3vUpdateClipping( ctx ); */ - - if ( new_state ) - { - - vmesa->new_state = 0; - - /* Update the various parts of the context's state. - */ - if ( new_state & S3V_NEW_ALPHA ) - s3vUpdateAlphaMode( ctx ); - - if ( new_state & S3V_NEW_DEPTH ) - s3vUpdateZMode( ctx ); - - if ( new_state & S3V_NEW_FOG ) - s3vUpdateFogAttrib( ctx ); - - if ( new_state & S3V_NEW_CLIP ) - { - DEBUG(("---> going to s3vUpdateClipping\n")); - s3vUpdateClipping( ctx ); - } - - if ( new_state & S3V_NEW_POLYGON ) - s3vUpdatePolygon( ctx ); - - if ( new_state & S3V_NEW_CULL ) - s3vUpdateCull( ctx ); - - if ( new_state & S3V_NEW_MASKS ) - s3vUpdateMasks( ctx ); - - if ( new_state & S3V_NEW_WINDOW ) - s3vUpdateWindow( ctx ); -/* - if ( new_state & S3_NEW_TEXTURE ) - s3vUpdateTextureState( ctx ); -*/ - CMDCHANGE(); - } - - /* HACK ! */ - s3vEmitHwState( vmesa ); -} - - -static void s3vDDUpdateState( GLcontext *ctx, GLuint new_state ) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - S3V_CONTEXT(ctx)->new_gl_state |= new_state; -} - - -/* Initialize the context's hardware state. - */ -void s3vInitState( s3vContextPtr vmesa ) -{ - vmesa->new_state = 0; -} - -/* Initialize the driver's state functions. - */ -void s3vInitStateFuncs( GLcontext *ctx ) -{ - ctx->Driver.UpdateState = s3vDDUpdateState; - - ctx->Driver.Clear = s3vDDClear; - ctx->Driver.ClearIndex = NULL; - ctx->Driver.ClearColor = s3vDDClearColor; - ctx->Driver.DrawBuffer = s3vDDSetDrawBuffer; - ctx->Driver.ReadBuffer = NULL; /* XXX */ - - ctx->Driver.IndexMask = NULL; - ctx->Driver.ColorMask = NULL; /* s3vDDColorMask; */ /* FIXME */ - - ctx->Driver.AlphaFunc = s3vDDAlphaFunc; /* FIXME */ -#if 0 - ctx->Driver.BlendEquation = NULL; /* s3vDDBlendEquation; */ - ctx->Driver.BlendFunc = s3vDDBlendFunc; /* FIXME */ -#endif - ctx->Driver.BlendFuncSeparate = NULL; /* s3vDDBlendFuncSeparate; */ - ctx->Driver.ClearDepth = s3vDDClearDepth; - ctx->Driver.CullFace = s3vDDCullFace; - ctx->Driver.FrontFace = s3vDDFrontFace; - ctx->Driver.DepthFunc = s3vDDDepthFunc; /* FIXME */ - ctx->Driver.DepthMask = s3vDDDepthMask; /* FIXME */ - ctx->Driver.DepthRange = NULL; /* s3vDDDepthRange; */ - ctx->Driver.Enable = s3vDDEnable; /* FIXME */ - ctx->Driver.Finish = s3vDDFinish; - ctx->Driver.Flush = s3vDDFlush; -#if 1 - ctx->Driver.Fogfv = NULL; /* s3vDDFogfv; */ -#endif - ctx->Driver.Hint = NULL; - ctx->Driver.LineWidth = NULL; /* s3vDDLineWidth; */ - ctx->Driver.LineStipple = NULL; /* s3vDDLineStipple; */ -#if ENABLELIGHTING - ctx->Driver.Lightfv = NULL; /* s3vDDLightfv; */ - - ctx->Driver.LightModelfv = NULL; /* s3vDDLightModelfv; */ -#endif - ctx->Driver.LogicOpcode = NULL; /* s3vDDLogicalOpcode; */ - ctx->Driver.PointSize = NULL; /* s3vDDPointSize; */ - ctx->Driver.PolygonMode = NULL; /* s3vDDPolygonMode; */ - ctx->Driver.PolygonStipple = NULL; /* s3vDDPolygonStipple; */ - ctx->Driver.Scissor = s3vDDScissor; /* ScissorLR / ScissorTB */ - ctx->Driver.ShadeModel = NULL; /* s3vDDShadeModel; */ - ctx->Driver.Viewport = NULL; /* s3vDDViewport; */ -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c deleted file mode 100644 index 9b92519862..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ /dev/null @@ -1,559 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include <stdlib.h> -#include <stdio.h> - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "main/mm.h" -#include "main/texstore.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "swrast/swrast.h" - -#include "s3v_context.h" -#include "s3v_tex.h" - - -extern void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); -extern void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); - -/* -static GLuint s3vComputeLodBias(GLfloat bias) -{ -#if TEX_DEBUG_ON - DEBUG_TEX(("*** s3vComputeLodBias ***\n")); -#endif - return bias; -} -*/ - -static void s3vSetTexWrapping(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - GLenum wraps, GLenum wrapt) -{ - GLuint t0 = t->TextureCMD; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexWrapping: #%i ***\n", ++times)); -#endif - - - t0 &= ~TEX_WRAP_MASK; - cmd &= ~TEX_WRAP_MASK; - - if ((wraps != GL_CLAMP) || (wrapt != GL_CLAMP)) { - DEBUG(("TEX_WRAP_ON\n")); - t0 |= TEX_WRAP_ON; - cmd |= TEX_WRAP_ON; - } - - cmd |= TEX_WRAP_ON; /* FIXME: broken if off */ - t->TextureCMD = t0; - vmesa->CMD = cmd; -} - - -static void s3vSetTexFilter(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - GLenum minf, GLenum magf) -{ - GLuint t0 = t->TextureCMD; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexFilter: #%i ***\n", ++times)); -#endif - - t0 &= ~TEX_FILTER_MASK; - cmd &= ~TEX_FILTER_MASK; - - switch (minf) { - case GL_NEAREST: - DEBUG(("GL_NEAREST\n")); - t0 |= NEAREST; - cmd |= NEAREST; - break; - case GL_LINEAR: - DEBUG(("GL_LINEAR\n")); - t0 |= LINEAR; - cmd |= LINEAR; - break; - case GL_NEAREST_MIPMAP_NEAREST: - DEBUG(("GL_MIPMAP_NEAREST\n")); - t0 |= MIP_NEAREST; - cmd |= MIP_NEAREST; - break; - case GL_LINEAR_MIPMAP_NEAREST: - DEBUG(("GL_LINEAR_MIPMAP_NEAREST\n")); - t0 |= LINEAR_MIP_NEAREST; - cmd |= LINEAR_MIP_NEAREST; - break; - case GL_NEAREST_MIPMAP_LINEAR: - DEBUG(("GL_NEAREST_MIPMAP_LINEAR\n")); - t0 |= MIP_LINEAR; - cmd |= MIP_LINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - DEBUG(("GL_LINEAR_MIPMAP_LINEAR\n")); - t0 |= LINEAR_MIP_LINEAR; - cmd |= LINEAR_MIP_LINEAR; - break; - default: - break; - } - /* FIXME: bilinear? */ - -#if 0 - switch (magf) { - case GL_NEAREST: - break; - case GL_LINEAR: - break; - default: - break; - } -#endif - - t->TextureCMD = t0; - - DEBUG(("CMD was = 0x%x\n", vmesa->CMD)); - DEBUG(("CMD is = 0x%x\n", cmd)); - - vmesa->CMD = cmd; - /* CMDCHANGE(); */ -} - - -static void s3vSetTexBorderColor(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - const GLfloat color[4]) -{ - GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexBorderColor: #%i ***\n", ++times)); -#endif - - /*FIXME: it should depend on tex col format */ - /* switch(t0 ... t->TextureColorMode) */ - - /* case TEX_COL_ARGB1555: */ - t->TextureBorderColor = S3VIRGEPACKCOLOR555(c[0], c[1], c[2], c[3]); - - DEBUG(("TextureBorderColor = 0x%x\n", t->TextureBorderColor)); - - vmesa->TextureBorderColor = t->TextureBorderColor; -} - -static void s3vTexParameter( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj, - GLenum pname, const GLfloat *params ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexParameter: #%i ***\n", ++times)); -#endif - - if (!t) return; - - /* Can't do the update now as we don't know whether to flush - * vertices or not. Setting vmesa->new_state means that - * s3vUpdateTextureState() will be called before any triangles are - * rendered. If a statechange has occurred, it will be detected at - * that point, and buffered vertices flushed. - */ - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter ); - break; - - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT ); - break; - - case GL_TEXTURE_BORDER_COLOR: - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); - break; - - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative for Virge. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - s3vSwapOutTexObj( vmesa, t ); - break; - - default: - return; - } - - if (t == vmesa->CurrentTexObj[0]) - vmesa->dirty |= S3V_UPLOAD_TEX0; - -#if 0 - if (t == vmesa->CurrentTexObj[1]) { - vmesa->dirty |= S3V_UPLOAD_TEX1; - } -#endif -} - - -static void s3vTexEnv( GLcontext *ctx, GLenum target, - GLenum pname, const GLfloat *param ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - GLuint unit = ctx->Texture.CurrentUnit; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexEnv: #%i ***\n", ++times)); -#endif - - /* Only one env color. Need a fallback if env colors are different - * and texture setup references env color in both units. - */ - switch (pname) { - case GL_TEXTURE_ENV_COLOR: { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLfloat *fc = texUnit->EnvColor; - GLuint r, g, b, a, col; - CLAMPED_FLOAT_TO_UBYTE(r, fc[0]); - CLAMPED_FLOAT_TO_UBYTE(g, fc[1]); - CLAMPED_FLOAT_TO_UBYTE(b, fc[2]); - CLAMPED_FLOAT_TO_UBYTE(a, fc[3]); - - col = ((a << 24) | - (r << 16) | - (g << 8) | - (b << 0)); - - break; - } - case GL_TEXTURE_ENV_MODE: - vmesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */ - break; - case GL_TEXTURE_LOD_BIAS_EXT: { -/* - struct gl_texture_object *tObj = - ctx->Texture.Unit[unit]._Current; - - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; -*/ - break; - } - default: - break; - } -} - -static void s3vTexImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexImage1D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_teximage1d( ctx, target, level, internalFormat, - width, border, format, type, - pixels, pack, texObj, texImage ); -} - -static void s3vTexSubImage1D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexSubImage1D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, - format, type, pixels, pack, texObj, - texImage); -} - -static void s3vTexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexImage2D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_teximage2d( ctx, target, level, internalFormat, - width, height, border, format, type, - pixels, packing, texObj, texImage ); -} - -static void s3vTexSubImage2D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexSubImage2D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, - height, format, type, pixels, packing, texObj, - texImage); -} - - -static void s3vBindTexture( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vBindTexture: #%i ***\n", ++times)); -#endif - - if (!t) { -/* - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; -*/ - t = CALLOC_STRUCT(s3v_texture_object_t); - - /* Initialize non-image-dependent parts of the state: - */ - t->globj = tObj; -#if 0 - if (target == GL_TEXTURE_2D) { - } else - if (target == GL_TEXTURE_1D) { - } - -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - t->TextureFormat = (TF_LittleEndian | -#else - t->TextureFormat = (TF_BigEndian | -#endif -#endif - t->dirty_images = ~0; - - tObj->DriverData = t; - make_empty_list( t ); -#if 0 - s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT ); - s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter ); - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); -#endif - } - - cmd = vmesa->CMD & ~MIP_MASK; - vmesa->dirty |= S3V_UPLOAD_TEX0; - vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel]; - vmesa->TexStride = t->Pitch; - cmd |= MIPMAP_LEVEL(t->WidthLog2); - vmesa->CMD = cmd; - vmesa->restore_primitive = -1; -#if 0 - printf("t->TextureBaseAddr[0] = 0x%x\n", t->TextureBaseAddr[0]); - printf("t->TextureBaseAddr[1] = 0x%x\n", t->TextureBaseAddr[1]); - printf("t->TextureBaseAddr[2] = 0x%x\n", t->TextureBaseAddr[2]); -#endif -} - - -static void s3vDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) -{ - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vDeleteTexture: #%i ***\n", ++times)); -#endif - - if (t) { - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - -#if _TEXFLUSH - if (vmesa) { - DMAFLUSH(); - } -#endif - - s3vDestroyTexObj( vmesa, t ); - tObj->DriverData = 0; - - } -} - -static GLboolean s3vIsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) -{ - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vIsTextureResident: #%i ***\n", ++times)); -#endif - - return (t && t->MemBlock); -} - -static void s3vInitTextureObjects( GLcontext *ctx ) -{ - /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - struct gl_texture_object *texObj; - GLuint tmp = ctx->Texture.CurrentUnit; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vInitTextureObjects: #%i ***\n", ++times)); -#endif - -#if 1 - ctx->Texture.CurrentUnit = 0; - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_1D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - -#if 0 - ctx->Texture.CurrentUnit = 1; - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_1D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_2D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - - ctx->Texture.CurrentUnit = tmp; -} - - -void s3vInitTextureFuncs( GLcontext *ctx ) -{ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vInitTextureFuncs: #%i ***\n", ++times)); -#endif - - ctx->Driver.TexEnv = s3vTexEnv; - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = s3vTexImage2D; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = s3vTexSubImage2D; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.BindTexture = s3vBindTexture; - ctx->Driver.DeleteTexture = s3vDeleteTexture; - ctx->Driver.TexParameter = s3vTexParameter; - ctx->Driver.UpdateTexturePalette = 0; - ctx->Driver.IsTextureResident = s3vIsTextureResident; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - s3vInitTextureObjects( ctx ); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.h b/src/mesa/drivers/dri/s3v/s3v_tex.h deleted file mode 100644 index a823fe2453..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tex.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef _S3V_TEX_H -#define _S3V_TEX_H - -#define TEX_DEBUG_ON 0 - -extern void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ); - -#if TEX_DEBUG_ON -#define DEBUG_TEX(str) printf str -#else -#define DEBUG_TEX(str) /* str */ -#endif - -#define _TEXFLUSH 1 /* flush before uploading */ -#define _TEXLOCK 1 /* lock before writing new texures to card mem */ - /* if you turn it on you will gain stability and image - quality, but you will loose performance (~10%) */ -#define _TEXFALLBACK 0 /* fallback to software for -big- textures (slow) */ - /* turning this off, you will lose some tex (e.g. mountains - on tuxracer) but you will increase average playability */ - -#define _TEXALIGN 0x00000007 - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_texmem.c b/src/mesa/drivers/dri/s3v/s3v_texmem.c deleted file mode 100644 index 705d105f55..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_texmem.c +++ /dev/null @@ -1,582 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include <stdlib.h> -#include <stdio.h> - -#include "main/glheader.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" - -#include "main/mm.h" -#include "s3v_context.h" -#include "s3v_lock.h" -#include "s3v_tex.h" - -void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); -void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ); - - -void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t) -{ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vDestroyTexObj: #%i ***\n", ++times)); -#endif - - if (!t) return; - -/* FIXME: useful? */ -#if _TEXFLUSH - if (vmesa) - DMAFLUSH(); -#endif - - /* This is sad - need to sync *in case* we upload a texture - * to this newly free memory... - */ - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (vmesa && t->age > vmesa->dirtyAge) - vmesa->dirtyAge = t->age; - } - - if (t->globj) - t->globj->DriverData = NULL; - - if (vmesa) { - if (vmesa->CurrentTexObj[0] == t) { - vmesa->CurrentTexObj[0] = 0; - vmesa->dirty &= ~S3V_UPLOAD_TEX0; - } - -#if 0 - if (vmesa->CurrentTexObj[1] == t) { - vmesa->CurrentTexObj[1] = 0; - vmesa->dirty &= ~S3V_UPLOAD_TEX1; - } -#endif - } - - remove_from_list(t); - FREE(t); -} - - -void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t) -{ -/* int i; */ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSwapOutTexObj: #%i ***\n", ++times)); -#endif - - if (t->MemBlock) { - - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (t->age > vmesa->dirtyAge) - vmesa->dirtyAge = t->age; - - t->dirty_images = ~0; - move_to_tail(&(vmesa->SwappedOut), t); - } -} - - -/* Upload an image from mesa's internal copy. - */ - -static void s3vUploadTexLevel( s3vContextPtr vmesa, s3vTextureObjectPtr t, - int level ) -{ - __DRIscreenPrivate *sPriv = vmesa->driScreen; - const struct gl_texture_image *image = t->image[level].image; - int i,j; - int l2d; - /* int offset = 0; */ - int words; - GLuint* dest; -#if TEX_DEBUG_ON - static unsigned int times=0; -#endif - if ( !image ) return; - if (image->Data == 0) return; - - DEBUG_TEX(("*** s3vUploadTexLevel: #%i ***\n", ++times)); - DEBUG_TEX(("level = %i\n", level)); - - l2d = 5; /* 32bits per texel == 1<<5 */ -/* - if (level == 0) - ; -*/ - DEBUG_TEX(("t->image[%i].offset = 0x%x\n", - level, t->image[level].offset)); - - t->TextureBaseAddr[level] = (GLuint)(t->BufAddr + t->image[level].offset - + _TEXALIGN) & (GLuint)(~_TEXALIGN); - dest = (GLuint*)(sPriv->pFB + t->TextureBaseAddr[level]); - - DEBUG_TEX(("sPriv->pFB = 0x%x\n", sPriv->pFB)); - DEBUG_TEX(("dest = 0x%x\n", dest)); - DEBUG_TEX(("dest - sPriv->pFB = 0x%x\n", ((int)dest - (int)sPriv->pFB))); - - /* NOTE: we implicitly suppose t->texelBytes == 2 */ - - words = (image->Width * image->Height) >> 1; - - DEBUG_TEX(("\n\n")); - - switch (t->image[level].internalFormat) { - case GL_RGB: - case 3: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_RGB:\n")); -/* - if (level == 0) - ; -*/ - /* The UGLY way, and SLOW : use DMA FIXME ! */ - - for (i = 0; i < words; i++) { - unsigned int data; - /* data = PACK_COLOR_565(src[0],src[1],src[2]); */ - data = S3VIRGEPACKCOLOR555(src[0],src[1],src[2],255) - |(S3VIRGEPACKCOLOR555(src[3],src[4],src[5],255)<<16); - - *dest++ = data; - /* src += 3; */ - src +=6; - } - } - break; - - case GL_RGBA: - case 4: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_RGBA:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(src[0],src[1],src[2],src[3]); */ - data = S3VIRGEPACKCOLOR4444(src[0], src[1],src[2], src[3]) - | (S3VIRGEPACKCOLOR4444(src[4], src[5], src[6], src[7]) << 16); - - *dest++ = data; - /* src += 4; */ - src += 8; - } - } - break; - - case GL_LUMINANCE: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_LUMINANCE:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_888(src[0],src[0],src[0]); */ - data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[0]) - | (S3VIRGEPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16); - - *dest++ = data; - /* src ++; */ - src +=2; - } - } - break; - - case GL_INTENSITY: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_INTENSITY:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(src[0],src[0],src[0],src[0]); */ - data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[0]) - | (S3VIRGEPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16); - - *dest++ = data; - /* src ++; */ - src += 2; - } - } - break; - - case GL_LUMINANCE_ALPHA: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_LUMINANCE_ALPHA:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(src[0],src[0],src[0],src[1]); */ - data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[1]) - | (S3VIRGEPACKCOLOR4444(src[2],src[2],src[2],src[3]) << 16); - - *dest++ = data; - /* src += 2; */ - src += 4; - } - } - break; - - case GL_ALPHA: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_ALPHA:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(255,255,255,src[0]); */ - data = S3VIRGEPACKCOLOR4444(255,255,255,src[0]) - | (S3VIRGEPACKCOLOR4444(255,255,255,src[1]) << 16); - - *dest++ = data; - /* src += 1; */ - src += 2; - } - } - break; - - /* TODO: Translate color indices *now*: - */ - case GL_COLOR_INDEX: - { - - GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_COLOR_INDEX:\n")); - - for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src += 1; - } - } - } - break; - - default: - fprintf(stderr, "Not supported texture format %s\n", - _mesa_lookup_enum_by_nr(image->_BaseFormat)); - } - - DEBUG_TEX(("words = %i\n\n", words)); -} - -void s3vPrintLocalLRU( s3vContextPtr vmesa ) -{ - s3vTextureObjectPtr t; - int sz = 1 << (vmesa->s3vScreen->logTextureGranularity); - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vPrintLocalLRU: #%i ***\n", ++times)); -#endif - - foreach( t, &vmesa->TexObjList ) { - if (!t->globj) - fprintf(stderr, "Placeholder %d at %x sz %x\n", - t->MemBlock->ofs / sz, - t->MemBlock->ofs, - t->MemBlock->size); - else - fprintf(stderr, "Texture at %x sz %x\n", - t->MemBlock->ofs, - t->MemBlock->size); - - } -} - -void s3vPrintGlobalLRU( s3vContextPtr vmesa ) -{ - int i, j; - S3VTexRegionPtr list = vmesa->sarea->texList; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vPrintGlobalLRU: #%i ***\n", ++times)); -#endif - - for (i = 0, j = S3V_NR_TEX_REGIONS ; i < S3V_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev); - j = list[j].next; - if (j == S3V_NR_TEX_REGIONS) break; - } - - if (j != S3V_NR_TEX_REGIONS) - fprintf(stderr, "Loop detected in global LRU\n"); -} - - -void s3vResetGlobalLRU( s3vContextPtr vmesa ) -{ - S3VTexRegionPtr list = vmesa->sarea->texList; - int sz = 1 << vmesa->s3vScreen->logTextureGranularity; - int i; - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vResetGlobalLRU: #%i ***\n", ++times)); -#endif - - /* (Re)initialize the global circular LRU list. The last element - * in the array (S3V_NR_TEX_REGIONS) is the sentinal. Keeping it - * at the end of the array allows it to be addressed rationally - * when looking up objects at a particular location in texture - * memory. - */ - for (i = 0 ; (i+1) * sz <= vmesa->s3vScreen->textureSize ; i++) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = S3V_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = S3V_NR_TEX_REGIONS; - list[S3V_NR_TEX_REGIONS].prev = i; - list[S3V_NR_TEX_REGIONS].next = 0; - vmesa->sarea->texAge = 0; -} - - -void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ) -{ -/* - int i; - int logsz = vmesa->s3vScreen->logTextureGranularity; - int start = t->MemBlock->ofs >> logsz; - int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz; - S3VTexRegionPtr list = vmesa->sarea->texList; -*/ - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTexLRU: #%i ***\n", ++times)); -#endif - - vmesa->texAge = ++vmesa->sarea->texAge; - - /* Update our local LRU - */ - move_to_head( &(vmesa->TexObjList), t ); - - /* Update the global LRU - */ -#if 0 - for (i = start ; i <= end ; i++) { - - list[i].in_use = 1; - list[i].age = vmesa->texAge; - - /* remove_from_list(i) - */ - list[(unsigned)list[i].next].prev = list[i].prev; - list[(unsigned)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) - */ - list[i].prev = S3V_NR_TEX_REGIONS; - list[i].next = list[S3V_NR_TEX_REGIONS].next; - list[(unsigned)list[S3V_NR_TEX_REGIONS].next].prev = i; - list[S3V_NR_TEX_REGIONS].next = i; - } -#endif -} - - -/* Called for every shared texture region which has increased in age - * since we last held the lock. - * - * Figures out which of our textures have been ejected by other clients, - * and pushes a placeholder texture onto the LRU list to represent - * the other client's textures. - */ -void s3vTexturesGone( s3vContextPtr vmesa, - GLuint offset, - GLuint size, - GLuint in_use ) -{ - s3vTextureObjectPtr t, tmp; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexturesGone: #%i ***\n", ++times)); -#endif - - foreach_s ( t, tmp, &vmesa->TexObjList ) { - - if (t->MemBlock->ofs >= offset + size || - t->MemBlock->ofs + t->MemBlock->size <= offset) - continue; - - /* It overlaps - kick it off. Need to hold onto the currently bound - * objects, however. - */ - s3vSwapOutTexObj( vmesa, t ); - } - - if (in_use) { - t = (s3vTextureObjectPtr) calloc(1,sizeof(*t)); - if (!t) return; - - t->MemBlock = mmAllocMem( vmesa->texHeap, size, 0, offset); - insert_at_head( &vmesa->TexObjList, t ); - } - - /* Reload any lost textures referenced by current vertex buffer. - */ -#if 0 - if (vmesa->vertex_buffer) { - int i, j; - - fprintf(stderr, "\n\nreload tex\n"); - - for (i = 0 ; i < vmesa->statenr ; i++) { - for (j = 0 ; j < 2 ; j++) { - s3vTextureObjectPtr t = vmesa->state_tex[j][i]; - if (t) { - if (t->MemBlock == 0) - s3vUploadTexImages( vmesa, t ); - } - } - } - - /* Hard to do this with the lock held: - */ - /* S3V_FIREVERTICES( vmesa ); */ - } -#endif -} - - -/* This is called with the lock held. May have to eject our own and/or - * other client's texture objects to make room for the upload. - */ -void s3vUploadTexImages( s3vContextPtr vmesa, s3vTextureObjectPtr t ) -{ - int i; - int ofs; - int numLevels; -#if TEX_DEBUG_ON - static unsigned int times=0; - static unsigned int try=0; - - DEBUG_TEX(("*** s3vUploadTexImages: #%i ***\n", ++times)); - DEBUG_TEX(("vmesa->texHeap = 0x%x; t->totalSize = %i\n", - (unsigned int)vmesa->texHeap, t->totalSize)); -#endif - - /* Do we need to eject LRU texture objects? - */ - if (!t->MemBlock) { - - while (1) - { - /* int try = 0; */ - DEBUG_TEX(("trying to alloc mem for tex (try %i)\n", ++try)); - - t->MemBlock = mmAllocMem( vmesa->texHeap, t->totalSize, 12, 0 ); - - if (t->MemBlock) - break; - - if (vmesa->TexObjList.prev == vmesa->CurrentTexObj[0]) { -/* || vmesa->TexObjList.prev == vmesa->CurrentTexObj[1]) { - fprintf(stderr, "Hit bound texture in upload\n"); - s3vPrintLocalLRU( vmesa ); */ - return; - } - - if (vmesa->TexObjList.prev == &(vmesa->TexObjList)) { -/* fprintf(stderr, "Failed to upload texture, sz %d\n", - t->totalSize); - mmDumpMemInfo( vmesa->texHeap ); */ - return; - } - - DEBUG_TEX(("swapping out: %p\n", vmesa->TexObjList.prev)); - s3vSwapOutTexObj( vmesa, vmesa->TexObjList.prev ); - } - - ofs = t->MemBlock->ofs; - - t->BufAddr = vmesa->s3vScreen->texOffset + ofs; - - DEBUG_TEX(("ofs = 0x%x\n", ofs)); - DEBUG_TEX(("t->BufAddr = 0x%x\n", t->BufAddr)); - -/* FIXME: check if we need it */ -#if 0 - if (t == vmesa->CurrentTexObj[0]) { - vmesa->dirty |= S3V_UPLOAD_TEX0; - vmesa->restore_primitive = -1; - } -#endif - -#if 0 - if (t == vmesa->CurrentTexObj[1]) - vmesa->dirty |= S3V_UPLOAD_TEX1; -#endif - - s3vUpdateTexLRU( vmesa, t ); - } - -#if 0 - if (vmesa->dirtyAge >= GET_DISPATCH_AGE(vmesa)) - s3vWaitAgeLocked( vmesa, vmesa->dirtyAge ); -#endif - -#if _TEXLOCK - S3V_SIMPLE_FLUSH_LOCK(vmesa); -#endif - numLevels = t->lastLevel - t->firstLevel + 1; - for (i = 0 ; i < numLevels ; i++) - if (t->dirty_images & (1<<i)) - s3vUploadTexLevel( vmesa, t, i ); - - t->dirty_images = 0; -#if _TEXLOCK - S3V_SIMPLE_UNLOCK(vmesa); -#endif -} diff --git a/src/mesa/drivers/dri/s3v/s3v_texstate.c b/src/mesa/drivers/dri/s3v/s3v_texstate.c deleted file mode 100644 index 455bae6301..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_texstate.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include <stdlib.h> -#include <stdio.h> - -#include "main/glheader.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" - -#include "main/mm.h" -#include "s3v_context.h" -#include "s3v_tex.h" - - -static void s3vSetTexImages( s3vContextPtr vmesa, - struct gl_texture_object *tObj ) -{ - GLuint height, width, pitch, i, /*textureFormat,*/ log_pitch; - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel]; - GLint firstLevel, lastLevel, numLevels; - GLint log2Width, log2Height; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexImages: #%i ***\n", ++times)); -#endif - - t->texelBytes = 2; /* FIXME: always 2 ? */ - - /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. - */ - if (tObj->MinFilter == GL_LINEAR || tObj->MinFilter == GL_NEAREST) { - firstLevel = lastLevel = tObj->BaseLevel; - } - else { - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - } - - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; - - numLevels = lastLevel - firstLevel + 1; - - log2Width = tObj->Image[0][firstLevel]->WidthLog2; - log2Height = tObj->Image[0][firstLevel]->HeightLog2; - - - /* Figure out the amount of memory required to hold all the mipmap - * levels. Choose the smallest pitch to accomodate the largest - * mipmap: - */ - width = tObj->Image[0][firstLevel]->Width * t->texelBytes; - for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 ) - log_pitch++; - - /* All images must be loaded at this pitch. Count the number of - * lines required: - */ - for ( height = i = 0 ; i < numLevels ; i++ ) { - t->image[i].image = tObj->Image[0][firstLevel + i]; - t->image[i].offset = height * pitch; - t->image[i].internalFormat = baseImage->_BaseFormat; - height += t->image[i].image->Height; - t->TextureBaseAddr[i] = (t->BufAddr + t->image[i].offset + - _TEXALIGN) & (GLuint)(~_TEXALIGN); - } - - t->Pitch = pitch; - t->WidthLog2 = log2Width; - t->totalSize = height*pitch; - t->max_level = i-1; - vmesa->dirty |= S3V_UPLOAD_TEX0 /* | S3V_UPLOAD_TEX1*/; - vmesa->restore_primitive = -1; - DEBUG(("<><>pitch = TexStride = %i\n", pitch)); - DEBUG(("log2Width = %i\n", log2Width)); - - s3vUploadTexImages( vmesa, t ); -} - -static void s3vUpdateTexEnv( GLcontext *ctx, GLuint unit ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = texUnit->_Current; - const GLuint format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; -/* - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; - GLuint tc; -*/ - GLuint alpha = 0; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTexEnv: %i ***\n", ++times)); -#endif - - cmd &= ~TEX_COL_MASK; - cmd &= ~TEX_BLEND_MAKS; -/* cmd &= ~ALPHA_BLEND_MASK; */ - - DEBUG(("format = ")); - - switch (format) { - case GL_RGB: - DEBUG_TEX(("GL_RGB\n")); - cmd |= TEX_COL_ARGB1555; - break; - case GL_LUMINANCE: - DEBUG_TEX(("GL_LUMINANCE\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; /* FIXME: check */ - break; - case GL_ALPHA: - DEBUG_TEX(("GL_ALPHA\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_LUMINANCE_ALPHA: - DEBUG_TEX(("GL_LUMINANCE_ALPHA\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_INTENSITY: - DEBUG_TEX(("GL_INTENSITY\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_RGBA: - DEBUG_TEX(("GL_RGBA\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_COLOR_INDEX: - DEBUG_TEX(("GL_COLOR_INDEX\n")); - cmd |= TEX_COL_PAL; - break; - } - - DEBUG_TEX(("EnvMode = ")); - - switch (texUnit->EnvMode) { - case GL_REPLACE: - DEBUG_TEX(("GL_REPLACE\n")); - cmd |= TEX_REFLECT; /* FIXME */ - vmesa->_tri[1] = DO_TEX_UNLIT_TRI; /* FIXME: white tri hack */ - vmesa->_alpha_tex = ALPHA_TEX /* * alpha */; - break; - case GL_MODULATE: - DEBUG_TEX(("GL_MODULATE\n")); - cmd |= TEX_MODULATE; - vmesa->_tri[1] = DO_TEX_LIT_TRI; -#if 0 - if (alpha) - vmesa->_alpha_tex = ALPHA_TEX /* * alpha */; - else - vmesa->_alpha_tex = ALPHA_SRC /* * alpha */; -#else - vmesa->_alpha_tex = ALPHA_TEX ; -#endif - break; - case GL_ADD: - DEBUG_TEX(("DEBUG_TEX\n")); - /* do nothing ???*/ - break; - case GL_DECAL: - DEBUG_TEX(("GL_DECAL\n")); - cmd |= TEX_DECAL; - vmesa->_tri[1] = DO_TEX_LIT_TRI; - vmesa->_alpha_tex = ALPHA_OFF; - break; - case GL_BLEND: - DEBUG_TEX(("GL_BLEND\n")); - cmd |= TEX_DECAL; - vmesa->_tri[1] = DO_TEX_LIT_TRI; - vmesa->_alpha_tex = ALPHA_OFF; /* FIXME: sure? */ - break; - default: - fprintf(stderr, "unknown tex env mode"); - return; - } - - DEBUG_TEX(("\n\n vmesa->CMD was 0x%x\n", vmesa->CMD)); - DEBUG_TEX(( " vmesa->CMD is 0x%x\n\n", cmd )); - - vmesa->_alpha[1] = vmesa->_alpha_tex; - vmesa->CMD = cmd; /* | MIPMAP_LEVEL(8); */ - vmesa->restore_primitive = -1; -} - -static void s3vUpdateTexUnit( GLcontext *ctx, GLuint unit ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTexUnit: %i ***\n", ++times)); - DEBUG_TEX(("and vmesa->CMD was 0x%x\n", vmesa->CMD)); -#endif - - if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) - { - struct gl_texture_object *tObj = texUnit->_Current; - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; - - /* Upload teximages (not pipelined) - */ - if (t->dirty_images) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSetTexImages( vmesa, tObj ); - if (!t->MemBlock) { -#if _TEXFALLBACK - FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_TRUE ); -#endif - return; - } - } - - /* Update state if this is a different texture object to last - * time. - */ -#if 1 - if (vmesa->CurrentTexObj[unit] != t) { - vmesa->dirty |= S3V_UPLOAD_TEX0 /* << unit */; - vmesa->CurrentTexObj[unit] = t; - s3vUpdateTexLRU( vmesa, t ); /* done too often */ - } -#endif - - /* Update texture environment if texture object image format or - * texture environment state has changed. - */ - if (tObj->Image[0][tObj->BaseLevel]->_BaseFormat != - vmesa->TexEnvImageFmt[unit]) { - vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; - s3vUpdateTexEnv( ctx, unit ); - } -#if 1 - cmd = vmesa->CMD & ~MIP_MASK; - vmesa->dirty |= S3V_UPLOAD_TEX0 /* << unit */; - vmesa->CurrentTexObj[unit] = t; - vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel]; - vmesa->TexStride = t->Pitch; - cmd |= MIPMAP_LEVEL(t->WidthLog2); - - DEBUG_TEX(("\n\n>> vmesa->CMD was 0x%x\n", vmesa->CMD)); - DEBUG_TEX(( ">> vmesa->CMD is 0x%x\n\n", cmd )); - DEBUG_TEX(("t->WidthLog2 = %i\n", t->WidthLog2)); - DEBUG_TEX(("MIPMAP_LEVEL(t->WidthLog2) = 0x%x\n", MIPMAP_LEVEL(t->WidthLog2))); - - vmesa->CMD = cmd; - vmesa->restore_primitive = -1; -#endif - } - else if (texUnit->_ReallyEnabled) { /* _ReallyEnabled but != TEXTURE0_2D */ -#if _TEXFALLBACK - FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_TRUE ); -#endif - } - else /*if (vmesa->CurrentTexObj[unit])*/ { /* !_ReallyEnabled */ - vmesa->CurrentTexObj[unit] = 0; - vmesa->TexEnvImageFmt[unit] = 0; - vmesa->dirty &= ~(S3V_UPLOAD_TEX0<<unit); - } -} - - -void s3vUpdateTextureState( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - (void) vmesa; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTextureState: #%i ***\n", ++times)); -#endif - -#if _TEXFALLBACK - FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_FALSE ); -#endif - s3vUpdateTexUnit( ctx, 0 ); -#if 0 - s3vUpdateTexUnit( ctx, 1 ); -#endif -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tris.c b/src/mesa/drivers/dri/s3v/s3v_tris.c deleted file mode 100644 index fafd38480c..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tris.c +++ /dev/null @@ -1,850 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include <stdio.h> -#include <stdlib.h> - -#include <sys/ioctl.h> - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_tris.h" - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - - -/*********************************************************************** - * Build hardware rasterization functions * - ***********************************************************************/ - -#define DO_TRI 1 -#define HAVE_RGBA 1 -#define HAVE_SPEC 0 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX s3vVertex -#define TAB rast_tab - -#define VERT_SET_RGBA( v, c ) \ -do { \ - UNCLAMPED_FLOAT_TO_RGBA_CHAN( v->ub4[4], c); \ -/* *(v->ub4[4]) = c; \ */ \ -} while (0) -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4] -/* -#define VERT_COPY_RGBA1( v0, v1 ) v0->ui[4] = v1->ui[4] -*/ -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx] - -#define S3V_OFFSET_BIT 0x01 -#define S3V_TWOSIDE_BIT 0x02 -#define S3V_UNFILLED_BIT 0x04 -#define S3V_FALLBACK_BIT 0x08 -#define S3V_MAX_TRIFUNC 0x10 - - -static struct { - tnl_points_func points; - tnl_line_func line; - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[S3V_MAX_TRIFUNC]; - -#define S3V_RAST_CULL_BIT 0x01 -#define S3V_RAST_FLAT_BIT 0x02 -#define S3V_RAST_TEX_BIT 0x04 - -static s3v_point_func s3v_point_tab[0x8]; -static s3v_line_func s3v_line_tab[0x8]; -static s3v_tri_func s3v_tri_tab[0x8]; -static s3v_quad_func s3v_quad_tab[0x8]; - -#define IND (0) -#define TAG(x) x -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT) -#define TAG(x) x##_cull -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_FLAT_BIT) -#define TAG(x) x##_flat -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT|S3V_RAST_FLAT_BIT) -#define TAG(x) x##_cull_flat -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_TEX_BIT) -#define TAG(x) x##_tex -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT|S3V_RAST_TEX_BIT) -#define TAG(x) x##_cull_tex -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_FLAT_BIT|S3V_RAST_TEX_BIT) -#define TAG(x) x##_flat_tex -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT|S3V_RAST_FLAT_BIT|S3V_RAST_TEX_BIT) -#define TAG(x) x##_cull_flat_tex -#include "s3v_tritmp.h" - -static void init_rast_tab( void ) -{ - DEBUG(("*** init_rast_tab ***\n")); - - s3v_init(); - s3v_init_cull(); - s3v_init_flat(); - s3v_init_cull_flat(); - s3v_init_tex(); - s3v_init_cull_tex(); - s3v_init_flat_tex(); - s3v_init_cull_flat_tex(); -} - -/*********************************************************************** - * Rasterization fallback helpers * - ***********************************************************************/ - - -/* This code is hit only when a mix of accelerated and unaccelerated - * primitives are being drawn, and only for the unaccelerated - * primitives. - */ - -#if 0 -static void -s3v_fallback_quad( s3vContextPtr vmesa, - const s3vVertex *v0, - const s3vVertex *v1, - const s3vVertex *v2, - const s3vVertex *v3 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[4]; - s3v_translate_vertex( ctx, v0, &v[0] ); - s3v_translate_vertex( ctx, v1, &v[1] ); - s3v_translate_vertex( ctx, v2, &v[2] ); - s3v_translate_vertex( ctx, v3, &v[3] ); - DEBUG(("s3v_fallback_quad\n")); -/* _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] ); */ -} - -static void -s3v_fallback_tri( s3vContextPtr vmesa, - const s3vVertex *v0, - const s3vVertex *v1, - const s3vVertex *v2 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[3]; - s3v_translate_vertex( ctx, v0, &v[0] ); - s3v_translate_vertex( ctx, v1, &v[1] ); - s3v_translate_vertex( ctx, v2, &v[2] ); - DEBUG(("s3v_fallback_tri\n")); -/* _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); */ -} - -static void -s3v_fallback_line( s3vContextPtr vmesa, - const s3vVertex *v0, - const s3vVertex *v1 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[2]; - s3v_translate_vertex( ctx, v0, &v[0] ); - s3v_translate_vertex( ctx, v1, &v[1] ); - DEBUG(("s3v_fallback_line\n")); - _swrast_Line( ctx, &v[0], &v[1] ); -} - -/* -static void -s3v_fallback_point( s3vContextPtr vmesa, - const s3vVertex *v0 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[1]; - s3v_translate_vertex( ctx, v0, &v[0] ); - _swrast_Point( ctx, &v[0] ); -} -*/ -#endif - -/*********************************************************************** - * Choose rasterization functions * - ***********************************************************************/ - -#define _S3V_NEW_RASTER_STATE (_NEW_FOG | \ - _NEW_TEXTURE | \ - _DD_NEW_TRI_SMOOTH | \ - _DD_NEW_LINE_SMOOTH | \ - _DD_NEW_POINT_SMOOTH | \ - _DD_NEW_TRI_STIPPLE | \ - _DD_NEW_LINE_STIPPLE) - -#define LINE_FALLBACK (0) -#define TRI_FALLBACK (0) - -static void s3v_nodraw_triangle(GLcontext *ctx, s3vVertex *v0, - s3vVertex *v1, s3vVertex *v2) -{ - (void) (ctx && v0 && v1 && v2); -} - -static void s3v_nodraw_quad(GLcontext *ctx, - s3vVertex *v0, s3vVertex *v1, - s3vVertex *v2, s3vVertex *v3) -{ - (void) (ctx && v0 && v1 && v2 && v3); -} - -void s3vChooseRasterState(GLcontext *ctx); - -void s3vChooseRasterState(GLcontext *ctx) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint ind = 0; - - DEBUG(("*** s3vChooseRasterState ***\n")); - - if (ctx->Polygon.CullFlag) { - if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) { - vmesa->draw_tri = (s3v_tri_func)s3v_nodraw_triangle; - vmesa->draw_quad = (s3v_quad_func)s3v_nodraw_quad; - return; - } - ind |= S3V_RAST_CULL_BIT; - /* s3v_update_cullsign(ctx); */ - } /* else vmesa->backface_sign = 0; */ - - if ( flags & DD_FLATSHADE ) - ind |= S3V_RAST_FLAT_BIT; - - if ( ctx->Texture.Unit[0]._ReallyEnabled ) { - ind |= S3V_RAST_TEX_BIT; - } - - DEBUG(("ind = %i\n", ind)); - - vmesa->draw_line = s3v_line_tab[ind]; - vmesa->draw_tri = s3v_tri_tab[ind]; - vmesa->draw_quad = s3v_quad_tab[ind]; - vmesa->draw_point = s3v_point_tab[ind]; - -#if 0 - /* Hook in fallbacks for specific primitives. CURRENTLY DISABLED - */ - - if (flags & LINE_FALLBACK) - vmesa->draw_line = s3v_fallback_line; - - if (flags & TRI_FALLBACK) { - DEBUG(("TRI_FALLBACK\n")); - vmesa->draw_tri = s3v_fallback_tri; - vmesa->draw_quad = s3v_fallback_quad; - } -#endif -} - - - - -/*********************************************************************** - * Macros for t_dd_tritmp.h to draw basic primitives * - ***********************************************************************/ - -#define TRI( v0, v1, v2 ) \ -do { \ - /* - if (DO_FALLBACK) \ - vmesa->draw_tri( vmesa, v0, v1, v2 ); \ - else */ \ - DEBUG(("TRI: max was here\n")); /* \ - s3v_draw_tex_triangle( vmesa, v0, v1, v2 ); */ \ - vmesa->draw_tri( vmesa, v0, v1, v2 ); \ -} while (0) - -#define QUAD( v0, v1, v2, v3 ) \ -do { \ - DEBUG(("QUAD: max was here\n")); \ - vmesa->draw_quad( vmesa, v0, v1, v2, v3 ); \ -} while (0) - -#define LINE( v0, v1 ) \ -do { \ - DEBUG(("LINE: max was here\n")); \ - vmesa->draw_line( vmesa, v0, v1 ); \ -} while (0) - -#define POINT( v0 ) \ -do { \ - vmesa->draw_point( vmesa, v0 ); \ -} while (0) - - -/*********************************************************************** - * Build render functions from dd templates * - ***********************************************************************/ - -/* -#define S3V_OFFSET_BIT 0x01 -#define S3V_TWOSIDE_BIT 0x02 -#define S3V_UNFILLED_BIT 0x04 -#define S3V_FALLBACK_BIT 0x08 -#define S3V_MAX_TRIFUNC 0x10 - - -static struct { - points_func points; - line_func line; - triangle_func triangle; - quad_func quad; -} rast_tab[S3V_MAX_TRIFUNC]; -*/ - -#define DO_FALLBACK (IND & S3V_FALLBACK_BIT) -#define DO_OFFSET (IND & S3V_OFFSET_BIT) -#define DO_UNFILLED (IND & S3V_UNFILLED_BIT) -#define DO_TWOSIDE (IND & S3V_TWOSIDE_BIT) -#define DO_FLAT 0 -#define DO_TRI 1 -#define DO_QUAD 1 -#define DO_LINE 1 -#define DO_POINTS 1 -#define DO_FULL_QUAD 1 - -#define HAVE_RGBA 1 -#define HAVE_SPEC 0 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX s3vVertex -#define TAB rast_tab - -#define DEPTH_SCALE 1.0 -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define VERT_X(_v) _v->v.x -#define VERT_Y(_v) _v->v.y -#define VERT_Z(_v) _v->v.z -#define AREA_IS_CCW( a ) (a > 0) -#define GET_VERTEX(e) (vmesa->verts + (e<<vmesa->vertex_stride_shift)) - -#if 0 -#define VERT_SET_RGBA( v, c ) \ -do { \ -/* UNCLAMPED_FLOAT_TO_RGBA_CHAN( v->ub4[4], c) */ \ -} while (0) - -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4] -/* -#define VERT_COPY_RGBA1( v0, v1 ) v0->ui[4] = v1->ui[4] -*/ -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx] -#endif - -#define LOCAL_VARS(n) \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - GLuint color[n]; \ - (void) color; - - -/*********************************************************************** - * Helpers for rendering unfilled primitives * - ***********************************************************************/ - -static const GLuint hw_prim[GL_POLYGON+1] = { - PrimType_Points, - PrimType_Lines, - PrimType_Lines, - PrimType_Lines, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles -}; - -static void s3vResetLineStipple( GLcontext *ctx ); -static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim ); -static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim ); -/* -extern static void s3v_lines_emit(GLcontext *ctx, GLuint start, GLuint end); -extern static void s3v_tris_emit(GLcontext *ctx, GLuint start, GLuint end); -*/ -#define RASTERIZE(x) if (vmesa->hw_primitive != hw_prim[x]) \ - s3vRasterPrimitive( ctx, hw_prim[x] ) -#define RENDER_PRIMITIVE vmesa->render_primitive -#define TAG(x) x -#define IND S3V_FALLBACK_BIT -#include "tnl_dd/t_dd_unfilled.h" -#undef IND - -/*********************************************************************** - * Generate GL render functions * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT|S3V_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_OFFSET_BIT|S3V_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT|S3V_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT|S3V_OFFSET_BIT|S3V_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - - -static void init_render_tab( void ) -{ - DEBUG(("*** init_render_tab ***\n")); - - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); -} - - -/**********************************************************************/ -/* Render unclipped begin/end objects */ -/**********************************************************************/ - -#define VERT(x) (s3vVertex *)(s3vverts + (x << shift)) - -#define RENDER_POINTS( start, count ) \ - DEBUG(("RENDER_POINTS...(ok)\n")); \ - for ( ; start < count ; start++) \ - vmesa->draw_line( vmesa, VERT(start), VERT(start) ) - /* vmesa->draw_point( vmesa, VERT(start) ) */ - -#define RENDER_LINE( v0, v1 ) \ - /* DEBUG(("RENDER_LINE...(ok)\n")); \ */ \ - vmesa->draw_line( vmesa, VERT(v0), VERT(v1) ); \ - DEBUG(("RENDER_LINE...(ok)\n")) - -#define RENDER_TRI( v0, v1, v2 ) \ - DEBUG(("RENDER_TRI...(ok)\n")); \ - vmesa->draw_tri( vmesa, VERT(v0), VERT(v1), VERT(v2) ) - -#define RENDER_QUAD( v0, v1, v2, v3 ) \ - DEBUG(("RENDER_QUAD...(ok)\n")); \ - /* s3v_draw_quad( vmesa, VERT(v0), VERT(v1), VERT(v2),VERT(v3) ) */\ - /* s3v_draw_triangle( vmesa, VERT(v0), VERT(v1), VERT(v2) ); \ - s3v_draw_triangle( vmesa, VERT(v0), VERT(v2), VERT(v3) ) */ \ - vmesa->draw_quad( vmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) - -#define INIT(x) s3vRenderPrimitive( ctx, x ); -#undef LOCAL_VARS -#define LOCAL_VARS \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - const GLuint shift = vmesa->vertex_stride_shift; \ - const char *s3vverts = (char *)vmesa->verts; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) stipple; -#define RESET_STIPPLE if ( stipple ) s3vResetLineStipple( ctx ); -#define RESET_OCCLUSION -#define PRESERVE_VB_DEFS -#define ELT(x) (x) -#define TAG(x) s3v_##x##_verts -#include "tnl_dd/t_dd_rendertmp.h" - - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - -static void s3vRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint prim = vmesa->render_primitive; - - DEBUG(("I AM in: s3vRenderClippedPoly\n")); - - /* Render the new vertices as an unclipped polygon. - */ - if (1) - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON] - ( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - - VB->Elts = tmp; - } - - /* Restore the render primitive - */ -#if 1 - if (prim != GL_POLYGON) { - DEBUG(("and prim != GL_POLYGON\n")); - tnl->Driver.Render.PrimitiveNotify( ctx, prim ); - } - -#endif -} - -static void s3vRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - /*tnl->Driver.LineFunc = s3v_line_tab[2];*/ /* _swsetup_Line; */ - - DEBUG(("I AM in: s3vRenderClippedLine\n")); - tnl->Driver.Render.Line( ctx, ii, jj ); -} - - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - - - -#define _S3V_NEW_RENDERSTATE (_DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET) - -#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) - -static void s3vChooseRenderState(GLcontext *ctx) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint index = 0; - - DEBUG(("s3vChooseRenderState\n")); - - if (flags & ANY_RASTER_FLAGS) { - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= S3V_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= S3V_OFFSET_BIT; - if (flags & DD_TRI_UNFILLED) index |= S3V_UNFILLED_BIT; - } - - DEBUG(("vmesa->RenderIndex = %i\n", vmesa->RenderIndex)); - DEBUG(("index = %i\n", index)); - - if (vmesa->RenderIndex != index) { - vmesa->RenderIndex = index; - - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (vmesa->RenderIndex == 0) - tnl->Driver.Render.PrimTabVerts = s3v_render_tab_verts; - else - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ClippedLine = s3vRenderClippedLine; - tnl->Driver.Render.ClippedPolygon = s3vRenderClippedPoly; - } -} - - -/**********************************************************************/ -/* High level hooks for t_vb_render.c */ -/**********************************************************************/ - - - -/* Determine the rasterized primitive when not drawing unfilled - * polygons. - * - * Used only for the default render stage which always decomposes - * primitives to trianges/lines/points. For the accelerated stage, - * which renders strips as strips, the equivalent calculations are - * performed in s3v_render.c. - */ - -static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); -/* __DRIdrawablePrivate *dPriv = vmesa->driDrawable; */ - GLuint cmd = vmesa->CMD; - - unsigned int _hw_prim = hwprim; - - DEBUG(("s3vRasterPrimitive: hwprim = 0x%x ", _hw_prim)); - -/* printf("* vmesa->CMD = 0x%x\n", vmesa->CMD); */ - - if (vmesa->hw_primitive != _hw_prim) - { - DEBUG(("(new one) ***\n")); - cmd &= ~DO_MASK; - cmd &= ~ALPHA_BLEND_MASK; - vmesa->hw_primitive = _hw_prim; - - if (_hw_prim == PrimType_Triangles) { - /* TRI */ - DEBUG(("->switching to tri\n")); - cmd |= (vmesa->_tri[vmesa->_3d_mode] | vmesa->_alpha[vmesa->_3d_mode]); - } else if (_hw_prim == PrimType_Lines - || _hw_prim == PrimType_Points) { - /* LINE */ - DEBUG(("->switching to line\n")); - cmd |= (DO_3D_LINE | vmesa->_alpha[0]); - } else { - /* ugh? */ - DEBUG(("->switching to your sis'ass\n")); - } - - DEBUG(("\n")); - - vmesa->restore_primitive = _hw_prim; - /* 0xacc16827: good value -> lightened newave!!! */ - vmesa->CMD = cmd; - CMDCHANGE(); - } -} - -static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - GLuint cmd = vmesa->CMD; - - unsigned int _hw_prim = hw_prim[prim]; - - vmesa->render_primitive = prim; - vmesa->hw_primitive = _hw_prim; - - DEBUG(("s3vRenderPrimitive #%i ", prim)); - DEBUG(("_hw_prim = 0x%x\n", _hw_prim)); - -/* printf(" vmesa->CMD = 0x%x\n", vmesa->CMD); */ - - if (_hw_prim != vmesa->restore_primitive) { - DEBUG(("_hw_prim != vmesa->restore_primitive (was 0x%x)\n", - vmesa->restore_primitive)); -#if 1 - cmd &= ~DO_MASK; - cmd &= ~ALPHA_BLEND_MASK; -/* - printf(" cmd = 0x%x\n", cmd); - printf(" vmesa->_3d_mode=%i; vmesa->_tri[vmesa->_3d_mode]=0x%x\n", - vmesa->_3d_mode, vmesa->_tri[vmesa->_3d_mode]); - printf("vmesa->alpha[0] = 0x%x; vmesa->alpha[1] = 0x%x\n", - vmesa->_alpha[0], vmesa->_alpha[1]); -*/ - if (_hw_prim == PrimType_Triangles) { /* TRI */ - DEBUG(("->switching to tri\n")); - cmd |= (vmesa->_tri[vmesa->_3d_mode] | vmesa->_alpha[vmesa->_3d_mode]); - DEBUG(("vmesa->TexStride = %i\n", vmesa->TexStride)); - DEBUG(("vmesa->TexOffset = %i\n", vmesa->TexOffset)); - DMAOUT_CHECK(3DTRI_Z_BASE, 12); - } else { /* LINE */ - DEBUG(("->switching to line\n")); - cmd |= (DO_3D_LINE | vmesa->_alpha[0]); - DMAOUT_CHECK(3DLINE_Z_BASE, 12); - } - - DMAOUT(vmesa->s3vScreen->depthOffset & 0x003FFFF8); - DMAOUT(vmesa->DestBase); - /* DMAOUT(vmesa->ScissorLR); */ - /* DMAOUT(vmesa->ScissorTB); */ - - /* NOTE: we need to restore all these values since we - * are coming back from a vmesa->restore_primitive */ - DMAOUT( (0 << 16) | (dPriv->w-1) ); - DMAOUT( (0 << 16) | (dPriv->h-1) ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->TexStride ); - DMAOUT(vmesa->SrcStride); - DMAOUT(vmesa->TexOffset); - DMAOUT(vmesa->TextureBorderColor); - DMAOUT(0); /* FOG */ - DMAOUT(0); - DMAOUT(0); - DMAOUT(cmd); - /* 0xacc16827: good value -> lightened newave!!! */ - DMAFINISH(); - - vmesa->CMD = cmd; -#endif - } - - DEBUG(("\n")); - - vmesa->restore_primitive = _hw_prim; -} - -static void s3vRunPipeline( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("*** s3vRunPipeline ***\n")); - - if ( vmesa->new_state ) - s3vDDUpdateHWState( ctx ); - - if (vmesa->new_gl_state) { - - if (vmesa->new_gl_state & _NEW_TEXTURE) { - s3vUpdateTextureState( ctx ); - } - - if (!vmesa->Fallback) { - if (vmesa->new_gl_state & _S3V_NEW_VERTEX) - s3vChooseVertexState( ctx ); - - if (vmesa->new_gl_state & _S3V_NEW_RASTER_STATE) - s3vChooseRasterState( ctx ); - - if (vmesa->new_gl_state & _S3V_NEW_RENDERSTATE) - s3vChooseRenderState( ctx ); - } - - vmesa->new_gl_state = 0; - - } - - _tnl_run_pipeline( ctx ); -} - -static void s3vRenderStart( GLcontext *ctx ) -{ - /* Check for projective texturing. Make sure all texcoord - * pointers point to something. (fix in mesa?) - */ - - DEBUG(("s3vRenderStart\n")); - /* s3vCheckTexSizes( ctx ); */ -} - -static void s3vRenderFinish( GLcontext *ctx ) -{ - if (0) - _swrast_flush( ctx ); /* never needed */ -} - -static void s3vResetLineStipple( GLcontext *ctx ) -{ -/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - - /* Reset the hardware stipple counter. - */ -/* - CHECK_DMA_BUFFER(vmesa, 1); - WRITE(vmesa->buf, UpdateLineStippleCounters, 0); -*/ -} - - -/**********************************************************************/ -/* Transition to/from hardware rasterization. */ -/**********************************************************************/ - - -void s3vFallback( s3vContextPtr vmesa, GLuint bit, GLboolean mode ) -{ - GLcontext *ctx = vmesa->glCtx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = vmesa->Fallback; - - DEBUG(("*** s3vFallback: ")); - - if (mode) { - vmesa->Fallback |= bit; - if (oldfallback == 0) { - DEBUG(("oldfallback == 0 ***\n")); - _swsetup_Wakeup( ctx ); - _tnl_need_projected_coords( ctx, GL_TRUE ); - vmesa->RenderIndex = ~0; - } - } - else { - DEBUG(("***\n")); - vmesa->Fallback &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - tnl->Driver.Render.Start = s3vRenderStart; - tnl->Driver.Render.PrimitiveNotify = s3vRenderPrimitive; - tnl->Driver.Render.Finish = s3vRenderFinish; - tnl->Driver.Render.BuildVertices = s3vBuildVertices; - tnl->Driver.Render.ResetLineStipple = s3vResetLineStipple; - vmesa->new_gl_state |= (_S3V_NEW_RENDERSTATE| - _S3V_NEW_RASTER_STATE| - _S3V_NEW_VERTEX); - } - } -} - - -/**********************************************************************/ -/* Initialization. */ -/**********************************************************************/ - - -void s3vInitTriFuncs( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - init_render_tab(); - firsttime = 0; - } - - vmesa->RenderIndex = ~0; - - tnl->Driver.RunPipeline = s3vRunPipeline; - tnl->Driver.Render.Start = s3vRenderStart; - tnl->Driver.Render.Finish = s3vRenderFinish; - tnl->Driver.Render.PrimitiveNotify = s3vRenderPrimitive; - tnl->Driver.Render.ResetLineStipple = s3vResetLineStipple; -/* - tnl->Driver.RenderInterp = _swsetup_RenderInterp; - tnl->Driver.RenderCopyPV = _swsetup_RenderCopyPV; -*/ - tnl->Driver.Render.BuildVertices = s3vBuildVertices; -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tris.h b/src/mesa/drivers/dri/s3v/s3v_tris.h deleted file mode 100644 index 0010a7fe0a..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tris.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef _S3V_TRIS_H -#define _S3V_TRIS_H - -extern void s3vDDTrifuncInit(void); -extern void s3vDDChooseTriRenderState(GLcontext *); - -#endif /* !(_S3V_TRIS_H) */ diff --git a/src/mesa/drivers/dri/s3v/s3v_tritmp.h b/src/mesa/drivers/dri/s3v/s3v_tritmp.h deleted file mode 100644 index 2321bd414f..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tritmp.h +++ /dev/null @@ -1,958 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -/**** MACROS start ****/ - -/* point/line macros */ - -#define LINE_VERT_VARS \ - SWvertex v[3]; \ - s3vVertex* vvv[2]; \ - int x[3], y[3], z[3]; \ - int idx[3]; \ - int dx01, dy01; \ - int delt02; \ - int deltzy, zstart; \ - int start02, end01; \ - int ystart, y01y12; \ - int i, tmp, tmp2, tmp3; \ - GLfloat ydiff, fy[3] -#define LINE_VERT_VARS_VOIDS \ - (void) v; (void) vvv; (void) x; (void) y; (void) z; (void) idx; \ - (void) dx01; (void) dy01; (void) delt02; (void) deltzy; \ - (void) zstart; (void) start02; (void) ystart; (void) y01y12; \ - (void) i; (void) tmp; (void) tmp2; (void) tmp3; (void) ydiff; (void) fy - -#define LINE_FLAT_VARS \ - int arstart, gbstart; \ - int deltarx, deltgbx, deltary, deltgby; \ - GLubyte *(col)[3] -#define LINE_FLAT_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ - (void) deltary; (void) deltgby; (void) col - -#define LINE_GOURAUD_VARS \ - int arstart, gbstart; \ - int deltary, deltgby; \ - int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *(col)[3] -#define LINE_GOURAUD_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltary; (void) deltgby; \ - (void) ctmp; (void) ctmp2; (void) ctmp3; (void) ctmp4; (void) col - -#define SORT_LINE_VERT() \ -do { \ - if(v[0].attrib[FRAG_ATTRIB_WPOS][1] <= v[1].attrib[FRAG_ATTRIB_WPOS][1]) { \ -\ - idx[0] = 0; \ - idx[1] = 1; \ -\ - } else if (v[0].attrib[FRAG_ATTRIB_WPOS][1] > v[1].attrib[FRAG_ATTRIB_WPOS][1]) { \ -\ - idx[0] = 1; \ - idx[1] = 0; \ -\ - } \ -} while(0) - -#define SET_LINE_VERT() \ -do { \ - x[0] = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][0] * 1024.0f * 1024.0f); /* 0x100000 */ \ - y[0] = fy[0] = dPriv->h - v[idx[0]].attrib[FRAG_ATTRIB_WPOS][1]; \ - z[0] = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][2]) * 1024.0f * 32.0f; /* 0x8000; */ \ -\ - x[1] = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][0] * 1024.0f * 1024.0f); /* 0x100000 */ \ - y[1] = dPriv->h - v[idx[1]].attrib[FRAG_ATTRIB_WPOS][1]; \ - z[1] = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][2]) * 1024.0f * 32.0f; /* 0x8000 */ \ -} while(0) - -#define SET_LINE_XY() \ -do { \ - tmp = v[idx[0]].attrib[FRAG_ATTRIB_WPOS][0]; \ - tmp2 = v[idx[1]].attrib[FRAG_ATTRIB_WPOS][0]; \ -\ - dx01 = x[0] - x[1]; \ - dy01 = y[0] - y[1]; \ -\ - ydiff = fy[0] - (float)y[0]; \ - ystart = y[0]; \ - y01y12 = dy01 + 1; \ -} while (0) - -#define SET_LINE_DIR() \ -do { \ - if (tmp2 > tmp) { \ - y01y12 |= 0x80000000; \ - tmp3 = tmp2-tmp; \ - } else { \ - tmp3 = tmp-tmp2; \ - } \ -\ - end01 = ((tmp << 16) | tmp2); \ -\ - if (dy01) \ - delt02 = -(dx01/dy01); \ - else \ - delt02 = 0; \ -\ - if (dy01 > tmp3) { /* Y MAJ */ \ - /* NOTE: tmp3 always >=0 */ \ - start02 = x[0]; \ - } else if (delt02 >= 0){ /* X MAJ - positive delta */ \ - start02 = x[0] + delt02/2; \ - dy01 = tmp3; /* could be 0 */ \ - } else { /* X MAJ - negative delta */ \ - start02 = x[0] + delt02/2 + ((1 << 20) - 1); \ - dy01 = tmp3; /* could be 0 */ \ - } \ -} while(0) - -#define SET_LINE_Z() \ -do { \ - zstart = z[0]; \ -\ - if (dy01) { \ - deltzy = (z[1] - z[0])/dy01; \ - } else { \ - deltzy = 0; /* dy01 = tmp3 = 0 (it's a point)*/ \ - } \ -} while (0) - -#define SET_LINE_FLAT_COL() \ -do { \ - col[0] = &(v[idx[0]].color[0]); \ - deltarx = deltary = deltgbx = deltgby = 0; \ - gbstart = (((col[0][1]) << 23) | ((col[0][2]) << 7)); \ - arstart = (((col[0][3]) << 23) | ((col[0][0]) << 7)); \ -} while(0) - -#define SET_LINE_GOURAUD_COL() \ -do { \ - col[0] = &(v[idx[0]].color[0]); \ - col[1] = &(v[idx[1]].color[0]); \ -\ - vvv[0] = _v0; \ - vvv[1] = _v1; \ -\ - for (i=0; i<2; i++) { \ - /* FIXME: swapped ! */ \ - col[i][0] = vvv[!idx[i]]->v.color.red; \ - col[i][1] = vvv[!idx[i]]->v.color.green; \ - col[i][2] = vvv[!idx[i]]->v.color.blue; \ - col[i][3] = vvv[!idx[i]]->v.color.alpha; \ - } \ -\ - if (dy01) { \ -\ - ctmp = ((col[0][1] - col[1][1]) << 7) / dy01; \ - ctmp2 = ((col[0][2] - col[1][2]) << 7) / dy01; \ - deltgby = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ -\ - ctmp3 = ((col[0][3] - col[1][3]) << 7) / dy01; \ - ctmp4 = ((col[0][0] - col[1][0]) << 7) / dy01; \ - deltary = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - } else { \ - ctmp = ((col[1][1] - col[0][1]) << 7); \ - ctmp2 = ((col[1][2] - col[0][2]) << 7); \ - deltgby = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ -\ - ctmp3 = ((col[1][3] - col[0][3]) << 7); \ - ctmp4 = ((col[1][0] - col[0][0]) << 7); \ - deltary = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - deltgby = deltary = 0; \ - } \ -\ - idx[0] = 1; /* FIXME: swapped */ \ -\ - gbstart = \ - (((int)((ydiff * ctmp) + (col[idx[0]][1] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp2) + (col[idx[0]][2] << 7)) & 0x7FFF); \ - arstart = \ - (((int)((ydiff * ctmp3) + (col[idx[0]][3] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp4) + (col[idx[0]][0] << 7)) & 0x7FFF); \ -} while(0) - -#define SEND_LINE_COL() \ -do { \ - DMAOUT(deltgby); \ - DMAOUT(deltary); \ - DMAOUT(gbstart); \ - DMAOUT(arstart); \ -} while (0) - -#define SEND_LINE_VERT() \ -do { \ - DMAOUT(deltzy); \ - DMAOUT(zstart); \ - DMAOUT(0); \ - DMAOUT(0); \ - DMAOUT(0); \ - DMAOUT(end01); \ - DMAOUT(delt02); \ - DMAOUT(start02); \ - DMAOUT(ystart); \ - DMAOUT(y01y12); \ -} while (0) - - -/* tri macros (mostly stolen from utah-glx...) */ - -#define VERT_VARS \ - SWvertex v[3]; \ - int x[3], y[3], z[3]; \ - int idx[3]; \ - int dx01, dy01; \ - int dx02, dy02; \ - int dx12, dy12; \ - int delt01, delt02, delt12; \ - int deltzx, deltzy, zstart; \ - int start02, end01, end12; \ - int ystart, y01y12; \ - int i, tmp, lr; \ - GLfloat ydiff, fy[3] -#define VERT_VARS_VOIDS \ - (void) v; (void) x; (void) y; (void) z; (void) idx; (void) dx01; \ - (void) dy01; (void) dx02; (void) dy02; (void) dx12; (void) dy12; \ - (void) delt01; (void) delt02; (void) delt12; (void) deltzx; \ - (void) deltzy; (void) zstart; (void) start02; (void) end01; \ - (void) end12; (void) ystart; (void) y01y12; (void) i; (void) tmp; \ - (void) lr; (void) ydiff; (void) fy - -#define GOURAUD_VARS \ - int arstart, gbstart; \ - int deltarx, deltgbx, deltary, deltgby; \ - int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *(col)[3] -#define GOURAUD_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ - (void) deltary; (void) deltgby; (void) ctmp; (void) ctmp2; \ - (void) ctmp3; (void) ctmp4; (void) col - -#define FLAT_VARS \ - int arstart, gbstart; \ - int deltarx, deltgbx, deltary, deltgby; \ - GLubyte *(col)[3] -#define FLAT_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ - (void) deltary; (void) deltgby; (void) col - -#define TEX_VARS \ - int u0, u1, u2; \ - GLfloat ru0, ru1, ru2; \ - int v0, v1, v2; \ - GLfloat rv0, rv1, rv2; \ - GLfloat w0, w1, w2; \ - GLfloat rw0, rw1, rw2; \ - int baseu, basev; \ - int d0, d1, d2; \ - int deltdx, deltvx, deltux, deltdy, deltvy, deltuy; \ - int deltwx, deltwy; \ - int rbaseu, rbasev; \ - int dstart, ustart, wstart, vstart; \ - static int stmp = 0; \ - s3vTextureObjectPtr t -#define TEX_VARS_VOIDS \ - (void) u0; (void) u1; (void) u2; (void) ru0; (void) ru1; (void) ru2; \ - (void) v0; (void) v1; (void) v2; (void) rv0; (void) rv1; (void) rv2; \ - (void) w0; (void) w1; (void) w2; (void) rw0; (void) rw1; (void) rw2; \ - (void) baseu; (void) basev; (void) d0; (void) d1; (void) d2; \ - (void) deltdx; (void) deltvx; (void) deltux; (void) deltdy; \ - (void) deltuy; (void) deltwx; (void) deltwy; (void) rbaseu; \ - (void) rbasev; (void) dstart; (void) ustart; (void) wstart; \ - (void) vstart; (void) stmp; (void) t - -#define SORT_VERT() \ -do { \ - for (i=0; i<3; i++) \ - fy[i] = v[i].attrib[FRAG_ATTRIB_WPOS][1]; \ -\ - if (fy[1] > fy[0]) { /* (fy[1] > fy[0]) */ \ -\ - if (fy[2] > fy[0]) { \ - idx[0] = 0; \ - if (fy[1] > fy[2]) { \ - idx[1] = 2; \ - idx[2] = 1; \ - } else { \ - idx[1] = 1; \ - idx[2] = 2; \ - } \ - } else { \ - idx[0] = 2; \ - idx[1] = 0; \ - idx[2] = 1; \ - } \ - } else { /* (fy[1] < y[0]) */ \ - if (fy[2] > fy[0]) { \ - idx[0] = 1; \ - idx[1] = 0; \ - idx[2] = 2; \ - } else { \ - idx[2] = 0; \ - if (fy[2] > fy[1]) { \ - idx[0] = 1; \ - idx[1] = 2; \ - } else { \ - idx[0] = 2; \ - idx[1] = 1; \ - } \ - } \ - } \ -} while(0) - -#define SET_VERT() \ -do { \ - for (i=0; i<3; i++) \ - { \ - x[i] = ((v[idx[i]].attrib[FRAG_ATTRIB_WPOS][0]) * /* 0x100000*/ 1024.0 * 1024.0); \ - y[i] = fy[i] = (dPriv->h - v[idx[i]].attrib[FRAG_ATTRIB_WPOS][1]); \ - z[i] = ((v[idx[i]].attrib[FRAG_ATTRIB_WPOS][2]) * /* 0x8000 */ 1024.0 * 32.0); \ - } \ -\ - ydiff = fy[0] - (float)y[0]; \ -\ - ystart = y[0]; \ -\ - dx12 = x[2] - x[1]; \ - dy12 = y[1] - y[2]; \ - dx01 = x[1] - x[0]; \ - dy01 = y[0] - y[1]; \ - dx02 = x[2] - x[0]; \ - dy02 = y[0] - y[2]; \ -\ - delt01 = delt02 = delt12 = 0; \ -} while (0) - - -#define SET_XY() \ -do { \ - if (dy01) delt01 = dx01 / dy01; \ - if (dy12) delt12 = dx12 / dy12; \ - delt02 = dx02 / dy02; \ -\ - start02 = x[0] + (ydiff * delt02); \ - end01 = x[0] + (ydiff * delt01); \ - end12 = x[1] + ((fy[1] - (GLfloat)y[1]) * delt12); \ -} while (0) - -#define SET_DIR() \ -do { \ - tmp = x[1] - (dy01 * delt02 + x[0]); \ - if (tmp > 0) { \ - lr = 0x80000000; \ - } else { \ - tmp *= -1; \ - lr = 0; \ - } \ - tmp >>= 20; \ -\ - y01y12 = ((((y[0] - y[1]) & 0x7FF) << 16) \ - | ((y[1] - y[2]) & 0x7FF) | lr); \ -} while (0) - -#define SET_Z() \ -do { \ - deltzy = (z[2] - z[0]) / dy02; \ - if (tmp) { \ - deltzx = (z[1] - (dy01 * deltzy + z[0])) / tmp; \ - } else { \ - deltzx = 0; \ - } \ - zstart = (deltzy * ydiff) + z[0]; \ -} while (0) - -#define SET_FLAT_COL() \ -do { \ - col[0] = &(v[0].color[0]); \ - deltarx = deltary = deltgbx = deltgby = 0; \ - gbstart = (((col[0][1]) << 23) | ((col[0][2]) << 7)); \ - arstart = (((col[0][3]) << 23) | ((col[0][0]) << 7)); \ -} while(0) - -#define SET_GOURAUD_COL() \ -do { \ - col[0] = &(v[idx[0]].color[0]); \ - col[1] = &(v[idx[1]].color[0]); \ - col[2] = &(v[idx[2]].color[0]); \ -\ - ctmp = ((col[2][3] - col[0][3]) << 7) / dy02; \ - ctmp2 = ((col[2][0] - col[0][0]) << 7) / dy02; \ - deltary = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ - ctmp3 = ((col[2][1] - col[0][1]) << 7) / dy02; \ - ctmp4 = ((col[2][2] - col[0][2]) << 7) / dy02; \ - deltgby = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - gbstart = \ - (((int)((ydiff * ctmp3) + (col[0][1] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp4) + (col[0][2] << 7)) & 0x7FFF); \ - arstart = \ - (((int)((ydiff * ctmp) + (col[0][3] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp2) + (col[0][0] << 7)) & 0x7FFF); \ - if (tmp) { \ - int ax, rx, gx, bx; \ - ax = ((col[1][3] << 7) - (dy01 * ctmp + (col[0][3] << 7))) / tmp; \ - rx = ((col[1][0] << 7) - (dy01 * ctmp2 + (col[0][0] << 7))) / tmp; \ - gx = ((col[1][1] << 7) - (dy01 * ctmp3 + (col[0][1] << 7))) / tmp; \ - bx = ((col[1][2] << 7) - (dy01 * ctmp4 + (col[0][2] << 7))) / tmp; \ - deltarx = ((ax << 16) & 0xFFFF0000) | (rx & 0xFFFF); \ - deltgbx = ((gx << 16) & 0xFFFF0000) | (bx & 0xFFFF); \ - } else { \ - deltgbx = deltarx = 0; \ - } \ -} while (0) - -#define SET_TEX_VERT() \ -do { \ - t = ((s3vTextureObjectPtr) \ - ctx->Texture.Unit[0]._Current->DriverData); \ - deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \ -\ - u0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] \ - * (GLfloat)(t->image[0].image->Width) * 256.0); \ - u1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] \ - * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \ - u2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0] \ - * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \ - v0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] \ - * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ - v1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] \ - * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ - v2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1] \ - * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ -\ - w0 = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][3]); \ - w1 = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][3]); \ - w2 = (v[idx[2]].attrib[FRAG_ATTRIB_WPOS][3]); \ -} while (0) - -#define SET_BASEUV() \ -do { \ - if (u0 < u1) { \ - if (u0 < u2) { \ - baseu = u0; \ - } else { \ - baseu = u2; \ - } \ - } else { \ - if (u1 < u2) { \ - baseu = u1; \ - } else { \ - baseu = u2; \ - } \ - } \ -\ - if (v0 < v1) { \ - if (v0 < v2) { \ - basev = v0; \ - } else { \ - basev = v2; \ - } \ - } else { \ - if (v1 < v2) { \ - basev = v1; \ - } else { \ - basev = v2; \ - } \ - } \ -} while (0) - - -#define SET_RW() \ -do { \ - /* GLfloat minW; \ -\ - if (w0 < w1) { \ - if (w0 < w2) { \ - minW = w0; \ - } else { \ - minW = w2; \ - } \ - } else { \ - if (w1 < w2) { \ - minW = w1; \ - } else { \ - minW = w2; \ - } \ - } */ \ -\ - rw0 = (512.0 * w0); \ - rw1 = (512.0 * w1); \ - rw2 = (512.0 * w2); \ -} while (0) - -#define SET_D() \ -do { \ - GLfloat sxy, suv; \ - int lev; \ -\ - suv = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \ -\ - sxy = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \ -\ - if (sxy < 0) sxy *= -1.0; \ - if (suv < 0) suv *= -1.0; \ -\ - lev = *(int*)&suv - *(int *)&sxy; \ - if (lev < 0) \ - lev = 0; \ - else \ - lev >>=23; \ - dstart = (lev << 27); \ -} while (0) - -#define SET_UVWD() \ -do { \ - SET_BASEUV(); \ - SET_RW(); \ - SET_D(); \ - ru0 = (((u0 - baseu) * rw0)); \ - ru1 = (((u1 - baseu) * rw1)); \ - ru2 = (((u2 - baseu) * rw2)); \ - rv0 = (((v0 - basev) * rw0)); \ - rv1 = (((v1 - basev) * rw1)); \ - rv2 = (((v2 - basev) * rw2)); \ -\ - while (baseu < 0) { baseu += (t->globj->Image[0][0]->Width << 8); } \ - while (basev < 0) { basev += (t->globj->Image[0][0]->Height << 8); } \ -\ - if (!(baseu & 0xFF)) \ - { baseu = (baseu >> 8); } \ - else \ - { baseu = (baseu >> 8) + 1; } \ -\ - if ((basev & 0x80) || !(basev & 0xFF)) \ - { basev = (basev >> 8); } \ - else \ - { basev = (basev >> 8) - 1; } \ -\ - rbaseu = (baseu) << (16 - t->globj->Image[0][0]->WidthLog2); \ - rbasev = (basev) << (16 - t->globj->Image[0][0]->WidthLog2); \ - deltuy = (((ru2 - ru0) / dy02)); \ - deltvy = (((rv2 - rv0) / dy02)); \ - rw0 *= (1024.0 * 512.0); \ - rw1 *= (1024.0 * 512.0); \ - rw2 *= (1024.0 * 512.0); \ - deltwy = ((rw2 - rw0) / dy02); \ - if (tmp) { \ - deltux = ((ru1 - (dy01 * deltuy + ru0)) / tmp); \ - deltvx = ((rv1 - (dy01 * deltvy + rv0)) / tmp); \ - deltwx = ((rw1 - (dy01 * deltwy + rw0)) / tmp); \ - } else { deltux = deltvx = deltwx = 0; } \ - ustart = (deltuy * ydiff) + (ru0); \ - vstart = (deltvy * ydiff) + (rv0); \ - wstart = (deltwy * ydiff) + (rw0); \ -} while (0) - -#define SEND_UVWD() \ -do { \ - DMAOUT((rbasev & 0xFFFF)); \ - DMAOUT((0xa0000000 | (rbaseu & 0xFFFF))); \ - DMAOUT(deltwx); \ - DMAOUT(deltwy); \ - DMAOUT(wstart); \ - DMAOUT(deltdx); \ - DMAOUT(deltvx); \ - DMAOUT(deltux); \ - DMAOUT(deltdy); \ - DMAOUT(deltvy); \ - DMAOUT(deltuy); \ - DMAOUT(dstart); \ - DMAOUT(vstart); \ - DMAOUT(ustart); \ -} while (0) - -#define SEND_VERT() \ -do { \ - DMAOUT(deltzx); \ - DMAOUT(deltzy); \ - DMAOUT(zstart); \ - DMAOUT(delt12); \ - DMAOUT(end12); \ - DMAOUT(delt01); \ - DMAOUT(end01); \ - DMAOUT(delt02); \ - DMAOUT(start02); \ - DMAOUT(ystart); \ - DMAOUT(y01y12); \ -} while (0) - -#define SEND_COL() \ -do { \ - DMAOUT(deltgbx); \ - DMAOUT(deltarx); \ - DMAOUT(deltgby); \ - DMAOUT(deltary); \ - DMAOUT(gbstart); \ - DMAOUT(arstart); \ -} while (0) - -/**** MACROS end ****/ - - - - -static void TAG(s3v_point)( s3vContextPtr vmesa, - const s3vVertex *_v0 ) -{ -} - -static void TAG(s3v_line)( s3vContextPtr vmesa, - const s3vVertex *_v0, - const s3vVertex *_v1 ) -{ - GLcontext *ctx = vmesa->glCtx; - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - LINE_VERT_VARS; -#if (IND & S3V_RAST_FLAT_BIT) - LINE_FLAT_VARS; -#else - LINE_GOURAUD_VARS; -#endif -#if (IND & S3V_RAST_CULL_BIT) - GLfloat cull; - (void) cull; -#endif - LINE_VERT_VARS_VOIDS; -#if (IND & S3V_RAST_FLAT_BIT) - LINE_FLAT_VARS_VOIDS; -#else - LINE_GOURAUD_VARS_VOIDS; -#endif - - DEBUG(("*** s3v_line: ")); -#if (IND & S3V_RAST_CULL_BIT) - DEBUG(("cull ")); -#endif -#if (IND & S3V_RAST_FLAT_BIT) - DEBUG(("flat ")); -#endif - - DEBUG(("***\n")); - -#if 0 - s3v_print_vertex(ctx, _v0); - s3v_print_vertex(ctx, _v1); -#endif - - s3v_translate_vertex( ctx, _v0, &v[0] ); - s3v_translate_vertex( ctx, _v1, &v[1] ); - -#if (IND & S3V_RAST_CULL_BIT) - /* FIXME: should we cull lines too? */ -#endif - (void)v; /* v[0]; v[1]; */ - - SORT_LINE_VERT(); - SET_LINE_VERT(); - - SET_LINE_XY(); - SET_LINE_DIR(); - SET_LINE_Z(); - -#if (IND & S3V_RAST_FLAT_BIT) - SET_LINE_FLAT_COL(); -#else - SET_LINE_GOURAUD_COL(); -#endif - - DMAOUT_CHECK(3DLINE_GBD, 15); - SEND_LINE_COL(); - DMAOUT(0); - SEND_LINE_VERT(); - DMAFINISH(); -} - -static void TAG(s3v_triangle)( s3vContextPtr vmesa, - const s3vVertex *_v0, - const s3vVertex *_v1, - const s3vVertex *_v2 ) -{ - GLcontext *ctx = vmesa->glCtx; - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - VERT_VARS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS; -#else - GOURAUD_VARS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS; -#endif -#if (IND & S3V_RAST_CULL_BIT) - GLfloat cull; -#endif - VERT_VARS_VOIDS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS_VOIDS; -#else - GOURAUD_VARS_VOIDS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS_VOIDS; -#endif - - DEBUG(("*** s3v_triangle: ")); -#if (IND & S3V_RAST_CULL_BIT) - DEBUG(("cull ")); -#endif -#if (IND & S3V_RAST_FLAT_BIT) - DEBUG(("flat ")); -#endif -#if (IND & S3V_RAST_TEX_BIT) - DEBUG(("tex ")); -#endif - -DEBUG(("***\n")); - -#if 0 - s3v_print_vertex(ctx, _v0); - s3v_print_vertex(ctx, _v1); - s3v_print_vertex(ctx, _v2); -#endif - - s3v_translate_vertex( ctx, _v0, &v[0] ); - s3v_translate_vertex( ctx, _v1, &v[1] ); - s3v_translate_vertex( ctx, _v2, &v[2] ); - -#if (IND & S3V_RAST_CULL_BIT) - cull = vmesa->backface_sign * - ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + - (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); - - if (cull < vmesa->cull_zero /* -0.02f */) return; -#endif - - (void)v; /* v[0]; v[1]; v[2]; */ - - SORT_VERT(); - SET_VERT(); - - if (dy02 == 0) return; - - SET_XY(); - SET_DIR(); - SET_Z(); - -#if (IND & S3V_RAST_TEX_BIT) - SET_TEX_VERT(); - SET_UVWD(); -#endif - -#if (IND & S3V_RAST_FLAT_BIT) - SET_FLAT_COL(); -#else - SET_GOURAUD_COL(); -#endif - -#if (IND & S3V_RAST_TEX_BIT) - DMAOUT_CHECK(3DTRI_BASEV, 31); - SEND_UVWD(); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#else - DMAOUT_CHECK(3DTRI_GBX, 17); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#endif -} - -static void TAG(s3v_quad)( s3vContextPtr vmesa, - const s3vVertex *_v0, - const s3vVertex *_v1, - const s3vVertex *_v2, - const s3vVertex *_v3 ) -{ - GLcontext *ctx = vmesa->glCtx; - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - SWvertex temp_v[4]; - VERT_VARS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS; -#else - GOURAUD_VARS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS; -#endif -#if (IND & S3V_RAST_CULL_BIT) - GLfloat cull; -#endif - VERT_VARS_VOIDS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS_VOIDS; -#else - GOURAUD_VARS_VOIDS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS_VOIDS; -#endif - - DEBUG(("*** s3v_quad: ")); -#if (IND & S3V_RAST_CULL_BIT) - DEBUG(("cull ")); - /* printf(""); */ /* speed trick */ -#endif -#if (IND & S3V_RAST_FLAT_BIT) - DEBUG(("flat ")); -#endif -#if (IND & S3V_RAST_TEX_BIT) - DEBUG(("tex ")); -#endif - - DEBUG(("***\n")); - -#if 0 - s3v_print_vertex(ctx, _v0); - s3v_print_vertex(ctx, _v1); - s3v_print_vertex(ctx, _v2); - s3v_print_vertex(ctx, _v3); -#endif - s3v_translate_vertex( ctx, _v0, &temp_v[0] ); - s3v_translate_vertex( ctx, _v1, &temp_v[1] ); - s3v_translate_vertex( ctx, _v2, &temp_v[2] ); - s3v_translate_vertex( ctx, _v3, &temp_v[3] ); - - /* FIRST TRI (0,1,2) */ - - /* ROMEO */ - /* printf(""); */ /* speed trick (a) [turn on if (a) is return]*/ - - v[0] = temp_v[0]; - v[1] = temp_v[1]; - v[2] = temp_v[2]; - -#if (IND & S3V_RAST_CULL_BIT) - cull = vmesa->backface_sign * - ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + - (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); - - if (cull < vmesa->cull_zero /* -0.02f */) goto second; /* return; */ /* (a) */ -#endif - -#if 0 - v[0] = temp_v[0]; - v[1] = temp_v[1]; - v[2] = temp_v[2]; -#else - (void) v; -#endif - SORT_VERT(); - SET_VERT(); - - if (dy02 == 0) goto second; - - SET_XY(); - SET_DIR(); - SET_Z(); - -#if (IND & S3V_RAST_TEX_BIT) - SET_TEX_VERT(); - SET_UVWD(); -#endif - -#if (IND & S3V_RAST_FLAT_BIT) - SET_FLAT_COL(); -#else - SET_GOURAUD_COL(); -#endif - -#if (IND & S3V_RAST_TEX_BIT) - DMAOUT_CHECK(3DTRI_BASEV, 31); - SEND_UVWD(); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#else - DMAOUT_CHECK(3DTRI_GBX, 17); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#endif - - /* SECOND TRI (0,2,3) */ - -second: - v[0] = temp_v[0]; - v[1] = temp_v[2]; - v[2] = temp_v[3]; - -#if (IND & S3V_RAST_CULL_BIT) - cull = vmesa->backface_sign * - ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + - (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); - - if (cull < /* -0.02f */ vmesa->cull_zero) return; -#endif - -/* second: */ - - /* ROMEO */ - /* printf(""); */ /* speed trick */ - - v[0] = temp_v[0]; - v[1] = temp_v[2]; - v[2] = temp_v[3]; - - SORT_VERT(); - SET_VERT(); - - if (dy02 == 0) return; - - SET_XY(); - SET_DIR(); - SET_Z(); - -#if (IND & S3V_RAST_TEX_BIT) - SET_TEX_VERT(); - SET_UVWD(); -#endif - -#if (IND & S3V_RAST_FLAT_BIT) - SET_FLAT_COL(); -#else - SET_GOURAUD_COL(); -#endif - -#if (IND & S3V_RAST_TEX_BIT) - DMAOUT_CHECK(3DTRI_BASEV, 31); - SEND_UVWD(); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#else - DMAOUT_CHECK(3DTRI_GBX, 17); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#endif -} - -static void TAG(s3v_init)(void) -{ - s3v_point_tab[IND] = TAG(s3v_point); - s3v_line_tab[IND] = TAG(s3v_line); - s3v_tri_tab[IND] = TAG(s3v_triangle); - s3v_quad_tab[IND] = TAG(s3v_quad); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.c b/src/mesa/drivers/dri/s3v/s3v_vb.c deleted file mode 100644 index 00e375c6c4..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_vb.c +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast_setup/swrast_setup.h" -#include "tnl/t_context.h" -#include "tnl/tnl.h" - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_tris.h" - -#define S3V_XYZW_BIT 0x1 -#define S3V_RGBA_BIT 0x2 -#define S3V_TEX0_BIT 0x4 -#define S3V_PTEX_BIT 0x8 -#define S3V_FOG_BIT 0x10 -#define S3V_MAX_SETUP 0x20 - -static struct { - void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); - tnl_interp_func interp; - tnl_copy_pv_func copy_pv; - GLboolean (*check_tex_sizes)( GLcontext *ctx ); - GLuint vertex_size; - GLuint vertex_stride_shift; - GLuint vertex_format; -} setup_tab[S3V_MAX_SETUP]; - - -/* Only one vertex format, atm, so no need to give them names: - */ -#define TINY_VERTEX_FORMAT 1 -#define NOTEX_VERTEX_FORMAT 0 -#define TEX0_VERTEX_FORMAT 0 -#define TEX1_VERTEX_FORMAT 0 -#define PROJ_TEX1_VERTEX_FORMAT 0 -#define TEX2_VERTEX_FORMAT 0 -#define TEX3_VERTEX_FORMAT 0 -#define PROJ_TEX3_VERTEX_FORMAT 0 - -#define DO_XYZW (IND & S3V_XYZW_BIT) -#define DO_RGBA (IND & S3V_RGBA_BIT) -#define DO_SPEC 0 -#define DO_FOG (IND & S3V_FOG_BIT) -#define DO_TEX0 (IND & S3V_TEX0_BIT) -#define DO_TEX1 0 -#define DO_TEX2 0 -#define DO_TEX3 0 -#define DO_PTEX (IND & S3V_PTEX_BIT) - -#define VERTEX s3vVertex -#define LOCALVARS /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ -#define GET_VIEWPORT_MAT() 0 /* vmesa->hw_viewport */ -#define GET_TEXSOURCE(n) n -#define GET_VERTEX_FORMAT() 0 -#define GET_VERTEX_SIZE() S3V_CONTEXT(ctx)->vertex_size * sizeof(GLuint) -#define GET_VERTEX_STORE() S3V_CONTEXT(ctx)->verts -#define GET_VERTEX_STRIDE_SHIFT() S3V_CONTEXT(ctx)->vertex_stride_shift -#define INVALIDATE_STORED_VERTICES() -#define GET_UBYTE_COLOR_STORE() &S3V_CONTEXT(ctx)->UbyteColor -#define GET_UBYTE_SPEC_COLOR_STORE() &S3V_CONTEXT(ctx)->UbyteSecondaryColor - -#define HAVE_HW_VIEWPORT 1 /* FIXME */ -#define HAVE_HW_DIVIDE 1 -#define HAVE_RGBA_COLOR 0 /* we're BGRA */ -#define HAVE_TINY_VERTICES 1 -#define HAVE_NOTEX_VERTICES 0 -#define HAVE_TEX0_VERTICES 0 -#define HAVE_TEX1_VERTICES 0 -#define HAVE_TEX2_VERTICES 0 -#define HAVE_TEX3_VERTICES 0 -#define HAVE_PTEX_VERTICES 1 - -/* -#define SUBPIXEL_X -.5 -#define SUBPIXEL_Y -.5 -#define UNVIEWPORT_VARS GLfloat h = S3V_CONTEXT(ctx)->driDrawable->h -#define UNVIEWPORT_X(x) x - SUBPIXEL_X -#define UNVIEWPORT_Y(y) - y + h + SUBPIXEL_Y -#define UNVIEWPORT_Z(z) z / vmesa->depth_scale -*/ - -#define PTEX_FALLBACK() /* never needed */ - -#define IMPORT_QUALIFIER -#define IMPORT_FLOAT_COLORS s3v_import_float_colors -#define IMPORT_FLOAT_SPEC_COLORS s3v_import_float_spec_colors - -#define INTERP_VERTEX setup_tab[S3V_CONTEXT(ctx)->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[S3V_CONTEXT(ctx)->SetupIndex].copy_pv - - - -/*********************************************************************** - * Generate pv-copying and translation functions * - ***********************************************************************/ - -#define TAG(x) s3v_##x -#include "tnl_dd/t_dd_vb.c" - -/*********************************************************************** - * Generate vertex emit and interp functions * - ***********************************************************************/ - - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT) -#define TAG(x) x##_wg -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_TEX0_BIT) -#define TAG(x) x##_wgt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_TEX0_BIT|S3V_PTEX_BIT) -#define TAG(x) x##_wgpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_TEX0_BIT) -#define TAG(x) x##_t0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT) -#define TAG(x) x##_g -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT|S3V_TEX0_BIT) -#define TAG(x) x##_gt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT) -#define TAG(x) x##_wgf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT|S3V_TEX0_BIT) -#define TAG(x) x##_wgft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT|S3V_TEX0_BIT|S3V_PTEX_BIT) -#define TAG(x) x##_wgfpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_FOG_BIT) -#define TAG(x) x##_f -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT | S3V_FOG_BIT) -#define TAG(x) x##_gf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT | S3V_FOG_BIT | S3V_TEX0_BIT) -#define TAG(x) x##_gft0 -#include "tnl_dd/t_dd_vbtmp.h" - -static void init_setup_tab( void ) -{ - init_wg(); /* pos + col */ - init_wgt0(); /* pos + col + tex0 */ - init_wgpt0(); /* pos + col + p-tex0 (?) */ - init_t0(); /* tex0 */ - init_g(); /* col */ - init_gt0(); /* col + tex */ - init_wgf(); - init_wgft0(); - init_wgfpt0(); - init_f(); - init_gf(); - init_gft0(); -} - - -#if 0 -void s3vPrintSetupFlags(char *msg, GLuint flags ) -{ - fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n", - msg, - (int)flags, - (flags & S3V_XYZW_BIT) ? " xyzw," : "", - (flags & S3V_RGBA_BIT) ? " rgba," : "", - (flags & S3V_SPEC_BIT) ? " spec," : "", - (flags & S3V_FOG_BIT) ? " fog," : "", - (flags & S3V_TEX0_BIT) ? " tex-0," : "", - (flags & S3V_TEX1_BIT) ? " tex-1," : ""); -} -#endif - - -void s3vCheckTexSizes( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - - if (!setup_tab[vmesa->SetupIndex].check_tex_sizes(ctx)) { - - vmesa->SetupIndex |= (S3V_PTEX_BIT|S3V_RGBA_BIT); - - if (1 || !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - tnl->Driver.Render.Interp = setup_tab[vmesa->SetupIndex].interp; - tnl->Driver.Render.CopyPV = setup_tab[vmesa->SetupIndex].copy_pv; - } - } -} - -void s3vBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - GLubyte *v = ((GLubyte *)vmesa->verts + - (start<<vmesa->vertex_stride_shift)); - GLuint stride = 1<<vmesa->vertex_stride_shift; - - DEBUG(("*** s3vBuildVertices ***\n")); - DEBUG(("vmesa->SetupNewInputs = 0x%x\n", vmesa->SetupNewInputs)); - DEBUG(("vmesa->SetupIndex = 0x%x\n", vmesa->SetupIndex)); - -#if 1 - setup_tab[vmesa->SetupIndex].emit( ctx, start, count, v, stride ); -#else - newinputs |= vmesa->SetupNewInputs; - vmesa->SetupNewInputs = 0; - - DEBUG(("newinputs is 0x%x\n", newinputs)); - - if (!newinputs) { - DEBUG(("!newinputs\n")); - return; - } - - if (newinputs & VERT_CLIP) { - setup_tab[vmesa->SetupIndex].emit( ctx, start, count, v, stride ); - DEBUG(("newinputs & VERT_CLIP\n")); - return; - } /* else { */ -/* GLuint ind = 0; */ - - if (newinputs & VERT_RGBA) { - DEBUG(("newinputs & VERT_RGBA\n")); - ind |= S3V_RGBA_BIT; - } - - if (newinputs & VERT_TEX0) { - DEBUG(("newinputs & VERT_TEX0\n")); - ind |= S3V_TEX0_BIT; - } - - if (newinputs & VERT_FOG_COORD) - ind |= S3V_FOG_BIT; - - if (vmesa->SetupIndex & S3V_PTEX_BIT) - ind = ~0; - - ind &= vmesa->SetupIndex; - - DEBUG(("vmesa->SetupIndex = 0x%x\n", vmesa->SetupIndex)); - DEBUG(("ind = 0x%x\n", ind)); - DEBUG(("ind & vmesa->SetupIndex = 0x%x\n", (ind & vmesa->SetupIndex))); - - if (ind) { - setup_tab[ind].emit( ctx, start, count, v, stride ); - } -#endif -} - -void s3vChooseVertexState( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - - GLuint ind = S3V_XYZW_BIT | S3V_RGBA_BIT; - - /* FIXME: will segv in tnl_dd/t_dd_vbtmp.h (line 196) on some demos */ -/* - if (ctx->Fog.Enabled) - ind |= S3V_FOG_BIT; -*/ - - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - _tnl_need_projected_coords( ctx, GL_FALSE ); - ind |= S3V_TEX0_BIT; - } else { - _tnl_need_projected_coords( ctx, GL_TRUE ); - } - - vmesa->SetupIndex = ind; - - if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { - tnl->Driver.Render.Interp = s3v_interp_extras; - tnl->Driver.Render.CopyPV = s3v_copy_pv_extras; - } else { - tnl->Driver.Render.Interp = setup_tab[ind].interp; - tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; - } -} - - -void s3vInitVB( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - - vmesa->verts = (char *)ALIGN_MALLOC(size * 4 * 16, 32); - - { - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - vmesa->vertex_stride_shift = 6 /* 4 */; /* FIXME - only one vertex setup */ - } - } -} - - -void s3vFreeVB( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - if (vmesa->verts) { - ALIGN_FREE(vmesa->verts); - vmesa->verts = 0; - } - - if (vmesa->UbyteSecondaryColor.Ptr) { - ALIGN_FREE((void *)vmesa->UbyteSecondaryColor.Ptr); - vmesa->UbyteSecondaryColor.Ptr = 0; - } - - if (vmesa->UbyteColor.Ptr) { - ALIGN_FREE((void *)vmesa->UbyteColor.Ptr); - vmesa->UbyteColor.Ptr = 0; - } -} diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.h b/src/mesa/drivers/dri/s3v/s3v_vb.h deleted file mode 100644 index 0fd5437380..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_vb.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#ifndef S3VVB_INC -#define S3VVB_INC - -#include "main/mtypes.h" -#include "swrast/swrast.h" - -#define _S3V_NEW_VERTEX (_NEW_TEXTURE | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE) - - -extern void s3vChooseVertexState( GLcontext *ctx ); -extern void s3vCheckTexSizes( GLcontext *ctx ); -extern void s3vBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ); - - -extern void s3v_import_float_colors( GLcontext *ctx ); -extern void s3v_import_float_spec_colors( GLcontext *ctx ); - -extern void s3v_translate_vertex( GLcontext *ctx, - const s3vVertex *src, - SWvertex *dst ); - -extern void s3vInitVB( GLcontext *ctx ); -extern void s3vFreeVB( GLcontext *ctx ); - -extern void s3v_print_vertex( GLcontext *ctx, const s3vVertex *v ); -#if 0 -extern void s3vPrintSetupFlags(char *msg, GLuint flags ); -#endif - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c deleted file mode 100644 index 85f1481769..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_dri.h" -#include "main/context.h" -#include "main/matrix.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/viewport.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "vbo/vbo.h" - -/* #define DEBUG(str) printf str */ - -static const __DRIconfig ** -s3vInitScreen(__DRIscreen *sPriv) -{ - sPriv->private = (void *) s3vCreateScreen( sPriv ); - - if (!sPriv->private) { - s3vDestroyScreen( sPriv ); - return GL_FALSE; - } - - return NULL; -} - -static void -s3vDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - s3vContextPtr vmesa = (s3vContextPtr)driContextPriv->driverPrivate; - - if (vmesa) { - _swsetup_DestroyContext( vmesa->glCtx ); - _tnl_DestroyContext( vmesa->glCtx ); - _vbo_DestroyContext( vmesa->glCtx ); - _swrast_DestroyContext( vmesa->glCtx ); - - s3vFreeVB( vmesa->glCtx ); - - /* free the Mesa context */ - vmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(vmesa->glCtx); - - _mesa_free(vmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - s3vScreenPtr screen = (s3vScreenPtr) driScrnPriv->private; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->frontOffset, screen->frontPitch, - driDrawPriv); - s3vSetSpanFunctions(frontRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->backOffset, screen->backPitch, - driDrawPriv); - s3vSetSpanFunctions(backRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - backRb->backBuffer = GL_TRUE; - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - s3vSetSpanFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - else if (mesaVis->depthBits == 24) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - s3vSetSpanFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - /* no h/w stencil yet? - if (mesaVis->stencilBits > 0) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, - screen->cpp, screen->depthOffset, - screen->depthPitch, driDrawPriv); - s3vSetSpanFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - */ - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -s3vDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -s3vSwapBuffers(__DRIdrawablePrivate *drawablePrivate) -{ - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - __DRIscreenPrivate *sPriv; - GLcontext *ctx; - s3vContextPtr vmesa; - s3vScreenPtr s3vscrn; - - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; - sPriv = vmesa->driScreen; - s3vscrn = vmesa->s3vScreen; - ctx = vmesa->glCtx; - - DEBUG(("*** s3vSwapBuffers ***\n")); - -/* DMAFLUSH(); */ - - _mesa_notifySwapBuffers( ctx ); - - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; -/* driScrnPriv = vmesa->driScreen; */ - -/* if (vmesa->EnabledFlags & S3V_BACK_BUFFER) */ - -/* _mesa_notifySwapBuffers( ctx ); */ -#if 1 -{ - int x0, y0, x1, y1; -/* - int nRect = dPriv->numClipRects; - XF86DRIClipRectPtr pRect = dPriv->pClipRects; - - __DRIscreenPrivate *driScrnPriv = vmesa->driScreen; -*/ - -/* - DEBUG(("s3vSwapBuffers: S3V_BACK_BUFFER = 1 - nClip = %i\n", nRect)); -*/ -/* vmesa->drawOffset=vmesa->s3vScreen->backOffset; */ - - x0 = dPriv->x; - y0 = dPriv->y; - - x1 = x0 + dPriv->w - 1; - y1 = y0 + dPriv->h - 1; - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(vmesa->s3vScreen->backOffset); - DMAOUT(0); /* 0xc0000000 */ - DMAOUT( ((x0 << 16) | x1) ); - DMAOUT( ((y0 << 16) | y1) ); - DMAOUT( (vmesa->DestStride << 16) | vmesa->SrcStride ); - DMAOUT( (~(0)) ); - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(0); - /* FIXME */ - DMAOUT(0); - DMAOUT(0); - DMAOUT( (0x01 | /* Autoexecute */ - 0x02 | /* clip */ - 0x04 | /* 16 bit */ - 0x20 | /* draw */ - 0x400 | /* word alignment (bit 10=1) */ - (0x2 << 11) | /* offset = 1 byte */ - (0xCC << 17) | /* rop #204 */ - (0x3 << 25)) ); /* l-r, t-b */ - DMAOUT(vmesa->ScissorWH); - DMAOUT( /* 0 */ vmesa->SrcXY ); - DMAOUT( (dPriv->x << 16) | dPriv->y ); - DMAFINISH(); - - DMAFLUSH(); - - vmesa->restore_primitive = -1; - -} -#endif -} - -static GLboolean -s3vMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - int x1,x2,y1,y2; - int cx, cy, cw, ch; - unsigned int src_stride, dest_stride; - int cl; - - s3vContextPtr vmesa; - __DRIdrawablePrivate *dPriv = driDrawPriv; - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; - - DEBUG(("s3vMakeCurrent\n")); - - DEBUG(("dPriv->x=%i y=%i w=%i h=%i\n", dPriv->x, dPriv->y, - dPriv->w, dPriv->h)); - - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - s3vContextPtr oldVirgeCtx = ctx ? S3V_CONTEXT(ctx) : NULL; - s3vContextPtr newVirgeCtx = (s3vContextPtr) driContextPriv->driverPrivate; - - if ( newVirgeCtx != oldVirgeCtx ) { - - newVirgeCtx->dirty = ~0; - cl = 1; - DEBUG(("newVirgeCtx != oldVirgeCtx\n")); -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } - - if (newVirgeCtx->driDrawable != driDrawPriv) { - newVirgeCtx->driDrawable = driDrawPriv; - DEBUG(("driDrawable != driDrawPriv\n")); - s3vUpdateWindow ( newVirgeCtx->glCtx ); - s3vUpdateViewportOffset( newVirgeCtx->glCtx ); -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } -/* - s3vUpdateWindow ( newVirgeCtx->glCtx ); - s3vUpdateViewportOffset( newVirgeCtx->glCtx ); -*/ - -/* - _mesa_make_current( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, - newVirgeCtx->driDrawable->w, - newVirgeCtx->driDrawable->h); -*/ - -#if 0 - newVirgeCtx->Window &= ~W_GIDMask; - newVirgeCtx->Window |= (driDrawPriv->index << 5); - CHECK_DMA_BUFFER(newVirgeCtx,1); - WRITE(newVirgeCtx->buf, S3VWindow, newVirgeCtx->Window); -#endif - - newVirgeCtx->new_state |= S3V_NEW_WINDOW; /* FIXME */ - - _mesa_make_current( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - if (!newVirgeCtx->glCtx->Viewport.Width) { - _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } - -/* - if (cl) { - s3vUpdateClipping(newVirgeCtx->glCtx ); - cl =0; - } -*/ - - newVirgeCtx->new_state |= S3V_NEW_CLIP; - - if (1) { - cx = dPriv->x; - cw = dPriv->w; - cy = dPriv->y; - ch = dPriv->h; - } - - x1 = y1 = 0; - x2 = cw-1; - y2 = ch-1; - - /* src_stride = vmesa->s3vScreen->w * vmesa->s3vScreen->cpp; - dest_stride = ((x2+31)&~31) * vmesa->s3vScreen->cpp; */ - src_stride = vmesa->driScreen->fbWidth * 2; - dest_stride = ((x2+31)&~31) * 2; - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - - return GL_TRUE; -} - - -static GLboolean -s3vUnbindContext( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - -const struct __DriverAPIRec driDriverAPI = { - .InitScreen = s3vInitScreen, - .DestroyScreen = s3vDestroyScreen, - .CreateContext = s3vCreateContext, - .DestroyContext = s3vDestroyContext, - .CreateBuffer = s3vCreateBuffer, - .DestroyBuffer = s3vDestroyBuffer, - .SwapBuffers = s3vSwapBuffers, - .MakeCurrent = s3vMakeCurrent, - .UnbindContext = s3vUnbindContext, -}; diff --git a/src/mesa/drivers/dri/s3v/s3virgetri.h b/src/mesa/drivers/dri/s3v/s3virgetri.h deleted file mode 100644 index 5519cfd741..0000000000 --- a/src/mesa/drivers/dri/s3v/s3virgetri.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Author: Max Lingua <sunmax@libero.it> - */ - -#define LOCAL_VARS \ - int vert0, vert1, vert2; \ - GLfloat y0, y1, y2, ydiff; \ - int iy0, iy1, iy2; \ - int x0, x1, x2, z0, z1, z2; \ - int dy01, dy02, dy12, dx01, dx02, dx12; \ - int delt02, delt01, delt12, end01, end12, start02; \ - int zstart, arstart, gbstart; \ - int deltzy, deltzx, deltarx, deltgbx, deltary, deltgby; \ - GLubyte (*colours)[4]; \ - GLubyte (*scolours)[4]; \ - static int tp = 0; \ - int tmp, lr - -#define LOCAL_TEX_VARS \ - int u0, u1, u2; \ - GLfloat ru0, ru1, ru2; \ - int v0, v1, v2; \ - GLfloat rv0, rv1, rv2; \ - GLfloat w0, w1, w2; \ - GLfloat rw0, rw1, rw2; \ - int baseu, basev; \ - int d0, d1, d2; \ - int deltdx, deltvx, deltux, deltdy, deltvy, deltuy; \ - int deltwx, deltwy; \ - int rbaseu, rbasev; \ - int dstart, ustart, wstart, vstart; \ - static int stmp = 0; \ - s3virgeTextureObject_t *t - -#define CULL_BACKFACE() \ - do { \ - GLfloat *w0 = VB->Win.data[e0]; \ - GLfloat *w1 = VB->Win.data[e1]; \ - GLfloat *w2 = VB->Win.data[e2]; \ - float cull; \ - cull = ctx->backface_sign * ((w1[0] - w0[0]) * (w0[1] - w2[1]) + \ - (w1[1] - w0[1]) * (w2[0] - w0[0])); \ - if (cull < 0) \ - return; \ - } while (0) - -#define SORT_VERTICES() \ - do { \ - y0 = VB->Win.data[e0][1]; \ - y1 = VB->Win.data[e1][1]; \ - y2 = VB->Win.data[e2][1]; \ - if (y1 > y0) { \ - if (y2 > y0) { \ - vert0 = e0; \ - if (y1 > y2) { vert2 = e1; vert1 = e2; } else { vert2 = e2; vert1 = e1; } \ - } else { vert0 = e2; vert1 = e0; vert2 = e1; } \ - } else { \ - if (y2 > y0) { vert0 = e1; vert1 = e0; vert2 = e2; } else { \ - vert2 = e0; \ - if (y2 > y1) { vert0 = e1; vert1 = e2; } else { vert0 = e2; vert1 = e1; } \ - } \ - } \ - } while (0) - -#define SET_VARIABLES() \ - do { \ - iy0 = y0 = ((s3virgeDB->height - (VB->Win.data[vert0][1]))); \ - iy1 = y1 = ((s3virgeDB->height - (VB->Win.data[vert1][1]))); \ - iy2 = y2 = ((s3virgeDB->height - (VB->Win.data[vert2][1]))); \ - if (iy0 == iy2) { return; } \ - ydiff = y0 - (float)iy0; \ - x0 = ((VB->Win.data[vert0][0]) * 1024.0 * 1024.0); \ - x1 = ((VB->Win.data[vert1][0]) * 1024.0 * 1024.0); \ - x2 = ((VB->Win.data[vert2][0]) * 1024.0 * 1024.0); \ - z0 = (VB->Win.data[vert0][2] * 1024.0 * 32.0); \ - z1 = (VB->Win.data[vert1][2] * 1024.0 * 32.0); \ - z2 = (VB->Win.data[vert2][2] * 1024.0 * 32.0); \ - dx12 = x2 - x1; \ - dy12 = iy1 - iy2; \ - dx01 = x1 - x0; \ - dy01 = iy0 - iy1; \ - dx02 = x2 - x0; \ - dy02 = iy0 - iy2; \ - delt12 = delt02 = delt01 = 0; \ - } while (0) - -#define SET_TEX_VARIABLES() \ - do { \ - t = ((s3virgeTextureObject_t *)ctx->Texture.Unit[0].Current->DriverData); \ - deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \ - u0 = (VB->TexCoordPtr[0]->data[vert0][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \ - u1 = (VB->TexCoordPtr[0]->data[vert1][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \ - u2 = (VB->TexCoordPtr[0]->data[vert2][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \ - v0 = (VB->TexCoordPtr[0]->data[vert0][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \ - v1 = (VB->TexCoordPtr[0]->data[vert1][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \ - v2 = (VB->TexCoordPtr[0]->data[vert2][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \ - w0 = (VB->Win.data[vert0][3]); \ - w1 = (VB->Win.data[vert1][3]); \ - w2 = (VB->Win.data[vert2][3]); \ - } while (0) - -#define FLATSHADE_COLORS() \ - do { \ - GLubyte *col = &(colours[pv][0]); \ - deltarx = deltary = deltgbx = deltgby = 0; \ - gbstart = (((col[1]) << 23) | ((col[2]) << 7)); \ - arstart = (((col[3]) << 23) | ((col[0]) << 7)); \ - } while (0) - -#define GOURAUD_COLORS() \ - do { \ - int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *col0, *col1, *col2; \ - col0 = &(colours[vert0][0]); \ - col1 = &(colours[vert1][0]); \ - col2 = &(colours[vert2][0]); \ - ctmp = ((col2[3] - col0[3]) << 7) / dy02; \ - ctmp2 = ((col2[0] - col0[0]) << 7) / dy02; \ - deltary = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ - ctmp3 = ((col2[1] - col0[1]) << 7) / dy02; \ - ctmp4 = ((col2[2] - col0[2]) << 7) / dy02; \ - deltgby = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - gbstart = (((int)((ydiff * ctmp3) + (col0[1] << 7)) << 16) & 0x7FFF0000) | \ - ((int)((ydiff * ctmp4) + (col0[2] << 7)) & 0x7FFF); \ - arstart = (((int)((ydiff * ctmp) + (col0[3] << 7)) << 16) & 0x7FFF0000) | \ - ((int)((ydiff * ctmp2) + (col0[0] << 7)) & 0x7FFF); \ - if (tmp) { \ - int ax, rx, gx, bx; \ - ax = ((col1[3] << 7) - (dy01 * ctmp + (col0[3] << 7))) / tmp; \ - rx = ((col1[0] << 7) - (dy01 * ctmp2 + (col0[0] << 7))) / tmp; \ - gx = ((col1[1] << 7) - (dy01 * ctmp3 + (col0[1] << 7))) / tmp; \ - bx = ((col1[2] << 7) - (dy01 * ctmp4 + (col0[2] << 7))) / tmp; \ - deltarx = ((ax << 16) & 0xFFFF0000) | (rx & 0xFFFF); \ - deltgbx = ((gx << 16) & 0xFFFF0000) | (bx & 0xFFFF); \ - } else { \ - deltgbx = deltarx = 0; \ - } \ - } while (0) - -#define SET_XY() \ - do { \ - delt02 = dx02 / dy02; \ - if (dy12) delt12 = dx12 / dy12; \ - if (dy01) delt01 = dx01 / dy01; \ - start02 = (ydiff * delt02) + x0; \ - end01 = (ydiff * delt01) + x0; \ - end12 = ((y1 - (GLfloat)iy1) * delt12) + x1; \ - } while (0) - -#define SET_DIR() \ - do { \ - tmp = x1 - (dy01 * delt02 + x0); \ - if (tmp > 0) { \ - lr = 0x80000000; \ - } else { \ - tmp *= -1; \ - lr = 0; \ - } \ - tmp >>= 20; \ - } while (0) - -#define SET_Z() \ - do { \ - deltzy = (z2 - z0) / dy02; \ - if (tmp) { \ - deltzx = (z1 - (dy01 * deltzy + z0)) / tmp; \ - } else { deltzx = 0; } \ - zstart = (deltzy * ydiff) + z0; \ - } while (0) - -#define SET_BASEUV() \ - do { \ - if (u0 < u1) { \ - if (u0 < u2) { \ - baseu = u0; \ - } else { \ - baseu = u2; \ - } \ - } else { \ - if (u1 < u2) { \ - baseu = u1; \ - } else { \ - baseu = u2; \ - } \ - } \ - if (v0 < v1) { \ - if (v0 < v2) { \ - basev = v0; \ - } else { \ - basev = v2; \ - } \ - } else { \ - if (v1 < v2) { \ - basev = v1; \ - } else { \ - basev = v2; \ - } \ - } \ - } while (0) - -#define SET_RW() \ - do { \ - /* GLfloat minW; \ - if (w0 < w1) { \ - if (w0 < w2) { \ - minW = w0; \ - } else { \ - minW = w2; \ - } \ - } else { \ - if (w1 < w2) { \ - minW = w1; \ - } else { \ - minW = w2; \ - } \ - } */ \ - rw0 = (512.0 * w0); \ - rw1 = (512.0 * w1); \ - rw2 = (512.0 * w2); \ - } while (0) - - -#define SET_D() \ - do { \ - GLfloat sxy, suv; \ - int lev; \ - suv = (VB->TexCoordPtr[0]->data[vert0][0] - \ - VB->TexCoordPtr[0]->data[vert2][0]) * \ - (VB->TexCoordPtr[0]->data[vert1][1] - \ - VB->TexCoordPtr[0]->data[vert2][1]) - \ - (VB->TexCoordPtr[0]->data[vert1][0] - \ - VB->TexCoordPtr[0]->data[vert2][0]) * \ - (VB->TexCoordPtr[0]->data[vert0][1] - \ - VB->TexCoordPtr[0]->data[vert2][2]); \ - sxy = (VB->Win.data[vert0][0] - \ - VB->Win.data[vert2][0]) * \ - (VB->Win.data[vert1][1] - \ - VB->Win.data[vert2][1]) - \ - (VB->Win.data[vert1][0] - \ - VB->Win.data[vert2][0]) * \ - (VB->Win.data[vert0][1] - \ - VB->Win.data[vert2][2]); \ - if (sxy < 0) sxy *= -1.0; \ - if (suv < 0) suv *= -1.0; \ - lev = *(int*)&suv - *(int *)&sxy; \ - if (lev < 0) \ - lev = 0; \ - else \ - lev >>=23; \ - dstart = (lev << 27); \ - } while (0) - - - -#define SET_UVWD() \ - do { \ - SET_BASEUV(); \ - SET_RW(); \ - SET_D(); \ - ru0 = (((u0 - baseu) * rw0)); \ - ru1 = (((u1 - baseu) * rw1)); \ - ru2 = (((u2 - baseu) * rw2)); \ - rv0 = (((v0 - basev) * rw0)); \ - rv1 = (((v1 - basev) * rw1)); \ - rv2 = (((v2 - basev) * rw2)); \ - while (baseu < 0) { baseu += (t->tObj->Image[0]->Width << 8); } \ - while (basev < 0) { basev += (t->tObj->Image[0]->Height << 8); } \ - if (!(baseu & 0xFF)) { baseu = (baseu >> 8); } else { baseu = (baseu >> 8) + 1; } \ - if ((basev & 0x80) || !(basev & 0xFF)) { basev = (basev >> 8); } else { basev = (basev >> 8) - 1; } \ - rbaseu = (baseu) << (16 - t->widthLog2); \ - rbasev = (basev) << (16 - t->widthLog2); \ - deltuy = (((ru2 - ru0) / dy02)); \ - deltvy = (((rv2 - rv0) / dy02)); \ - rw0 *= (1024.0 * 512.0); \ - rw1 *= (1024.0 * 512.0); \ - rw2 *= (1024.0 * 512.0); \ - deltwy = ((rw2 - rw0) / dy02); \ - if (tmp) { \ - deltux = ((ru1 - (dy01 * deltuy + ru0)) / tmp); \ - deltvx = ((rv1 - (dy01 * deltvy + rv0)) / tmp); \ - deltwx = ((rw1 - (dy01 * deltwy + rw0)) / tmp); \ - } else { deltux = deltvx = deltwx = 0; } \ - ustart = (deltuy * ydiff) + (ru0); \ - vstart = (deltvy * ydiff) + (rv0); \ - wstart = (deltwy * ydiff) + (rw0); \ - } while (0) - - -#define SEND_COLORS() \ - do { \ - WAITFIFOEMPTY(6); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GBX), deltgbx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ARX), deltarx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GBY), deltgby); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ARY), deltary); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GS_BS), gbstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_AS_RS), arstart); \ - } while (0) - -#define SEND_VERTICES() \ - do { \ - WAITFIFOEMPTY(6); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZSTART), zstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZXD), deltzx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZYD), deltzy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA12), delt12); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXEND12), end12); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA01), delt01); \ - WAITFIFOEMPTY(5); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXEND01), end01); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA02), delt02); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXSTART02), start02); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TYS), iy0); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TY01_Y12), \ - ((((iy0 - iy1) & 0x7FF) << 16) | \ - ((iy1 - iy2) & 0x7FF) | lr)); \ - } while (0) - -#define SEND_UVWD() \ - do { \ - WAITFIFOEMPTY(7); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_BASEV), (rbasev & 0xFFFF)); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_BASEU), (0xa0000000 | (rbaseu & 0xFFFF))); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WXD), deltwx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WYD), deltwy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WSTART), wstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DXD), deltdx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VXD), deltvx); \ - WAITFIFOEMPTY(7); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_UXD), deltux); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DYD), deltdy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VYD), deltvy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_UYD), deltuy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DSTART), dstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VSTART), vstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_USTART), ustart); \ - } while (0) - -#define DMA_SEND_UVWD() \ - do { \ - DMAOUT((rbasev & 0xFFFF)); \ - DMAOUT((0xa0000000 | (rbaseu & 0xFFFF))); \ - DMAOUT(deltwx); \ - DMAOUT(deltwy); \ - DMAOUT(wstart); \ - DMAOUT(deltdx); \ - DMAOUT(deltvx); \ - DMAOUT(deltux); \ - DMAOUT(deltdy); \ - DMAOUT(deltvy); \ - DMAOUT(deltuy); \ - DMAOUT(dstart); \ - DMAOUT(vstart); \ - DMAOUT(ustart); \ - } while (0) - - -#define DMA_SEND_COLORS() \ - do { \ - DMAOUT(deltgbx); \ - DMAOUT(deltarx); \ - DMAOUT(deltgby); \ - DMAOUT(deltary); \ - DMAOUT(gbstart); \ - DMAOUT(arstart); \ - } while (0) - -#define DMA_SEND_VERTICES() \ - do { \ - DMAOUT(deltzx); \ - DMAOUT(deltzy); \ - DMAOUT(zstart); \ - DMAOUT(delt12); \ - DMAOUT(end12); \ - DMAOUT(delt01); \ - DMAOUT(end01); \ - DMAOUT(delt02); \ - DMAOUT(start02); \ - DMAOUT(iy0); \ - DMAOUT(((((iy0 - iy1) & 0x7FF) << 16) | \ - ((iy1 - iy2) & 0x7FF) | lr)); \ - } while (0) - diff --git a/src/mesa/drivers/dri/savage/Makefile b/src/mesa/drivers/dri/savage/Makefile index 018482f66b..2e5c40802c 100644 --- a/src/mesa/drivers/dri/savage/Makefile +++ b/src/mesa/drivers/dri/savage/Makefile @@ -27,4 +27,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile index d2354e6776..ad009fc239 100644 --- a/src/mesa/drivers/dri/sis/Makefile +++ b/src/mesa/drivers/dri/sis/Makefile @@ -34,4 +34,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/swrast/Makefile b/src/mesa/drivers/dri/swrast/Makefile index 5f3a4f2191..771169c1ff 100644 --- a/src/mesa/drivers/dri/swrast/Makefile +++ b/src/mesa/drivers/dri/swrast/Makefile @@ -21,4 +21,3 @@ SWRAST_COMMON_SOURCES = \ include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index a858af30c1..f4947daa06 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -43,6 +43,7 @@ #include "tnl/t_pipeline.h" #include "vbo/vbo.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "utils.h" #include "swrast_priv.h" @@ -62,6 +63,7 @@ #define need_GL_SGI_color_table /* sw extensions not associated with some GL version */ +#define need_GL_ARB_draw_elements_base_vertex #define need_GL_ARB_shader_objects #define need_GL_ARB_vertex_array_object #define need_GL_ARB_vertex_program @@ -95,6 +97,8 @@ const struct dri_extension card_extensions[] = { "GL_EXT_histogram", GL_EXT_histogram_functions }, { "GL_SGI_color_table", GL_SGI_color_table_functions }, + { "GL_ARB_depth_clamp", NULL }, + { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, { "GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions }, { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, @@ -109,8 +113,10 @@ const struct dri_extension card_extensions[] = { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions }, { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, + { "GL_NV_depth_clamp", NULL }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_fragment_program", GL_NV_fragment_program_functions }, + { "GL_NV_fragment_program_option", NULL }, { NULL, NULL } }; @@ -645,6 +651,8 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, _mesa_enable_2_0_extensions(mesaCtx); _mesa_enable_2_1_extensions(mesaCtx); + _mesa_meta_init(mesaCtx); + return ctx; } @@ -656,6 +664,7 @@ driDestroyContext(__DRIcontext *ctx) if (ctx) { mesaCtx = &ctx->Base; + _mesa_meta_free(mesaCtx); _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile index 092c580fea..b9f25db4fe 100644 --- a/src/mesa/drivers/dri/tdfx/Makefile +++ b/src/mesa/drivers/dri/tdfx/Makefile @@ -32,6 +32,4 @@ ASM_SOURCES = include ../Makefile.template -symlinks: - diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 1f7257eaea..f6a48b3ae1 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -176,6 +176,54 @@ logbase2(int n) } +static void +tdfxGenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + GLint mipWidth, mipHeight; + tdfxMipMapLevel *mip; + struct gl_texture_image *mipImage; /* the new/next image */ + struct gl_texture_image *texImage; + const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); + GLint level = texObj->BaseLevel; + GLsizei width, height, texelBytes; + const tdfxMipMapLevel *mml; + + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + assert(!texImage->IsCompressed); + + mml = TDFX_TEXIMAGE_DATA(texImage); + + width = texImage->Width; + height = texImage->Height; + while (level < texObj->MaxLevel && level < maxLevels - 1) { + mipWidth = width / 2; + if (!mipWidth) { + mipWidth = 1; + } + mipHeight = height / 2; + if (!mipHeight) { + mipHeight = 1; + } + if ((mipWidth == width) && (mipHeight == height)) { + break; + } + ++level; + mipImage = _mesa_select_tex_image(ctx, texObj, target, level); + mip = TDFX_TEXIMAGE_DATA(mipImage); + _mesa_halve2x2_teximage2d(ctx, + texImage, + texelBytes, + mml->width, mml->height, + texImage->Data, mipImage->Data); + texImage = mipImage; + mml = mip; + width = mipWidth; + height = mipHeight; + } +} + + /* * Compute various texture image parameters. * Input: w, h - source texture width and height @@ -1397,45 +1445,6 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, width, height, 1, format, type, pixels, packing); } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - GLint mipWidth, mipHeight; - tdfxMipMapLevel *mip; - struct gl_texture_image *mipImage; - const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - - assert(!texImage->IsCompressed); - - while (level < texObj->MaxLevel && level < maxLevels - 1) { - mipWidth = width / 2; - if (!mipWidth) { - mipWidth = 1; - } - mipHeight = height / 2; - if (!mipHeight) { - mipHeight = 1; - } - if ((mipWidth == width) && (mipHeight == height)) { - break; - } - _mesa_TexImage2D(target, ++level, internalFormat, - mipWidth, mipHeight, border, - format, type, - NULL); - mipImage = _mesa_select_tex_image(ctx, texObj, target, level); - mip = TDFX_TEXIMAGE_DATA(mipImage); - _mesa_halve2x2_teximage2d(ctx, - texImage, - texelBytes, - mml->width, mml->height, - texImage->Data, mipImage->Data); - texImage = mipImage; - mml = mip; - width = mipWidth; - height = mipHeight; - } - } } RevalidateTexture(ctx, texObj); @@ -1507,44 +1516,6 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, format, type, pixels, packing); } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - GLint mipWidth, mipHeight; - tdfxMipMapLevel *mip; - struct gl_texture_image *mipImage; - const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - - assert(!texImage->IsCompressed); - - width = texImage->Width; - height = texImage->Height; - while (level < texObj->MaxLevel && level < maxLevels - 1) { - mipWidth = width / 2; - if (!mipWidth) { - mipWidth = 1; - } - mipHeight = height / 2; - if (!mipHeight) { - mipHeight = 1; - } - if ((mipWidth == width) && (mipHeight == height)) { - break; - } - ++level; - mipImage = _mesa_select_tex_image(ctx, texObj, target, level); - mip = TDFX_TEXIMAGE_DATA(mipImage); - _mesa_halve2x2_teximage2d(ctx, - texImage, - texelBytes, - mml->width, mml->height, - texImage->Data, mipImage->Data); - texImage = mipImage; - mml = mip; - width = mipWidth; - height = mipHeight; - } - } - ti->reloadImages = GL_TRUE; /* signal the image needs to be reloaded */ fxMesa->new_state |= TDFX_NEW_TEXTURE; /* XXX this might be a bit much */ } @@ -1703,11 +1674,6 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, MEMCPY(texImage->Data, data, texImage->CompressedSize); } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - assert(!texImage->IsCompressed); - } - RevalidateTexture(ctx, texObj); ti->reloadImages = GL_TRUE; @@ -1770,11 +1736,6 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, texImage->Data); } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - assert(!texImage->IsCompressed); - } - RevalidateTexture(ctx, texObj); ti->reloadImages = GL_TRUE; @@ -1914,4 +1875,5 @@ void tdfxInitTextureFuncs( struct dd_function_table *functions ) functions->CompressedTexImage2D = tdfxCompressedTexImage2D; functions->CompressedTexSubImage2D = tdfxCompressedTexSubImage2D; functions->UpdateTexturePalette = tdfxUpdateTexturePalette; + functions->GenerateMipmap = tdfxGenerateMipmap; } diff --git a/src/mesa/drivers/dri/trident/Makefile b/src/mesa/drivers/dri/trident/Makefile deleted file mode 100644 index 9ee24c504c..0000000000 --- a/src/mesa/drivers/dri/trident/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# src/mesa/drivers/dri/trident/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = trident_dri.so - -# Not yet -# MINIGLX_SOURCES = server/trident_dri.c - -DRIVER_SOURCES = \ - trident_context.c \ - trident_state.c \ - trident_vb.c \ - trident_dd.c \ - trident_tris.c - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -include ../Makefile.template - -symlinks: diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c deleted file mode 100644 index b5126b07ea..0000000000 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_dri.h" -#include "trident_context.h" -#include "trident_lock.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "main/context.h" -#include "main/simple_list.h" -#include "main/matrix.h" -#include "main/extensions.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/viewport.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif -#include "main/simple_list.h" -#include "main/mm.h" -#include "drirenderbuffer.h" - -#include "drivers/common/driverfuncs.h" -#include "dri_util.h" -#include "utils.h" - -static const struct tnl_pipeline_stage *trident_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_render_stage, - 0, -}; - - -static GLboolean -tridentCreateContext( const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) -{ - GLcontext *ctx, *shareCtx; - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - tridentContextPtr tmesa; - tridentScreenPtr tridentscrn; - struct dd_function_table functions; -#if 0 - drm_trident_sarea_t *saPriv=(drm_trident_sarea_t *)(((char*)sPriv->pSAREA)+ - sizeof(XF86DRISAREARec)); -#endif - - tmesa = (tridentContextPtr) CALLOC( sizeof(*tmesa) ); - if ( !tmesa ) return GL_FALSE; - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((tridentContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - _mesa_init_driver_functions(&functions); - - tmesa->glCtx = - _mesa_create_context(glVisual, shareCtx, &functions, (void *)tmesa); - - if (!tmesa->glCtx) { - FREE(tmesa); - return GL_FALSE; - } - - tmesa->driContext = driContextPriv; - tmesa->driScreen = sPriv; - tmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ - - tmesa->hHWContext = driContextPriv->hHWContext; - tmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock; - tmesa->driFd = sPriv->fd; -#if 0 - tmesa->sarea = saPriv; -#endif - - tridentscrn = tmesa->tridentScreen = (tridentScreenPtr)(sPriv->private); - - ctx = tmesa->glCtx; - - ctx->Const.MaxTextureLevels = 13; /* 4K by 4K? Is that right? */ - ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */ - - ctx->Const.MinLineWidth = 0.0; - ctx->Const.MaxLineWidth = 255.0; - - ctx->Const.MinLineWidthAA = 0.0; - ctx->Const.MaxLineWidthAA = 65536.0; - - ctx->Const.MinPointSize = 0.0; - ctx->Const.MaxPointSize = 255.0; - - ctx->Const.MinPointSizeAA = 0.5; /* 4x4 quality mode */ - ctx->Const.MaxPointSizeAA = 16.0; - ctx->Const.PointSizeGranularity = 0.25; - - ctx->Const.MaxDrawBuffers = 1; - -#if 0 - tmesa->texHeap = mmInit( 0, tmesa->tridentScreen->textureSize ); - - make_empty_list(&tmesa->TexObjList); - make_empty_list(&tmesa->SwappedOut); - - tmesa->CurrentTexObj[0] = 0; - tmesa->CurrentTexObj[1] = 0; /* Permedia 3, second texture */ - - tmesa->RenderIndex = ~0; -#endif - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* Install the customized pipeline: - */ - _tnl_destroy_pipeline( ctx ); - _tnl_install_pipeline( ctx, trident_pipeline ); - - /* Configure swrast to match hardware characteristics: - */ - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); - - tridentInitVB( ctx ); - tridentDDInitExtensions( ctx ); - tridentDDInitDriverFuncs( ctx ); - tridentDDInitStateFuncs( ctx ); -#if 0 - tridentDDInitSpanFuncs( ctx ); - tridentDDInitTextureFuncs( ctx ); -#endif - tridentDDInitTriFuncs( ctx ); - tridentDDInitState( tmesa ); - - driContextPriv->driverPrivate = (void *)tmesa; - - UNLOCK_HARDWARE(tmesa); - - return GL_TRUE; -} - -static void -tridentDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - tridentContextPtr tmesa = (tridentContextPtr)driContextPriv->driverPrivate; - - if (tmesa) { - _swsetup_DestroyContext( tmesa->glCtx ); - _tnl_DestroyContext( tmesa->glCtx ); - _vbo_DestroyContext( tmesa->glCtx ); - _swrast_DestroyContext( tmesa->glCtx ); - - /* free the Mesa context */ - tmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(tmesa->glCtx); - - _mesa_free(tmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - tridentScreenPtr screen = (tridentScreenPtr) driScrnPriv->private; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->frontOffset, screen->frontPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(frontRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->backOffset, screen->backPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(backRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(depthRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - else if (mesaVis->depthBits == 24) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(depthRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - /* no h/w stencil? - if (mesaVis->stencilBits > 0 && !swStencil) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT); - tridentSetSpanFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - */ - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -tridentDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -tridentSwapBuffers(__DRIdrawablePrivate *drawablePrivate) -{ - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - tridentContextPtr tmesa; - GLcontext *ctx; - tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate; - ctx = tmesa->glCtx; - if (ctx->Visual.doubleBufferMode) { - _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ - tridentCopyBuffer( dPriv ); - } - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "tridentSwapBuffers: drawable has no context!\n"); - } -} - -static GLboolean -tridentMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - tridentContextPtr oldCtx = ctx ? TRIDENT_CONTEXT(ctx) : NULL; - tridentContextPtr newCtx = (tridentContextPtr) driContextPriv->driverPrivate; - - if ( newCtx != oldCtx ) { - newCtx->dirty = ~0; - } - - if (newCtx->driDrawable != driDrawPriv) { - newCtx->driDrawable = driDrawPriv; -#if 0 - tridentUpdateWindow ( newCtx->glCtx ); - tridentUpdateViewportOffset( newCtx->glCtx ); -#endif - } - - newCtx->drawOffset = newCtx->tridentScreen->backOffset; - newCtx->drawPitch = newCtx->tridentScreen->backPitch; - - _mesa_make_current( newCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - if (!newCtx->glCtx->Viewport.Width) { - _mesa_set_viewport(newCtx->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - } - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - return GL_TRUE; -} - - -static GLboolean -tridentUnbindContext( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - - -static tridentScreenPtr -tridentCreateScreen( __DRIscreenPrivate *sPriv ) -{ - TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv; - tridentScreenPtr tridentScreen; - - if (sPriv->devPrivSize != sizeof(TRIDENTDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(TRIDENTDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area */ - tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) ); - if ( !tridentScreen ) return NULL; - - tridentScreen->driScreen = sPriv; - - tridentScreen->frontOffset = tDRIPriv->frontOffset; - tridentScreen->backOffset = tDRIPriv->backOffset; - tridentScreen->depthOffset = tDRIPriv->depthOffset; - tridentScreen->frontPitch = tDRIPriv->frontPitch; - tridentScreen->backPitch = tDRIPriv->backPitch; - tridentScreen->depthPitch = tDRIPriv->depthPitch; - tridentScreen->width = tDRIPriv->width; - tridentScreen->height = tDRIPriv->height; - -printf("%d %d\n",tridentScreen->width,tridentScreen->height); -printf("%d %d\n",tridentScreen->frontPitch,tridentScreen->backPitch); -printf("offset 0x%x 0x%x\n",tridentScreen->backOffset,tridentScreen->depthOffset); - - tridentScreen->mmio.handle = tDRIPriv->regs; - tridentScreen->mmio.size = 0x20000; - - if (drmMap(sPriv->fd, - tridentScreen->mmio.handle, tridentScreen->mmio.size, - (drmAddressPtr)&tridentScreen->mmio.map)) { - FREE(tridentScreen); - return GL_FALSE; - } -printf("MAPPED at %p\n", tridentScreen->mmio.map); - - return tridentScreen; -} - -/* Destroy the device specific screen private data struct. - */ -static void -tridentDestroyScreen( __DRIscreenPrivate *sPriv ) -{ - tridentScreenPtr tridentScreen = (tridentScreenPtr)sPriv->private; - - FREE(tridentScreen); -} - -static GLboolean -tridentInitDriver(__DRIscreenPrivate *sPriv) -{ - sPriv->private = (void *) tridentCreateScreen( sPriv ); - - if (!sPriv->private) { - tridentDestroyScreen( sPriv ); - return GL_FALSE; - } - - return GL_TRUE; -} - -/** - * This is the driver specific part of the createNewScreen entry point. - * - * \todo maybe fold this into intelInitDriver - * - * \return the __GLcontextModes supported by this driver - */ -const __DRIconfig **tridentInitScreen(__DRIscreenPrivate *psp) -{ - static const __DRIversion ddx_expected = { 4, 0, 0 }; - static const __DRIversion dri_expected = { 3, 1, 0 }; - static const __DRIversion drm_expected = { 1, 0, 0 }; - - if ( ! driCheckDriDdxDrmVersions2( "Trident", - &psp->dri_version, & dri_expected, - &psp->ddx_version, & ddx_expected, - &psp->drm_version, & drm_expected ) ) - return NULL; - - if (!tridentInitDriver(psp)) - return NULL; - - /* Wait... what? This driver doesn't report any modes... */ -#if 0 - TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv; - *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8, - GL_TRUE ); -#endif - - return NULL; -} - -const struct __DriverAPIRec driDriverAPI = { - tridentInitScreen, - tridentDestroyScreen, - tridentCreateContext, - tridentDestroyContext, - tridentCreateBuffer, - tridentDestroyBuffer, - tridentSwapBuffers, - tridentMakeCurrent, - tridentUnbindContext, -}; diff --git a/src/mesa/drivers/dri/trident/trident_context.h b/src/mesa/drivers/dri/trident/trident_context.h deleted file mode 100644 index fbbb4a96e7..0000000000 --- a/src/mesa/drivers/dri/trident/trident_context.h +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> - * - * Trident CyberBladeXP driver. - * - */ -#ifndef _TRIDENT_CONTEXT_H_ -#define _TRIDENT_CONTEXT_H_ - -#include "dri_util.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "drm.h" -#include "main/mm.h" - -#define SUBPIXEL_X (0.0F) -#define SUBPIXEL_Y (0.125F) - -#define _TRIDENT_NEW_VERTEX (_NEW_TEXTURE | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE) - -#define TRIDENT_FALLBACK_TEXTURE 0x01 -#define TRIDENT_FALLBACK_DRAW_BUFFER 0x02 - -#define TRIDENT_NEW_CLIP 0x01 - -#define TRIDENT_UPLOAD_COMMAND_D 0x00000001 -#define TRIDENT_UPLOAD_CONTEXT 0x04000000 -#define TRIDENT_UPLOAD_CLIPRECTS 0x80000000 - -#define TAG(x) trident##x -#include "tnl_dd/t_dd_vertex.h" -#undef TAG - -/* these require that base be dword-aligned */ -static INLINE void MMIO_OUT32(unsigned char *base, unsigned int offset, - unsigned int val) -{ - unsigned int *addr = (unsigned int *)(base + offset); - *addr = val; -} - -static INLINE unsigned int MMIO_IN32(unsigned char *base, unsigned int offset) -{ - unsigned int *addr = (unsigned int *)(base + offset); - return *addr; -} - -#define MMIO_OUT8(base, offset, val) *((base) + (offset)) = (val) -#define MMIO_IN8(base, offset) *((base) + (offset)) - -struct trident_context; -typedef struct trident_context tridentContextRec; -typedef struct trident_context *tridentContextPtr; - -typedef void (*trident_quad_func)( tridentContextPtr, - const tridentVertex *, - const tridentVertex *, - const tridentVertex *, - const tridentVertex * ); -typedef void (*trident_tri_func)( tridentContextPtr, - const tridentVertex *, - const tridentVertex *, - const tridentVertex * ); -typedef void (*trident_line_func)( tridentContextPtr, - const tridentVertex *, - const tridentVertex * ); -typedef void (*trident_point_func)( tridentContextPtr, - const tridentVertex * ); - -typedef struct { - drm_handle_t handle; /* Handle to the DRM region */ - drmSize size; /* Size of the DRM region */ - unsigned char *map; /* Mapping of the DRM region */ -} tridentRegionRec, *tridentRegionPtr; - -typedef struct { - __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */ - - drmBufMapPtr buffers; - - unsigned int frontOffset; - unsigned int frontPitch; - unsigned int backOffset; - unsigned int backPitch; - unsigned int depthOffset; - unsigned int depthPitch; - unsigned int width; - unsigned int height; - unsigned int cpp; - -#if 0 - unsigned int sarea_priv_offset; -#endif - - tridentRegionRec mmio; -} tridentScreenRec, *tridentScreenPtr; - -/** - * tridentRenderbuffer, derived from Mesa's gl_renderbuffer - */ -typedef struct { - struct gl_renderbuffer Base; - /* XXX per-window info should go here */ - int foo, bar; -} tridentRenderbuffer; - - -struct trident_context { - GLcontext *glCtx; /* Mesa context */ - - __DRIcontextPrivate *driContext; - __DRIscreenPrivate *driScreen; - __DRIdrawablePrivate *driDrawable; - - GLuint new_gl_state; - GLuint new_state; - GLuint dirty; - -#if 0 - drm_trident_sarea_t *sarea; -#endif - - /* Temporaries for translating away float colors: - */ - struct gl_client_array UbyteColor; - struct gl_client_array UbyteSecondaryColor; - - /* Mirrors of some DRI state - */ - int lastStamp; /* mirror driDrawable->lastStamp */ - - drm_context_t hHWContext; - drmLock *driHwLock; - int driFd; - - tridentScreenPtr tridentScreen; /* Screen private DRI data */ - - /* Visual, drawable, cliprect and scissor information - */ - GLenum DrawBuffer; - GLint drawOffset, drawPitch; - GLint drawX, drawY; /* origin of drawable in draw buffer */ - GLint readOffset, readPitch; - - GLuint numClipRects; /* Cliprects for the draw buffer */ - drm_clip_rect_t *pClipRects; - - GLint scissor; - drm_clip_rect_t ScissorRect; /* Current software scissor */ - - GLuint Fallback; - GLuint RenderIndex; - GLuint SetupNewInputs; - GLuint SetupIndex; - GLfloat hw_viewport[16]; - GLfloat depth_scale; - GLuint vertex_format; - GLuint vertex_size; - GLuint vertex_stride_shift; - GLubyte *verts; - - GLint tmu_source[2]; - - GLuint hw_primitive; - GLenum render_primitive; - - trident_point_func draw_point; - trident_line_func draw_line; - trident_tri_func draw_tri; - trident_quad_func draw_quad; - -#if 0 - gammaTextureObjectPtr CurrentTexObj[2]; - struct gamma_texture_object_t TexObjList; - struct gamma_texture_object_t SwappedOut; - GLenum TexEnvImageFmt[2]; - - struct mem_block *texHeap; - - int lastSwap; - int texAge; - int ctxAge; - int dirtyAge; - int lastStamp; -#endif - - /* Chip state */ - - int commandD; - - /* Context State */ - - int ClearColor; -}; - -void tridentDDInitExtensions( GLcontext *ctx ); -void tridentDDInitDriverFuncs( GLcontext *ctx ); -void tridentDDInitSpanFuncs( GLcontext *ctx ); -void tridentDDInitState( tridentContextPtr tmesa ); -void tridentInitHW( tridentContextPtr tmesa ); -void tridentDDInitStateFuncs( GLcontext *ctx ); -void tridentDDInitTextureFuncs( GLcontext *ctx ); -void tridentDDInitTriFuncs( GLcontext *ctx ); - -extern void tridentBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ); -extern void tridentInitVB( GLcontext *ctx ); -extern void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv ); -extern void tridentFallback( tridentContextPtr tmesa, GLuint bit, - GLboolean mode ); -extern void tridentCheckTexSizes( GLcontext *ctx ); -extern void tridentChooseVertexState( GLcontext *ctx ); -extern void tridentDDUpdateHWState( GLcontext *ctx ); -extern void tridentUploadHwStateLocked( tridentContextPtr tmesa ); - -#define TRIDENT_CONTEXT(ctx) ((tridentContextPtr)(ctx->DriverCtx)) - -#endif /* _TRIDENT_CONTEXT_H_ */ diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c deleted file mode 100644 index faa40c36a2..0000000000 --- a/src/mesa/drivers/dri/trident/trident_dd.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_context.h" -#include "trident_lock.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif - -#include "swrast/swrast.h" -#include "main/context.h" -#include "main/framebuffer.h" - -#define TRIDENT_DATE "20041223" - -/* Return the width and height of the current color buffer. - */ -static void tridentDDGetBufferSize( GLframebuffer *framebuffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - LOCK_HARDWARE(tmesa); - *width = tmesa->driDrawable->w; - *height = tmesa->driDrawable->h; - UNLOCK_HARDWARE(tmesa); -} - - -/* Return various strings for glGetString(). - */ -static const GLubyte *tridentDDGetString( GLcontext *ctx, GLenum name ) -{ - static char buffer[128]; - - switch ( name ) { - case GL_VENDOR: - return (GLubyte *)"Alan Hourihane"; - - case GL_RENDERER: - sprintf( buffer, "Mesa DRI Trident " TRIDENT_DATE ); - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - return (GLubyte *)buffer; - - default: - return NULL; - } -} - -/* Enable the extensions supported by this driver. - */ -void tridentDDInitExtensions( GLcontext *ctx ) -{ - /* None... */ -} - -/* Initialize the driver's misc functions. - */ -void tridentDDInitDriverFuncs( GLcontext *ctx ) -{ - ctx->Driver.GetBufferSize = tridentDDGetBufferSize; - ctx->Driver.GetString = tridentDDGetString; - ctx->Driver.Error = NULL; -} diff --git a/src/mesa/drivers/dri/trident/trident_dri.h b/src/mesa/drivers/dri/trident/trident_dri.h deleted file mode 100644 index c1ce3c4682..0000000000 --- a/src/mesa/drivers/dri/trident/trident_dri.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _TRIDENT_DRI_ -#define _TRIDENT_DRI_ - -#include "xf86drm.h" - -typedef struct { - drm_handle_t regs; - drmSize regsSize; - drmAddress regsMap; - int deviceID; - int width; - int height; - int mem; - int frontOffset; - int frontPitch; - int backOffset; - int backPitch; - int depthOffset; - int depthPitch; - int cpp; -#if 0 - int textureOffset; - int textureSize; -#endif - unsigned int sarea_priv_offset; -} TRIDENTDRIRec, *TRIDENTDRIPtr; - -#endif diff --git a/src/mesa/drivers/dri/trident/trident_lock.h b/src/mesa/drivers/dri/trident/trident_lock.h deleted file mode 100644 index ee0819f5ca..0000000000 --- a/src/mesa/drivers/dri/trident/trident_lock.h +++ /dev/null @@ -1,11 +0,0 @@ -/* XXX tridentGetLock doesn't exist... */ - -#define LOCK_HARDWARE(tmesa) \ - do { \ - char __ret = 0; \ - DRM_CAS(tmesa->driHwLock, tmesa->hHWContext, \ - DRM_LOCK_HELD | tmesa->hHWContext, __ret); \ - } while (0) - -#define UNLOCK_HARDWARE(tmesa) \ - DRM_UNLOCK(tmesa->driFd, tmesa->driHwLock, tmesa->hHWContext) diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c deleted file mode 100644 index e68d3a73c6..0000000000 --- a/src/mesa/drivers/dri/trident/trident_state.c +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_context.h" -#include "trident_lock.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "main/framebuffer.h" - -#define TRIDENTPACKCOLOR332(r, g, b) \ - (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6)) - -#define TRIDENTPACKCOLOR1555(r, g, b, a) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) - -#define TRIDENTPACKCOLOR565(r, g, b) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) - -#define TRIDENTPACKCOLOR888(r, g, b) \ - (((r) << 16) | ((g) << 8) | (b)) - -#define TRIDENTPACKCOLOR8888(r, g, b, a) \ - (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) - -#define TRIDENTPACKCOLOR4444(r, g, b, a) \ - ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) - -static INLINE GLuint tridentPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) -{ - switch ( cpp ) { - case 2: - return TRIDENTPACKCOLOR565( r, g, b ); - case 4: - return TRIDENTPACKCOLOR8888( r, g, b, a ); - default: - return 0; - } -} - -void tridentUploadHwStateLocked( tridentContextPtr tmesa ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; -#if 0 - ATISAREAPrivPtr sarea = tmesa->sarea; - trident_context_regs_t *regs = &(sarea->ContextState); -#endif - - if ( tmesa->dirty & TRIDENT_UPLOAD_COMMAND_D ) { - MMIO_OUT32(MMIO, 0x00281C, tmesa->commandD ); - tmesa->dirty &= ~TRIDENT_UPLOAD_COMMAND_D; - } - - if ( tmesa->dirty & TRIDENT_UPLOAD_CLIPRECTS ) { - /* XXX FIX ME ! */ - MMIO_OUT32(MMIO, 0x002C80 , 0x20008000 | tmesa->tridentScreen->height ); - MMIO_OUT32(MMIO, 0x002C84 , 0x20000000 | tmesa->tridentScreen->width ); - tmesa->dirty &= ~TRIDENT_UPLOAD_CLIPRECTS; - } - - tmesa->dirty = 0; -} - -/* Copy the back color buffer to the front color buffer. - */ -void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv ) -{ - unsigned char *MMIO; - tridentContextPtr tmesa; - GLint nbox, i; - int busy; - drm_clip_rect_t *pbox; - - assert(dPriv); - assert(dPriv->driContextPriv); - assert(dPriv->driContextPriv->driverPrivate); - - tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate; - MMIO = tmesa->tridentScreen->mmio.map; - - LOCK_HARDWARE( tmesa ); - - /* use front buffer cliprects */ - nbox = dPriv->numClipRects; - pbox = dPriv->pClipRects; - - for ( i = 0 ; i < nbox ; i++ ) { -#if 0 - GLint nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS , nbox ); - drm_clip_rect_t *b = tmesa->sarea->boxes; - GLint n = 0; - - for ( ; i < nr ; i++ ) { - *b++ = pbox[i]; - n++; - } - tmesa->sarea->nbox = n; -#endif - - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->frontPitch << 20 | tmesa->tridentScreen->frontOffset>>4); - MMIO_OUT32(MMIO, 0x2154, tmesa->tridentScreen->backPitch << 20 | tmesa->tridentScreen->backOffset>>4); - MMIO_OUT8(MMIO, 0x2127, 0xCC); /* Copy Rop */ - MMIO_OUT32(MMIO, 0x2128, 0x4); /* scr2scr */ - MMIO_OUT32(MMIO, 0x2138, (pbox->x1 << 16) | pbox->y1); - MMIO_OUT32(MMIO, 0x213C, (pbox->x1 << 16) | pbox->y1); - MMIO_OUT32(MMIO, 0x2140, (pbox->x2 - pbox->x1) << 16 | (pbox->y2 - pbox->y1) ); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } - } - - UNLOCK_HARDWARE( tmesa ); - -#if 0 - tmesa->dirty |= (MACH64_UPLOAD_CONTEXT | - MACH64_UPLOAD_MISC | - MACH64_UPLOAD_CLIPRECTS); -#endif -} - - -static void tridentDDClear( GLcontext *ctx, GLbitfield mask ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - int busy; - GLuint flags = 0; - GLint i; - GLint cx, cy, cw, ch; - -#define DRM_TRIDENT_FRONT 0x01 -#define DRM_TRIDENT_BACK 0x02 -#define DRM_TRIDENT_DEPTH 0x04 - - if ( tmesa->new_state ) - tridentDDUpdateHWState( ctx ); - - if ( mask & BUFFER_BIT_FRONT_LEFT ) { - flags |= DRM_TRIDENT_FRONT; - mask &= ~BUFFER_BIT_FRONT_LEFT; - } - - if ( mask & BUFFER_BIT_BACK_LEFT ) { - flags |= DRM_TRIDENT_BACK; - mask &= ~BUFFER_BIT_BACK_LEFT; - } - - if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) { - flags |= DRM_TRIDENT_DEPTH; - mask &= ~BUFFER_BIT_DEPTH; - } - - LOCK_HARDWARE(tmesa); - - /* get region after locking: */ - cx = ctx->DrawBuffer->_Xmin; - cy = ctx->DrawBuffer->_Ymin; - cw = ctx->DrawBuffer->_Xmax - cx; - ch = ctx->DrawBuffer->_Ymax - cy; - - if ( flags ) { - - cx += tmesa->drawX; - cy += tmesa->drawY; - - /* HACK!!! - */ - if ( tmesa->dirty & ~TRIDENT_UPLOAD_CLIPRECTS ) { - tridentUploadHwStateLocked( tmesa ); - } - - for ( i = 0 ; i < tmesa->numClipRects ; i++ ) { -#if 0 - int nr = MIN2( i + TRIDENT_NR_SAREA_CLIPRECTS, tmesa->numClipRects ); - drm_clip_rect_t *box = tmesa->pClipRects; - drm_clip_rect_t *b = tmesa->sarea->boxes; - GLint n = 0; - - if ( !all ) { - for ( ; i < nr ; i++ ) { - GLint x = box[i].x1; - GLint y = box[i].y1; - GLint w = box[i].x2 - x; - GLint h = box[i].y2 - y; - - if ( x < cx ) w -= cx - x, x = cx; - if ( y < cy ) h -= cy - y, y = cy; - if ( x + w > cx + cw ) w = cx + cw - x; - if ( y + h > cy + ch ) h = cy + ch - y; - if ( w <= 0 ) continue; - if ( h <= 0 ) continue; - - b->x1 = x; - b->y1 = y; - b->x2 = x + w; - b->y2 = y + h; - b++; - n++; - } - } else { - for ( ; i < nr ; i++ ) { - *b++ = box[i]; - n++; - } - } - - tmesa->sarea->nbox = n; -#endif - -if (flags & DRM_TRIDENT_BACK) { - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->backPitch << 20 | tmesa->tridentScreen->backOffset>>4); - MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */ - MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor); - MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */ - MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy); - MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } -} -if (flags & DRM_TRIDENT_DEPTH) { - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->depthPitch << 20 | tmesa->tridentScreen->depthOffset>>4); - MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */ - MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor); - MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */ - MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy); - MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } -} - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->frontPitch << 20 | tmesa->tridentScreen->frontOffset>>4); -if (flags & DRM_TRIDENT_FRONT) { - MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */ - MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor); - MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */ - MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy); - MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } -} - - } - -#if 0 - tmesa->dirty |= (TRIDENT_UPLOAD_CONTEXT | - TRIDENT_UPLOAD_MISC | - TRIDENT_UPLOAD_CLIPRECTS); -#endif - } - - UNLOCK_HARDWARE(tmesa); - - if ( mask ) - _swrast_Clear( ctx, mask ); -} - -static void tridentDDShadeModel( GLcontext *ctx, GLenum mode ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - GLuint s = tmesa->commandD; - -#define TRIDENT_FLAT_SHADE 0x000000E0 -#define TRIDENT_FLAT_SHADE_VERTEX_C 0x00000060 -#define TRIDENT_FLAT_SHADE_GOURAUD 0x00000080 - - s &= ~TRIDENT_FLAT_SHADE; - - switch ( mode ) { - case GL_FLAT: - s |= TRIDENT_FLAT_SHADE_VERTEX_C; - break; - case GL_SMOOTH: - s |= TRIDENT_FLAT_SHADE_GOURAUD; - break; - default: - return; - } - - if ( tmesa->commandD != s ) { - tmesa->commandD = s; - - tmesa->dirty |= TRIDENT_UPLOAD_COMMAND_D; - } -} - -static void -tridentCalcViewport( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - const GLfloat *v = ctx->Viewport._WindowMap.m; - GLfloat *m = tmesa->hw_viewport; - - /* See also trident_translate_vertex. - */ - m[MAT_SX] = v[MAT_SX]; - m[MAT_TX] = v[MAT_TX] + tmesa->drawX + SUBPIXEL_X; - m[MAT_SY] = - v[MAT_SY]; - m[MAT_TY] = - v[MAT_TY] + tmesa->driDrawable->h + tmesa->drawY + SUBPIXEL_Y; -#if 0 - m[MAT_SZ] = v[MAT_SZ] * tmesa->depth_scale; - m[MAT_TZ] = v[MAT_TZ] * tmesa->depth_scale; -#else - m[MAT_SZ] = v[MAT_SZ]; - m[MAT_TZ] = v[MAT_TZ]; -#endif - - tmesa->SetupNewInputs = ~0; -} - -static void tridentDDViewport( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - tridentCalcViewport( ctx ); -} - -static void tridentDDDepthRange( GLcontext *ctx, - GLclampd nearval, GLclampd farval ) -{ - tridentCalcViewport( ctx ); -} - -static void -tridentSetCliprects( tridentContextPtr tmesa, GLenum mode ) -{ - __DRIdrawablePrivate *dPriv = tmesa->driDrawable; - - switch ( mode ) { - case GL_FRONT_LEFT: - if (dPriv->numClipRects == 0) { - static drm_clip_rect_t zeroareacliprect = {0,0,0,0}; - tmesa->numClipRects = 1; - tmesa->pClipRects = &zeroareacliprect; - } else { - tmesa->numClipRects = dPriv->numClipRects; - tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pClipRects; - } - tmesa->drawX = dPriv->x; - tmesa->drawY = dPriv->y; - break; - case GL_BACK_LEFT: - if ( dPriv->numBackClipRects == 0 ) { - if (dPriv->numClipRects == 0) { - static drm_clip_rect_t zeroareacliprect = {0,0,0,0}; - tmesa->numClipRects = 1; - tmesa->pClipRects = &zeroareacliprect; - } else { - tmesa->numClipRects = dPriv->numClipRects; - tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pClipRects; - tmesa->drawX = dPriv->x; - tmesa->drawY = dPriv->y; - } - } - else { - tmesa->numClipRects = dPriv->numBackClipRects; - tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pBackClipRects; - tmesa->drawX = dPriv->backX; - tmesa->drawY = dPriv->backY; - } - break; - default: - return; - } - -#if 0 - tmesa->dirty |= TRIDENT_UPLOAD_CLIPRECTS; -#endif -} - -#if 0 -static GLboolean tridentDDSetDrawBuffer( GLcontext *ctx, GLenum mode ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - int found = GL_TRUE; - - if ( tmesa->DrawBuffer != mode ) { - tmesa->DrawBuffer = mode; - - switch ( mode ) { - case GL_FRONT_LEFT: - tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_FALSE ); - tmesa->drawOffset = tmesa->tridentScreen->frontOffset; - tmesa->drawPitch = tmesa->tridentScreen->frontPitch; - tridentSetCliprects( tmesa, GL_FRONT_LEFT ); - break; - case GL_BACK_LEFT: - tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_FALSE ); - tmesa->drawOffset = tmesa->tridentScreen->backOffset; - tmesa->drawPitch = tmesa->tridentScreen->backPitch; - tridentSetCliprects( tmesa, GL_BACK_LEFT ); - break; - default: - tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_TRUE ); - found = GL_FALSE; - break; - } - -#if 0 - tmesa->setup.dst_off_pitch = (((tmesa->drawPitch/8) << 22) | - (tmesa->drawOffset >> 3)); - - tmesa->dirty |= MACH64_UPLOAD_DST_OFF_PITCH | MACH64_UPLOAD_CONTEXT; -#endif - - } - - return found; -} - -static void tridentDDClearColor( GLcontext *ctx, - const GLchan color[4] ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - tmesa->ClearColor = tridentPackColor( tmesa->tridentScreen->cpp, - color[0], color[1], - color[2], color[3] ); -} -#endif - -static void -tridentDDUpdateState( GLcontext *ctx, GLuint new_state ) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - TRIDENT_CONTEXT(ctx)->new_gl_state |= new_state; -} - - -/* Initialize the context's hardware state. - */ -void tridentDDInitState( tridentContextPtr tmesa ) -{ - tmesa->new_state = 0; - - switch ( tmesa->glCtx->Visual.depthBits ) { - case 16: - tmesa->depth_scale = 1.0 / (GLfloat)0xffff; - break; - case 24: - tmesa->depth_scale = 1.0 / (GLfloat)0xffffff; - break; - } -} - -void tridentDDUpdateHWState( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - int new_state = tmesa->new_state; - - if ( new_state ) - { - tmesa->new_state = 0; - -#if 0 - /* Update the various parts of the context's state. - */ - if ( new_state & GAMMA_NEW_ALPHA ) - tridentUpdateAlphaMode( ctx ); - - if ( new_state & GAMMA_NEW_DEPTH ) - tridentUpdateZMode( ctx ); - - if ( new_state & GAMMA_NEW_FOG ) - gammaUpdateFogAttrib( ctx ); - - if ( new_state & GAMMA_NEW_CLIP ) - gammaUpdateClipping( ctx ); - - if ( new_state & GAMMA_NEW_POLYGON ) - gammaUpdatePolygon( ctx ); - - if ( new_state & GAMMA_NEW_CULL ) - gammaUpdateCull( ctx ); - - if ( new_state & GAMMA_NEW_MASKS ) - gammaUpdateMasks( ctx ); - - if ( new_state & GAMMA_NEW_STIPPLE ) - gammaUpdateStipple( ctx ); -#endif - } - - /* HACK ! */ - -#if 0 - gammaEmitHwState( tmesa ); -#endif -} - -/* Initialize the driver's state functions. - */ -void tridentDDInitStateFuncs( GLcontext *ctx ) -{ - ctx->Driver.UpdateState = tridentDDUpdateState; - - ctx->Driver.Clear = tridentDDClear; - ctx->Driver.DepthRange = tridentDDDepthRange; - ctx->Driver.ShadeModel = tridentDDShadeModel; - ctx->Driver.Viewport = tridentDDViewport; -} diff --git a/src/mesa/drivers/dri/trident/trident_tris.c b/src/mesa/drivers/dri/trident/trident_tris.c deleted file mode 100644 index ee85ab482c..0000000000 --- a/src/mesa/drivers/dri/trident/trident_tris.c +++ /dev/null @@ -1,1125 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> - * - * Trident CyberBladeXP driver. - * - */ - -#include "trident_context.h" -#include "trident_lock.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" - -static int first = 1; - -typedef struct reg { - int addr; - int data; -} RegData; - -RegData initRegData[]={ - {0x2804, 0x19980824}, - {0x2F70, 0x46455858}, - {0x2F74, 0x41584998}, - {0x2F00, 0x00000000}, - {0x2F04, 0x80000800}, - {0x2F08, 0x00550200}, - {0x2F40, 0x00000001}, - {0x2F40, 0x00000001}, - {0x2F44, 0x00830097}, - {0x2F48, 0x0087009F}, - {0x2F4C, 0x00BF0003}, - {0x2F50, 0xF00B6C1B}, - {0x2C04, 0x00000000}, - {0x2D00, 0x00000080}, - {0x2D00, 0x00000000}, - {0x2DD4, 0x00100000}, - {0x2DD4, 0x00100010}, - {0x2DD8, 0x00100000}, - {0x2DD8, 0x00100010}, - {0x2C88, 0xFFFFFFFF}, - {0x2C94 , 0xFFFFFFFF}, - {0x281C, 0x00008000}, - {0x2C80, 0x00000000}, - {0x2C80, 0x00000000}, - {0x2C80 , 0x00008000}, - {0x2C00 , 0x00000000}, - {0x2C04 , 0x00000000}, - {0x2C08 , 0x00000000}, - {0x2C0C , 0x00000000}, - {0x2C10 , 0x00000000}, - {0x2C14 , 0x00000000}, - {0x2C18 , 0x00000000}, - {0x2C1C , 0x00000000}, - {0x2C20 , 0x00000000}, - {0x2C24 , 0x00000000}, - {0x2C2C , 0x00000000}, - {0x2C30 , 0x00000000}, - {0x2C34 , 0x00000000}, - {0x2C38 , 0x00000000}, - {0x2C3C , 0x00000000}, - {0x2C40 , 0x00000000}, - {0x2C44 , 0x00000000}, - {0x2C48 , 0x00000000}, - {0x2C4C , 0x00000000}, - {0x2C50 , 0x00000000}, - {0x2C54 , 0x00000000}, - {0x2C58 , 0x00000000}, - {0x2C5C , 0x00000000}, - {0x2C60 , 0x00000000}, - {0x2C64 , 0x00000000}, - {0x2C68 , 0x00000000}, - {0x2C6C , 0x00000000}, - {0x2C70 , 0x00000000}, - {0x2C74 , 0x00000000}, - {0x2C78 , 0x00000000}, - {0x2C7C , 0x00000000}, - {0x2C80 , 0x00008000}, - {0x2C84 , 0x00000000}, - {0x2C88 , 0xFFFFFFFF}, - {0x2C8C , 0x00000000}, - {0x2C90 , 0x00000000}, - {0x2C94 , 0xFFFFFFFF}, - {0x2C98 , 0x00000000}, - {0x2C9C , 0x00000000}, - {0x2CA0 , 0x00000000}, - {0x2CA4 , 0x00000000}, - {0x2CA8 , 0x00000000}, - {0x2CAC , 0x00000000}, - {0x2CB0 , 0x00000000}, - {0x2CB4 , 0x00000000}, - {0x2CB8 , 0x00000000}, - {0x2CBC , 0x00000000}, - {0x2CC0 , 0x00000000}, - {0x2CC4 , 0x00000000}, - {0x2CC8 , 0x00000000}, - {0x2CCC , 0x00000000}, - {0x2CD0 , 0x00000000}, - {0x2CD4 , 0x00000000}, - {0x2CD8 , 0x00000000}, - {0x2CDC , 0x00000000}, - {0x2CE0 , 0x00000000}, - {0x2CE4 , 0x00000000}, - {0x2CE8 , 0x00000000}, - {0x2CEC , 0x00000000}, - {0x2CF0 , 0x00000000}, - {0x2CF4 , 0x00000000}, - {0x2CF8 , 0x00000000}, - {0x2CFC , 0x00000000}, - {0x2D00 , 0x00000000}, - {0x2D04 , 0x00000000}, - {0x2D08 , 0x00000000}, - {0x2D0C , 0x00000000}, - {0x2D10 , 0x00000000}, - {0x2D14 , 0x00000000}, - {0x2D18 , 0x00000000}, - {0x2D1C , 0x00000000}, - {0x2D20 , 0x00000000}, - {0x2D24 , 0x00000000}, - {0x2D28 , 0x00000000}, - {0x2D2C , 0x00000000}, - {0x2D30 , 0x00000000}, - {0x2D34 , 0x00000000}, - {0x2D38 , 0x00000000}, - {0x2D3C , 0x00000000}, - {0x2D40 , 0x00000000}, - {0x2D44 , 0x00000000}, - {0x2D48 , 0x00000000}, - {0x2D4C , 0x00000000}, - {0x2D50 , 0x00000000}, - {0x2D54 , 0x00000000}, - {0x2D58 , 0x00000000}, - {0x2D5C , 0x00000000}, - {0x2D60 , 0x00000000}, - {0x2D64 , 0x00000000}, - {0x2D68 , 0x00000000}, - {0x2D6C , 0x00000000}, - {0x2D70 , 0x00000000}, - {0x2D74 , 0x00000000}, - {0x2D78 , 0x00000000}, - {0x2D7C , 0x00000000}, - {0x2D80 , 0x00000000}, - {0x2D84 , 0x00000000}, - {0x2D88 , 0x00000000}, - {0x2D8C , 0x00000000}, - {0x2D90 , 0x00000000}, - {0x2D94 , 0x00000000}, - {0x2D98 , 0x00000000}, - {0x2D9C , 0x00000000}, - {0x2DA0 , 0x00000000}, - {0x2DA4 , 0x00000000}, - {0x2DA8 , 0x00000000}, - {0x2DAC , 0x00000000}, - {0x2DB0 , 0x00000000}, - {0x2DB4 , 0x00000000}, - {0x2DB8 , 0x00000000}, - {0x2DBC , 0x00000000}, - {0x2DC0 , 0x00000000}, - {0x2DC4 , 0x00000000}, - {0x2DC8 , 0x00000000}, - {0x2DCC , 0x00000000}, - {0x2DD0 , 0x00000000}, - {0x2DD4 , 0x00100010}, - {0x2DD8 , 0x00100010}, - {0x2DDC , 0x00000000}, - {0x2DE0 , 0x00000000}, - {0x2DE4 , 0x00000000}, - {0x2DE8 , 0x00000000}, - {0x2DEC , 0x00000000}, - {0x2DF0 , 0x00000000}, - {0x2DF4 , 0x00000000}, - {0x2DF8 , 0x00000000}, - {0x2DFC , 0x00000000}, - {0x2E00 , 0x00000000}, - {0x2E04 , 0x00000000}, - {0x2E08 , 0x00000000}, - {0x2E0C , 0x00000000}, - {0x2E10 , 0x00000000}, - {0x2E14 , 0x00000000}, - {0x2E18 , 0x00000000}, - {0x2E1C , 0x00000000}, - {0x2E20 , 0x00000000}, - {0x2E24 , 0x00000000}, - {0x2E28 , 0x00000000}, - {0x2E2C , 0x00000000}, - {0x2E30 , 0x00000000}, - {0x2E34 , 0x00000000}, - {0x2E38 , 0x00000000}, - {0x2E3C , 0x00000000}, - {0x2E40 , 0x00000000}, - {0x2E44 , 0x00000000}, - {0x2E48 , 0x00000000}, - {0x2E4C , 0x00000000}, - {0x2E50 , 0x00000000}, - {0x2E54 , 0x00000000}, - {0x2E58 , 0x00000000}, - {0x2E5C , 0x00000000}, - {0x2E60 , 0x00000000}, - {0x2E64 , 0x00000000}, - {0x2E68 , 0x00000000}, - {0x2E6C , 0x00000000}, - {0x2E70 , 0x00000000}, - {0x2E74 , 0x00000000}, - {0x2E78 , 0x00000000}, - {0x2E7C , 0x00000000}, - {0x2E80 , 0x00000000}, - {0x2E84 , 0x00000000}, - {0x2E88 , 0x00000000}, - {0x2E8C , 0x00000000}, - {0x2E90 , 0x00000000}, - {0x2E94 , 0x00000000}, - {0x2E98 , 0x00000000}, - {0x2E9C , 0x00000000}, - {0x2EA0 , 0x00000000}, - {0x2EA4 , 0x00000000}, - {0x2EA8 , 0x00000000}, - {0x2EAC , 0x00000000}, - {0x2EB0 , 0x00000000}, - {0x2EB4 , 0x00000000}, - {0x2EB8 , 0x00000000}, - {0x2EBC , 0x00000000}, - {0x2EC0 , 0x00000000}, - {0x2EC4 , 0x00000000}, - {0x2EC8 , 0x00000000}, - {0x2ECC , 0x00000000}, - {0x2ED0 , 0x00000000}, - {0x2ED4 , 0x00000000}, - {0x2ED8 , 0x00000000}, - {0x2EDC , 0x00000000}, - {0x2EE0 , 0x00000000}, - {0x2EE4 ,0x00000000}, - {0x2EE8 ,0x00000000}, - {0x2EEC , 0x00000000}, - {0x2EF0 , 0x00000000}, - {0x2EF4 , 0x00000000}, - {0x2EF8 , 0x00000000}, - {0x2EFC , 0x00000000}, - /*{0x2F60 , 0x00000000},*/ -}; - -int initRegDataNum=sizeof(initRegData)/sizeof(RegData); - -typedef union { - unsigned int i; - float f; -} dmaBufRec, *dmaBuf; - -void Init3D( tridentContextPtr tmesa ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - int i; - - for(i=0;i<initRegDataNum;++i) - MMIO_OUT32(MMIO, initRegData[i].addr, initRegData[i].data); -} - -int DrawTriangle( tridentContextPtr tmesa) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - dmaBufRec clr; - -printf("DRAW TRI\n"); - Init3D(tmesa); - -printf("ENGINE STATUS 0x%x\n",MMIO_IN32(MMIO, 0x2800)); - MMIO_OUT32(MMIO, 0x002800, 0x00000000 ); -#if 0 - MMIO_OUT32(MMIO, 0x002368 , MMIO_IN32(MMIO,0x002368)|1 ); -#endif - - MMIO_OUT32(MMIO, 0x002C00 , 0x00000014 ); -#if 0 - MMIO_OUT32(MMIO, 0x002C04 , 0x0A8004C0 ); -#else - MMIO_OUT32(MMIO, 0x002C04 , 0x0A8000C0 ); -#endif - -#if 0 - MMIO_OUT32(MMIO, 0x002C08 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C0C , 0xFFCCCCCC ); - MMIO_OUT32(MMIO, 0x002C10 , 0x3F800000 ); - MMIO_OUT32(MMIO, 0x002C14 , 0x3D0D3DCB ); - MMIO_OUT32(MMIO, 0x002C2C , 0x70000000 ); - MMIO_OUT32(MMIO, 0x002C24 , 0x00202C00 ); - MMIO_OUT32(MMIO, 0x002C28 , 0xE0002500 ); - MMIO_OUT32(MMIO, 0x002C30 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C34 , 0xE0000000 ); - MMIO_OUT32(MMIO, 0x002C38 , 0x00000000 ); -#endif - - MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C54 , 0x0C320C80 ); - MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C54 , 0x0C320C80 ); - MMIO_OUT32(MMIO, 0x002C80 , 0x20008258 ); - MMIO_OUT32(MMIO, 0x002C84 , 0x20000320 ); - MMIO_OUT32(MMIO, 0x002C94 , 0xFFFFFFFF ); - -#if 0 - MMIO_OUT32(MMIO, 0x002D00 , 0x00009009 ); - MMIO_OUT32(MMIO, 0x002D38 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002D94 , 0x20002000 ); - MMIO_OUT32(MMIO, 0x002D50 , 0xf0000000 ); - MMIO_OUT32(MMIO, 0x002D80 , 0x24002000 ); - MMIO_OUT32(MMIO, 0x002D98 , 0x81000000 ); - MMIO_OUT32(MMIO, 0x002DB0 , 0x81000000 ); - MMIO_OUT32(MMIO, 0x002DC8 , 0x808000FF ); - MMIO_OUT32(MMIO, 0x002DD4 , 0x02000200 ); - MMIO_OUT32(MMIO, 0x002DD8 , 0x02000200 ); - MMIO_OUT32(MMIO, 0x002D30 , 0x02092400 ); - MMIO_OUT32(MMIO, 0x002D04 , 0x00102120 ); - MMIO_OUT32(MMIO, 0x002D08 , 0xFFFFFFFF ); - MMIO_OUT32(MMIO, 0x002D0C , 0xF00010D0 ); - MMIO_OUT32(MMIO, 0x002D10 , 0xC0000400 ); -#endif - - MMIO_OUT32(MMIO, 0x002814, 0x00000000 ); -#if 0 - MMIO_OUT32(MMIO, 0x002818 , 0x00036C20 ); -#else - MMIO_OUT32(MMIO, 0x002818 , 0x00036020 ); -#endif - MMIO_OUT32(MMIO, 0x00281C , 0x00098081 ); - -printf("first TRI\n"); - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 595.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0x00FF00 ); -#if 0 - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0xFF0000 ); -#if 0 - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - - clr.f = 395.0; -printf("0x%x\n",clr.i); - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0xFF ); -#if 0 - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - -printf("sec TRI\n"); - MMIO_OUT32(MMIO, 0x00281C , 0x00093980 ); - clr.f = 395.0; - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 595.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0x00FF00 ); -#if 0 - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - -#if 0 - MMIO_OUT32(MMIO, 0x002368 , MMIO_IN32(MMIO,0x002368)&0xfffffffe ); -#endif - -printf("fin TRI\n"); - - return 0; -} - -static INLINE void trident_draw_point(tridentContextPtr tmesa, - const tridentVertex *v0 ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - (void) MMIO; -} - -static INLINE void trident_draw_line( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1 ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - (void) MMIO; -} - -static INLINE void trident_draw_triangle( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2 ) -{ -} - -static INLINE void trident_draw_quad( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2, - const tridentVertex *v3 ) -{ - GLuint vertsize = tmesa->vertex_size; - GLint coloridx = (vertsize > 4) ? 4 : 3; - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - int clr; - float *ftmp = (float *)(&clr); - - if (tmesa->dirty) - tridentUploadHwStateLocked( tmesa ); -#if 0 - DrawTriangle(tmesa); - exit(0); -#else -#if 1 - if (first) { - Init3D(tmesa); -#if 0 - DrawTriangle(tmesa); -#endif - first = 0; - } -#endif - - LOCK_HARDWARE( tmesa ); - - MMIO_OUT32(MMIO, 0x002C00 , 0x00000010 ); - MMIO_OUT32(MMIO, 0x002C04 , 0x029C00C0 ); - - /* Z buffer */ - MMIO_OUT32(MMIO, 0x002C24 , 0x00100000 /*| (tmesa->tridentScreen->depthOffset)*/ ); - MMIO_OUT32(MMIO, 0x002C28 , 0xE0000000 | (tmesa->tridentScreen->depthPitch * 4) ); - - /* front buffer */ - MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 | (tmesa->drawOffset) ); - MMIO_OUT32(MMIO, 0x002C54 , 0x0C320000 | (tmesa->drawPitch * 4) ); - - /* clipper */ - MMIO_OUT32(MMIO, 0x002C80 , 0x20008000 | tmesa->tridentScreen->height ); - MMIO_OUT32(MMIO, 0x002C84 , 0x20000000 | tmesa->tridentScreen->width ); - - /* writemask */ - MMIO_OUT32(MMIO, 0x002C94 , 0xFFFFFFFF ); - -if (vertsize == 4) { - MMIO_OUT32(MMIO, 0x002818 , 0x0003A020 ); - MMIO_OUT32(MMIO, 0x00281C , 0x00098021 ); - - *ftmp = v0->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v0->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v0->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v0->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v0->ui[coloridx] ); - - *ftmp = v1->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v1->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v1->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v1->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v1->ui[coloridx] ); - - *ftmp = v2->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v2->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v2->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v2->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v2->ui[coloridx] ); - - MMIO_OUT32(MMIO, 0x00281C , 0x00093020 ); - *ftmp = v3->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v3->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v3->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v3->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v3->ui[coloridx] ); - -} -#endif - - UNLOCK_HARDWARE( tmesa ); -} -/*********************************************************************** - * Rasterization fallback helpers * - ***********************************************************************/ - - -/* This code is hit only when a mix of accelerated and unaccelerated - * primitives are being drawn, and only for the unaccelerated - * primitives. - */ -#if 0 -static void -trident_fallback_quad( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2, - const tridentVertex *v3 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[4]; - trident_translate_vertex( ctx, v0, &v[0] ); - trident_translate_vertex( ctx, v1, &v[1] ); - trident_translate_vertex( ctx, v2, &v[2] ); - trident_translate_vertex( ctx, v3, &v[3] ); - _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] ); -} -#endif - -/* XXX hack to get the prototype defined in time... */ -void trident_translate_vertex(GLcontext *ctx, const tridentVertex *src, - SWvertex *dst); - -static void -trident_fallback_tri( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[3]; - trident_translate_vertex( ctx, v0, &v[0] ); - trident_translate_vertex( ctx, v1, &v[1] ); - trident_translate_vertex( ctx, v2, &v[2] ); - _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); -} - -static void -trident_fallback_line( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[2]; - trident_translate_vertex( ctx, v0, &v[0] ); - trident_translate_vertex( ctx, v1, &v[1] ); - _swrast_Line( ctx, &v[0], &v[1] ); -} - - -static void -trident_fallback_point( tridentContextPtr tmesa, - const tridentVertex *v0 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[1]; - trident_translate_vertex( ctx, v0, &v[0] ); - _swrast_Point( ctx, &v[0] ); -} - -/*********************************************************************** - * Macros for t_dd_tritmp.h to draw basic primitives * - ***********************************************************************/ - -#define TRI( a, b, c ) \ -do { \ - if (DO_FALLBACK) \ - tmesa->draw_tri( tmesa, a, b, c ); \ - else \ - trident_draw_triangle( tmesa, a, b, c ); \ -} while (0) - -#define QUAD( a, b, c, d ) \ -do { \ - if (DO_FALLBACK) { \ - tmesa->draw_tri( tmesa, a, b, d ); \ - tmesa->draw_tri( tmesa, b, c, d ); \ - } else \ - trident_draw_quad( tmesa, a, b, c, d ); \ -} while (0) - -#define LINE( v0, v1 ) \ -do { \ - if (DO_FALLBACK) \ - tmesa->draw_line( tmesa, v0, v1 ); \ - else \ - trident_draw_line( tmesa, v0, v1 ); \ -} while (0) - -#define POINT( v0 ) \ -do { \ - if (DO_FALLBACK) \ - tmesa->draw_point( tmesa, v0 ); \ - else \ - trident_draw_point( tmesa, v0 ); \ -} while (0) - -/*********************************************************************** - * Build render functions from dd templates * - ***********************************************************************/ - -#define TRIDENT_OFFSET_BIT 0x01 -#define TRIDENT_TWOSIDE_BIT 0x02 -#define TRIDENT_UNFILLED_BIT 0x04 -#define TRIDENT_FALLBACK_BIT 0x08 -#define TRIDENT_MAX_TRIFUNC 0x10 - - -static struct { - tnl_points_func points; - tnl_line_func line; - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[TRIDENT_MAX_TRIFUNC]; - - -#define DO_FALLBACK (IND & TRIDENT_FALLBACK_BIT) -#define DO_OFFSET (IND & TRIDENT_OFFSET_BIT) -#define DO_UNFILLED (IND & TRIDENT_UNFILLED_BIT) -#define DO_TWOSIDE (IND & TRIDENT_TWOSIDE_BIT) -#define DO_FLAT 0 -#define DO_TRI 1 -#define DO_QUAD 1 -#define DO_LINE 1 -#define DO_POINTS 1 -#define DO_FULL_QUAD 1 - -#define HAVE_RGBA 1 -#define HAVE_SPEC 1 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX tridentVertex -#define TAB rast_tab - -#define DEPTH_SCALE 1.0 -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define VERT_X(_v) _v->v.x -#define VERT_Y(_v) _v->v.y -#define VERT_Z(_v) _v->v.z -#define AREA_IS_CCW( a ) (a > 0) -#define GET_VERTEX(e) (tmesa->verts + (e<<tmesa->vertex_stride_shift)) - -#define TRIDENT_COLOR( dst, src ) \ -do { \ - dst[0] = src[2]; \ - dst[1] = src[1]; \ - dst[2] = src[0]; \ - dst[3] = src[3]; \ -} while (0) - -#define TRIDENT_SPEC( dst, src ) \ -do { \ - dst[0] = src[2]; \ - dst[1] = src[1]; \ - dst[2] = src[0]; \ -} while (0) - -#define VERT_SET_RGBA( v, c ) TRIDENT_COLOR( v->ub4[coloroffset], c ) -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset] -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx] - -#define VERT_SET_SPEC( v, c ) if (havespec) TRIDENT_SPEC( v->ub4[5], c ) -#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V(v0->ub4[5], v1->ub4[5]) -#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5] -#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx] - -#define LOCAL_VARS(n) \ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); \ - GLuint color[n], spec[n]; \ - GLuint coloroffset = (tmesa->vertex_size == 4 ? 3 : 4); \ - GLboolean havespec = (tmesa->vertex_size == 4 ? 0 : 1); \ - (void) color; (void) spec; (void) coloroffset; (void) havespec; -/*********************************************************************** - * Helpers for rendering unfilled primitives * - ***********************************************************************/ -#if 0 -static const GLuint hw_prim[GL_POLYGON+1] = { - B_PrimType_Points, - B_PrimType_Lines, - B_PrimType_Lines, - B_PrimType_Lines, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles -}; -#endif - -static void tridentResetLineStipple( GLcontext *ctx ); -#if 0 -static void tridentRasterPrimitive( GLcontext *ctx, GLuint hwprim ); -#endif -static void tridentRenderPrimitive( GLcontext *ctx, GLenum prim ); - -#define RASTERIZE(x) /*if (tmesa->hw_primitive != hw_prim[x]) \ - tridentRasterPrimitive( ctx, hw_prim[x] ) */ -#define RENDER_PRIMITIVE tmesa->render_primitive -#define TAG(x) x -#define IND TRIDENT_FALLBACK_BIT -#include "tnl_dd/t_dd_unfilled.h" -#undef IND - -/*********************************************************************** - * Generate GL render functions * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_offset_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_offset_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_offset_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_offset_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -static void init_rast_tab( void ) -{ - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); - init_fallback(); - init_offset_fallback(); - init_twoside_fallback(); - init_twoside_offset_fallback(); - init_unfilled_fallback(); - init_offset_unfilled_fallback(); - init_twoside_unfilled_fallback(); - init_twoside_offset_unfilled_fallback(); -} - - -/**********************************************************************/ -/* Render unclipped begin/end objects */ -/**********************************************************************/ - -#define VERT(x) (tridentVertex *)(tridentverts + (x << shift)) -#define RENDER_POINTS( start, count ) \ - for ( ; start < count ; start++) \ - trident_draw_point( tmesa, VERT(start) ) -#define RENDER_LINE( v0, v1 ) \ - trident_draw_line( tmesa, VERT(v0), VERT(v1) ) -#define RENDER_TRI( v0, v1, v2 ) \ - trident_draw_triangle( tmesa, VERT(v0), VERT(v1), VERT(v2) ) -#define RENDER_QUAD( v0, v1, v2, v3 ) \ - trident_draw_quad( tmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) -#define INIT(x) tridentRenderPrimitive( ctx, x ); -#undef LOCAL_VARS -#define LOCAL_VARS \ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); \ - const GLuint shift = tmesa->vertex_stride_shift; \ - const char *tridentverts = (char *)tmesa->verts; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ - (void) elt; -#define RESET_STIPPLE if ( stipple ) tridentResetLineStipple( ctx ); -#define RESET_OCCLUSION -#define PRESERVE_VB_DEFS -#define ELT(x) (x) -#define TAG(x) trident_##x##_verts -#include "tnl/t_vb_rendertmp.h" -#undef ELT -#undef TAG -#define TAG(x) trident_##x##_elts -#define ELT(x) elt[x] -#include "tnl/t_vb_rendertmp.h" - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - -static void tridentRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint prim = tmesa->render_primitive; - - /* Render the new vertices as an unclipped polygon. - */ - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; - } - - /* Restore the render primitive - */ - if (prim != GL_POLYGON) - tnl->Driver.Render.PrimitiveNotify( ctx, prim ); -} - -static void tridentRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} - - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - -#define _TRIDENT_NEW_RENDER_STATE (_DD_NEW_LINE_STIPPLE | \ - _DD_NEW_LINE_SMOOTH | \ - _DD_NEW_POINT_SMOOTH | \ - _DD_NEW_TRI_SMOOTH | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET) \ - - -#define POINT_FALLBACK (DD_POINT_SMOOTH) -#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH) -#define TRI_FALLBACK (DD_TRI_SMOOTH) -#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK) -#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) - - -static void tridentChooseRenderState(GLcontext *ctx) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint index = 0; - - if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) { - tmesa->draw_point = trident_draw_point; - tmesa->draw_line = trident_draw_line; - tmesa->draw_tri = trident_draw_triangle; - - if (flags & ANY_RASTER_FLAGS) { - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= TRIDENT_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= TRIDENT_OFFSET_BIT; - if (flags & DD_TRI_UNFILLED) index |= TRIDENT_UNFILLED_BIT; - } - - /* Hook in fallbacks for specific primitives. - */ - if (flags & (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)) { - if (flags & POINT_FALLBACK) tmesa->draw_point = trident_fallback_point; - if (flags & LINE_FALLBACK) tmesa->draw_line = trident_fallback_line; - if (flags & TRI_FALLBACK) tmesa->draw_tri = trident_fallback_tri; - index |= TRIDENT_FALLBACK_BIT; - } - } - - if (tmesa->RenderIndex != index) { - tmesa->RenderIndex = index; - - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (tmesa->RenderIndex == 0) { - tnl->Driver.Render.PrimTabVerts = trident_render_tab_verts; - tnl->Driver.Render.PrimTabElts = trident_render_tab_elts; - } else { - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - } - tnl->Driver.Render.ClippedLine = tridentRenderClippedLine; - tnl->Driver.Render.ClippedPolygon = tridentRenderClippedPoly; - } -} - - -/**********************************************************************/ -/* High level hooks for t_vb_render.c */ -/**********************************************************************/ - - - -/* Determine the rasterized primitive when not drawing unfilled - * polygons. - * - * Used only for the default render stage which always decomposes - * primitives to trianges/lines/points. For the accelerated stage, - * which renders strips as strips, the equivalent calculations are - * performed in tridentrender.c. - */ -#if 0 -static void tridentRasterPrimitive( GLcontext *ctx, GLuint hwprim ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - if (tmesa->hw_primitive != hwprim) - tmesa->hw_primitive = hwprim; -} -#endif - -static void tridentRenderPrimitive( GLcontext *ctx, GLenum prim ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - tmesa->render_primitive = prim; -} - -static void tridentRunPipeline( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - if ( tmesa->new_state ) - tridentDDUpdateHWState( ctx ); - - if (tmesa->new_gl_state) { -#if 0 - if (tmesa->new_gl_state & _NEW_TEXTURE) - tridentUpdateTextureState( ctx ); -#endif - - if (!tmesa->Fallback) { - if (tmesa->new_gl_state & _TRIDENT_NEW_VERTEX) - tridentChooseVertexState( ctx ); - - if (tmesa->new_gl_state & _TRIDENT_NEW_RENDER_STATE) - tridentChooseRenderState( ctx ); - } - - tmesa->new_gl_state = 0; - } - - _tnl_run_pipeline( ctx ); -} - -static void tridentRenderStart( GLcontext *ctx ) -{ - /* Check for projective texturing. Make sure all texcoord - * pointers point to something. (fix in mesa?) - */ - tridentCheckTexSizes( ctx ); -} - -static void tridentRenderFinish( GLcontext *ctx ) -{ - if (0) - _swrast_flush( ctx ); /* never needed */ -} - -static void tridentResetLineStipple( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - (void) tmesa; - - /* Reset the hardware stipple counter. - */ -} - - -/**********************************************************************/ -/* Transition to/from hardware rasterization. */ -/**********************************************************************/ - - -void tridentFallback( tridentContextPtr tmesa, GLuint bit, GLboolean mode ) -{ - GLcontext *ctx = tmesa->glCtx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = tmesa->Fallback; - - _tnl_need_projected_coords( ctx, GL_FALSE ); - - if (mode) { - tmesa->Fallback |= bit; - if (oldfallback == 0) { - _swsetup_Wakeup( ctx ); - tmesa->RenderIndex = ~0; - } - } - else { - tmesa->Fallback &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - tnl->Driver.Render.Start = tridentRenderStart; - tnl->Driver.Render.PrimitiveNotify = tridentRenderPrimitive; - tnl->Driver.Render.Finish = tridentRenderFinish; - tnl->Driver.Render.BuildVertices = tridentBuildVertices; - tnl->Driver.Render.ResetLineStipple = tridentResetLineStipple; - tmesa->new_gl_state |= (_TRIDENT_NEW_RENDER_STATE| - _TRIDENT_NEW_VERTEX); - } - } -} - - -/**********************************************************************/ -/* Initialization. */ -/**********************************************************************/ - - -void tridentDDInitTriFuncs( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - firsttime = 0; - } - - tmesa->RenderIndex = ~0; - - tnl->Driver.RunPipeline = tridentRunPipeline; - tnl->Driver.Render.Start = tridentRenderStart; - tnl->Driver.Render.Finish = tridentRenderFinish; - tnl->Driver.Render.PrimitiveNotify = tridentRenderPrimitive; - tnl->Driver.Render.ResetLineStipple = tridentResetLineStipple; - tnl->Driver.Render.BuildVertices = tridentBuildVertices; -} diff --git a/src/mesa/drivers/dri/trident/trident_vb.c b/src/mesa/drivers/dri/trident/trident_vb.c deleted file mode 100644 index 055a914595..0000000000 --- a/src/mesa/drivers/dri/trident/trident_vb.c +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> - * - * Trident CyberBladeXP driver. - * - */ -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast_setup/swrast_setup.h" -#include "swrast/swrast.h" -#include "tnl/t_context.h" -#include "tnl/tnl.h" - -#include "trident_context.h" - -#define TRIDENT_TEX1_BIT 0x1 -#define TRIDENT_TEX0_BIT 0x2 -#define TRIDENT_RGBA_BIT 0x4 -#define TRIDENT_SPEC_BIT 0x8 -#define TRIDENT_FOG_BIT 0x10 -#define TRIDENT_XYZW_BIT 0x20 -#define TRIDENT_PTEX_BIT 0x40 -#define TRIDENT_MAX_SETUP 0x80 - -static struct { - void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); - tnl_interp_func interp; - tnl_copy_pv_func copy_pv; - GLboolean (*check_tex_sizes)( GLcontext *ctx ); - GLuint vertex_size; - GLuint vertex_stride_shift; - GLuint vertex_format; -} setup_tab[TRIDENT_MAX_SETUP]; - -#define TINY_VERTEX_FORMAT 1 -#define NOTEX_VERTEX_FORMAT 2 -#define TEX0_VERTEX_FORMAT 3 -#define TEX1_VERTEX_FORMAT 4 -#define PROJ_TEX1_VERTEX_FORMAT 5 -#define TEX2_VERTEX_FORMAT 6 -#define TEX3_VERTEX_FORMAT 7 -#define PROJ_TEX3_VERTEX_FORMAT 8 - -#define DO_XYZW (IND & TRIDENT_XYZW_BIT) -#define DO_RGBA (IND & TRIDENT_RGBA_BIT) -#define DO_SPEC (IND & TRIDENT_SPEC_BIT) -#define DO_FOG (IND & TRIDENT_FOG_BIT) -#define DO_TEX0 (IND & TRIDENT_TEX0_BIT) -#define DO_TEX1 (IND & TRIDENT_TEX1_BIT) -#define DO_TEX2 0 -#define DO_TEX3 0 -#define DO_PTEX (IND & TRIDENT_PTEX_BIT) - -#define VERTEX tridentVertex -#define VERTEX_COLOR trident_color_t -#define LOCALVARS tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); -#define GET_VIEWPORT_MAT() tmesa->hw_viewport -#define GET_TEXSOURCE(n) tmesa->tmu_source[n] -#define GET_VERTEX_FORMAT() tmesa->vertex_format -#define GET_VERTEX_SIZE() tmesa->vertex_size -#define GET_VERTEX_STORE() tmesa->verts -#define GET_VERTEX_STRIDE_SHIFT() tmesa->vertex_stride_shift -#define GET_UBYTE_COLOR_STORE() &tmesa->UbyteColor -#define GET_UBYTE_SPEC_COLOR_STORE() &tmesa->UbyteSecondaryColor - -#define HAVE_HW_VIEWPORT 0 -#define HAVE_HW_DIVIDE 0 -#define HAVE_RGBA_COLOR 0 -#define HAVE_TINY_VERTICES 1 -#define HAVE_NOTEX_VERTICES 1 -#define HAVE_TEX0_VERTICES 1 -#define HAVE_TEX1_VERTICES 1 -#define HAVE_TEX2_VERTICES 0 -#define HAVE_TEX3_VERTICES 0 -#define HAVE_PTEX_VERTICES 0 - -#define UNVIEWPORT_VARS \ - const GLfloat dx = - tmesa->drawX - SUBPIXEL_X; \ - const GLfloat dy = (tmesa->driDrawable->h + \ - tmesa->drawY + SUBPIXEL_Y); \ - const GLfloat sz = 1.0 / tmesa->depth_scale - -#define UNVIEWPORT_X(x) x + dx; -#define UNVIEWPORT_Y(y) - y + dy; -#define UNVIEWPORT_Z(z) z * sz; - -#define PTEX_FALLBACK() tridentFallback(TRIDENT_CONTEXT(ctx), TRIDENT_FALLBACK_TEXTURE, 1) - -#define IMPORT_FLOAT_COLORS trident_import_float_colors -#define IMPORT_FLOAT_SPEC_COLORS trident_import_float_spec_colors - -#define INTERP_VERTEX setup_tab[tmesa->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[tmesa->SetupIndex].copy_pv - -/*********************************************************************** - * Generate pv-copying and translation functions * - ***********************************************************************/ - -#define TAG(x) trident_##x -#include "tnl_dd/t_dd_vb.c" - -/*********************************************************************** - * Generate vertex emit and interp functions * - ***********************************************************************/ - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT) -#define TAG(x) x##_wg -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_wgs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgt0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgspt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT) -#define TAG(x) x##_wgf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_wgfs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgft0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgfpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgfst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgfst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgfspt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_TEX0_BIT) -#define TAG(x) x##_t0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_t0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_FOG_BIT) -#define TAG(x) x##_f -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_ft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_ft0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT) -#define TAG(x) x##_g -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_gs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gt0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT) -#define TAG(x) x##_gf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_gfs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gft0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gfst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gfst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -static void init_setup_tab( void ) -{ - init_wg(); - init_wgs(); - init_wgt0(); - init_wgt0t1(); - init_wgpt0(); - init_wgst0(); - init_wgst0t1(); - init_wgspt0(); - init_wgf(); - init_wgfs(); - init_wgft0(); - init_wgft0t1(); - init_wgfpt0(); - init_wgfst0(); - init_wgfst0t1(); - init_wgfspt0(); - init_t0(); - init_t0t1(); - init_f(); - init_ft0(); - init_ft0t1(); - init_g(); - init_gs(); - init_gt0(); - init_gt0t1(); - init_gst0(); - init_gst0t1(); - init_gf(); - init_gfs(); - init_gft0(); - init_gft0t1(); - init_gfst0(); - init_gfst0t1(); -} - -void tridentBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx ); - GLubyte *v = ((GLubyte *)tmesa->verts + (start<<tmesa->vertex_stride_shift)); - GLuint stride = 1<<tmesa->vertex_stride_shift; - - newinputs |= tmesa->SetupNewInputs; - tmesa->SetupNewInputs = 0; - - if (!newinputs) - return; - - if (newinputs & VERT_BIT_POS) { - setup_tab[tmesa->SetupIndex].emit( ctx, start, count, v, stride ); - } else { - GLuint ind = 0; - - if (newinputs & VERT_BIT_COLOR0) - ind |= TRIDENT_RGBA_BIT; - - if (newinputs & VERT_BIT_COLOR1) - ind |= TRIDENT_SPEC_BIT; - - if (newinputs & VERT_BIT_TEX0) - ind |= TRIDENT_TEX0_BIT; - - if (newinputs & VERT_BIT_TEX1) - ind |= TRIDENT_TEX1_BIT; - - if (newinputs & VERT_BIT_FOG) - ind |= TRIDENT_FOG_BIT; - - if (tmesa->SetupIndex & TRIDENT_PTEX_BIT) - ind = ~0; - - ind &= tmesa->SetupIndex; - - if (ind) { - setup_tab[ind].emit( ctx, start, count, v, stride ); - } - } -} - -void tridentCheckTexSizes( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx ); - - if (!setup_tab[tmesa->SetupIndex].check_tex_sizes(ctx)) { - TNLcontext *tnl = TNL_CONTEXT(ctx); - - /* Invalidate stored verts - */ - tmesa->SetupNewInputs = ~0; - tmesa->SetupIndex |= TRIDENT_PTEX_BIT; - - if (!tmesa->Fallback && - !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - tnl->Driver.Render.Interp = setup_tab[tmesa->SetupIndex].interp; - tnl->Driver.Render.CopyPV = setup_tab[tmesa->SetupIndex].copy_pv; - } - } -} - -void tridentChooseVertexState( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint ind = TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT; - - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - ind |= TRIDENT_SPEC_BIT; - - if (ctx->Fog.Enabled) - ind |= TRIDENT_FOG_BIT; - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - ind |= TRIDENT_TEX0_BIT; - if (ctx->Texture.Unit[1]._ReallyEnabled) { - ind |= TRIDENT_TEX1_BIT; - } - } - - tmesa->SetupIndex = ind; - - if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { - tnl->Driver.Render.Interp = trident_interp_extras; - tnl->Driver.Render.CopyPV = trident_copy_pv_extras; - } else { - tnl->Driver.Render.Interp = setup_tab[ind].interp; - tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; - } - - if (setup_tab[ind].vertex_format != tmesa->vertex_format) { - tmesa->vertex_format = setup_tab[ind].vertex_format; - tmesa->vertex_size = setup_tab[ind].vertex_size; - tmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift; - } -} - -void tridentInitVB( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - - tmesa->verts = (GLubyte *)ALIGN_MALLOC( size * 16 * 4, 32 ); - - { - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - } - } -} - -void tridentFreeVB( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - if (tmesa->verts) { - ALIGN_FREE(tmesa->verts); - tmesa->verts = 0; - } - - if (tmesa->UbyteSecondaryColor.Ptr) { - ALIGN_FREE((void *)tmesa->UbyteSecondaryColor.Ptr); - tmesa->UbyteSecondaryColor.Ptr = 0; - } - - if (tmesa->UbyteColor.Ptr) { - ALIGN_FREE((void *)tmesa->UbyteColor.Ptr); - tmesa->UbyteColor.Ptr = 0; - } -} diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile index 5fe00c1bd1..344d34fce3 100644 --- a/src/mesa/drivers/dri/unichrome/Makefile +++ b/src/mesa/drivers/dri/unichrome/Makefile @@ -29,4 +29,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index d2010f0907..54073e7691 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -818,11 +818,6 @@ static void viaTexImage(GLcontext *ctx, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - _mesa_generate_mipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 904659e345..692657a5df 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -50,6 +50,7 @@ #include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "vbo/vbo.h" @@ -1258,6 +1259,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, osmesa->bInd = bind; osmesa->aInd = aind; + _mesa_meta_init(&osmesa->mesa); + /* Initialize the software rasterizer and helper modules. */ { GLcontext *ctx = &osmesa->mesa; @@ -1304,6 +1307,8 @@ OSMesaDestroyContext( OSMesaContext osmesa ) if (osmesa->rb) _mesa_reference_renderbuffer(&osmesa->rb, NULL); + _mesa_meta_free( &osmesa->mesa ); + _swsetup_DestroyContext( &osmesa->mesa ); _tnl_DestroyContext( &osmesa->mesa ); _vbo_DestroyContext( &osmesa->mesa ); diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index bd3e5b2137..5abcd1d927 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -943,6 +943,15 @@ EXPORTS _mesa_update_framebuffer_visual _mesa_use_program _mesa_Viewport + _mesa_meta_CopyColorSubTable + _mesa_meta_CopyColorTable + _mesa_meta_CopyConvolutionFilter1D + _mesa_meta_CopyConvolutionFilter2D + _mesa_meta_CopyTexImage1D + _mesa_meta_CopyTexImage2D + _mesa_meta_CopyTexSubImage1D + _mesa_meta_CopyTexSubImage2D + _mesa_meta_CopyTexSubImage3D _mesa_wait_query _swrast_Accum _swrast_Bitmap @@ -953,15 +962,6 @@ EXPORTS _swrast_Clear _swrast_choose_line _swrast_choose_triangle - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_CopyConvolutionFilter1D - _swrast_CopyConvolutionFilter2D - _swrast_copy_teximage1d - _swrast_copy_teximage2d - _swrast_copy_texsubimage1d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext _swrast_exec_fragment_program diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index e1971db693..8929b22af1 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -12,6 +12,7 @@ #include "framebuffer.h" #include "renderbuffer.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "vbo/vbo.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -1515,6 +1516,8 @@ WMesaContext WMesaCreateContext(HDC hDC, _mesa_enable_2_0_extensions(ctx); _mesa_enable_2_1_extensions(ctx); + _mesa_meta_init(ctx); + /* Initialize the software rasterizer and helper modules. */ if (!_swrast_CreateContext(ctx) || !_vbo_CreateContext(ctx) || @@ -1558,6 +1561,8 @@ void WMesaDestroyContext( WMesaContext pwc ) DeleteObject(pwc->clearPen); DeleteObject(pwc->clearBrush); + _mesa_meta_free(ctx); + _swsetup_DestroyContext(ctx); _tnl_DestroyContext(ctx); _vbo_DestroyContext(ctx); diff --git a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c index 342a742867..7ac425a109 100644 --- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c @@ -1346,6 +1346,8 @@ static void wmesa_update_state_first_time( struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); + _mesa_init_driver_functions(&ctx->Driver); + /* * XXX these function pointers could be initialized just once during * context creation since they don't depend on any state changes. @@ -1362,8 +1364,6 @@ static void wmesa_update_state_first_time( ctx->Driver.Viewport = wmesa_viewport; - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; ctx->Driver.Clear = clear; ctx->Driver.Flush = flush; @@ -1371,28 +1371,6 @@ static void wmesa_update_state_first_time( ctx->Driver.ClearColor = clear_color; ctx->Driver.Enable = enable; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = _mesa_store_teximage2d; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; // Does not apply for Mesa 5.x //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index 465b380a0c..25ac08a2f0 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -75,6 +75,15 @@ EXPORTS _mesa_strcmp _mesa_test_proxy_teximage _mesa_Viewport + _mesa_meta_CopyColorSubTable + _mesa_meta_CopyColorTable + _mesa_meta_CopyConvolutionFilter1D + _mesa_meta_CopyConvolutionFilter2D + _mesa_meta_CopyTexImage1D + _mesa_meta_CopyTexImage2D + _mesa_meta_CopyTexSubImage1D + _mesa_meta_CopyTexSubImage2D + _mesa_meta_CopyTexSubImage3D _swrast_Accum _swrast_Bitmap _swrast_CopyPixels @@ -84,15 +93,6 @@ EXPORTS _swrast_Clear _swrast_choose_line _swrast_choose_triangle - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_CopyConvolutionFilter1D - _swrast_CopyConvolutionFilter2D - _swrast_copy_teximage1d - _swrast_copy_teximage2d - _swrast_copy_texsubimage1d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext _swrast_InvalidateState diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 2c7be9f182..79b058634c 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1317,6 +1317,7 @@ xmesa_convert_from_x_visual_type( int visualType ) #define need_GL_SGI_color_table /* sw extensions not associated with some GL version */ +#define need_GL_ARB_draw_elements_base_vertex #define need_GL_ARB_shader_objects #define need_GL_ARB_sync #define need_GL_ARB_vertex_program @@ -1347,6 +1348,8 @@ const struct dri_extension card_extensions[] = { "GL_EXT_histogram", GL_EXT_histogram_functions }, { "GL_SGI_color_table", GL_SGI_color_table_functions }, + { "GL_ARB_depth_clamp", NULL }, + { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, { "GL_ARB_sync", GL_ARB_sync_functions }, { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, @@ -1358,6 +1361,7 @@ const struct dri_extension card_extensions[] = { "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions }, { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions }, { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, + { "GL_NV_depth_clamp", NULL }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_fragment_program", GL_NV_fragment_program_functions }, { NULL, NULL } @@ -1644,8 +1648,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) xmesa_register_swrast_functions( mesaCtx ); _swsetup_Wakeup(mesaCtx); - if (TEST_META_FUNCS) - _mesa_meta_init(mesaCtx); + _mesa_meta_init(mesaCtx); return c; } @@ -1661,8 +1664,7 @@ void XMesaDestroyContext( XMesaContext c ) FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) ); #endif - if (TEST_META_FUNCS) - _mesa_meta_free( mesaCtx ); + _mesa_meta_free( mesaCtx ); _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 465a40ac8d..e2d4aa9b2d 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1150,10 +1150,11 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, driver->Enable = enable; driver->Viewport = xmesa_viewport; if (TEST_META_FUNCS) { - driver->Clear = _mesa_meta_clear; - driver->CopyPixels = _mesa_meta_copy_pixels; - driver->BlitFramebuffer = _mesa_meta_blit_framebuffer; - driver->DrawPixels = _mesa_meta_draw_pixels; + driver->Clear = _mesa_meta_Clear; + driver->CopyPixels = _mesa_meta_CopyPixels; + driver->BlitFramebuffer = _mesa_meta_BlitFramebuffer; + driver->DrawPixels = _mesa_meta_DrawPixels; + driver->Bitmap = _mesa_meta_Bitmap; } else { driver->Clear = clear_buffers; @@ -1167,8 +1168,8 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, else if (xmvisual->undithered_pf == PF_5R6G5B) { driver->DrawPixels = xmesa_DrawPixels_5R6G5B; } - } #endif + } driver->TestProxyTexImage = test_proxy_teximage; #if ENABLE_EXT_texure_compression_s3tc driver->ChooseTextureFormat = choose_tex_format; diff --git a/src/mesa/glapi/ARB_depth_clamp.xml b/src/mesa/glapi/ARB_depth_clamp.xml new file mode 100644 index 0000000000..157c9a86b1 --- /dev/null +++ b/src/mesa/glapi/ARB_depth_clamp.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<OpenGLAPI> + +<category name="GL_ARB_depth_clamp" number="61"> + <enum name="DEPTH_CLAMP" count="1" value="0x864F"> + <size name="Get" mode="get"/> + </enum> +</category> + +</OpenGLAPI> diff --git a/src/mesa/glapi/ARB_draw_elements_base_vertex.xml b/src/mesa/glapi/ARB_draw_elements_base_vertex.xml new file mode 100644 index 0000000000..f4067f4c8d --- /dev/null +++ b/src/mesa/glapi/ARB_draw_elements_base_vertex.xml @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<!-- Note: no GLX protocol info yet. --> + + +<OpenGLAPI> + +<category name="GL_ARB_draw_elements_base_vertex" number="62"> + + <function name="DrawElementsBaseVertex" offset="assign"> + <param name="mode" type="GLenum"/> + <param name="count" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid *"/> + <param name="basevertex" type="GLint"/> + </function> + + <function name="DrawRangeElementsBaseVertex" offset="assign"> + <param name="mode" type="GLenum"/> + <param name="start" type="GLuint"/> + <param name="end" type="GLuint"/> + <param name="count" type="GLsizei"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid *"/> + <param name="basevertex" type="GLint"/> + </function> + + <function name="MultiDrawElementsBaseVertex" offset="assign"> + <param name="mode" type="GLenum"/> + <param name="count" type="const GLsizei *"/> + <param name="type" type="GLenum"/> + <param name="indices" type="const GLvoid **"/> + <param name="primcount" type="GLsizei"/> + <param name="basevertex" type="const GLint *"/> + </function> + +</category> + +</OpenGLAPI> diff --git a/src/mesa/glapi/EXT_provoking_vertex.xml b/src/mesa/glapi/EXT_provoking_vertex.xml index f528a2c7d3..71d2c72909 100644 --- a/src/mesa/glapi/EXT_provoking_vertex.xml +++ b/src/mesa/glapi/EXT_provoking_vertex.xml @@ -19,4 +19,17 @@ </category> +<category name="GL_ARB_provoking_vertex" number="64"> + + <enum name="FIRST_VERTEX_CONVENTION" value="0x8E4D"/> + <enum name="LAST_VERTEX_CONVENTION" value="0x8E4E"/> + <enum name="PROVOKING_VERTEX" value="0x8E4F"/> + <enum name="QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION" value="0x8E4C"/> + + <function name="ProvokingVertex" alias="ProvokingVertexEXT"> + <param name="mode" type="GLenum"/> + </function> + +</category> + </OpenGLAPI> diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index 65edab7cec..22f65b74c2 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -48,6 +48,7 @@ SERVER_OUTPUTS = \ API_XML = gl_API.xml \ EXT_framebuffer_object.xml \ ARB_copy_buffer.xml \ + ARB_depth_clamp.xml \ ARB_framebuffer_object.xml \ ARB_map_buffer_range.xml \ ARB_seamless_cube_map.xml \ diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index 0d32045916..efbd56fa71 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -1782,6 +1782,15 @@ #define CALL_WaitSync(disp, parameters) (*((disp)->WaitSync)) parameters #define GET_WaitSync(disp) ((disp)->WaitSync) #define SET_WaitSync(disp, fn) ((disp)->WaitSync = fn) +#define CALL_DrawElementsBaseVertex(disp, parameters) (*((disp)->DrawElementsBaseVertex)) parameters +#define GET_DrawElementsBaseVertex(disp) ((disp)->DrawElementsBaseVertex) +#define SET_DrawElementsBaseVertex(disp, fn) ((disp)->DrawElementsBaseVertex = fn) +#define CALL_DrawRangeElementsBaseVertex(disp, parameters) (*((disp)->DrawRangeElementsBaseVertex)) parameters +#define GET_DrawRangeElementsBaseVertex(disp) ((disp)->DrawRangeElementsBaseVertex) +#define SET_DrawRangeElementsBaseVertex(disp, fn) ((disp)->DrawRangeElementsBaseVertex = fn) +#define CALL_MultiDrawElementsBaseVertex(disp, parameters) (*((disp)->MultiDrawElementsBaseVertex)) parameters +#define GET_MultiDrawElementsBaseVertex(disp) ((disp)->MultiDrawElementsBaseVertex) +#define SET_MultiDrawElementsBaseVertex(disp, fn) ((disp)->MultiDrawElementsBaseVertex = fn) #define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters #define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) #define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) @@ -2439,7 +2448,7 @@ #else -#define driDispatchRemapTable_size 384 +#define driDispatchRemapTable_size 387 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define AttachShader_remap_index 0 @@ -2608,224 +2617,227 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define GetSynciv_remap_index 163 #define IsSync_remap_index 164 #define WaitSync_remap_index 165 -#define PolygonOffsetEXT_remap_index 166 -#define GetPixelTexGenParameterfvSGIS_remap_index 167 -#define GetPixelTexGenParameterivSGIS_remap_index 168 -#define PixelTexGenParameterfSGIS_remap_index 169 -#define PixelTexGenParameterfvSGIS_remap_index 170 -#define PixelTexGenParameteriSGIS_remap_index 171 -#define PixelTexGenParameterivSGIS_remap_index 172 -#define SampleMaskSGIS_remap_index 173 -#define SamplePatternSGIS_remap_index 174 -#define ColorPointerEXT_remap_index 175 -#define EdgeFlagPointerEXT_remap_index 176 -#define IndexPointerEXT_remap_index 177 -#define NormalPointerEXT_remap_index 178 -#define TexCoordPointerEXT_remap_index 179 -#define VertexPointerEXT_remap_index 180 -#define PointParameterfEXT_remap_index 181 -#define PointParameterfvEXT_remap_index 182 -#define LockArraysEXT_remap_index 183 -#define UnlockArraysEXT_remap_index 184 -#define CullParameterdvEXT_remap_index 185 -#define CullParameterfvEXT_remap_index 186 -#define SecondaryColor3bEXT_remap_index 187 -#define SecondaryColor3bvEXT_remap_index 188 -#define SecondaryColor3dEXT_remap_index 189 -#define SecondaryColor3dvEXT_remap_index 190 -#define SecondaryColor3fEXT_remap_index 191 -#define SecondaryColor3fvEXT_remap_index 192 -#define SecondaryColor3iEXT_remap_index 193 -#define SecondaryColor3ivEXT_remap_index 194 -#define SecondaryColor3sEXT_remap_index 195 -#define SecondaryColor3svEXT_remap_index 196 -#define SecondaryColor3ubEXT_remap_index 197 -#define SecondaryColor3ubvEXT_remap_index 198 -#define SecondaryColor3uiEXT_remap_index 199 -#define SecondaryColor3uivEXT_remap_index 200 -#define SecondaryColor3usEXT_remap_index 201 -#define SecondaryColor3usvEXT_remap_index 202 -#define SecondaryColorPointerEXT_remap_index 203 -#define MultiDrawArraysEXT_remap_index 204 -#define MultiDrawElementsEXT_remap_index 205 -#define FogCoordPointerEXT_remap_index 206 -#define FogCoorddEXT_remap_index 207 -#define FogCoorddvEXT_remap_index 208 -#define FogCoordfEXT_remap_index 209 -#define FogCoordfvEXT_remap_index 210 -#define PixelTexGenSGIX_remap_index 211 -#define BlendFuncSeparateEXT_remap_index 212 -#define FlushVertexArrayRangeNV_remap_index 213 -#define VertexArrayRangeNV_remap_index 214 -#define CombinerInputNV_remap_index 215 -#define CombinerOutputNV_remap_index 216 -#define CombinerParameterfNV_remap_index 217 -#define CombinerParameterfvNV_remap_index 218 -#define CombinerParameteriNV_remap_index 219 -#define CombinerParameterivNV_remap_index 220 -#define FinalCombinerInputNV_remap_index 221 -#define GetCombinerInputParameterfvNV_remap_index 222 -#define GetCombinerInputParameterivNV_remap_index 223 -#define GetCombinerOutputParameterfvNV_remap_index 224 -#define GetCombinerOutputParameterivNV_remap_index 225 -#define GetFinalCombinerInputParameterfvNV_remap_index 226 -#define GetFinalCombinerInputParameterivNV_remap_index 227 -#define ResizeBuffersMESA_remap_index 228 -#define WindowPos2dMESA_remap_index 229 -#define WindowPos2dvMESA_remap_index 230 -#define WindowPos2fMESA_remap_index 231 -#define WindowPos2fvMESA_remap_index 232 -#define WindowPos2iMESA_remap_index 233 -#define WindowPos2ivMESA_remap_index 234 -#define WindowPos2sMESA_remap_index 235 -#define WindowPos2svMESA_remap_index 236 -#define WindowPos3dMESA_remap_index 237 -#define WindowPos3dvMESA_remap_index 238 -#define WindowPos3fMESA_remap_index 239 -#define WindowPos3fvMESA_remap_index 240 -#define WindowPos3iMESA_remap_index 241 -#define WindowPos3ivMESA_remap_index 242 -#define WindowPos3sMESA_remap_index 243 -#define WindowPos3svMESA_remap_index 244 -#define WindowPos4dMESA_remap_index 245 -#define WindowPos4dvMESA_remap_index 246 -#define WindowPos4fMESA_remap_index 247 -#define WindowPos4fvMESA_remap_index 248 -#define WindowPos4iMESA_remap_index 249 -#define WindowPos4ivMESA_remap_index 250 -#define WindowPos4sMESA_remap_index 251 -#define WindowPos4svMESA_remap_index 252 -#define MultiModeDrawArraysIBM_remap_index 253 -#define MultiModeDrawElementsIBM_remap_index 254 -#define DeleteFencesNV_remap_index 255 -#define FinishFenceNV_remap_index 256 -#define GenFencesNV_remap_index 257 -#define GetFenceivNV_remap_index 258 -#define IsFenceNV_remap_index 259 -#define SetFenceNV_remap_index 260 -#define TestFenceNV_remap_index 261 -#define AreProgramsResidentNV_remap_index 262 -#define BindProgramNV_remap_index 263 -#define DeleteProgramsNV_remap_index 264 -#define ExecuteProgramNV_remap_index 265 -#define GenProgramsNV_remap_index 266 -#define GetProgramParameterdvNV_remap_index 267 -#define GetProgramParameterfvNV_remap_index 268 -#define GetProgramStringNV_remap_index 269 -#define GetProgramivNV_remap_index 270 -#define GetTrackMatrixivNV_remap_index 271 -#define GetVertexAttribPointervNV_remap_index 272 -#define GetVertexAttribdvNV_remap_index 273 -#define GetVertexAttribfvNV_remap_index 274 -#define GetVertexAttribivNV_remap_index 275 -#define IsProgramNV_remap_index 276 -#define LoadProgramNV_remap_index 277 -#define ProgramParameters4dvNV_remap_index 278 -#define ProgramParameters4fvNV_remap_index 279 -#define RequestResidentProgramsNV_remap_index 280 -#define TrackMatrixNV_remap_index 281 -#define VertexAttrib1dNV_remap_index 282 -#define VertexAttrib1dvNV_remap_index 283 -#define VertexAttrib1fNV_remap_index 284 -#define VertexAttrib1fvNV_remap_index 285 -#define VertexAttrib1sNV_remap_index 286 -#define VertexAttrib1svNV_remap_index 287 -#define VertexAttrib2dNV_remap_index 288 -#define VertexAttrib2dvNV_remap_index 289 -#define VertexAttrib2fNV_remap_index 290 -#define VertexAttrib2fvNV_remap_index 291 -#define VertexAttrib2sNV_remap_index 292 -#define VertexAttrib2svNV_remap_index 293 -#define VertexAttrib3dNV_remap_index 294 -#define VertexAttrib3dvNV_remap_index 295 -#define VertexAttrib3fNV_remap_index 296 -#define VertexAttrib3fvNV_remap_index 297 -#define VertexAttrib3sNV_remap_index 298 -#define VertexAttrib3svNV_remap_index 299 -#define VertexAttrib4dNV_remap_index 300 -#define VertexAttrib4dvNV_remap_index 301 -#define VertexAttrib4fNV_remap_index 302 -#define VertexAttrib4fvNV_remap_index 303 -#define VertexAttrib4sNV_remap_index 304 -#define VertexAttrib4svNV_remap_index 305 -#define VertexAttrib4ubNV_remap_index 306 -#define VertexAttrib4ubvNV_remap_index 307 -#define VertexAttribPointerNV_remap_index 308 -#define VertexAttribs1dvNV_remap_index 309 -#define VertexAttribs1fvNV_remap_index 310 -#define VertexAttribs1svNV_remap_index 311 -#define VertexAttribs2dvNV_remap_index 312 -#define VertexAttribs2fvNV_remap_index 313 -#define VertexAttribs2svNV_remap_index 314 -#define VertexAttribs3dvNV_remap_index 315 -#define VertexAttribs3fvNV_remap_index 316 -#define VertexAttribs3svNV_remap_index 317 -#define VertexAttribs4dvNV_remap_index 318 -#define VertexAttribs4fvNV_remap_index 319 -#define VertexAttribs4svNV_remap_index 320 -#define VertexAttribs4ubvNV_remap_index 321 -#define GetTexBumpParameterfvATI_remap_index 322 -#define GetTexBumpParameterivATI_remap_index 323 -#define TexBumpParameterfvATI_remap_index 324 -#define TexBumpParameterivATI_remap_index 325 -#define AlphaFragmentOp1ATI_remap_index 326 -#define AlphaFragmentOp2ATI_remap_index 327 -#define AlphaFragmentOp3ATI_remap_index 328 -#define BeginFragmentShaderATI_remap_index 329 -#define BindFragmentShaderATI_remap_index 330 -#define ColorFragmentOp1ATI_remap_index 331 -#define ColorFragmentOp2ATI_remap_index 332 -#define ColorFragmentOp3ATI_remap_index 333 -#define DeleteFragmentShaderATI_remap_index 334 -#define EndFragmentShaderATI_remap_index 335 -#define GenFragmentShadersATI_remap_index 336 -#define PassTexCoordATI_remap_index 337 -#define SampleMapATI_remap_index 338 -#define SetFragmentShaderConstantATI_remap_index 339 -#define PointParameteriNV_remap_index 340 -#define PointParameterivNV_remap_index 341 -#define ActiveStencilFaceEXT_remap_index 342 -#define BindVertexArrayAPPLE_remap_index 343 -#define DeleteVertexArraysAPPLE_remap_index 344 -#define GenVertexArraysAPPLE_remap_index 345 -#define IsVertexArrayAPPLE_remap_index 346 -#define GetProgramNamedParameterdvNV_remap_index 347 -#define GetProgramNamedParameterfvNV_remap_index 348 -#define ProgramNamedParameter4dNV_remap_index 349 -#define ProgramNamedParameter4dvNV_remap_index 350 -#define ProgramNamedParameter4fNV_remap_index 351 -#define ProgramNamedParameter4fvNV_remap_index 352 -#define DepthBoundsEXT_remap_index 353 -#define BlendEquationSeparateEXT_remap_index 354 -#define BindFramebufferEXT_remap_index 355 -#define BindRenderbufferEXT_remap_index 356 -#define CheckFramebufferStatusEXT_remap_index 357 -#define DeleteFramebuffersEXT_remap_index 358 -#define DeleteRenderbuffersEXT_remap_index 359 -#define FramebufferRenderbufferEXT_remap_index 360 -#define FramebufferTexture1DEXT_remap_index 361 -#define FramebufferTexture2DEXT_remap_index 362 -#define FramebufferTexture3DEXT_remap_index 363 -#define GenFramebuffersEXT_remap_index 364 -#define GenRenderbuffersEXT_remap_index 365 -#define GenerateMipmapEXT_remap_index 366 -#define GetFramebufferAttachmentParameterivEXT_remap_index 367 -#define GetRenderbufferParameterivEXT_remap_index 368 -#define IsFramebufferEXT_remap_index 369 -#define IsRenderbufferEXT_remap_index 370 -#define RenderbufferStorageEXT_remap_index 371 -#define BlitFramebufferEXT_remap_index 372 -#define BufferParameteriAPPLE_remap_index 373 -#define FlushMappedBufferRangeAPPLE_remap_index 374 -#define FramebufferTextureLayerEXT_remap_index 375 -#define ProvokingVertexEXT_remap_index 376 -#define GetTexParameterPointervAPPLE_remap_index 377 -#define TextureRangeAPPLE_remap_index 378 -#define StencilFuncSeparateATI_remap_index 379 -#define ProgramEnvParameters4fvEXT_remap_index 380 -#define ProgramLocalParameters4fvEXT_remap_index 381 -#define GetQueryObjecti64vEXT_remap_index 382 -#define GetQueryObjectui64vEXT_remap_index 383 +#define DrawElementsBaseVertex_remap_index 166 +#define DrawRangeElementsBaseVertex_remap_index 167 +#define MultiDrawElementsBaseVertex_remap_index 168 +#define PolygonOffsetEXT_remap_index 169 +#define GetPixelTexGenParameterfvSGIS_remap_index 170 +#define GetPixelTexGenParameterivSGIS_remap_index 171 +#define PixelTexGenParameterfSGIS_remap_index 172 +#define PixelTexGenParameterfvSGIS_remap_index 173 +#define PixelTexGenParameteriSGIS_remap_index 174 +#define PixelTexGenParameterivSGIS_remap_index 175 +#define SampleMaskSGIS_remap_index 176 +#define SamplePatternSGIS_remap_index 177 +#define ColorPointerEXT_remap_index 178 +#define EdgeFlagPointerEXT_remap_index 179 +#define IndexPointerEXT_remap_index 180 +#define NormalPointerEXT_remap_index 181 +#define TexCoordPointerEXT_remap_index 182 +#define VertexPointerEXT_remap_index 183 +#define PointParameterfEXT_remap_index 184 +#define PointParameterfvEXT_remap_index 185 +#define LockArraysEXT_remap_index 186 +#define UnlockArraysEXT_remap_index 187 +#define CullParameterdvEXT_remap_index 188 +#define CullParameterfvEXT_remap_index 189 +#define SecondaryColor3bEXT_remap_index 190 +#define SecondaryColor3bvEXT_remap_index 191 +#define SecondaryColor3dEXT_remap_index 192 +#define SecondaryColor3dvEXT_remap_index 193 +#define SecondaryColor3fEXT_remap_index 194 +#define SecondaryColor3fvEXT_remap_index 195 +#define SecondaryColor3iEXT_remap_index 196 +#define SecondaryColor3ivEXT_remap_index 197 +#define SecondaryColor3sEXT_remap_index 198 +#define SecondaryColor3svEXT_remap_index 199 +#define SecondaryColor3ubEXT_remap_index 200 +#define SecondaryColor3ubvEXT_remap_index 201 +#define SecondaryColor3uiEXT_remap_index 202 +#define SecondaryColor3uivEXT_remap_index 203 +#define SecondaryColor3usEXT_remap_index 204 +#define SecondaryColor3usvEXT_remap_index 205 +#define SecondaryColorPointerEXT_remap_index 206 +#define MultiDrawArraysEXT_remap_index 207 +#define MultiDrawElementsEXT_remap_index 208 +#define FogCoordPointerEXT_remap_index 209 +#define FogCoorddEXT_remap_index 210 +#define FogCoorddvEXT_remap_index 211 +#define FogCoordfEXT_remap_index 212 +#define FogCoordfvEXT_remap_index 213 +#define PixelTexGenSGIX_remap_index 214 +#define BlendFuncSeparateEXT_remap_index 215 +#define FlushVertexArrayRangeNV_remap_index 216 +#define VertexArrayRangeNV_remap_index 217 +#define CombinerInputNV_remap_index 218 +#define CombinerOutputNV_remap_index 219 +#define CombinerParameterfNV_remap_index 220 +#define CombinerParameterfvNV_remap_index 221 +#define CombinerParameteriNV_remap_index 222 +#define CombinerParameterivNV_remap_index 223 +#define FinalCombinerInputNV_remap_index 224 +#define GetCombinerInputParameterfvNV_remap_index 225 +#define GetCombinerInputParameterivNV_remap_index 226 +#define GetCombinerOutputParameterfvNV_remap_index 227 +#define GetCombinerOutputParameterivNV_remap_index 228 +#define GetFinalCombinerInputParameterfvNV_remap_index 229 +#define GetFinalCombinerInputParameterivNV_remap_index 230 +#define ResizeBuffersMESA_remap_index 231 +#define WindowPos2dMESA_remap_index 232 +#define WindowPos2dvMESA_remap_index 233 +#define WindowPos2fMESA_remap_index 234 +#define WindowPos2fvMESA_remap_index 235 +#define WindowPos2iMESA_remap_index 236 +#define WindowPos2ivMESA_remap_index 237 +#define WindowPos2sMESA_remap_index 238 +#define WindowPos2svMESA_remap_index 239 +#define WindowPos3dMESA_remap_index 240 +#define WindowPos3dvMESA_remap_index 241 +#define WindowPos3fMESA_remap_index 242 +#define WindowPos3fvMESA_remap_index 243 +#define WindowPos3iMESA_remap_index 244 +#define WindowPos3ivMESA_remap_index 245 +#define WindowPos3sMESA_remap_index 246 +#define WindowPos3svMESA_remap_index 247 +#define WindowPos4dMESA_remap_index 248 +#define WindowPos4dvMESA_remap_index 249 +#define WindowPos4fMESA_remap_index 250 +#define WindowPos4fvMESA_remap_index 251 +#define WindowPos4iMESA_remap_index 252 +#define WindowPos4ivMESA_remap_index 253 +#define WindowPos4sMESA_remap_index 254 +#define WindowPos4svMESA_remap_index 255 +#define MultiModeDrawArraysIBM_remap_index 256 +#define MultiModeDrawElementsIBM_remap_index 257 +#define DeleteFencesNV_remap_index 258 +#define FinishFenceNV_remap_index 259 +#define GenFencesNV_remap_index 260 +#define GetFenceivNV_remap_index 261 +#define IsFenceNV_remap_index 262 +#define SetFenceNV_remap_index 263 +#define TestFenceNV_remap_index 264 +#define AreProgramsResidentNV_remap_index 265 +#define BindProgramNV_remap_index 266 +#define DeleteProgramsNV_remap_index 267 +#define ExecuteProgramNV_remap_index 268 +#define GenProgramsNV_remap_index 269 +#define GetProgramParameterdvNV_remap_index 270 +#define GetProgramParameterfvNV_remap_index 271 +#define GetProgramStringNV_remap_index 272 +#define GetProgramivNV_remap_index 273 +#define GetTrackMatrixivNV_remap_index 274 +#define GetVertexAttribPointervNV_remap_index 275 +#define GetVertexAttribdvNV_remap_index 276 +#define GetVertexAttribfvNV_remap_index 277 +#define GetVertexAttribivNV_remap_index 278 +#define IsProgramNV_remap_index 279 +#define LoadProgramNV_remap_index 280 +#define ProgramParameters4dvNV_remap_index 281 +#define ProgramParameters4fvNV_remap_index 282 +#define RequestResidentProgramsNV_remap_index 283 +#define TrackMatrixNV_remap_index 284 +#define VertexAttrib1dNV_remap_index 285 +#define VertexAttrib1dvNV_remap_index 286 +#define VertexAttrib1fNV_remap_index 287 +#define VertexAttrib1fvNV_remap_index 288 +#define VertexAttrib1sNV_remap_index 289 +#define VertexAttrib1svNV_remap_index 290 +#define VertexAttrib2dNV_remap_index 291 +#define VertexAttrib2dvNV_remap_index 292 +#define VertexAttrib2fNV_remap_index 293 +#define VertexAttrib2fvNV_remap_index 294 +#define VertexAttrib2sNV_remap_index 295 +#define VertexAttrib2svNV_remap_index 296 +#define VertexAttrib3dNV_remap_index 297 +#define VertexAttrib3dvNV_remap_index 298 +#define VertexAttrib3fNV_remap_index 299 +#define VertexAttrib3fvNV_remap_index 300 +#define VertexAttrib3sNV_remap_index 301 +#define VertexAttrib3svNV_remap_index 302 +#define VertexAttrib4dNV_remap_index 303 +#define VertexAttrib4dvNV_remap_index 304 +#define VertexAttrib4fNV_remap_index 305 +#define VertexAttrib4fvNV_remap_index 306 +#define VertexAttrib4sNV_remap_index 307 +#define VertexAttrib4svNV_remap_index 308 +#define VertexAttrib4ubNV_remap_index 309 +#define VertexAttrib4ubvNV_remap_index 310 +#define VertexAttribPointerNV_remap_index 311 +#define VertexAttribs1dvNV_remap_index 312 +#define VertexAttribs1fvNV_remap_index 313 +#define VertexAttribs1svNV_remap_index 314 +#define VertexAttribs2dvNV_remap_index 315 +#define VertexAttribs2fvNV_remap_index 316 +#define VertexAttribs2svNV_remap_index 317 +#define VertexAttribs3dvNV_remap_index 318 +#define VertexAttribs3fvNV_remap_index 319 +#define VertexAttribs3svNV_remap_index 320 +#define VertexAttribs4dvNV_remap_index 321 +#define VertexAttribs4fvNV_remap_index 322 +#define VertexAttribs4svNV_remap_index 323 +#define VertexAttribs4ubvNV_remap_index 324 +#define GetTexBumpParameterfvATI_remap_index 325 +#define GetTexBumpParameterivATI_remap_index 326 +#define TexBumpParameterfvATI_remap_index 327 +#define TexBumpParameterivATI_remap_index 328 +#define AlphaFragmentOp1ATI_remap_index 329 +#define AlphaFragmentOp2ATI_remap_index 330 +#define AlphaFragmentOp3ATI_remap_index 331 +#define BeginFragmentShaderATI_remap_index 332 +#define BindFragmentShaderATI_remap_index 333 +#define ColorFragmentOp1ATI_remap_index 334 +#define ColorFragmentOp2ATI_remap_index 335 +#define ColorFragmentOp3ATI_remap_index 336 +#define DeleteFragmentShaderATI_remap_index 337 +#define EndFragmentShaderATI_remap_index 338 +#define GenFragmentShadersATI_remap_index 339 +#define PassTexCoordATI_remap_index 340 +#define SampleMapATI_remap_index 341 +#define SetFragmentShaderConstantATI_remap_index 342 +#define PointParameteriNV_remap_index 343 +#define PointParameterivNV_remap_index 344 +#define ActiveStencilFaceEXT_remap_index 345 +#define BindVertexArrayAPPLE_remap_index 346 +#define DeleteVertexArraysAPPLE_remap_index 347 +#define GenVertexArraysAPPLE_remap_index 348 +#define IsVertexArrayAPPLE_remap_index 349 +#define GetProgramNamedParameterdvNV_remap_index 350 +#define GetProgramNamedParameterfvNV_remap_index 351 +#define ProgramNamedParameter4dNV_remap_index 352 +#define ProgramNamedParameter4dvNV_remap_index 353 +#define ProgramNamedParameter4fNV_remap_index 354 +#define ProgramNamedParameter4fvNV_remap_index 355 +#define DepthBoundsEXT_remap_index 356 +#define BlendEquationSeparateEXT_remap_index 357 +#define BindFramebufferEXT_remap_index 358 +#define BindRenderbufferEXT_remap_index 359 +#define CheckFramebufferStatusEXT_remap_index 360 +#define DeleteFramebuffersEXT_remap_index 361 +#define DeleteRenderbuffersEXT_remap_index 362 +#define FramebufferRenderbufferEXT_remap_index 363 +#define FramebufferTexture1DEXT_remap_index 364 +#define FramebufferTexture2DEXT_remap_index 365 +#define FramebufferTexture3DEXT_remap_index 366 +#define GenFramebuffersEXT_remap_index 367 +#define GenRenderbuffersEXT_remap_index 368 +#define GenerateMipmapEXT_remap_index 369 +#define GetFramebufferAttachmentParameterivEXT_remap_index 370 +#define GetRenderbufferParameterivEXT_remap_index 371 +#define IsFramebufferEXT_remap_index 372 +#define IsRenderbufferEXT_remap_index 373 +#define RenderbufferStorageEXT_remap_index 374 +#define BlitFramebufferEXT_remap_index 375 +#define BufferParameteriAPPLE_remap_index 376 +#define FlushMappedBufferRangeAPPLE_remap_index 377 +#define FramebufferTextureLayerEXT_remap_index 378 +#define ProvokingVertexEXT_remap_index 379 +#define GetTexParameterPointervAPPLE_remap_index 380 +#define TextureRangeAPPLE_remap_index 381 +#define StencilFuncSeparateATI_remap_index 382 +#define ProgramEnvParameters4fvEXT_remap_index 383 +#define ProgramLocalParameters4fvEXT_remap_index 384 +#define GetQueryObjecti64vEXT_remap_index 385 +#define GetQueryObjectui64vEXT_remap_index 386 #define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) #define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) @@ -3325,6 +3337,15 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_WaitSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[WaitSync_remap_index], parameters) #define GET_WaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index]) #define SET_WaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index], fn) +#define CALL_DrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawElementsBaseVertex_remap_index], parameters) +#define GET_DrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index]) +#define SET_DrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index], fn) +#define CALL_DrawRangeElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], parameters) +#define GET_DrawRangeElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index]) +#define SET_DrawRangeElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], fn) +#define CALL_MultiDrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei, const GLint *)), driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], parameters) +#define GET_MultiDrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index]) +#define SET_MultiDrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], fn) #define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) #define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) #define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 1dfd92be08..da4be14707 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -7950,6 +7950,8 @@ <xi:include href="ARB_copy_buffer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> +<xi:include href="ARB_depth_clamp.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + <xi:include href="ARB_map_buffer_range.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> <xi:include href="ARB_vertex_array_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> @@ -7958,6 +7960,8 @@ <xi:include href="ARB_seamless_cube_map.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> +<xi:include href="ARB_draw_elements_base_vertex.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + <!-- Non-ARB extensions sorted by extension number. --> diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index 6d4ab09b07..a3807744ff 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -606,225 +606,228 @@ #define _gloffset_GetSynciv 571 #define _gloffset_IsSync 572 #define _gloffset_WaitSync 573 -#define _gloffset_PolygonOffsetEXT 574 -#define _gloffset_GetPixelTexGenParameterfvSGIS 575 -#define _gloffset_GetPixelTexGenParameterivSGIS 576 -#define _gloffset_PixelTexGenParameterfSGIS 577 -#define _gloffset_PixelTexGenParameterfvSGIS 578 -#define _gloffset_PixelTexGenParameteriSGIS 579 -#define _gloffset_PixelTexGenParameterivSGIS 580 -#define _gloffset_SampleMaskSGIS 581 -#define _gloffset_SamplePatternSGIS 582 -#define _gloffset_ColorPointerEXT 583 -#define _gloffset_EdgeFlagPointerEXT 584 -#define _gloffset_IndexPointerEXT 585 -#define _gloffset_NormalPointerEXT 586 -#define _gloffset_TexCoordPointerEXT 587 -#define _gloffset_VertexPointerEXT 588 -#define _gloffset_PointParameterfEXT 589 -#define _gloffset_PointParameterfvEXT 590 -#define _gloffset_LockArraysEXT 591 -#define _gloffset_UnlockArraysEXT 592 -#define _gloffset_CullParameterdvEXT 593 -#define _gloffset_CullParameterfvEXT 594 -#define _gloffset_SecondaryColor3bEXT 595 -#define _gloffset_SecondaryColor3bvEXT 596 -#define _gloffset_SecondaryColor3dEXT 597 -#define _gloffset_SecondaryColor3dvEXT 598 -#define _gloffset_SecondaryColor3fEXT 599 -#define _gloffset_SecondaryColor3fvEXT 600 -#define _gloffset_SecondaryColor3iEXT 601 -#define _gloffset_SecondaryColor3ivEXT 602 -#define _gloffset_SecondaryColor3sEXT 603 -#define _gloffset_SecondaryColor3svEXT 604 -#define _gloffset_SecondaryColor3ubEXT 605 -#define _gloffset_SecondaryColor3ubvEXT 606 -#define _gloffset_SecondaryColor3uiEXT 607 -#define _gloffset_SecondaryColor3uivEXT 608 -#define _gloffset_SecondaryColor3usEXT 609 -#define _gloffset_SecondaryColor3usvEXT 610 -#define _gloffset_SecondaryColorPointerEXT 611 -#define _gloffset_MultiDrawArraysEXT 612 -#define _gloffset_MultiDrawElementsEXT 613 -#define _gloffset_FogCoordPointerEXT 614 -#define _gloffset_FogCoorddEXT 615 -#define _gloffset_FogCoorddvEXT 616 -#define _gloffset_FogCoordfEXT 617 -#define _gloffset_FogCoordfvEXT 618 -#define _gloffset_PixelTexGenSGIX 619 -#define _gloffset_BlendFuncSeparateEXT 620 -#define _gloffset_FlushVertexArrayRangeNV 621 -#define _gloffset_VertexArrayRangeNV 622 -#define _gloffset_CombinerInputNV 623 -#define _gloffset_CombinerOutputNV 624 -#define _gloffset_CombinerParameterfNV 625 -#define _gloffset_CombinerParameterfvNV 626 -#define _gloffset_CombinerParameteriNV 627 -#define _gloffset_CombinerParameterivNV 628 -#define _gloffset_FinalCombinerInputNV 629 -#define _gloffset_GetCombinerInputParameterfvNV 630 -#define _gloffset_GetCombinerInputParameterivNV 631 -#define _gloffset_GetCombinerOutputParameterfvNV 632 -#define _gloffset_GetCombinerOutputParameterivNV 633 -#define _gloffset_GetFinalCombinerInputParameterfvNV 634 -#define _gloffset_GetFinalCombinerInputParameterivNV 635 -#define _gloffset_ResizeBuffersMESA 636 -#define _gloffset_WindowPos2dMESA 637 -#define _gloffset_WindowPos2dvMESA 638 -#define _gloffset_WindowPos2fMESA 639 -#define _gloffset_WindowPos2fvMESA 640 -#define _gloffset_WindowPos2iMESA 641 -#define _gloffset_WindowPos2ivMESA 642 -#define _gloffset_WindowPos2sMESA 643 -#define _gloffset_WindowPos2svMESA 644 -#define _gloffset_WindowPos3dMESA 645 -#define _gloffset_WindowPos3dvMESA 646 -#define _gloffset_WindowPos3fMESA 647 -#define _gloffset_WindowPos3fvMESA 648 -#define _gloffset_WindowPos3iMESA 649 -#define _gloffset_WindowPos3ivMESA 650 -#define _gloffset_WindowPos3sMESA 651 -#define _gloffset_WindowPos3svMESA 652 -#define _gloffset_WindowPos4dMESA 653 -#define _gloffset_WindowPos4dvMESA 654 -#define _gloffset_WindowPos4fMESA 655 -#define _gloffset_WindowPos4fvMESA 656 -#define _gloffset_WindowPos4iMESA 657 -#define _gloffset_WindowPos4ivMESA 658 -#define _gloffset_WindowPos4sMESA 659 -#define _gloffset_WindowPos4svMESA 660 -#define _gloffset_MultiModeDrawArraysIBM 661 -#define _gloffset_MultiModeDrawElementsIBM 662 -#define _gloffset_DeleteFencesNV 663 -#define _gloffset_FinishFenceNV 664 -#define _gloffset_GenFencesNV 665 -#define _gloffset_GetFenceivNV 666 -#define _gloffset_IsFenceNV 667 -#define _gloffset_SetFenceNV 668 -#define _gloffset_TestFenceNV 669 -#define _gloffset_AreProgramsResidentNV 670 -#define _gloffset_BindProgramNV 671 -#define _gloffset_DeleteProgramsNV 672 -#define _gloffset_ExecuteProgramNV 673 -#define _gloffset_GenProgramsNV 674 -#define _gloffset_GetProgramParameterdvNV 675 -#define _gloffset_GetProgramParameterfvNV 676 -#define _gloffset_GetProgramStringNV 677 -#define _gloffset_GetProgramivNV 678 -#define _gloffset_GetTrackMatrixivNV 679 -#define _gloffset_GetVertexAttribPointervNV 680 -#define _gloffset_GetVertexAttribdvNV 681 -#define _gloffset_GetVertexAttribfvNV 682 -#define _gloffset_GetVertexAttribivNV 683 -#define _gloffset_IsProgramNV 684 -#define _gloffset_LoadProgramNV 685 -#define _gloffset_ProgramParameters4dvNV 686 -#define _gloffset_ProgramParameters4fvNV 687 -#define _gloffset_RequestResidentProgramsNV 688 -#define _gloffset_TrackMatrixNV 689 -#define _gloffset_VertexAttrib1dNV 690 -#define _gloffset_VertexAttrib1dvNV 691 -#define _gloffset_VertexAttrib1fNV 692 -#define _gloffset_VertexAttrib1fvNV 693 -#define _gloffset_VertexAttrib1sNV 694 -#define _gloffset_VertexAttrib1svNV 695 -#define _gloffset_VertexAttrib2dNV 696 -#define _gloffset_VertexAttrib2dvNV 697 -#define _gloffset_VertexAttrib2fNV 698 -#define _gloffset_VertexAttrib2fvNV 699 -#define _gloffset_VertexAttrib2sNV 700 -#define _gloffset_VertexAttrib2svNV 701 -#define _gloffset_VertexAttrib3dNV 702 -#define _gloffset_VertexAttrib3dvNV 703 -#define _gloffset_VertexAttrib3fNV 704 -#define _gloffset_VertexAttrib3fvNV 705 -#define _gloffset_VertexAttrib3sNV 706 -#define _gloffset_VertexAttrib3svNV 707 -#define _gloffset_VertexAttrib4dNV 708 -#define _gloffset_VertexAttrib4dvNV 709 -#define _gloffset_VertexAttrib4fNV 710 -#define _gloffset_VertexAttrib4fvNV 711 -#define _gloffset_VertexAttrib4sNV 712 -#define _gloffset_VertexAttrib4svNV 713 -#define _gloffset_VertexAttrib4ubNV 714 -#define _gloffset_VertexAttrib4ubvNV 715 -#define _gloffset_VertexAttribPointerNV 716 -#define _gloffset_VertexAttribs1dvNV 717 -#define _gloffset_VertexAttribs1fvNV 718 -#define _gloffset_VertexAttribs1svNV 719 -#define _gloffset_VertexAttribs2dvNV 720 -#define _gloffset_VertexAttribs2fvNV 721 -#define _gloffset_VertexAttribs2svNV 722 -#define _gloffset_VertexAttribs3dvNV 723 -#define _gloffset_VertexAttribs3fvNV 724 -#define _gloffset_VertexAttribs3svNV 725 -#define _gloffset_VertexAttribs4dvNV 726 -#define _gloffset_VertexAttribs4fvNV 727 -#define _gloffset_VertexAttribs4svNV 728 -#define _gloffset_VertexAttribs4ubvNV 729 -#define _gloffset_GetTexBumpParameterfvATI 730 -#define _gloffset_GetTexBumpParameterivATI 731 -#define _gloffset_TexBumpParameterfvATI 732 -#define _gloffset_TexBumpParameterivATI 733 -#define _gloffset_AlphaFragmentOp1ATI 734 -#define _gloffset_AlphaFragmentOp2ATI 735 -#define _gloffset_AlphaFragmentOp3ATI 736 -#define _gloffset_BeginFragmentShaderATI 737 -#define _gloffset_BindFragmentShaderATI 738 -#define _gloffset_ColorFragmentOp1ATI 739 -#define _gloffset_ColorFragmentOp2ATI 740 -#define _gloffset_ColorFragmentOp3ATI 741 -#define _gloffset_DeleteFragmentShaderATI 742 -#define _gloffset_EndFragmentShaderATI 743 -#define _gloffset_GenFragmentShadersATI 744 -#define _gloffset_PassTexCoordATI 745 -#define _gloffset_SampleMapATI 746 -#define _gloffset_SetFragmentShaderConstantATI 747 -#define _gloffset_PointParameteriNV 748 -#define _gloffset_PointParameterivNV 749 -#define _gloffset_ActiveStencilFaceEXT 750 -#define _gloffset_BindVertexArrayAPPLE 751 -#define _gloffset_DeleteVertexArraysAPPLE 752 -#define _gloffset_GenVertexArraysAPPLE 753 -#define _gloffset_IsVertexArrayAPPLE 754 -#define _gloffset_GetProgramNamedParameterdvNV 755 -#define _gloffset_GetProgramNamedParameterfvNV 756 -#define _gloffset_ProgramNamedParameter4dNV 757 -#define _gloffset_ProgramNamedParameter4dvNV 758 -#define _gloffset_ProgramNamedParameter4fNV 759 -#define _gloffset_ProgramNamedParameter4fvNV 760 -#define _gloffset_DepthBoundsEXT 761 -#define _gloffset_BlendEquationSeparateEXT 762 -#define _gloffset_BindFramebufferEXT 763 -#define _gloffset_BindRenderbufferEXT 764 -#define _gloffset_CheckFramebufferStatusEXT 765 -#define _gloffset_DeleteFramebuffersEXT 766 -#define _gloffset_DeleteRenderbuffersEXT 767 -#define _gloffset_FramebufferRenderbufferEXT 768 -#define _gloffset_FramebufferTexture1DEXT 769 -#define _gloffset_FramebufferTexture2DEXT 770 -#define _gloffset_FramebufferTexture3DEXT 771 -#define _gloffset_GenFramebuffersEXT 772 -#define _gloffset_GenRenderbuffersEXT 773 -#define _gloffset_GenerateMipmapEXT 774 -#define _gloffset_GetFramebufferAttachmentParameterivEXT 775 -#define _gloffset_GetRenderbufferParameterivEXT 776 -#define _gloffset_IsFramebufferEXT 777 -#define _gloffset_IsRenderbufferEXT 778 -#define _gloffset_RenderbufferStorageEXT 779 -#define _gloffset_BlitFramebufferEXT 780 -#define _gloffset_BufferParameteriAPPLE 781 -#define _gloffset_FlushMappedBufferRangeAPPLE 782 -#define _gloffset_FramebufferTextureLayerEXT 783 -#define _gloffset_ProvokingVertexEXT 784 -#define _gloffset_GetTexParameterPointervAPPLE 785 -#define _gloffset_TextureRangeAPPLE 786 -#define _gloffset_StencilFuncSeparateATI 787 -#define _gloffset_ProgramEnvParameters4fvEXT 788 -#define _gloffset_ProgramLocalParameters4fvEXT 789 -#define _gloffset_GetQueryObjecti64vEXT 790 -#define _gloffset_GetQueryObjectui64vEXT 791 -#define _gloffset_FIRST_DYNAMIC 792 +#define _gloffset_DrawElementsBaseVertex 574 +#define _gloffset_DrawRangeElementsBaseVertex 575 +#define _gloffset_MultiDrawElementsBaseVertex 576 +#define _gloffset_PolygonOffsetEXT 577 +#define _gloffset_GetPixelTexGenParameterfvSGIS 578 +#define _gloffset_GetPixelTexGenParameterivSGIS 579 +#define _gloffset_PixelTexGenParameterfSGIS 580 +#define _gloffset_PixelTexGenParameterfvSGIS 581 +#define _gloffset_PixelTexGenParameteriSGIS 582 +#define _gloffset_PixelTexGenParameterivSGIS 583 +#define _gloffset_SampleMaskSGIS 584 +#define _gloffset_SamplePatternSGIS 585 +#define _gloffset_ColorPointerEXT 586 +#define _gloffset_EdgeFlagPointerEXT 587 +#define _gloffset_IndexPointerEXT 588 +#define _gloffset_NormalPointerEXT 589 +#define _gloffset_TexCoordPointerEXT 590 +#define _gloffset_VertexPointerEXT 591 +#define _gloffset_PointParameterfEXT 592 +#define _gloffset_PointParameterfvEXT 593 +#define _gloffset_LockArraysEXT 594 +#define _gloffset_UnlockArraysEXT 595 +#define _gloffset_CullParameterdvEXT 596 +#define _gloffset_CullParameterfvEXT 597 +#define _gloffset_SecondaryColor3bEXT 598 +#define _gloffset_SecondaryColor3bvEXT 599 +#define _gloffset_SecondaryColor3dEXT 600 +#define _gloffset_SecondaryColor3dvEXT 601 +#define _gloffset_SecondaryColor3fEXT 602 +#define _gloffset_SecondaryColor3fvEXT 603 +#define _gloffset_SecondaryColor3iEXT 604 +#define _gloffset_SecondaryColor3ivEXT 605 +#define _gloffset_SecondaryColor3sEXT 606 +#define _gloffset_SecondaryColor3svEXT 607 +#define _gloffset_SecondaryColor3ubEXT 608 +#define _gloffset_SecondaryColor3ubvEXT 609 +#define _gloffset_SecondaryColor3uiEXT 610 +#define _gloffset_SecondaryColor3uivEXT 611 +#define _gloffset_SecondaryColor3usEXT 612 +#define _gloffset_SecondaryColor3usvEXT 613 +#define _gloffset_SecondaryColorPointerEXT 614 +#define _gloffset_MultiDrawArraysEXT 615 +#define _gloffset_MultiDrawElementsEXT 616 +#define _gloffset_FogCoordPointerEXT 617 +#define _gloffset_FogCoorddEXT 618 +#define _gloffset_FogCoorddvEXT 619 +#define _gloffset_FogCoordfEXT 620 +#define _gloffset_FogCoordfvEXT 621 +#define _gloffset_PixelTexGenSGIX 622 +#define _gloffset_BlendFuncSeparateEXT 623 +#define _gloffset_FlushVertexArrayRangeNV 624 +#define _gloffset_VertexArrayRangeNV 625 +#define _gloffset_CombinerInputNV 626 +#define _gloffset_CombinerOutputNV 627 +#define _gloffset_CombinerParameterfNV 628 +#define _gloffset_CombinerParameterfvNV 629 +#define _gloffset_CombinerParameteriNV 630 +#define _gloffset_CombinerParameterivNV 631 +#define _gloffset_FinalCombinerInputNV 632 +#define _gloffset_GetCombinerInputParameterfvNV 633 +#define _gloffset_GetCombinerInputParameterivNV 634 +#define _gloffset_GetCombinerOutputParameterfvNV 635 +#define _gloffset_GetCombinerOutputParameterivNV 636 +#define _gloffset_GetFinalCombinerInputParameterfvNV 637 +#define _gloffset_GetFinalCombinerInputParameterivNV 638 +#define _gloffset_ResizeBuffersMESA 639 +#define _gloffset_WindowPos2dMESA 640 +#define _gloffset_WindowPos2dvMESA 641 +#define _gloffset_WindowPos2fMESA 642 +#define _gloffset_WindowPos2fvMESA 643 +#define _gloffset_WindowPos2iMESA 644 +#define _gloffset_WindowPos2ivMESA 645 +#define _gloffset_WindowPos2sMESA 646 +#define _gloffset_WindowPos2svMESA 647 +#define _gloffset_WindowPos3dMESA 648 +#define _gloffset_WindowPos3dvMESA 649 +#define _gloffset_WindowPos3fMESA 650 +#define _gloffset_WindowPos3fvMESA 651 +#define _gloffset_WindowPos3iMESA 652 +#define _gloffset_WindowPos3ivMESA 653 +#define _gloffset_WindowPos3sMESA 654 +#define _gloffset_WindowPos3svMESA 655 +#define _gloffset_WindowPos4dMESA 656 +#define _gloffset_WindowPos4dvMESA 657 +#define _gloffset_WindowPos4fMESA 658 +#define _gloffset_WindowPos4fvMESA 659 +#define _gloffset_WindowPos4iMESA 660 +#define _gloffset_WindowPos4ivMESA 661 +#define _gloffset_WindowPos4sMESA 662 +#define _gloffset_WindowPos4svMESA 663 +#define _gloffset_MultiModeDrawArraysIBM 664 +#define _gloffset_MultiModeDrawElementsIBM 665 +#define _gloffset_DeleteFencesNV 666 +#define _gloffset_FinishFenceNV 667 +#define _gloffset_GenFencesNV 668 +#define _gloffset_GetFenceivNV 669 +#define _gloffset_IsFenceNV 670 +#define _gloffset_SetFenceNV 671 +#define _gloffset_TestFenceNV 672 +#define _gloffset_AreProgramsResidentNV 673 +#define _gloffset_BindProgramNV 674 +#define _gloffset_DeleteProgramsNV 675 +#define _gloffset_ExecuteProgramNV 676 +#define _gloffset_GenProgramsNV 677 +#define _gloffset_GetProgramParameterdvNV 678 +#define _gloffset_GetProgramParameterfvNV 679 +#define _gloffset_GetProgramStringNV 680 +#define _gloffset_GetProgramivNV 681 +#define _gloffset_GetTrackMatrixivNV 682 +#define _gloffset_GetVertexAttribPointervNV 683 +#define _gloffset_GetVertexAttribdvNV 684 +#define _gloffset_GetVertexAttribfvNV 685 +#define _gloffset_GetVertexAttribivNV 686 +#define _gloffset_IsProgramNV 687 +#define _gloffset_LoadProgramNV 688 +#define _gloffset_ProgramParameters4dvNV 689 +#define _gloffset_ProgramParameters4fvNV 690 +#define _gloffset_RequestResidentProgramsNV 691 +#define _gloffset_TrackMatrixNV 692 +#define _gloffset_VertexAttrib1dNV 693 +#define _gloffset_VertexAttrib1dvNV 694 +#define _gloffset_VertexAttrib1fNV 695 +#define _gloffset_VertexAttrib1fvNV 696 +#define _gloffset_VertexAttrib1sNV 697 +#define _gloffset_VertexAttrib1svNV 698 +#define _gloffset_VertexAttrib2dNV 699 +#define _gloffset_VertexAttrib2dvNV 700 +#define _gloffset_VertexAttrib2fNV 701 +#define _gloffset_VertexAttrib2fvNV 702 +#define _gloffset_VertexAttrib2sNV 703 +#define _gloffset_VertexAttrib2svNV 704 +#define _gloffset_VertexAttrib3dNV 705 +#define _gloffset_VertexAttrib3dvNV 706 +#define _gloffset_VertexAttrib3fNV 707 +#define _gloffset_VertexAttrib3fvNV 708 +#define _gloffset_VertexAttrib3sNV 709 +#define _gloffset_VertexAttrib3svNV 710 +#define _gloffset_VertexAttrib4dNV 711 +#define _gloffset_VertexAttrib4dvNV 712 +#define _gloffset_VertexAttrib4fNV 713 +#define _gloffset_VertexAttrib4fvNV 714 +#define _gloffset_VertexAttrib4sNV 715 +#define _gloffset_VertexAttrib4svNV 716 +#define _gloffset_VertexAttrib4ubNV 717 +#define _gloffset_VertexAttrib4ubvNV 718 +#define _gloffset_VertexAttribPointerNV 719 +#define _gloffset_VertexAttribs1dvNV 720 +#define _gloffset_VertexAttribs1fvNV 721 +#define _gloffset_VertexAttribs1svNV 722 +#define _gloffset_VertexAttribs2dvNV 723 +#define _gloffset_VertexAttribs2fvNV 724 +#define _gloffset_VertexAttribs2svNV 725 +#define _gloffset_VertexAttribs3dvNV 726 +#define _gloffset_VertexAttribs3fvNV 727 +#define _gloffset_VertexAttribs3svNV 728 +#define _gloffset_VertexAttribs4dvNV 729 +#define _gloffset_VertexAttribs4fvNV 730 +#define _gloffset_VertexAttribs4svNV 731 +#define _gloffset_VertexAttribs4ubvNV 732 +#define _gloffset_GetTexBumpParameterfvATI 733 +#define _gloffset_GetTexBumpParameterivATI 734 +#define _gloffset_TexBumpParameterfvATI 735 +#define _gloffset_TexBumpParameterivATI 736 +#define _gloffset_AlphaFragmentOp1ATI 737 +#define _gloffset_AlphaFragmentOp2ATI 738 +#define _gloffset_AlphaFragmentOp3ATI 739 +#define _gloffset_BeginFragmentShaderATI 740 +#define _gloffset_BindFragmentShaderATI 741 +#define _gloffset_ColorFragmentOp1ATI 742 +#define _gloffset_ColorFragmentOp2ATI 743 +#define _gloffset_ColorFragmentOp3ATI 744 +#define _gloffset_DeleteFragmentShaderATI 745 +#define _gloffset_EndFragmentShaderATI 746 +#define _gloffset_GenFragmentShadersATI 747 +#define _gloffset_PassTexCoordATI 748 +#define _gloffset_SampleMapATI 749 +#define _gloffset_SetFragmentShaderConstantATI 750 +#define _gloffset_PointParameteriNV 751 +#define _gloffset_PointParameterivNV 752 +#define _gloffset_ActiveStencilFaceEXT 753 +#define _gloffset_BindVertexArrayAPPLE 754 +#define _gloffset_DeleteVertexArraysAPPLE 755 +#define _gloffset_GenVertexArraysAPPLE 756 +#define _gloffset_IsVertexArrayAPPLE 757 +#define _gloffset_GetProgramNamedParameterdvNV 758 +#define _gloffset_GetProgramNamedParameterfvNV 759 +#define _gloffset_ProgramNamedParameter4dNV 760 +#define _gloffset_ProgramNamedParameter4dvNV 761 +#define _gloffset_ProgramNamedParameter4fNV 762 +#define _gloffset_ProgramNamedParameter4fvNV 763 +#define _gloffset_DepthBoundsEXT 764 +#define _gloffset_BlendEquationSeparateEXT 765 +#define _gloffset_BindFramebufferEXT 766 +#define _gloffset_BindRenderbufferEXT 767 +#define _gloffset_CheckFramebufferStatusEXT 768 +#define _gloffset_DeleteFramebuffersEXT 769 +#define _gloffset_DeleteRenderbuffersEXT 770 +#define _gloffset_FramebufferRenderbufferEXT 771 +#define _gloffset_FramebufferTexture1DEXT 772 +#define _gloffset_FramebufferTexture2DEXT 773 +#define _gloffset_FramebufferTexture3DEXT 774 +#define _gloffset_GenFramebuffersEXT 775 +#define _gloffset_GenRenderbuffersEXT 776 +#define _gloffset_GenerateMipmapEXT 777 +#define _gloffset_GetFramebufferAttachmentParameterivEXT 778 +#define _gloffset_GetRenderbufferParameterivEXT 779 +#define _gloffset_IsFramebufferEXT 780 +#define _gloffset_IsRenderbufferEXT 781 +#define _gloffset_RenderbufferStorageEXT 782 +#define _gloffset_BlitFramebufferEXT 783 +#define _gloffset_BufferParameteriAPPLE 784 +#define _gloffset_FlushMappedBufferRangeAPPLE 785 +#define _gloffset_FramebufferTextureLayerEXT 786 +#define _gloffset_ProvokingVertexEXT 787 +#define _gloffset_GetTexParameterPointervAPPLE 788 +#define _gloffset_TextureRangeAPPLE 789 +#define _gloffset_StencilFuncSeparateATI 790 +#define _gloffset_ProgramEnvParameters4fvEXT 791 +#define _gloffset_ProgramLocalParameters4fvEXT 792 +#define _gloffset_GetQueryObjecti64vEXT 793 +#define _gloffset_GetQueryObjectui64vEXT 794 +#define _gloffset_FIRST_DYNAMIC 795 #else @@ -994,6 +997,9 @@ #define _gloffset_GetSynciv driDispatchRemapTable[GetSynciv_remap_index] #define _gloffset_IsSync driDispatchRemapTable[IsSync_remap_index] #define _gloffset_WaitSync driDispatchRemapTable[WaitSync_remap_index] +#define _gloffset_DrawElementsBaseVertex driDispatchRemapTable[DrawElementsBaseVertex_remap_index] +#define _gloffset_DrawRangeElementsBaseVertex driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index] +#define _gloffset_MultiDrawElementsBaseVertex driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index] #define _gloffset_PolygonOffsetEXT driDispatchRemapTable[PolygonOffsetEXT_remap_index] #define _gloffset_GetPixelTexGenParameterfvSGIS driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index] #define _gloffset_GetPixelTexGenParameterivSGIS driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index] diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 855fcaa7fe..4f9e53b62d 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -614,224 +614,227 @@ struct _glapi_table void (GLAPIENTRYP GetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values); /* 571 */ GLboolean (GLAPIENTRYP IsSync)(GLsync sync); /* 572 */ void (GLAPIENTRYP WaitSync)(GLsync sync, GLbitfield flags, GLuint64 timeout); /* 573 */ - void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 574 */ - void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 575 */ - void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 576 */ - void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 577 */ - void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 578 */ - void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 579 */ - void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 580 */ - void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 581 */ - void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 582 */ - void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 583 */ - void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 584 */ - void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 585 */ - void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 586 */ - void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 587 */ - void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 588 */ - void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 589 */ - void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 590 */ - void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 591 */ - void (GLAPIENTRYP UnlockArraysEXT)(void); /* 592 */ - void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 593 */ - void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 594 */ - void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 595 */ - void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 596 */ - void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 597 */ - void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 598 */ - void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 599 */ - void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 600 */ - void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 601 */ - void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 602 */ - void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 603 */ - void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 604 */ - void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 605 */ - void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 606 */ - void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 607 */ - void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 608 */ - void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 609 */ - void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 610 */ - void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 611 */ - void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 612 */ - void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 613 */ - void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 614 */ - void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 615 */ - void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 616 */ - void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 617 */ - void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 618 */ - void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 619 */ - void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 620 */ - void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 621 */ - void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 622 */ - void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 623 */ - void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 624 */ - void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 625 */ - void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 626 */ - void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 627 */ - void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 628 */ - void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 629 */ - void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 630 */ - void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 631 */ - void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 632 */ - void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 633 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 634 */ - void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 635 */ - void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 636 */ - void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 637 */ - void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 638 */ - void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 639 */ - void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 640 */ - void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 641 */ - void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 642 */ - void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 643 */ - void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 644 */ - void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 645 */ - void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 646 */ - void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 647 */ - void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 648 */ - void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 649 */ - void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 650 */ - void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 651 */ - void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 652 */ - void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 653 */ - void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 654 */ - void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 655 */ - void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 656 */ - void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 657 */ - void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 658 */ - void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 659 */ - void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 660 */ - void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 661 */ - void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 662 */ - void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 663 */ - void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 664 */ - void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 665 */ - void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 666 */ - GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 667 */ - void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 668 */ - GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 669 */ - GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 670 */ - void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 671 */ - void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 672 */ - void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 673 */ - void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 674 */ - void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 675 */ - void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 676 */ - void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 677 */ - void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 678 */ - void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 679 */ - void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 680 */ - void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 681 */ - void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 682 */ - void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 683 */ - GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 684 */ - void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 685 */ - void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 686 */ - void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 687 */ - void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 688 */ - void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 689 */ - void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 690 */ - void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 691 */ - void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 692 */ - void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 693 */ - void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 694 */ - void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 695 */ - void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 696 */ - void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 697 */ - void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 698 */ - void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 699 */ - void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 700 */ - void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 701 */ - void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 702 */ - void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 703 */ - void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 704 */ - void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 705 */ - void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 706 */ - void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 707 */ - void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 708 */ - void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 709 */ - void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 710 */ - void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 711 */ - void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 712 */ - void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 713 */ - void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 714 */ - void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 715 */ - void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 716 */ - void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */ - void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */ - void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */ - void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 720 */ - void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 721 */ - void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 722 */ - void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 723 */ - void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 724 */ - void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 725 */ - void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 726 */ - void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 727 */ - void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 728 */ - void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 729 */ - void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 730 */ - void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 731 */ - void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 732 */ - void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 733 */ - void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 734 */ - void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 735 */ - void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 736 */ - void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 737 */ - void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 738 */ - void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 739 */ - void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 740 */ - void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 741 */ - void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 742 */ - void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 743 */ - GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 744 */ - void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 745 */ - void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 746 */ - void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 747 */ - void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 748 */ - void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 749 */ - void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 750 */ - void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 751 */ - void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 752 */ - void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 753 */ - GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 754 */ - void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 755 */ - void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 756 */ - void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 757 */ - void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 758 */ - void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 759 */ - void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 760 */ - void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 761 */ - void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 762 */ - void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 763 */ - void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 764 */ - GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 765 */ - void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 766 */ - void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 767 */ - void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 768 */ - void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 769 */ - void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 770 */ - void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 771 */ - void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 772 */ - void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 773 */ - void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 774 */ - void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 775 */ - void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 776 */ - GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 777 */ - GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 778 */ - void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 779 */ - void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 780 */ - void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 781 */ - void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 782 */ - void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 783 */ - void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 784 */ - void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 785 */ - void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 786 */ - void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 787 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 788 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 789 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 790 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 791 */ + void (GLAPIENTRYP DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 574 */ + void (GLAPIENTRYP DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); /* 575 */ + void (GLAPIENTRYP MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex); /* 576 */ + void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 577 */ + void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 578 */ + void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 579 */ + void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 580 */ + void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 581 */ + void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 582 */ + void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 583 */ + void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 584 */ + void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 585 */ + void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 586 */ + void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 587 */ + void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 588 */ + void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 589 */ + void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 590 */ + void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 591 */ + void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 592 */ + void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 593 */ + void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 594 */ + void (GLAPIENTRYP UnlockArraysEXT)(void); /* 595 */ + void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 596 */ + void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 597 */ + void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 598 */ + void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 599 */ + void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 600 */ + void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 601 */ + void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 602 */ + void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 603 */ + void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 604 */ + void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 605 */ + void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 606 */ + void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 607 */ + void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 608 */ + void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 609 */ + void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 610 */ + void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 611 */ + void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 612 */ + void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 613 */ + void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 614 */ + void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 615 */ + void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 616 */ + void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 617 */ + void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 618 */ + void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 619 */ + void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 620 */ + void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 621 */ + void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 622 */ + void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 623 */ + void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 624 */ + void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 625 */ + void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 626 */ + void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 627 */ + void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 628 */ + void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 629 */ + void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 630 */ + void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 631 */ + void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 632 */ + void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 633 */ + void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 634 */ + void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 635 */ + void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 636 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 637 */ + void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 638 */ + void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 639 */ + void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 640 */ + void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 641 */ + void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 642 */ + void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 643 */ + void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 644 */ + void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 645 */ + void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 646 */ + void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 647 */ + void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 648 */ + void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 649 */ + void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 650 */ + void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 651 */ + void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 652 */ + void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 653 */ + void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 654 */ + void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 655 */ + void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 656 */ + void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 657 */ + void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 658 */ + void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 659 */ + void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 660 */ + void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 661 */ + void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 662 */ + void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 663 */ + void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 664 */ + void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 665 */ + void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 666 */ + void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 667 */ + void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 668 */ + void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 669 */ + GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 670 */ + void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 671 */ + GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 672 */ + GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 673 */ + void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 674 */ + void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 675 */ + void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 676 */ + void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 677 */ + void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 678 */ + void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 679 */ + void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 680 */ + void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 681 */ + void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 682 */ + void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 683 */ + void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 684 */ + void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 685 */ + void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 686 */ + GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 687 */ + void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 688 */ + void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 689 */ + void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 690 */ + void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 691 */ + void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 692 */ + void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 693 */ + void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 694 */ + void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 695 */ + void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 696 */ + void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 697 */ + void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 698 */ + void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 699 */ + void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 700 */ + void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 701 */ + void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 702 */ + void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 703 */ + void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 704 */ + void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 705 */ + void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 706 */ + void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 707 */ + void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 708 */ + void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 709 */ + void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 710 */ + void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 711 */ + void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 712 */ + void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 713 */ + void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 714 */ + void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 715 */ + void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 716 */ + void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 717 */ + void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 718 */ + void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 719 */ + void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 720 */ + void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 721 */ + void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 722 */ + void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 723 */ + void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 724 */ + void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 725 */ + void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 726 */ + void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 727 */ + void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 728 */ + void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 729 */ + void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 730 */ + void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 731 */ + void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 732 */ + void (GLAPIENTRYP GetTexBumpParameterfvATI)(GLenum pname, GLfloat * param); /* 733 */ + void (GLAPIENTRYP GetTexBumpParameterivATI)(GLenum pname, GLint * param); /* 734 */ + void (GLAPIENTRYP TexBumpParameterfvATI)(GLenum pname, const GLfloat * param); /* 735 */ + void (GLAPIENTRYP TexBumpParameterivATI)(GLenum pname, const GLint * param); /* 736 */ + void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 737 */ + void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 738 */ + void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 739 */ + void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 740 */ + void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 741 */ + void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 742 */ + void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 743 */ + void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 744 */ + void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 745 */ + void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 746 */ + GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 747 */ + void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 748 */ + void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 749 */ + void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 750 */ + void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 751 */ + void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 752 */ + void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 753 */ + void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 754 */ + void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 755 */ + void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 756 */ + GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 757 */ + void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 758 */ + void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 759 */ + void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 760 */ + void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 761 */ + void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 762 */ + void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 763 */ + void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 764 */ + void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 765 */ + void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 766 */ + void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 767 */ + GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 768 */ + void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 769 */ + void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 770 */ + void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 771 */ + void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 772 */ + void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 773 */ + void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 774 */ + void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 775 */ + void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 776 */ + void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 777 */ + void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 778 */ + void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 779 */ + GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 780 */ + GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 781 */ + void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 782 */ + void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 783 */ + void (GLAPIENTRYP BufferParameteriAPPLE)(GLenum target, GLenum pname, GLint param); /* 784 */ + void (GLAPIENTRYP FlushMappedBufferRangeAPPLE)(GLenum target, GLintptr offset, GLsizeiptr size); /* 785 */ + void (GLAPIENTRYP FramebufferTextureLayerEXT)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); /* 786 */ + void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 787 */ + void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 788 */ + void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 789 */ + void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 790 */ + void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 791 */ + void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 792 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 793 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 794 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index e08f9548f5..d9a3690f2a 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -4071,63 +4071,78 @@ KEYWORD1 void KEYWORD2 NAME(WaitSync)(GLsync sync, GLbitfield flags, GLuint64 ti DISPATCH(WaitSync, (sync, flags, timeout), (F, "glWaitSync(%d, %d, %d);\n", sync, flags, timeout)); } +KEYWORD1 void KEYWORD2 NAME(DrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex) +{ + DISPATCH(DrawElementsBaseVertex, (mode, count, type, indices, basevertex), (F, "glDrawElementsBaseVertex(0x%x, %d, 0x%x, %p, %d);\n", mode, count, type, (const void *) indices, basevertex)); +} + +KEYWORD1 void KEYWORD2 NAME(DrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex) +{ + DISPATCH(DrawRangeElementsBaseVertex, (mode, start, end, count, type, indices, basevertex), (F, "glDrawRangeElementsBaseVertex(0x%x, %d, %d, %d, 0x%x, %p, %d);\n", mode, start, end, count, type, (const void *) indices, basevertex)); +} + +KEYWORD1 void KEYWORD2 NAME(MultiDrawElementsBaseVertex)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount, const GLint * basevertex) +{ + DISPATCH(MultiDrawElementsBaseVertex, (mode, count, type, indices, primcount, basevertex), (F, "glMultiDrawElementsBaseVertex(0x%x, %p, 0x%x, %p, %d, %p);\n", mode, (const void *) count, type, (const void *) indices, primcount, (const void *) basevertex)); +} + KEYWORD1 void KEYWORD2 NAME(PolygonOffsetEXT)(GLfloat factor, GLfloat bias) { DISPATCH(PolygonOffsetEXT, (factor, bias), (F, "glPolygonOffsetEXT(%f, %f);\n", factor, bias)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_575)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_575)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, GLfloat * params) { DISPATCH(GetPixelTexGenParameterfvSGIS, (pname, params), (F, "glGetPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_576)(GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(GLenum pname, GLint * params) { DISPATCH(GetPixelTexGenParameterivSGIS, (pname, params), (F, "glGetPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_577)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, GLfloat param) { DISPATCH(PixelTexGenParameterfSGIS, (pname, param), (F, "glPixelTexGenParameterfSGIS(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_578)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLenum pname, const GLfloat * params) { DISPATCH(PixelTexGenParameterfvSGIS, (pname, params), (F, "glPixelTexGenParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(GLenum pname, GLint param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLint param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_579)(GLenum pname, GLint param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pname, GLint param) { DISPATCH(PixelTexGenParameteriSGIS, (pname, param), (F, "glPixelTexGenParameteriSGIS(0x%x, %d);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, const GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_583)(GLenum pname, const GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_580)(GLenum pname, const GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_583)(GLenum pname, const GLint * params) { DISPATCH(PixelTexGenParameterivSGIS, (pname, params), (F, "glPixelTexGenParameterivSGIS(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLclampf value, GLboolean invert); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_584)(GLclampf value, GLboolean invert); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_581)(GLclampf value, GLboolean invert) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_584)(GLclampf value, GLboolean invert) { DISPATCH(SampleMaskSGIS, (value, invert), (F, "glSampleMaskSGIS(%f, %d);\n", value, invert)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pattern); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_585)(GLenum pattern); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_582)(GLenum pattern) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_585)(GLenum pattern) { DISPATCH(SamplePatternSGIS, (pattern), (F, "glSamplePatternSGIS(0x%x);\n", pattern)); } @@ -4177,9 +4192,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfEXT)(GLenum pname, GLfloat param) DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfEXT(0x%x, %f);\n", pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_589)(GLenum pname, GLfloat param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_592)(GLenum pname, GLfloat param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_589)(GLenum pname, GLfloat param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_592)(GLenum pname, GLfloat param) { DISPATCH(PointParameterfEXT, (pname, param), (F, "glPointParameterfSGIS(0x%x, %f);\n", pname, param)); } @@ -4199,9 +4214,9 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterfvEXT)(GLenum pname, const GLfloat * p DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_590)(GLenum pname, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_590)(GLenum pname, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, const GLfloat * params) { DISPATCH(PointParameterfvEXT, (pname, params), (F, "glPointParameterfvSGIS(0x%x, %p);\n", pname, (const void *) params)); } @@ -4216,16 +4231,16 @@ KEYWORD1 void KEYWORD2 NAME(UnlockArraysEXT)(void) DISPATCH(UnlockArraysEXT, (), (F, "glUnlockArraysEXT();\n")); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, GLdouble * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_596)(GLenum pname, GLdouble * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_593)(GLenum pname, GLdouble * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_596)(GLenum pname, GLdouble * params) { DISPATCH(CullParameterdvEXT, (pname, params), (F, "glCullParameterdvEXT(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_594)(GLenum pname, GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_597)(GLenum pname, GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_594)(GLenum pname, GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_597)(GLenum pname, GLfloat * params) { DISPATCH(CullParameterfvEXT, (pname, params), (F, "glCullParameterfvEXT(0x%x, %p);\n", pname, (const void *) params)); } @@ -4470,9 +4485,9 @@ KEYWORD1 void KEYWORD2 NAME(FogCoordfvEXT)(const GLfloat * coord) DISPATCH(FogCoordfvEXT, (coord), (F, "glFogCoordfvEXT(%p);\n", (const void *) coord)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_619)(GLenum mode); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_622)(GLenum mode); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_619)(GLenum mode) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_622)(GLenum mode) { DISPATCH(PixelTexGenSGIX, (mode), (F, "glPixelTexGenSGIX(0x%x);\n", mode)); } @@ -4487,9 +4502,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfac DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateEXT(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_620)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_623)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_620)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_623)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { DISPATCH(BlendFuncSeparateEXT, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha), (F, "glBlendFuncSeparateINGR(0x%x, 0x%x, 0x%x, 0x%x);\n", sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)); } @@ -4854,65 +4869,65 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_661)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) { DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_662)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) { DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_663)(GLsizei n, const GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLsizei n, const GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_663)(GLsizei n, const GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLsizei n, const GLuint * fences) { DISPATCH(DeleteFencesNV, (n, fences), (F, "glDeleteFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(GLuint fence); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_664)(GLuint fence) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence) { DISPATCH(FinishFenceNV, (fence), (F, "glFinishFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(GLsizei n, GLuint * fences); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLsizei n, GLuint * fences); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_665)(GLsizei n, GLuint * fences) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLsizei n, GLuint * fences) { DISPATCH(GenFencesNV, (n, fences), (F, "glGenFencesNV(%d, %p);\n", n, (const void *) fences)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLuint fence, GLenum pname, GLint * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence, GLenum pname, GLint * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_666)(GLuint fence, GLenum pname, GLint * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence, GLenum pname, GLint * params) { DISPATCH(GetFenceivNV, (fence, pname, params), (F, "glGetFenceivNV(%d, 0x%x, %p);\n", fence, pname, (const void *) params)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_670)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_667)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_670)(GLuint fence) { RETURN_DISPATCH(IsFenceNV, (fence), (F, "glIsFenceNV(%d);\n", fence)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLuint fence, GLenum condition); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_671)(GLuint fence, GLenum condition); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_668)(GLuint fence, GLenum condition) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_671)(GLuint fence, GLenum condition) { DISPATCH(SetFenceNV, (fence, condition), (F, "glSetFenceNV(%d, 0x%x);\n", fence, condition)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_672)(GLuint fence); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_669)(GLuint fence) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_672)(GLuint fence) { RETURN_DISPATCH(TestFenceNV, (fence), (F, "glTestFenceNV(%d);\n", fence)); } @@ -5357,16 +5372,16 @@ KEYWORD1 void KEYWORD2 NAME(PointParameterivNV)(GLenum pname, const GLint * para DISPATCH(PointParameterivNV, (pname, params), (F, "glPointParameterivNV(0x%x, %p);\n", pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_750)(GLenum face); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLenum face); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_750)(GLenum face) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLenum face) { DISPATCH(ActiveStencilFaceEXT, (face), (F, "glActiveStencilFaceEXT(0x%x);\n", face)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_751)(GLuint array); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_754)(GLuint array); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_751)(GLuint array) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_754)(GLuint array) { DISPATCH(BindVertexArrayAPPLE, (array), (F, "glBindVertexArrayAPPLE(%d);\n", array)); } @@ -5376,16 +5391,16 @@ KEYWORD1 void KEYWORD2 NAME(DeleteVertexArrays)(GLsizei n, const GLuint * arrays DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArrays(%d, %p);\n", n, (const void *) arrays)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_752)(GLsizei n, const GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_755)(GLsizei n, const GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_752)(GLsizei n, const GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_755)(GLsizei n, const GLuint * arrays) { DISPATCH(DeleteVertexArraysAPPLE, (n, arrays), (F, "glDeleteVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLsizei n, GLuint * arrays); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_756)(GLsizei n, GLuint * arrays); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_753)(GLsizei n, GLuint * arrays) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_756)(GLsizei n, GLuint * arrays) { DISPATCH(GenVertexArraysAPPLE, (n, arrays), (F, "glGenVertexArraysAPPLE(%d, %p);\n", n, (const void *) arrays)); } @@ -5395,9 +5410,9 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsVertexArray)(GLuint array) RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArray(%d);\n", array)); } -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_754)(GLuint array); +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_757)(GLuint array); -KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_754)(GLuint array) +KEYWORD1_ALT GLboolean KEYWORD2 NAME(_dispatch_stub_757)(GLuint array) { RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array)); } @@ -5432,9 +5447,9 @@ KEYWORD1 void KEYWORD2 NAME(ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, DISPATCH(ProgramNamedParameter4fvNV, (id, len, name, v), (F, "glProgramNamedParameter4fvNV(%d, %d, %p, %p);\n", id, len, (const void *) name, (const void *) v)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLclampd zmin, GLclampd zmax); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLclampd zmin, GLclampd zmax); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_761)(GLclampd zmin, GLclampd zmax) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_764)(GLclampd zmin, GLclampd zmax) { DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); } @@ -5444,9 +5459,9 @@ KEYWORD1 void KEYWORD2 NAME(BlendEquationSeparate)(GLenum modeRGB, GLenum modeA) DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparate(0x%x, 0x%x);\n", modeRGB, modeA)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_762)(GLenum modeRGB, GLenum modeA); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum modeRGB, GLenum modeA); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_762)(GLenum modeRGB, GLenum modeA) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_765)(GLenum modeRGB, GLenum modeA) { DISPATCH(BlendEquationSeparateEXT, (modeRGB, modeA), (F, "glBlendEquationSeparateEXT(0x%x, 0x%x);\n", modeRGB, modeA)); } @@ -5626,23 +5641,23 @@ KEYWORD1 void KEYWORD2 NAME(BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint src DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_780)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_783)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_780)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_783)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { DISPATCH(BlitFramebufferEXT, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter), (F, "glBlitFramebufferEXT(%d, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x);\n", srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_781)(GLenum target, GLenum pname, GLint param); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_784)(GLenum target, GLenum pname, GLint param); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_781)(GLenum target, GLenum pname, GLint param) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_784)(GLenum target, GLenum pname, GLint param) { DISPATCH(BufferParameteriAPPLE, (target, pname, param), (F, "glBufferParameteriAPPLE(0x%x, 0x%x, %d);\n", target, pname, param)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_782)(GLenum target, GLintptr offset, GLsizeiptr size); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLintptr offset, GLsizeiptr size); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_782)(GLenum target, GLintptr offset, GLsizeiptr size) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLintptr offset, GLsizeiptr size) { DISPATCH(FlushMappedBufferRangeAPPLE, (target, offset, size), (F, "glFlushMappedBufferRangeAPPLE(0x%x, %d, %d);\n", target, offset, size)); } @@ -5662,51 +5677,56 @@ KEYWORD1 void KEYWORD2 NAME(ProvokingVertexEXT)(GLenum mode) DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertexEXT(0x%x);\n", mode)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLenum pname, GLvoid ** params); +KEYWORD1 void KEYWORD2 NAME(ProvokingVertex)(GLenum mode) +{ + DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertex(0x%x);\n", mode)); +} -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_785)(GLenum target, GLenum pname, GLvoid ** params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLenum pname, GLvoid ** params); + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLenum pname, GLvoid ** params) { DISPATCH(GetTexParameterPointervAPPLE, (target, pname, params), (F, "glGetTexParameterPointervAPPLE(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_786)(GLenum target, GLsizei length, GLvoid * pointer); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLsizei length, GLvoid * pointer); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_786)(GLenum target, GLsizei length, GLvoid * pointer) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLsizei length, GLvoid * pointer) { DISPATCH(TextureRangeAPPLE, (target, length, pointer), (F, "glTextureRangeAPPLE(0x%x, %d, %p);\n", target, length, (const void *) pointer)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_787)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_787)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) { DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_792)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_789)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_792)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(GLuint id, GLenum pname, GLint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_793)(GLuint id, GLenum pname, GLint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_790)(GLuint id, GLenum pname, GLint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_793)(GLuint id, GLenum pname, GLint64EXT * params) { DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(GLuint id, GLenum pname, GLuint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_794)(GLuint id, GLenum pname, GLuint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_791)(GLuint id, GLenum pname, GLuint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_794)(GLuint id, GLenum pname, GLuint64EXT * params) { DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } @@ -6299,15 +6319,18 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(GetSynciv), TABLE_ENTRY(IsSync), TABLE_ENTRY(WaitSync), + TABLE_ENTRY(DrawElementsBaseVertex), + TABLE_ENTRY(DrawRangeElementsBaseVertex), + TABLE_ENTRY(MultiDrawElementsBaseVertex), TABLE_ENTRY(PolygonOffsetEXT), - TABLE_ENTRY(_dispatch_stub_575), - TABLE_ENTRY(_dispatch_stub_576), - TABLE_ENTRY(_dispatch_stub_577), TABLE_ENTRY(_dispatch_stub_578), TABLE_ENTRY(_dispatch_stub_579), TABLE_ENTRY(_dispatch_stub_580), TABLE_ENTRY(_dispatch_stub_581), TABLE_ENTRY(_dispatch_stub_582), + TABLE_ENTRY(_dispatch_stub_583), + TABLE_ENTRY(_dispatch_stub_584), + TABLE_ENTRY(_dispatch_stub_585), TABLE_ENTRY(ColorPointerEXT), TABLE_ENTRY(EdgeFlagPointerEXT), TABLE_ENTRY(IndexPointerEXT), @@ -6318,8 +6341,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(PointParameterfvEXT), TABLE_ENTRY(LockArraysEXT), TABLE_ENTRY(UnlockArraysEXT), - TABLE_ENTRY(_dispatch_stub_593), - TABLE_ENTRY(_dispatch_stub_594), + TABLE_ENTRY(_dispatch_stub_596), + TABLE_ENTRY(_dispatch_stub_597), TABLE_ENTRY(SecondaryColor3bEXT), TABLE_ENTRY(SecondaryColor3bvEXT), TABLE_ENTRY(SecondaryColor3dEXT), @@ -6344,7 +6367,7 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(FogCoorddvEXT), TABLE_ENTRY(FogCoordfEXT), TABLE_ENTRY(FogCoordfvEXT), - TABLE_ENTRY(_dispatch_stub_619), + TABLE_ENTRY(_dispatch_stub_622), TABLE_ENTRY(BlendFuncSeparateEXT), TABLE_ENTRY(FlushVertexArrayRangeNV), TABLE_ENTRY(VertexArrayRangeNV), @@ -6386,15 +6409,15 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(WindowPos4ivMESA), TABLE_ENTRY(WindowPos4sMESA), TABLE_ENTRY(WindowPos4svMESA), - TABLE_ENTRY(_dispatch_stub_661), - TABLE_ENTRY(_dispatch_stub_662), - TABLE_ENTRY(_dispatch_stub_663), TABLE_ENTRY(_dispatch_stub_664), TABLE_ENTRY(_dispatch_stub_665), TABLE_ENTRY(_dispatch_stub_666), TABLE_ENTRY(_dispatch_stub_667), TABLE_ENTRY(_dispatch_stub_668), TABLE_ENTRY(_dispatch_stub_669), + TABLE_ENTRY(_dispatch_stub_670), + TABLE_ENTRY(_dispatch_stub_671), + TABLE_ENTRY(_dispatch_stub_672), TABLE_ENTRY(AreProgramsResidentNV), TABLE_ENTRY(BindProgramNV), TABLE_ENTRY(DeleteProgramsNV), @@ -6475,19 +6498,19 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(SetFragmentShaderConstantATI), TABLE_ENTRY(PointParameteriNV), TABLE_ENTRY(PointParameterivNV), - TABLE_ENTRY(_dispatch_stub_750), - TABLE_ENTRY(_dispatch_stub_751), - TABLE_ENTRY(_dispatch_stub_752), TABLE_ENTRY(_dispatch_stub_753), TABLE_ENTRY(_dispatch_stub_754), + TABLE_ENTRY(_dispatch_stub_755), + TABLE_ENTRY(_dispatch_stub_756), + TABLE_ENTRY(_dispatch_stub_757), TABLE_ENTRY(GetProgramNamedParameterdvNV), TABLE_ENTRY(GetProgramNamedParameterfvNV), TABLE_ENTRY(ProgramNamedParameter4dNV), TABLE_ENTRY(ProgramNamedParameter4dvNV), TABLE_ENTRY(ProgramNamedParameter4fNV), TABLE_ENTRY(ProgramNamedParameter4fvNV), - TABLE_ENTRY(_dispatch_stub_761), - TABLE_ENTRY(_dispatch_stub_762), + TABLE_ENTRY(_dispatch_stub_764), + TABLE_ENTRY(_dispatch_stub_765), TABLE_ENTRY(BindFramebufferEXT), TABLE_ENTRY(BindRenderbufferEXT), TABLE_ENTRY(CheckFramebufferStatusEXT), @@ -6505,18 +6528,18 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(IsFramebufferEXT), TABLE_ENTRY(IsRenderbufferEXT), TABLE_ENTRY(RenderbufferStorageEXT), - TABLE_ENTRY(_dispatch_stub_780), - TABLE_ENTRY(_dispatch_stub_781), - TABLE_ENTRY(_dispatch_stub_782), + TABLE_ENTRY(_dispatch_stub_783), + TABLE_ENTRY(_dispatch_stub_784), + TABLE_ENTRY(_dispatch_stub_785), TABLE_ENTRY(FramebufferTextureLayerEXT), TABLE_ENTRY(ProvokingVertexEXT), - TABLE_ENTRY(_dispatch_stub_785), - TABLE_ENTRY(_dispatch_stub_786), - TABLE_ENTRY(_dispatch_stub_787), TABLE_ENTRY(_dispatch_stub_788), TABLE_ENTRY(_dispatch_stub_789), TABLE_ENTRY(_dispatch_stub_790), TABLE_ENTRY(_dispatch_stub_791), + TABLE_ENTRY(_dispatch_stub_792), + TABLE_ENTRY(_dispatch_stub_793), + TABLE_ENTRY(_dispatch_stub_794), /* A whole bunch of no-op functions. These might be called * when someone tries to call a dynamically-registered * extension function without a current rendering context. @@ -6905,6 +6928,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(RenderbufferStorage), TABLE_ENTRY(BlitFramebuffer), TABLE_ENTRY(FramebufferTextureLayer), + TABLE_ENTRY(ProvokingVertex), }; #endif /*UNUSED_TABLE_NAME*/ diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index ae6603262e..c29f8b57be 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -626,6 +626,9 @@ static const char gl_string_table[] = "glGetSynciv\0" "glIsSync\0" "glWaitSync\0" + "glDrawElementsBaseVertex\0" + "glDrawRangeElementsBaseVertex\0" + "glMultiDrawElementsBaseVertex\0" "glPolygonOffsetEXT\0" "glGetPixelTexGenParameterfvSGIS\0" "glGetPixelTexGenParameterivSGIS\0" @@ -1144,6 +1147,7 @@ static const char gl_string_table[] = "glRenderbufferStorage\0" "glBlitFramebuffer\0" "glFramebufferTextureLayer\0" + "glProvokingVertex\0" ; @@ -1161,43 +1165,43 @@ static const char gl_string_table[] = #define gl_dispatch_stub_364 mgl_dispatch_stub_364 #define gl_dispatch_stub_365 mgl_dispatch_stub_365 #define gl_dispatch_stub_366 mgl_dispatch_stub_366 -#define gl_dispatch_stub_575 mgl_dispatch_stub_575 -#define gl_dispatch_stub_576 mgl_dispatch_stub_576 -#define gl_dispatch_stub_577 mgl_dispatch_stub_577 #define gl_dispatch_stub_578 mgl_dispatch_stub_578 #define gl_dispatch_stub_579 mgl_dispatch_stub_579 #define gl_dispatch_stub_580 mgl_dispatch_stub_580 #define gl_dispatch_stub_581 mgl_dispatch_stub_581 #define gl_dispatch_stub_582 mgl_dispatch_stub_582 -#define gl_dispatch_stub_593 mgl_dispatch_stub_593 -#define gl_dispatch_stub_594 mgl_dispatch_stub_594 -#define gl_dispatch_stub_619 mgl_dispatch_stub_619 -#define gl_dispatch_stub_661 mgl_dispatch_stub_661 -#define gl_dispatch_stub_662 mgl_dispatch_stub_662 -#define gl_dispatch_stub_663 mgl_dispatch_stub_663 +#define gl_dispatch_stub_583 mgl_dispatch_stub_583 +#define gl_dispatch_stub_584 mgl_dispatch_stub_584 +#define gl_dispatch_stub_585 mgl_dispatch_stub_585 +#define gl_dispatch_stub_596 mgl_dispatch_stub_596 +#define gl_dispatch_stub_597 mgl_dispatch_stub_597 +#define gl_dispatch_stub_622 mgl_dispatch_stub_622 #define gl_dispatch_stub_664 mgl_dispatch_stub_664 #define gl_dispatch_stub_665 mgl_dispatch_stub_665 #define gl_dispatch_stub_666 mgl_dispatch_stub_666 #define gl_dispatch_stub_667 mgl_dispatch_stub_667 #define gl_dispatch_stub_668 mgl_dispatch_stub_668 #define gl_dispatch_stub_669 mgl_dispatch_stub_669 -#define gl_dispatch_stub_750 mgl_dispatch_stub_750 -#define gl_dispatch_stub_751 mgl_dispatch_stub_751 -#define gl_dispatch_stub_752 mgl_dispatch_stub_752 +#define gl_dispatch_stub_670 mgl_dispatch_stub_670 +#define gl_dispatch_stub_671 mgl_dispatch_stub_671 +#define gl_dispatch_stub_672 mgl_dispatch_stub_672 #define gl_dispatch_stub_753 mgl_dispatch_stub_753 #define gl_dispatch_stub_754 mgl_dispatch_stub_754 -#define gl_dispatch_stub_761 mgl_dispatch_stub_761 -#define gl_dispatch_stub_762 mgl_dispatch_stub_762 -#define gl_dispatch_stub_780 mgl_dispatch_stub_780 -#define gl_dispatch_stub_781 mgl_dispatch_stub_781 -#define gl_dispatch_stub_782 mgl_dispatch_stub_782 +#define gl_dispatch_stub_755 mgl_dispatch_stub_755 +#define gl_dispatch_stub_756 mgl_dispatch_stub_756 +#define gl_dispatch_stub_757 mgl_dispatch_stub_757 +#define gl_dispatch_stub_764 mgl_dispatch_stub_764 +#define gl_dispatch_stub_765 mgl_dispatch_stub_765 +#define gl_dispatch_stub_783 mgl_dispatch_stub_783 +#define gl_dispatch_stub_784 mgl_dispatch_stub_784 #define gl_dispatch_stub_785 mgl_dispatch_stub_785 -#define gl_dispatch_stub_786 mgl_dispatch_stub_786 -#define gl_dispatch_stub_787 mgl_dispatch_stub_787 #define gl_dispatch_stub_788 mgl_dispatch_stub_788 #define gl_dispatch_stub_789 mgl_dispatch_stub_789 #define gl_dispatch_stub_790 mgl_dispatch_stub_790 #define gl_dispatch_stub_791 mgl_dispatch_stub_791 +#define gl_dispatch_stub_792 mgl_dispatch_stub_792 +#define gl_dispatch_stub_793 mgl_dispatch_stub_793 +#define gl_dispatch_stub_794 mgl_dispatch_stub_794 #endif /* USE_MGL_NAMESPACE */ @@ -1215,43 +1219,43 @@ void GLAPIENTRY gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params void GLAPIENTRY gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); void GLAPIENTRY gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params); void GLAPIENTRY gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params); -void GLAPIENTRY gl_dispatch_stub_575(GLenum pname, GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_576(GLenum pname, GLint * params); -void GLAPIENTRY gl_dispatch_stub_577(GLenum pname, GLfloat param); -void GLAPIENTRY gl_dispatch_stub_578(GLenum pname, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_579(GLenum pname, GLint param); -void GLAPIENTRY gl_dispatch_stub_580(GLenum pname, const GLint * params); -void GLAPIENTRY gl_dispatch_stub_581(GLclampf value, GLboolean invert); -void GLAPIENTRY gl_dispatch_stub_582(GLenum pattern); -void GLAPIENTRY gl_dispatch_stub_593(GLenum pname, GLdouble * params); -void GLAPIENTRY gl_dispatch_stub_594(GLenum pname, GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_619(GLenum mode); -void GLAPIENTRY gl_dispatch_stub_661(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); -void GLAPIENTRY gl_dispatch_stub_662(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); -void GLAPIENTRY gl_dispatch_stub_663(GLsizei n, const GLuint * fences); -void GLAPIENTRY gl_dispatch_stub_664(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_665(GLsizei n, GLuint * fences); -void GLAPIENTRY gl_dispatch_stub_666(GLuint fence, GLenum pname, GLint * params); -GLboolean GLAPIENTRY gl_dispatch_stub_667(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_668(GLuint fence, GLenum condition); -GLboolean GLAPIENTRY gl_dispatch_stub_669(GLuint fence); -void GLAPIENTRY gl_dispatch_stub_750(GLenum face); -void GLAPIENTRY gl_dispatch_stub_751(GLuint array); -void GLAPIENTRY gl_dispatch_stub_752(GLsizei n, const GLuint * arrays); -void GLAPIENTRY gl_dispatch_stub_753(GLsizei n, GLuint * arrays); -GLboolean GLAPIENTRY gl_dispatch_stub_754(GLuint array); -void GLAPIENTRY gl_dispatch_stub_761(GLclampd zmin, GLclampd zmax); -void GLAPIENTRY gl_dispatch_stub_762(GLenum modeRGB, GLenum modeA); -void GLAPIENTRY gl_dispatch_stub_780(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -void GLAPIENTRY gl_dispatch_stub_781(GLenum target, GLenum pname, GLint param); -void GLAPIENTRY gl_dispatch_stub_782(GLenum target, GLintptr offset, GLsizeiptr size); -void GLAPIENTRY gl_dispatch_stub_785(GLenum target, GLenum pname, GLvoid ** params); -void GLAPIENTRY gl_dispatch_stub_786(GLenum target, GLsizei length, GLvoid * pointer); -void GLAPIENTRY gl_dispatch_stub_787(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -void GLAPIENTRY gl_dispatch_stub_788(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_789(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_790(GLuint id, GLenum pname, GLint64EXT * params); -void GLAPIENTRY gl_dispatch_stub_791(GLuint id, GLenum pname, GLuint64EXT * params); +void GLAPIENTRY gl_dispatch_stub_578(GLenum pname, GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_579(GLenum pname, GLint * params); +void GLAPIENTRY gl_dispatch_stub_580(GLenum pname, GLfloat param); +void GLAPIENTRY gl_dispatch_stub_581(GLenum pname, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_582(GLenum pname, GLint param); +void GLAPIENTRY gl_dispatch_stub_583(GLenum pname, const GLint * params); +void GLAPIENTRY gl_dispatch_stub_584(GLclampf value, GLboolean invert); +void GLAPIENTRY gl_dispatch_stub_585(GLenum pattern); +void GLAPIENTRY gl_dispatch_stub_596(GLenum pname, GLdouble * params); +void GLAPIENTRY gl_dispatch_stub_597(GLenum pname, GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_622(GLenum mode); +void GLAPIENTRY gl_dispatch_stub_664(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); +void GLAPIENTRY gl_dispatch_stub_665(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); +void GLAPIENTRY gl_dispatch_stub_666(GLsizei n, const GLuint * fences); +void GLAPIENTRY gl_dispatch_stub_667(GLuint fence); +void GLAPIENTRY gl_dispatch_stub_668(GLsizei n, GLuint * fences); +void GLAPIENTRY gl_dispatch_stub_669(GLuint fence, GLenum pname, GLint * params); +GLboolean GLAPIENTRY gl_dispatch_stub_670(GLuint fence); +void GLAPIENTRY gl_dispatch_stub_671(GLuint fence, GLenum condition); +GLboolean GLAPIENTRY gl_dispatch_stub_672(GLuint fence); +void GLAPIENTRY gl_dispatch_stub_753(GLenum face); +void GLAPIENTRY gl_dispatch_stub_754(GLuint array); +void GLAPIENTRY gl_dispatch_stub_755(GLsizei n, const GLuint * arrays); +void GLAPIENTRY gl_dispatch_stub_756(GLsizei n, GLuint * arrays); +GLboolean GLAPIENTRY gl_dispatch_stub_757(GLuint array); +void GLAPIENTRY gl_dispatch_stub_764(GLclampd zmin, GLclampd zmax); +void GLAPIENTRY gl_dispatch_stub_765(GLenum modeRGB, GLenum modeA); +void GLAPIENTRY gl_dispatch_stub_783(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +void GLAPIENTRY gl_dispatch_stub_784(GLenum target, GLenum pname, GLint param); +void GLAPIENTRY gl_dispatch_stub_785(GLenum target, GLintptr offset, GLsizeiptr size); +void GLAPIENTRY gl_dispatch_stub_788(GLenum target, GLenum pname, GLvoid ** params); +void GLAPIENTRY gl_dispatch_stub_789(GLenum target, GLsizei length, GLvoid * pointer); +void GLAPIENTRY gl_dispatch_stub_790(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +void GLAPIENTRY gl_dispatch_stub_791(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_792(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_793(GLuint id, GLenum pname, GLint64EXT * params); +void GLAPIENTRY gl_dispatch_stub_794(GLuint id, GLenum pname, GLuint64EXT * params); #endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ static const glprocs_table_t static_functions[] = { @@ -1829,524 +1833,528 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET( 9140, glGetSynciv, glGetSynciv, NULL, _gloffset_GetSynciv), NAME_FUNC_OFFSET( 9152, glIsSync, glIsSync, NULL, _gloffset_IsSync), NAME_FUNC_OFFSET( 9161, glWaitSync, glWaitSync, NULL, _gloffset_WaitSync), - NAME_FUNC_OFFSET( 9172, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), - NAME_FUNC_OFFSET( 9191, gl_dispatch_stub_575, gl_dispatch_stub_575, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9223, gl_dispatch_stub_576, gl_dispatch_stub_576, NULL, _gloffset_GetPixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9255, gl_dispatch_stub_577, gl_dispatch_stub_577, NULL, _gloffset_PixelTexGenParameterfSGIS), - NAME_FUNC_OFFSET( 9283, gl_dispatch_stub_578, gl_dispatch_stub_578, NULL, _gloffset_PixelTexGenParameterfvSGIS), - NAME_FUNC_OFFSET( 9312, gl_dispatch_stub_579, gl_dispatch_stub_579, NULL, _gloffset_PixelTexGenParameteriSGIS), - NAME_FUNC_OFFSET( 9340, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_PixelTexGenParameterivSGIS), - NAME_FUNC_OFFSET( 9369, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET( 9386, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET( 9406, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), - NAME_FUNC_OFFSET( 9424, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), - NAME_FUNC_OFFSET( 9445, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), - NAME_FUNC_OFFSET( 9463, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), - NAME_FUNC_OFFSET( 9482, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), - NAME_FUNC_OFFSET( 9503, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), - NAME_FUNC_OFFSET( 9522, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET( 9543, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET( 9565, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), - NAME_FUNC_OFFSET( 9581, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), - NAME_FUNC_OFFSET( 9599, gl_dispatch_stub_593, gl_dispatch_stub_593, NULL, _gloffset_CullParameterdvEXT), - NAME_FUNC_OFFSET( 9620, gl_dispatch_stub_594, gl_dispatch_stub_594, NULL, _gloffset_CullParameterfvEXT), - NAME_FUNC_OFFSET( 9641, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET( 9663, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET( 9686, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET( 9708, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET( 9731, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET( 9753, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET( 9776, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET( 9798, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET( 9821, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET( 9843, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET( 9866, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET( 9889, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET( 9913, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET( 9936, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET( 9960, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET( 9983, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(10007, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(10034, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(10055, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(10078, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(10099, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(10114, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(10130, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(10145, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(10161, gl_dispatch_stub_619, gl_dispatch_stub_619, NULL, _gloffset_PixelTexGenSGIX), - NAME_FUNC_OFFSET(10179, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(10202, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), - NAME_FUNC_OFFSET(10228, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), - NAME_FUNC_OFFSET(10249, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), - NAME_FUNC_OFFSET(10267, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), - NAME_FUNC_OFFSET(10286, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), - NAME_FUNC_OFFSET(10309, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), - NAME_FUNC_OFFSET(10333, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), - NAME_FUNC_OFFSET(10356, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), - NAME_FUNC_OFFSET(10380, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), - NAME_FUNC_OFFSET(10403, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10435, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10467, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), - NAME_FUNC_OFFSET(10500, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), - NAME_FUNC_OFFSET(10533, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), - NAME_FUNC_OFFSET(10570, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), - NAME_FUNC_OFFSET(10607, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), - NAME_FUNC_OFFSET(10627, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(10645, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(10664, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(10682, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(10701, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(10719, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(10738, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(10756, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(10775, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(10793, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(10812, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(10830, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(10849, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(10867, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(10886, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(10904, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(10923, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), - NAME_FUNC_OFFSET(10941, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), - NAME_FUNC_OFFSET(10960, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), - NAME_FUNC_OFFSET(10978, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), - NAME_FUNC_OFFSET(10997, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), - NAME_FUNC_OFFSET(11015, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), - NAME_FUNC_OFFSET(11034, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), - NAME_FUNC_OFFSET(11052, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), - NAME_FUNC_OFFSET(11071, gl_dispatch_stub_661, gl_dispatch_stub_661, NULL, _gloffset_MultiModeDrawArraysIBM), - NAME_FUNC_OFFSET(11096, gl_dispatch_stub_662, gl_dispatch_stub_662, NULL, _gloffset_MultiModeDrawElementsIBM), - NAME_FUNC_OFFSET(11123, gl_dispatch_stub_663, gl_dispatch_stub_663, NULL, _gloffset_DeleteFencesNV), - NAME_FUNC_OFFSET(11140, gl_dispatch_stub_664, gl_dispatch_stub_664, NULL, _gloffset_FinishFenceNV), - NAME_FUNC_OFFSET(11156, gl_dispatch_stub_665, gl_dispatch_stub_665, NULL, _gloffset_GenFencesNV), - NAME_FUNC_OFFSET(11170, gl_dispatch_stub_666, gl_dispatch_stub_666, NULL, _gloffset_GetFenceivNV), - NAME_FUNC_OFFSET(11185, gl_dispatch_stub_667, gl_dispatch_stub_667, NULL, _gloffset_IsFenceNV), - NAME_FUNC_OFFSET(11197, gl_dispatch_stub_668, gl_dispatch_stub_668, NULL, _gloffset_SetFenceNV), - NAME_FUNC_OFFSET(11210, gl_dispatch_stub_669, gl_dispatch_stub_669, NULL, _gloffset_TestFenceNV), - NAME_FUNC_OFFSET(11224, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), - NAME_FUNC_OFFSET(11248, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(11264, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(11283, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), - NAME_FUNC_OFFSET(11302, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(11318, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), - NAME_FUNC_OFFSET(11344, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), - NAME_FUNC_OFFSET(11370, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), - NAME_FUNC_OFFSET(11391, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), - NAME_FUNC_OFFSET(11408, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), - NAME_FUNC_OFFSET(11429, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(11457, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), - NAME_FUNC_OFFSET(11479, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), - NAME_FUNC_OFFSET(11501, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), - NAME_FUNC_OFFSET(11523, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(11537, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), - NAME_FUNC_OFFSET(11553, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), - NAME_FUNC_OFFSET(11578, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), - NAME_FUNC_OFFSET(11603, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), - NAME_FUNC_OFFSET(11631, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), - NAME_FUNC_OFFSET(11647, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), - NAME_FUNC_OFFSET(11666, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), - NAME_FUNC_OFFSET(11686, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), - NAME_FUNC_OFFSET(11705, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), - NAME_FUNC_OFFSET(11725, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), - NAME_FUNC_OFFSET(11744, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), - NAME_FUNC_OFFSET(11764, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), - NAME_FUNC_OFFSET(11783, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), - NAME_FUNC_OFFSET(11803, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), - NAME_FUNC_OFFSET(11822, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), - NAME_FUNC_OFFSET(11842, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), - NAME_FUNC_OFFSET(11861, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), - NAME_FUNC_OFFSET(11881, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), - NAME_FUNC_OFFSET(11900, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), - NAME_FUNC_OFFSET(11920, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), - NAME_FUNC_OFFSET(11939, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), - NAME_FUNC_OFFSET(11959, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), - NAME_FUNC_OFFSET(11978, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), - NAME_FUNC_OFFSET(11998, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), - NAME_FUNC_OFFSET(12017, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), - NAME_FUNC_OFFSET(12037, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), - NAME_FUNC_OFFSET(12056, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), - NAME_FUNC_OFFSET(12076, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), - NAME_FUNC_OFFSET(12095, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), - NAME_FUNC_OFFSET(12115, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), - NAME_FUNC_OFFSET(12135, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), - NAME_FUNC_OFFSET(12156, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), - NAME_FUNC_OFFSET(12180, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), - NAME_FUNC_OFFSET(12201, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), - NAME_FUNC_OFFSET(12222, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), - NAME_FUNC_OFFSET(12243, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), - NAME_FUNC_OFFSET(12264, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), - NAME_FUNC_OFFSET(12285, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), - NAME_FUNC_OFFSET(12306, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), - NAME_FUNC_OFFSET(12327, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), - NAME_FUNC_OFFSET(12348, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), - NAME_FUNC_OFFSET(12369, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), - NAME_FUNC_OFFSET(12390, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), - NAME_FUNC_OFFSET(12411, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), - NAME_FUNC_OFFSET(12432, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), - NAME_FUNC_OFFSET(12454, glGetTexBumpParameterfvATI, glGetTexBumpParameterfvATI, NULL, _gloffset_GetTexBumpParameterfvATI), - NAME_FUNC_OFFSET(12481, glGetTexBumpParameterivATI, glGetTexBumpParameterivATI, NULL, _gloffset_GetTexBumpParameterivATI), - NAME_FUNC_OFFSET(12508, glTexBumpParameterfvATI, glTexBumpParameterfvATI, NULL, _gloffset_TexBumpParameterfvATI), - NAME_FUNC_OFFSET(12532, glTexBumpParameterivATI, glTexBumpParameterivATI, NULL, _gloffset_TexBumpParameterivATI), - NAME_FUNC_OFFSET(12556, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), - NAME_FUNC_OFFSET(12578, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), - NAME_FUNC_OFFSET(12600, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), - NAME_FUNC_OFFSET(12622, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), - NAME_FUNC_OFFSET(12647, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), - NAME_FUNC_OFFSET(12671, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), - NAME_FUNC_OFFSET(12693, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), - NAME_FUNC_OFFSET(12715, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), - NAME_FUNC_OFFSET(12737, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), - NAME_FUNC_OFFSET(12763, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), - NAME_FUNC_OFFSET(12786, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), - NAME_FUNC_OFFSET(12810, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), - NAME_FUNC_OFFSET(12828, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), - NAME_FUNC_OFFSET(12843, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), - NAME_FUNC_OFFSET(12874, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(12894, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(12915, gl_dispatch_stub_750, gl_dispatch_stub_750, NULL, _gloffset_ActiveStencilFaceEXT), - NAME_FUNC_OFFSET(12938, gl_dispatch_stub_751, gl_dispatch_stub_751, NULL, _gloffset_BindVertexArrayAPPLE), - NAME_FUNC_OFFSET(12961, gl_dispatch_stub_752, gl_dispatch_stub_752, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(12987, gl_dispatch_stub_753, gl_dispatch_stub_753, NULL, _gloffset_GenVertexArraysAPPLE), - NAME_FUNC_OFFSET(13010, gl_dispatch_stub_754, gl_dispatch_stub_754, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(13031, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), - NAME_FUNC_OFFSET(13062, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), - NAME_FUNC_OFFSET(13093, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), - NAME_FUNC_OFFSET(13121, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), - NAME_FUNC_OFFSET(13150, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), - NAME_FUNC_OFFSET(13178, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), - NAME_FUNC_OFFSET(13207, gl_dispatch_stub_761, gl_dispatch_stub_761, NULL, _gloffset_DepthBoundsEXT), - NAME_FUNC_OFFSET(13224, gl_dispatch_stub_762, gl_dispatch_stub_762, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(13251, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(13272, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(13294, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(13322, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(13346, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(13371, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(13400, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(13426, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(13452, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(13478, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(13499, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(13521, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(13541, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(13582, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(13614, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(13633, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(13653, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(13678, gl_dispatch_stub_780, gl_dispatch_stub_780, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(13699, gl_dispatch_stub_781, gl_dispatch_stub_781, NULL, _gloffset_BufferParameteriAPPLE), - NAME_FUNC_OFFSET(13723, gl_dispatch_stub_782, gl_dispatch_stub_782, NULL, _gloffset_FlushMappedBufferRangeAPPLE), - NAME_FUNC_OFFSET(13753, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(13782, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), - NAME_FUNC_OFFSET(13803, gl_dispatch_stub_785, gl_dispatch_stub_785, NULL, _gloffset_GetTexParameterPointervAPPLE), - NAME_FUNC_OFFSET(13834, gl_dispatch_stub_786, gl_dispatch_stub_786, NULL, _gloffset_TextureRangeAPPLE), - NAME_FUNC_OFFSET(13854, gl_dispatch_stub_787, gl_dispatch_stub_787, NULL, _gloffset_StencilFuncSeparateATI), - NAME_FUNC_OFFSET(13879, gl_dispatch_stub_788, gl_dispatch_stub_788, NULL, _gloffset_ProgramEnvParameters4fvEXT), - NAME_FUNC_OFFSET(13908, gl_dispatch_stub_789, gl_dispatch_stub_789, NULL, _gloffset_ProgramLocalParameters4fvEXT), - NAME_FUNC_OFFSET(13939, gl_dispatch_stub_790, gl_dispatch_stub_790, NULL, _gloffset_GetQueryObjecti64vEXT), - NAME_FUNC_OFFSET(13963, gl_dispatch_stub_791, gl_dispatch_stub_791, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(13988, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(14006, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(14023, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(14039, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(14064, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(14084, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(14104, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(14127, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(14150, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(14170, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(14187, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(14204, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(14219, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(14243, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(14262, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(14281, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(14297, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(14316, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(14339, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14355, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14371, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(14398, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(14425, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(14445, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14464, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14483, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14513, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14543, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14573, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14603, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14622, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14645, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(14670, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(14695, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(14722, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(14750, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(14777, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(14805, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(14834, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(14863, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(14889, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(14920, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(14951, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(14975, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(14998, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(15016, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(15045, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(15074, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(15089, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(15115, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(15141, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(15156, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(15168, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(15188, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(15205, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(15221, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(15240, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(15263, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(15279, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(15301, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(15319, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(15338, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(15356, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(15375, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(15393, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(15412, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(15430, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15449, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15467, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15486, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15504, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15523, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15541, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15560, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15578, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15597, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15615, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15634, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15652, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(15671, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(15689, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(15708, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(15726, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(15745, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(15763, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(15782, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(15800, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(15819, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(15837, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(15856, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(15874, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(15893, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET(15916, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(15939, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(15962, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(15985, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(16008, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(16025, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(16048, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(16071, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(16094, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(16120, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(16146, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(16172, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(16196, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16223, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16249, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(16269, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(16289, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(16309, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET(16332, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET(16356, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET(16379, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET(16403, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(16420, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(16438, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(16455, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(16473, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(16490, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(16508, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(16525, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16543, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16560, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16578, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16595, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16613, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16630, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16648, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(16665, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(16683, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(16700, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(16718, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(16737, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(16756, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(16775, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(16794, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(16814, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(16834, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(16854, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET(16872, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(16889, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(16907, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(16924, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(16942, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET(16960, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(16977, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(16995, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET(17014, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET(17033, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET(17052, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(17074, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(17087, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(17100, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(17116, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(17132, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(17145, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(17168, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(17188, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(17207, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(17218, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(17230, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(17244, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(17257, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(17273, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(17284, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(17297, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(17316, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(17336, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(17349, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(17359, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(17375, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(17394, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(17412, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(17433, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(17448, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(17463, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(17477, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(17492, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(17504, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(17517, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(17529, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(17542, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(17554, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(17567, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(17579, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17592, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17604, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17617, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17629, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17642, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17654, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17667, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17679, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17692, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17711, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17730, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(17749, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(17762, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(17780, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(17801, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(17819, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(17839, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17853, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17870, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17886, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17905, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17923, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17944, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(17966, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(17985, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18007, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18030, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(18049, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(18069, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(18088, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(18108, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(18127, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(18147, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(18166, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(18186, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(18205, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(18225, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(18245, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(18266, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(18286, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(18307, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(18327, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(18348, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(18372, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(18390, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(18410, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(18428, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(18440, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18453, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18465, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18478, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18498, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18522, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18536, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18553, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18568, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18586, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18600, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18617, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18632, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18650, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18664, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18681, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18696, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18714, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18728, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18745, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18760, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18778, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18792, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18809, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18824, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18842, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18856, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18873, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18888, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18906, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18920, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(18937, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18952, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(18970, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(18984, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19001, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19016, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19034, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(19051, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(19071, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(19088, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19114, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19143, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(19158, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(19176, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(19195, gl_dispatch_stub_752, gl_dispatch_stub_752, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(19216, gl_dispatch_stub_754, gl_dispatch_stub_754, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(19232, gl_dispatch_stub_762, gl_dispatch_stub_762, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19256, gl_dispatch_stub_762, gl_dispatch_stub_762, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19283, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(19301, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(19320, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(19345, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(19366, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(19388, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(19414, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(19437, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(19460, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(19483, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(19501, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(19520, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(19537, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(19575, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(19604, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(19620, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(19637, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(19659, gl_dispatch_stub_780, gl_dispatch_stub_780, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(19677, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET( 9172, glDrawElementsBaseVertex, glDrawElementsBaseVertex, NULL, _gloffset_DrawElementsBaseVertex), + NAME_FUNC_OFFSET( 9197, glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertex, NULL, _gloffset_DrawRangeElementsBaseVertex), + NAME_FUNC_OFFSET( 9227, glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertex, NULL, _gloffset_MultiDrawElementsBaseVertex), + NAME_FUNC_OFFSET( 9257, glPolygonOffsetEXT, glPolygonOffsetEXT, NULL, _gloffset_PolygonOffsetEXT), + NAME_FUNC_OFFSET( 9276, gl_dispatch_stub_578, gl_dispatch_stub_578, NULL, _gloffset_GetPixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9308, gl_dispatch_stub_579, gl_dispatch_stub_579, NULL, _gloffset_GetPixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9340, gl_dispatch_stub_580, gl_dispatch_stub_580, NULL, _gloffset_PixelTexGenParameterfSGIS), + NAME_FUNC_OFFSET( 9368, gl_dispatch_stub_581, gl_dispatch_stub_581, NULL, _gloffset_PixelTexGenParameterfvSGIS), + NAME_FUNC_OFFSET( 9397, gl_dispatch_stub_582, gl_dispatch_stub_582, NULL, _gloffset_PixelTexGenParameteriSGIS), + NAME_FUNC_OFFSET( 9425, gl_dispatch_stub_583, gl_dispatch_stub_583, NULL, _gloffset_PixelTexGenParameterivSGIS), + NAME_FUNC_OFFSET( 9454, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET( 9471, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET( 9491, glColorPointerEXT, glColorPointerEXT, NULL, _gloffset_ColorPointerEXT), + NAME_FUNC_OFFSET( 9509, glEdgeFlagPointerEXT, glEdgeFlagPointerEXT, NULL, _gloffset_EdgeFlagPointerEXT), + NAME_FUNC_OFFSET( 9530, glIndexPointerEXT, glIndexPointerEXT, NULL, _gloffset_IndexPointerEXT), + NAME_FUNC_OFFSET( 9548, glNormalPointerEXT, glNormalPointerEXT, NULL, _gloffset_NormalPointerEXT), + NAME_FUNC_OFFSET( 9567, glTexCoordPointerEXT, glTexCoordPointerEXT, NULL, _gloffset_TexCoordPointerEXT), + NAME_FUNC_OFFSET( 9588, glVertexPointerEXT, glVertexPointerEXT, NULL, _gloffset_VertexPointerEXT), + NAME_FUNC_OFFSET( 9607, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET( 9628, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET( 9650, glLockArraysEXT, glLockArraysEXT, NULL, _gloffset_LockArraysEXT), + NAME_FUNC_OFFSET( 9666, glUnlockArraysEXT, glUnlockArraysEXT, NULL, _gloffset_UnlockArraysEXT), + NAME_FUNC_OFFSET( 9684, gl_dispatch_stub_596, gl_dispatch_stub_596, NULL, _gloffset_CullParameterdvEXT), + NAME_FUNC_OFFSET( 9705, gl_dispatch_stub_597, gl_dispatch_stub_597, NULL, _gloffset_CullParameterfvEXT), + NAME_FUNC_OFFSET( 9726, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET( 9748, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET( 9771, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET( 9793, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET( 9816, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET( 9838, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET( 9861, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET( 9883, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET( 9906, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET( 9928, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET( 9951, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET( 9974, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET( 9998, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(10021, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(10045, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(10068, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(10092, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(10119, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(10140, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(10163, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(10184, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(10199, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(10215, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(10230, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(10246, gl_dispatch_stub_622, gl_dispatch_stub_622, NULL, _gloffset_PixelTexGenSGIX), + NAME_FUNC_OFFSET(10264, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(10287, glFlushVertexArrayRangeNV, glFlushVertexArrayRangeNV, NULL, _gloffset_FlushVertexArrayRangeNV), + NAME_FUNC_OFFSET(10313, glVertexArrayRangeNV, glVertexArrayRangeNV, NULL, _gloffset_VertexArrayRangeNV), + NAME_FUNC_OFFSET(10334, glCombinerInputNV, glCombinerInputNV, NULL, _gloffset_CombinerInputNV), + NAME_FUNC_OFFSET(10352, glCombinerOutputNV, glCombinerOutputNV, NULL, _gloffset_CombinerOutputNV), + NAME_FUNC_OFFSET(10371, glCombinerParameterfNV, glCombinerParameterfNV, NULL, _gloffset_CombinerParameterfNV), + NAME_FUNC_OFFSET(10394, glCombinerParameterfvNV, glCombinerParameterfvNV, NULL, _gloffset_CombinerParameterfvNV), + NAME_FUNC_OFFSET(10418, glCombinerParameteriNV, glCombinerParameteriNV, NULL, _gloffset_CombinerParameteriNV), + NAME_FUNC_OFFSET(10441, glCombinerParameterivNV, glCombinerParameterivNV, NULL, _gloffset_CombinerParameterivNV), + NAME_FUNC_OFFSET(10465, glFinalCombinerInputNV, glFinalCombinerInputNV, NULL, _gloffset_FinalCombinerInputNV), + NAME_FUNC_OFFSET(10488, glGetCombinerInputParameterfvNV, glGetCombinerInputParameterfvNV, NULL, _gloffset_GetCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10520, glGetCombinerInputParameterivNV, glGetCombinerInputParameterivNV, NULL, _gloffset_GetCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10552, glGetCombinerOutputParameterfvNV, glGetCombinerOutputParameterfvNV, NULL, _gloffset_GetCombinerOutputParameterfvNV), + NAME_FUNC_OFFSET(10585, glGetCombinerOutputParameterivNV, glGetCombinerOutputParameterivNV, NULL, _gloffset_GetCombinerOutputParameterivNV), + NAME_FUNC_OFFSET(10618, glGetFinalCombinerInputParameterfvNV, glGetFinalCombinerInputParameterfvNV, NULL, _gloffset_GetFinalCombinerInputParameterfvNV), + NAME_FUNC_OFFSET(10655, glGetFinalCombinerInputParameterivNV, glGetFinalCombinerInputParameterivNV, NULL, _gloffset_GetFinalCombinerInputParameterivNV), + NAME_FUNC_OFFSET(10692, glResizeBuffersMESA, glResizeBuffersMESA, NULL, _gloffset_ResizeBuffersMESA), + NAME_FUNC_OFFSET(10712, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(10730, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(10749, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(10767, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(10786, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(10804, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(10823, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(10841, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(10860, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(10878, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(10897, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(10915, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(10934, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(10952, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(10971, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(10989, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(11008, glWindowPos4dMESA, glWindowPos4dMESA, NULL, _gloffset_WindowPos4dMESA), + NAME_FUNC_OFFSET(11026, glWindowPos4dvMESA, glWindowPos4dvMESA, NULL, _gloffset_WindowPos4dvMESA), + NAME_FUNC_OFFSET(11045, glWindowPos4fMESA, glWindowPos4fMESA, NULL, _gloffset_WindowPos4fMESA), + NAME_FUNC_OFFSET(11063, glWindowPos4fvMESA, glWindowPos4fvMESA, NULL, _gloffset_WindowPos4fvMESA), + NAME_FUNC_OFFSET(11082, glWindowPos4iMESA, glWindowPos4iMESA, NULL, _gloffset_WindowPos4iMESA), + NAME_FUNC_OFFSET(11100, glWindowPos4ivMESA, glWindowPos4ivMESA, NULL, _gloffset_WindowPos4ivMESA), + NAME_FUNC_OFFSET(11119, glWindowPos4sMESA, glWindowPos4sMESA, NULL, _gloffset_WindowPos4sMESA), + NAME_FUNC_OFFSET(11137, glWindowPos4svMESA, glWindowPos4svMESA, NULL, _gloffset_WindowPos4svMESA), + NAME_FUNC_OFFSET(11156, gl_dispatch_stub_664, gl_dispatch_stub_664, NULL, _gloffset_MultiModeDrawArraysIBM), + NAME_FUNC_OFFSET(11181, gl_dispatch_stub_665, gl_dispatch_stub_665, NULL, _gloffset_MultiModeDrawElementsIBM), + NAME_FUNC_OFFSET(11208, gl_dispatch_stub_666, gl_dispatch_stub_666, NULL, _gloffset_DeleteFencesNV), + NAME_FUNC_OFFSET(11225, gl_dispatch_stub_667, gl_dispatch_stub_667, NULL, _gloffset_FinishFenceNV), + NAME_FUNC_OFFSET(11241, gl_dispatch_stub_668, gl_dispatch_stub_668, NULL, _gloffset_GenFencesNV), + NAME_FUNC_OFFSET(11255, gl_dispatch_stub_669, gl_dispatch_stub_669, NULL, _gloffset_GetFenceivNV), + NAME_FUNC_OFFSET(11270, gl_dispatch_stub_670, gl_dispatch_stub_670, NULL, _gloffset_IsFenceNV), + NAME_FUNC_OFFSET(11282, gl_dispatch_stub_671, gl_dispatch_stub_671, NULL, _gloffset_SetFenceNV), + NAME_FUNC_OFFSET(11295, gl_dispatch_stub_672, gl_dispatch_stub_672, NULL, _gloffset_TestFenceNV), + NAME_FUNC_OFFSET(11309, glAreProgramsResidentNV, glAreProgramsResidentNV, NULL, _gloffset_AreProgramsResidentNV), + NAME_FUNC_OFFSET(11333, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(11349, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(11368, glExecuteProgramNV, glExecuteProgramNV, NULL, _gloffset_ExecuteProgramNV), + NAME_FUNC_OFFSET(11387, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(11403, glGetProgramParameterdvNV, glGetProgramParameterdvNV, NULL, _gloffset_GetProgramParameterdvNV), + NAME_FUNC_OFFSET(11429, glGetProgramParameterfvNV, glGetProgramParameterfvNV, NULL, _gloffset_GetProgramParameterfvNV), + NAME_FUNC_OFFSET(11455, glGetProgramStringNV, glGetProgramStringNV, NULL, _gloffset_GetProgramStringNV), + NAME_FUNC_OFFSET(11476, glGetProgramivNV, glGetProgramivNV, NULL, _gloffset_GetProgramivNV), + NAME_FUNC_OFFSET(11493, glGetTrackMatrixivNV, glGetTrackMatrixivNV, NULL, _gloffset_GetTrackMatrixivNV), + NAME_FUNC_OFFSET(11514, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(11542, glGetVertexAttribdvNV, glGetVertexAttribdvNV, NULL, _gloffset_GetVertexAttribdvNV), + NAME_FUNC_OFFSET(11564, glGetVertexAttribfvNV, glGetVertexAttribfvNV, NULL, _gloffset_GetVertexAttribfvNV), + NAME_FUNC_OFFSET(11586, glGetVertexAttribivNV, glGetVertexAttribivNV, NULL, _gloffset_GetVertexAttribivNV), + NAME_FUNC_OFFSET(11608, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(11622, glLoadProgramNV, glLoadProgramNV, NULL, _gloffset_LoadProgramNV), + NAME_FUNC_OFFSET(11638, glProgramParameters4dvNV, glProgramParameters4dvNV, NULL, _gloffset_ProgramParameters4dvNV), + NAME_FUNC_OFFSET(11663, glProgramParameters4fvNV, glProgramParameters4fvNV, NULL, _gloffset_ProgramParameters4fvNV), + NAME_FUNC_OFFSET(11688, glRequestResidentProgramsNV, glRequestResidentProgramsNV, NULL, _gloffset_RequestResidentProgramsNV), + NAME_FUNC_OFFSET(11716, glTrackMatrixNV, glTrackMatrixNV, NULL, _gloffset_TrackMatrixNV), + NAME_FUNC_OFFSET(11732, glVertexAttrib1dNV, glVertexAttrib1dNV, NULL, _gloffset_VertexAttrib1dNV), + NAME_FUNC_OFFSET(11751, glVertexAttrib1dvNV, glVertexAttrib1dvNV, NULL, _gloffset_VertexAttrib1dvNV), + NAME_FUNC_OFFSET(11771, glVertexAttrib1fNV, glVertexAttrib1fNV, NULL, _gloffset_VertexAttrib1fNV), + NAME_FUNC_OFFSET(11790, glVertexAttrib1fvNV, glVertexAttrib1fvNV, NULL, _gloffset_VertexAttrib1fvNV), + NAME_FUNC_OFFSET(11810, glVertexAttrib1sNV, glVertexAttrib1sNV, NULL, _gloffset_VertexAttrib1sNV), + NAME_FUNC_OFFSET(11829, glVertexAttrib1svNV, glVertexAttrib1svNV, NULL, _gloffset_VertexAttrib1svNV), + NAME_FUNC_OFFSET(11849, glVertexAttrib2dNV, glVertexAttrib2dNV, NULL, _gloffset_VertexAttrib2dNV), + NAME_FUNC_OFFSET(11868, glVertexAttrib2dvNV, glVertexAttrib2dvNV, NULL, _gloffset_VertexAttrib2dvNV), + NAME_FUNC_OFFSET(11888, glVertexAttrib2fNV, glVertexAttrib2fNV, NULL, _gloffset_VertexAttrib2fNV), + NAME_FUNC_OFFSET(11907, glVertexAttrib2fvNV, glVertexAttrib2fvNV, NULL, _gloffset_VertexAttrib2fvNV), + NAME_FUNC_OFFSET(11927, glVertexAttrib2sNV, glVertexAttrib2sNV, NULL, _gloffset_VertexAttrib2sNV), + NAME_FUNC_OFFSET(11946, glVertexAttrib2svNV, glVertexAttrib2svNV, NULL, _gloffset_VertexAttrib2svNV), + NAME_FUNC_OFFSET(11966, glVertexAttrib3dNV, glVertexAttrib3dNV, NULL, _gloffset_VertexAttrib3dNV), + NAME_FUNC_OFFSET(11985, glVertexAttrib3dvNV, glVertexAttrib3dvNV, NULL, _gloffset_VertexAttrib3dvNV), + NAME_FUNC_OFFSET(12005, glVertexAttrib3fNV, glVertexAttrib3fNV, NULL, _gloffset_VertexAttrib3fNV), + NAME_FUNC_OFFSET(12024, glVertexAttrib3fvNV, glVertexAttrib3fvNV, NULL, _gloffset_VertexAttrib3fvNV), + NAME_FUNC_OFFSET(12044, glVertexAttrib3sNV, glVertexAttrib3sNV, NULL, _gloffset_VertexAttrib3sNV), + NAME_FUNC_OFFSET(12063, glVertexAttrib3svNV, glVertexAttrib3svNV, NULL, _gloffset_VertexAttrib3svNV), + NAME_FUNC_OFFSET(12083, glVertexAttrib4dNV, glVertexAttrib4dNV, NULL, _gloffset_VertexAttrib4dNV), + NAME_FUNC_OFFSET(12102, glVertexAttrib4dvNV, glVertexAttrib4dvNV, NULL, _gloffset_VertexAttrib4dvNV), + NAME_FUNC_OFFSET(12122, glVertexAttrib4fNV, glVertexAttrib4fNV, NULL, _gloffset_VertexAttrib4fNV), + NAME_FUNC_OFFSET(12141, glVertexAttrib4fvNV, glVertexAttrib4fvNV, NULL, _gloffset_VertexAttrib4fvNV), + NAME_FUNC_OFFSET(12161, glVertexAttrib4sNV, glVertexAttrib4sNV, NULL, _gloffset_VertexAttrib4sNV), + NAME_FUNC_OFFSET(12180, glVertexAttrib4svNV, glVertexAttrib4svNV, NULL, _gloffset_VertexAttrib4svNV), + NAME_FUNC_OFFSET(12200, glVertexAttrib4ubNV, glVertexAttrib4ubNV, NULL, _gloffset_VertexAttrib4ubNV), + NAME_FUNC_OFFSET(12220, glVertexAttrib4ubvNV, glVertexAttrib4ubvNV, NULL, _gloffset_VertexAttrib4ubvNV), + NAME_FUNC_OFFSET(12241, glVertexAttribPointerNV, glVertexAttribPointerNV, NULL, _gloffset_VertexAttribPointerNV), + NAME_FUNC_OFFSET(12265, glVertexAttribs1dvNV, glVertexAttribs1dvNV, NULL, _gloffset_VertexAttribs1dvNV), + NAME_FUNC_OFFSET(12286, glVertexAttribs1fvNV, glVertexAttribs1fvNV, NULL, _gloffset_VertexAttribs1fvNV), + NAME_FUNC_OFFSET(12307, glVertexAttribs1svNV, glVertexAttribs1svNV, NULL, _gloffset_VertexAttribs1svNV), + NAME_FUNC_OFFSET(12328, glVertexAttribs2dvNV, glVertexAttribs2dvNV, NULL, _gloffset_VertexAttribs2dvNV), + NAME_FUNC_OFFSET(12349, glVertexAttribs2fvNV, glVertexAttribs2fvNV, NULL, _gloffset_VertexAttribs2fvNV), + NAME_FUNC_OFFSET(12370, glVertexAttribs2svNV, glVertexAttribs2svNV, NULL, _gloffset_VertexAttribs2svNV), + NAME_FUNC_OFFSET(12391, glVertexAttribs3dvNV, glVertexAttribs3dvNV, NULL, _gloffset_VertexAttribs3dvNV), + NAME_FUNC_OFFSET(12412, glVertexAttribs3fvNV, glVertexAttribs3fvNV, NULL, _gloffset_VertexAttribs3fvNV), + NAME_FUNC_OFFSET(12433, glVertexAttribs3svNV, glVertexAttribs3svNV, NULL, _gloffset_VertexAttribs3svNV), + NAME_FUNC_OFFSET(12454, glVertexAttribs4dvNV, glVertexAttribs4dvNV, NULL, _gloffset_VertexAttribs4dvNV), + NAME_FUNC_OFFSET(12475, glVertexAttribs4fvNV, glVertexAttribs4fvNV, NULL, _gloffset_VertexAttribs4fvNV), + NAME_FUNC_OFFSET(12496, glVertexAttribs4svNV, glVertexAttribs4svNV, NULL, _gloffset_VertexAttribs4svNV), + NAME_FUNC_OFFSET(12517, glVertexAttribs4ubvNV, glVertexAttribs4ubvNV, NULL, _gloffset_VertexAttribs4ubvNV), + NAME_FUNC_OFFSET(12539, glGetTexBumpParameterfvATI, glGetTexBumpParameterfvATI, NULL, _gloffset_GetTexBumpParameterfvATI), + NAME_FUNC_OFFSET(12566, glGetTexBumpParameterivATI, glGetTexBumpParameterivATI, NULL, _gloffset_GetTexBumpParameterivATI), + NAME_FUNC_OFFSET(12593, glTexBumpParameterfvATI, glTexBumpParameterfvATI, NULL, _gloffset_TexBumpParameterfvATI), + NAME_FUNC_OFFSET(12617, glTexBumpParameterivATI, glTexBumpParameterivATI, NULL, _gloffset_TexBumpParameterivATI), + NAME_FUNC_OFFSET(12641, glAlphaFragmentOp1ATI, glAlphaFragmentOp1ATI, NULL, _gloffset_AlphaFragmentOp1ATI), + NAME_FUNC_OFFSET(12663, glAlphaFragmentOp2ATI, glAlphaFragmentOp2ATI, NULL, _gloffset_AlphaFragmentOp2ATI), + NAME_FUNC_OFFSET(12685, glAlphaFragmentOp3ATI, glAlphaFragmentOp3ATI, NULL, _gloffset_AlphaFragmentOp3ATI), + NAME_FUNC_OFFSET(12707, glBeginFragmentShaderATI, glBeginFragmentShaderATI, NULL, _gloffset_BeginFragmentShaderATI), + NAME_FUNC_OFFSET(12732, glBindFragmentShaderATI, glBindFragmentShaderATI, NULL, _gloffset_BindFragmentShaderATI), + NAME_FUNC_OFFSET(12756, glColorFragmentOp1ATI, glColorFragmentOp1ATI, NULL, _gloffset_ColorFragmentOp1ATI), + NAME_FUNC_OFFSET(12778, glColorFragmentOp2ATI, glColorFragmentOp2ATI, NULL, _gloffset_ColorFragmentOp2ATI), + NAME_FUNC_OFFSET(12800, glColorFragmentOp3ATI, glColorFragmentOp3ATI, NULL, _gloffset_ColorFragmentOp3ATI), + NAME_FUNC_OFFSET(12822, glDeleteFragmentShaderATI, glDeleteFragmentShaderATI, NULL, _gloffset_DeleteFragmentShaderATI), + NAME_FUNC_OFFSET(12848, glEndFragmentShaderATI, glEndFragmentShaderATI, NULL, _gloffset_EndFragmentShaderATI), + NAME_FUNC_OFFSET(12871, glGenFragmentShadersATI, glGenFragmentShadersATI, NULL, _gloffset_GenFragmentShadersATI), + NAME_FUNC_OFFSET(12895, glPassTexCoordATI, glPassTexCoordATI, NULL, _gloffset_PassTexCoordATI), + NAME_FUNC_OFFSET(12913, glSampleMapATI, glSampleMapATI, NULL, _gloffset_SampleMapATI), + NAME_FUNC_OFFSET(12928, glSetFragmentShaderConstantATI, glSetFragmentShaderConstantATI, NULL, _gloffset_SetFragmentShaderConstantATI), + NAME_FUNC_OFFSET(12959, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(12979, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(13000, gl_dispatch_stub_753, gl_dispatch_stub_753, NULL, _gloffset_ActiveStencilFaceEXT), + NAME_FUNC_OFFSET(13023, gl_dispatch_stub_754, gl_dispatch_stub_754, NULL, _gloffset_BindVertexArrayAPPLE), + NAME_FUNC_OFFSET(13046, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(13072, gl_dispatch_stub_756, gl_dispatch_stub_756, NULL, _gloffset_GenVertexArraysAPPLE), + NAME_FUNC_OFFSET(13095, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(13116, glGetProgramNamedParameterdvNV, glGetProgramNamedParameterdvNV, NULL, _gloffset_GetProgramNamedParameterdvNV), + NAME_FUNC_OFFSET(13147, glGetProgramNamedParameterfvNV, glGetProgramNamedParameterfvNV, NULL, _gloffset_GetProgramNamedParameterfvNV), + NAME_FUNC_OFFSET(13178, glProgramNamedParameter4dNV, glProgramNamedParameter4dNV, NULL, _gloffset_ProgramNamedParameter4dNV), + NAME_FUNC_OFFSET(13206, glProgramNamedParameter4dvNV, glProgramNamedParameter4dvNV, NULL, _gloffset_ProgramNamedParameter4dvNV), + NAME_FUNC_OFFSET(13235, glProgramNamedParameter4fNV, glProgramNamedParameter4fNV, NULL, _gloffset_ProgramNamedParameter4fNV), + NAME_FUNC_OFFSET(13263, glProgramNamedParameter4fvNV, glProgramNamedParameter4fvNV, NULL, _gloffset_ProgramNamedParameter4fvNV), + NAME_FUNC_OFFSET(13292, gl_dispatch_stub_764, gl_dispatch_stub_764, NULL, _gloffset_DepthBoundsEXT), + NAME_FUNC_OFFSET(13309, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(13336, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(13357, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(13379, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(13407, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(13431, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(13456, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(13485, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(13511, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(13537, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(13563, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(13584, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(13606, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(13626, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(13667, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(13699, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(13718, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(13738, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(13763, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(13784, gl_dispatch_stub_784, gl_dispatch_stub_784, NULL, _gloffset_BufferParameteriAPPLE), + NAME_FUNC_OFFSET(13808, gl_dispatch_stub_785, gl_dispatch_stub_785, NULL, _gloffset_FlushMappedBufferRangeAPPLE), + NAME_FUNC_OFFSET(13838, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(13867, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), + NAME_FUNC_OFFSET(13888, gl_dispatch_stub_788, gl_dispatch_stub_788, NULL, _gloffset_GetTexParameterPointervAPPLE), + NAME_FUNC_OFFSET(13919, gl_dispatch_stub_789, gl_dispatch_stub_789, NULL, _gloffset_TextureRangeAPPLE), + NAME_FUNC_OFFSET(13939, gl_dispatch_stub_790, gl_dispatch_stub_790, NULL, _gloffset_StencilFuncSeparateATI), + NAME_FUNC_OFFSET(13964, gl_dispatch_stub_791, gl_dispatch_stub_791, NULL, _gloffset_ProgramEnvParameters4fvEXT), + NAME_FUNC_OFFSET(13993, gl_dispatch_stub_792, gl_dispatch_stub_792, NULL, _gloffset_ProgramLocalParameters4fvEXT), + NAME_FUNC_OFFSET(14024, gl_dispatch_stub_793, gl_dispatch_stub_793, NULL, _gloffset_GetQueryObjecti64vEXT), + NAME_FUNC_OFFSET(14048, gl_dispatch_stub_794, gl_dispatch_stub_794, NULL, _gloffset_GetQueryObjectui64vEXT), + NAME_FUNC_OFFSET(14073, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(14091, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(14108, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(14124, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(14149, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(14169, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(14189, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(14212, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(14235, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(14255, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(14272, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(14289, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(14304, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(14328, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(14347, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(14366, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(14382, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(14401, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(14424, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14440, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14456, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(14483, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14510, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14530, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14549, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14568, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14598, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14628, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14658, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14688, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(14707, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(14730, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(14755, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(14780, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(14807, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(14835, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(14862, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(14890, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(14919, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(14948, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(14974, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(15005, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(15036, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(15060, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(15083, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(15101, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(15130, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(15159, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(15174, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(15200, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(15226, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(15241, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(15253, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(15273, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(15290, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(15306, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(15325, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(15348, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(15364, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(15386, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(15404, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(15423, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(15441, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(15460, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(15478, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(15497, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15515, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15534, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15552, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15571, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15589, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15608, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15626, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15645, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15663, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(15682, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(15700, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(15719, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(15737, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(15756, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(15774, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(15793, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(15811, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(15830, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(15848, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(15867, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(15885, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(15904, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(15922, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(15941, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(15959, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(15978, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), + NAME_FUNC_OFFSET(16001, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(16024, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(16047, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(16070, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(16093, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(16110, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(16133, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(16156, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(16179, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(16205, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(16231, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(16257, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(16281, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16308, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16334, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(16354, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(16374, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(16394, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), + NAME_FUNC_OFFSET(16417, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), + NAME_FUNC_OFFSET(16441, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), + NAME_FUNC_OFFSET(16464, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), + NAME_FUNC_OFFSET(16488, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(16505, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(16523, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(16540, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(16558, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(16575, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(16593, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(16610, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16628, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16645, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16663, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(16680, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(16698, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(16715, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(16733, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(16750, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(16768, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(16785, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(16803, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(16822, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(16841, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(16860, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(16879, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(16899, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(16919, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(16939, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET(16957, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(16974, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(16992, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(17009, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(17027, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET(17045, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(17062, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(17080, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET(17099, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET(17118, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET(17137, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(17159, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(17172, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(17185, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(17201, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(17217, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(17230, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(17253, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(17273, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(17292, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(17303, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(17315, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(17329, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(17342, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(17358, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(17369, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(17382, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(17401, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(17421, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(17434, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(17444, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(17460, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(17479, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(17497, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(17518, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(17533, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(17548, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(17562, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(17577, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(17589, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(17602, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(17614, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(17627, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(17639, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(17652, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(17664, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(17677, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(17689, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(17702, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17714, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17727, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17739, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(17752, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(17764, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(17777, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(17796, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(17815, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(17834, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(17847, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(17865, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(17886, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(17904, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(17924, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17938, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(17955, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(17971, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(17990, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18008, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18029, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18051, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18070, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18092, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18115, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(18134, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(18154, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(18173, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(18193, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(18212, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(18232, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(18251, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(18271, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(18290, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(18310, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(18330, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(18351, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(18371, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(18392, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(18412, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(18433, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(18457, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(18475, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(18495, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(18513, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(18525, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(18538, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(18550, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(18563, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18583, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18607, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18621, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18638, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18653, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18671, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18685, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18702, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18717, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18735, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18749, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18766, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18781, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18799, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18813, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18830, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18845, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18863, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18877, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18894, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18909, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18927, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18941, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18958, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18973, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(18991, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19005, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19022, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19037, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19055, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19069, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19086, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19101, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19119, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(19136, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(19156, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(19173, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19199, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19228, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(19243, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(19261, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(19280, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(19301, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(19317, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19341, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19368, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(19386, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(19405, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(19430, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(19451, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(19473, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(19499, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(19522, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(19545, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(19568, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(19586, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(19605, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(19622, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(19660, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(19689, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(19705, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(19722, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(19744, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(19762, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(19788, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 0f410fc482..342c9cde46 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -155,6 +155,15 @@ def PrintTail(): print '\t_mesa_strcmp' print '\t_mesa_test_proxy_teximage' print '\t_mesa_Viewport' + print '\t_mesa_meta_CopyColorSubTable' + print '\t_mesa_meta_CopyColorTable' + print '\t_mesa_meta_CopyConvolutionFilter1D' + print '\t_mesa_meta_CopyConvolutionFilter2D' + print '\t_mesa_meta_CopyTexImage1D' + print '\t_mesa_meta_CopyTexImage2D' + print '\t_mesa_meta_CopyTexSubImage1D' + print '\t_mesa_meta_CopyTexSubImage2D' + print '\t_mesa_meta_CopyTexSubImage3D' print '\t_swrast_Accum' print '\t_swrast_alloc_buffers' print '\t_swrast_Bitmap' @@ -164,15 +173,6 @@ def PrintTail(): print '\t_swrast_Clear' print '\t_swrast_choose_line' print '\t_swrast_choose_triangle' - print '\t_swrast_CopyColorSubTable' - print '\t_swrast_CopyColorTable' - print '\t_swrast_CopyConvolutionFilter1D' - print '\t_swrast_CopyConvolutionFilter2D' - print '\t_swrast_copy_teximage1d' - print '\t_swrast_copy_teximage2d' - print '\t_swrast_copy_texsubimage1d' - print '\t_swrast_copy_texsubimage2d' - print '\t_swrast_copy_texsubimage3d' print '\t_swrast_CreateContext' print '\t_swrast_DestroyContext' print '\t_swrast_InvalidateState' diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 2345695f3c..032e13b96e 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -29,6 +29,10 @@ #include "macros.h" #include "state.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_accum void GLAPIENTRY @@ -51,7 +55,7 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Accum( GLenum op, GLfloat value ) { GET_CURRENT_CONTEXT(ctx); @@ -99,6 +103,16 @@ _mesa_Accum( GLenum op, GLfloat value ) } +void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ + SET_Accum(disp, _mesa_Accum); + SET_ClearAccum(disp, _mesa_ClearAccum); +} + + +#endif /* FEATURE_accum */ + void _mesa_init_accum( GLcontext *ctx ) diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index ce92688a5b..63740f07ed 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -38,25 +38,40 @@ #define ACCUM_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ); +#if FEATURE_accum +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) \ + do { \ + (driver)->Accum = impl ## Accum; \ + } while (0) extern void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern void -_mesa_init_accum( GLcontext *ctx ); +extern void +_mesa_init_accum_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_accum */ -#else +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) do { } while (0) -/** No-op */ -#define _mesa_init_accum( c ) ((void)0) +static INLINE void +_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +{ + /* this is used in _mesa_PopAttrib */ + ASSERT_NO_FEATURE(); +} -#endif +static INLINE void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_accum */ + +extern void +_mesa_init_accum( GLcontext *ctx ); -#endif +#endif /* ACCUM_H */ diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 2462a1b003..a058227110 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -71,6 +71,10 @@ typedef struct { */ #define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) + +#if FEATURE_arrayelt + + static const int ColorFuncs[2][8] = { { _gloffset_Color3bv, @@ -1160,7 +1164,7 @@ static void _ae_update_state( GLcontext *ctx ) at->array = attribArray; /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV * function pointer here (for float arrays) since the pointer may - * change from one execution of _ae_loopback_array_elt() to + * change from one execution of _ae_ArrayElement() to * the next. Doing so caused UT to break. */ if (ctx->VertexProgram._Enabled @@ -1254,7 +1258,7 @@ void _ae_unmap_vbos( GLcontext *ctx ) * for all enabled vertex arrays (for elt-th element). * Note: this may be called during display list construction. */ -void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) +void GLAPIENTRY _ae_ArrayElement( GLint elt ) { GET_CURRENT_CONTEXT(ctx); const AEcontext *actx = AE_CONTEXT(ctx); @@ -1317,3 +1321,13 @@ void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) actx->NewState |= new_state; } } + + +void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_ArrayElement(disp, vfmt->ArrayElement); +} + + +#endif /* FEATURE_arrayelt */ diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h index e621724fb2..d18c0792c3 100644 --- a/src/mesa/main/api_arrayelt.h +++ b/src/mesa/main/api_arrayelt.h @@ -27,16 +27,57 @@ #ifndef API_ARRAYELT_H #define API_ARRAYELT_H -#include "mtypes.h" + +#include "main/mtypes.h" + +#if FEATURE_arrayelt + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->ArrayElement = impl ## ArrayElement; \ + } while (0) extern GLboolean _ae_create_context( GLcontext *ctx ); extern void _ae_destroy_context( GLcontext *ctx ); extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ); -extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt ); +extern void GLAPIENTRY _ae_ArrayElement( GLint elt ); /* May optionally be called before a batch of element calls: */ extern void _ae_map_vbos( GLcontext *ctx ); extern void _ae_unmap_vbos( GLcontext *ctx ); -#endif +extern void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +#else /* FEATURE_arrayelt */ + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0) + +static INLINE GLboolean +_ae_create_context( GLcontext *ctx ) +{ + return GL_TRUE; +} + +static INLINE void +_ae_destroy_context( GLcontext *ctx ) +{ +} + +static INLINE void +_ae_invalidate_state( GLcontext *ctx, GLuint new_state ) +{ +} + +static INLINE void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} + +#endif /* FEATURE_arrayelt */ + + +#endif /* API_ARRAYELT_H */ diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 02550ae108..1559984f43 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -30,9 +30,7 @@ #include "mfeatures.h" -#if FEATURE_accum #include "accum.h" -#endif #include "api_loopback.h" #include "api_exec.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program @@ -41,9 +39,7 @@ #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif -#if FEATURE_attrib_stack #include "attrib.h" -#endif #include "blend.h" #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" @@ -54,29 +50,17 @@ #endif #include "clear.h" #include "clip.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "depth.h" -#if FEATURE_dlist #include "dlist.h" -#endif -#if FEATURE_drawpix #include "drawpix.h" #include "rastpos.h" -#endif #include "enable.h" -#if FEATURE_evaluators #include "eval.h" -#endif #include "get.h" -#if FEATURE_feedback #include "feedback.h" -#endif #include "fog.h" #if FEATURE_EXT_framebuffer_object #include "fbobject.h" @@ -84,24 +68,18 @@ #include "ffvertex_prog.h" #include "framebuffer.h" #include "hint.h" -#if FEATURE_histogram #include "histogram.h" -#endif #include "imports.h" #include "light.h" #include "lines.h" #include "macros.h" #include "matrix.h" #include "multisample.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query #include "queryobj.h" -#endif #include "readpix.h" #include "scissor.h" #include "state.h" @@ -109,9 +87,7 @@ #include "texenv.h" #include "texgetimage.h" #include "teximage.h" -#if FEATURE_texgen #include "texgen.h" -#endif #include "texobj.h" #include "texparam.h" #include "texstate.h" @@ -199,20 +175,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexParameteri(exec, _mesa_TexParameteri); SET_Translatef(exec, _mesa_Translatef); SET_Viewport(exec, _mesa_Viewport); -#if FEATURE_accum - SET_Accum(exec, _mesa_Accum); - SET_ClearAccum(exec, _mesa_ClearAccum); -#endif -#if FEATURE_dlist - SET_CallList(exec, _mesa_CallList); - SET_CallLists(exec, _mesa_CallLists); - SET_DeleteLists(exec, _mesa_DeleteLists); - SET_EndList(exec, _mesa_EndList); - SET_GenLists(exec, _mesa_GenLists); - SET_IsList(exec, _mesa_IsList); - SET_ListBase(exec, _mesa_ListBase); - SET_NewList(exec, _mesa_NewList); -#endif + + _mesa_init_accum_dispatch(exec); + _mesa_init_dlist_dispatch(exec); + SET_ClearDepth(exec, _mesa_ClearDepth); SET_ClearIndex(exec, _mesa_ClearIndex); SET_ClipPlane(exec, _mesa_ClipPlane); @@ -222,21 +188,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_DepthFunc(exec, _mesa_DepthFunc); SET_DepthMask(exec, _mesa_DepthMask); SET_DepthRange(exec, _mesa_DepthRange); -#if FEATURE_drawpix - SET_Bitmap(exec, _mesa_Bitmap); - SET_CopyPixels(exec, _mesa_CopyPixels); - SET_DrawPixels(exec, _mesa_DrawPixels); -#endif -#if FEATURE_feedback - SET_InitNames(exec, _mesa_InitNames); - SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); - SET_LoadName(exec, _mesa_LoadName); - SET_PassThrough(exec, _mesa_PassThrough); - SET_PopName(exec, _mesa_PopName); - SET_PushName(exec, _mesa_PushName); - SET_SelectBuffer(exec, _mesa_SelectBuffer); - SET_RenderMode(exec, _mesa_RenderMode); -#endif + + _mesa_init_drawpix_dispatch(exec); + _mesa_init_feedback_dispatch(exec); + SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); SET_Fogf(exec, _mesa_Fogf); SET_Fogfv(exec, _mesa_Fogfv); @@ -270,68 +225,22 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Lighti(exec, _mesa_Lighti); SET_Lightiv(exec, _mesa_Lightiv); SET_LoadMatrixd(exec, _mesa_LoadMatrixd); -#if FEATURE_evaluators - SET_GetMapdv(exec, _mesa_GetMapdv); - SET_GetMapfv(exec, _mesa_GetMapfv); - SET_GetMapiv(exec, _mesa_GetMapiv); - SET_Map1d(exec, _mesa_Map1d); - SET_Map1f(exec, _mesa_Map1f); - SET_Map2d(exec, _mesa_Map2d); - SET_Map2f(exec, _mesa_Map2f); - SET_MapGrid1d(exec, _mesa_MapGrid1d); - SET_MapGrid1f(exec, _mesa_MapGrid1f); - SET_MapGrid2d(exec, _mesa_MapGrid2d); - SET_MapGrid2f(exec, _mesa_MapGrid2f); -#endif + + _mesa_init_eval_dispatch(exec); + SET_MultMatrixd(exec, _mesa_MultMatrixd); -#if FEATURE_pixel_transfer - SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); - SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); - SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); - SET_PixelMapfv(exec, _mesa_PixelMapfv); - SET_PixelMapuiv(exec, _mesa_PixelMapuiv); - SET_PixelMapusv(exec, _mesa_PixelMapusv); - SET_PixelTransferf(exec, _mesa_PixelTransferf); - SET_PixelTransferi(exec, _mesa_PixelTransferi); - SET_PixelZoom(exec, _mesa_PixelZoom); -#endif + + _mesa_init_pixel_dispatch(exec); + SET_PixelStoref(exec, _mesa_PixelStoref); SET_PointSize(exec, _mesa_PointSize); SET_PolygonMode(exec, _mesa_PolygonMode); SET_PolygonOffset(exec, _mesa_PolygonOffset); SET_PolygonStipple(exec, _mesa_PolygonStipple); -#if FEATURE_attrib_stack - SET_PopAttrib(exec, _mesa_PopAttrib); - SET_PushAttrib(exec, _mesa_PushAttrib); - SET_PopClientAttrib(exec, _mesa_PopClientAttrib); - SET_PushClientAttrib(exec, _mesa_PushClientAttrib); -#endif -#if FEATURE_drawpix - SET_RasterPos2f(exec, _mesa_RasterPos2f); - SET_RasterPos2fv(exec, _mesa_RasterPos2fv); - SET_RasterPos2i(exec, _mesa_RasterPos2i); - SET_RasterPos2iv(exec, _mesa_RasterPos2iv); - SET_RasterPos2d(exec, _mesa_RasterPos2d); - SET_RasterPos2dv(exec, _mesa_RasterPos2dv); - SET_RasterPos2s(exec, _mesa_RasterPos2s); - SET_RasterPos2sv(exec, _mesa_RasterPos2sv); - SET_RasterPos3d(exec, _mesa_RasterPos3d); - SET_RasterPos3dv(exec, _mesa_RasterPos3dv); - SET_RasterPos3f(exec, _mesa_RasterPos3f); - SET_RasterPos3fv(exec, _mesa_RasterPos3fv); - SET_RasterPos3i(exec, _mesa_RasterPos3i); - SET_RasterPos3iv(exec, _mesa_RasterPos3iv); - SET_RasterPos3s(exec, _mesa_RasterPos3s); - SET_RasterPos3sv(exec, _mesa_RasterPos3sv); - SET_RasterPos4d(exec, _mesa_RasterPos4d); - SET_RasterPos4dv(exec, _mesa_RasterPos4dv); - SET_RasterPos4f(exec, _mesa_RasterPos4f); - SET_RasterPos4fv(exec, _mesa_RasterPos4fv); - SET_RasterPos4i(exec, _mesa_RasterPos4i); - SET_RasterPos4iv(exec, _mesa_RasterPos4iv); - SET_RasterPos4s(exec, _mesa_RasterPos4s); - SET_RasterPos4sv(exec, _mesa_RasterPos4sv); -#endif + + _mesa_init_attrib_dispatch(exec); + _mesa_init_rastpos_dispatch(exec); + SET_ReadPixels(exec, _mesa_ReadPixels); SET_Rotated(exec, _mesa_Rotated); SET_Scaled(exec, _mesa_Scaled); @@ -339,17 +248,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexEnvf(exec, _mesa_TexEnvf); SET_TexEnviv(exec, _mesa_TexEnviv); -#if FEATURE_texgen - SET_GetTexGendv(exec, _mesa_GetTexGendv); - SET_GetTexGenfv(exec, _mesa_GetTexGenfv); - SET_GetTexGeniv(exec, _mesa_GetTexGeniv); - SET_TexGend(exec, _mesa_TexGend); - SET_TexGendv(exec, _mesa_TexGendv); - SET_TexGenf(exec, _mesa_TexGenf); - SET_TexGenfv(exec, _mesa_TexGenfv); - SET_TexGeni(exec, _mesa_TexGeni); - SET_TexGeniv(exec, _mesa_TexGeniv); -#endif + _mesa_init_texgen_dispatch(exec); SET_TexImage1D(exec, _mesa_TexImage1D); SET_TexParameterf(exec, _mesa_TexParameterf); @@ -395,45 +294,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_BlendEquation(exec, _mesa_BlendEquation); SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); -#if FEATURE_colortable - SET_ColorSubTable(exec, _mesa_ColorSubTable); - SET_ColorTable(exec, _mesa_ColorTable); - SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); -#endif - -#if FEATURE_convolve - SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); -#endif -#if FEATURE_histogram - SET_GetHistogram(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); - SET_Histogram(exec, _mesa_Histogram); - SET_Minmax(exec, _mesa_Minmax); - SET_ResetHistogram(exec, _mesa_ResetHistogram); - SET_ResetMinmax(exec, _mesa_ResetMinmax); -#endif + _mesa_init_colortable_dispatch(exec); + _mesa_init_convolve_dispatch(exec); + _mesa_init_histogram_dispatch(exec); /* OpenGL 2.0 */ SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); @@ -545,32 +408,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* 197. GL_MESA_window_pos */ -#if FEATURE_drawpix - SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); - SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); - SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); - SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); - SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); - SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); - SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); - SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); - SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); - SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); - SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); - SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); - SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); - SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); - SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); - SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); - SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); - SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); - SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); - SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); - SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); - SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); - SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); - SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); -#endif + /* part of _mesa_init_rastpos_dispatch(exec); */ /* 200. GL_IBM_multimode_draw_arrays */ #if _HAVE_FULL_GL @@ -762,16 +600,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - SET_GenQueriesARB(exec, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); - SET_IsQueryARB(exec, _mesa_IsQueryARB); - SET_BeginQueryARB(exec, _mesa_BeginQueryARB); - SET_EndQueryARB(exec, _mesa_EndQueryARB); - SET_GetQueryivARB(exec, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); -#endif + _mesa_init_queryobj_dispatch(exec); /* ARB 37. GL_ARB_draw_buffers */ #if FEATURE_draw_read_buffer @@ -881,11 +710,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); #endif -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - #if FEATURE_EXT_framebuffer_blit SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); #endif diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 0e3f5ff957..3d466ac44a 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -77,6 +77,10 @@ #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) #define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) + +#if FEATURE_beginend + + static void GLAPIENTRY loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) { @@ -1655,3 +1659,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_loopback.h b/src/mesa/main/api_loopback.h index 6f85bbc1d9..3140eb515e 100644 --- a/src/mesa/main/api_loopback.h +++ b/src/mesa/main/api_loopback.h @@ -27,11 +27,19 @@ #ifndef API_LOOPBACK_H #define API_LOOPBACK_H -#include "glheader.h" +#include "main/mtypes.h" - -struct _glapi_table; +#if FEATURE_beginend extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_loopback_init_api_table( struct _glapi_table *dest ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* API_LOOPBACK_H */ diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 09ba7e5062..f72f957300 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -30,9 +30,8 @@ #include "context.h" #include "light.h" #include "macros.h" -#if FEATURE_dlist #include "dlist.h" -#endif +#include "eval.h" #include "glapi/dispatch.h" @@ -44,6 +43,9 @@ */ +#if FEATURE_beginend + + static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b ) { GET_CURRENT_CONTEXT(ctx); @@ -731,7 +733,7 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, GET_CURRENT_CONTEXT(ctx); GLint i; - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; CALL_Begin(GET_DISPATCH(), (mode)); @@ -757,6 +759,43 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, CALL_End(GET_DISPATCH(), ()); } +static void GLAPIENTRY +_mesa_noop_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, + basevertex )) + return; + + CALL_Begin(GET_DISPATCH(), (mode)); + + switch (type) { + case GL_UNSIGNED_BYTE: + for (i = 0 ; i < count ; i++) + CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] + + basevertex)); + break; + case GL_UNSIGNED_SHORT: + for (i = 0 ; i < count ; i++) + CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] + + basevertex )); + break; + case GL_UNSIGNED_INT: + for (i = 0 ; i < count ; i++) + CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] + + basevertex )); + break; + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElementsBaseVertex(type)" ); + break; + } + + CALL_End(GET_DISPATCH(), ()); +} + static void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode, @@ -768,7 +807,7 @@ _mesa_noop_DrawRangeElements(GLenum mode, if (_mesa_validate_DrawRangeElements( ctx, mode, start, end, - count, type, indices )) + count, type, indices, 0 )) CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices)); } @@ -786,6 +825,40 @@ _mesa_noop_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, } } +static void GLAPIENTRY +_mesa_noop_DrawRangeElementsBaseVertex(GLenum mode, + GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + + if (_mesa_validate_DrawRangeElements( ctx, mode, + start, end, + count, type, indices, basevertex )) + CALL_DrawElementsBaseVertex(GET_DISPATCH(), (mode, count, type, indices, + basevertex)); +} + +/* GL_EXT_multi_draw_arrays */ +void GLAPIENTRY +_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex) +{ + GLsizei i; + + for (i = 0; i < primcount; i++) { + if (count[i] > 0) { + CALL_DrawElementsBaseVertex(GET_DISPATCH(), (mode, count[i], type, + indices[i], + basevertex[i])); + } + } +} + /* * Eval Mesh */ @@ -921,26 +994,21 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _mesa_noop_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif + + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + vfmt->Color3f = _mesa_noop_Color3f; vfmt->Color3fv = _mesa_noop_Color3fv; vfmt->Color4f = _mesa_noop_Color4f; vfmt->Color4fv = _mesa_noop_Color4fv; vfmt->EdgeFlag = _mesa_noop_EdgeFlag; vfmt->End = _mesa_noop_End; -#if FEATURE_evaluators - vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; - vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; - vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; - vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; - vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; - vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; -#endif + + _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_); + vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; vfmt->Indexf = _mesa_noop_Indexf; @@ -995,6 +1063,10 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) vfmt->DrawElements = _mesa_noop_DrawElements; vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; + vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; + vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; + vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_noop.h b/src/mesa/main/api_noop.h index a7956d00b3..e7fd49bafb 100644 --- a/src/mesa/main/api_noop.h +++ b/src/mesa/main/api_noop.h @@ -25,8 +25,9 @@ #ifndef _API_NOOP_H #define _API_NOOP_H -#include "mtypes.h" -#include "context.h" +#include "main/mtypes.h" + +#if FEATURE_beginend extern void GLAPIENTRY _mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); @@ -44,7 +45,16 @@ extern void GLAPIENTRY _mesa_noop_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +extern void GLAPIENTRY +_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex); + extern void _mesa_noop_vtxfmt_init(GLvertexformat *vfmt); -#endif +#endif /* FEATURE_beginend */ + +#endif /* _API_NOOP_H */ diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 507e21fe81..e71e5a6ce8 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -29,7 +29,7 @@ #include "imports.h" #include "mtypes.h" #include "state.h" - +#include "vbo/vbo.h" /** @@ -124,6 +124,40 @@ check_valid_to_render(GLcontext *ctx, const char *function) return GL_TRUE; } +static GLboolean +check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + struct _mesa_prim prim; + struct _mesa_index_buffer ib; + GLuint min, max; + + /* Only the X Server needs to do this -- otherwise, accessing outside + * array/BO bounds allows application termination. + */ + if (!ctx->Const.CheckArrayBounds) + return GL_TRUE; + + memset(&prim, 0, sizeof(prim)); + prim.count = count; + + memset(&ib, 0, sizeof(ib)); + ib.type = type; + ib.ptr = indices; + ib.obj = ctx->Array.ElementArrayBufferObj; + + vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); + + if (min + basevertex < 0 || + max + basevertex > ctx->Array.ArrayObj->_MaxElement) { + /* the max element is out of bounds of one or more enabled arrays */ + _mesa_warning(ctx, "glDrawElements() index=%u is " + "out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement); + return GL_FALSE; + } + + return GL_TRUE; +} /** * Error checking for glDrawElements(). Includes parameter checking @@ -133,7 +167,7 @@ check_valid_to_render(GLcontext *ctx, const char *function) GLboolean _mesa_validate_DrawElements(GLcontext *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) + const GLvoid *indices, GLint basevertex) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -177,17 +211,8 @@ _mesa_validate_DrawElements(GLcontext *ctx, return GL_FALSE; } - if (ctx->Const.CheckArrayBounds) { - /* find max array index */ - GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array.ArrayObj->_MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, "glDrawElements() index=%u is " - "out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement); - return GL_FALSE; - } - } + if (!check_index_bounds(ctx, count, type, indices, basevertex)) + return GL_FALSE; return GL_TRUE; } @@ -202,7 +227,7 @@ GLboolean _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices) + const GLvoid *indices, GLint basevertex) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -250,14 +275,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, return GL_FALSE; } - if (ctx->Const.CheckArrayBounds) { - GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array.ArrayObj->_MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - return GL_FALSE; - } - } + if (!check_index_bounds(ctx, count, type, indices, basevertex)) + return GL_FALSE; return GL_TRUE; } diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h index ff82a2966c..6064d15fe6 100644 --- a/src/mesa/main/api_validate.h +++ b/src/mesa/main/api_validate.h @@ -43,13 +43,13 @@ _mesa_validate_DrawArrays(GLcontext *ctx, extern GLboolean _mesa_validate_DrawElements(GLcontext *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices); + const GLvoid *indices, GLint basevertex); extern GLboolean _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices); + const GLvoid *indices, GLint basevertex); #endif diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index ab99ca1c64..246c5521b7 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -57,6 +57,7 @@ #include "varray.h" #include "viewport.h" #include "mtypes.h" +#include "glapi/dispatch.h" /** @@ -74,6 +75,7 @@ struct gl_enable_attrib GLboolean Convolution2D; GLboolean Separable2D; GLboolean CullFace; + GLboolean DepthClamp; GLboolean DepthTest; GLboolean Dither; GLboolean Fog; @@ -173,6 +175,9 @@ struct texture_state }; +#if FEATURE_attrib_stack + + /** * Allocate new attribute node of given type/kind. Attach payload data. * Insert it into the linked list named by 'head'. @@ -265,6 +270,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Convolution2D = ctx->Pixel.Convolution2DEnabled; attr->Separable2D = ctx->Pixel.Separable2DEnabled; attr->CullFace = ctx->Polygon.CullFlag; + attr->DepthClamp = ctx->Transform.DepthClamp; attr->DepthTest = ctx->Depth.Test; attr->Dither = ctx->Color.DitherFlag; attr->Fog = ctx->Fog.Enabled; @@ -514,6 +520,8 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) enable->ColorTable[COLORTABLE_POSTCOLORMATRIX], GL_POST_COLOR_MATRIX_COLOR_TABLE); TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE); + TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp, + GL_DEPTH_CLAMP); TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST); TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER); TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, @@ -1221,6 +1229,9 @@ _mesa_PopAttrib(void) if (xform->RescaleNormals != ctx->Transform.RescaleNormals) _mesa_set_enable(ctx, GL_RESCALE_NORMAL_EXT, ctx->Transform.RescaleNormals); + if (xform->DepthClamp != ctx->Transform.DepthClamp) + _mesa_set_enable(ctx, GL_DEPTH_CLAMP, + ctx->Transform.DepthClamp); } break; case GL_TEXTURE_BIT: @@ -1457,6 +1468,19 @@ _mesa_PopClientAttrib(void) } +void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ + SET_PopAttrib(disp, _mesa_PopAttrib); + SET_PushAttrib(disp, _mesa_PushAttrib); + SET_PopClientAttrib(disp, _mesa_PopClientAttrib); + SET_PushClientAttrib(disp, _mesa_PushClientAttrib); +} + + +#endif /* FEATURE_attrib_stack */ + + /** * Free any attribute state data that might be attached to the context. */ diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index 2cf8fe6934..6b48a17663 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -26,10 +26,10 @@ #define ATTRIB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_attrib_stack extern void GLAPIENTRY _mesa_PushAttrib( GLbitfield mask ); @@ -43,18 +43,34 @@ _mesa_PushClientAttrib( GLbitfield mask ); extern void GLAPIENTRY _mesa_PopClientAttrib( void ); +extern void +_mesa_init_attrib_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_attrib_stack */ + +static INLINE void +_mesa_PushClientAttrib( GLbitfield mask ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_PopClientAttrib( void ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_attrib_stack */ + 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 - -#endif +#endif /* ATTRIB_H */ diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5a7de5f209..5ede76c1fb 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -31,6 +31,11 @@ #include "macros.h" #include "state.h" #include "teximage.h" +#include "texstate.h" +#include "glapi/dispatch.h" + + +#if FEATURE_colortable /** @@ -278,7 +283,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 }; static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 }; GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = NULL; struct gl_color_table *table = NULL; GLboolean proxy = GL_FALSE; @@ -443,7 +448,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 }; static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 }; GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = NULL; struct gl_color_table *table = NULL; const GLfloat *scale = one, *bias = zero; @@ -535,37 +540,44 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - /* Select buffer to read from */ + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; GLfloat rgba[MAX_COLOR_TABLE_SIZE][4]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -694,7 +706,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GLfloat *scale, *bias; @@ -739,7 +751,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparams[4]; @@ -762,11 +774,11 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -889,11 +901,11 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -1044,6 +1056,25 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) } } + +void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ + SET_ColorSubTable(disp, _mesa_ColorSubTable); + SET_ColorTable(disp, _mesa_ColorTable); + SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv); + SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv); + SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable); + SET_CopyColorTable(disp, _mesa_CopyColorTable); + SET_GetColorTable(disp, _mesa_GetColorTable); + SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); +} + + +#endif /* FEATURE_colortable */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index b6ff737a65..652fb58246 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -27,9 +27,16 @@ #define COLORTAB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_colortable + +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyColorTable = impl ## CopyColorTable; \ + (driver)->CopyColorSubTable = impl ## CopyColorSubTable; \ + (driver)->UpdateTexturePalette = impl ## UpdateTexturePalette; \ + } while (0) extern void GLAPIENTRY _mesa_ColorTable( GLenum target, GLenum internalformat, @@ -41,32 +48,35 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table ); -extern void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_init_colortable_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); +#else /* FEATURE_colortable */ -extern void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); +static INLINE void GLAPIENTRY +_mesa_ColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); +static INLINE void GLAPIENTRY +_mesa_ColorSubTable( GLenum target, GLsizei start, + GLsizei count, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); +static INLINE void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_colortable */ extern void @@ -81,20 +91,5 @@ _mesa_init_colortables( GLcontext *ctx ); extern void _mesa_free_colortables_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_colortable( p ) ((void) 0) - -/** No-op */ -#define _mesa_free_colortable_data( p ) ((void) 0) - -/** No-op */ -#define _mesa_init_colortables( p ) ((void)0) - -/** No-op */ -#define _mesa_free_colortables_data( p ) ((void)0) - -#endif -#endif +#endif /* COLORTAB_H */ diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9319505a75..380663ec97 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -107,8 +107,7 @@ extern "C" { /** * finite macro. */ -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) -# define __WIN32__ +#if defined(_MSC_VER) # define finite _finite #elif defined(__WATCOMC__) # define finite _finite diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index e844a7432d..490b8f0f33 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -79,42 +79,28 @@ #include "glheader.h" #include "mfeatures.h" #include "imports.h" -#if FEATURE_accum #include "accum.h" -#endif #include "api_exec.h" #include "arrayobj.h" -#if FEATURE_attrib_stack #include "attrib.h" -#endif #include "blend.h" #include "buffers.h" #include "bufferobj.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "cpuinfo.h" #include "debug.h" #include "depth.h" -#if FEATURE_dlist #include "dlist.h" -#endif -#if FEATURE_evaluators #include "eval.h" -#endif #include "enums.h" #include "extensions.h" #include "fbobject.h" -#if FEATURE_feedback #include "feedback.h" -#endif #include "fog.h" #include "framebuffer.h" #include "get.h" -#if FEATURE_histogram #include "histogram.h" -#endif #include "hint.h" #include "hash.h" #include "light.h" @@ -126,15 +112,11 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query #include "queryobj.h" -#endif #if FEATURE_ARB_sync #include "syncobj.h" #endif -#if FEATURE_drawpix #include "rastpos.h" -#endif #include "scissor.h" #include "shared.h" #include "simple_list.h" @@ -191,6 +173,8 @@ GLfloat _mesa_ubyte_to_float_color_tab[256]; void _mesa_notifySwapBuffers(__GLcontext *ctx) { + if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS) + _mesa_debug(ctx, "SwapBuffers\n"); FLUSH_CURRENT( ctx, 0 ); if (ctx->Driver.Flush) { ctx->Driver.Flush(ctx); @@ -678,36 +662,20 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_extensions( ctx ); /* Attribute Groups */ -#if FEATURE_accum _mesa_init_accum( ctx ); -#endif -#if FEATURE_attrib_stack _mesa_init_attrib( ctx ); -#endif _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); -#if FEATURE_colortable _mesa_init_colortables( ctx ); -#endif _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); -#if FEATURE_dlist _mesa_init_display_list( ctx ); -#endif -#if FEATURE_evaluators _mesa_init_eval( ctx ); -#endif _mesa_init_fbobjects( ctx ); -#if FEATURE_feedback _mesa_init_feedback( ctx ); -#else - ctx->RenderMode = GL_RENDER; -#endif _mesa_init_fog( ctx ); -#if FEATURE_histogram _mesa_init_histogram( ctx ); -#endif _mesa_init_hint( ctx ); _mesa_init_line( ctx ); _mesa_init_lighting( ctx ); @@ -718,15 +686,11 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); -#if FEATURE_ARB_occlusion_query - _mesa_init_query( ctx ); -#endif + _mesa_init_queryobj( ctx ); #if FEATURE_ARB_sync _mesa_init_sync( ctx ); #endif -#if FEATURE_drawpix _mesa_init_rastpos( ctx ); -#endif _mesa_init_scissor( ctx ); _mesa_init_shader_state( ctx ); _mesa_init_stencil( ctx ); @@ -904,10 +868,12 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_init_exec_table(ctx->Exec); #endif ctx->CurrentDispatch = ctx->Exec; + #if FEATURE_dlist - _mesa_init_dlist_table(ctx->Save); + _mesa_init_save_table(ctx->Save); _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); #endif + /* Neutral tnl module stuff */ _mesa_init_exec_vtxfmt( ctx ); ctx->TnlModule.Current = NULL; @@ -1006,24 +972,16 @@ _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 ); -#endif _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); -#if FEATURE_colortable _mesa_free_colortables_data( ctx ); -#endif _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); -#if FEATURE_ARB_occlusion_query - _mesa_free_query_data(ctx); -#endif + _mesa_free_queryobj_data(ctx); #if FEATURE_ARB_sync _mesa_free_sync_data(ctx); #endif @@ -1055,6 +1013,9 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_shared_state( ctx, ctx->Shared ); } + /* needs to be after freeing shared state */ + _mesa_free_display_list_data(ctx); + if (ctx->Extensions.String) _mesa_free((void *) ctx->Extensions.String); diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 70951112a1..8db3e79d38 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -40,6 +40,10 @@ #include "mtypes.h" #include "pixel.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_convolve /* @@ -256,7 +260,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); @@ -299,7 +303,7 @@ _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -351,7 +355,7 @@ _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); @@ -394,7 +398,7 @@ _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -459,7 +463,7 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { GLint baseFormat; @@ -482,12 +486,16 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi return; } + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyConvolutionFilter1D( ctx, target, internalFormat, x, y, width); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { GLint baseFormat; @@ -514,12 +522,16 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi return; } + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, width, height ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) { @@ -578,7 +590,7 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -639,7 +651,7 @@ _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -709,7 +721,7 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) { @@ -776,7 +788,7 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) { const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; @@ -1425,3 +1437,25 @@ _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); } } + + +void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ + SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D); + SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D); + SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf); + SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv); + SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri); + SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv); + SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D); + SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D); + SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter); + SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv); + SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv); + SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D); + SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter); +} + + +#endif /* FEATURE_convolve */ diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 4505cdae01..59492bc7c5 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -28,10 +28,17 @@ #define CONVOLVE_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_convolve + +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyConvolutionFilter1D = impl ## CopyConvolutionFilter1D; \ + (driver)->CopyConvolutionFilter2D = impl ## CopyConvolutionFilter2D; \ + } while (0) + extern void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); @@ -41,74 +48,79 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -extern void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params); - -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLsizei height); +extern void +_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image); +extern void +_mesa_convolve_sep_image(const GLcontext *ctx, + GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params); +extern void +_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, + GLsizei *width, GLsizei *height); -extern void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params); +extern void +_mesa_init_convolve_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span); +#else /* FEATURE_convolve */ -extern void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *row, const GLvoid *column); +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) do { } while (0) +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, + GLenum format, GLenum type, const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_sep_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height); + GLsizei *width, GLsizei *height) +{ +} + +static INLINE void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ +} -#else -#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) -#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) -#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) -#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) -#endif +#endif /* FEATURE_convolve */ -#endif +#endif /* CONVOLVE_H */ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 4a700b5cb4..25aaddea81 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -545,12 +545,6 @@ struct dd_function_table { struct gl_texture_object *t ); /** - * Called by glPrioritizeTextures(). - */ - void (*PrioritizeTexture)( GLcontext *ctx, struct gl_texture_object *t, - GLclampf priority ); - - /** * Called by glActiveTextureARB() to set current texture unit. */ void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber ); @@ -717,7 +711,6 @@ struct dd_function_table { void (*TexParameter)(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params); - void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat); /** Set the viewport */ void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); /*@}*/ @@ -1172,7 +1165,22 @@ typedef struct { GLenum type, const GLvoid **indices, GLsizei primcount); - /*@}*/ + void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex ); + void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start, + GLuint end, GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex); + void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode, + const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex); + /*@}*/ /** * \name Eval diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 8492c8561d..0e35617575 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -27,6 +27,7 @@ #include "attrib.h" #include "colormac.h" #include "context.h" +#include "enums.h" #include "hash.h" #include "imports.h" #include "debug.h" @@ -167,14 +168,16 @@ static void add_debug_flags( const char *debug ) static const struct debug_option debug_opt[] = { { "varray", VERBOSE_VARRAY }, { "tex", VERBOSE_TEXTURE }, - { "imm", VERBOSE_IMMEDIATE }, + { "mat", VERBOSE_MATERIAL }, { "pipe", VERBOSE_PIPELINE }, { "driver", VERBOSE_DRIVER }, { "state", VERBOSE_STATE }, { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM } + { "disassem", VERBOSE_DISASSEM }, + { "draw", VERBOSE_DRAW }, + { "swap", VERBOSE_SWAPBUFFERS } }; GLuint i; @@ -262,10 +265,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height, /** - * Write level[0] image to a ppm file. + * Write a texture image to a ppm file. + * \param face cube face in [0,5] + * \param level mipmap level */ static void -write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) +write_texture_image(struct gl_texture_object *texObj, + GLuint face, GLuint level) { struct gl_texture_image *img = texObj->Image[face][level]; if (img) { @@ -297,16 +303,53 @@ write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) } +/** + * Write renderbuffer image to a ppm file. + */ +static void +write_renderbuffer_image(const struct gl_renderbuffer *rb) +{ + GET_CURRENT_CONTEXT(ctx); + GLubyte *buffer; + char s[100]; + GLenum format, type; + + if (rb->_BaseFormat == GL_RGB || + rb->_BaseFormat == GL_RGBA) { + format = GL_RGBA; + type = GL_UNSIGNED_BYTE; + } + else if (rb->_BaseFormat == GL_DEPTH_STENCIL) { + format = GL_DEPTH_STENCIL; + type = GL_UNSIGNED_INT_24_8; + } + else { + return; + } + + buffer = (GLubyte *) _mesa_malloc(rb->Width * rb->Height * 4); + + ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, + format, type, &ctx->DefaultPacking, buffer); + + /* make filename */ + _mesa_sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); + + _mesa_printf(" Writing renderbuffer image to %s\n", s); + write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); + + _mesa_free(buffer); +} + + static GLboolean DumpImages; static void -dump_texture_cb(GLuint id, void *data, void *userData) +dump_texture(struct gl_texture_object *texObj) { - struct gl_texture_object *texObj = (struct gl_texture_object *) data; int i; GLboolean written = GL_FALSE; - (void) userData; _mesa_printf("Texture %u\n", texObj->Name); _mesa_printf(" Target 0x%x\n", texObj->Target); @@ -327,6 +370,30 @@ dump_texture_cb(GLuint id, void *data, void *userData) /** + * Dump a single texture. + */ +void +_mesa_dump_texture(GLuint texture, GLboolean dumpImages) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture); + if (texObj) { + DumpImages = dumpImages; + dump_texture(texObj); + } +} + + +static void +dump_texture_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + (void) userData; + dump_texture(texObj); +} + + +/** * Print basic info about all texture objext to stdout. * If dumpImages is true, write PPM of level[0] image to a file. */ @@ -339,6 +406,35 @@ _mesa_dump_textures(GLboolean dumpImages) } +static void +dump_renderbuffer_cb(GLuint id, void *data, void *userData) +{ + const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; + (void) userData; + + _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n", + rb->Name, rb->Width, rb->Height, + _mesa_lookup_enum_by_nr(rb->InternalFormat)); + if (DumpImages) { + write_renderbuffer_image(rb); + } +} + + +/** + * Print basic info about all renderbuffers to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_renderbuffers(GLboolean dumpImages) +{ + GET_CURRENT_CONTEXT(ctx); + DumpImages = dumpImages; + _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx); +} + + + void _mesa_dump_color_buffer(const char *filename) { diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index bb384c4324..f66f774a45 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -58,9 +58,15 @@ extern void _mesa_init_debug( GLcontext *ctx ); #endif extern void +_mesa_dump_texture(GLuint texture, GLboolean dumpImages); + +extern void _mesa_dump_textures(GLboolean dumpImages); extern void +_mesa_dump_renderbuffers(GLboolean dumpImages); + +extern void _mesa_dump_color_buffer(const char *filename); extern void diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 41a5b61406..b692c335a7 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.7 * - * 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"), @@ -73,6 +74,7 @@ #include "texstate.h" #include "mtypes.h" #include "varray.h" +#include "vtxfmt.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program #include "shader/arbprogram.h" #include "shader/program.h" @@ -90,6 +92,33 @@ #include "glapi/dispatch.h" + +/** + * Other parts of Mesa (such as the VBO module) can plug into the display + * list system. This structure describes new display list instructions. + */ +struct gl_list_instruction +{ + GLuint Size; + void (*Execute)( GLcontext *ctx, void *data ); + void (*Destroy)( GLcontext *ctx, void *data ); + void (*Print)( GLcontext *ctx, void *data ); +}; + + +#define MAX_DLIST_EXT_OPCODES 16 + +/** + * Used by device drivers to hook new commands into display lists. + */ +struct gl_list_extensions +{ + struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES]; + GLuint NumOpcodes; +}; + + + /** * Flush vertices. * @@ -438,6 +467,10 @@ typedef union gl_dlist_node Node; */ static GLuint InstSize[OPCODE_END_OF_LIST + 1]; + +#if FEATURE_dlist + + void mesa_print_display_list(GLuint list); @@ -472,6 +505,49 @@ lookup_list(GLcontext *ctx, GLuint list) } +/** Is the given opcode an extension code? */ +static INLINE GLboolean +is_ext_opcode(OpCode opcode) +{ + return (opcode >= OPCODE_EXT_0); +} + + +/** Destroy an extended opcode instruction */ +static GLint +ext_opcode_destroy(GLcontext *ctx, Node *node) +{ + const GLint i = node[0].opcode - OPCODE_EXT_0; + GLint step; + ctx->ListExt->Opcode[i].Destroy(ctx, &node[1]); + step = ctx->ListExt->Opcode[i].Size; + return step; +} + + +/** Execute an extended opcode instruction */ +static GLint +ext_opcode_execute(GLcontext *ctx, Node *node) +{ + const GLint i = node[0].opcode - OPCODE_EXT_0; + GLint step; + ctx->ListExt->Opcode[i].Execute(ctx, &node[1]); + step = ctx->ListExt->Opcode[i].Size; + return step; +} + + +/** Print an extended opcode instruction */ +static GLint +ext_opcode_print(GLcontext *ctx, Node *node) +{ + const GLint i = node[0].opcode - OPCODE_EXT_0; + GLint step; + ctx->ListExt->Opcode[i].Print(ctx, &node[1]); + step = ctx->ListExt->Opcode[i].Size; + return step; +} + /** * Delete the named display list, but don't remove from hash table. @@ -487,16 +563,14 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) done = block ? GL_FALSE : GL_TRUE; while (!done) { + const OpCode opcode = n[0].opcode; /* check for extension opcodes first */ - - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_destroy(ctx, n); } else { - switch (n[0].opcode) { + switch (opcode) { /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: _mesa_free(n[6].data); @@ -784,14 +858,13 @@ unpack_image(GLcontext *ctx, GLuint dimensions, /** - * Allocate space for a display list instruction. + * Allocate space for a display list instruction (opcode + payload space). * \param opcode the instruction opcode (OPCODE_* value) - * \param bytes instruction size in bytes, not counting opcode. - * \return pointer to the usable data area (not including the internal - * opcode). + * \param bytes instruction payload size (not counting opcode) + * \return pointer to allocated memory (the opcode space) */ -void * -_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) +static Node * +dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes) { const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node); Node *n; @@ -825,9 +898,30 @@ _mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; ctx->ListState.CurrentPos += numNodes; - n[0].opcode = (OpCode) opcode; + n[0].opcode = opcode; - return (void *) (n + 1); /* return ptr to node following opcode */ + return n; +} + + + +/** + * Allocate space for a display list instruction. Used by callers outside + * this file for things like VBO vertex data. + * + * \param opcode the instruction opcode (OPCODE_* value) + * \param bytes instruction size in bytes, not counting opcode. + * \return pointer to the usable data area (not including the internal + * opcode). + */ +void * +_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes) +{ + Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes); + if (n) + return n + 1; /* return pointer to payload area, after opcode */ + else + return NULL; } @@ -842,35 +936,39 @@ _mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) * \return the new opcode number or -1 if error */ GLint -_mesa_alloc_opcode(GLcontext *ctx, - GLuint size, - void (*execute) (GLcontext *, void *), - void (*destroy) (GLcontext *, void *), - void (*print) (GLcontext *, void *)) -{ - if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) { - const GLuint i = ctx->ListExt.NumOpcodes++; - ctx->ListExt.Opcode[i].Size = +_mesa_dlist_alloc_opcode(GLcontext *ctx, + GLuint size, + void (*execute) (GLcontext *, void *), + void (*destroy) (GLcontext *, void *), + void (*print) (GLcontext *, void *)) +{ + if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) { + const GLuint i = ctx->ListExt->NumOpcodes++; + ctx->ListExt->Opcode[i].Size = 1 + (size + sizeof(Node) - 1) / sizeof(Node); - ctx->ListExt.Opcode[i].Execute = execute; - ctx->ListExt.Opcode[i].Destroy = destroy; - ctx->ListExt.Opcode[i].Print = print; + ctx->ListExt->Opcode[i].Execute = execute; + ctx->ListExt->Opcode[i].Destroy = destroy; + ctx->ListExt->Opcode[i].Print = print; return i + OPCODE_EXT_0; } return -1; } - /** - * Allocate display list instruction. Returns Node ptr to where the opcode - * is stored. - * - nParams is the number of function parameters - * - return value a pointer to sizeof(Node) before the actual - * usable data area. + * Allocate space for a display list instruction. The space is basically + * an array of Nodes where node[0] holds the opcode, node[1] is the first + * function parameter, node[2] is the second parameter, etc. + * + * \param opcode one of OPCODE_x + * \param nparams number of function parameters + * \return pointer to start of instruction space */ -#define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \ - ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1) +static INLINE Node * +alloc_instruction(GLcontext *ctx, OpCode opcode, GLuint nparams) +{ + return dlist_alloc(ctx, opcode, nparams * sizeof(Node)); +} @@ -883,7 +981,7 @@ save_Accum(GLenum op, GLfloat value) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACCUM, 2); + n = alloc_instruction(ctx, OPCODE_ACCUM, 2); if (n) { n[1].e = op; n[2].f = value; @@ -900,7 +998,7 @@ save_AlphaFunc(GLenum func, GLclampf ref) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ALPHA_FUNC, 2); + n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2); if (n) { n[1].e = func; n[2].f = (GLfloat) ref; @@ -917,7 +1015,7 @@ save_BindTexture(GLenum target, GLuint texture) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_TEXTURE, 2); + n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2); if (n) { n[1].e = target; n[2].ui = texture; @@ -936,7 +1034,7 @@ save_Bitmap(GLsizei width, GLsizei height, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BITMAP, 7); + n = alloc_instruction(ctx, OPCODE_BITMAP, 7); if (n) { n[1].i = (GLint) width; n[2].i = (GLint) height; @@ -959,7 +1057,7 @@ save_BlendEquation(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION, 1); + n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1); if (n) { n[1].e = mode; } @@ -975,7 +1073,7 @@ save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); + n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); if (n) { n[1].e = modeRGB; n[2].e = modeA; @@ -993,7 +1091,7 @@ save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); if (n) { n[1].e = sfactorRGB; n[2].e = dfactorRGB; @@ -1020,7 +1118,7 @@ save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_COLOR, 4); + n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1047,14 +1145,14 @@ static void invalidate_saved_current_state( GLcontext *ctx ) ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; } -void GLAPIENTRY -_mesa_save_CallList(GLuint list) +static void GLAPIENTRY +save_CallList(GLuint list) { GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST, 1); + n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1); if (n) { n[1].ui = list; } @@ -1070,8 +1168,8 @@ _mesa_save_CallList(GLuint list) } -void GLAPIENTRY -_mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) +static void GLAPIENTRY +save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) { GET_CURRENT_CONTEXT(ctx); GLint i; @@ -1098,7 +1196,7 @@ _mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) for (i = 0; i < num; i++) { GLint list = translate_id(i, type, lists); - Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2); + Node *n = alloc_instruction(ctx, OPCODE_CALL_LIST_OFFSET, 2); if (n) { n[1].i = list; n[2].b = typeErrorFlag; @@ -1122,7 +1220,7 @@ save_Clear(GLbitfield mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR, 1); if (n) { n[1].bf = mask; } @@ -1138,7 +1236,7 @@ save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_ACCUM, 4); + n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1157,7 +1255,7 @@ save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_COLOR, 4); + n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1176,7 +1274,7 @@ save_ClearDepth(GLclampd depth) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_DEPTH, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1); if (n) { n[1].f = (GLfloat) depth; } @@ -1192,7 +1290,7 @@ save_ClearIndex(GLfloat c) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_INDEX, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1); if (n) { n[1].f = c; } @@ -1208,7 +1306,7 @@ save_ClearStencil(GLint s) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_STENCIL, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1); if (n) { n[1].i = s; } @@ -1224,7 +1322,7 @@ save_ClipPlane(GLenum plane, const GLdouble * equ) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLIP_PLANE, 5); + n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5); if (n) { n[1].e = plane; n[2].f = (GLfloat) equ[0]; @@ -1246,7 +1344,7 @@ save_ColorMask(GLboolean red, GLboolean green, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MASK, 4); + n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4); if (n) { n[1].b = red; n[2].b = green; @@ -1266,7 +1364,7 @@ save_ColorMaterial(GLenum face, GLenum mode) Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MATERIAL, 2); + n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2); if (n) { n[1].e = face; n[2].e = mode; @@ -1291,7 +1389,7 @@ save_ColorTable(GLenum target, GLenum internalFormat, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1319,7 +1417,7 @@ save_ColorTableParameterfv(GLenum target, GLenum pname, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1348,7 +1446,7 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1377,7 +1475,7 @@ save_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_SUB_TABLE, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6); if (n) { n[1].e = target; n[2].i = start; @@ -1402,7 +1500,7 @@ save_CopyColorSubTable(GLenum target, GLsizei start, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); + n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); if (n) { n[1].e = target; n[2].i = start; @@ -1424,7 +1522,7 @@ save_CopyColorTable(GLenum target, GLenum internalformat, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_TABLE, 5); + n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5); if (n) { n[1].e = target; n[2].e = internalformat; @@ -1447,7 +1545,7 @@ save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1474,7 +1572,7 @@ save_ConvolutionFilter2D(GLenum target, GLenum internalFormat, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1499,7 +1597,7 @@ save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); if (n) { n[1].e = target; n[2].e = pname; @@ -1517,7 +1615,7 @@ save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1545,7 +1643,7 @@ save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); if (n) { n[1].e = target; n[2].e = pname; @@ -1564,7 +1662,7 @@ save_ConvolutionParameterfv(GLenum target, GLenum pname, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1592,7 +1690,7 @@ save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_PIXELS, 5); + n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5); if (n) { n[1].i = x; n[2].i = y; @@ -1614,7 +1712,7 @@ save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -1640,7 +1738,7 @@ save_CopyTexImage2D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -1666,7 +1764,7 @@ save_CopyTexSubImage1D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); if (n) { n[1].e = target; n[2].i = level; @@ -1690,7 +1788,7 @@ save_CopyTexSubImage2D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -1716,7 +1814,7 @@ save_CopyTexSubImage3D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -1742,7 +1840,7 @@ save_CullFace(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CULL_FACE, 1); + n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1); if (n) { n[1].e = mode; } @@ -1758,7 +1856,7 @@ save_DepthFunc(GLenum func) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_FUNC, 1); + n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1); if (n) { n[1].e = func; } @@ -1774,7 +1872,7 @@ save_DepthMask(GLboolean mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_MASK, 1); + n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1); if (n) { n[1].b = mask; } @@ -1790,7 +1888,7 @@ save_DepthRange(GLclampd nearval, GLclampd farval) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_RANGE, 2); + n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2); if (n) { n[1].f = (GLfloat) nearval; n[2].f = (GLfloat) farval; @@ -1807,7 +1905,7 @@ save_Disable(GLenum cap) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DISABLE, 1); + n = alloc_instruction(ctx, OPCODE_DISABLE, 1); if (n) { n[1].e = cap; } @@ -1823,7 +1921,7 @@ save_DrawBuffer(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFER, 1); + n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1); if (n) { n[1].e = mode; } @@ -1842,7 +1940,7 @@ save_DrawPixels(GLsizei width, GLsizei height, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_PIXELS, 5); + n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5); if (n) { n[1].i = width; n[2].i = height; @@ -1864,7 +1962,7 @@ save_Enable(GLenum cap) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ENABLE, 1); + n = alloc_instruction(ctx, OPCODE_ENABLE, 1); if (n) { n[1].e = cap; } @@ -1876,12 +1974,12 @@ save_Enable(GLenum cap) static void GLAPIENTRY -_mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) +save_EvalMesh1(GLenum mode, GLint i1, GLint i2) { GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH1, 3); + n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3); if (n) { n[1].e = mode; n[2].i = i1; @@ -1894,12 +1992,12 @@ _mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) static void GLAPIENTRY -_mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) { GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH2, 5); + n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5); if (n) { n[1].e = mode; n[2].i = i1; @@ -1921,7 +2019,7 @@ save_Fogfv(GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FOG, 5); + n = alloc_instruction(ctx, OPCODE_FOG, 5); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -1990,7 +2088,7 @@ save_FrontFace(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRONT_FACE, 1); + n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1); if (n) { n[1].e = mode; } @@ -2007,7 +2105,7 @@ save_Frustum(GLdouble left, GLdouble right, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRUSTUM, 6); + n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6); if (n) { n[1].f = (GLfloat) left; n[2].f = (GLfloat) right; @@ -2028,7 +2126,7 @@ save_Hint(GLenum target, GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HINT, 2); + n = alloc_instruction(ctx, OPCODE_HINT, 2); if (n) { n[1].e = target; n[2].e = mode; @@ -2047,7 +2145,7 @@ save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HISTOGRAM, 4); + n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4); if (n) { n[1].e = target; n[2].i = width; @@ -2066,7 +2164,7 @@ save_IndexMask(GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX_MASK, 1); + n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1); if (n) { n[1].ui = mask; } @@ -2081,7 +2179,7 @@ save_InitNames(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_INIT_NAMES, 0); + (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0); if (ctx->ExecuteFlag) { CALL_InitNames(ctx->Exec, ()); } @@ -2094,7 +2192,7 @@ save_Lightfv(GLenum light, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT, 6); + n = alloc_instruction(ctx, OPCODE_LIGHT, 6); if (n) { GLint i, nParams; n[1].e = light; @@ -2208,7 +2306,7 @@ save_LightModelfv(GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT_MODEL, 5); + n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -2275,7 +2373,7 @@ save_LineStipple(GLint factor, GLushort pattern) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_STIPPLE, 2); + n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2); if (n) { n[1].i = factor; n[2].us = pattern; @@ -2292,7 +2390,7 @@ save_LineWidth(GLfloat width) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_WIDTH, 1); + n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1); if (n) { n[1].f = width; } @@ -2308,7 +2406,7 @@ save_ListBase(GLuint base) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIST_BASE, 1); + n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1); if (n) { n[1].ui = base; } @@ -2323,7 +2421,7 @@ save_LoadIdentity(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0); + (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0); if (ctx->ExecuteFlag) { CALL_LoadIdentity(ctx->Exec, ()); } @@ -2336,7 +2434,7 @@ save_LoadMatrixf(const GLfloat * m) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_MATRIX, 16); + n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16); if (n) { GLuint i; for (i = 0; i < 16; i++) { @@ -2367,7 +2465,7 @@ save_LoadName(GLuint name) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_NAME, 1); + n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1); if (n) { n[1].ui = name; } @@ -2383,7 +2481,7 @@ save_LogicOp(GLenum opcode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOGIC_OP, 1); + n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1); if (n) { n[1].e = opcode; } @@ -2400,7 +2498,7 @@ save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 6); if (n) { GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points); n[1].e = target; @@ -2422,7 +2520,7 @@ save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 6); if (n) { GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points); n[1].e = target; @@ -2447,7 +2545,7 @@ save_Map2d(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 10); if (n) { GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder, vstride, vorder, points); @@ -2480,7 +2578,7 @@ save_Map2f(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 10); if (n) { GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder, vstride, vorder, points); @@ -2509,7 +2607,7 @@ save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID1, 3); + n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3); if (n) { n[1].i = un; n[2].f = u1; @@ -2535,7 +2633,7 @@ save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID2, 6); + n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6); if (n) { n[1].i = un; n[2].f = u1; @@ -2566,7 +2664,7 @@ save_MatrixMode(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATRIX_MODE, 1); + n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1); if (n) { n[1].e = mode; } @@ -2583,7 +2681,7 @@ save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3); + n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -2601,7 +2699,7 @@ save_MultMatrixf(const GLfloat * m) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MULT_MATRIX, 16); + n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16); if (n) { GLuint i; for (i = 0; i < 16; i++) { @@ -2645,7 +2743,7 @@ save_Ortho(GLdouble left, GLdouble right, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6); + n = alloc_instruction(ctx, OPCODE_ORTHO, 6); if (n) { n[1].f = (GLfloat) left; n[2].f = (GLfloat) right; @@ -2666,7 +2764,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_MAP, 3); + n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3); if (n) { n[1].e = map; n[2].i = mapsize; @@ -2723,7 +2821,7 @@ save_PixelTransferf(GLenum pname, GLfloat param) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_TRANSFER, 2); + n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2); if (n) { n[1].e = pname; n[2].f = param; @@ -2747,7 +2845,7 @@ save_PixelZoom(GLfloat xfactor, GLfloat yfactor) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_ZOOM, 2); + n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2); if (n) { n[1].f = xfactor; n[2].f = yfactor; @@ -2764,7 +2862,7 @@ save_PointParameterfvEXT(GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_PARAMETERS, 4); + n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -2811,7 +2909,7 @@ save_PointSize(GLfloat size) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_SIZE, 1); + n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1); if (n) { n[1].f = size; } @@ -2827,7 +2925,7 @@ save_PolygonMode(GLenum face, GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_MODE, 2); + n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2); if (n) { n[1].e = face; n[2].e = mode; @@ -2846,7 +2944,7 @@ save_PolygonStipple(const GLubyte * pattern) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1); + n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, 1); if (n) { n[1].data = unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, pattern, &ctx->Unpack); @@ -2863,7 +2961,7 @@ save_PolygonOffset(GLfloat factor, GLfloat units) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_OFFSET, 2); + n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2); if (n) { n[1].f = factor; n[2].f = units; @@ -2888,7 +2986,7 @@ save_PopAttrib(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_ATTRIB, 0); + (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0); if (ctx->ExecuteFlag) { CALL_PopAttrib(ctx->Exec, ()); } @@ -2900,7 +2998,7 @@ save_PopMatrix(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_MATRIX, 0); + (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0); if (ctx->ExecuteFlag) { CALL_PopMatrix(ctx->Exec, ()); } @@ -2912,7 +3010,7 @@ save_PopName(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_NAME, 0); + (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0); if (ctx->ExecuteFlag) { CALL_PopName(ctx->Exec, ()); } @@ -2929,7 +3027,7 @@ save_PrioritizeTextures(GLsizei num, const GLuint * textures, for (i = 0; i < num; i++) { Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); + n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); if (n) { n[1].ui = textures[i]; n[2].f = priorities[i]; @@ -2947,7 +3045,7 @@ save_PushAttrib(GLbitfield mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_ATTRIB, 1); + n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1); if (n) { n[1].bf = mask; } @@ -2962,7 +3060,7 @@ save_PushMatrix(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_MATRIX, 0); + (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0); if (ctx->ExecuteFlag) { CALL_PushMatrix(ctx->Exec, ()); } @@ -2975,7 +3073,7 @@ save_PushName(GLuint name) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_NAME, 1); + n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1); if (n) { n[1].ui = name; } @@ -2991,7 +3089,7 @@ save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RASTER_POS, 4); + n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4); if (n) { n[1].f = x; n[2].f = y; @@ -3150,7 +3248,7 @@ save_PassThrough(GLfloat token) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PASSTHROUGH, 1); + n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1); if (n) { n[1].f = token; } @@ -3166,7 +3264,7 @@ save_ReadBuffer(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_READ_BUFFER, 1); + n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1); if (n) { n[1].e = mode; } @@ -3182,7 +3280,7 @@ save_ResetHistogram(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_HISTOGRAM, 1); + n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1); if (n) { n[1].e = target; } @@ -3198,7 +3296,7 @@ save_ResetMinmax(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_MIN_MAX, 1); + n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1); if (n) { n[1].e = target; } @@ -3214,7 +3312,7 @@ save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ROTATE, 4); + n = alloc_instruction(ctx, OPCODE_ROTATE, 4); if (n) { n[1].f = angle; n[2].f = x; @@ -3240,7 +3338,7 @@ save_Scalef(GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SCALE, 3); + n = alloc_instruction(ctx, OPCODE_SCALE, 3); if (n) { n[1].f = x; n[2].f = y; @@ -3265,7 +3363,7 @@ save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SCISSOR, 4); + n = alloc_instruction(ctx, OPCODE_SCISSOR, 4); if (n) { n[1].i = x; n[2].i = y; @@ -3299,7 +3397,7 @@ save_ShadeModel(GLenum mode) if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) ctx->ListState.Current.ShadeModel = mode; - n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1); + n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1); if (n) { n[1].e = mode; } @@ -3312,7 +3410,7 @@ save_StencilFunc(GLenum func, GLint ref, GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC, 3); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3); if (n) { n[1].e = func; n[2].i = ref; @@ -3330,7 +3428,7 @@ save_StencilMask(GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK, 1); + n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1); if (n) { n[1].ui = mask; } @@ -3346,7 +3444,7 @@ save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP, 3); + n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3); if (n) { n[1].e = fail; n[2].e = zfail; @@ -3364,7 +3462,7 @@ save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = face; n[2].e = func; @@ -3385,7 +3483,7 @@ save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* GL_FRONT */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = GL_FRONT; n[2].e = frontfunc; @@ -3393,7 +3491,7 @@ save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, n[4].ui = mask; } /* GL_BACK */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = GL_BACK; n[2].e = backfunc; @@ -3413,7 +3511,7 @@ save_StencilMaskSeparate(GLenum face, GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); + n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); if (n) { n[1].e = face; n[2].ui = mask; @@ -3430,7 +3528,7 @@ save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); if (n) { n[1].e = face; n[2].e = fail; @@ -3449,7 +3547,7 @@ save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXENV, 6); + n = alloc_instruction(ctx, OPCODE_TEXENV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -3514,7 +3612,7 @@ save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXGEN, 6); + n = alloc_instruction(ctx, OPCODE_TEXGEN, 6); if (n) { n[1].e = coord; n[2].e = pname; @@ -3589,7 +3687,7 @@ save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXPARAMETER, 6); + n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -3649,7 +3747,7 @@ save_TexImage1D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE1D, 8); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -3684,7 +3782,7 @@ save_TexImage2D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -3722,7 +3820,7 @@ save_TexImage3D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE3D, 10); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10); if (n) { n[1].e = target; n[2].i = level; @@ -3755,7 +3853,7 @@ save_TexSubImage1D(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -3784,7 +3882,7 @@ save_TexSubImage2D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -3815,7 +3913,7 @@ save_TexSubImage3D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); if (n) { n[1].e = target; n[2].i = level; @@ -3845,7 +3943,7 @@ save_Translatef(GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRANSLATE, 3); + n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3); if (n) { n[1].f = x; n[2].f = y; @@ -3871,7 +3969,7 @@ save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_VIEWPORT, 4); + n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4); if (n) { n[1].i = x; n[2].i = y; @@ -3890,7 +3988,7 @@ save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_WINDOW_POS, 4); + n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4); if (n) { n[1].f = x; n[2].f = y; @@ -4051,7 +4149,7 @@ save_ActiveTextureARB(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_TEXTURE, 1); + n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1); if (n) { n[1].e = target; } @@ -4124,7 +4222,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -4170,7 +4268,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -4217,7 +4315,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -4260,7 +4358,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -4300,7 +4398,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -4342,7 +4440,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); if (n) { n[1].e = target; n[2].i = level; @@ -4375,7 +4473,7 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SAMPLE_COVERAGE, 2); + n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2); if (n) { n[1].f = value; n[2].b = invert; @@ -4396,7 +4494,7 @@ save_BindProgramNV(GLenum target, GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_PROGRAM_NV, 2); + n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_NV, 2); if (n) { n[1].e = target; n[2].ui = id; @@ -4413,7 +4511,7 @@ save_ProgramEnvParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4450,7 +4548,7 @@ save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * p = params; for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4498,7 +4596,7 @@ save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); + n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); if (n) { n[1].e = target; n[2].ui = id; @@ -4544,7 +4642,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_PROGRAM_NV, 4); + n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4); if (n) { GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); if (!programCopy) { @@ -4571,7 +4669,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 2); + n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2); if (n) { GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); if (!idCopy) { @@ -4595,7 +4693,7 @@ save_TrackMatrixNV(GLenum target, GLuint address, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 4); + n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4); if (n) { n[1].e = target; n[2].ui = address; @@ -4620,7 +4718,7 @@ save_ProgramLocalParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4642,7 +4740,7 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4670,7 +4768,7 @@ save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * p = params; for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4697,7 +4795,7 @@ save_ProgramLocalParameter4dARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4719,7 +4817,7 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4742,7 +4840,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); if (n) { GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); if (!nameCopy) { @@ -4801,7 +4899,7 @@ save_ActiveStencilFaceEXT(GLenum face) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); + n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); if (n) { n[1].e = face; } @@ -4818,7 +4916,7 @@ save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2); + n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2); if (n) { n[1].f = (GLfloat) zmin; n[2].f = (GLfloat) zmax; @@ -4841,7 +4939,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_STRING_ARB, 4); + n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4); if (n) { GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); if (!programCopy) { @@ -4862,7 +4960,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj static void GLAPIENTRY save_BeginQueryARB(GLenum target, GLuint id) @@ -4870,7 +4968,7 @@ save_BeginQueryARB(GLenum target, GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN_QUERY_ARB, 2); + n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2); if (n) { n[1].e = target; n[2].ui = id; @@ -4887,7 +4985,7 @@ save_EndQueryARB(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_END_QUERY_ARB, 1); + n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1); if (n) { n[1].e = target; } @@ -4896,7 +4994,7 @@ save_EndQueryARB(GLenum target) } } -#endif /* FEATURE_ARB_occlusion_query */ +#endif /* FEATURE_queryobj */ static void GLAPIENTRY @@ -4905,7 +5003,7 @@ save_DrawBuffersARB(GLsizei count, const GLenum * buffers) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS); + n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS); if (n) { GLint i; n[1].i = count; @@ -4926,7 +5024,7 @@ save_TexBumpParameterfvATI(GLenum pname, const GLfloat *param) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5); + n = alloc_instruction(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5); if (n) { n[1].ui = pname; n[2].f = param[0]; @@ -4957,7 +5055,7 @@ save_BindFragmentShaderATI(GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); + n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); if (n) { n[1].ui = id; } @@ -4972,7 +5070,7 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); + n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); if (n) { n[1].ui = dst; n[2].f = value[0]; @@ -4992,7 +5090,7 @@ save_Attr1fNV(GLenum attr, GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_NV, 2); + n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2); if (n) { n[1].e = attr; n[2].f = x; @@ -5013,7 +5111,7 @@ save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_NV, 3); + n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3); if (n) { n[1].e = attr; n[2].f = x; @@ -5035,7 +5133,7 @@ save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_NV, 4); + n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4); if (n) { n[1].e = attr; n[2].f = x; @@ -5058,7 +5156,7 @@ save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_NV, 5); + n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5); if (n) { n[1].e = attr; n[2].f = x; @@ -5083,7 +5181,7 @@ save_Attr1fARB(GLenum attr, GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_ARB, 2); + n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2); if (n) { n[1].e = attr; n[2].f = x; @@ -5104,7 +5202,7 @@ save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_ARB, 3); + n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3); if (n) { n[1].e = attr; n[2].f = x; @@ -5126,7 +5224,7 @@ save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_ARB, 4); + n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4); if (n) { n[1].e = attr; n[2].f = x; @@ -5149,7 +5247,7 @@ save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_ARB, 5); + n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5); if (n) { n[1].e = attr; n[2].f = x; @@ -5174,7 +5272,7 @@ save_EvalCoord1f(GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C1, 1); + n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1); if (n) { n[1].f = x; } @@ -5195,7 +5293,7 @@ save_EvalCoord2f(GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C2, 2); + n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2); if (n) { n[1].f = x; n[2].f = y; @@ -5218,7 +5316,7 @@ save_EvalPoint1(GLint x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P1, 1); + n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1); if (n) { n[1].i = x; } @@ -5233,7 +5331,7 @@ save_EvalPoint2(GLint x, GLint y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P2, 2); + n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2); if (n) { n[1].i = x; n[2].i = y; @@ -5336,7 +5434,7 @@ save_Materialfv(GLenum face, GLenum pname, const GLfloat * param) SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATERIAL, 6); + n = alloc_instruction(ctx, OPCODE_MATERIAL, 6); if (n) { n[1].e = face; n[2].e = pname; @@ -5379,7 +5477,7 @@ save_Begin(GLenum mode) return; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN, 1); + n = alloc_instruction(ctx, OPCODE_BEGIN, 1); if (n) { n[1].e = mode; } @@ -5395,7 +5493,7 @@ save_End(void) { GET_CURRENT_CONTEXT(ctx); SAVE_FLUSH_VERTICES(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END, 0); + (void) alloc_instruction(ctx, OPCODE_END, 0); ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; if (ctx->ExecuteFlag) { CALL_End(ctx->Exec, ()); @@ -5408,7 +5506,7 @@ save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RECTF, 4); + n = alloc_instruction(ctx, OPCODE_RECTF, 4); if (n) { n[1].f = a; n[2].f = b; @@ -5822,7 +5920,7 @@ save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); + n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); if (n) { n[1].i = srcX0; n[2].i = srcY0; @@ -5851,7 +5949,7 @@ save_ProvokingVertexEXT(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROVOKING_VERTEX, 1); + n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1); if (n) { n[1].e = mode; } @@ -5869,7 +5967,7 @@ save_UseProgramObjectARB(GLhandleARB program) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_USE_PROGRAM, 1); + n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1); if (n) { n[1].ui = program; } @@ -5885,7 +5983,7 @@ save_Uniform1fARB(GLint location, GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1F, 2); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2); if (n) { n[1].i = location; n[2].f = x; @@ -5902,7 +6000,7 @@ save_Uniform2fARB(GLint location, GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2F, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3); if (n) { n[1].i = location; n[2].f = x; @@ -5920,7 +6018,7 @@ save_Uniform3fARB(GLint location, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3F, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4); if (n) { n[1].i = location; n[2].f = x; @@ -5939,7 +6037,7 @@ save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4F, 5); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5); if (n) { n[1].i = location; n[2].f = x; @@ -5970,7 +6068,7 @@ save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -5987,7 +6085,7 @@ save_Uniform2fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6004,7 +6102,7 @@ save_Uniform3fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6021,7 +6119,7 @@ save_Uniform4fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6039,7 +6137,7 @@ save_Uniform1iARB(GLint location, GLint x) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1I, 2); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2); if (n) { n[1].i = location; n[2].i = x; @@ -6055,7 +6153,7 @@ save_Uniform2iARB(GLint location, GLint x, GLint y) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2I, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3); if (n) { n[1].i = location; n[2].i = x; @@ -6072,7 +6170,7 @@ save_Uniform3iARB(GLint location, GLint x, GLint y, GLint z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3I, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4); if (n) { n[1].i = location; n[2].i = x; @@ -6090,7 +6188,7 @@ save_Uniform4iARB(GLint location, GLint x, GLint y, GLint z, GLint w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4I, 5); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5); if (n) { n[1].i = location; n[2].i = x; @@ -6111,7 +6209,7 @@ save_Uniform1ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6128,7 +6226,7 @@ save_Uniform2ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6145,7 +6243,7 @@ save_Uniform3ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6162,7 +6260,7 @@ save_Uniform4ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6181,7 +6279,7 @@ save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX22, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6200,7 +6298,7 @@ save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX33, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6219,7 +6317,7 @@ save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX44, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6239,7 +6337,7 @@ save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX23, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6258,7 +6356,7 @@ save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX32, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6278,7 +6376,7 @@ save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX24, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6297,7 +6395,7 @@ save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX42, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6317,7 +6415,7 @@ save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX34, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6336,7 +6434,7 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX43, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6360,7 +6458,7 @@ static void save_error(GLcontext *ctx, GLenum error, const char *s) { Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2); + n = alloc_instruction(ctx, OPCODE_ERROR, 2); if (n) { n[1].e = error; n[2].data = (void *) s; @@ -6436,13 +6534,10 @@ execute_list(GLcontext *ctx, GLuint list) done = GL_FALSE; while (!done) { - OpCode opcode = n[0].opcode; - int i = (int) n[0].opcode - (int) OPCODE_EXT_0; + const OpCode opcode = n[0].opcode; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Execute(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_execute(ctx, n); } else { switch (opcode) { @@ -7161,7 +7256,7 @@ execute_list(GLcontext *ctx, GLuint list) n[6].f)); break; #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj case OPCODE_BEGIN_QUERY_ARB: CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); break; @@ -7432,7 +7527,7 @@ execute_list(GLcontext *ctx, GLuint list) /** * Test if a display list number is valid. */ -GLboolean GLAPIENTRY +static GLboolean GLAPIENTRY _mesa_IsList(GLuint list) { GET_CURRENT_CONTEXT(ctx); @@ -7445,7 +7540,7 @@ _mesa_IsList(GLuint list) /** * Delete a sequence of consecutive display lists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DeleteLists(GLuint list, GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7467,7 +7562,7 @@ _mesa_DeleteLists(GLuint list, GLsizei range) * Return a display list number, n, such that lists n through n+range-1 * are free. */ -GLuint GLAPIENTRY +static GLuint GLAPIENTRY _mesa_GenLists(GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7507,7 +7602,7 @@ _mesa_GenLists(GLsizei range) /** * Begin a new display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); @@ -7557,7 +7652,7 @@ _mesa_NewList(GLuint name, GLenum mode) /** * End definition of current display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndList(void) { GET_CURRENT_CONTEXT(ctx); @@ -7578,7 +7673,7 @@ _mesa_EndList(void) */ ctx->Driver.EndList(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); + (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0); /* Destroy old list, if any */ destroy_list(ctx, ctx->ListState.CurrentList->Name); @@ -7691,7 +7786,7 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) /** * Set the offset added to list numbers in glCallLists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_ListBase(GLuint base) { GET_CURRENT_CONTEXT(ctx); @@ -8426,7 +8521,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode, * struct. */ void -_mesa_init_dlist_table(struct _glapi_table *table) +_mesa_init_save_table(struct _glapi_table *table) { _mesa_loopback_init_api_table(table); @@ -8435,8 +8530,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_AlphaFunc(table, save_AlphaFunc); SET_Bitmap(table, save_Bitmap); SET_BlendFunc(table, save_BlendFunc); - SET_CallList(table, _mesa_save_CallList); - SET_CallLists(table, _mesa_save_CallLists); + SET_CallList(table, save_CallList); + SET_CallLists(table, save_CallLists); SET_Clear(table, save_Clear); SET_ClearAccum(table, save_ClearAccum); SET_ClearColor(table, save_ClearColor); @@ -8457,8 +8552,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_DrawPixels(table, save_DrawPixels); SET_Enable(table, save_Enable); SET_EndList(table, _mesa_EndList); - SET_EvalMesh1(table, _mesa_save_EvalMesh1); - SET_EvalMesh2(table, _mesa_save_EvalMesh2); + SET_EvalMesh1(table, save_EvalMesh1); + SET_EvalMesh2(table, save_EvalMesh2); SET_Finish(table, exec_Finish); SET_Flush(table, exec_Flush); SET_Fogf(table, save_Fogf); @@ -8930,7 +9025,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); SET_GenQueriesARB(table, _mesa_GenQueriesARB); @@ -9036,13 +9131,10 @@ print_list(GLcontext *ctx, GLuint list) done = n ? GL_FALSE : GL_TRUE; while (!done) { - OpCode opcode = n[0].opcode; - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; + const OpCode opcode = n[0].opcode; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Print(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_print(ctx, n); } else { switch (opcode) { @@ -9297,22 +9389,21 @@ mesa_print_display_list(GLuint list) void _mesa_save_vtxfmt_init(GLvertexformat * vfmt) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = save_Begin; - vfmt->CallList = _mesa_save_CallList; - vfmt->CallLists = _mesa_save_CallLists; + + _MESA_INIT_DLIST_VTXFMT(vfmt, save_); + vfmt->Color3f = save_Color3f; vfmt->Color3fv = save_Color3fv; vfmt->Color4f = save_Color4f; vfmt->Color4fv = save_Color4fv; vfmt->EdgeFlag = save_EdgeFlag; vfmt->End = save_End; - vfmt->EvalCoord1f = save_EvalCoord1f; - vfmt->EvalCoord1fv = save_EvalCoord1fv; - vfmt->EvalCoord2f = save_EvalCoord2f; - vfmt->EvalCoord2fv = save_EvalCoord2fv; - vfmt->EvalPoint1 = save_EvalPoint1; - vfmt->EvalPoint2 = save_EvalPoint2; + + _MESA_INIT_EVAL_VTXFMT(vfmt, save_); + vfmt->FogCoordfEXT = save_FogCoordfEXT; vfmt->FogCoordfvEXT = save_FogCoordfvEXT; vfmt->Indexf = save_Indexf; @@ -9361,8 +9452,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB; - vfmt->EvalMesh1 = _mesa_save_EvalMesh1; - vfmt->EvalMesh2 = _mesa_save_EvalMesh2; vfmt->Rectf = save_Rectf; /* The driver is required to implement these as @@ -9376,10 +9465,39 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->DrawElements = 0; vfmt->DrawRangeElements = 0; vfmt->MultiDrawElemementsEXT = 0; + vfmt->DrawElementsBaseVertex = 0; + vfmt->DrawRangeElementsBaseVertex = 0; + vfmt->MultiDrawElemementsBaseVertex = 0; #endif } +void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_CallList(disp, vfmt->CallList); + SET_CallLists(disp, vfmt->CallLists); +} + + +void _mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ + SET_CallList(disp, _mesa_CallList); + SET_CallLists(disp, _mesa_CallLists); + + SET_DeleteLists(disp, _mesa_DeleteLists); + SET_EndList(disp, _mesa_EndList); + SET_GenLists(disp, _mesa_GenLists); + SET_IsList(disp, _mesa_IsList); + SET_ListBase(disp, _mesa_ListBase); + SET_NewList(disp, _mesa_NewList); +} + + +#endif /* FEATURE_dlist */ + + /** * Initialize display list state for given context. */ @@ -9394,6 +9512,9 @@ _mesa_init_display_list(GLcontext *ctx) tableInitialized = GL_TRUE; } + /* extension info */ + ctx->ListExt = CALLOC_STRUCT(gl_list_extensions); + /* Display list */ ctx->ListState.CallDepth = 0; ctx->ExecuteFlag = GL_TRUE; @@ -9404,5 +9525,15 @@ _mesa_init_display_list(GLcontext *ctx) /* Display List group */ ctx->List.ListBase = 0; +#if FEATURE_dlist _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); +#endif +} + + +void +_mesa_free_display_list_data(GLcontext *ctx) +{ + free(ctx->ListExt); + ctx->ListExt = NULL; } diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index ab7ec2c8db..f37a93a7f4 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -33,64 +33,80 @@ #define DLIST_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_dlist -extern void -_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewList = impl ## NewList; \ + (driver)->EndList = impl ## EndList; \ + (driver)->BeginCallList = impl ## BeginCallList; \ + (driver)->EndCallList = impl ## EndCallList; \ + (driver)->SaveFlushVertices = impl ## SaveFlushVertices; \ + (driver)->NotifySaveBegin = impl ## NotifyBegin; \ + } while (0) + +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->CallList = impl ## CallList; \ + (vfmt)->CallLists = impl ## CallLists; \ + } while (0) extern void GLAPIENTRY _mesa_CallList( GLuint list ); extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); -extern void GLAPIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ); -extern void GLAPIENTRY _mesa_EndList( void ); +extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); -extern GLuint GLAPIENTRY _mesa_GenLists( GLsizei range ); +extern void *_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint sz); -extern GLboolean GLAPIENTRY _mesa_IsList( GLuint list ); +extern GLint _mesa_dlist_alloc_opcode( GLcontext *ctx, GLuint sz, + void (*execute)( GLcontext *, void * ), + void (*destroy)( GLcontext *, void * ), + void (*print)( GLcontext *, void * ) ); -extern void GLAPIENTRY _mesa_ListBase( GLuint base ); +extern void _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); -extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode ); +extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); -extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); +extern void _mesa_init_save_table( struct _glapi_table *table ); -extern void GLAPIENTRY _mesa_save_CallList( GLuint list ); +extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); +extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp); +#else /* FEATURE_dlist */ -extern void _mesa_init_dlist_table( struct _glapi_table *table ); +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) do { } while (0) +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0) -extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); +static INLINE void +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) +{ + /* there should be no list to delete */ + ASSERT_NO_FEATURE(); +} +static INLINE void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz); +static INLINE void +_mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ +} -extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, - void (*execute)( GLcontext *, void * ), - void (*destroy)( GLcontext *, void * ), - void (*print)( GLcontext *, void * ) ); +#endif /* FEATURE_dlist */ extern void _mesa_init_display_list( GLcontext * ctx ); -extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); - - -#else - -/** No-op */ -#define _mesa_init_dlist_table(t,ts) ((void)0) - -/** No-op */ -#define _mesa_init_display_list(c) ((void)0) - -/** No-op */ -#define _mesa_save_vtxfmt_init(v) ((void)0) +extern void _mesa_free_display_list_data(GLcontext *ctx); -#endif -#endif +#endif /* DLIST_H */ diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index aef6585641..5d4b53af4c 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -33,8 +33,11 @@ #include "image.h" #include "readpix.h" #include "state.h" +#include "glapi/dispatch.h" +#if FEATURE_drawpix + /** * If a fragment program is enabled, check that it's valid. @@ -47,12 +50,10 @@ valid_fragment_program(GLcontext *ctx) } -#if _HAVE_FULL_GL - /* * Execute glDrawPixels */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { @@ -140,7 +141,7 @@ end: } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLenum type ) { @@ -225,11 +226,8 @@ end: _mesa_set_vp_override(ctx, GL_FALSE); } -#endif /* _HAVE_FULL_GL */ - - -void GLAPIENTRY +static void GLAPIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) @@ -309,3 +307,15 @@ _mesa_Bitmap( GLsizei width, GLsizei height, ctx->Current.RasterPos[0] += xmove; ctx->Current.RasterPos[1] += ymove; } + + +void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ + SET_Bitmap(disp, _mesa_Bitmap); + SET_CopyPixels(disp, _mesa_CopyPixels); + SET_DrawPixels(disp, _mesa_DrawPixels); +} + + +#endif /* FEATURE_drawpix */ diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h index 6177adad6d..8ffb1a6d88 100644 --- a/src/mesa/main/drawpix.h +++ b/src/mesa/main/drawpix.h @@ -22,28 +22,35 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef DRAWPIX_H +#define DRAWPIX_H -#ifndef DRAWPIXELS_H -#define DRAWPIXELS_H +#include "main/mtypes.h" -#include "main/glheader.h" +#if FEATURE_drawpix -extern void GLAPIENTRY -_mesa_DrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) \ + do { \ + (driver)->DrawPixels = impl ## DrawPixels; \ + (driver)->CopyPixels = impl ## CopyPixels; \ + (driver)->Bitmap = impl ## Bitmap; \ + } while (0) +extern void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLenum type ); +#else /* FEATURE_drawpix */ +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_Bitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); +static INLINE void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_drawpix */ -#endif + +#endif /* DRAWPIX_H */ diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 4a00440ab1..4383aed669 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -36,8 +36,8 @@ #include "simple_list.h" #include "mtypes.h" #include "enums.h" -#include "math/m_matrix.h" #include "api_arrayelt.h" +#include "texstate.h" @@ -229,8 +229,7 @@ get_texcoord_unit(GLcontext *ctx) static GLboolean enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit) { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); const GLbitfield newenabled = state ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); @@ -942,6 +941,14 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) ctx->Depth.BoundsTest = state; break; + case GL_DEPTH_CLAMP: + if (ctx->Transform.DepthClamp == state) + return; + CHECK_EXTENSION(ARB_depth_clamp, cap); + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Transform.DepthClamp = state; + break; + #if FEATURE_ATI_fragment_shader case GL_FRAGMENT_SHADER_ATI: CHECK_EXTENSION(ATI_fragment_shader, cap); @@ -1390,6 +1397,11 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(EXT_depth_bounds_test); return ctx->Depth.BoundsTest; + /* GL_ARB_depth_clamp */ + case GL_DEPTH_CLAMP: + CHECK_EXTENSION(ARB_depth_clamp); + return ctx->Transform.DepthClamp; + #if FEATURE_ATI_fragment_shader case GL_FRAGMENT_SHADER_ATI: CHECK_EXTENSION(ATI_fragment_shader); diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 9f650dadd3..606d50c59a 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -391,6 +391,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DEPTH_BOUNDS_EXT\0" "GL_DEPTH_BOUNDS_TEST_EXT\0" "GL_DEPTH_BUFFER_BIT\0" + "GL_DEPTH_CLAMP\0" "GL_DEPTH_CLAMP_NV\0" "GL_DEPTH_CLEAR_VALUE\0" "GL_DEPTH_COMPONENT\0" @@ -518,6 +519,7 @@ LONGSTRING static const char enum_string_table[] = "GL_FEEDBACK_BUFFER_SIZE\0" "GL_FEEDBACK_BUFFER_TYPE\0" "GL_FILL\0" + "GL_FIRST_VERTEX_CONVENTION\0" "GL_FIRST_VERTEX_CONVENTION_EXT\0" "GL_FLAT\0" "GL_FLOAT\0" @@ -701,6 +703,7 @@ LONGSTRING static const char enum_string_table[] = "GL_INVERSE_TRANSPOSE_NV\0" "GL_INVERT\0" "GL_KEEP\0" + "GL_LAST_VERTEX_CONVENTION\0" "GL_LAST_VERTEX_CONVENTION_EXT\0" "GL_LEFT\0" "GL_LEQUAL\0" @@ -1287,6 +1290,7 @@ LONGSTRING static const char enum_string_table[] = "GL_PROJECTION\0" "GL_PROJECTION_MATRIX\0" "GL_PROJECTION_STACK_DEPTH\0" + "GL_PROVOKING_VERTEX\0" "GL_PROVOKING_VERTEX_EXT\0" "GL_PROXY_COLOR_TABLE\0" "GL_PROXY_HISTOGRAM\0" @@ -1308,6 +1312,7 @@ LONGSTRING static const char enum_string_table[] = "GL_Q\0" "GL_QUADRATIC_ATTENUATION\0" "GL_QUADS\0" + "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION\0" "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT\0" "GL_QUAD_MESH_SUN\0" "GL_QUAD_STRIP\0" @@ -1895,7 +1900,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1857] = +static const enum_elt all_enums[1862] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2252,1588 +2257,1593 @@ static const enum_elt all_enums[1857] = { 7262, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ { 7282, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ { 7307, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 7327, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 7345, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 7366, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 7385, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 7406, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 7431, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 7457, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 7478, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 7503, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 7529, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 7550, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 7575, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 7601, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 7615, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 7630, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 7645, 0x000084F9 }, /* GL_DEPTH_STENCIL */ - { 7662, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ - { 7690, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 7710, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 7738, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 7766, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 7780, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 7802, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 7828, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 7847, 0x00001201 }, /* GL_DIFFUSE */ - { 7858, 0x00000BD0 }, /* GL_DITHER */ - { 7868, 0x00000A02 }, /* GL_DOMAIN */ - { 7878, 0x00001100 }, /* GL_DONT_CARE */ - { 7891, 0x000086AE }, /* GL_DOT3_RGB */ - { 7903, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7916, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7933, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7950, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7966, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7982, 0x0000140A }, /* GL_DOUBLE */ - { 7992, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 8008, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 8023, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 8039, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 8059, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 8079, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 8095, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 8112, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 8133, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 8154, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 8171, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 8192, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 8213, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 8230, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 8251, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 8272, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 8289, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 8310, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 8331, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 8348, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 8369, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 8390, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 8407, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 8428, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 8449, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 8469, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 8489, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 8505, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 8525, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 8545, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 8561, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 8581, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 8601, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 8617, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 8637, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 8657, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 8673, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 8693, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 8713, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 8729, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 8749, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 8769, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 8785, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 8805, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 8825, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 8841, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 8861, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8881, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8897, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8917, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8937, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ - { 8957, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8989, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 9013, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 9033, 0x00000304 }, /* GL_DST_ALPHA */ - { 9046, 0x00000306 }, /* GL_DST_COLOR */ - { 9059, 0x0000877A }, /* GL_DU8DV8_ATI */ - { 9073, 0x00008779 }, /* GL_DUDV_ATI */ - { 9085, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 9101, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 9121, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 9137, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 9157, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 9173, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 9193, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 9206, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 9225, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 9259, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 9297, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 9324, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 9350, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 9374, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 9406, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 9442, 0x00001600 }, /* GL_EMISSION */ - { 9454, 0x00002000 }, /* GL_ENABLE_BIT */ - { 9468, 0x00000202 }, /* GL_EQUAL */ - { 9477, 0x00001509 }, /* GL_EQUIV */ - { 9486, 0x00010000 }, /* GL_EVAL_BIT */ - { 9498, 0x00000800 }, /* GL_EXP */ - { 9505, 0x00000801 }, /* GL_EXP2 */ - { 9513, 0x00001F03 }, /* GL_EXTENSIONS */ - { 9527, 0x00002400 }, /* GL_EYE_LINEAR */ - { 9541, 0x00002502 }, /* GL_EYE_PLANE */ - { 9554, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 9579, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 9596, 0x00000000 }, /* GL_FALSE */ - { 9605, 0x00001101 }, /* GL_FASTEST */ - { 9616, 0x00001C01 }, /* GL_FEEDBACK */ - { 9628, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 9655, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 9679, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 9703, 0x00001B02 }, /* GL_FILL */ - { 9711, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - { 9742, 0x00001D00 }, /* GL_FLAT */ - { 9750, 0x00001406 }, /* GL_FLOAT */ - { 9759, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 9773, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 9791, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ - { 9807, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ - { 9823, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 9837, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 9855, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ - { 9871, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ - { 9887, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 9901, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 9919, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ - { 9935, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ - { 9951, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 9965, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 9983, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 9997, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 10015, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 10029, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 10047, 0x00000B60 }, /* GL_FOG */ - { 10054, 0x00000080 }, /* GL_FOG_BIT */ - { 10065, 0x00000B66 }, /* GL_FOG_COLOR */ - { 10078, 0x00008451 }, /* GL_FOG_COORD */ - { 10091, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 10109, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 10133, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 10172, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 10215, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 10247, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 10278, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 10307, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 10332, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 10351, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 10385, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 10412, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 10438, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 10462, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 10479, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 10494, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 10518, 0x00000B64 }, /* GL_FOG_END */ - { 10529, 0x00000C54 }, /* GL_FOG_HINT */ - { 10541, 0x00000B61 }, /* GL_FOG_INDEX */ - { 10554, 0x00000B65 }, /* GL_FOG_MODE */ - { 10566, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 10585, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 10610, 0x00000B63 }, /* GL_FOG_START */ - { 10623, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 10641, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 10665, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 10684, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 10707, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 10742, 0x00008D40 }, /* GL_FRAMEBUFFER */ - { 10757, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - { 10794, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - { 10830, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - { 10871, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - { 10912, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - { 10949, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - { 10986, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - { 11024, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 11066, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - { 11104, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 11146, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - { 11181, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - { 11220, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 11269, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - { 11317, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 11369, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - { 11409, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 11453, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - { 11493, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 11537, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 11564, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ - { 11588, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 11616, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ - { 11639, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 11658, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - { 11695, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 11736, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 11777, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 11819, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 11870, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 11908, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - { 11953, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 12002, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - { 12040, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 12082, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 12114, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ - { 12139, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ - { 12166, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 12197, 0x00000404 }, /* GL_FRONT */ - { 12206, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 12224, 0x00000B46 }, /* GL_FRONT_FACE */ - { 12238, 0x00000400 }, /* GL_FRONT_LEFT */ - { 12252, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 12267, 0x00008006 }, /* GL_FUNC_ADD */ - { 12279, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 12295, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 12320, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 12349, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 12366, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 12387, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 12406, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 12430, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 12459, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 12483, 0x00000206 }, /* GL_GEQUAL */ - { 12493, 0x00000204 }, /* GL_GREATER */ - { 12504, 0x00001904 }, /* GL_GREEN */ - { 12513, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 12527, 0x00000D53 }, /* GL_GREEN_BITS */ - { 12541, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12556, 0x00008000 }, /* GL_HINT_BIT */ - { 12568, 0x00008024 }, /* GL_HISTOGRAM */ - { 12581, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12605, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12633, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12656, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12683, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12700, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12720, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 12744, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 12768, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 12796, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 12824, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 12856, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 12878, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 12904, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 12922, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 12944, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 12963, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 12986, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13001, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13021, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13061, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13099, 0x00001E02 }, /* GL_INCR */ - { 13107, 0x00008507 }, /* GL_INCR_WRAP */ - { 13120, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13137, 0x00008222 }, /* GL_INDEX */ - { 13146, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13161, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13191, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13225, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13248, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13270, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13290, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13304, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13325, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13343, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13357, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13373, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13388, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13407, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13426, 0x00001404 }, /* GL_INT */ - { 13433, 0x00008049 }, /* GL_INTENSITY */ - { 13446, 0x0000804C }, /* GL_INTENSITY12 */ - { 13461, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13480, 0x0000804D }, /* GL_INTENSITY16 */ - { 13495, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13514, 0x0000804A }, /* GL_INTENSITY4 */ - { 13528, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13546, 0x0000804B }, /* GL_INTENSITY8 */ - { 13560, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13578, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13595, 0x00008575 }, /* GL_INTERPOLATE */ - { 13610, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13629, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13648, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13660, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13676, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13688, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13704, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13716, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 13732, 0x00000500 }, /* GL_INVALID_ENUM */ - { 13748, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 13781, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 13818, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 13839, 0x00000501 }, /* GL_INVALID_VALUE */ - { 13856, 0x0000862B }, /* GL_INVERSE_NV */ - { 13870, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 13894, 0x0000150A }, /* GL_INVERT */ - { 13904, 0x00001E00 }, /* GL_KEEP */ - { 13912, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ - { 13942, 0x00000406 }, /* GL_LEFT */ - { 13950, 0x00000203 }, /* GL_LEQUAL */ - { 13960, 0x00000201 }, /* GL_LESS */ - { 13968, 0x00004000 }, /* GL_LIGHT0 */ - { 13978, 0x00004001 }, /* GL_LIGHT1 */ - { 13988, 0x00004002 }, /* GL_LIGHT2 */ - { 13998, 0x00004003 }, /* GL_LIGHT3 */ - { 14008, 0x00004004 }, /* GL_LIGHT4 */ - { 14018, 0x00004005 }, /* GL_LIGHT5 */ - { 14028, 0x00004006 }, /* GL_LIGHT6 */ - { 14038, 0x00004007 }, /* GL_LIGHT7 */ - { 14048, 0x00000B50 }, /* GL_LIGHTING */ - { 14060, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14076, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14099, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14128, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14161, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14189, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14213, 0x00001B01 }, /* GL_LINE */ - { 14221, 0x00002601 }, /* GL_LINEAR */ - { 14231, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14253, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14283, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14314, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14338, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14363, 0x00000001 }, /* GL_LINES */ - { 14372, 0x00000004 }, /* GL_LINE_BIT */ - { 14384, 0x00000002 }, /* GL_LINE_LOOP */ - { 14397, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14417, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14432, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14452, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14468, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14492, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14515, 0x00000003 }, /* GL_LINE_STRIP */ - { 14529, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14543, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14557, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14583, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14603, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14618, 0x00000B32 }, /* GL_LIST_BASE */ - { 14631, 0x00020000 }, /* GL_LIST_BIT */ - { 14643, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14657, 0x00000B30 }, /* GL_LIST_MODE */ - { 14670, 0x00000101 }, /* GL_LOAD */ - { 14678, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14690, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 14707, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 14721, 0x00001909 }, /* GL_LUMINANCE */ - { 14734, 0x00008041 }, /* GL_LUMINANCE12 */ - { 14749, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 14772, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 14799, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 14821, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 14847, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 14866, 0x00008042 }, /* GL_LUMINANCE16 */ - { 14881, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 14904, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 14931, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 14950, 0x0000803F }, /* GL_LUMINANCE4 */ - { 14964, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 14985, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15010, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15028, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15049, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15074, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15088, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15109, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15134, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15152, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15171, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15187, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15207, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15229, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15243, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15258, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15282, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15306, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15330, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15354, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15371, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15388, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15416, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15445, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15474, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15503, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15532, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15561, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15590, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15618, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15646, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15674, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15702, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 15730, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 15758, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 15786, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 15814, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 15842, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 15858, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 15878, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 15900, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 15914, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 15929, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 15953, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 15977, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16001, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16025, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16042, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16059, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16087, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16116, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16145, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16174, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16203, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16232, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16261, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16289, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16317, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16345, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16373, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16401, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16429, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16457, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16485, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16513, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16526, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ - { 16552, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ - { 16581, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ - { 16609, 0x00000001 }, /* GL_MAP_READ_BIT */ - { 16625, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16640, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ - { 16666, 0x00000002 }, /* GL_MAP_WRITE_BIT */ - { 16683, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16698, 0x00008630 }, /* GL_MATRIX0_NV */ - { 16712, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 16728, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 16744, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 16760, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 16776, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 16792, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 16808, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 16824, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 16840, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 16856, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 16872, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 16887, 0x00008631 }, /* GL_MATRIX1_NV */ - { 16901, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 16917, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 16933, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 16949, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 16965, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 16981, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 16997, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 17013, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 17029, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 17045, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17061, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17076, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17090, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17106, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17122, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17137, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17151, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17166, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17180, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17195, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17209, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17224, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17238, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17253, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17267, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17282, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17297, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17323, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17357, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17388, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17421, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17452, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17467, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17489, 0x00008008 }, /* GL_MAX */ - { 17496, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17519, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17551, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17577, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17610, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17636, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17670, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17689, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 17718, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 17750, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 17786, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 17822, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 17862, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 17888, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 17918, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 17943, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 17972, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 18001, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 18034, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 18054, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18078, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18102, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18126, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18151, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18169, 0x00008008 }, /* GL_MAX_EXT */ - { 18180, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18215, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18254, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18268, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18288, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18326, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18355, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18379, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18407, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18430, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18467, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18503, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18530, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18559, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18593, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18629, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18656, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 18688, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 18724, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 18753, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 18782, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 18810, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 18848, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 18892, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 18935, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 18969, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 19008, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 19045, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19083, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19126, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19169, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19199, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19230, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19266, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19302, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19332, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19366, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19399, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19428, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19443, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - { 19470, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19490, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19514, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19536, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19562, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19589, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19620, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 19644, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 19678, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 19698, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 19725, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 19746, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 19771, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 19796, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 19831, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 19853, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19879, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 19901, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 19927, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 19961, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 19999, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 20032, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 20069, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20093, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20114, 0x00008007 }, /* GL_MIN */ - { 20121, 0x0000802E }, /* GL_MINMAX */ - { 20131, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20145, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20162, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20183, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20198, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20217, 0x00008007 }, /* GL_MIN_EXT */ - { 20228, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20247, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20270, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20293, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20313, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20333, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20363, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20391, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20419, 0x00001700 }, /* GL_MODELVIEW */ - { 20432, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20450, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20469, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20488, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20507, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20526, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20545, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20564, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20583, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20602, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20621, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 20640, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 20658, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 20677, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 20696, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 20715, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 20734, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 20753, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 20772, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 20791, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 20810, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 20829, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 20848, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 20866, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 20885, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 20904, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 20922, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 20940, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 20958, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 20976, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 20994, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 21012, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 21030, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 21050, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 21077, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21102, 0x00002100 }, /* GL_MODULATE */ - { 21114, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21134, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21161, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21186, 0x00000103 }, /* GL_MULT */ - { 21194, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21209, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21229, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21248, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21267, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21291, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21314, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21344, 0x00002A25 }, /* GL_N3F_V3F */ - { 21355, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21375, 0x0000150E }, /* GL_NAND */ - { 21383, 0x00002600 }, /* GL_NEAREST */ - { 21394, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21425, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21457, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21482, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21508, 0x00000200 }, /* GL_NEVER */ - { 21517, 0x00001102 }, /* GL_NICEST */ - { 21527, 0x00000000 }, /* GL_NONE */ - { 21535, 0x00001505 }, /* GL_NOOP */ - { 21543, 0x00001508 }, /* GL_NOR */ - { 21550, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21563, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21579, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21610, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 21645, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 21669, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 21692, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 21713, 0x00008511 }, /* GL_NORMAL_MAP */ - { 21727, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 21745, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 21762, 0x00000205 }, /* GL_NOTEQUAL */ - { 21774, 0x00000000 }, /* GL_NO_ERROR */ - { 21786, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 21820, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 21858, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 21890, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 21932, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 21962, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 22002, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 22033, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 22062, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22090, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22120, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22137, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22163, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22179, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22214, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22236, 0x00009112 }, /* GL_OBJECT_TYPE */ - { 22251, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22270, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22300, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22321, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22349, 0x00000001 }, /* GL_ONE */ - { 22356, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22384, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22416, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22444, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22476, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22499, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22522, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22545, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22568, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22586, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22608, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22630, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 22646, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 22666, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 22686, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 22704, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 22726, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 22748, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 22764, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 22784, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 22804, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 22822, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 22844, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 22866, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 22882, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 22902, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 22922, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 22943, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 22962, 0x00001507 }, /* GL_OR */ - { 22968, 0x00000A01 }, /* GL_ORDER */ - { 22977, 0x0000150D }, /* GL_OR_INVERTED */ - { 22992, 0x0000150B }, /* GL_OR_REVERSE */ - { 23006, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 23023, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 23041, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 23062, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 23082, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23100, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23119, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23139, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23159, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23177, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23196, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23221, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23245, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23266, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23288, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23310, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23335, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23359, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23380, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23402, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23424, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23446, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23477, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23497, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23522, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23542, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23567, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23587, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23612, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23632, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 23657, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 23677, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 23702, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 23722, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 23747, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 23767, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 23792, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 23812, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 23837, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 23857, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 23882, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 23902, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 23927, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 23945, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ - { 23966, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ - { 23995, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 24028, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 24053, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ - { 24076, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 24107, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 24142, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 24169, 0x00001B00 }, /* GL_POINT */ - { 24178, 0x00000000 }, /* GL_POINTS */ - { 24188, 0x00000002 }, /* GL_POINT_BIT */ - { 24201, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24231, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24265, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24299, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24334, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24363, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24396, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24429, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24463, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24477, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24503, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24521, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24543, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24565, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24588, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24606, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24628, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 24650, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 24673, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 24693, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 24709, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 24730, 0x00008861 }, /* GL_POINT_SPRITE */ - { 24746, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 24766, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 24795, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 24814, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 24840, 0x00000701 }, /* GL_POINT_TOKEN */ - { 24855, 0x00000009 }, /* GL_POLYGON */ - { 24866, 0x00000008 }, /* GL_POLYGON_BIT */ - { 24881, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 24897, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 24920, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 24945, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 24968, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 24991, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 25015, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 25039, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 25057, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 25080, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 25099, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 25122, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 25139, 0x00001203 }, /* GL_POSITION */ - { 25151, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 25183, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25219, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25252, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25289, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25320, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25355, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25387, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25423, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25456, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25488, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25524, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25557, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25594, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25624, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 25658, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 25689, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 25724, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 25755, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 25790, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 25822, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 25858, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 25888, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 25922, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 25953, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 25988, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 26020, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 26051, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 26086, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 26118, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 26154, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 26183, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26216, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26246, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26280, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26319, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26352, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26392, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26426, 0x00008578 }, /* GL_PREVIOUS */ - { 26438, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26454, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26470, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26487, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26508, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26529, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26562, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26594, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26617, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 26640, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 26670, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 26699, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 26727, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 26749, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 26777, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 26805, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 26827, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 26848, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 26888, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 26927, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 26957, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 26992, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 27025, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 27059, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 27098, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 27137, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 27159, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 27185, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27209, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27232, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27254, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27275, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27296, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27323, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27355, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27387, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27422, 0x00001701 }, /* GL_PROJECTION */ - { 27436, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27457, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27483, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ - { 27507, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27528, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27547, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27570, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27609, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 27647, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 27667, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 27697, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 27721, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 27741, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 27771, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 27795, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 27815, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 27848, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 27874, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 27904, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 27935, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 27965, 0x00002003 }, /* GL_Q */ - { 27970, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 27995, 0x00000007 }, /* GL_QUADS */ - { 28004, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - { 28052, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 28069, 0x00000008 }, /* GL_QUAD_STRIP */ - { 28083, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 28105, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 28131, 0x00008866 }, /* GL_QUERY_RESULT */ - { 28147, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 28167, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 28193, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 28223, 0x00002002 }, /* GL_R */ - { 28228, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 28240, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 28273, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28288, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28308, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28340, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28364, 0x000088B8 }, /* GL_READ_ONLY */ - { 28377, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28394, 0x000088BA }, /* GL_READ_WRITE */ - { 28408, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28426, 0x00001903 }, /* GL_RED */ - { 28433, 0x00008016 }, /* GL_REDUCE */ - { 28443, 0x00008016 }, /* GL_REDUCE_EXT */ - { 28457, 0x00000D15 }, /* GL_RED_BIAS */ - { 28469, 0x00000D52 }, /* GL_RED_BITS */ - { 28481, 0x00000D14 }, /* GL_RED_SCALE */ - { 28494, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 28512, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 28534, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 28555, 0x00001C00 }, /* GL_RENDER */ - { 28565, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 28581, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 28608, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 28636, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 28662, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 28689, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 28709, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 28736, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 28759, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 28786, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 28818, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 28854, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 28879, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 28903, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 28932, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 28954, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 28980, 0x00001F01 }, /* GL_RENDERER */ - { 28992, 0x00000C40 }, /* GL_RENDER_MODE */ - { 29007, 0x00002901 }, /* GL_REPEAT */ - { 29017, 0x00001E01 }, /* GL_REPLACE */ - { 29028, 0x00008062 }, /* GL_REPLACE_EXT */ - { 29043, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 29066, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 29084, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 29106, 0x00000102 }, /* GL_RETURN */ - { 29116, 0x00001907 }, /* GL_RGB */ - { 29123, 0x00008052 }, /* GL_RGB10 */ - { 29132, 0x00008059 }, /* GL_RGB10_A2 */ - { 29144, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 29160, 0x00008052 }, /* GL_RGB10_EXT */ - { 29173, 0x00008053 }, /* GL_RGB12 */ - { 29182, 0x00008053 }, /* GL_RGB12_EXT */ - { 29195, 0x00008054 }, /* GL_RGB16 */ - { 29204, 0x00008054 }, /* GL_RGB16_EXT */ - { 29217, 0x0000804E }, /* GL_RGB2_EXT */ - { 29229, 0x0000804F }, /* GL_RGB4 */ - { 29237, 0x0000804F }, /* GL_RGB4_EXT */ - { 29249, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 29262, 0x00008050 }, /* GL_RGB5 */ - { 29270, 0x00008057 }, /* GL_RGB5_A1 */ - { 29281, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29296, 0x00008050 }, /* GL_RGB5_EXT */ - { 29308, 0x00008051 }, /* GL_RGB8 */ - { 29316, 0x00008051 }, /* GL_RGB8_EXT */ - { 29328, 0x00001908 }, /* GL_RGBA */ - { 29336, 0x0000805A }, /* GL_RGBA12 */ - { 29346, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29360, 0x0000805B }, /* GL_RGBA16 */ - { 29370, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29384, 0x00008055 }, /* GL_RGBA2 */ - { 29393, 0x00008055 }, /* GL_RGBA2_EXT */ - { 29406, 0x00008056 }, /* GL_RGBA4 */ - { 29415, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 29434, 0x00008056 }, /* GL_RGBA4_EXT */ - { 29447, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 29461, 0x00008058 }, /* GL_RGBA8 */ - { 29470, 0x00008058 }, /* GL_RGBA8_EXT */ - { 29483, 0x00008F97 }, /* GL_RGBA8_SNORM */ - { 29498, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 29516, 0x00000C31 }, /* GL_RGBA_MODE */ - { 29529, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 29542, 0x00008F93 }, /* GL_RGBA_SNORM */ - { 29556, 0x000083A0 }, /* GL_RGB_S3TC */ - { 29568, 0x00008573 }, /* GL_RGB_SCALE */ - { 29581, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 29598, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 29615, 0x00000407 }, /* GL_RIGHT */ - { 29624, 0x00002000 }, /* GL_S */ - { 29629, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 29643, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 29664, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 29678, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 29699, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 29713, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 29729, 0x000080A9 }, /* GL_SAMPLES */ - { 29740, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 29756, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 29771, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 29789, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 29811, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 29839, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 29871, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 29894, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 29921, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 29939, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 29962, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 29984, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 30003, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 30026, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 30052, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 30082, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 30107, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 30136, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 30151, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 30166, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 30182, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 30207, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 30247, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 30291, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30324, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30354, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30386, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 30416, 0x00001C02 }, /* GL_SELECT */ - { 30426, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 30454, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 30479, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 30495, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 30522, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 30553, 0x0000150F }, /* GL_SET */ - { 30560, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 30581, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 30605, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 30620, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 30635, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 30663, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 30686, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 30716, 0x00001601 }, /* GL_SHININESS */ - { 30729, 0x00001402 }, /* GL_SHORT */ - { 30738, 0x00009119 }, /* GL_SIGNALED */ - { 30750, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ - { 30771, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 30787, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 30807, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 30826, 0x00008C46 }, /* GL_SLUMINANCE */ - { 30840, 0x00008C47 }, /* GL_SLUMINANCE8 */ - { 30855, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ - { 30877, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ - { 30897, 0x00001D01 }, /* GL_SMOOTH */ - { 30907, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 30940, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 30967, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 31000, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 31027, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 31044, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 31065, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 31086, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 31101, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 31120, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 31139, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 31156, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 31177, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 31198, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 31213, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 31232, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 31251, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 31268, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 31289, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 31310, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 31325, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 31344, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 31363, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 31383, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 31401, 0x00001202 }, /* GL_SPECULAR */ - { 31413, 0x00002402 }, /* GL_SPHERE_MAP */ - { 31427, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 31442, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 31460, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 31477, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 31491, 0x00008580 }, /* GL_SRC0_RGB */ - { 31503, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 31517, 0x00008581 }, /* GL_SRC1_RGB */ - { 31529, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 31543, 0x00008582 }, /* GL_SRC2_RGB */ - { 31555, 0x00000302 }, /* GL_SRC_ALPHA */ - { 31568, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 31590, 0x00000300 }, /* GL_SRC_COLOR */ - { 31603, 0x00008C40 }, /* GL_SRGB */ - { 31611, 0x00008C41 }, /* GL_SRGB8 */ - { 31620, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ - { 31636, 0x00008C42 }, /* GL_SRGB_ALPHA */ - { 31650, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 31668, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 31687, 0x000088E6 }, /* GL_STATIC_COPY */ - { 31702, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 31721, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 31736, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 31755, 0x000088E5 }, /* GL_STATIC_READ */ - { 31770, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 31789, 0x00001802 }, /* GL_STENCIL */ - { 31800, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 31822, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 31848, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 31869, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 31894, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 31915, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 31940, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 31972, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 32008, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 32040, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 32076, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 32096, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 32123, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 32149, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 32165, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 32187, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 32210, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 32226, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 32242, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 32259, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 32282, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 32304, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 32326, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 32348, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 32369, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 32396, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 32423, 0x00000B97 }, /* GL_STENCIL_REF */ - { 32438, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 32454, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 32483, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 32505, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 32526, 0x00000C33 }, /* GL_STEREO */ - { 32536, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ - { 32560, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ - { 32585, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ - { 32609, 0x000088E2 }, /* GL_STREAM_COPY */ - { 32624, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 32643, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 32658, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 32677, 0x000088E1 }, /* GL_STREAM_READ */ - { 32692, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 32711, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 32728, 0x000084E7 }, /* GL_SUBTRACT */ - { 32740, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 32756, 0x00009113 }, /* GL_SYNC_CONDITION */ - { 32774, 0x00009116 }, /* GL_SYNC_FENCE */ - { 32788, 0x00009115 }, /* GL_SYNC_FLAGS */ - { 32802, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ - { 32829, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - { 32859, 0x00009114 }, /* GL_SYNC_STATUS */ - { 32874, 0x00002001 }, /* GL_T */ - { 32879, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 32894, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 32913, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 32929, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 32944, 0x00002A27 }, /* GL_T2F_V3F */ - { 32955, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 32974, 0x00002A28 }, /* GL_T4F_V4F */ - { 32985, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 33008, 0x00001702 }, /* GL_TEXTURE */ - { 33019, 0x000084C0 }, /* GL_TEXTURE0 */ - { 33031, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 33047, 0x000084C1 }, /* GL_TEXTURE1 */ - { 33059, 0x000084CA }, /* GL_TEXTURE10 */ - { 33072, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 33089, 0x000084CB }, /* GL_TEXTURE11 */ - { 33102, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 33119, 0x000084CC }, /* GL_TEXTURE12 */ - { 33132, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 33149, 0x000084CD }, /* GL_TEXTURE13 */ - { 33162, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 33179, 0x000084CE }, /* GL_TEXTURE14 */ - { 33192, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 33209, 0x000084CF }, /* GL_TEXTURE15 */ - { 33222, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 33239, 0x000084D0 }, /* GL_TEXTURE16 */ - { 33252, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 33269, 0x000084D1 }, /* GL_TEXTURE17 */ - { 33282, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 33299, 0x000084D2 }, /* GL_TEXTURE18 */ - { 33312, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 33329, 0x000084D3 }, /* GL_TEXTURE19 */ - { 33342, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 33359, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 33375, 0x000084C2 }, /* GL_TEXTURE2 */ - { 33387, 0x000084D4 }, /* GL_TEXTURE20 */ - { 33400, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 33417, 0x000084D5 }, /* GL_TEXTURE21 */ - { 33430, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 33447, 0x000084D6 }, /* GL_TEXTURE22 */ - { 33460, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 33477, 0x000084D7 }, /* GL_TEXTURE23 */ - { 33490, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 33507, 0x000084D8 }, /* GL_TEXTURE24 */ - { 33520, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 33537, 0x000084D9 }, /* GL_TEXTURE25 */ - { 33550, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 33567, 0x000084DA }, /* GL_TEXTURE26 */ - { 33580, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 33597, 0x000084DB }, /* GL_TEXTURE27 */ - { 33610, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 33627, 0x000084DC }, /* GL_TEXTURE28 */ - { 33640, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 33657, 0x000084DD }, /* GL_TEXTURE29 */ - { 33670, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 33687, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 33703, 0x000084C3 }, /* GL_TEXTURE3 */ - { 33715, 0x000084DE }, /* GL_TEXTURE30 */ - { 33728, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 33745, 0x000084DF }, /* GL_TEXTURE31 */ - { 33758, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 33775, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 33791, 0x000084C4 }, /* GL_TEXTURE4 */ - { 33803, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 33819, 0x000084C5 }, /* GL_TEXTURE5 */ - { 33831, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 33847, 0x000084C6 }, /* GL_TEXTURE6 */ - { 33859, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 33875, 0x000084C7 }, /* GL_TEXTURE7 */ - { 33887, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 33903, 0x000084C8 }, /* GL_TEXTURE8 */ - { 33915, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 33931, 0x000084C9 }, /* GL_TEXTURE9 */ - { 33943, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 33959, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 33973, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 33997, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 34011, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 34035, 0x0000806F }, /* GL_TEXTURE_3D */ - { 34049, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 34071, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 34097, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 34119, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 34141, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 34173, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 34195, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 34227, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 34249, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 34277, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 34309, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 34342, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 34374, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 34389, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 34410, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 34435, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 34453, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 34477, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 34508, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 34538, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 34568, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 34603, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 34634, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 34672, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 34699, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 34731, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 34765, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 34789, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 34817, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 34841, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 34869, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 34902, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 34926, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 34948, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 34970, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 34996, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 35030, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 35063, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 35100, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 35128, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 35160, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 35183, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 35221, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 35263, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 35294, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 35322, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 35352, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 35380, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 35400, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 35424, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 35455, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 35490, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 35521, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 35556, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 35587, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 35622, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 35653, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 35688, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 35719, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 35754, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 35785, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 35820, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - { 35849, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 35866, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 35888, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 35914, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 35929, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 35950, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 35970, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 35996, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 36016, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 36033, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 36050, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 36067, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 36084, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 36109, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 36131, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 36157, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 36175, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 36201, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 36227, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 36257, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 36284, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 36309, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 36329, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 36353, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 36380, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 36407, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 36434, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 36460, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 36490, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 36512, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 36530, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 36560, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 36588, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 36616, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 36644, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 36665, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 36684, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 36706, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 36725, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 36745, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - { 36775, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - { 36806, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 36831, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 36855, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 36875, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 36899, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 36919, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 36942, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 36966, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - { 36996, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 37021, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 37055, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 37072, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 37090, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 37108, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 37126, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ - { 37145, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ - { 37164, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 37184, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 37203, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 37232, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 37249, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 37275, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 37305, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 37337, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 37367, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 37401, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 37417, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 37448, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 37483, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 37511, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 37543, 0x00000004 }, /* GL_TRIANGLES */ - { 37556, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 37572, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 37593, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 37611, 0x00000001 }, /* GL_TRUE */ - { 37619, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 37639, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 37662, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 37682, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 37703, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 37725, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 37747, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 37767, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 37788, 0x00009118 }, /* GL_UNSIGNALED */ - { 37802, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 37819, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 37846, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 37869, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 37885, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 37912, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 37933, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 37957, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 37988, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 38012, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 38040, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 38063, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 38081, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 38111, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 38137, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 38167, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 38193, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 38217, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 38245, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 38273, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 38300, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 38332, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 38363, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 38377, 0x00002A20 }, /* GL_V2F */ - { 38384, 0x00002A21 }, /* GL_V3F */ - { 38391, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 38410, 0x00001F00 }, /* GL_VENDOR */ - { 38420, 0x00001F02 }, /* GL_VERSION */ - { 38431, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 38447, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ - { 38471, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 38501, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 38532, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 38567, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 38591, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 38612, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 38635, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 38656, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 38683, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 38711, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 38739, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 38767, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 38795, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 38823, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 38851, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 38878, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 38905, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 38932, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 38959, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 38986, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 39013, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 39040, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 39067, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 39094, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 39132, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 39174, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 39205, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 39240, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 39274, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 39312, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 39343, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 39378, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 39406, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 39438, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 39468, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 39502, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 39530, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 39562, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 39582, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 39604, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 39633, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 39654, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 39683, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 39716, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 39748, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 39775, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 39806, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 39836, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 39853, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 39874, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 39901, 0x00000BA2 }, /* GL_VIEWPORT */ - { 39913, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 39929, 0x0000911D }, /* GL_WAIT_FAILED */ - { 39944, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 39964, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 39995, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 40030, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 40058, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 40083, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 40110, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 40135, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 40159, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 40178, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 40192, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 40210, 0x00001506 }, /* GL_XOR */ - { 40217, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 40236, 0x00008757 }, /* GL_YCBCR_MESA */ - { 40250, 0x00000000 }, /* GL_ZERO */ - { 40258, 0x00000D16 }, /* GL_ZOOM_X */ - { 40268, 0x00000D17 }, /* GL_ZOOM_Y */ + { 7327, 0x0000864F }, /* GL_DEPTH_CLAMP */ + { 7342, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 7360, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 7381, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 7400, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 7421, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 7446, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7472, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7493, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7518, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7544, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7565, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7590, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7616, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7630, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7645, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7660, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7677, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7705, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7725, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7753, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7781, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7795, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7817, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7843, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7862, 0x00001201 }, /* GL_DIFFUSE */ + { 7873, 0x00000BD0 }, /* GL_DITHER */ + { 7883, 0x00000A02 }, /* GL_DOMAIN */ + { 7893, 0x00001100 }, /* GL_DONT_CARE */ + { 7906, 0x000086AE }, /* GL_DOT3_RGB */ + { 7918, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7931, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7948, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 7965, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 7981, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 7997, 0x0000140A }, /* GL_DOUBLE */ + { 8007, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 8023, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 8038, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 8054, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 8074, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 8094, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 8110, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 8127, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 8148, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 8169, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 8186, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 8207, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 8228, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 8245, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 8266, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 8287, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 8304, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 8325, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 8346, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 8363, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 8384, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 8405, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 8422, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 8443, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8464, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8484, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8504, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8520, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8540, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8560, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8576, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8596, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8616, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8632, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8652, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8672, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8688, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8708, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8728, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8744, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8764, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8784, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8800, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8820, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8840, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8856, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8876, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8896, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8912, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8932, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8952, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 8972, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 9004, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 9028, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 9048, 0x00000304 }, /* GL_DST_ALPHA */ + { 9061, 0x00000306 }, /* GL_DST_COLOR */ + { 9074, 0x0000877A }, /* GL_DU8DV8_ATI */ + { 9088, 0x00008779 }, /* GL_DUDV_ATI */ + { 9100, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 9116, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 9136, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 9152, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 9172, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 9188, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 9208, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 9221, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 9240, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 9274, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 9312, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 9339, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 9365, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 9389, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 9421, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 9457, 0x00001600 }, /* GL_EMISSION */ + { 9469, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9483, 0x00000202 }, /* GL_EQUAL */ + { 9492, 0x00001509 }, /* GL_EQUIV */ + { 9501, 0x00010000 }, /* GL_EVAL_BIT */ + { 9513, 0x00000800 }, /* GL_EXP */ + { 9520, 0x00000801 }, /* GL_EXP2 */ + { 9528, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9542, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9556, 0x00002502 }, /* GL_EYE_PLANE */ + { 9569, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9594, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9611, 0x00000000 }, /* GL_FALSE */ + { 9620, 0x00001101 }, /* GL_FASTEST */ + { 9631, 0x00001C01 }, /* GL_FEEDBACK */ + { 9643, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9670, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9694, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9718, 0x00001B02 }, /* GL_FILL */ + { 9726, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ + { 9753, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ + { 9784, 0x00001D00 }, /* GL_FLAT */ + { 9792, 0x00001406 }, /* GL_FLOAT */ + { 9801, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9815, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9833, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ + { 9849, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ + { 9865, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9879, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9897, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ + { 9913, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ + { 9929, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 9943, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 9961, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ + { 9977, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ + { 9993, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 10007, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 10025, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 10039, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 10057, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 10071, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 10089, 0x00000B60 }, /* GL_FOG */ + { 10096, 0x00000080 }, /* GL_FOG_BIT */ + { 10107, 0x00000B66 }, /* GL_FOG_COLOR */ + { 10120, 0x00008451 }, /* GL_FOG_COORD */ + { 10133, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 10151, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 10175, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 10214, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 10257, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 10289, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 10320, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 10349, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 10374, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 10393, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 10427, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 10454, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 10480, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 10504, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 10521, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 10536, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 10560, 0x00000B64 }, /* GL_FOG_END */ + { 10571, 0x00000C54 }, /* GL_FOG_HINT */ + { 10583, 0x00000B61 }, /* GL_FOG_INDEX */ + { 10596, 0x00000B65 }, /* GL_FOG_MODE */ + { 10608, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 10627, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10652, 0x00000B63 }, /* GL_FOG_START */ + { 10665, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10683, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10707, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10726, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10749, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10784, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10799, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10836, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10872, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10913, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 10954, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 10991, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 11028, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 11066, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 11108, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 11146, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 11188, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 11223, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 11262, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 11311, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 11359, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 11411, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 11451, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 11495, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 11535, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 11579, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 11606, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 11630, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11658, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11681, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11700, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11737, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11778, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11819, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11861, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 11912, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 11950, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 11995, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 12044, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 12082, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 12124, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 12156, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 12181, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 12208, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 12239, 0x00000404 }, /* GL_FRONT */ + { 12248, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 12266, 0x00000B46 }, /* GL_FRONT_FACE */ + { 12280, 0x00000400 }, /* GL_FRONT_LEFT */ + { 12294, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 12309, 0x00008006 }, /* GL_FUNC_ADD */ + { 12321, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 12337, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 12362, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 12391, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 12408, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 12429, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 12448, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 12472, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 12501, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 12525, 0x00000206 }, /* GL_GEQUAL */ + { 12535, 0x00000204 }, /* GL_GREATER */ + { 12546, 0x00001904 }, /* GL_GREEN */ + { 12555, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12569, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12583, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12598, 0x00008000 }, /* GL_HINT_BIT */ + { 12610, 0x00008024 }, /* GL_HISTOGRAM */ + { 12623, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12647, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12675, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12698, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12725, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12742, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12762, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 12786, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 12810, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 12838, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 12866, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 12898, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 12920, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 12946, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 12964, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 12986, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 13005, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 13028, 0x0000862A }, /* GL_IDENTITY_NV */ + { 13043, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 13063, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13103, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13141, 0x00001E02 }, /* GL_INCR */ + { 13149, 0x00008507 }, /* GL_INCR_WRAP */ + { 13162, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13179, 0x00008222 }, /* GL_INDEX */ + { 13188, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13203, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13233, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13267, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13290, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13312, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13332, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13346, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13367, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13385, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13399, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13415, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13430, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13449, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13468, 0x00001404 }, /* GL_INT */ + { 13475, 0x00008049 }, /* GL_INTENSITY */ + { 13488, 0x0000804C }, /* GL_INTENSITY12 */ + { 13503, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13522, 0x0000804D }, /* GL_INTENSITY16 */ + { 13537, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13556, 0x0000804A }, /* GL_INTENSITY4 */ + { 13570, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13588, 0x0000804B }, /* GL_INTENSITY8 */ + { 13602, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13620, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13637, 0x00008575 }, /* GL_INTERPOLATE */ + { 13652, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13671, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13690, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13702, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13718, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13730, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13746, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13758, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13774, 0x00000500 }, /* GL_INVALID_ENUM */ + { 13790, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 13823, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 13860, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 13881, 0x00000501 }, /* GL_INVALID_VALUE */ + { 13898, 0x0000862B }, /* GL_INVERSE_NV */ + { 13912, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 13936, 0x0000150A }, /* GL_INVERT */ + { 13946, 0x00001E00 }, /* GL_KEEP */ + { 13954, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ + { 13980, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ + { 14010, 0x00000406 }, /* GL_LEFT */ + { 14018, 0x00000203 }, /* GL_LEQUAL */ + { 14028, 0x00000201 }, /* GL_LESS */ + { 14036, 0x00004000 }, /* GL_LIGHT0 */ + { 14046, 0x00004001 }, /* GL_LIGHT1 */ + { 14056, 0x00004002 }, /* GL_LIGHT2 */ + { 14066, 0x00004003 }, /* GL_LIGHT3 */ + { 14076, 0x00004004 }, /* GL_LIGHT4 */ + { 14086, 0x00004005 }, /* GL_LIGHT5 */ + { 14096, 0x00004006 }, /* GL_LIGHT6 */ + { 14106, 0x00004007 }, /* GL_LIGHT7 */ + { 14116, 0x00000B50 }, /* GL_LIGHTING */ + { 14128, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 14144, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14167, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14196, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14229, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14257, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14281, 0x00001B01 }, /* GL_LINE */ + { 14289, 0x00002601 }, /* GL_LINEAR */ + { 14299, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14321, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14351, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14382, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14406, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14431, 0x00000001 }, /* GL_LINES */ + { 14440, 0x00000004 }, /* GL_LINE_BIT */ + { 14452, 0x00000002 }, /* GL_LINE_LOOP */ + { 14465, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14485, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14500, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14520, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14536, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14560, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14583, 0x00000003 }, /* GL_LINE_STRIP */ + { 14597, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14611, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14625, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14651, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14671, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14686, 0x00000B32 }, /* GL_LIST_BASE */ + { 14699, 0x00020000 }, /* GL_LIST_BIT */ + { 14711, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14725, 0x00000B30 }, /* GL_LIST_MODE */ + { 14738, 0x00000101 }, /* GL_LOAD */ + { 14746, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14758, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14775, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 14789, 0x00001909 }, /* GL_LUMINANCE */ + { 14802, 0x00008041 }, /* GL_LUMINANCE12 */ + { 14817, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 14840, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 14867, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 14889, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 14915, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 14934, 0x00008042 }, /* GL_LUMINANCE16 */ + { 14949, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 14972, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 14999, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 15018, 0x0000803F }, /* GL_LUMINANCE4 */ + { 15032, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 15053, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 15078, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 15096, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 15117, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 15142, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15156, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15177, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15202, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15220, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15239, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15255, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15275, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15297, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15311, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15326, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15350, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15374, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15398, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15422, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15439, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15456, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15484, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15513, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15542, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15571, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15600, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15629, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15658, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15686, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15714, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15742, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15770, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 15798, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 15826, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 15854, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 15882, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 15910, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 15926, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 15946, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 15968, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 15982, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 15997, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 16021, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 16045, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 16069, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 16093, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 16110, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 16127, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16155, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16184, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16213, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16242, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16271, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16300, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16329, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16357, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16385, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16413, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16441, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16469, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16497, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16525, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16553, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16581, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16594, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ + { 16620, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ + { 16649, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ + { 16677, 0x00000001 }, /* GL_MAP_READ_BIT */ + { 16693, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16708, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ + { 16734, 0x00000002 }, /* GL_MAP_WRITE_BIT */ + { 16751, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16766, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16780, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 16796, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 16812, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 16828, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 16844, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 16860, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 16876, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 16892, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 16908, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 16924, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 16940, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 16955, 0x00008631 }, /* GL_MATRIX1_NV */ + { 16969, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 16985, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 17001, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 17017, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 17033, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 17049, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 17065, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 17081, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 17097, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 17113, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 17129, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 17144, 0x00008632 }, /* GL_MATRIX2_NV */ + { 17158, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 17174, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 17190, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 17205, 0x00008633 }, /* GL_MATRIX3_NV */ + { 17219, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 17234, 0x00008634 }, /* GL_MATRIX4_NV */ + { 17248, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 17263, 0x00008635 }, /* GL_MATRIX5_NV */ + { 17277, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17292, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17306, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17321, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17335, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17350, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17365, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17391, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17425, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17456, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17489, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17520, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17535, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17557, 0x00008008 }, /* GL_MAX */ + { 17564, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17587, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17619, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17645, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17678, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17704, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17738, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17757, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 17786, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 17818, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 17854, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 17890, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 17930, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 17956, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 17986, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 18011, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 18040, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 18069, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 18102, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 18122, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 18146, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 18170, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 18194, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 18219, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 18237, 0x00008008 }, /* GL_MAX_EXT */ + { 18248, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 18283, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18322, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18336, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18356, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18394, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18423, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18447, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18475, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18498, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18535, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18571, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18598, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18627, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18661, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18697, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18724, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18756, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 18792, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 18821, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 18850, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 18878, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 18916, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 18960, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 19003, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 19037, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 19076, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 19113, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 19151, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 19194, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 19237, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 19267, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19298, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19334, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19370, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19400, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19434, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19467, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19496, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19511, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + { 19538, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19558, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19582, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19604, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19630, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19657, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19688, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19712, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 19746, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 19766, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 19793, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 19814, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 19839, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 19864, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 19899, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 19921, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 19947, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19969, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 19995, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 20029, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 20067, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 20100, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 20137, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 20161, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 20182, 0x00008007 }, /* GL_MIN */ + { 20189, 0x0000802E }, /* GL_MINMAX */ + { 20199, 0x0000802E }, /* GL_MINMAX_EXT */ + { 20213, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 20230, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 20251, 0x00008030 }, /* GL_MINMAX_SINK */ + { 20266, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 20285, 0x00008007 }, /* GL_MIN_EXT */ + { 20296, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 20315, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20338, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20361, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20381, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20401, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20431, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20459, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20487, 0x00001700 }, /* GL_MODELVIEW */ + { 20500, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20518, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20537, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20556, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20575, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20594, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20613, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20632, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20651, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20670, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20689, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20708, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 20726, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 20745, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 20764, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 20783, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 20802, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 20821, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 20840, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 20859, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 20878, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 20897, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 20916, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 20934, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 20953, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 20972, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 20990, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 21008, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 21026, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 21044, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 21062, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 21080, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 21098, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 21118, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 21145, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 21170, 0x00002100 }, /* GL_MODULATE */ + { 21182, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 21202, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 21229, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 21254, 0x00000103 }, /* GL_MULT */ + { 21262, 0x0000809D }, /* GL_MULTISAMPLE */ + { 21277, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 21297, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21316, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21335, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21359, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21382, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21412, 0x00002A25 }, /* GL_N3F_V3F */ + { 21423, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21443, 0x0000150E }, /* GL_NAND */ + { 21451, 0x00002600 }, /* GL_NEAREST */ + { 21462, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21493, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21525, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21550, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21576, 0x00000200 }, /* GL_NEVER */ + { 21585, 0x00001102 }, /* GL_NICEST */ + { 21595, 0x00000000 }, /* GL_NONE */ + { 21603, 0x00001505 }, /* GL_NOOP */ + { 21611, 0x00001508 }, /* GL_NOR */ + { 21618, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21631, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21647, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21678, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21713, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 21737, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 21760, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 21781, 0x00008511 }, /* GL_NORMAL_MAP */ + { 21795, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 21813, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 21830, 0x00000205 }, /* GL_NOTEQUAL */ + { 21842, 0x00000000 }, /* GL_NO_ERROR */ + { 21854, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 21888, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 21926, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 21958, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 22000, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 22030, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 22070, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 22101, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 22130, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 22158, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 22188, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 22205, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 22231, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 22247, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 22282, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 22304, 0x00009112 }, /* GL_OBJECT_TYPE */ + { 22319, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22338, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22368, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22389, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22417, 0x00000001 }, /* GL_ONE */ + { 22424, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22452, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22484, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22512, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22544, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22567, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22590, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22613, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22636, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22654, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22676, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22698, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22714, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 22734, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 22754, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 22772, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 22794, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 22816, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 22832, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 22852, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 22872, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 22890, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 22912, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 22934, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 22950, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 22970, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 22990, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 23011, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 23030, 0x00001507 }, /* GL_OR */ + { 23036, 0x00000A01 }, /* GL_ORDER */ + { 23045, 0x0000150D }, /* GL_OR_INVERTED */ + { 23060, 0x0000150B }, /* GL_OR_REVERSE */ + { 23074, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 23091, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 23109, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 23130, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 23150, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 23168, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 23187, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 23207, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 23227, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 23245, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 23264, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 23289, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 23313, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23334, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23356, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23378, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23403, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23427, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23448, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23470, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23492, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23514, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23545, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23565, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23590, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23610, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23635, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23655, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23680, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23700, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 23725, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 23745, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 23770, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 23790, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 23815, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 23835, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 23860, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 23880, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 23905, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 23925, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 23950, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 23970, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 23995, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 24013, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 24034, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 24063, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 24096, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 24121, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 24144, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 24175, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 24210, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 24237, 0x00001B00 }, /* GL_POINT */ + { 24246, 0x00000000 }, /* GL_POINTS */ + { 24256, 0x00000002 }, /* GL_POINT_BIT */ + { 24269, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 24299, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 24333, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 24367, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 24402, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 24431, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24464, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24497, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24531, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24545, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24571, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24589, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24611, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24633, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24656, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24674, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24696, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 24718, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 24741, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 24761, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 24777, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 24798, 0x00008861 }, /* GL_POINT_SPRITE */ + { 24814, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 24834, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 24863, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 24882, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 24908, 0x00000701 }, /* GL_POINT_TOKEN */ + { 24923, 0x00000009 }, /* GL_POLYGON */ + { 24934, 0x00000008 }, /* GL_POLYGON_BIT */ + { 24949, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 24965, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 24988, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 25013, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 25036, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 25059, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 25083, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 25107, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 25125, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 25148, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 25167, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 25190, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 25207, 0x00001203 }, /* GL_POSITION */ + { 25219, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 25251, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 25287, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 25320, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 25357, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 25388, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 25423, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25455, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25491, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25524, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25556, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25592, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25625, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25662, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25692, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 25726, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 25757, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 25792, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 25823, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 25858, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 25890, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 25926, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 25956, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 25990, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 26021, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 26056, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 26088, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 26119, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 26154, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 26186, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 26222, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 26251, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 26284, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 26314, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 26348, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 26387, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 26420, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26460, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26494, 0x00008578 }, /* GL_PREVIOUS */ + { 26506, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26522, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26538, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26555, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26576, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26597, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26630, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26662, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26685, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26708, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 26738, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 26767, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 26795, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 26817, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 26845, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 26873, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 26895, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 26916, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 26956, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 26995, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 27025, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 27060, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 27093, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 27127, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 27166, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 27205, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 27227, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 27253, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 27277, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 27300, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 27322, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 27343, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 27364, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 27391, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 27423, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27455, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27490, 0x00001701 }, /* GL_PROJECTION */ + { 27504, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27525, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27551, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ + { 27571, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ + { 27595, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27616, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27635, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27658, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27697, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 27735, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 27755, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 27785, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 27809, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 27829, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 27859, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 27883, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 27903, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 27936, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 27962, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 27992, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 28023, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 28053, 0x00002003 }, /* GL_Q */ + { 28058, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 28083, 0x00000007 }, /* GL_QUADS */ + { 28092, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + { 28136, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ + { 28184, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 28201, 0x00000008 }, /* GL_QUAD_STRIP */ + { 28215, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 28237, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 28263, 0x00008866 }, /* GL_QUERY_RESULT */ + { 28279, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 28299, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 28325, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 28355, 0x00002002 }, /* GL_R */ + { 28360, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 28372, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 28405, 0x00000C02 }, /* GL_READ_BUFFER */ + { 28420, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 28440, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 28472, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 28496, 0x000088B8 }, /* GL_READ_ONLY */ + { 28509, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 28526, 0x000088BA }, /* GL_READ_WRITE */ + { 28540, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 28558, 0x00001903 }, /* GL_RED */ + { 28565, 0x00008016 }, /* GL_REDUCE */ + { 28575, 0x00008016 }, /* GL_REDUCE_EXT */ + { 28589, 0x00000D15 }, /* GL_RED_BIAS */ + { 28601, 0x00000D52 }, /* GL_RED_BITS */ + { 28613, 0x00000D14 }, /* GL_RED_SCALE */ + { 28626, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28644, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28666, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28687, 0x00001C00 }, /* GL_RENDER */ + { 28697, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 28713, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 28740, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 28768, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 28794, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 28821, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 28841, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 28868, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 28891, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 28918, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 28950, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 28986, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 29011, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 29035, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 29064, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 29086, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 29112, 0x00001F01 }, /* GL_RENDERER */ + { 29124, 0x00000C40 }, /* GL_RENDER_MODE */ + { 29139, 0x00002901 }, /* GL_REPEAT */ + { 29149, 0x00001E01 }, /* GL_REPLACE */ + { 29160, 0x00008062 }, /* GL_REPLACE_EXT */ + { 29175, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 29198, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 29216, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 29238, 0x00000102 }, /* GL_RETURN */ + { 29248, 0x00001907 }, /* GL_RGB */ + { 29255, 0x00008052 }, /* GL_RGB10 */ + { 29264, 0x00008059 }, /* GL_RGB10_A2 */ + { 29276, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 29292, 0x00008052 }, /* GL_RGB10_EXT */ + { 29305, 0x00008053 }, /* GL_RGB12 */ + { 29314, 0x00008053 }, /* GL_RGB12_EXT */ + { 29327, 0x00008054 }, /* GL_RGB16 */ + { 29336, 0x00008054 }, /* GL_RGB16_EXT */ + { 29349, 0x0000804E }, /* GL_RGB2_EXT */ + { 29361, 0x0000804F }, /* GL_RGB4 */ + { 29369, 0x0000804F }, /* GL_RGB4_EXT */ + { 29381, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 29394, 0x00008050 }, /* GL_RGB5 */ + { 29402, 0x00008057 }, /* GL_RGB5_A1 */ + { 29413, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 29428, 0x00008050 }, /* GL_RGB5_EXT */ + { 29440, 0x00008051 }, /* GL_RGB8 */ + { 29448, 0x00008051 }, /* GL_RGB8_EXT */ + { 29460, 0x00001908 }, /* GL_RGBA */ + { 29468, 0x0000805A }, /* GL_RGBA12 */ + { 29478, 0x0000805A }, /* GL_RGBA12_EXT */ + { 29492, 0x0000805B }, /* GL_RGBA16 */ + { 29502, 0x0000805B }, /* GL_RGBA16_EXT */ + { 29516, 0x00008055 }, /* GL_RGBA2 */ + { 29525, 0x00008055 }, /* GL_RGBA2_EXT */ + { 29538, 0x00008056 }, /* GL_RGBA4 */ + { 29547, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 29566, 0x00008056 }, /* GL_RGBA4_EXT */ + { 29579, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 29593, 0x00008058 }, /* GL_RGBA8 */ + { 29602, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29615, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 29630, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 29648, 0x00000C31 }, /* GL_RGBA_MODE */ + { 29661, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 29674, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 29688, 0x000083A0 }, /* GL_RGB_S3TC */ + { 29700, 0x00008573 }, /* GL_RGB_SCALE */ + { 29713, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 29730, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 29747, 0x00000407 }, /* GL_RIGHT */ + { 29756, 0x00002000 }, /* GL_S */ + { 29761, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 29775, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 29796, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 29810, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 29831, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 29845, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 29861, 0x000080A9 }, /* GL_SAMPLES */ + { 29872, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 29888, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 29903, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 29921, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 29943, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 29971, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 30003, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 30026, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 30053, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 30071, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 30094, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 30116, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 30135, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 30158, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 30184, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 30214, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 30239, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 30268, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 30283, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 30298, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 30314, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 30339, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 30379, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 30423, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 30456, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 30486, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 30518, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 30548, 0x00001C02 }, /* GL_SELECT */ + { 30558, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 30586, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30611, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30627, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 30654, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 30685, 0x0000150F }, /* GL_SET */ + { 30692, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 30713, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 30737, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 30752, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 30767, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 30795, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 30818, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 30848, 0x00001601 }, /* GL_SHININESS */ + { 30861, 0x00001402 }, /* GL_SHORT */ + { 30870, 0x00009119 }, /* GL_SIGNALED */ + { 30882, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 30903, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 30919, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 30939, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 30958, 0x00008C46 }, /* GL_SLUMINANCE */ + { 30972, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 30987, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 31009, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 31029, 0x00001D01 }, /* GL_SMOOTH */ + { 31039, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 31072, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 31099, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 31132, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 31159, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 31176, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 31197, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 31218, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 31233, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 31252, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 31271, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 31288, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 31309, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 31330, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 31345, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 31364, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 31383, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 31400, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 31421, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 31442, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 31457, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 31476, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 31495, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 31515, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 31533, 0x00001202 }, /* GL_SPECULAR */ + { 31545, 0x00002402 }, /* GL_SPHERE_MAP */ + { 31559, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 31574, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 31592, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 31609, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 31623, 0x00008580 }, /* GL_SRC0_RGB */ + { 31635, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 31649, 0x00008581 }, /* GL_SRC1_RGB */ + { 31661, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 31675, 0x00008582 }, /* GL_SRC2_RGB */ + { 31687, 0x00000302 }, /* GL_SRC_ALPHA */ + { 31700, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 31722, 0x00000300 }, /* GL_SRC_COLOR */ + { 31735, 0x00008C40 }, /* GL_SRGB */ + { 31743, 0x00008C41 }, /* GL_SRGB8 */ + { 31752, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 31768, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 31782, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 31800, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 31819, 0x000088E6 }, /* GL_STATIC_COPY */ + { 31834, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 31853, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 31868, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 31887, 0x000088E5 }, /* GL_STATIC_READ */ + { 31902, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 31921, 0x00001802 }, /* GL_STENCIL */ + { 31932, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 31954, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 31980, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 32001, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 32026, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 32047, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 32072, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 32104, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 32140, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 32172, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 32208, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 32228, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 32255, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 32281, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 32297, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 32319, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 32342, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 32358, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 32374, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 32391, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 32414, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 32436, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 32458, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 32480, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 32501, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 32528, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 32555, 0x00000B97 }, /* GL_STENCIL_REF */ + { 32570, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 32586, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 32615, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 32637, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 32658, 0x00000C33 }, /* GL_STEREO */ + { 32668, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ + { 32692, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ + { 32717, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ + { 32741, 0x000088E2 }, /* GL_STREAM_COPY */ + { 32756, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 32775, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 32790, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 32809, 0x000088E1 }, /* GL_STREAM_READ */ + { 32824, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 32843, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 32860, 0x000084E7 }, /* GL_SUBTRACT */ + { 32872, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 32888, 0x00009113 }, /* GL_SYNC_CONDITION */ + { 32906, 0x00009116 }, /* GL_SYNC_FENCE */ + { 32920, 0x00009115 }, /* GL_SYNC_FLAGS */ + { 32934, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ + { 32961, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + { 32991, 0x00009114 }, /* GL_SYNC_STATUS */ + { 33006, 0x00002001 }, /* GL_T */ + { 33011, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 33026, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 33045, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 33061, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 33076, 0x00002A27 }, /* GL_T2F_V3F */ + { 33087, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 33106, 0x00002A28 }, /* GL_T4F_V4F */ + { 33117, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 33140, 0x00001702 }, /* GL_TEXTURE */ + { 33151, 0x000084C0 }, /* GL_TEXTURE0 */ + { 33163, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 33179, 0x000084C1 }, /* GL_TEXTURE1 */ + { 33191, 0x000084CA }, /* GL_TEXTURE10 */ + { 33204, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 33221, 0x000084CB }, /* GL_TEXTURE11 */ + { 33234, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 33251, 0x000084CC }, /* GL_TEXTURE12 */ + { 33264, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 33281, 0x000084CD }, /* GL_TEXTURE13 */ + { 33294, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 33311, 0x000084CE }, /* GL_TEXTURE14 */ + { 33324, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 33341, 0x000084CF }, /* GL_TEXTURE15 */ + { 33354, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 33371, 0x000084D0 }, /* GL_TEXTURE16 */ + { 33384, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 33401, 0x000084D1 }, /* GL_TEXTURE17 */ + { 33414, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 33431, 0x000084D2 }, /* GL_TEXTURE18 */ + { 33444, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 33461, 0x000084D3 }, /* GL_TEXTURE19 */ + { 33474, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 33491, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 33507, 0x000084C2 }, /* GL_TEXTURE2 */ + { 33519, 0x000084D4 }, /* GL_TEXTURE20 */ + { 33532, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 33549, 0x000084D5 }, /* GL_TEXTURE21 */ + { 33562, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 33579, 0x000084D6 }, /* GL_TEXTURE22 */ + { 33592, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 33609, 0x000084D7 }, /* GL_TEXTURE23 */ + { 33622, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 33639, 0x000084D8 }, /* GL_TEXTURE24 */ + { 33652, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 33669, 0x000084D9 }, /* GL_TEXTURE25 */ + { 33682, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 33699, 0x000084DA }, /* GL_TEXTURE26 */ + { 33712, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 33729, 0x000084DB }, /* GL_TEXTURE27 */ + { 33742, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 33759, 0x000084DC }, /* GL_TEXTURE28 */ + { 33772, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 33789, 0x000084DD }, /* GL_TEXTURE29 */ + { 33802, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 33819, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 33835, 0x000084C3 }, /* GL_TEXTURE3 */ + { 33847, 0x000084DE }, /* GL_TEXTURE30 */ + { 33860, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 33877, 0x000084DF }, /* GL_TEXTURE31 */ + { 33890, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 33907, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 33923, 0x000084C4 }, /* GL_TEXTURE4 */ + { 33935, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 33951, 0x000084C5 }, /* GL_TEXTURE5 */ + { 33963, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 33979, 0x000084C6 }, /* GL_TEXTURE6 */ + { 33991, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 34007, 0x000084C7 }, /* GL_TEXTURE7 */ + { 34019, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 34035, 0x000084C8 }, /* GL_TEXTURE8 */ + { 34047, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 34063, 0x000084C9 }, /* GL_TEXTURE9 */ + { 34075, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 34091, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 34105, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 34129, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 34143, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 34167, 0x0000806F }, /* GL_TEXTURE_3D */ + { 34181, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 34203, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 34229, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 34251, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 34273, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 34305, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 34327, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 34359, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 34381, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 34409, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 34441, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 34474, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 34506, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 34521, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 34542, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 34567, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 34585, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 34609, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 34640, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 34670, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 34700, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 34735, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 34766, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 34804, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 34831, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 34863, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 34897, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 34921, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 34949, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 34973, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 35001, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 35034, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 35058, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 35080, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 35102, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 35128, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 35162, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 35195, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 35232, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 35260, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 35292, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 35315, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 35353, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 35395, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 35426, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 35454, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 35484, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 35512, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 35532, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 35556, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 35587, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 35622, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 35653, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 35688, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 35719, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 35754, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 35785, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 35820, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 35851, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 35886, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 35917, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 35952, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + { 35981, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 35998, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 36020, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 36046, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 36061, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 36082, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 36102, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 36128, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 36148, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 36165, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 36182, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 36199, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 36216, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 36241, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 36263, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 36289, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 36307, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 36333, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 36359, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 36389, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 36416, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 36441, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 36461, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 36485, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 36512, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 36539, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 36566, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 36592, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 36622, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 36644, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 36662, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 36692, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 36720, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 36748, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 36776, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 36797, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 36816, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 36838, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 36857, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 36877, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + { 36907, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + { 36938, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 36963, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 36987, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 37007, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 37031, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 37051, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 37074, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 37098, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + { 37128, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 37153, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 37187, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 37204, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 37222, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 37240, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 37258, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ + { 37277, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ + { 37296, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 37316, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 37335, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 37364, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 37381, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 37407, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 37437, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 37469, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 37499, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 37533, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 37549, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 37580, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 37615, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 37643, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 37675, 0x00000004 }, /* GL_TRIANGLES */ + { 37688, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 37704, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 37725, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 37743, 0x00000001 }, /* GL_TRUE */ + { 37751, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 37771, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 37794, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 37814, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 37835, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 37857, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 37879, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 37899, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 37920, 0x00009118 }, /* GL_UNSIGNALED */ + { 37934, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 37951, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 37978, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 38001, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 38017, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 38044, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 38065, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 38089, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 38120, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 38144, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 38172, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 38195, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 38213, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 38243, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 38269, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 38299, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 38325, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 38349, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 38377, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 38405, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 38432, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 38464, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 38495, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 38509, 0x00002A20 }, /* GL_V2F */ + { 38516, 0x00002A21 }, /* GL_V3F */ + { 38523, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 38542, 0x00001F00 }, /* GL_VENDOR */ + { 38552, 0x00001F02 }, /* GL_VERSION */ + { 38563, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 38579, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ + { 38603, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 38633, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 38664, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 38699, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 38723, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 38744, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 38767, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 38788, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 38815, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 38843, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 38871, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 38899, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 38927, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 38955, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 38983, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 39010, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 39037, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 39064, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 39091, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 39118, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 39145, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 39172, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 39199, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 39226, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 39264, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 39306, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 39337, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 39372, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 39406, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 39444, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 39475, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 39510, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 39538, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 39570, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 39600, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 39634, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 39662, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 39694, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 39714, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 39736, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 39765, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 39786, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 39815, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 39848, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 39880, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 39907, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 39938, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 39968, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 39985, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 40006, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 40033, 0x00000BA2 }, /* GL_VIEWPORT */ + { 40045, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 40061, 0x0000911D }, /* GL_WAIT_FAILED */ + { 40076, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 40096, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 40127, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 40162, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 40190, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 40215, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 40242, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 40267, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 40291, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 40310, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 40324, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 40342, 0x00001506 }, /* GL_XOR */ + { 40349, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 40368, 0x00008757 }, /* GL_YCBCR_MESA */ + { 40382, 0x00000000 }, /* GL_ZERO */ + { 40390, 0x00000D16 }, /* GL_ZOOM_X */ + { 40400, 0x00000D17 }, /* GL_ZOOM_Y */ }; static const unsigned reduced_enums[1347] = { - 475, /* GL_FALSE */ - 691, /* GL_LINES */ - 693, /* GL_LINE_LOOP */ - 700, /* GL_LINE_STRIP */ - 1743, /* GL_TRIANGLES */ - 1746, /* GL_TRIANGLE_STRIP */ - 1744, /* GL_TRIANGLE_FAN */ - 1271, /* GL_QUADS */ - 1274, /* GL_QUAD_STRIP */ - 1158, /* GL_POLYGON */ - 1170, /* GL_POLYGON_STIPPLE_BIT */ - 1119, /* GL_PIXEL_MODE_BIT */ - 678, /* GL_LIGHTING_BIT */ - 504, /* GL_FOG_BIT */ + 476, /* GL_FALSE */ + 694, /* GL_LINES */ + 696, /* GL_LINE_LOOP */ + 703, /* GL_LINE_STRIP */ + 1748, /* GL_TRIANGLES */ + 1751, /* GL_TRIANGLE_STRIP */ + 1749, /* GL_TRIANGLE_FAN */ + 1275, /* GL_QUADS */ + 1279, /* GL_QUAD_STRIP */ + 1161, /* GL_POLYGON */ + 1173, /* GL_POLYGON_STIPPLE_BIT */ + 1122, /* GL_PIXEL_MODE_BIT */ + 681, /* GL_LIGHTING_BIT */ + 506, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 710, /* GL_LOAD */ - 1326, /* GL_RETURN */ - 991, /* GL_MULT */ + 713, /* GL_LOAD */ + 1331, /* GL_RETURN */ + 994, /* GL_MULT */ 23, /* GL_ADD */ - 1007, /* GL_NEVER */ - 668, /* GL_LESS */ - 465, /* GL_EQUAL */ - 667, /* GL_LEQUAL */ - 590, /* GL_GREATER */ - 1022, /* GL_NOTEQUAL */ - 589, /* GL_GEQUAL */ + 1010, /* GL_NEVER */ + 671, /* GL_LESS */ + 466, /* GL_EQUAL */ + 670, /* GL_LEQUAL */ + 592, /* GL_GREATER */ + 1025, /* GL_NOTEQUAL */ + 591, /* GL_GEQUAL */ 47, /* GL_ALWAYS */ - 1467, /* GL_SRC_COLOR */ - 1052, /* GL_ONE_MINUS_SRC_COLOR */ - 1465, /* GL_SRC_ALPHA */ - 1051, /* GL_ONE_MINUS_SRC_ALPHA */ - 444, /* GL_DST_ALPHA */ - 1049, /* GL_ONE_MINUS_DST_ALPHA */ - 445, /* GL_DST_COLOR */ - 1050, /* GL_ONE_MINUS_DST_COLOR */ - 1466, /* GL_SRC_ALPHA_SATURATE */ - 577, /* GL_FRONT_LEFT */ - 578, /* GL_FRONT_RIGHT */ + 1472, /* GL_SRC_COLOR */ + 1055, /* GL_ONE_MINUS_SRC_COLOR */ + 1470, /* GL_SRC_ALPHA */ + 1054, /* GL_ONE_MINUS_SRC_ALPHA */ + 445, /* GL_DST_ALPHA */ + 1052, /* GL_ONE_MINUS_DST_ALPHA */ + 446, /* GL_DST_COLOR */ + 1053, /* GL_ONE_MINUS_DST_COLOR */ + 1471, /* GL_SRC_ALPHA_SATURATE */ + 579, /* GL_FRONT_LEFT */ + 580, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ - 574, /* GL_FRONT */ + 576, /* GL_FRONT */ 68, /* GL_BACK */ - 666, /* GL_LEFT */ - 1368, /* GL_RIGHT */ - 575, /* GL_FRONT_AND_BACK */ + 669, /* GL_LEFT */ + 1373, /* GL_RIGHT */ + 577, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 656, /* GL_INVALID_ENUM */ - 660, /* GL_INVALID_VALUE */ - 659, /* GL_INVALID_OPERATION */ - 1472, /* GL_STACK_OVERFLOW */ - 1473, /* GL_STACK_UNDERFLOW */ - 1077, /* GL_OUT_OF_MEMORY */ - 657, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 658, /* GL_INVALID_ENUM */ + 662, /* GL_INVALID_VALUE */ + 661, /* GL_INVALID_OPERATION */ + 1477, /* GL_STACK_OVERFLOW */ + 1478, /* GL_STACK_UNDERFLOW */ + 1080, /* GL_OUT_OF_MEMORY */ + 659, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1097, /* GL_PASS_THROUGH_TOKEN */ - 1157, /* GL_POINT_TOKEN */ - 701, /* GL_LINE_TOKEN */ - 1171, /* GL_POLYGON_TOKEN */ + 1100, /* GL_PASS_THROUGH_TOKEN */ + 1160, /* GL_POINT_TOKEN */ + 704, /* GL_LINE_TOKEN */ + 1174, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ - 443, /* GL_DRAW_PIXEL_TOKEN */ + 444, /* GL_DRAW_PIXEL_TOKEN */ 301, /* GL_COPY_PIXEL_TOKEN */ - 694, /* GL_LINE_RESET_TOKEN */ - 468, /* GL_EXP */ - 469, /* GL_EXP2 */ + 697, /* GL_LINE_RESET_TOKEN */ + 469, /* GL_EXP */ + 470, /* GL_EXP2 */ 337, /* GL_CW */ 125, /* GL_CCW */ 146, /* GL_COEFF */ - 1074, /* GL_ORDER */ - 381, /* GL_DOMAIN */ + 1077, /* GL_ORDER */ + 382, /* GL_DOMAIN */ 311, /* GL_CURRENT_COLOR */ 314, /* GL_CURRENT_INDEX */ 320, /* GL_CURRENT_NORMAL */ @@ -3844,519 +3854,519 @@ static const unsigned reduced_enums[1347] = 328, /* GL_CURRENT_RASTER_POSITION */ 329, /* GL_CURRENT_RASTER_POSITION_VALID */ 326, /* GL_CURRENT_RASTER_DISTANCE */ - 1150, /* GL_POINT_SMOOTH */ - 1139, /* GL_POINT_SIZE */ - 1149, /* GL_POINT_SIZE_RANGE */ - 1140, /* GL_POINT_SIZE_GRANULARITY */ - 695, /* GL_LINE_SMOOTH */ - 702, /* GL_LINE_WIDTH */ - 704, /* GL_LINE_WIDTH_RANGE */ - 703, /* GL_LINE_WIDTH_GRANULARITY */ - 697, /* GL_LINE_STIPPLE */ - 698, /* GL_LINE_STIPPLE_PATTERN */ - 699, /* GL_LINE_STIPPLE_REPEAT */ - 709, /* GL_LIST_MODE */ - 874, /* GL_MAX_LIST_NESTING */ - 706, /* GL_LIST_BASE */ - 708, /* GL_LIST_INDEX */ - 1160, /* GL_POLYGON_MODE */ - 1167, /* GL_POLYGON_SMOOTH */ - 1169, /* GL_POLYGON_STIPPLE */ - 454, /* GL_EDGE_FLAG */ + 1153, /* GL_POINT_SMOOTH */ + 1142, /* GL_POINT_SIZE */ + 1152, /* GL_POINT_SIZE_RANGE */ + 1143, /* GL_POINT_SIZE_GRANULARITY */ + 698, /* GL_LINE_SMOOTH */ + 705, /* GL_LINE_WIDTH */ + 707, /* GL_LINE_WIDTH_RANGE */ + 706, /* GL_LINE_WIDTH_GRANULARITY */ + 700, /* GL_LINE_STIPPLE */ + 701, /* GL_LINE_STIPPLE_PATTERN */ + 702, /* GL_LINE_STIPPLE_REPEAT */ + 712, /* GL_LIST_MODE */ + 877, /* GL_MAX_LIST_NESTING */ + 709, /* GL_LIST_BASE */ + 711, /* GL_LIST_INDEX */ + 1163, /* GL_POLYGON_MODE */ + 1170, /* GL_POLYGON_SMOOTH */ + 1172, /* GL_POLYGON_STIPPLE */ + 455, /* GL_EDGE_FLAG */ 304, /* GL_CULL_FACE */ 305, /* GL_CULL_FACE_MODE */ - 576, /* GL_FRONT_FACE */ - 677, /* GL_LIGHTING */ - 682, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 683, /* GL_LIGHT_MODEL_TWO_SIDE */ - 679, /* GL_LIGHT_MODEL_AMBIENT */ - 1414, /* GL_SHADE_MODEL */ + 578, /* GL_FRONT_FACE */ + 680, /* GL_LIGHTING */ + 685, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 686, /* GL_LIGHT_MODEL_TWO_SIDE */ + 682, /* GL_LIGHT_MODEL_AMBIENT */ + 1419, /* GL_SHADE_MODEL */ 193, /* GL_COLOR_MATERIAL_FACE */ 194, /* GL_COLOR_MATERIAL_PARAMETER */ 192, /* GL_COLOR_MATERIAL */ - 503, /* GL_FOG */ - 525, /* GL_FOG_INDEX */ - 521, /* GL_FOG_DENSITY */ - 529, /* GL_FOG_START */ - 523, /* GL_FOG_END */ - 526, /* GL_FOG_MODE */ - 505, /* GL_FOG_COLOR */ - 368, /* GL_DEPTH_RANGE */ - 375, /* GL_DEPTH_TEST */ - 378, /* GL_DEPTH_WRITEMASK */ - 356, /* GL_DEPTH_CLEAR_VALUE */ - 367, /* GL_DEPTH_FUNC */ + 505, /* GL_FOG */ + 527, /* GL_FOG_INDEX */ + 523, /* GL_FOG_DENSITY */ + 531, /* GL_FOG_START */ + 525, /* GL_FOG_END */ + 528, /* GL_FOG_MODE */ + 507, /* GL_FOG_COLOR */ + 369, /* GL_DEPTH_RANGE */ + 376, /* GL_DEPTH_TEST */ + 379, /* GL_DEPTH_WRITEMASK */ + 357, /* GL_DEPTH_CLEAR_VALUE */ + 368, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1508, /* GL_STENCIL_TEST */ - 1496, /* GL_STENCIL_CLEAR_VALUE */ - 1498, /* GL_STENCIL_FUNC */ - 1510, /* GL_STENCIL_VALUE_MASK */ - 1497, /* GL_STENCIL_FAIL */ - 1505, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1506, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1507, /* GL_STENCIL_REF */ - 1511, /* GL_STENCIL_WRITEMASK */ - 843, /* GL_MATRIX_MODE */ - 1012, /* GL_NORMALIZE */ - 1837, /* GL_VIEWPORT */ - 986, /* GL_MODELVIEW_STACK_DEPTH */ - 1250, /* GL_PROJECTION_STACK_DEPTH */ - 1718, /* GL_TEXTURE_STACK_DEPTH */ - 984, /* GL_MODELVIEW_MATRIX */ - 1249, /* GL_PROJECTION_MATRIX */ - 1701, /* GL_TEXTURE_MATRIX */ + 1513, /* GL_STENCIL_TEST */ + 1501, /* GL_STENCIL_CLEAR_VALUE */ + 1503, /* GL_STENCIL_FUNC */ + 1515, /* GL_STENCIL_VALUE_MASK */ + 1502, /* GL_STENCIL_FAIL */ + 1510, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1511, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1512, /* GL_STENCIL_REF */ + 1516, /* GL_STENCIL_WRITEMASK */ + 846, /* GL_MATRIX_MODE */ + 1015, /* GL_NORMALIZE */ + 1842, /* GL_VIEWPORT */ + 989, /* GL_MODELVIEW_STACK_DEPTH */ + 1253, /* GL_PROJECTION_STACK_DEPTH */ + 1723, /* GL_TEXTURE_STACK_DEPTH */ + 987, /* GL_MODELVIEW_MATRIX */ + 1252, /* GL_PROJECTION_MATRIX */ + 1706, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ 136, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 380, /* GL_DITHER */ + 381, /* GL_DITHER */ 78, /* GL_BLEND_DST */ 87, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 712, /* GL_LOGIC_OP_MODE */ - 630, /* GL_INDEX_LOGIC_OP */ + 715, /* GL_LOGIC_OP_MODE */ + 632, /* GL_INDEX_LOGIC_OP */ 191, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ - 391, /* GL_DRAW_BUFFER */ - 1284, /* GL_READ_BUFFER */ - 1395, /* GL_SCISSOR_BOX */ - 1396, /* GL_SCISSOR_TEST */ - 629, /* GL_INDEX_CLEAR_VALUE */ - 634, /* GL_INDEX_WRITEMASK */ + 392, /* GL_DRAW_BUFFER */ + 1289, /* GL_READ_BUFFER */ + 1400, /* GL_SCISSOR_BOX */ + 1401, /* GL_SCISSOR_TEST */ + 631, /* GL_INDEX_CLEAR_VALUE */ + 636, /* GL_INDEX_WRITEMASK */ 188, /* GL_COLOR_CLEAR_VALUE */ 230, /* GL_COLOR_WRITEMASK */ - 631, /* GL_INDEX_MODE */ - 1361, /* GL_RGBA_MODE */ - 390, /* GL_DOUBLEBUFFER */ - 1512, /* GL_STEREO */ - 1319, /* GL_RENDER_MODE */ - 1098, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1151, /* GL_POINT_SMOOTH_HINT */ - 696, /* GL_LINE_SMOOTH_HINT */ - 1168, /* GL_POLYGON_SMOOTH_HINT */ - 524, /* GL_FOG_HINT */ - 1682, /* GL_TEXTURE_GEN_S */ - 1683, /* GL_TEXTURE_GEN_T */ - 1681, /* GL_TEXTURE_GEN_R */ - 1680, /* GL_TEXTURE_GEN_Q */ - 1111, /* GL_PIXEL_MAP_I_TO_I */ - 1117, /* GL_PIXEL_MAP_S_TO_S */ - 1113, /* GL_PIXEL_MAP_I_TO_R */ - 1109, /* GL_PIXEL_MAP_I_TO_G */ - 1107, /* GL_PIXEL_MAP_I_TO_B */ - 1105, /* GL_PIXEL_MAP_I_TO_A */ - 1115, /* GL_PIXEL_MAP_R_TO_R */ - 1103, /* GL_PIXEL_MAP_G_TO_G */ - 1101, /* GL_PIXEL_MAP_B_TO_B */ - 1099, /* GL_PIXEL_MAP_A_TO_A */ - 1112, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1118, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1114, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1110, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1108, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1106, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1116, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1104, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1102, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1100, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1755, /* GL_UNPACK_SWAP_BYTES */ - 1750, /* GL_UNPACK_LSB_FIRST */ - 1751, /* GL_UNPACK_ROW_LENGTH */ - 1754, /* GL_UNPACK_SKIP_ROWS */ - 1753, /* GL_UNPACK_SKIP_PIXELS */ - 1748, /* GL_UNPACK_ALIGNMENT */ - 1086, /* GL_PACK_SWAP_BYTES */ - 1081, /* GL_PACK_LSB_FIRST */ - 1082, /* GL_PACK_ROW_LENGTH */ - 1085, /* GL_PACK_SKIP_ROWS */ - 1084, /* GL_PACK_SKIP_PIXELS */ - 1078, /* GL_PACK_ALIGNMENT */ - 790, /* GL_MAP_COLOR */ - 795, /* GL_MAP_STENCIL */ - 633, /* GL_INDEX_SHIFT */ - 632, /* GL_INDEX_OFFSET */ - 1297, /* GL_RED_SCALE */ - 1295, /* GL_RED_BIAS */ - 1855, /* GL_ZOOM_X */ - 1856, /* GL_ZOOM_Y */ - 594, /* GL_GREEN_SCALE */ - 592, /* GL_GREEN_BIAS */ + 633, /* GL_INDEX_MODE */ + 1366, /* GL_RGBA_MODE */ + 391, /* GL_DOUBLEBUFFER */ + 1517, /* GL_STEREO */ + 1324, /* GL_RENDER_MODE */ + 1101, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1154, /* GL_POINT_SMOOTH_HINT */ + 699, /* GL_LINE_SMOOTH_HINT */ + 1171, /* GL_POLYGON_SMOOTH_HINT */ + 526, /* GL_FOG_HINT */ + 1687, /* GL_TEXTURE_GEN_S */ + 1688, /* GL_TEXTURE_GEN_T */ + 1686, /* GL_TEXTURE_GEN_R */ + 1685, /* GL_TEXTURE_GEN_Q */ + 1114, /* GL_PIXEL_MAP_I_TO_I */ + 1120, /* GL_PIXEL_MAP_S_TO_S */ + 1116, /* GL_PIXEL_MAP_I_TO_R */ + 1112, /* GL_PIXEL_MAP_I_TO_G */ + 1110, /* GL_PIXEL_MAP_I_TO_B */ + 1108, /* GL_PIXEL_MAP_I_TO_A */ + 1118, /* GL_PIXEL_MAP_R_TO_R */ + 1106, /* GL_PIXEL_MAP_G_TO_G */ + 1104, /* GL_PIXEL_MAP_B_TO_B */ + 1102, /* GL_PIXEL_MAP_A_TO_A */ + 1115, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1121, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1117, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1113, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1111, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1109, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1119, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1107, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1105, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1103, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1760, /* GL_UNPACK_SWAP_BYTES */ + 1755, /* GL_UNPACK_LSB_FIRST */ + 1756, /* GL_UNPACK_ROW_LENGTH */ + 1759, /* GL_UNPACK_SKIP_ROWS */ + 1758, /* GL_UNPACK_SKIP_PIXELS */ + 1753, /* GL_UNPACK_ALIGNMENT */ + 1089, /* GL_PACK_SWAP_BYTES */ + 1084, /* GL_PACK_LSB_FIRST */ + 1085, /* GL_PACK_ROW_LENGTH */ + 1088, /* GL_PACK_SKIP_ROWS */ + 1087, /* GL_PACK_SKIP_PIXELS */ + 1081, /* GL_PACK_ALIGNMENT */ + 793, /* GL_MAP_COLOR */ + 798, /* GL_MAP_STENCIL */ + 635, /* GL_INDEX_SHIFT */ + 634, /* GL_INDEX_OFFSET */ + 1302, /* GL_RED_SCALE */ + 1300, /* GL_RED_BIAS */ + 1860, /* GL_ZOOM_X */ + 1861, /* GL_ZOOM_Y */ + 596, /* GL_GREEN_SCALE */ + 594, /* GL_GREEN_BIAS */ 93, /* GL_BLUE_SCALE */ 91, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 369, /* GL_DEPTH_SCALE */ + 370, /* GL_DEPTH_SCALE */ 350, /* GL_DEPTH_BIAS */ - 869, /* GL_MAX_EVAL_ORDER */ - 873, /* GL_MAX_LIGHTS */ - 852, /* GL_MAX_CLIP_PLANES */ - 919, /* GL_MAX_TEXTURE_SIZE */ - 879, /* GL_MAX_PIXEL_MAP_TABLE */ - 848, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 876, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 877, /* GL_MAX_NAME_STACK_DEPTH */ - 905, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 920, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 934, /* GL_MAX_VIEWPORT_DIMS */ - 849, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1522, /* GL_SUBPIXEL_BITS */ - 628, /* GL_INDEX_BITS */ - 1296, /* GL_RED_BITS */ - 593, /* GL_GREEN_BITS */ + 872, /* GL_MAX_EVAL_ORDER */ + 876, /* GL_MAX_LIGHTS */ + 855, /* GL_MAX_CLIP_PLANES */ + 922, /* GL_MAX_TEXTURE_SIZE */ + 882, /* GL_MAX_PIXEL_MAP_TABLE */ + 851, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 879, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 880, /* GL_MAX_NAME_STACK_DEPTH */ + 908, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 923, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 937, /* GL_MAX_VIEWPORT_DIMS */ + 852, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1527, /* GL_SUBPIXEL_BITS */ + 630, /* GL_INDEX_BITS */ + 1301, /* GL_RED_BITS */ + 595, /* GL_GREEN_BITS */ 92, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ 351, /* GL_DEPTH_BITS */ - 1494, /* GL_STENCIL_BITS */ + 1499, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 1000, /* GL_NAME_STACK_DEPTH */ + 1003, /* GL_NAME_STACK_DEPTH */ 62, /* GL_AUTO_NORMAL */ - 736, /* GL_MAP1_COLOR_4 */ - 739, /* GL_MAP1_INDEX */ - 740, /* GL_MAP1_NORMAL */ - 741, /* GL_MAP1_TEXTURE_COORD_1 */ - 742, /* GL_MAP1_TEXTURE_COORD_2 */ - 743, /* GL_MAP1_TEXTURE_COORD_3 */ - 744, /* GL_MAP1_TEXTURE_COORD_4 */ - 745, /* GL_MAP1_VERTEX_3 */ - 746, /* GL_MAP1_VERTEX_4 */ - 763, /* GL_MAP2_COLOR_4 */ - 766, /* GL_MAP2_INDEX */ - 767, /* GL_MAP2_NORMAL */ - 768, /* GL_MAP2_TEXTURE_COORD_1 */ - 769, /* GL_MAP2_TEXTURE_COORD_2 */ - 770, /* GL_MAP2_TEXTURE_COORD_3 */ - 771, /* GL_MAP2_TEXTURE_COORD_4 */ - 772, /* GL_MAP2_VERTEX_3 */ - 773, /* GL_MAP2_VERTEX_4 */ - 737, /* GL_MAP1_GRID_DOMAIN */ - 738, /* GL_MAP1_GRID_SEGMENTS */ - 764, /* GL_MAP2_GRID_DOMAIN */ - 765, /* GL_MAP2_GRID_SEGMENTS */ - 1605, /* GL_TEXTURE_1D */ - 1607, /* GL_TEXTURE_2D */ - 478, /* GL_FEEDBACK_BUFFER_POINTER */ - 479, /* GL_FEEDBACK_BUFFER_SIZE */ - 480, /* GL_FEEDBACK_BUFFER_TYPE */ - 1405, /* GL_SELECTION_BUFFER_POINTER */ - 1406, /* GL_SELECTION_BUFFER_SIZE */ - 1723, /* GL_TEXTURE_WIDTH */ - 1687, /* GL_TEXTURE_HEIGHT */ - 1642, /* GL_TEXTURE_COMPONENTS */ - 1626, /* GL_TEXTURE_BORDER_COLOR */ - 1625, /* GL_TEXTURE_BORDER */ - 382, /* GL_DONT_CARE */ - 476, /* GL_FASTEST */ - 1008, /* GL_NICEST */ + 739, /* GL_MAP1_COLOR_4 */ + 742, /* GL_MAP1_INDEX */ + 743, /* GL_MAP1_NORMAL */ + 744, /* GL_MAP1_TEXTURE_COORD_1 */ + 745, /* GL_MAP1_TEXTURE_COORD_2 */ + 746, /* GL_MAP1_TEXTURE_COORD_3 */ + 747, /* GL_MAP1_TEXTURE_COORD_4 */ + 748, /* GL_MAP1_VERTEX_3 */ + 749, /* GL_MAP1_VERTEX_4 */ + 766, /* GL_MAP2_COLOR_4 */ + 769, /* GL_MAP2_INDEX */ + 770, /* GL_MAP2_NORMAL */ + 771, /* GL_MAP2_TEXTURE_COORD_1 */ + 772, /* GL_MAP2_TEXTURE_COORD_2 */ + 773, /* GL_MAP2_TEXTURE_COORD_3 */ + 774, /* GL_MAP2_TEXTURE_COORD_4 */ + 775, /* GL_MAP2_VERTEX_3 */ + 776, /* GL_MAP2_VERTEX_4 */ + 740, /* GL_MAP1_GRID_DOMAIN */ + 741, /* GL_MAP1_GRID_SEGMENTS */ + 767, /* GL_MAP2_GRID_DOMAIN */ + 768, /* GL_MAP2_GRID_SEGMENTS */ + 1610, /* GL_TEXTURE_1D */ + 1612, /* GL_TEXTURE_2D */ + 479, /* GL_FEEDBACK_BUFFER_POINTER */ + 480, /* GL_FEEDBACK_BUFFER_SIZE */ + 481, /* GL_FEEDBACK_BUFFER_TYPE */ + 1410, /* GL_SELECTION_BUFFER_POINTER */ + 1411, /* GL_SELECTION_BUFFER_SIZE */ + 1728, /* GL_TEXTURE_WIDTH */ + 1692, /* GL_TEXTURE_HEIGHT */ + 1647, /* GL_TEXTURE_COMPONENTS */ + 1631, /* GL_TEXTURE_BORDER_COLOR */ + 1630, /* GL_TEXTURE_BORDER */ + 383, /* GL_DONT_CARE */ + 477, /* GL_FASTEST */ + 1011, /* GL_NICEST */ 48, /* GL_AMBIENT */ - 379, /* GL_DIFFUSE */ - 1454, /* GL_SPECULAR */ - 1172, /* GL_POSITION */ - 1457, /* GL_SPOT_DIRECTION */ - 1458, /* GL_SPOT_EXPONENT */ - 1456, /* GL_SPOT_CUTOFF */ + 380, /* GL_DIFFUSE */ + 1459, /* GL_SPECULAR */ + 1175, /* GL_POSITION */ + 1462, /* GL_SPOT_DIRECTION */ + 1463, /* GL_SPOT_EXPONENT */ + 1461, /* GL_SPOT_CUTOFF */ 275, /* GL_CONSTANT_ATTENUATION */ - 686, /* GL_LINEAR_ATTENUATION */ - 1270, /* GL_QUADRATIC_ATTENUATION */ + 689, /* GL_LINEAR_ATTENUATION */ + 1274, /* GL_QUADRATIC_ATTENUATION */ 244, /* GL_COMPILE */ 245, /* GL_COMPILE_AND_EXECUTE */ 120, /* GL_BYTE */ - 1757, /* GL_UNSIGNED_BYTE */ - 1419, /* GL_SHORT */ - 1768, /* GL_UNSIGNED_SHORT */ - 636, /* GL_INT */ - 1760, /* GL_UNSIGNED_INT */ - 484, /* GL_FLOAT */ + 1762, /* GL_UNSIGNED_BYTE */ + 1424, /* GL_SHORT */ + 1773, /* GL_UNSIGNED_SHORT */ + 638, /* GL_INT */ + 1765, /* GL_UNSIGNED_INT */ + 486, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 389, /* GL_DOUBLE */ + 390, /* GL_DOUBLE */ 132, /* GL_CLEAR */ 50, /* GL_AND */ 52, /* GL_AND_REVERSE */ 299, /* GL_COPY */ 51, /* GL_AND_INVERTED */ - 1010, /* GL_NOOP */ - 1851, /* GL_XOR */ - 1073, /* GL_OR */ - 1011, /* GL_NOR */ - 466, /* GL_EQUIV */ - 663, /* GL_INVERT */ - 1076, /* GL_OR_REVERSE */ + 1013, /* GL_NOOP */ + 1856, /* GL_XOR */ + 1076, /* GL_OR */ + 1014, /* GL_NOR */ + 467, /* GL_EQUIV */ + 665, /* GL_INVERT */ + 1079, /* GL_OR_REVERSE */ 300, /* GL_COPY_INVERTED */ - 1075, /* GL_OR_INVERTED */ - 1001, /* GL_NAND */ - 1410, /* GL_SET */ - 463, /* GL_EMISSION */ - 1418, /* GL_SHININESS */ + 1078, /* GL_OR_INVERTED */ + 1004, /* GL_NAND */ + 1415, /* GL_SET */ + 464, /* GL_EMISSION */ + 1423, /* GL_SHININESS */ 49, /* GL_AMBIENT_AND_DIFFUSE */ 190, /* GL_COLOR_INDEXES */ - 951, /* GL_MODELVIEW */ - 1248, /* GL_PROJECTION */ - 1540, /* GL_TEXTURE */ + 954, /* GL_MODELVIEW */ + 1251, /* GL_PROJECTION */ + 1545, /* GL_TEXTURE */ 147, /* GL_COLOR */ 346, /* GL_DEPTH */ - 1480, /* GL_STENCIL */ + 1485, /* GL_STENCIL */ 189, /* GL_COLOR_INDEX */ - 1499, /* GL_STENCIL_INDEX */ - 357, /* GL_DEPTH_COMPONENT */ - 1292, /* GL_RED */ - 591, /* GL_GREEN */ + 1504, /* GL_STENCIL_INDEX */ + 358, /* GL_DEPTH_COMPONENT */ + 1297, /* GL_RED */ + 593, /* GL_GREEN */ 90, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1327, /* GL_RGB */ - 1346, /* GL_RGBA */ - 714, /* GL_LUMINANCE */ - 735, /* GL_LUMINANCE_ALPHA */ + 1332, /* GL_RGB */ + 1351, /* GL_RGBA */ + 717, /* GL_LUMINANCE */ + 738, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1128, /* GL_POINT */ - 684, /* GL_LINE */ - 481, /* GL_FILL */ - 1301, /* GL_RENDER */ - 477, /* GL_FEEDBACK */ - 1404, /* GL_SELECT */ - 483, /* GL_FLAT */ - 1429, /* GL_SMOOTH */ - 664, /* GL_KEEP */ - 1321, /* GL_REPLACE */ - 618, /* GL_INCR */ + 1131, /* GL_POINT */ + 687, /* GL_LINE */ + 482, /* GL_FILL */ + 1306, /* GL_RENDER */ + 478, /* GL_FEEDBACK */ + 1409, /* GL_SELECT */ + 485, /* GL_FLAT */ + 1434, /* GL_SMOOTH */ + 666, /* GL_KEEP */ + 1326, /* GL_REPLACE */ + 620, /* GL_INCR */ 342, /* GL_DECR */ - 1783, /* GL_VENDOR */ - 1318, /* GL_RENDERER */ - 1784, /* GL_VERSION */ - 470, /* GL_EXTENSIONS */ - 1369, /* GL_S */ - 1531, /* GL_T */ - 1281, /* GL_R */ - 1269, /* GL_Q */ - 987, /* GL_MODULATE */ + 1788, /* GL_VENDOR */ + 1323, /* GL_RENDERER */ + 1789, /* GL_VERSION */ + 471, /* GL_EXTENSIONS */ + 1374, /* GL_S */ + 1536, /* GL_T */ + 1286, /* GL_R */ + 1273, /* GL_Q */ + 990, /* GL_MODULATE */ 341, /* GL_DECAL */ - 1677, /* GL_TEXTURE_ENV_MODE */ - 1676, /* GL_TEXTURE_ENV_COLOR */ - 1675, /* GL_TEXTURE_ENV */ - 471, /* GL_EYE_LINEAR */ - 1034, /* GL_OBJECT_LINEAR */ - 1455, /* GL_SPHERE_MAP */ - 1679, /* GL_TEXTURE_GEN_MODE */ - 1036, /* GL_OBJECT_PLANE */ - 472, /* GL_EYE_PLANE */ - 1002, /* GL_NEAREST */ - 685, /* GL_LINEAR */ - 1006, /* GL_NEAREST_MIPMAP_NEAREST */ - 690, /* GL_LINEAR_MIPMAP_NEAREST */ - 1005, /* GL_NEAREST_MIPMAP_LINEAR */ - 689, /* GL_LINEAR_MIPMAP_LINEAR */ - 1700, /* GL_TEXTURE_MAG_FILTER */ - 1708, /* GL_TEXTURE_MIN_FILTER */ - 1725, /* GL_TEXTURE_WRAP_S */ - 1726, /* GL_TEXTURE_WRAP_T */ + 1682, /* GL_TEXTURE_ENV_MODE */ + 1681, /* GL_TEXTURE_ENV_COLOR */ + 1680, /* GL_TEXTURE_ENV */ + 472, /* GL_EYE_LINEAR */ + 1037, /* GL_OBJECT_LINEAR */ + 1460, /* GL_SPHERE_MAP */ + 1684, /* GL_TEXTURE_GEN_MODE */ + 1039, /* GL_OBJECT_PLANE */ + 473, /* GL_EYE_PLANE */ + 1005, /* GL_NEAREST */ + 688, /* GL_LINEAR */ + 1009, /* GL_NEAREST_MIPMAP_NEAREST */ + 693, /* GL_LINEAR_MIPMAP_NEAREST */ + 1008, /* GL_NEAREST_MIPMAP_LINEAR */ + 692, /* GL_LINEAR_MIPMAP_LINEAR */ + 1705, /* GL_TEXTURE_MAG_FILTER */ + 1713, /* GL_TEXTURE_MIN_FILTER */ + 1730, /* GL_TEXTURE_WRAP_S */ + 1731, /* GL_TEXTURE_WRAP_T */ 126, /* GL_CLAMP */ - 1320, /* GL_REPEAT */ - 1166, /* GL_POLYGON_OFFSET_UNITS */ - 1165, /* GL_POLYGON_OFFSET_POINT */ - 1164, /* GL_POLYGON_OFFSET_LINE */ - 1282, /* GL_R3_G3_B2 */ - 1780, /* GL_V2F */ - 1781, /* GL_V3F */ + 1325, /* GL_REPEAT */ + 1169, /* GL_POLYGON_OFFSET_UNITS */ + 1168, /* GL_POLYGON_OFFSET_POINT */ + 1167, /* GL_POLYGON_OFFSET_LINE */ + 1287, /* GL_R3_G3_B2 */ + 1785, /* GL_V2F */ + 1786, /* GL_V3F */ 123, /* GL_C4UB_V2F */ 124, /* GL_C4UB_V3F */ 121, /* GL_C3F_V3F */ - 999, /* GL_N3F_V3F */ + 1002, /* GL_N3F_V3F */ 122, /* GL_C4F_N3F_V3F */ - 1536, /* GL_T2F_V3F */ - 1538, /* GL_T4F_V4F */ - 1534, /* GL_T2F_C4UB_V3F */ - 1532, /* GL_T2F_C3F_V3F */ - 1535, /* GL_T2F_N3F_V3F */ - 1533, /* GL_T2F_C4F_N3F_V3F */ - 1537, /* GL_T4F_C4F_N3F_V4F */ + 1541, /* GL_T2F_V3F */ + 1543, /* GL_T4F_V4F */ + 1539, /* GL_T2F_C4UB_V3F */ + 1537, /* GL_T2F_C3F_V3F */ + 1540, /* GL_T2F_N3F_V3F */ + 1538, /* GL_T2F_C4F_N3F_V3F */ + 1542, /* GL_T4F_C4F_N3F_V4F */ 139, /* GL_CLIP_PLANE0 */ 140, /* GL_CLIP_PLANE1 */ 141, /* GL_CLIP_PLANE2 */ 142, /* GL_CLIP_PLANE3 */ 143, /* GL_CLIP_PLANE4 */ 144, /* GL_CLIP_PLANE5 */ - 669, /* GL_LIGHT0 */ - 670, /* GL_LIGHT1 */ - 671, /* GL_LIGHT2 */ - 672, /* GL_LIGHT3 */ - 673, /* GL_LIGHT4 */ - 674, /* GL_LIGHT5 */ - 675, /* GL_LIGHT6 */ - 676, /* GL_LIGHT7 */ - 595, /* GL_HINT_BIT */ + 672, /* GL_LIGHT0 */ + 673, /* GL_LIGHT1 */ + 674, /* GL_LIGHT2 */ + 675, /* GL_LIGHT3 */ + 676, /* GL_LIGHT4 */ + 677, /* GL_LIGHT5 */ + 678, /* GL_LIGHT6 */ + 679, /* GL_LIGHT7 */ + 597, /* GL_HINT_BIT */ 277, /* GL_CONSTANT_COLOR */ - 1047, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 1050, /* GL_ONE_MINUS_CONSTANT_COLOR */ 272, /* GL_CONSTANT_ALPHA */ - 1045, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1048, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ - 579, /* GL_FUNC_ADD */ - 935, /* GL_MIN */ - 845, /* GL_MAX */ + 581, /* GL_FUNC_ADD */ + 938, /* GL_MIN */ + 848, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ - 583, /* GL_FUNC_SUBTRACT */ - 581, /* GL_FUNC_REVERSE_SUBTRACT */ + 585, /* GL_FUNC_SUBTRACT */ + 583, /* GL_FUNC_REVERSE_SUBTRACT */ 280, /* GL_CONVOLUTION_1D */ 281, /* GL_CONVOLUTION_2D */ - 1407, /* GL_SEPARABLE_2D */ + 1412, /* GL_SEPARABLE_2D */ 284, /* GL_CONVOLUTION_BORDER_MODE */ 288, /* GL_CONVOLUTION_FILTER_SCALE */ 286, /* GL_CONVOLUTION_FILTER_BIAS */ - 1293, /* GL_REDUCE */ + 1298, /* GL_REDUCE */ 290, /* GL_CONVOLUTION_FORMAT */ 294, /* GL_CONVOLUTION_WIDTH */ 292, /* GL_CONVOLUTION_HEIGHT */ - 860, /* GL_MAX_CONVOLUTION_WIDTH */ - 858, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1205, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1201, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1196, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1192, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1203, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1199, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1194, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1190, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 596, /* GL_HISTOGRAM */ - 1253, /* GL_PROXY_HISTOGRAM */ - 612, /* GL_HISTOGRAM_WIDTH */ - 602, /* GL_HISTOGRAM_FORMAT */ - 608, /* GL_HISTOGRAM_RED_SIZE */ - 604, /* GL_HISTOGRAM_GREEN_SIZE */ - 599, /* GL_HISTOGRAM_BLUE_SIZE */ - 597, /* GL_HISTOGRAM_ALPHA_SIZE */ - 606, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 610, /* GL_HISTOGRAM_SINK */ - 936, /* GL_MINMAX */ - 938, /* GL_MINMAX_FORMAT */ - 940, /* GL_MINMAX_SINK */ - 1539, /* GL_TABLE_TOO_LARGE_EXT */ - 1759, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1770, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1772, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1765, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1761, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1163, /* GL_POLYGON_OFFSET_FILL */ - 1162, /* GL_POLYGON_OFFSET_FACTOR */ - 1161, /* GL_POLYGON_OFFSET_BIAS */ - 1324, /* GL_RESCALE_NORMAL */ + 863, /* GL_MAX_CONVOLUTION_WIDTH */ + 861, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1208, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1204, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1199, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1195, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1206, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1202, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1197, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1193, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 598, /* GL_HISTOGRAM */ + 1257, /* GL_PROXY_HISTOGRAM */ + 614, /* GL_HISTOGRAM_WIDTH */ + 604, /* GL_HISTOGRAM_FORMAT */ + 610, /* GL_HISTOGRAM_RED_SIZE */ + 606, /* GL_HISTOGRAM_GREEN_SIZE */ + 601, /* GL_HISTOGRAM_BLUE_SIZE */ + 599, /* GL_HISTOGRAM_ALPHA_SIZE */ + 608, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 612, /* GL_HISTOGRAM_SINK */ + 939, /* GL_MINMAX */ + 941, /* GL_MINMAX_FORMAT */ + 943, /* GL_MINMAX_SINK */ + 1544, /* GL_TABLE_TOO_LARGE_EXT */ + 1764, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1775, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1777, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1770, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1766, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1166, /* GL_POLYGON_OFFSET_FILL */ + 1165, /* GL_POLYGON_OFFSET_FACTOR */ + 1164, /* GL_POLYGON_OFFSET_BIAS */ + 1329, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 725, /* GL_LUMINANCE4 */ - 731, /* GL_LUMINANCE8 */ - 715, /* GL_LUMINANCE12 */ - 721, /* GL_LUMINANCE16 */ - 726, /* GL_LUMINANCE4_ALPHA4 */ - 729, /* GL_LUMINANCE6_ALPHA2 */ - 732, /* GL_LUMINANCE8_ALPHA8 */ - 718, /* GL_LUMINANCE12_ALPHA4 */ - 716, /* GL_LUMINANCE12_ALPHA12 */ - 722, /* GL_LUMINANCE16_ALPHA16 */ - 637, /* GL_INTENSITY */ - 642, /* GL_INTENSITY4 */ - 644, /* GL_INTENSITY8 */ - 638, /* GL_INTENSITY12 */ - 640, /* GL_INTENSITY16 */ - 1336, /* GL_RGB2_EXT */ - 1337, /* GL_RGB4 */ - 1340, /* GL_RGB5 */ - 1344, /* GL_RGB8 */ - 1328, /* GL_RGB10 */ - 1332, /* GL_RGB12 */ - 1334, /* GL_RGB16 */ - 1351, /* GL_RGBA2 */ - 1353, /* GL_RGBA4 */ - 1341, /* GL_RGB5_A1 */ - 1357, /* GL_RGBA8 */ - 1329, /* GL_RGB10_A2 */ - 1347, /* GL_RGBA12 */ - 1349, /* GL_RGBA16 */ - 1715, /* GL_TEXTURE_RED_SIZE */ - 1685, /* GL_TEXTURE_GREEN_SIZE */ - 1623, /* GL_TEXTURE_BLUE_SIZE */ - 1610, /* GL_TEXTURE_ALPHA_SIZE */ - 1698, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1689, /* GL_TEXTURE_INTENSITY_SIZE */ - 1322, /* GL_REPLACE_EXT */ - 1257, /* GL_PROXY_TEXTURE_1D */ - 1260, /* GL_PROXY_TEXTURE_2D */ - 1721, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1710, /* GL_TEXTURE_PRIORITY */ - 1717, /* GL_TEXTURE_RESIDENT */ - 1613, /* GL_TEXTURE_BINDING_1D */ - 1615, /* GL_TEXTURE_BINDING_2D */ - 1617, /* GL_TEXTURE_BINDING_3D */ - 1083, /* GL_PACK_SKIP_IMAGES */ - 1079, /* GL_PACK_IMAGE_HEIGHT */ - 1752, /* GL_UNPACK_SKIP_IMAGES */ - 1749, /* GL_UNPACK_IMAGE_HEIGHT */ - 1609, /* GL_TEXTURE_3D */ - 1263, /* GL_PROXY_TEXTURE_3D */ - 1672, /* GL_TEXTURE_DEPTH */ - 1724, /* GL_TEXTURE_WRAP_R */ - 846, /* GL_MAX_3D_TEXTURE_SIZE */ - 1785, /* GL_VERTEX_ARRAY */ - 1013, /* GL_NORMAL_ARRAY */ + 728, /* GL_LUMINANCE4 */ + 734, /* GL_LUMINANCE8 */ + 718, /* GL_LUMINANCE12 */ + 724, /* GL_LUMINANCE16 */ + 729, /* GL_LUMINANCE4_ALPHA4 */ + 732, /* GL_LUMINANCE6_ALPHA2 */ + 735, /* GL_LUMINANCE8_ALPHA8 */ + 721, /* GL_LUMINANCE12_ALPHA4 */ + 719, /* GL_LUMINANCE12_ALPHA12 */ + 725, /* GL_LUMINANCE16_ALPHA16 */ + 639, /* GL_INTENSITY */ + 644, /* GL_INTENSITY4 */ + 646, /* GL_INTENSITY8 */ + 640, /* GL_INTENSITY12 */ + 642, /* GL_INTENSITY16 */ + 1341, /* GL_RGB2_EXT */ + 1342, /* GL_RGB4 */ + 1345, /* GL_RGB5 */ + 1349, /* GL_RGB8 */ + 1333, /* GL_RGB10 */ + 1337, /* GL_RGB12 */ + 1339, /* GL_RGB16 */ + 1356, /* GL_RGBA2 */ + 1358, /* GL_RGBA4 */ + 1346, /* GL_RGB5_A1 */ + 1362, /* GL_RGBA8 */ + 1334, /* GL_RGB10_A2 */ + 1352, /* GL_RGBA12 */ + 1354, /* GL_RGBA16 */ + 1720, /* GL_TEXTURE_RED_SIZE */ + 1690, /* GL_TEXTURE_GREEN_SIZE */ + 1628, /* GL_TEXTURE_BLUE_SIZE */ + 1615, /* GL_TEXTURE_ALPHA_SIZE */ + 1703, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1694, /* GL_TEXTURE_INTENSITY_SIZE */ + 1327, /* GL_REPLACE_EXT */ + 1261, /* GL_PROXY_TEXTURE_1D */ + 1264, /* GL_PROXY_TEXTURE_2D */ + 1726, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1715, /* GL_TEXTURE_PRIORITY */ + 1722, /* GL_TEXTURE_RESIDENT */ + 1618, /* GL_TEXTURE_BINDING_1D */ + 1620, /* GL_TEXTURE_BINDING_2D */ + 1622, /* GL_TEXTURE_BINDING_3D */ + 1086, /* GL_PACK_SKIP_IMAGES */ + 1082, /* GL_PACK_IMAGE_HEIGHT */ + 1757, /* GL_UNPACK_SKIP_IMAGES */ + 1754, /* GL_UNPACK_IMAGE_HEIGHT */ + 1614, /* GL_TEXTURE_3D */ + 1267, /* GL_PROXY_TEXTURE_3D */ + 1677, /* GL_TEXTURE_DEPTH */ + 1729, /* GL_TEXTURE_WRAP_R */ + 849, /* GL_MAX_3D_TEXTURE_SIZE */ + 1790, /* GL_VERTEX_ARRAY */ + 1016, /* GL_NORMAL_ARRAY */ 148, /* GL_COLOR_ARRAY */ - 622, /* GL_INDEX_ARRAY */ - 1650, /* GL_TEXTURE_COORD_ARRAY */ - 455, /* GL_EDGE_FLAG_ARRAY */ - 1791, /* GL_VERTEX_ARRAY_SIZE */ - 1793, /* GL_VERTEX_ARRAY_TYPE */ - 1792, /* GL_VERTEX_ARRAY_STRIDE */ - 1018, /* GL_NORMAL_ARRAY_TYPE */ - 1017, /* GL_NORMAL_ARRAY_STRIDE */ + 624, /* GL_INDEX_ARRAY */ + 1655, /* GL_TEXTURE_COORD_ARRAY */ + 456, /* GL_EDGE_FLAG_ARRAY */ + 1796, /* GL_VERTEX_ARRAY_SIZE */ + 1798, /* GL_VERTEX_ARRAY_TYPE */ + 1797, /* GL_VERTEX_ARRAY_STRIDE */ + 1021, /* GL_NORMAL_ARRAY_TYPE */ + 1020, /* GL_NORMAL_ARRAY_STRIDE */ 152, /* GL_COLOR_ARRAY_SIZE */ 154, /* GL_COLOR_ARRAY_TYPE */ 153, /* GL_COLOR_ARRAY_STRIDE */ - 627, /* GL_INDEX_ARRAY_TYPE */ - 626, /* GL_INDEX_ARRAY_STRIDE */ - 1654, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1656, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1655, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 459, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1790, /* GL_VERTEX_ARRAY_POINTER */ - 1016, /* GL_NORMAL_ARRAY_POINTER */ + 629, /* GL_INDEX_ARRAY_TYPE */ + 628, /* GL_INDEX_ARRAY_STRIDE */ + 1659, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1661, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1660, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 460, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1795, /* GL_VERTEX_ARRAY_POINTER */ + 1019, /* GL_NORMAL_ARRAY_POINTER */ 151, /* GL_COLOR_ARRAY_POINTER */ - 625, /* GL_INDEX_ARRAY_POINTER */ - 1653, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 458, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 992, /* GL_MULTISAMPLE */ - 1381, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1383, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1388, /* GL_SAMPLE_COVERAGE */ - 1385, /* GL_SAMPLE_BUFFERS */ - 1376, /* GL_SAMPLES */ - 1392, /* GL_SAMPLE_COVERAGE_VALUE */ - 1390, /* GL_SAMPLE_COVERAGE_INVERT */ + 627, /* GL_INDEX_ARRAY_POINTER */ + 1658, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 459, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 995, /* GL_MULTISAMPLE */ + 1386, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1388, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1393, /* GL_SAMPLE_COVERAGE */ + 1390, /* GL_SAMPLE_BUFFERS */ + 1381, /* GL_SAMPLES */ + 1397, /* GL_SAMPLE_COVERAGE_VALUE */ + 1395, /* GL_SAMPLE_COVERAGE_INVERT */ 195, /* GL_COLOR_MATRIX */ 197, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 854, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1188, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1184, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1179, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1175, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1186, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1182, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1177, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1173, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1633, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1264, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1635, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 857, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1191, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1187, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1182, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1178, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1189, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1185, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1180, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1176, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1638, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1268, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1640, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 89, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 88, /* GL_BLEND_SRC_ALPHA */ 201, /* GL_COLOR_TABLE */ - 1198, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1181, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1252, /* GL_PROXY_COLOR_TABLE */ - 1256, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1255, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1201, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1184, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1256, /* GL_PROXY_COLOR_TABLE */ + 1260, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1259, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 225, /* GL_COLOR_TABLE_SCALE */ 205, /* GL_COLOR_TABLE_BIAS */ 210, /* GL_COLOR_TABLE_FORMAT */ @@ -4369,380 +4379,380 @@ static const unsigned reduced_enums[1347] = 216, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 868, /* GL_MAX_ELEMENTS_VERTICES */ - 867, /* GL_MAX_ELEMENTS_INDICES */ - 1688, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 871, /* GL_MAX_ELEMENTS_VERTICES */ + 870, /* GL_MAX_ELEMENTS_INDICES */ + 1693, /* GL_TEXTURE_INDEX_SIZE_EXT */ 145, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1145, /* GL_POINT_SIZE_MIN */ - 1141, /* GL_POINT_SIZE_MAX */ - 1135, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1131, /* GL_POINT_DISTANCE_ATTENUATION */ + 1148, /* GL_POINT_SIZE_MIN */ + 1144, /* GL_POINT_SIZE_MAX */ + 1138, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1134, /* GL_POINT_DISTANCE_ATTENUATION */ 127, /* GL_CLAMP_TO_BORDER */ 130, /* GL_CLAMP_TO_EDGE */ - 1709, /* GL_TEXTURE_MIN_LOD */ - 1707, /* GL_TEXTURE_MAX_LOD */ - 1612, /* GL_TEXTURE_BASE_LEVEL */ - 1706, /* GL_TEXTURE_MAX_LEVEL */ - 615, /* GL_IGNORE_BORDER_HP */ + 1714, /* GL_TEXTURE_MIN_LOD */ + 1712, /* GL_TEXTURE_MAX_LOD */ + 1617, /* GL_TEXTURE_BASE_LEVEL */ + 1711, /* GL_TEXTURE_MAX_LEVEL */ + 617, /* GL_IGNORE_BORDER_HP */ 276, /* GL_CONSTANT_BORDER_HP */ - 1323, /* GL_REPLICATE_BORDER_HP */ + 1328, /* GL_REPLICATE_BORDER_HP */ 282, /* GL_CONVOLUTION_BORDER_COLOR */ - 1042, /* GL_OCCLUSION_TEST_HP */ - 1043, /* GL_OCCLUSION_TEST_RESULT_HP */ - 687, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1627, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1629, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1631, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1632, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1630, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1628, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 850, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 851, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1208, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1210, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1207, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1209, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1696, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1697, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1695, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 585, /* GL_GENERATE_MIPMAP */ - 586, /* GL_GENERATE_MIPMAP_HINT */ - 527, /* GL_FOG_OFFSET_SGIX */ - 528, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1641, /* GL_TEXTURE_COMPARE_SGIX */ - 1640, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1692, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1684, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 358, /* GL_DEPTH_COMPONENT16 */ - 361, /* GL_DEPTH_COMPONENT24 */ - 364, /* GL_DEPTH_COMPONENT32 */ + 1045, /* GL_OCCLUSION_TEST_HP */ + 1046, /* GL_OCCLUSION_TEST_RESULT_HP */ + 690, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1632, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1634, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1636, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1637, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1635, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1633, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 853, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 854, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1211, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1213, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1210, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1212, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1701, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1702, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1700, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 587, /* GL_GENERATE_MIPMAP */ + 588, /* GL_GENERATE_MIPMAP_HINT */ + 529, /* GL_FOG_OFFSET_SGIX */ + 530, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1646, /* GL_TEXTURE_COMPARE_SGIX */ + 1645, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1697, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1689, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 359, /* GL_DEPTH_COMPONENT16 */ + 362, /* GL_DEPTH_COMPONENT24 */ + 365, /* GL_DEPTH_COMPONENT32 */ 306, /* GL_CULL_VERTEX_EXT */ 308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1848, /* GL_WRAP_BORDER_SUN */ - 1634, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 680, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1422, /* GL_SINGLE_COLOR */ - 1408, /* GL_SEPARATE_SPECULAR_COLOR */ - 1417, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 538, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - 539, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - 546, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - 541, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - 537, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - 536, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - 540, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - 547, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - 558, /* GL_FRAMEBUFFER_DEFAULT */ - 571, /* GL_FRAMEBUFFER_UNDEFINED */ - 371, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 621, /* GL_INDEX */ - 1758, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1773, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1774, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1771, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1769, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1766, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1764, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1704, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1705, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1703, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 943, /* GL_MIRRORED_REPEAT */ - 1364, /* GL_RGB_S3TC */ - 1339, /* GL_RGB4_S3TC */ - 1362, /* GL_RGBA_S3TC */ - 1356, /* GL_RGBA4_S3TC */ - 1360, /* GL_RGBA_DXT5_S3TC */ - 1354, /* GL_RGBA4_DXT5_S3TC */ + 1853, /* GL_WRAP_BORDER_SUN */ + 1639, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 683, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1427, /* GL_SINGLE_COLOR */ + 1413, /* GL_SEPARATE_SPECULAR_COLOR */ + 1422, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 540, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 541, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 548, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 543, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 539, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 538, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 542, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 549, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 560, /* GL_FRAMEBUFFER_DEFAULT */ + 573, /* GL_FRAMEBUFFER_UNDEFINED */ + 372, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 623, /* GL_INDEX */ + 1763, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1778, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1779, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1776, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1774, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1771, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1769, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1709, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1710, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1708, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 946, /* GL_MIRRORED_REPEAT */ + 1369, /* GL_RGB_S3TC */ + 1344, /* GL_RGB4_S3TC */ + 1367, /* GL_RGBA_S3TC */ + 1361, /* GL_RGBA4_S3TC */ + 1365, /* GL_RGBA_DXT5_S3TC */ + 1359, /* GL_RGBA4_DXT5_S3TC */ 264, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ 259, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ 260, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ 261, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1004, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1003, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 688, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 514, /* GL_FOG_COORDINATE_SOURCE */ - 506, /* GL_FOG_COORD */ - 530, /* GL_FRAGMENT_DEPTH */ + 1007, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 1006, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 691, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 516, /* GL_FOG_COORDINATE_SOURCE */ + 508, /* GL_FOG_COORD */ + 532, /* GL_FRAGMENT_DEPTH */ 312, /* GL_CURRENT_FOG_COORD */ - 513, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 512, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 511, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 508, /* GL_FOG_COORDINATE_ARRAY */ + 515, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 514, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 513, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 510, /* GL_FOG_COORDINATE_ARRAY */ 199, /* GL_COLOR_SUM */ 332, /* GL_CURRENT_SECONDARY_COLOR */ - 1401, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1403, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1402, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1400, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1397, /* GL_SECONDARY_COLOR_ARRAY */ + 1406, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1408, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1407, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1405, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1402, /* GL_SECONDARY_COLOR_ARRAY */ 330, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1541, /* GL_TEXTURE0 */ - 1543, /* GL_TEXTURE1 */ - 1565, /* GL_TEXTURE2 */ - 1587, /* GL_TEXTURE3 */ - 1593, /* GL_TEXTURE4 */ - 1595, /* GL_TEXTURE5 */ - 1597, /* GL_TEXTURE6 */ - 1599, /* GL_TEXTURE7 */ - 1601, /* GL_TEXTURE8 */ - 1603, /* GL_TEXTURE9 */ - 1544, /* GL_TEXTURE10 */ - 1546, /* GL_TEXTURE11 */ - 1548, /* GL_TEXTURE12 */ - 1550, /* GL_TEXTURE13 */ - 1552, /* GL_TEXTURE14 */ - 1554, /* GL_TEXTURE15 */ - 1556, /* GL_TEXTURE16 */ - 1558, /* GL_TEXTURE17 */ - 1560, /* GL_TEXTURE18 */ - 1562, /* GL_TEXTURE19 */ - 1566, /* GL_TEXTURE20 */ - 1568, /* GL_TEXTURE21 */ - 1570, /* GL_TEXTURE22 */ - 1572, /* GL_TEXTURE23 */ - 1574, /* GL_TEXTURE24 */ - 1576, /* GL_TEXTURE25 */ - 1578, /* GL_TEXTURE26 */ - 1580, /* GL_TEXTURE27 */ - 1582, /* GL_TEXTURE28 */ - 1584, /* GL_TEXTURE29 */ - 1588, /* GL_TEXTURE30 */ - 1590, /* GL_TEXTURE31 */ + 1546, /* GL_TEXTURE0 */ + 1548, /* GL_TEXTURE1 */ + 1570, /* GL_TEXTURE2 */ + 1592, /* GL_TEXTURE3 */ + 1598, /* GL_TEXTURE4 */ + 1600, /* GL_TEXTURE5 */ + 1602, /* GL_TEXTURE6 */ + 1604, /* GL_TEXTURE7 */ + 1606, /* GL_TEXTURE8 */ + 1608, /* GL_TEXTURE9 */ + 1549, /* GL_TEXTURE10 */ + 1551, /* GL_TEXTURE11 */ + 1553, /* GL_TEXTURE12 */ + 1555, /* GL_TEXTURE13 */ + 1557, /* GL_TEXTURE14 */ + 1559, /* GL_TEXTURE15 */ + 1561, /* GL_TEXTURE16 */ + 1563, /* GL_TEXTURE17 */ + 1565, /* GL_TEXTURE18 */ + 1567, /* GL_TEXTURE19 */ + 1571, /* GL_TEXTURE20 */ + 1573, /* GL_TEXTURE21 */ + 1575, /* GL_TEXTURE22 */ + 1577, /* GL_TEXTURE23 */ + 1579, /* GL_TEXTURE24 */ + 1581, /* GL_TEXTURE25 */ + 1583, /* GL_TEXTURE26 */ + 1585, /* GL_TEXTURE27 */ + 1587, /* GL_TEXTURE28 */ + 1589, /* GL_TEXTURE29 */ + 1593, /* GL_TEXTURE30 */ + 1595, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 133, /* GL_CLIENT_ACTIVE_TEXTURE */ - 921, /* GL_MAX_TEXTURE_UNITS */ - 1736, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1739, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1741, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1733, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1523, /* GL_SUBTRACT */ - 908, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 924, /* GL_MAX_TEXTURE_UNITS */ + 1741, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1744, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1746, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1738, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1528, /* GL_SUBTRACT */ + 911, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ 247, /* GL_COMPRESSED_ALPHA */ 251, /* GL_COMPRESSED_LUMINANCE */ 252, /* GL_COMPRESSED_LUMINANCE_ALPHA */ 249, /* GL_COMPRESSED_INTENSITY */ 255, /* GL_COMPRESSED_RGB */ 256, /* GL_COMPRESSED_RGBA */ - 1648, /* GL_TEXTURE_COMPRESSION_HINT */ - 1713, /* GL_TEXTURE_RECTANGLE_ARB */ - 1620, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1267, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 906, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 370, /* GL_DEPTH_STENCIL */ - 1762, /* GL_UNSIGNED_INT_24_8 */ - 917, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1702, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 918, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1678, /* GL_TEXTURE_FILTER_CONTROL */ - 1693, /* GL_TEXTURE_LOD_BIAS */ + 1653, /* GL_TEXTURE_COMPRESSION_HINT */ + 1718, /* GL_TEXTURE_RECTANGLE_ARB */ + 1625, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1271, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 909, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 371, /* GL_DEPTH_STENCIL */ + 1767, /* GL_UNSIGNED_INT_24_8 */ + 920, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1707, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 921, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1683, /* GL_TEXTURE_FILTER_CONTROL */ + 1698, /* GL_TEXTURE_LOD_BIAS */ 232, /* GL_COMBINE4 */ - 911, /* GL_MAX_SHININESS_NV */ - 912, /* GL_MAX_SPOT_EXPONENT_NV */ - 619, /* GL_INCR_WRAP */ + 914, /* GL_MAX_SHININESS_NV */ + 915, /* GL_MAX_SPOT_EXPONENT_NV */ + 621, /* GL_INCR_WRAP */ 343, /* GL_DECR_WRAP */ - 963, /* GL_MODELVIEW1_ARB */ - 1019, /* GL_NORMAL_MAP */ - 1298, /* GL_REFLECTION_MAP */ - 1657, /* GL_TEXTURE_CUBE_MAP */ - 1618, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1665, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1659, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1667, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1661, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1669, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1663, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1265, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 862, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 998, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 522, /* GL_FOG_DISTANCE_MODE_NV */ - 474, /* GL_EYE_RADIAL_NV */ - 473, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 966, /* GL_MODELVIEW1_ARB */ + 1022, /* GL_NORMAL_MAP */ + 1303, /* GL_REFLECTION_MAP */ + 1662, /* GL_TEXTURE_CUBE_MAP */ + 1623, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1670, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1664, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1672, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1666, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1674, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1668, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1269, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 865, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 1001, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 524, /* GL_FOG_DISTANCE_MODE_NV */ + 475, /* GL_EYE_RADIAL_NV */ + 474, /* GL_EYE_PLANE_ABSOLUTE_NV */ 231, /* GL_COMBINE */ 238, /* GL_COMBINE_RGB */ 233, /* GL_COMBINE_ALPHA */ - 1365, /* GL_RGB_SCALE */ + 1370, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 647, /* GL_INTERPOLATE */ + 649, /* GL_INTERPOLATE */ 271, /* GL_CONSTANT */ - 1214, /* GL_PRIMARY_COLOR */ - 1211, /* GL_PREVIOUS */ - 1437, /* GL_SOURCE0_RGB */ - 1443, /* GL_SOURCE1_RGB */ - 1449, /* GL_SOURCE2_RGB */ - 1453, /* GL_SOURCE3_RGB_NV */ - 1434, /* GL_SOURCE0_ALPHA */ - 1440, /* GL_SOURCE1_ALPHA */ - 1446, /* GL_SOURCE2_ALPHA */ - 1452, /* GL_SOURCE3_ALPHA_NV */ - 1056, /* GL_OPERAND0_RGB */ - 1062, /* GL_OPERAND1_RGB */ - 1068, /* GL_OPERAND2_RGB */ - 1072, /* GL_OPERAND3_RGB_NV */ - 1053, /* GL_OPERAND0_ALPHA */ - 1059, /* GL_OPERAND1_ALPHA */ - 1065, /* GL_OPERAND2_ALPHA */ - 1071, /* GL_OPERAND3_ALPHA_NV */ - 1786, /* GL_VERTEX_ARRAY_BINDING */ - 1711, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - 1712, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - 1852, /* GL_YCBCR_422_APPLE */ - 1775, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1777, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1720, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - 1514, /* GL_STORAGE_PRIVATE_APPLE */ - 1513, /* GL_STORAGE_CACHED_APPLE */ - 1515, /* GL_STORAGE_SHARED_APPLE */ - 1424, /* GL_SLICE_ACCUM_SUN */ - 1273, /* GL_QUAD_MESH_SUN */ - 1745, /* GL_TRIANGLE_MESH_SUN */ - 1825, /* GL_VERTEX_PROGRAM_ARB */ - 1836, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1812, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1818, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1820, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1822, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 1217, /* GL_PRIMARY_COLOR */ + 1214, /* GL_PREVIOUS */ + 1442, /* GL_SOURCE0_RGB */ + 1448, /* GL_SOURCE1_RGB */ + 1454, /* GL_SOURCE2_RGB */ + 1458, /* GL_SOURCE3_RGB_NV */ + 1439, /* GL_SOURCE0_ALPHA */ + 1445, /* GL_SOURCE1_ALPHA */ + 1451, /* GL_SOURCE2_ALPHA */ + 1457, /* GL_SOURCE3_ALPHA_NV */ + 1059, /* GL_OPERAND0_RGB */ + 1065, /* GL_OPERAND1_RGB */ + 1071, /* GL_OPERAND2_RGB */ + 1075, /* GL_OPERAND3_RGB_NV */ + 1056, /* GL_OPERAND0_ALPHA */ + 1062, /* GL_OPERAND1_ALPHA */ + 1068, /* GL_OPERAND2_ALPHA */ + 1074, /* GL_OPERAND3_ALPHA_NV */ + 1791, /* GL_VERTEX_ARRAY_BINDING */ + 1716, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + 1717, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + 1857, /* GL_YCBCR_422_APPLE */ + 1780, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1782, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1725, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + 1519, /* GL_STORAGE_PRIVATE_APPLE */ + 1518, /* GL_STORAGE_CACHED_APPLE */ + 1520, /* GL_STORAGE_SHARED_APPLE */ + 1429, /* GL_SLICE_ACCUM_SUN */ + 1278, /* GL_QUAD_MESH_SUN */ + 1750, /* GL_TRIANGLE_MESH_SUN */ + 1830, /* GL_VERTEX_PROGRAM_ARB */ + 1841, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1817, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1823, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1825, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1827, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ 334, /* GL_CURRENT_VERTEX_ATTRIB */ - 1227, /* GL_PROGRAM_LENGTH_ARB */ - 1241, /* GL_PROGRAM_STRING_ARB */ - 985, /* GL_MODELVIEW_PROJECTION_NV */ - 614, /* GL_IDENTITY_NV */ - 661, /* GL_INVERSE_NV */ - 1738, /* GL_TRANSPOSE_NV */ - 662, /* GL_INVERSE_TRANSPOSE_NV */ - 892, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 891, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 799, /* GL_MATRIX0_NV */ - 811, /* GL_MATRIX1_NV */ - 823, /* GL_MATRIX2_NV */ - 827, /* GL_MATRIX3_NV */ - 829, /* GL_MATRIX4_NV */ - 831, /* GL_MATRIX5_NV */ - 833, /* GL_MATRIX6_NV */ - 835, /* GL_MATRIX7_NV */ + 1230, /* GL_PROGRAM_LENGTH_ARB */ + 1244, /* GL_PROGRAM_STRING_ARB */ + 988, /* GL_MODELVIEW_PROJECTION_NV */ + 616, /* GL_IDENTITY_NV */ + 663, /* GL_INVERSE_NV */ + 1743, /* GL_TRANSPOSE_NV */ + 664, /* GL_INVERSE_TRANSPOSE_NV */ + 895, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 894, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 802, /* GL_MATRIX0_NV */ + 814, /* GL_MATRIX1_NV */ + 826, /* GL_MATRIX2_NV */ + 830, /* GL_MATRIX3_NV */ + 832, /* GL_MATRIX4_NV */ + 834, /* GL_MATRIX5_NV */ + 836, /* GL_MATRIX6_NV */ + 838, /* GL_MATRIX7_NV */ 318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 315, /* GL_CURRENT_MATRIX_ARB */ - 1828, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1831, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1239, /* GL_PROGRAM_PARAMETER_NV */ - 1816, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1243, /* GL_PROGRAM_TARGET_NV */ - 1240, /* GL_PROGRAM_RESIDENT_NV */ - 1730, /* GL_TRACK_MATRIX_NV */ - 1731, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1826, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1221, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 355, /* GL_DEPTH_CLAMP_NV */ - 1794, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1801, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1802, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1803, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1804, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1805, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1806, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1807, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1808, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1809, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1795, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1796, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1797, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1798, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1799, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1800, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 747, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 754, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 755, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 756, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 757, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 748, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 749, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 750, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 751, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 752, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 753, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 774, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 781, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 782, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 783, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 784, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1220, /* GL_PROGRAM_BINDING_ARB */ - 788, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 789, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 775, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 776, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 777, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 778, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 779, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 780, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1646, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1643, /* GL_TEXTURE_COMPRESSED */ - 1024, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 1833, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1836, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1242, /* GL_PROGRAM_PARAMETER_NV */ + 1821, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1246, /* GL_PROGRAM_TARGET_NV */ + 1243, /* GL_PROGRAM_RESIDENT_NV */ + 1735, /* GL_TRACK_MATRIX_NV */ + 1736, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1831, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1224, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 355, /* GL_DEPTH_CLAMP */ + 1799, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1806, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1807, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1808, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1809, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1810, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1811, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1812, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1813, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1814, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1800, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1801, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1802, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1803, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1804, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1805, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 750, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 757, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 759, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 760, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 761, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 762, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 763, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 764, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 765, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 751, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 752, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 753, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 754, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 755, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 756, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 777, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 784, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 786, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 787, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 788, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 789, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1223, /* GL_PROGRAM_BINDING_ARB */ + 791, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 792, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 778, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 779, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 780, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 781, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 782, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 783, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1651, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1648, /* GL_TEXTURE_COMPRESSED */ + 1027, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ 269, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 933, /* GL_MAX_VERTEX_UNITS_ARB */ + 936, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1847, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1824, /* GL_VERTEX_BLEND_ARB */ + 1852, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1829, /* GL_VERTEX_BLEND_ARB */ 336, /* GL_CURRENT_WEIGHT_ARB */ - 1846, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1845, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1844, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1843, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1840, /* GL_WEIGHT_ARRAY_ARB */ - 383, /* GL_DOT3_RGB */ - 384, /* GL_DOT3_RGBA */ + 1851, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1850, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1849, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1848, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1845, /* GL_WEIGHT_ARRAY_ARB */ + 384, /* GL_DOT3_RGB */ + 385, /* GL_DOT3_RGBA */ 263, /* GL_COMPRESSED_RGB_FXT1_3DFX */ 258, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 993, /* GL_MULTISAMPLE_3DFX */ - 1386, /* GL_SAMPLE_BUFFERS_3DFX */ - 1377, /* GL_SAMPLES_3DFX */ - 974, /* GL_MODELVIEW2_ARB */ - 977, /* GL_MODELVIEW3_ARB */ - 978, /* GL_MODELVIEW4_ARB */ - 979, /* GL_MODELVIEW5_ARB */ - 980, /* GL_MODELVIEW6_ARB */ - 981, /* GL_MODELVIEW7_ARB */ - 982, /* GL_MODELVIEW8_ARB */ - 983, /* GL_MODELVIEW9_ARB */ - 953, /* GL_MODELVIEW10_ARB */ - 954, /* GL_MODELVIEW11_ARB */ - 955, /* GL_MODELVIEW12_ARB */ - 956, /* GL_MODELVIEW13_ARB */ - 957, /* GL_MODELVIEW14_ARB */ - 958, /* GL_MODELVIEW15_ARB */ - 959, /* GL_MODELVIEW16_ARB */ - 960, /* GL_MODELVIEW17_ARB */ - 961, /* GL_MODELVIEW18_ARB */ - 962, /* GL_MODELVIEW19_ARB */ - 964, /* GL_MODELVIEW20_ARB */ - 965, /* GL_MODELVIEW21_ARB */ - 966, /* GL_MODELVIEW22_ARB */ - 967, /* GL_MODELVIEW23_ARB */ - 968, /* GL_MODELVIEW24_ARB */ - 969, /* GL_MODELVIEW25_ARB */ - 970, /* GL_MODELVIEW26_ARB */ - 971, /* GL_MODELVIEW27_ARB */ - 972, /* GL_MODELVIEW28_ARB */ - 973, /* GL_MODELVIEW29_ARB */ - 975, /* GL_MODELVIEW30_ARB */ - 976, /* GL_MODELVIEW31_ARB */ - 388, /* GL_DOT3_RGB_EXT */ - 386, /* GL_DOT3_RGBA_EXT */ - 947, /* GL_MIRROR_CLAMP_EXT */ - 950, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 988, /* GL_MODULATE_ADD_ATI */ - 989, /* GL_MODULATE_SIGNED_ADD_ATI */ - 990, /* GL_MODULATE_SUBTRACT_ATI */ - 1853, /* GL_YCBCR_MESA */ - 1080, /* GL_PACK_INVERT_MESA */ + 996, /* GL_MULTISAMPLE_3DFX */ + 1391, /* GL_SAMPLE_BUFFERS_3DFX */ + 1382, /* GL_SAMPLES_3DFX */ + 977, /* GL_MODELVIEW2_ARB */ + 980, /* GL_MODELVIEW3_ARB */ + 981, /* GL_MODELVIEW4_ARB */ + 982, /* GL_MODELVIEW5_ARB */ + 983, /* GL_MODELVIEW6_ARB */ + 984, /* GL_MODELVIEW7_ARB */ + 985, /* GL_MODELVIEW8_ARB */ + 986, /* GL_MODELVIEW9_ARB */ + 956, /* GL_MODELVIEW10_ARB */ + 957, /* GL_MODELVIEW11_ARB */ + 958, /* GL_MODELVIEW12_ARB */ + 959, /* GL_MODELVIEW13_ARB */ + 960, /* GL_MODELVIEW14_ARB */ + 961, /* GL_MODELVIEW15_ARB */ + 962, /* GL_MODELVIEW16_ARB */ + 963, /* GL_MODELVIEW17_ARB */ + 964, /* GL_MODELVIEW18_ARB */ + 965, /* GL_MODELVIEW19_ARB */ + 967, /* GL_MODELVIEW20_ARB */ + 968, /* GL_MODELVIEW21_ARB */ + 969, /* GL_MODELVIEW22_ARB */ + 970, /* GL_MODELVIEW23_ARB */ + 971, /* GL_MODELVIEW24_ARB */ + 972, /* GL_MODELVIEW25_ARB */ + 973, /* GL_MODELVIEW26_ARB */ + 974, /* GL_MODELVIEW27_ARB */ + 975, /* GL_MODELVIEW28_ARB */ + 976, /* GL_MODELVIEW29_ARB */ + 978, /* GL_MODELVIEW30_ARB */ + 979, /* GL_MODELVIEW31_ARB */ + 389, /* GL_DOT3_RGB_EXT */ + 387, /* GL_DOT3_RGBA_EXT */ + 950, /* GL_MIRROR_CLAMP_EXT */ + 953, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 991, /* GL_MODULATE_ADD_ATI */ + 992, /* GL_MODULATE_SIGNED_ADD_ATI */ + 993, /* GL_MODULATE_SUBTRACT_ATI */ + 1858, /* GL_YCBCR_MESA */ + 1083, /* GL_PACK_INVERT_MESA */ 339, /* GL_DEBUG_OBJECT_MESA */ 340, /* GL_DEBUG_PRINT_MESA */ 338, /* GL_DEBUG_ASSERT_MESA */ @@ -4752,292 +4762,292 @@ static const unsigned reduced_enums[1347] = 117, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ 115, /* GL_BUMP_NUM_TEX_UNITS_ATI */ 119, /* GL_BUMP_TEX_UNITS_ATI */ - 447, /* GL_DUDV_ATI */ - 446, /* GL_DU8DV8_ATI */ + 448, /* GL_DUDV_ATI */ + 447, /* GL_DU8DV8_ATI */ 114, /* GL_BUMP_ENVMAP_ATI */ 118, /* GL_BUMP_TARGET_ATI */ - 1485, /* GL_STENCIL_BACK_FUNC */ - 1483, /* GL_STENCIL_BACK_FAIL */ - 1487, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1489, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 531, /* GL_FRAGMENT_PROGRAM_ARB */ - 1218, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1246, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1245, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1230, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1236, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1235, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 881, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 904, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 903, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 894, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 900, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 899, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 864, /* GL_MAX_DRAW_BUFFERS */ - 392, /* GL_DRAW_BUFFER0 */ - 395, /* GL_DRAW_BUFFER1 */ - 416, /* GL_DRAW_BUFFER2 */ - 419, /* GL_DRAW_BUFFER3 */ - 422, /* GL_DRAW_BUFFER4 */ - 425, /* GL_DRAW_BUFFER5 */ - 428, /* GL_DRAW_BUFFER6 */ - 431, /* GL_DRAW_BUFFER7 */ - 434, /* GL_DRAW_BUFFER8 */ - 437, /* GL_DRAW_BUFFER9 */ - 396, /* GL_DRAW_BUFFER10 */ - 399, /* GL_DRAW_BUFFER11 */ - 402, /* GL_DRAW_BUFFER12 */ - 405, /* GL_DRAW_BUFFER13 */ - 408, /* GL_DRAW_BUFFER14 */ - 411, /* GL_DRAW_BUFFER15 */ + 1490, /* GL_STENCIL_BACK_FUNC */ + 1488, /* GL_STENCIL_BACK_FAIL */ + 1492, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1494, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 533, /* GL_FRAGMENT_PROGRAM_ARB */ + 1221, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1249, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1248, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1233, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1239, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1238, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 884, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 907, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 906, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 897, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 903, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 902, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 867, /* GL_MAX_DRAW_BUFFERS */ + 393, /* GL_DRAW_BUFFER0 */ + 396, /* GL_DRAW_BUFFER1 */ + 417, /* GL_DRAW_BUFFER2 */ + 420, /* GL_DRAW_BUFFER3 */ + 423, /* GL_DRAW_BUFFER4 */ + 426, /* GL_DRAW_BUFFER5 */ + 429, /* GL_DRAW_BUFFER6 */ + 432, /* GL_DRAW_BUFFER7 */ + 435, /* GL_DRAW_BUFFER8 */ + 438, /* GL_DRAW_BUFFER9 */ + 397, /* GL_DRAW_BUFFER10 */ + 400, /* GL_DRAW_BUFFER11 */ + 403, /* GL_DRAW_BUFFER12 */ + 406, /* GL_DRAW_BUFFER13 */ + 409, /* GL_DRAW_BUFFER14 */ + 412, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 844, /* GL_MATRIX_PALETTE_ARB */ - 875, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 878, /* GL_MAX_PALETTE_MATRICES_ARB */ + 847, /* GL_MATRIX_PALETTE_ARB */ + 878, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 881, /* GL_MAX_PALETTE_MATRICES_ARB */ 321, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 838, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 841, /* GL_MATRIX_INDEX_ARRAY_ARB */ 316, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 840, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 842, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 841, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 839, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1673, /* GL_TEXTURE_DEPTH_SIZE */ - 376, /* GL_DEPTH_TEXTURE_MODE */ - 1638, /* GL_TEXTURE_COMPARE_MODE */ - 1636, /* GL_TEXTURE_COMPARE_FUNC */ + 843, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 845, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 844, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 842, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1678, /* GL_TEXTURE_DEPTH_SIZE */ + 377, /* GL_DEPTH_TEXTURE_MODE */ + 1643, /* GL_TEXTURE_COMPARE_MODE */ + 1641, /* GL_TEXTURE_COMPARE_FUNC */ 242, /* GL_COMPARE_R_TO_TEXTURE */ - 1152, /* GL_POINT_SPRITE */ + 1155, /* GL_POINT_SPRITE */ 296, /* GL_COORD_REPLACE */ - 1156, /* GL_POINT_SPRITE_R_MODE_NV */ - 1275, /* GL_QUERY_COUNTER_BITS */ + 1159, /* GL_POINT_SPRITE_R_MODE_NV */ + 1280, /* GL_QUERY_COUNTER_BITS */ 323, /* GL_CURRENT_QUERY */ - 1277, /* GL_QUERY_RESULT */ - 1279, /* GL_QUERY_RESULT_AVAILABLE */ - 927, /* GL_MAX_VERTEX_ATTRIBS */ - 1814, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 374, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 373, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 913, /* GL_MAX_TEXTURE_COORDS */ - 915, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1223, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1225, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1224, /* GL_PROGRAM_FORMAT_ARB */ - 1722, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 1282, /* GL_QUERY_RESULT */ + 1284, /* GL_QUERY_RESULT_AVAILABLE */ + 930, /* GL_MAX_VERTEX_ATTRIBS */ + 1819, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 375, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 374, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 916, /* GL_MAX_TEXTURE_COORDS */ + 918, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1226, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1228, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1227, /* GL_PROGRAM_FORMAT_ARB */ + 1727, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ 353, /* GL_DEPTH_BOUNDS_TEST_EXT */ 352, /* GL_DEPTH_BOUNDS_EXT */ 53, /* GL_ARRAY_BUFFER */ - 460, /* GL_ELEMENT_ARRAY_BUFFER */ + 461, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ - 461, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1788, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1014, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 462, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1793, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1017, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 149, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 623, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1651, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 456, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1398, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 509, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1841, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1810, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1226, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 887, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1232, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 896, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1244, /* GL_PROGRAM_TEMPORARIES_ARB */ - 902, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1234, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 898, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1238, /* GL_PROGRAM_PARAMETERS_ARB */ - 901, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1233, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 897, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1219, /* GL_PROGRAM_ATTRIBS_ARB */ - 882, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1231, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 895, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1217, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 880, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1229, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 893, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 888, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 884, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1247, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1735, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1288, /* GL_READ_ONLY */ - 1849, /* GL_WRITE_ONLY */ - 1290, /* GL_READ_WRITE */ + 625, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1656, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 457, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1403, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 511, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1846, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1815, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1229, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 890, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1235, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 899, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1247, /* GL_PROGRAM_TEMPORARIES_ARB */ + 905, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1237, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 901, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1241, /* GL_PROGRAM_PARAMETERS_ARB */ + 904, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1236, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 900, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1222, /* GL_PROGRAM_ATTRIBS_ARB */ + 885, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1234, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 898, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1220, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 883, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1232, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 896, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 891, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 887, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1250, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1740, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1293, /* GL_READ_ONLY */ + 1854, /* GL_WRITE_ONLY */ + 1295, /* GL_READ_WRITE */ 102, /* GL_BUFFER_ACCESS */ 105, /* GL_BUFFER_MAPPED */ 107, /* GL_BUFFER_MAP_POINTER */ - 1729, /* GL_TIME_ELAPSED_EXT */ - 798, /* GL_MATRIX0_ARB */ - 810, /* GL_MATRIX1_ARB */ - 822, /* GL_MATRIX2_ARB */ - 826, /* GL_MATRIX3_ARB */ - 828, /* GL_MATRIX4_ARB */ - 830, /* GL_MATRIX5_ARB */ - 832, /* GL_MATRIX6_ARB */ - 834, /* GL_MATRIX7_ARB */ - 836, /* GL_MATRIX8_ARB */ - 837, /* GL_MATRIX9_ARB */ - 800, /* GL_MATRIX10_ARB */ - 801, /* GL_MATRIX11_ARB */ - 802, /* GL_MATRIX12_ARB */ - 803, /* GL_MATRIX13_ARB */ - 804, /* GL_MATRIX14_ARB */ - 805, /* GL_MATRIX15_ARB */ - 806, /* GL_MATRIX16_ARB */ - 807, /* GL_MATRIX17_ARB */ - 808, /* GL_MATRIX18_ARB */ - 809, /* GL_MATRIX19_ARB */ - 812, /* GL_MATRIX20_ARB */ - 813, /* GL_MATRIX21_ARB */ - 814, /* GL_MATRIX22_ARB */ - 815, /* GL_MATRIX23_ARB */ - 816, /* GL_MATRIX24_ARB */ - 817, /* GL_MATRIX25_ARB */ - 818, /* GL_MATRIX26_ARB */ - 819, /* GL_MATRIX27_ARB */ - 820, /* GL_MATRIX28_ARB */ - 821, /* GL_MATRIX29_ARB */ - 824, /* GL_MATRIX30_ARB */ - 825, /* GL_MATRIX31_ARB */ - 1518, /* GL_STREAM_DRAW */ - 1520, /* GL_STREAM_READ */ - 1516, /* GL_STREAM_COPY */ - 1476, /* GL_STATIC_DRAW */ - 1478, /* GL_STATIC_READ */ - 1474, /* GL_STATIC_COPY */ - 450, /* GL_DYNAMIC_DRAW */ - 452, /* GL_DYNAMIC_READ */ - 448, /* GL_DYNAMIC_COPY */ - 1120, /* GL_PIXEL_PACK_BUFFER */ - 1124, /* GL_PIXEL_UNPACK_BUFFER */ - 1121, /* GL_PIXEL_PACK_BUFFER_BINDING */ - 1125, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 1734, /* GL_TIME_ELAPSED_EXT */ + 801, /* GL_MATRIX0_ARB */ + 813, /* GL_MATRIX1_ARB */ + 825, /* GL_MATRIX2_ARB */ + 829, /* GL_MATRIX3_ARB */ + 831, /* GL_MATRIX4_ARB */ + 833, /* GL_MATRIX5_ARB */ + 835, /* GL_MATRIX6_ARB */ + 837, /* GL_MATRIX7_ARB */ + 839, /* GL_MATRIX8_ARB */ + 840, /* GL_MATRIX9_ARB */ + 803, /* GL_MATRIX10_ARB */ + 804, /* GL_MATRIX11_ARB */ + 805, /* GL_MATRIX12_ARB */ + 806, /* GL_MATRIX13_ARB */ + 807, /* GL_MATRIX14_ARB */ + 808, /* GL_MATRIX15_ARB */ + 809, /* GL_MATRIX16_ARB */ + 810, /* GL_MATRIX17_ARB */ + 811, /* GL_MATRIX18_ARB */ + 812, /* GL_MATRIX19_ARB */ + 815, /* GL_MATRIX20_ARB */ + 816, /* GL_MATRIX21_ARB */ + 817, /* GL_MATRIX22_ARB */ + 818, /* GL_MATRIX23_ARB */ + 819, /* GL_MATRIX24_ARB */ + 820, /* GL_MATRIX25_ARB */ + 821, /* GL_MATRIX26_ARB */ + 822, /* GL_MATRIX27_ARB */ + 823, /* GL_MATRIX28_ARB */ + 824, /* GL_MATRIX29_ARB */ + 827, /* GL_MATRIX30_ARB */ + 828, /* GL_MATRIX31_ARB */ + 1523, /* GL_STREAM_DRAW */ + 1525, /* GL_STREAM_READ */ + 1521, /* GL_STREAM_COPY */ + 1481, /* GL_STATIC_DRAW */ + 1483, /* GL_STATIC_READ */ + 1479, /* GL_STATIC_COPY */ + 451, /* GL_DYNAMIC_DRAW */ + 453, /* GL_DYNAMIC_READ */ + 449, /* GL_DYNAMIC_COPY */ + 1123, /* GL_PIXEL_PACK_BUFFER */ + 1127, /* GL_PIXEL_UNPACK_BUFFER */ + 1124, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1128, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ 347, /* GL_DEPTH24_STENCIL8 */ - 1719, /* GL_TEXTURE_STENCIL_SIZE */ - 1671, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - 883, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 886, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 890, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 889, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 847, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1509, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1724, /* GL_TEXTURE_STENCIL_SIZE */ + 1676, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + 886, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 889, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 893, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 892, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 850, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1514, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 948, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1379, /* GL_SAMPLES_PASSED */ + 951, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1384, /* GL_SAMPLES_PASSED */ 109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ 104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */ - 532, /* GL_FRAGMENT_SHADER */ - 1834, /* GL_VERTEX_SHADER */ - 1237, /* GL_PROGRAM_OBJECT_ARB */ - 1411, /* GL_SHADER_OBJECT_ARB */ - 871, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 931, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 925, /* GL_MAX_VARYING_FLOATS */ - 929, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 856, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1040, /* GL_OBJECT_TYPE_ARB */ - 1413, /* GL_SHADER_TYPE */ - 497, /* GL_FLOAT_VEC2 */ - 499, /* GL_FLOAT_VEC3 */ - 501, /* GL_FLOAT_VEC4 */ - 650, /* GL_INT_VEC2 */ - 652, /* GL_INT_VEC3 */ - 654, /* GL_INT_VEC4 */ + 534, /* GL_FRAGMENT_SHADER */ + 1839, /* GL_VERTEX_SHADER */ + 1240, /* GL_PROGRAM_OBJECT_ARB */ + 1416, /* GL_SHADER_OBJECT_ARB */ + 874, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 934, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 928, /* GL_MAX_VARYING_FLOATS */ + 932, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 859, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1043, /* GL_OBJECT_TYPE_ARB */ + 1418, /* GL_SHADER_TYPE */ + 499, /* GL_FLOAT_VEC2 */ + 501, /* GL_FLOAT_VEC3 */ + 503, /* GL_FLOAT_VEC4 */ + 652, /* GL_INT_VEC2 */ + 654, /* GL_INT_VEC3 */ + 656, /* GL_INT_VEC4 */ 94, /* GL_BOOL */ 96, /* GL_BOOL_VEC2 */ 98, /* GL_BOOL_VEC3 */ 100, /* GL_BOOL_VEC4 */ - 485, /* GL_FLOAT_MAT2 */ - 489, /* GL_FLOAT_MAT3 */ - 493, /* GL_FLOAT_MAT4 */ - 1370, /* GL_SAMPLER_1D */ - 1372, /* GL_SAMPLER_2D */ - 1374, /* GL_SAMPLER_3D */ - 1375, /* GL_SAMPLER_CUBE */ - 1371, /* GL_SAMPLER_1D_SHADOW */ - 1373, /* GL_SAMPLER_2D_SHADOW */ - 487, /* GL_FLOAT_MAT2x3 */ - 488, /* GL_FLOAT_MAT2x4 */ - 491, /* GL_FLOAT_MAT3x2 */ - 492, /* GL_FLOAT_MAT3x4 */ - 495, /* GL_FLOAT_MAT4x2 */ - 496, /* GL_FLOAT_MAT4x3 */ + 487, /* GL_FLOAT_MAT2 */ + 491, /* GL_FLOAT_MAT3 */ + 495, /* GL_FLOAT_MAT4 */ + 1375, /* GL_SAMPLER_1D */ + 1377, /* GL_SAMPLER_2D */ + 1379, /* GL_SAMPLER_3D */ + 1380, /* GL_SAMPLER_CUBE */ + 1376, /* GL_SAMPLER_1D_SHADOW */ + 1378, /* GL_SAMPLER_2D_SHADOW */ + 489, /* GL_FLOAT_MAT2x3 */ + 490, /* GL_FLOAT_MAT2x4 */ + 493, /* GL_FLOAT_MAT3x2 */ + 494, /* GL_FLOAT_MAT3x4 */ + 497, /* GL_FLOAT_MAT4x2 */ + 498, /* GL_FLOAT_MAT4x3 */ 345, /* GL_DELETE_STATUS */ 246, /* GL_COMPILE_STATUS */ - 705, /* GL_LINK_STATUS */ - 1782, /* GL_VALIDATE_STATUS */ - 635, /* GL_INFO_LOG_LENGTH */ + 708, /* GL_LINK_STATUS */ + 1787, /* GL_VALIDATE_STATUS */ + 637, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1412, /* GL_SHADER_SOURCE_LENGTH */ + 1417, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 534, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1415, /* GL_SHADING_LANGUAGE_VERSION */ + 536, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1420, /* GL_SHADING_LANGUAGE_VERSION */ 322, /* GL_CURRENT_PROGRAM */ - 1089, /* GL_PALETTE4_RGB8_OES */ - 1091, /* GL_PALETTE4_RGBA8_OES */ - 1087, /* GL_PALETTE4_R5_G6_B5_OES */ - 1090, /* GL_PALETTE4_RGBA4_OES */ - 1088, /* GL_PALETTE4_RGB5_A1_OES */ - 1094, /* GL_PALETTE8_RGB8_OES */ - 1096, /* GL_PALETTE8_RGBA8_OES */ - 1092, /* GL_PALETTE8_R5_G6_B5_OES */ - 1095, /* GL_PALETTE8_RGBA4_OES */ - 1093, /* GL_PALETTE8_RGB5_A1_OES */ - 617, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 616, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1767, /* GL_UNSIGNED_NORMALIZED */ - 1606, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1258, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1608, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1261, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1614, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1616, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 1468, /* GL_SRGB */ - 1469, /* GL_SRGB8 */ - 1471, /* GL_SRGB_ALPHA */ - 1470, /* GL_SRGB8_ALPHA8 */ - 1428, /* GL_SLUMINANCE_ALPHA */ - 1427, /* GL_SLUMINANCE8_ALPHA8 */ - 1425, /* GL_SLUMINANCE */ - 1426, /* GL_SLUMINANCE8 */ + 1092, /* GL_PALETTE4_RGB8_OES */ + 1094, /* GL_PALETTE4_RGBA8_OES */ + 1090, /* GL_PALETTE4_R5_G6_B5_OES */ + 1093, /* GL_PALETTE4_RGBA4_OES */ + 1091, /* GL_PALETTE4_RGB5_A1_OES */ + 1097, /* GL_PALETTE8_RGB8_OES */ + 1099, /* GL_PALETTE8_RGBA8_OES */ + 1095, /* GL_PALETTE8_R5_G6_B5_OES */ + 1098, /* GL_PALETTE8_RGBA4_OES */ + 1096, /* GL_PALETTE8_RGB5_A1_OES */ + 619, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 618, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1772, /* GL_UNSIGNED_NORMALIZED */ + 1611, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1262, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1613, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1265, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1619, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1621, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1473, /* GL_SRGB */ + 1474, /* GL_SRGB8 */ + 1476, /* GL_SRGB_ALPHA */ + 1475, /* GL_SRGB8_ALPHA8 */ + 1433, /* GL_SLUMINANCE_ALPHA */ + 1432, /* GL_SLUMINANCE8_ALPHA8 */ + 1430, /* GL_SLUMINANCE */ + 1431, /* GL_SLUMINANCE8 */ 267, /* GL_COMPRESSED_SRGB */ 268, /* GL_COMPRESSED_SRGB_ALPHA */ 265, /* GL_COMPRESSED_SLUMINANCE */ 266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1154, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 713, /* GL_LOWER_LEFT */ - 1779, /* GL_UPPER_LEFT */ - 1491, /* GL_STENCIL_BACK_REF */ - 1492, /* GL_STENCIL_BACK_VALUE_MASK */ - 1493, /* GL_STENCIL_BACK_WRITEMASK */ - 441, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1304, /* GL_RENDERBUFFER_BINDING_EXT */ - 1285, /* GL_READ_FRAMEBUFFER */ - 440, /* GL_DRAW_FRAMEBUFFER */ - 1286, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 1314, /* GL_RENDERBUFFER_SAMPLES */ - 544, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - 542, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - 553, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - 549, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - 551, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - 556, /* GL_FRAMEBUFFER_COMPLETE */ - 560, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - 566, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - 564, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 562, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 565, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 563, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 569, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 572, /* GL_FRAMEBUFFER_UNSUPPORTED */ - 570, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 853, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 1157, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 716, /* GL_LOWER_LEFT */ + 1784, /* GL_UPPER_LEFT */ + 1496, /* GL_STENCIL_BACK_REF */ + 1497, /* GL_STENCIL_BACK_VALUE_MASK */ + 1498, /* GL_STENCIL_BACK_WRITEMASK */ + 442, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + 1309, /* GL_RENDERBUFFER_BINDING_EXT */ + 1290, /* GL_READ_FRAMEBUFFER */ + 441, /* GL_DRAW_FRAMEBUFFER */ + 1291, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 1319, /* GL_RENDERBUFFER_SAMPLES */ + 546, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 544, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 555, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 551, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 553, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 558, /* GL_FRAMEBUFFER_COMPLETE */ + 562, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 568, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 566, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 564, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 567, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 565, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 571, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 574, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 572, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 856, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ 155, /* GL_COLOR_ATTACHMENT0 */ 157, /* GL_COLOR_ATTACHMENT1 */ 171, /* GL_COLOR_ATTACHMENT2 */ @@ -5055,56 +5065,56 @@ static const unsigned reduced_enums[1347] = 166, /* GL_COLOR_ATTACHMENT14 */ 168, /* GL_COLOR_ATTACHMENT15 */ 348, /* GL_DEPTH_ATTACHMENT */ - 1481, /* GL_STENCIL_ATTACHMENT */ - 535, /* GL_FRAMEBUFFER */ - 1302, /* GL_RENDERBUFFER */ - 1316, /* GL_RENDERBUFFER_WIDTH */ - 1309, /* GL_RENDERBUFFER_HEIGHT */ - 1311, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1504, /* GL_STENCIL_INDEX_EXT */ - 1501, /* GL_STENCIL_INDEX1_EXT */ - 1502, /* GL_STENCIL_INDEX4_EXT */ - 1503, /* GL_STENCIL_INDEX8_EXT */ - 1500, /* GL_STENCIL_INDEX16_EXT */ - 1313, /* GL_RENDERBUFFER_RED_SIZE */ - 1308, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1305, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1303, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1306, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1315, /* GL_RENDERBUFFER_STENCIL_SIZE */ - 568, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 909, /* GL_MAX_SAMPLES */ - 1272, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - 482, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - 665, /* GL_LAST_VERTEX_CONVENTION_EXT */ - 1251, /* GL_PROVOKING_VERTEX_EXT */ + 1486, /* GL_STENCIL_ATTACHMENT */ + 537, /* GL_FRAMEBUFFER */ + 1307, /* GL_RENDERBUFFER */ + 1321, /* GL_RENDERBUFFER_WIDTH */ + 1314, /* GL_RENDERBUFFER_HEIGHT */ + 1316, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1509, /* GL_STENCIL_INDEX_EXT */ + 1506, /* GL_STENCIL_INDEX1_EXT */ + 1507, /* GL_STENCIL_INDEX4_EXT */ + 1508, /* GL_STENCIL_INDEX8_EXT */ + 1505, /* GL_STENCIL_INDEX16_EXT */ + 1318, /* GL_RENDERBUFFER_RED_SIZE */ + 1313, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1310, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1308, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1311, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1320, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 570, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 912, /* GL_MAX_SAMPLES */ + 1276, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + 483, /* GL_FIRST_VERTEX_CONVENTION */ + 667, /* GL_LAST_VERTEX_CONVENTION */ + 1254, /* GL_PROVOKING_VERTEX */ 302, /* GL_COPY_READ_BUFFER */ 303, /* GL_COPY_WRITE_BUFFER */ - 1363, /* GL_RGBA_SNORM */ - 1359, /* GL_RGBA8_SNORM */ - 1421, /* GL_SIGNED_NORMALIZED */ - 910, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - 1039, /* GL_OBJECT_TYPE */ - 1525, /* GL_SYNC_CONDITION */ - 1530, /* GL_SYNC_STATUS */ - 1527, /* GL_SYNC_FLAGS */ - 1526, /* GL_SYNC_FENCE */ - 1529, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - 1756, /* GL_UNSIGNALED */ - 1420, /* GL_SIGNALED */ + 1368, /* GL_RGBA_SNORM */ + 1364, /* GL_RGBA8_SNORM */ + 1426, /* GL_SIGNED_NORMALIZED */ + 913, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + 1042, /* GL_OBJECT_TYPE */ + 1530, /* GL_SYNC_CONDITION */ + 1535, /* GL_SYNC_STATUS */ + 1532, /* GL_SYNC_FLAGS */ + 1531, /* GL_SYNC_FENCE */ + 1534, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + 1761, /* GL_UNSIGNALED */ + 1425, /* GL_SIGNALED */ 46, /* GL_ALREADY_SIGNALED */ - 1727, /* GL_TIMEOUT_EXPIRED */ + 1732, /* GL_TIMEOUT_EXPIRED */ 270, /* GL_CONDITION_SATISFIED */ - 1839, /* GL_WAIT_FAILED */ - 467, /* GL_EVAL_BIT */ - 1283, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 707, /* GL_LIST_BIT */ - 1622, /* GL_TEXTURE_BIT */ - 1394, /* GL_SCISSOR_BIT */ + 1844, /* GL_WAIT_FAILED */ + 468, /* GL_EVAL_BIT */ + 1288, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 710, /* GL_LIST_BIT */ + 1627, /* GL_TEXTURE_BIT */ + 1399, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 995, /* GL_MULTISAMPLE_BIT */ + 998, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ - 1728, /* GL_TIMEOUT_IGNORED */ + 1733, /* GL_TIMEOUT_IGNORED */ }; typedef int (*cfunc)(const void *, const void *); diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 3f89f9c1ea..95d6e23187 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -44,6 +44,10 @@ #include "eval.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_evaluators /* @@ -417,7 +421,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ) { @@ -425,7 +429,7 @@ _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) { @@ -516,7 +520,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, @@ -527,7 +531,7 @@ _mesa_Map2f( GLenum target, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, @@ -539,7 +543,7 @@ _mesa_Map2d( GLenum target, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) { GET_CURRENT_CONTEXT(ctx); @@ -604,7 +608,7 @@ _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); @@ -669,7 +673,7 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) { GET_CURRENT_CONTEXT(ctx); @@ -735,7 +739,7 @@ _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { GET_CURRENT_CONTEXT(ctx); @@ -753,14 +757,14 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) { @@ -788,7 +792,7 @@ _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { @@ -797,6 +801,41 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, } +void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_EvalCoord1f(disp, vfmt->EvalCoord1f); + SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv); + SET_EvalCoord2f(disp, vfmt->EvalCoord2f); + SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv); + SET_EvalPoint1(disp, vfmt->EvalPoint1); + SET_EvalPoint2(disp, vfmt->EvalPoint2); + + SET_EvalMesh1(disp, vfmt->EvalMesh1); + SET_EvalMesh2(disp, vfmt->EvalMesh2); +} + + +void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ + SET_GetMapdv(disp, _mesa_GetMapdv); + SET_GetMapfv(disp, _mesa_GetMapfv); + SET_GetMapiv(disp, _mesa_GetMapiv); + SET_Map1d(disp, _mesa_Map1d); + SET_Map1f(disp, _mesa_Map1f); + SET_Map2d(disp, _mesa_Map2d); + SET_Map2f(disp, _mesa_Map2f); + SET_MapGrid1d(disp, _mesa_MapGrid1d); + SET_MapGrid1f(disp, _mesa_MapGrid1f); + SET_MapGrid2d(disp, _mesa_MapGrid2d); + SET_MapGrid2f(disp, _mesa_MapGrid2f); +} + + +#endif /* FEATURE_evaluators */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index b3ff0a96f8..ffd1bab76d 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -37,13 +37,22 @@ #define EVAL_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL -extern void _mesa_init_eval( GLcontext *ctx ); -extern void _mesa_free_eval_data( GLcontext *ctx ); +#if FEATURE_evaluators +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ + (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \ + (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \ + (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \ + (vfmt)->EvalPoint1 = impl ## EvalPoint1; \ + (vfmt)->EvalPoint2 = impl ## EvalPoint2; \ + (vfmt)->EvalMesh1 = impl ## EvalMesh1; \ + (vfmt)->EvalMesh2 = impl ## EvalMesh2; \ + } while (0) extern GLuint _mesa_evaluator_components( GLenum target ); @@ -70,59 +79,32 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, GLint vstride, GLint vorder, const GLdouble *points ); +extern void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); +extern void +_mesa_init_eval_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points ); - -extern void GLAPIENTRY -_mesa_Map2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -extern void GLAPIENTRY -_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble *points ); - -extern void GLAPIENTRY -_mesa_Map2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); - -extern void GLAPIENTRY -_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); +#else /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); +static INLINE void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -extern void GLAPIENTRY -_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); +static INLINE void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); +#endif /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); - -extern void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); - -#else - -/** No-op */ -#define _mesa_init_eval( c ) ((void)0) - -/** No-op */ -#define _mesa_free_eval_data( c ) ((void)0) +extern void _mesa_init_eval( GLcontext *ctx ); +extern void _mesa_free_eval_data( GLcontext *ctx ); -#endif -#endif +#endif /* EVAL_H */ diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 57c1e117c8..4c6139985f 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -80,11 +80,10 @@ init_heap(void) exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - return (exec_mem != NULL); + return (exec_mem != MAP_FAILED); } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index e3070b1547..54cf37c5f4 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -47,7 +47,9 @@ static const struct { } default_extensions[] = { { OFF, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, + { OFF, "GL_ARB_depth_clamp", F(ARB_depth_clamp) }, { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, + { OFF, "GL_ARB_draw_elements_base_vertex", F(ARB_draw_elements_base_vertex) }, { 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) }, @@ -61,6 +63,7 @@ static const struct { { OFF, "GL_ARB_pixel_buffer_object", F(EXT_pixel_buffer_object) }, { OFF, "GL_ARB_point_parameters", F(EXT_point_parameters) }, { OFF, "GL_ARB_point_sprite", F(ARB_point_sprite) }, + { OFF, "GL_ARB_provoking_vertex", F(EXT_provoking_vertex) }, { OFF, "GL_ARB_seamless_cube_map", F(ARB_seamless_cube_map) }, { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, @@ -162,7 +165,9 @@ static const struct { { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) }, { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, { OFF, "GL_NV_blend_square", F(NV_blend_square) }, + { OFF, "GL_NV_depth_clamp", F(ARB_depth_clamp) }, { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, + { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, { 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) }, @@ -192,8 +197,10 @@ void _mesa_enable_sw_extensions(GLcontext *ctx) { ctx->Extensions.ARB_copy_buffer = GL_TRUE; + ctx->Extensions.ARB_depth_clamp = GL_TRUE; ctx->Extensions.ARB_depth_texture = GL_TRUE; /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ + ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; #if FEATURE_ARB_fragment_program ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; @@ -208,7 +215,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj ctx->Extensions.ARB_occlusion_query = GL_TRUE; #endif ctx->Extensions.ARB_point_sprite = GL_TRUE; @@ -309,6 +316,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_NV_fragment_program ctx->Extensions.NV_fragment_program = GL_TRUE; #endif +#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program + ctx->Extensions.NV_fragment_program_option = GL_TRUE; +#endif ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_color_table = GL_TRUE; ctx->Extensions.SGI_texture_color_table = GL_TRUE; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 825a23090b..87061aeb0d 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -44,6 +44,11 @@ #include "teximage.h" #include "texobj.h" #include "texstore.h" +#include "texstate.h" + + +/** Set this to 1 to help debug FBO incompleteness problems */ +#define DEBUG_FBO 0 /** @@ -308,8 +313,8 @@ _mesa_framebuffer_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, static void att_incomplete(const char *msg) { -#if 0 - _mesa_printf("attachment incomplete: %s\n", msg); +#if DEBUG_FBO + _mesa_debug(NULL, "attachment incomplete: %s\n", msg); #else (void) msg; #endif @@ -317,6 +322,23 @@ att_incomplete(const char *msg) /** + * For debug only. + */ +static void +fbo_incomplete(const char *msg, int index) +{ +#if DEBUG_FBO + _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index); +#else + (void) msg; + (void) index; +#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, @@ -468,20 +490,6 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, /** - * Helpful for debugging - */ -static void -fbo_incomplete(const char *msg, int index) -{ - (void) msg; - (void) index; - /* - _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, 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 @@ -710,12 +718,6 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - if (renderbuffer) { newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); @@ -1127,7 +1129,7 @@ check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) struct gl_renderbuffer_attachment *att = fb->Attachment + i; struct gl_texture_object *texObj = att->Texture; if (texObj - && att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { + && texObj->Image[att->CubeMapFace][att->TextureLevel]) { ctx->Driver.RenderTexture(ctx, fb, att); } } @@ -1205,9 +1207,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } if (framebuffer) { /* Binding a user-created framebuffer object */ @@ -1286,11 +1285,6 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) ASSERT_OUTSIDE_BEGIN_END(ctx); FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); for (i = 0; i < n; i++) { if (framebuffers[i] > 0) { @@ -1524,11 +1518,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); _glthread_LOCK_MUTEX(fb->Mutex); if (texObj) { @@ -1705,11 +1694,6 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); assert(ctx->Driver.FramebufferRenderbuffer); ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); @@ -1786,11 +1770,6 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: @@ -1948,18 +1927,18 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); _mesa_lock_texture(ctx, texObj); if (target == GL_TEXTURE_CUBE_MAP) { - int face; - + GLuint face; for (face = 0; face < 6; face++) ctx->Driver.GenerateMipmap(ctx, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, texObj); - } else { + } + else { ctx->Driver.GenerateMipmap(ctx, target, texObj); } _mesa_unlock_texture(ctx, texObj); diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 818a804540..fcdbb75fc4 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -36,9 +36,10 @@ #include "feedback.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" -#if _HAVE_FULL_GL +#if FEATURE_feedback #define FB_3D 0x01 @@ -49,7 +50,7 @@ -void GLAPIENTRY +static void GLAPIENTRY _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -103,7 +104,7 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PassThrough( GLfloat token ) { GET_CURRENT_CONTEXT(ctx); @@ -153,9 +154,6 @@ _mesa_feedback_vertex(GLcontext *ctx, } -#endif /* _HAVE_FULL_GL */ - - /**********************************************************************/ /** \name Selection */ /*@{*/ @@ -173,7 +171,7 @@ _mesa_feedback_vertex(GLcontext *ctx, * Verifies we're not in selection mode, flushes the vertices and initialize * the fields in __GLcontextRec::Select with the given buffer. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -280,7 +278,7 @@ write_hit_record(GLcontext *ctx) * the hit record data in gl_selection. Marks new render mode in * __GLcontextRec::NewState. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_InitNames( void ) { GET_CURRENT_CONTEXT(ctx); @@ -311,7 +309,7 @@ _mesa_InitNames( void ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_LoadName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -350,7 +348,7 @@ _mesa_LoadName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PushName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -381,7 +379,7 @@ _mesa_PushName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PopName( void ) { GET_CURRENT_CONTEXT(ctx); @@ -424,7 +422,7 @@ _mesa_PopName( void ) * __GLcontextRec::RenderMode and notifies the driver via the * dd_function_table::RenderMode callback. */ -GLint GLAPIENTRY +static GLint GLAPIENTRY _mesa_RenderMode( GLenum mode ) { GET_CURRENT_CONTEXT(ctx); @@ -507,6 +505,23 @@ _mesa_RenderMode( GLenum mode ) /*@}*/ +void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ + SET_InitNames(disp, _mesa_InitNames); + SET_FeedbackBuffer(disp, _mesa_FeedbackBuffer); + SET_LoadName(disp, _mesa_LoadName); + SET_PassThrough(disp, _mesa_PassThrough); + SET_PopName(disp, _mesa_PopName); + SET_PushName(disp, _mesa_PushName); + SET_SelectBuffer(disp, _mesa_SelectBuffer); + SET_RenderMode(disp, _mesa_RenderMode); +} + + +#endif /* FEATURE_feedback */ + + /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index 72c2acd5ed..7a648f444f 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -27,11 +27,15 @@ #define FEEDBACK_H -#include "mtypes.h" +#include "main/mtypes.h" -extern void -_mesa_init_feedback( GLcontext *ctx ); +#if FEATURE_feedback + +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RenderMode = impl ## RenderMode; \ + } while (0) extern void _mesa_feedback_vertex( GLcontext *ctx, @@ -55,29 +59,47 @@ extern void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ); -extern void GLAPIENTRY -_mesa_PassThrough( GLfloat token ); +extern void +_mesa_init_feedback_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_feedback */ -extern void GLAPIENTRY -_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); +static INLINE void +_mesa_feedback_vertex( GLcontext *ctx, + const GLfloat win[4], + const GLfloat color[4], + GLfloat index, + const GLfloat texcoord[4] ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_InitNames( void ); -extern void GLAPIENTRY -_mesa_LoadName( GLuint name ); +static INLINE void +_mesa_feedback_token( GLcontext *ctx, GLfloat token ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PushName( GLuint name ); +static INLINE void +_mesa_update_hitflag( GLcontext *ctx, GLfloat z ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PopName( void ); +static INLINE void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ +} -extern GLint GLAPIENTRY -_mesa_RenderMode( GLenum mode ); +#endif /* FEATURE_feedback */ +extern void +_mesa_init_feedback( GLcontext *ctx ); -#endif +#endif /* FEEDBACK_H */ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 477ed01030..a6e004a816 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1722,6 +1722,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMin); params[1] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMax); break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetBooleanv"); + params[0] = ctx->Transform.DepthClamp; + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers); break; @@ -3553,6 +3557,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Depth.BoundsMin; params[1] = ctx->Depth.BoundsMax; break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.DepthClamp); + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers); break; @@ -5384,6 +5392,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Depth.BoundsMin); params[1] = IROUND(ctx->Depth.BoundsMax); break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->Transform.DepthClamp); + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = ctx->Const.MaxDrawBuffers; break; @@ -7216,6 +7228,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Depth.BoundsMin); params[1] = IROUND64(ctx->Depth.BoundsMax); break; + case GL_DEPTH_CLAMP: + CHECK_EXT1(ARB_depth_clamp, "GetInteger64v"); + params[0] = BOOLEAN_TO_INT64(ctx->Transform.DepthClamp); + break; case GL_MAX_DRAW_BUFFERS_ARB: params[0] = ctx->Const.MaxDrawBuffers; break; diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 2878c1b552..364d8c55c4 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -905,6 +905,10 @@ StateVars = [ ["ctx->Depth.BoundsMin", "ctx->Depth.BoundsMax"], "", ["EXT_depth_bounds_test"] ), + # GL_ARB_depth_clamp + ( "GL_DEPTH_CLAMP", GLboolean, ["ctx->Transform.DepthClamp"], "", + ["ARB_depth_clamp"] ), + # GL_ARB_draw_buffers ( "GL_MAX_DRAW_BUFFERS_ARB", GLint, ["ctx->Const.MaxDrawBuffers"], "", None ), diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index ceb0d5a6a8..87816d3132 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -29,8 +29,11 @@ #include "context.h" #include "image.h" #include "histogram.h" +#include "glapi/dispatch.h" +#if FEATURE_histogram + /* * XXX the packed pixel formats haven't been tested. @@ -614,7 +617,11 @@ base_histogram_format( GLenum format ) */ -void GLAPIENTRY +/* this is defined below */ +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); + + +static void GLAPIENTRY _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -677,7 +684,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -737,7 +744,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -784,7 +791,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -831,7 +838,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -857,7 +864,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -883,7 +890,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) { GLuint i; @@ -966,7 +973,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) { GET_CURRENT_CONTEXT(ctx); @@ -994,7 +1001,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetHistogram(GLenum target) { GLuint i; @@ -1020,7 +1027,7 @@ _mesa_ResetHistogram(GLenum target) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target) { GET_CURRENT_CONTEXT(ctx); @@ -1043,6 +1050,24 @@ _mesa_ResetMinmax(GLenum target) } +void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ + SET_GetHistogram(disp, _mesa_GetHistogram); + SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv); + SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv); + SET_GetMinmax(disp, _mesa_GetMinmax); + SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv); + SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv); + SET_Histogram(disp, _mesa_Histogram); + SET_Minmax(disp, _mesa_Minmax); + SET_ResetHistogram(disp, _mesa_ResetHistogram); + SET_ResetMinmax(disp, _mesa_ResetMinmax); +} + + +#endif /* FEATURE_histogram */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index 367e9b11ba..dbae1bbd06 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -36,48 +36,22 @@ #ifndef HISTOGRAM_H #define HISTOGRAM_H -#include "glheader.h" -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_histogram -extern void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +extern void +_mesa_init_histogram_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +#else /* FEATURE_histogram */ -extern void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params); +static INLINE void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_ResetHistogram(GLenum target); - -extern void GLAPIENTRY -_mesa_ResetMinmax(GLenum target); +#endif /* FEATURE_histogram */ extern void _mesa_init_histogram( GLcontext * ctx ); -#else - -/** No-op */ -#define _mesa_init_histogram( c ) ((void) 0) - -#endif - -#endif +#endif /* HISTOGRAM_H */ diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 10c89f4368..1c8a081e9a 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -636,7 +636,7 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) struct gl_light *light, *list = &ctx->Light.EnabledList; GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - if (MESA_VERBOSE&VERBOSE_IMMEDIATE) + if (MESA_VERBOSE & VERBOSE_MATERIAL) _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); if (!bitmask) diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index e23cdb1f42..c2fb8404b1 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -36,12 +36,47 @@ #define _HAVE_FULL_GL 1 #endif +/* assert that a feature is disabled and should never be used */ +#define ASSERT_NO_FEATURE() ASSERT(0) + +/** + * A feature can be anything. But most of them share certain characteristics. + * + * When a feature defines driver entries, they can be initialized by + * _MESA_INIT_<FEATURE>_FUNCTIONS + * + * When a feature defines vtxfmt entries, they can be initialized and + * installed by + * _MESA_INIT_<FEATURE>_VTXFMT + * _mesa_install_<feature>_vtxfmt + * + * When a feature defines dispatch entries, they are initialized by + * _mesa_init_<feature>_dispatch + * + * When a feature has states, they are initialized and freed by + * _mesa_init_<feature> + * _mesa_free_<feature>_data + * + * Except for states, the others compile to no-op when a feature is disabled. + * + * The GLAPIENTRYs and helper functions defined by a feature should also + * compile to no-op when it is disabled. But to save typings and to catch + * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE() + * when the feature is disabled. + * + * A feature following the conventions may be used without knowing if it is + * enabled or not. + */ + #define FEATURE_accum _HAVE_FULL_GL +#define FEATURE_arrayelt _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL +/* this disables vtxfmt, api_loopback, and api_noop completely */ +#define FEATURE_beginend _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL #define FEATURE_convolve _HAVE_FULL_GL #define FEATURE_dispatch _HAVE_FULL_GL -#define FEATURE_dlist _HAVE_FULL_GL +#define FEATURE_dlist (_HAVE_FULL_GL && FEATURE_arrayelt && FEATURE_beginend) #define FEATURE_draw_read_buffer _HAVE_FULL_GL #define FEATURE_drawpix _HAVE_FULL_GL #define FEATURE_evaluators _HAVE_FULL_GL @@ -50,15 +85,15 @@ #define FEATURE_histogram _HAVE_FULL_GL #define FEATURE_pixel_transfer _HAVE_FULL_GL #define FEATURE_point_size_array 0 +#define FEATURE_queryobj _HAVE_FULL_GL +#define FEATURE_rastpos _HAVE_FULL_GL #define FEATURE_texgen _HAVE_FULL_GL #define FEATURE_texture_fxt1 _HAVE_FULL_GL #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_map_buffer_range _HAVE_FULL_GL @@ -76,7 +111,6 @@ #define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL #define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL #define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL -#define FEATURE_EXT_timer_query _HAVE_FULL_GL #define FEATURE_ATI_fragment_shader _HAVE_FULL_GL #define FEATURE_NV_fence _HAVE_FULL_GL #define FEATURE_NV_fragment_program _HAVE_FULL_GL diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f8e4e41583..052fbaaaea 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.5 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -84,6 +84,7 @@ /*@{*/ struct _mesa_HashTable; struct gl_attrib_node; +struct gl_list_extensions; struct gl_meta_state; struct gl_pixelstore_attrib; struct gl_program_cache; @@ -207,7 +208,7 @@ typedef enum VERT_RESULT_BFC0 = 13, VERT_RESULT_BFC1 = 14, VERT_RESULT_EDGE = 15, - VERT_RESULT_VAR0 = 16 /**< shader varying */, + VERT_RESULT_VAR0 = 16, /**< shader varying */ VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) } gl_vert_result; @@ -820,29 +821,6 @@ struct gl_list_attrib /** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_instruction -{ - GLuint Size; - void (*Execute)( GLcontext *ctx, void *data ); - void (*Destroy)( GLcontext *ctx, void *data ); - void (*Print)( GLcontext *ctx, void *data ); -}; - -#define MAX_DLIST_EXT_OPCODES 16 - -/** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_extensions -{ - struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES]; - GLuint NumOpcodes; -}; - - -/** * Multisample attribute group (GL_MULTISAMPLE_BIT). */ struct gl_multisample_attrib @@ -1482,6 +1460,7 @@ struct gl_transform_attrib GLboolean Normalize; /**< Normalize all normals? */ GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ + GLboolean DepthClamp; /**< GL_ARB_depth_clamp */ GLboolean CullVertexFlag; /**< True if GL_CULL_VERTEX_EXT is enabled */ GLfloat CullEyePos[4]; @@ -1833,7 +1812,6 @@ struct gl_vertex_program struct gl_program Base; /**< base class */ GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ GLboolean IsPositionInvariant; - void *TnlData; /**< should probably use Base.DriverData */ }; @@ -1939,10 +1917,10 @@ struct ati_fragment_shader struct atifs_instruction *Instructions[2]; struct atifs_setupinst *SetupInst[2]; GLfloat Constants[8][4]; - GLbitfield LocalConstDef; /** Indicates which constants have been set */ + GLbitfield LocalConstDef; /**< Indicates which constants have been set */ GLubyte numArithInstr[2]; GLubyte regsAssigned[2]; - GLubyte NumPasses; /** 1 or 2 */ + GLubyte NumPasses; /**< 1 or 2 */ GLubyte cur_pass; GLubyte last_optype; GLboolean interpinp1; @@ -1956,7 +1934,7 @@ struct ati_fragment_shader struct gl_ati_fragment_shader_state { GLboolean Enabled; - GLboolean _Enabled; /** enabled and valid shader? */ + GLboolean _Enabled; /**< enabled and valid shader? */ GLboolean Compiling; GLfloat GlobalConstants[8][4]; struct ati_fragment_shader *Current; @@ -2066,6 +2044,9 @@ struct gl_shader_program #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 */ +#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ +#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ +#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */ /** @@ -2476,7 +2457,9 @@ struct gl_extensions GLboolean dummy; /* don't remove this! */ GLboolean ARB_copy_buffer; GLboolean ARB_depth_texture; + GLboolean ARB_depth_clamp; GLboolean ARB_draw_buffers; + GLboolean ARB_draw_elements_base_vertex; GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; @@ -2581,6 +2564,7 @@ struct gl_extensions GLboolean MESA_texture_signed_rgba; GLboolean NV_blend_square; GLboolean NV_fragment_program; + GLboolean NV_fragment_program_option; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; @@ -3056,7 +3040,7 @@ struct __GLcontextRec struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ /**@}*/ - struct gl_list_extensions ListExt; /**< driver dlist extensions */ + struct gl_list_extensions *ListExt; /**< driver dlist extensions */ /** \name For debugging/development only */ /*@{*/ @@ -3112,11 +3096,12 @@ extern int MESA_DEBUG_FLAGS; #endif +/** The MESA_VERBOSE var is a bitmask of these flags */ enum _verbose { VERBOSE_VARRAY = 0x0001, VERBOSE_TEXTURE = 0x0002, - VERBOSE_IMMEDIATE = 0x0004, + VERBOSE_MATERIAL = 0x0004, VERBOSE_PIPELINE = 0x0008, VERBOSE_DRIVER = 0x0010, VERBOSE_STATE = 0x0020, @@ -3126,9 +3111,12 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, + VERBOSE_DRAW = 0x2000, + VERBOSE_SWAPBUFFERS = 0x4000 }; +/** The MESA_DEBUG_FLAGS var is a bitmask of these flags */ enum _debug { DEBUG_ALWAYS_FLUSH = 0x1 diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index fcef6dfd42..3820ebd889 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -36,13 +36,17 @@ #include "macros.h" #include "pixel.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_pixel_transfer /**********************************************************************/ /***** glPixelZoom *****/ /**********************************************************************/ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) { GET_CURRENT_CONTEXT(ctx); @@ -163,7 +167,7 @@ validate_pbo_access(GLcontext *ctx, struct gl_pixelstore_attrib *pack, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -205,7 +209,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -261,7 +265,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -317,7 +321,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -362,7 +366,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) { GET_CURRENT_CONTEXT(ctx); @@ -406,7 +410,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapusv( GLenum map, GLushort *values ) { GET_CURRENT_CONTEXT(ctx); @@ -468,7 +472,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values ) * Implements glPixelTransfer[fi] whether called immediately or from a * display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ) { GET_CURRENT_CONTEXT(ctx); @@ -662,7 +666,7 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferi( GLenum pname, GLint param ) { _mesa_PixelTransferf( pname, (GLfloat) param ); @@ -756,6 +760,24 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) } +void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ + SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv); + SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv); + SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv); + SET_PixelMapfv(disp, _mesa_PixelMapfv); + SET_PixelMapuiv(disp, _mesa_PixelMapuiv); + SET_PixelMapusv(disp, _mesa_PixelMapusv); + SET_PixelTransferf(disp, _mesa_PixelTransferf); + SET_PixelTransferi(disp, _mesa_PixelTransferi); + SET_PixelZoom(disp, _mesa_PixelZoom); +} + + +#endif /* FEATURE_pixel_transfer */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index cb6c5262a3..f4d3f1efdb 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -33,48 +33,35 @@ #define PIXEL_H -#include "mtypes.h" +#include "main/mtypes.h" -/** \name API functions */ -/*@{*/ +#if FEATURE_pixel_transfer -extern void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ); - -extern void GLAPIENTRY -_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); - -extern void GLAPIENTRY -_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ); - -extern void GLAPIENTRY -_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); +extern void +_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); -extern void GLAPIENTRY -_mesa_PixelTransferf( GLenum pname, GLfloat param ); +extern void +_mesa_init_pixel_dispatch( struct _glapi_table * disp ); -extern void GLAPIENTRY -_mesa_PixelTransferi( GLenum pname, GLint param ); +#else /* FEATURE_pixel_transfer */ -extern void GLAPIENTRY -_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); +static INLINE void +_mesa_update_pixel(GLcontext *ctx, GLuint newstate) +{ +} -/*@}*/ +static INLINE void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_pixel_transfer */ -extern void -_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); extern void _mesa_init_pixel( GLcontext * ctx ); /*@}*/ -#endif +#endif /* PIXEL_H */ diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index a73c6e0508..f6eb4ee7e1 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -29,6 +29,10 @@ #include "imports.h" #include "queryobj.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_queryobj /** @@ -216,7 +220,7 @@ _mesa_IsQueryARB(GLuint id) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_BeginQueryARB(GLenum target, GLuint id) { struct gl_query_object *q; @@ -236,7 +240,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); @@ -247,7 +250,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); return; @@ -285,17 +287,15 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) if (target == GL_SAMPLES_PASSED_ARB) { ctx->Query.CurrentOcclusionObject = q; } -#if FEATURE_EXT_timer_query else if (target == GL_TIME_ELAPSED_EXT) { ctx->Query.CurrentTimerObject = q; } -#endif ctx->Driver.BeginQuery(ctx, q); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndQueryARB(GLenum target) { struct gl_query_object *q; @@ -313,7 +313,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentOcclusionObject; ctx->Query.CurrentOcclusionObject = NULL; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -322,7 +321,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentTimerObject; ctx->Query.CurrentTimerObject = NULL; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); return; @@ -354,7 +352,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentOcclusionObject; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -362,7 +359,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentTimerObject; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); return; @@ -462,12 +458,10 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } -#if FEATURE_EXT_timer_query - /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) { struct gl_query_object *q = NULL; @@ -504,7 +498,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) { struct gl_query_object *q = NULL; @@ -537,19 +531,35 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) } } -#endif /* FEATURE_EXT_timer_query */ + +void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ + SET_GenQueriesARB(disp, _mesa_GenQueriesARB); + SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB); + SET_IsQueryARB(disp, _mesa_IsQueryARB); + SET_BeginQueryARB(disp, _mesa_BeginQueryARB); + SET_EndQueryARB(disp, _mesa_EndQueryARB); + SET_GetQueryivARB(disp, _mesa_GetQueryivARB); + SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); + SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); + + SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); +} + + +#endif /* FEATURE_queryobj */ /** * Allocate/init the context state related to query objects. */ void -_mesa_init_query(GLcontext *ctx) +_mesa_init_queryobj(GLcontext *ctx) { -#if FEATURE_ARB_occlusion_query ctx->Query.QueryObjects = _mesa_NewHashTable(); ctx->Query.CurrentOcclusionObject = NULL; -#endif } @@ -569,7 +579,7 @@ delete_queryobj_cb(GLuint id, void *data, void *userData) * Free the context state related to query objects. */ void -_mesa_free_query_data(GLcontext *ctx) +_mesa_free_queryobj_data(GLcontext *ctx) { _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); _mesa_DeleteHashTable(ctx->Query.QueryObjects); diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index ee775ef959..6cf3c76d74 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -23,19 +23,24 @@ */ -#ifndef OCCLUDE_H -#define OCCLUDE_H +#ifndef QUERYOBJ_H +#define QUERYOBJ_H -extern void -_mesa_init_query(GLcontext *ctx); +#include "main/mtypes.h" -extern void -_mesa_free_query_data(GLcontext *ctx); -extern void -_mesa_init_query_object_functions(struct dd_function_table *driver); +#if FEATURE_queryobj +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewQueryObject = impl ## NewQueryObject; \ + (driver)->DeleteQuery = impl ## DeleteQuery; \ + (driver)->BeginQuery = impl ## BeginQuery; \ + (driver)->EndQuery = impl ## EndQuery; \ + (driver)->WaitQuery = impl ## WaitQuery; \ + (driver)->CheckQuery = impl ## CheckQuery; \ + } while (0) extern void GLAPIENTRY _mesa_GenQueriesARB(GLsizei n, GLuint *ids); @@ -47,12 +52,6 @@ extern GLboolean GLAPIENTRY _mesa_IsQueryARB(GLuint id); extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - -extern void GLAPIENTRY _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); extern void GLAPIENTRY @@ -61,11 +60,33 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); +extern void +_mesa_init_query_object_functions(struct dd_function_table *driver); -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); +extern void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_queryobj */ + +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void +_mesa_init_query_object_functions(struct dd_function_table *driver) +{ +} + +static INLINE void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_queryobj */ + +extern void +_mesa_init_queryobj(GLcontext *ctx); + +extern void +_mesa_free_queryobj_data(GLcontext *ctx); -#endif /* OCCLUDE_H */ +#endif /* QUERYOBJ_H */ diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 9f309d6ab8..703b47ec74 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -34,6 +34,10 @@ #include "macros.h" #include "rastpos.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_rastpos /** @@ -60,147 +64,147 @@ rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2d(GLdouble x, GLdouble y) { rasterpos((GLfloat)x, (GLfloat)y, (GLfloat)0.0, (GLfloat)1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2f(GLfloat x, GLfloat y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2i(GLint x, GLint y) { rasterpos((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2s(GLshort x, GLshort y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3i(GLint x, GLint y, GLint z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2fv(const GLfloat *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2sv(const GLshort *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], v[3]); @@ -211,7 +215,7 @@ _mesa_RasterPos4sv(const GLshort *v) /*** GL_ARB_window_pos / GL_MESA_window_pos ***/ /**********************************************************************/ -#if FEATURE_drawpix + /** * All glWindowPosMESA and glWindowPosARB commands call this function to * update the current raster position. @@ -290,153 +294,152 @@ window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dMESA(GLdouble x, GLdouble y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fMESA(GLfloat x, GLfloat y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2iMESA(GLint x, GLint y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2sMESA(GLshort x, GLshort y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2svMESA(const GLshort *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], 1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -#endif #if 0 @@ -477,6 +480,65 @@ void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) #endif +void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ + SET_RasterPos2f(disp, _mesa_RasterPos2f); + SET_RasterPos2fv(disp, _mesa_RasterPos2fv); + SET_RasterPos2i(disp, _mesa_RasterPos2i); + SET_RasterPos2iv(disp, _mesa_RasterPos2iv); + SET_RasterPos2d(disp, _mesa_RasterPos2d); + SET_RasterPos2dv(disp, _mesa_RasterPos2dv); + SET_RasterPos2s(disp, _mesa_RasterPos2s); + SET_RasterPos2sv(disp, _mesa_RasterPos2sv); + SET_RasterPos3d(disp, _mesa_RasterPos3d); + SET_RasterPos3dv(disp, _mesa_RasterPos3dv); + SET_RasterPos3f(disp, _mesa_RasterPos3f); + SET_RasterPos3fv(disp, _mesa_RasterPos3fv); + SET_RasterPos3i(disp, _mesa_RasterPos3i); + SET_RasterPos3iv(disp, _mesa_RasterPos3iv); + SET_RasterPos3s(disp, _mesa_RasterPos3s); + SET_RasterPos3sv(disp, _mesa_RasterPos3sv); + SET_RasterPos4d(disp, _mesa_RasterPos4d); + SET_RasterPos4dv(disp, _mesa_RasterPos4dv); + SET_RasterPos4f(disp, _mesa_RasterPos4f); + SET_RasterPos4fv(disp, _mesa_RasterPos4fv); + SET_RasterPos4i(disp, _mesa_RasterPos4i); + SET_RasterPos4iv(disp, _mesa_RasterPos4iv); + SET_RasterPos4s(disp, _mesa_RasterPos4s); + SET_RasterPos4sv(disp, _mesa_RasterPos4sv); + + /* 197. GL_MESA_window_pos */ + SET_WindowPos2dMESA(disp, _mesa_WindowPos2dMESA); + SET_WindowPos2dvMESA(disp, _mesa_WindowPos2dvMESA); + SET_WindowPos2fMESA(disp, _mesa_WindowPos2fMESA); + SET_WindowPos2fvMESA(disp, _mesa_WindowPos2fvMESA); + SET_WindowPos2iMESA(disp, _mesa_WindowPos2iMESA); + SET_WindowPos2ivMESA(disp, _mesa_WindowPos2ivMESA); + SET_WindowPos2sMESA(disp, _mesa_WindowPos2sMESA); + SET_WindowPos2svMESA(disp, _mesa_WindowPos2svMESA); + SET_WindowPos3dMESA(disp, _mesa_WindowPos3dMESA); + SET_WindowPos3dvMESA(disp, _mesa_WindowPos3dvMESA); + SET_WindowPos3fMESA(disp, _mesa_WindowPos3fMESA); + SET_WindowPos3fvMESA(disp, _mesa_WindowPos3fvMESA); + SET_WindowPos3iMESA(disp, _mesa_WindowPos3iMESA); + SET_WindowPos3ivMESA(disp, _mesa_WindowPos3ivMESA); + SET_WindowPos3sMESA(disp, _mesa_WindowPos3sMESA); + SET_WindowPos3svMESA(disp, _mesa_WindowPos3svMESA); + SET_WindowPos4dMESA(disp, _mesa_WindowPos4dMESA); + SET_WindowPos4dvMESA(disp, _mesa_WindowPos4dvMESA); + SET_WindowPos4fMESA(disp, _mesa_WindowPos4fMESA); + SET_WindowPos4fvMESA(disp, _mesa_WindowPos4fvMESA); + SET_WindowPos4iMESA(disp, _mesa_WindowPos4iMESA); + SET_WindowPos4ivMESA(disp, _mesa_WindowPos4ivMESA); + SET_WindowPos4sMESA(disp, _mesa_WindowPos4sMESA); + SET_WindowPos4svMESA(disp, _mesa_WindowPos4svMESA); +} + + +#endif /* FEATURE_rastpos */ + + /**********************************************************************/ /** \name Initialization */ /**********************************************************************/ diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h index 363f86ad87..b2127225b6 100644 --- a/src/mesa/main/rastpos.h +++ b/src/mesa/main/rastpos.h @@ -32,162 +32,33 @@ #define RASTPOS_H -#include "glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_RasterPos2d(GLdouble x, GLdouble y); +#if FEATURE_rastpos -extern void GLAPIENTRY -_mesa_RasterPos2f(GLfloat x, GLfloat y); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RasterPos = impl ## RasterPos; \ + } while (0) -extern void GLAPIENTRY -_mesa_RasterPos2i(GLint x, GLint y); +extern void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_RasterPos2s(GLshort x, GLshort y); +#else /* FEATURE_rastpos */ -extern void GLAPIENTRY -_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); +static INLINE void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_RasterPos3i(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_RasterPos2dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos2fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos2iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos2sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos3dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos3fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos3iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos3sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos4dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos4fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos4iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos4sv(const GLshort *v); - - -/**********************************************************************/ -/** \name GL_MESA_window_pos */ -/**********************************************************************/ -/*@{*/ - -extern void GLAPIENTRY -_mesa_WindowPos2dMESA(GLdouble x, GLdouble y); - -extern void GLAPIENTRY -_mesa_WindowPos2fMESA(GLfloat x, GLfloat y); - -extern void GLAPIENTRY -_mesa_WindowPos2iMESA(GLint x, GLint y); - -extern void GLAPIENTRY -_mesa_WindowPos2sMESA(GLshort x, GLshort y); - -extern void GLAPIENTRY -_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); - -extern void GLAPIENTRY -_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); - -extern void GLAPIENTRY -_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_WindowPos2dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos2fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos2ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos2svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos3dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos3fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos3ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos3svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos4dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos4fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos4ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos4svMESA(const GLshort *v); +#endif /* FEATURE_rastpos */ extern void -_mesa_init_rastpos( GLcontext * ctx ); +_mesa_init_rastpos(GLcontext *ctx); /*@}*/ -#endif +#endif /* RASTPOS_H */ diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index bc76b91291..96fd8695a5 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -388,7 +388,6 @@ _mesa_read_shader(const char *fname) int len; if (!f) { - _mesa_fprintf(stderr, "Unable to open shader file %s\n", fname); return NULL; } @@ -401,11 +400,6 @@ _mesa_read_shader(const char *fname) shader = _mesa_strdup(buffer); free(buffer); - if (0) { - _mesa_fprintf(stderr, "Read shader %s:\n", fname); - _mesa_fprintf(stderr, "%s\n", shader); - } - return shader; } @@ -475,19 +469,25 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, source[totalLength - 1] = '\0'; source[totalLength - 2] = '\0'; -#if 0 if (0) { + /* Compute the shader's source code checksum then try to open a file + * named newshader_<CHECKSUM>. If it exists, use it in place of the + * original shader source code. For debugging. + */ + const GLuint checksum = _mesa_str_checksum(source); + char filename[100]; GLcharARB *newSource; - newSource = _mesa_read_shader("newshader.frag"); + sprintf(filename, "newshader_%d", checksum); + + newSource = _mesa_read_shader(filename); if (newSource) { + _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", + shaderObj, checksum, filename); _mesa_free(source); source = newSource; } - } -#else - (void) _mesa_read_shader; -#endif + } ctx->Driver.ShaderSource(ctx, shaderObj, source); diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 643ad3354e..4d01e8abc6 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -37,9 +37,7 @@ #include "shared.h" #include "shader/program.h" #include "shader/shader_api.h" -#if FEATURE_dlist #include "dlist.h" -#endif #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif @@ -143,11 +141,9 @@ _mesa_alloc_shared_state(GLcontext *ctx) static void delete_displaylist_cb(GLuint id, void *data, void *userData) { -#if FEATURE_dlist struct gl_display_list *list = (struct gl_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); -#endif } diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 140a998df2..f10e6b04b7 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -40,9 +40,7 @@ #include "framebuffer.h" #include "light.h" #include "matrix.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "shader/program.h" #include "shader/prog_parameter.h" #include "state.h" @@ -585,10 +583,8 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & (_NEW_STENCIL | _NEW_BUFFERS)) _mesa_update_stencil( ctx ); -#if FEATURE_pixel_transfer 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 ); diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index 64f923ff91..ac3f9eb175 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -190,7 +190,7 @@ _mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj) } -GLboolean +GLboolean GLAPIENTRY _mesa_IsSync(GLsync sync) { GET_CURRENT_CONTEXT(ctx); @@ -201,7 +201,7 @@ _mesa_IsSync(GLsync sync) } -void +void GLAPIENTRY _mesa_DeleteSync(GLsync sync) { GET_CURRENT_CONTEXT(ctx); @@ -231,7 +231,7 @@ _mesa_DeleteSync(GLsync sync) } -GLsync +GLsync GLAPIENTRY _mesa_FenceSync(GLenum condition, GLbitfield flags) { GET_CURRENT_CONTEXT(ctx); @@ -278,7 +278,7 @@ _mesa_FenceSync(GLenum condition, GLbitfield flags) } -GLenum +GLenum GLAPIENTRY _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) { GET_CURRENT_CONTEXT(ctx); @@ -319,7 +319,7 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) } -void +void GLAPIENTRY _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) { GET_CURRENT_CONTEXT(ctx); @@ -348,7 +348,7 @@ _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) } -void +void GLAPIENTRY _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values) { diff --git a/src/mesa/main/syncobj.h b/src/mesa/main/syncobj.h index fc160af289..f23fa281e2 100644 --- a/src/mesa/main/syncobj.h +++ b/src/mesa/main/syncobj.h @@ -48,22 +48,22 @@ _mesa_ref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj); extern void _mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj); -extern GLboolean +extern GLboolean GLAPIENTRY _mesa_IsSync(GLsync sync); -extern void +extern void GLAPIENTRY _mesa_DeleteSync(GLsync sync); -extern GLsync +extern GLsync GLAPIENTRY _mesa_FenceSync(GLenum condition, GLbitfield flags); -extern GLenum +extern GLenum GLAPIENTRY _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout); -extern void +extern void GLAPIENTRY _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout); -extern void +extern void GLAPIENTRY _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index e3feb024c3..733e129fcf 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -35,7 +35,12 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texgen.h" +#include "main/texstate.h" #include "math/m_matrix.h" +#include "glapi/dispatch.h" + + +#if FEATURE_texgen /** @@ -79,7 +84,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -161,7 +166,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; @@ -178,7 +183,7 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { GLfloat p = (GLfloat) param; @@ -186,7 +191,7 @@ _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; @@ -203,7 +208,7 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { _mesa_TexGenfv(coord, pname, ¶m); @@ -218,7 +223,7 @@ _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { struct gl_texture_unit *texUnit; @@ -231,7 +236,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -256,7 +261,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { struct gl_texture_unit *texUnit; @@ -269,7 +274,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -294,7 +299,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { struct gl_texture_unit *texUnit; @@ -307,7 +312,7 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -337,3 +342,19 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) } +void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ + SET_GetTexGendv(disp, _mesa_GetTexGendv); + SET_GetTexGenfv(disp, _mesa_GetTexGenfv); + SET_GetTexGeniv(disp, _mesa_GetTexGeniv); + SET_TexGend(disp, _mesa_TexGend); + SET_TexGendv(disp, _mesa_TexGendv); + SET_TexGenf(disp, _mesa_TexGenf); + SET_TexGenfv(disp, _mesa_TexGenfv); + SET_TexGeni(disp, _mesa_TexGeni); + SET_TexGeniv(disp, _mesa_TexGeniv); +} + + +#endif /* FEATURE_texgen */ diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index 073588efcd..f6924ef722 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -27,36 +27,45 @@ #define TEXGEN_H -#include "main/glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +#if FEATURE_texgen -extern void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) \ + do { \ + (driver)->TexGen = impl ## TexGen; \ + } while (0) extern void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); extern void GLAPIENTRY -_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); -extern void GLAPIENTRY -_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +extern void +_mesa_init_texgen_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); +#else /* FEATURE_texgen */ -extern void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); +static void +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) +{ +} -extern void GLAPIENTRY -_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); +static void INLINE +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ +} + +static INLINE void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_texgen */ #endif /* TEXGEN_H */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index a8160c2735..465da6b046 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -33,9 +33,7 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "enums.h" #include "fbobject.h" #include "framebuffer.h" @@ -2076,6 +2074,23 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj, } +/** + * If the texture object's GenerateMipmap flag is set and we've + * changed the texture base level image, regenerate the rest of the + * mipmap levels now. + */ +static INLINE void +check_gen_mipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj, GLint level) +{ + ASSERT(target != GL_TEXTURE_CUBE_MAP); + if (texObj->GenerateMipmap && level == texObj->BaseLevel) { + ASSERT(ctx->Driver.GenerateMipmap); + ctx->Driver.GenerateMipmap(ctx, target, texObj); + } +} + + /** Debug helper: override the user-requested internal format */ static GLenum override_internal_format(GLenum internalFormat, GLint width, GLint height) @@ -2169,36 +2184,36 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, 1, 1, + border, internalFormat); + + /* Give the texture to the driver. <pixels> may be null. */ + ASSERT(ctx->Driver.TexImage1D); + ctx->Driver.TexImage1D(ctx, target, level, internalFormat, + width, border, format, type, pixels, + &ctx->Unpack, texObj, texImage); - ASSERT(texImage->Data == NULL); - - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, 1, 1, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage1D); - - /* Give the texture to the driver! <pixels> may be null! */ - (*ctx->Driver.TexImage1D)(ctx, target, level, internalFormat, - width, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + ASSERT(texImage->TexFormat); + + check_gen_mipmap(ctx, target, texObj, level); + + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_1D) { @@ -2284,35 +2299,35 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - - ASSERT(ctx->Driver.TexImage2D); - - /* Give the texture to the driver! <pixels> may be null! */ - (*ctx->Driver.TexImage2D)(ctx, target, level, internalFormat, - width, height, border, format, type, pixels, - &ctx->Unpack, texObj, texImage); - - ASSERT(texImage->TexFormat); - - update_fbo_texture(ctx, texObj, face, level); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + /* Give the texture to the driver. <pixels> may be null. */ + ASSERT(ctx->Driver.TexImage2D); + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, format, type, + pixels, &ctx->Unpack, texObj, texImage); + + ASSERT(texImage->TexFormat); + + check_gen_mipmap(ctx, target, texObj, level); + + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_2D || @@ -2394,35 +2409,35 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); - goto out; } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - width, height, depth, - border, internalFormat); + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } - ASSERT(ctx->Driver.TexImage3D); + ASSERT(texImage->Data == NULL); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat); - /* Give the texture to the driver! <pixels> may be null! */ - (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, - width, height, depth, border, format, type, - pixels, &ctx->Unpack, texObj, texImage); + /* Give the texture to the driver. <pixels> may be null. */ + ASSERT(ctx->Driver.TexImage3D); + ctx->Driver.TexImage3D(ctx, target, level, internalFormat, + width, height, depth, border, format, type, + pixels, &ctx->Unpack, texObj, texImage); - ASSERT(texImage->TexFormat); + ASSERT(texImage->TexFormat); - update_fbo_texture(ctx, texObj, face, level); + check_gen_mipmap(ctx, target, texObj, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + update_fbo_texture(ctx, texObj, face, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_3D || @@ -2508,23 +2523,24 @@ _mesa_TexSubImage1D( GLenum target, GLint level, texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (subtexture_error_check2(ctx, 1, target, level, xoffset, 0, 0, - postConvWidth, 1, 1, format, type, texImage)) { - goto out; /* error was detected */ + postConvWidth, 1, 1, + format, type, texImage)) { + /* error was recorded */ } + else if (width > 0) { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; - if (width == 0) - goto out; /* no-op, not an error */ + ASSERT(ctx->Driver.TexSubImage1D); + ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, + format, type, pixels, &ctx->Unpack, + texObj, texImage); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + check_gen_mipmap(ctx, target, texObj, level); - ASSERT(ctx->Driver.TexSubImage1D); - (*ctx->Driver.TexSubImage1D)(ctx, target, level, xoffset, width, - format, type, pixels, &ctx->Unpack, - texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2568,30 +2584,31 @@ _mesa_TexSubImage2D( GLenum target, GLint level, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (subtexture_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, 1, format, type, - texImage)) { - goto out; /* error was detected */ + postConvWidth, postConvHeight, 1, + format, type, texImage)) { + /* error was recorded */ } + else if (width > 0 && height >= 0) { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + + ASSERT(ctx->Driver.TexSubImage2D); + ctx->Driver.TexSubImage2D(ctx, target, level, xoffset, yoffset, + width, height, format, type, pixels, + &ctx->Unpack, texObj, texImage); - if (width == 0 || height == 0) - goto out; /* no-op, not an error */ + check_gen_mipmap(ctx, target, texObj, level); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - - ASSERT(ctx->Driver.TexSubImage2D); - (*ctx->Driver.TexSubImage2D)(ctx, target, level, xoffset, yoffset, - width, height, format, type, pixels, - &ctx->Unpack, texObj, texImage); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2632,28 +2649,30 @@ _mesa_TexSubImage3D( GLenum target, GLint level, { texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (subtexture_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, - width, height, depth, format, type, texImage)) { - goto out; /* error was detected */ + if (subtexture_error_check2(ctx, 3, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, texImage)) { + /* error was recorded */ } + else if (width > 0 && height > 0 && height > 0) { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + zoffset += texImage->Border; - if (width == 0 || height == 0 || height == 0) - goto out; /* no-op, not an error */ + ASSERT(ctx->Driver.TexSubImage3D); + ctx->Driver.TexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, type, pixels, + &ctx->Unpack, texObj, texImage ); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; + check_gen_mipmap(ctx, target, texObj, level); - ASSERT(ctx->Driver.TexSubImage3D); - (*ctx->Driver.TexSubImage3D)(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, - &ctx->Unpack, texObj, texImage ); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2694,38 +2713,39 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - goto out; } + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - - ASSERT(texImage->Data == NULL); + ASSERT(texImage->Data == NULL); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, - border, internalFormat); + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, + border, internalFormat); + ASSERT(ctx->Driver.CopyTexImage1D); + ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat, + x, y, width, border); - ASSERT(ctx->Driver.CopyTexImage1D); - (*ctx->Driver.CopyTexImage1D)(ctx, target, level, internalFormat, - x, y, width, border); + ASSERT(texImage->TexFormat); - ASSERT(texImage->TexFormat); + check_gen_mipmap(ctx, target, texObj, level); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2773,33 +2793,34 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - - ASSERT(texImage->Data == NULL); + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + + ASSERT(texImage->Data == NULL); + + clear_teximage_fields(texImage); /* not really needed, but helpful */ + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + + ASSERT(ctx->Driver.CopyTexImage2D); + ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat, + x, y, width, height, border); + + ASSERT(texImage->TexFormat); - clear_teximage_fields(texImage); /* not really needed, but helpful */ - _mesa_init_teximage_fields(ctx, target, texImage, - postConvWidth, postConvHeight, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CopyTexImage2D); - (*ctx->Driver.CopyTexImage2D)(ctx, target, level, internalFormat, - x, y, width, height, border); - - ASSERT(texImage->TexFormat); + check_gen_mipmap(ctx, target, texObj, level); - update_fbo_texture(ctx, texObj, face, level); + update_fbo_texture(ctx, texObj, face, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2844,23 +2865,25 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (copytexsubimage_error_check2(ctx, 1, target, level, xoffset, 0, 0, postConvWidth, 1, - texImage)) - goto out; - + texImage)) { + /* error was recorded */ + } + else { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage1D); + ctx->Driver.CopyTexSubImage1D(ctx, target, level, + xoffset, x, y, width); - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage1D); - ctx->Driver.CopyTexSubImage1D(ctx, target, level, - xoffset, x, y, width); - } + check_gen_mipmap(ctx, target, texObj, level); - ctx->NewState |= _NEW_TEXTURE; + ctx->NewState |= _NEW_TEXTURE; + } + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2903,24 +2926,29 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, } #endif - if (copytexsubimage_error_check2(ctx, 2, target, level, xoffset, yoffset, 0, - postConvWidth, postConvHeight, texImage)) - goto out; + if (copytexsubimage_error_check2(ctx, 2, target, level, + xoffset, yoffset, 0, + postConvWidth, postConvHeight, + texImage)) { + /* error was recorded */ + } + else { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage2D); + ctx->Driver.CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, + x, y, width, height); - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; + check_gen_mipmap(ctx, target, texObj, level); - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage2D); - ctx->Driver.CopyTexSubImage2D(ctx, target, level, - xoffset, yoffset, x, y, width, height); + ctx->NewState |= _NEW_TEXTURE; + } } - - ctx->NewState |= _NEW_TEXTURE; } - out: _mesa_unlock_texture(ctx, texObj); } @@ -2965,25 +2993,28 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (copytexsubimage_error_check2(ctx, 3, target, level, xoffset, yoffset, zoffset, postConvWidth, postConvHeight, - texImage)) - goto out; - - /* If we have a border, xoffset=-1 is legal. Bias by border width */ - xoffset += texImage->Border; - yoffset += texImage->Border; - zoffset += texImage->Border; - - if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, - &width, &height)) { - ASSERT(ctx->Driver.CopyTexSubImage3D); - ctx->Driver.CopyTexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, - x, y, width, height); + texImage)) { + /* error was recored */ } + else { + /* If we have a border, xoffset=-1 is legal. Bias by border width */ + xoffset += texImage->Border; + yoffset += texImage->Border; + zoffset += texImage->Border; + + if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y, + &width, &height)) { + ASSERT(ctx->Driver.CopyTexSubImage3D); + ctx->Driver.CopyTexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + x, y, width, height); - ctx->NewState |= _NEW_TEXTURE; + check_gen_mipmap(ctx, target, texObj, level); + + ctx->NewState |= _NEW_TEXTURE; + } + } } - out: _mesa_unlock_texture(ctx, texObj); } @@ -3217,28 +3248,29 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1D"); - goto out; - } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); } - ASSERT(texImage->Data == NULL); + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); + + _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, + border, internalFormat); - _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, - border, internalFormat); + ASSERT(ctx->Driver.CompressedTexImage1D); + ctx->Driver.CompressedTexImage1D(ctx, target, level, + internalFormat, width, border, + imageSize, data, + texObj, texImage); - ASSERT(ctx->Driver.CompressedTexImage1D); - (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, - internalFormat, width, border, - imageSize, data, - texObj, texImage); + check_gen_mipmap(ctx, target, texObj, level); - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } } - out: _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_1D) { @@ -3320,28 +3352,29 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - goto out; } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage2D); - (*ctx->Driver.CompressedTexImage2D)(ctx, target, level, - internalFormat, width, height, - border, imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); + + _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, + border, internalFormat); + + ASSERT(ctx->Driver.CompressedTexImage2D); + ctx->Driver.CompressedTexImage2D(ctx, target, level, + internalFormat, width, height, + border, imageSize, data, + texObj, texImage); + + check_gen_mipmap(ctx, target, texObj, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_2D || @@ -3421,29 +3454,31 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, texImage = _mesa_get_tex_image(ctx, texObj, target, level); if (!texImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3D"); - goto out; } - - if (texImage->Data) { - ctx->Driver.FreeTexImageData( ctx, texImage ); - } - ASSERT(texImage->Data == NULL); - - _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, - border, internalFormat); - - ASSERT(ctx->Driver.CompressedTexImage3D); - (*ctx->Driver.CompressedTexImage3D)(ctx, target, level, - internalFormat, - width, height, depth, - border, imageSize, data, - texObj, texImage); - - /* state update */ - texObj->_Complete = GL_FALSE; - ctx->NewState |= _NEW_TEXTURE; - } - out: + else { + if (texImage->Data) { + ctx->Driver.FreeTexImageData( ctx, texImage ); + } + ASSERT(texImage->Data == NULL); + + _mesa_init_teximage_fields(ctx, target, texImage, + width, height, depth, + border, internalFormat); + + ASSERT(ctx->Driver.CompressedTexImage3D); + ctx->Driver.CompressedTexImage3D(ctx, target, level, + internalFormat, + width, height, depth, + border, imageSize, data, + texObj, texImage); + + check_gen_mipmap(ctx, target, texObj, level); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + } _mesa_unlock_texture(ctx, texObj); } else if (target == GL_PROXY_TEXTURE_3D) { @@ -3509,6 +3544,7 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -3517,26 +3553,25 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, if ((GLint) format != texImage->InternalFormat) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCompressedTexSubImage1D(format)"); - goto out; } + else if ((width == 1 || width == 2) && + (GLuint) width != texImage->Width) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCompressedTexSubImage1D(width)"); + } + else if (width > 0) { + if (ctx->Driver.CompressedTexSubImage1D) { + ctx->Driver.CompressedTexSubImage1D(ctx, target, level, + xoffset, width, + format, imageSize, data, + texObj, texImage); + } - if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)"); - goto out; - } - - if (width == 0) - goto out; /* no-op, not an error */ + check_gen_mipmap(ctx, target, texObj, level); - if (ctx->Driver.CompressedTexSubImage1D) { - (*ctx->Driver.CompressedTexSubImage1D)(ctx, target, level, - xoffset, width, - format, imageSize, data, - texObj, texImage); + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; } - out: _mesa_unlock_texture(ctx, texObj); } @@ -3566,6 +3601,7 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -3574,27 +3610,26 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, if ((GLint) format != texImage->InternalFormat) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCompressedTexSubImage2D(format)"); - goto out; } - - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) { + else if (((width == 1 || width == 2) + && (GLuint) width != texImage->Width) || + ((height == 1 || height == 2) + && (GLuint) height != texImage->Height)) { _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); - goto out; } - - if (width == 0 || height == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage2D) { - (*ctx->Driver.CompressedTexSubImage2D)(ctx, target, level, + else if (width > 0 && height > 0) { + if (ctx->Driver.CompressedTexSubImage2D) { + ctx->Driver.CompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data, texObj, texImage); + } + + check_gen_mipmap(ctx, target, texObj, level); + + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; } - out: _mesa_unlock_texture(ctx, texObj); } @@ -3623,6 +3658,7 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -3631,29 +3667,29 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, if ((GLint) format != texImage->InternalFormat) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCompressedTexSubImage3D(format)"); - goto out; } - - if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) && (GLuint) height != texImage->Height) || - ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) { + else if (((width == 1 || width == 2) + && (GLuint) width != texImage->Width) || + ((height == 1 || height == 2) + && (GLuint) height != texImage->Height) || + ((depth == 1 || depth == 2) + && (GLuint) depth != texImage->Depth)) { _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); - goto out; } - - if (width == 0 || height == 0 || depth == 0) - goto out; /* no-op, not an error */ - - if (ctx->Driver.CompressedTexSubImage3D) { - (*ctx->Driver.CompressedTexSubImage3D)(ctx, target, level, + else if (width > 0 && height > 0 && depth > 0) { + if (ctx->Driver.CompressedTexSubImage3D) { + ctx->Driver.CompressedTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, texObj, texImage); + } + + check_gen_mipmap(ctx, target, texObj, level); + + ctx->NewState |= _NEW_TEXTURE; } - ctx->NewState |= _NEW_TEXTURE; } - out: _mesa_unlock_texture(ctx, texObj); } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index da55ac8697..31832184c0 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -29,9 +29,7 @@ #include "mfeatures.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "fbobject.h" @@ -194,9 +192,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) */ texObj->Target = 0x99; -#if FEATURE_colortable _mesa_free_colortable_data(&texObj->Palette); -#endif /* free the texture images */ for (face = 0; face < 6; face++) { @@ -495,7 +491,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->Image[face][baseLevel]->Width2 != w || t->Image[face][baseLevel]->Height2 != h) { t->_Complete = GL_FALSE; - incomplete(t, "Non-quare cubemap image"); + incomplete(t, "Cube face missing or mismatched size"); return; } } @@ -1102,8 +1098,6 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]); if (t) { t->Priority = CLAMP( priorities[i], 0.0F, 1.0F ); - if (ctx->Driver.PrioritizeTexture) - ctx->Driver.PrioritizeTexture( ctx, t, t->Priority ); } } } diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 8292d43eb6..16492bd7bc 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -31,9 +31,7 @@ #include "glheader.h" #include "mfeatures.h" #include "colormac.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "macros.h" @@ -309,10 +307,6 @@ _mesa_ActiveTextureARB(GLenum texture) /* update current stack pointer */ ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit]; } - - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit ); - } } @@ -362,9 +356,6 @@ update_texture_matrices( GLcontext *ctx ) 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, u, ctx->TextureMatrixStack[u].Top); } } } @@ -759,9 +750,7 @@ _mesa_init_texture(GLcontext *ctx) ctx->Texture.CurrentUnit = 0; /* multitexture */ ctx->Texture._EnabledUnits = 0x0; ctx->Texture.SharedPalette = GL_FALSE; -#if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); -#endif for (u = 0; u < MAX_TEXTURE_UNITS; u++) init_texture_unit(ctx, u); @@ -802,10 +791,8 @@ _mesa_free_texture_data(GLcontext *ctx) for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); -#if FEATURE_colortable for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) _mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable); -#endif } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index a22db628d3..f553a898f9 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -56,9 +56,7 @@ #include "bufferobj.h" #include "colormac.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "image.h" #include "macros.h" #include "mipmap.h" @@ -3302,32 +3300,9 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) } -/** - * Choose the actual storage format for a new texture image. - * Mainly, this is a wrapper for the driver's ChooseTextureFormat() function. - * Also set some other texImage fields related to texture compression, etc. - * \param ctx rendering context - * \param texImage the gl_texture_image - * \param dims texture dimensions (1, 2 or 3) - * \param format the user-specified format parameter - * \param type the user-specified type parameter - * \param internalFormat the user-specified internal format hint - */ static void -choose_texture_format(GLcontext *ctx, struct gl_texture_image *texImage, - GLuint dims, - GLenum format, GLenum type, GLint internalFormat) +compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) { - ASSERT(dims == 1 || dims == 2 || dims == 3); - ASSERT(ctx->Driver.ChooseTextureFormat); - - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); - - ASSERT(texImage->TexFormat); - - _mesa_set_fetch_functions(texImage, dims); - if (texImage->TexFormat->TexelBytes == 0) { /* must be a compressed format */ texImage->IsCompressed = GL_TRUE; @@ -3365,7 +3340,12 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLint sizeInBytes; (void) border; - choose_texture_format(ctx, texImage, 1, format, type, internalFormat); + texImage->TexFormat + = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); + ASSERT(texImage->TexFormat); + + _mesa_set_fetch_functions(texImage, 1); + compute_texture_size(ctx, texImage); /* allocate memory */ if (texImage->IsCompressed) @@ -3403,11 +3383,6 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3434,7 +3409,12 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, GLint texelBytes, sizeInBytes; (void) border; - choose_texture_format(ctx, texImage, 2, format, type, internalFormat); + texImage->TexFormat + = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); + ASSERT(texImage->TexFormat); + + _mesa_set_fetch_functions(texImage, 2); + compute_texture_size(ctx, texImage); texelBytes = texImage->TexFormat->TexelBytes; @@ -3481,11 +3461,6 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3508,7 +3483,12 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, GLint texelBytes, sizeInBytes; (void) border; - choose_texture_format(ctx, texImage, 3, format, type, internalFormat); + texImage->TexFormat + = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); + ASSERT(texImage->TexFormat); + + _mesa_set_fetch_functions(texImage, 3); + compute_texture_size(ctx, texImage); texelBytes = texImage->TexFormat->TexelBytes; @@ -3555,11 +3535,6 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3601,11 +3576,6 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3654,11 +3624,6 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3707,11 +3672,6 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); } @@ -3762,7 +3722,12 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->Depth == 1); ASSERT(texImage->Data == NULL); /* was freed in glCompressedTexImage2DARB */ - choose_texture_format(ctx, texImage, 2, 0, 0, internalFormat); + texImage->TexFormat + = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, 0, 0); + ASSERT(texImage->TexFormat); + + _mesa_set_fetch_functions(texImage, 2); + compute_texture_size(ctx, texImage); /* allocate storage */ texImage->Data = _mesa_alloc_texmemory(imageSize); @@ -3781,11 +3746,6 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->CompressedSize == (GLuint) imageSize); MEMCPY(texImage->Data, data, imageSize); - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } @@ -3891,11 +3851,6 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, src += srcRowStride; } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index becc67c29d..ef790c504e 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -129,6 +129,11 @@ extern void GLAPIENTRY _mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount ); +extern void GLAPIENTRY +_mesa_MultiDrawElementsBaseVertex( GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount, + const GLint *basevertex); extern void GLAPIENTRY _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, @@ -159,6 +164,16 @@ extern void GLAPIENTRY _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +extern void GLAPIENTRY +_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex); + +extern void GLAPIENTRY +_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, + GLint basevertex); + extern void _mesa_copy_client_array(GLcontext *ctx, diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index f24e11cc51..0cae1860a3 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.6.1 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -30,9 +30,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 6 -#define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-devel" +#define MESA_MINOR 7 +#define MESA_PATCH 0 +#define MESA_VERSION_STRING "7.7-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 8d6f560a80..c9eea8ab83 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -27,12 +27,18 @@ */ #include "glheader.h" +#include "api_arrayelt.h" #include "api_loopback.h" #include "context.h" #include "imports.h" #include "mtypes.h" #include "state.h" #include "vtxfmt.h" +#include "eval.h" +#include "dlist.h" + + +#if FEATURE_beginend /* The neutral vertex format. This wraps all tnl module functions, @@ -82,18 +88,16 @@ static void install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) { - SET_ArrayElement(tab, vfmt->ArrayElement); + _mesa_install_arrayelt_vtxfmt(tab, vfmt); + SET_Color3f(tab, vfmt->Color3f); SET_Color3fv(tab, vfmt->Color3fv); SET_Color4f(tab, vfmt->Color4f); SET_Color4fv(tab, vfmt->Color4fv); SET_EdgeFlag(tab, vfmt->EdgeFlag); - SET_EvalCoord1f(tab, vfmt->EvalCoord1f); - SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv); - SET_EvalCoord2f(tab, vfmt->EvalCoord2f); - SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv); - SET_EvalPoint1(tab, vfmt->EvalPoint1); - SET_EvalPoint2(tab, vfmt->EvalPoint2); + + _mesa_install_eval_vtxfmt(tab, vfmt); + SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); SET_Indexf(tab, vfmt->Indexf); @@ -125,8 +129,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_Vertex3fv(tab, vfmt->Vertex3fv); SET_Vertex4f(tab, vfmt->Vertex4f); SET_Vertex4fv(tab, vfmt->Vertex4fv); - SET_CallList(tab, vfmt->CallList); - SET_CallLists(tab, vfmt->CallLists); + + _mesa_install_dlist_vtxfmt(tab, vfmt); + SET_Begin(tab, vfmt->Begin); SET_End(tab, vfmt->End); SET_Rectf(tab, vfmt->Rectf); @@ -134,9 +139,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawElements(tab, vfmt->DrawElements); SET_DrawRangeElements(tab, vfmt->DrawRangeElements); SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT); - SET_EvalMesh1(tab, vfmt->EvalMesh1); - SET_EvalMesh2(tab, vfmt->EvalMesh2); - ASSERT(tab->EvalMesh2); + SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); + SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); + SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); @@ -193,3 +198,6 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) tnl->SwapCount = 0; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h index 76f108e023..fb6c23abe9 100644 --- a/src/mesa/main/vtxfmt.h +++ b/src/mesa/main/vtxfmt.h @@ -33,6 +33,8 @@ #ifndef _VTXFMT_H_ #define _VTXFMT_H_ +#if FEATURE_beginend + extern void _mesa_init_exec_vtxfmt( GLcontext *ctx ); extern void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ); @@ -40,4 +42,28 @@ extern void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfm extern void _mesa_restore_exec_vtxfmt( GLcontext *ctx ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_init_exec_vtxfmt( GLcontext *ctx ) +{ +} + +static INLINE void +_mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_restore_exec_vtxfmt( GLcontext *ctx ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* _VTXFMT_H_ */ diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h index 1308d0aa46..d56a2bb95e 100644 --- a/src/mesa/main/vtxfmt_tmp.h +++ b/src/mesa/main/vtxfmt_tmp.h @@ -354,6 +354,44 @@ static void GLAPIENTRY TAG(DrawRangeElements)( GLenum mode, GLuint start, CALL_DrawRangeElements(GET_DISPATCH(), ( mode, start, end, count, type, indices )); } +static void GLAPIENTRY TAG(DrawElementsBaseVertex)( GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + PRE_LOOPBACK( DrawElementsBaseVertex ); + CALL_DrawElementsBaseVertex(GET_DISPATCH(), ( mode, count, type, + indices, basevertex )); +} + +static void GLAPIENTRY TAG(DrawRangeElementsBaseVertex)( GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + PRE_LOOPBACK( DrawRangeElementsBaseVertex ); + CALL_DrawRangeElementsBaseVertex(GET_DISPATCH(), ( mode, start, end, + count, type, indices, + basevertex )); +} + +static void GLAPIENTRY TAG(MultiDrawElementsBaseVertex)( GLenum mode, + const GLsizei *count, + GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLint *basevertex) +{ + PRE_LOOPBACK( MultiDrawElementsBaseVertex ); + CALL_MultiDrawElementsBaseVertex(GET_DISPATCH(), ( mode, count, type, + indices, + primcount, basevertex )); +} + static void GLAPIENTRY TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 ) { PRE_LOOPBACK( EvalMesh1 ); @@ -534,6 +572,9 @@ static GLvertexformat TAG(vtxfmt) = { TAG(DrawElements), TAG(DrawRangeElements), TAG(MultiDrawElementsEXT), + TAG(DrawElementsBaseVertex), + TAG(DrawRangeElementsBaseVertex), + TAG(MultiDrawElementsBaseVertex), TAG(EvalMesh1), TAG(EvalMesh2) }; diff --git a/src/mesa/math/m_clip_tmp.h b/src/mesa/math/m_clip_tmp.h index f3a589be05..2e30964057 100644 --- a/src/mesa/math/m_clip_tmp.h +++ b/src/mesa/math/m_clip_tmp.h @@ -44,7 +44,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLfloat *from = (GLfloat *)clip_vec->start; @@ -66,16 +67,20 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, mask |= (((cw < -cx) << CLIP_LEFT_SHIFT)); mask |= (((cw < cy) << CLIP_TOP_SHIFT)); mask |= (((cw < -cy) << CLIP_BOTTOM_SHIFT)); - mask |= (((cw < cz) << CLIP_FAR_SHIFT)); - mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + if (viewport_z_clip) { + mask |= (((cw < cz) << CLIP_FAR_SHIFT)); + mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + } #else /* !defined(macintosh)) */ GLubyte mask = 0; if (-cx + cw < 0) mask |= CLIP_RIGHT_BIT; if ( cx + cw < 0) mask |= CLIP_LEFT_BIT; if (-cy + cw < 0) mask |= CLIP_TOP_BIT; if ( cy + cw < 0) mask |= CLIP_BOTTOM_BIT; - if (-cz + cw < 0) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if (-cz + cw < 0) mask |= CLIP_FAR_BIT; + if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + } #endif /* defined(macintosh) */ clipMask[i] = mask; @@ -119,7 +124,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -141,16 +147,20 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, mask |= (((cw < -cx) << CLIP_LEFT_SHIFT)); mask |= (((cw < cy) << CLIP_TOP_SHIFT)); mask |= (((cw < -cy) << CLIP_BOTTOM_SHIFT)); - mask |= (((cw < cz) << CLIP_FAR_SHIFT)); - mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + if (viewport_z_clip) { + mask |= (((cw < cz) << CLIP_FAR_SHIFT)); + mask |= (((cw < -cz) << CLIP_NEAR_SHIFT)); + } #else /* !defined(macintosh)) */ GLubyte mask = 0; if (-cx + cw < 0) mask |= CLIP_RIGHT_BIT; if ( cx + cw < 0) mask |= CLIP_LEFT_BIT; if (-cy + cw < 0) mask |= CLIP_TOP_BIT; if ( cy + cw < 0) mask |= CLIP_BOTTOM_BIT; - if (-cz + cw < 0) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if (-cz + cw < 0) mask |= CLIP_FAR_BIT; + if ( cz + cw < 0) mask |= CLIP_NEAR_BIT; + } #endif /* defined(macintosh) */ clipMask[i] = mask; @@ -171,7 +181,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -187,8 +198,10 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, else if (cx < -1.0) mask |= CLIP_LEFT_BIT; if (cy > 1.0) mask |= CLIP_TOP_BIT; else if (cy < -1.0) mask |= CLIP_BOTTOM_BIT; - if (cz > 1.0) mask |= CLIP_FAR_BIT; - else if (cz < -1.0) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if (cz > 1.0) mask |= CLIP_FAR_BIT; + else if (cz < -1.0) mask |= CLIP_NEAR_BIT; + } clipMask[i] = mask; tmpOrMask |= mask; tmpAndMask &= mask; @@ -204,7 +217,8 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -231,7 +245,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, } -static void TAG(init_c_cliptest)( void ) +void TAG(init_c_cliptest)( void ) { _mesa_clip_tab[4] = TAG(cliptest_points4); _mesa_clip_tab[3] = TAG(cliptest_points3); diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index 460fed4a75..95ae5a347d 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -67,7 +67,8 @@ static GLvector4f *ref_cliptest_points4( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -87,8 +88,10 @@ static GLvector4f *ref_cliptest_points4( GLvector4f *clip_vec, if ( cx + cw < 0 ) mask |= CLIP_LEFT_BIT; if ( -cy + cw < 0 ) mask |= CLIP_TOP_BIT; if ( cy + cw < 0 ) mask |= CLIP_BOTTOM_BIT; - if ( -cz + cw < 0 ) mask |= CLIP_FAR_BIT; - if ( cz + cw < 0 ) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if ( -cz + cw < 0 ) mask |= CLIP_FAR_BIT; + if ( cz + cw < 0 ) mask |= CLIP_NEAR_BIT; + } clipMask[i] = mask; if ( mask ) { c++; @@ -122,7 +125,8 @@ static GLvector4f *ref_cliptest_points3( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -138,8 +142,10 @@ static GLvector4f *ref_cliptest_points3( GLvector4f *clip_vec, else if ( cx < -1.0 ) mask |= CLIP_LEFT_BIT; if ( cy > 1.0 ) mask |= CLIP_TOP_BIT; else if ( cy < -1.0 ) mask |= CLIP_BOTTOM_BIT; - if ( cz > 1.0 ) mask |= CLIP_FAR_BIT; - else if ( cz < -1.0 ) mask |= CLIP_NEAR_BIT; + if (viewport_z_clip) { + if ( cz > 1.0 ) mask |= CLIP_FAR_BIT; + else if ( cz < -1.0 ) mask |= CLIP_NEAR_BIT; + } clipMask[i] = mask; tmpOrMask |= mask; tmpAndMask &= mask; @@ -154,7 +160,8 @@ static GLvector4f * ref_cliptest_points2( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ) + GLubyte *andMask, + GLboolean viewport_z_clip ) { const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; @@ -163,6 +170,9 @@ static GLvector4f * ref_cliptest_points2( GLvector4f *clip_vec, GLubyte tmpOrMask = *orMask; GLubyte tmpAndMask = *andMask; GLuint i; + + (void) viewport_z_clip; + for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) { const GLfloat cx = from[0], cy = from[1]; GLubyte mask = 0; @@ -208,6 +218,7 @@ static int test_cliptest_function( clip_func func, int np, #ifdef RUN_DEBUG_BENCHMARK int cycle_i; /* the counter for the benchmarks we run */ #endif + GLboolean viewport_z_clip = GL_TRUE; (void) cycles; @@ -247,15 +258,15 @@ static int test_cliptest_function( clip_func func, int np, dco = rco = 0; dca = rca = CLIP_FRUSTUM_BITS; - ref_cliptest[psize]( source, ref, rm, &rco, &rca ); + ref_cliptest[psize]( source, ref, rm, &rco, &rca, viewport_z_clip ); if ( mesa_profile ) { BEGIN_RACE( *cycles ); - func( source, dest, dm, &dco, &dca ); + func( source, dest, dm, &dco, &dca, viewport_z_clip ); END_RACE( *cycles ); } else { - func( source, dest, dm, &dco, &dca ); + func( source, dest, dm, &dco, &dca, viewport_z_clip ); } if ( dco != rco ) { diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index 7ef76e0b92..33421ad1c0 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -43,7 +43,8 @@ extern void _math_init_transformation(void); - +extern void +init_c_cliptest(void); /* KW: Clip functions now do projective divide as well. The projected * coordinates are very useful to us because they let us cull @@ -102,7 +103,8 @@ typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip, GLvector4f *vProj, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ); + GLubyte *andMask, + GLboolean viewport_z_clip ); typedef void (*dotprod_func)( GLfloat *out, GLuint out_stride, diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index fefef573ee..17843c2121 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -53,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -348,8 +349,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 183 -#define YY_END_OF_BUFFER 184 +#define YY_NUM_RULES 170 +#define YY_END_OF_BUFFER 171 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -357,82 +358,101 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[675] = +static yyconst flex_int16_t yy_accept[850] = { 0, - 0, 0, 184, 182, 180, 179, 182, 182, 152, 178, - 154, 154, 154, 154, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 180, 0, 0, 181, 152, 0, - 153, 155, 175, 175, 0, 0, 0, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 132, 176, 133, 134, - 166, 166, 166, 166, 0, 154, 0, 140, 141, 142, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 173, 0, 0, 0, + 0, 0, 171, 169, 167, 166, 169, 169, 139, 165, + 141, 141, 141, 141, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 167, 0, 0, 168, 139, + 0, 140, 142, 162, 162, 0, 0, 0, 0, 162, + 0, 0, 0, 0, 0, 0, 0, 119, 163, 120, + 121, 153, 153, 153, 153, 0, 141, 0, 127, 128, + 129, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 163, 163, 163, 164, 164, 165, 156, - 155, 156, 0, 157, 11, 13, 152, 15, 152, 152, - 16, 18, 152, 20, 22, 24, 26, 6, 28, 30, - 31, 33, 35, 38, 36, 40, 41, 43, 45, 47, - - 49, 51, 152, 152, 152, 53, 55, 152, 57, 59, - 61, 152, 63, 65, 67, 69, 152, 71, 73, 75, - 77, 152, 152, 152, 152, 152, 152, 0, 0, 0, - 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 93, 94, 96, 0, 171, 0, 0, 0, - 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 170, 169, 169, 122, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 160, 160, - 161, 162, 0, 158, 152, 152, 152, 152, 152, 152, - 152, 152, 143, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 144, 152, 152, 152, 152, 152, 152, - 152, 152, 10, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 0, 177, 0, 0, 0, 86, 87, - 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, + 159, 159, 159, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 150, 150, 151, 151, 152, 143, + 142, 143, 0, 144, 11, 12, 139, 13, 139, 139, + 14, 15, 139, 16, 17, 18, 19, 20, 21, 6, + + 22, 23, 24, 25, 26, 28, 27, 29, 30, 31, + 32, 33, 34, 35, 139, 139, 139, 139, 139, 40, + 41, 139, 42, 43, 44, 45, 46, 47, 48, 139, + 49, 50, 51, 52, 53, 54, 55, 139, 56, 57, + 58, 59, 139, 139, 64, 65, 139, 139, 139, 139, + 139, 139, 0, 0, 0, 0, 142, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 80, 81, 83, + 0, 158, 0, 0, 0, 0, 0, 0, 97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 156, 156, 109, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 147, 147, 148, 149, 0, 145, 11, + 11, 139, 12, 12, 12, 139, 139, 139, 139, 139, + 15, 15, 139, 130, 16, 16, 139, 17, 17, 139, + 18, 18, 139, 19, 19, 139, 20, 20, 139, 21, + 21, 139, 22, 22, 139, 24, 24, 139, 25, 25, + 139, 28, 28, 139, 27, 27, 139, 30, 30, 139, + 31, 31, 139, 32, 32, 139, 33, 33, 139, 34, + 34, 139, 35, 35, 139, 139, 139, 139, 36, 139, + 38, 139, 40, 40, 139, 41, 41, 139, 131, 42, + 42, 139, 43, 43, 139, 139, 45, 45, 139, 46, + + 46, 139, 47, 47, 139, 48, 48, 139, 139, 49, + 49, 139, 50, 50, 139, 51, 51, 139, 52, 52, + 139, 53, 53, 139, 54, 54, 139, 139, 10, 56, + 139, 57, 139, 58, 139, 59, 139, 60, 139, 62, + 139, 64, 64, 139, 139, 139, 139, 139, 139, 139, + 139, 0, 164, 0, 0, 0, 73, 74, 0, 0, + 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, - 126, 0, 128, 0, 0, 0, 0, 0, 0, 167, - 159, 152, 152, 152, 4, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 9, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 82, 152, 152, 0, 0, 0, - 0, 0, 88, 89, 0, 0, 0, 0, 97, 0, - 0, 101, 104, 0, 0, 0, 0, 0, 0, 0, - 115, 116, 0, 0, 0, 0, 121, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 152, 152, 152, - 152, 152, 152, 5, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 7, 8, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 83, - 152, 79, 0, 0, 0, 0, 137, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 107, 0, 111, 112, - 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 130, 131, 0, 0, 138, 12, 3, 14, - 148, 149, 152, 17, 19, 21, 23, 25, 27, 29, - 32, 34, 39, 37, 42, 44, 46, 48, 50, 52, - 54, 56, 58, 60, 62, 152, 152, 152, 64, 66, - 68, 70, 72, 74, 76, 78, 152, 81, 139, 0, - 0, 84, 0, 90, 0, 0, 0, 99, 0, 0, - - 0, 0, 0, 0, 113, 0, 0, 119, 106, 0, - 0, 0, 0, 0, 0, 135, 0, 152, 145, 146, - 152, 80, 0, 0, 0, 0, 92, 95, 100, 0, - 0, 105, 0, 0, 0, 118, 0, 0, 0, 0, - 127, 129, 0, 152, 152, 2, 1, 0, 91, 0, - 103, 0, 109, 117, 0, 0, 124, 125, 136, 152, - 147, 0, 102, 0, 120, 123, 152, 85, 108, 152, - 152, 150, 151, 0 + 0, 0, 0, 0, 155, 0, 0, 0, 113, 0, + 115, 0, 0, 0, 0, 0, 0, 154, 146, 139, + + 139, 139, 4, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 9, 37, 39, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 60, 139, 61, 62, 139, 63, 139, 139, 139, 139, + 139, 69, 139, 139, 0, 0, 0, 0, 0, 75, + 76, 0, 0, 0, 0, 84, 0, 0, 88, 91, + 0, 0, 0, 0, 0, 0, 0, 102, 103, 0, + 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 139, 139, 139, 139, 139, 139, + 5, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 7, 8, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 61, 139, 139, 63, 139, 139, + 139, 139, 139, 70, 139, 66, 0, 0, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 94, 0, 98, 99, 0, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 117, 118, 0, 0, + + 125, 11, 3, 12, 135, 136, 139, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 24, 25, 28, 27, + 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 139, 139, 139, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 139, + 139, 139, 139, 64, 65, 139, 68, 126, 0, 0, + 71, 0, 77, 0, 0, 0, 86, 0, 0, 0, + 0, 0, 0, 100, 0, 0, 106, 93, 0, 0, + 0, 0, 0, 0, 122, 0, 139, 132, 133, 139, + 60, 139, 62, 139, 67, 0, 0, 0, 0, 79, + + 82, 87, 0, 0, 92, 0, 0, 0, 105, 0, + 0, 0, 0, 114, 116, 0, 139, 139, 61, 63, + 2, 1, 0, 78, 0, 90, 0, 96, 104, 0, + 0, 111, 112, 123, 139, 134, 0, 89, 0, 107, + 110, 139, 72, 95, 139, 139, 137, 138, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -478,280 +498,357 @@ static yyconst flex_int32_t yy_meta[68] = 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[678] = +static yyconst flex_int16_t yy_base[853] = { 0, - 0, 0, 954, 955, 66, 955, 948, 949, 0, 69, - 85, 128, 140, 152, 151, 58, 39, 48, 75, 927, - 158, 160, 73, 59, 71, 170, 54, 920, 890, 889, - 901, 885, 899, 898, 142, 927, 939, 955, 0, 206, - 955, 189, 168, 171, 53, 27, 66, 119, 175, 899, - 885, 123, 170, 883, 895, 183, 955, 198, 225, 99, - 212, 219, 223, 227, 285, 297, 308, 955, 955, 955, - 904, 917, 911, 165, 900, 903, 899, 914, 224, 896, - 910, 194, 896, 909, 900, 913, 890, 901, 892, 294, - 893, 884, 893, 884, 883, 884, 878, 884, 895, 881, - - 878, 890, 893, 880, 873, 889, 865, 193, 139, 885, - 861, 846, 841, 858, 834, 839, 865, 167, 854, 259, - 849, 325, 282, 851, 832, 302, 842, 838, 833, 43, - 839, 825, 841, 838, 829, 305, 309, 831, 820, 834, - 837, 819, 834, 821, 818, 825, 275, 833, 254, 299, - 317, 327, 331, 810, 827, 828, 821, 803, 310, 804, - 826, 817, 316, 327, 331, 335, 339, 343, 347, 955, - 405, 416, 422, 428, 825, 240, 849, 0, 848, 831, - 821, 820, 840, 818, 817, 816, 815, 0, 814, 0, - 813, 812, 0, 811, 810, 0, 809, 808, 807, 806, - - 805, 804, 820, 813, 826, 800, 799, 805, 797, 796, - 795, 816, 793, 792, 791, 790, 800, 788, 787, 786, - 785, 777, 776, 761, 761, 760, 759, 802, 774, 762, - 434, 442, 416, 766, 186, 763, 757, 757, 751, 764, - 764, 749, 955, 955, 764, 752, 418, 759, 281, 756, - 762, 308, 757, 955, 748, 755, 754, 757, 743, 742, - 746, 741, 278, 746, 420, 428, 430, 955, 738, 736, - 736, 744, 745, 727, 421, 732, 738, 419, 426, 430, - 434, 438, 496, 502, 752, 764, 750, 749, 742, 756, - 746, 745, 0, 744, 743, 742, 741, 740, 739, 738, - - 737, 736, 735, 734, 733, 732, 731, 730, 733, 726, - 733, 726, 725, 0, 724, 723, 722, 725, 720, 719, - 718, 717, 0, 716, 715, 714, 713, 691, 685, 690, - 696, 679, 694, 315, 955, 693, 683, 687, 955, 955, - 677, 686, 672, 689, 672, 675, 669, 955, 670, 669, - 666, 673, 666, 674, 670, 680, 677, 659, 665, 672, - 656, 655, 673, 655, 667, 666, 955, 665, 655, 659, - 955, 646, 955, 651, 651, 659, 642, 643, 653, 955, - 955, 685, 667, 683, 0, 507, 681, 681, 680, 679, - 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, - - 668, 667, 666, 665, 652, 645, 0, 662, 661, 660, - 659, 658, 636, 656, 655, 654, 653, 652, 651, 650, - 649, 618, 621, 601, 0, 602, 595, 602, 601, 602, - 594, 612, 955, 955, 594, 592, 602, 595, 955, 590, - 607, 330, 955, 598, 582, 583, 592, 583, 582, 582, - 955, 581, 590, 580, 596, 593, 955, 592, 590, 579, - 580, 576, 568, 575, 570, 571, 566, 592, 592, 590, - 604, 603, 598, 0, 586, 585, 584, 583, 582, 581, - 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, - 570, 0, 0, 569, 568, 567, 566, 565, 509, 564, - - 563, 562, 561, 560, 559, 558, 557, 535, 535, 0, - 542, 0, 576, 575, 524, 542, 955, 537, 532, 525, - 521, 533, 523, 521, 517, 533, 524, 523, 955, 955, - 526, 955, 521, 514, 503, 514, 506, 510, 523, 518, - 521, 503, 955, 955, 515, 504, 955, 0, 0, 0, - 0, 0, 543, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1299, 1300, 66, 1300, 1293, 1294, 0, 69, + 85, 128, 140, 152, 151, 58, 56, 63, 76, 1272, + 158, 160, 39, 163, 173, 189, 52, 1265, 76, 1235, + 1234, 1246, 1230, 1244, 1243, 105, 1272, 1284, 1300, 0, + 225, 1300, 218, 160, 157, 20, 123, 66, 119, 192, + 1244, 1230, 54, 162, 1228, 1240, 194, 1300, 200, 195, + 98, 227, 196, 231, 235, 293, 305, 316, 1300, 1300, + 1300, 1249, 1262, 1256, 223, 1245, 1248, 1244, 1259, 107, + 298, 1241, 1255, 246, 1241, 1254, 1245, 1258, 1235, 1246, + 1237, 182, 1238, 1229, 1238, 1229, 1228, 1229, 144, 1223, + + 1229, 1240, 1231, 1225, 1222, 1223, 1227, 289, 1236, 1223, + 302, 1230, 1217, 1231, 1207, 65, 315, 276, 1227, 1226, + 1202, 1187, 1182, 1199, 1175, 1180, 1206, 279, 1195, 293, + 1190, 342, 299, 1192, 1173, 317, 1183, 1179, 1174, 207, + 1180, 1166, 1182, 1179, 1170, 320, 324, 1172, 1161, 1175, + 1178, 1160, 1175, 1162, 1159, 1166, 284, 1174, 227, 288, + 327, 342, 345, 1151, 1168, 1169, 1162, 1144, 318, 1145, + 1167, 1158, 330, 341, 345, 349, 353, 357, 361, 1300, + 419, 430, 436, 442, 440, 441, 1191, 0, 1190, 1173, + 1163, 443, 1183, 444, 451, 468, 470, 472, 471, 0, + + 496, 0, 497, 498, 0, 499, 500, 0, 524, 525, + 526, 536, 537, 553, 1178, 1171, 1184, 354, 356, 561, + 563, 1165, 564, 565, 1157, 580, 590, 591, 592, 1178, + 593, 617, 618, 619, 629, 630, 1155, 1165, 330, 362, + 419, 483, 445, 364, 646, 1153, 1145, 1144, 1129, 1129, + 1128, 1127, 1170, 1142, 1130, 662, 669, 643, 1134, 487, + 1131, 1125, 1125, 1119, 1132, 1132, 1117, 1300, 1300, 1132, + 1120, 646, 1127, 135, 1124, 1130, 561, 1125, 1300, 1116, + 1123, 1122, 1125, 1111, 1110, 1114, 1109, 448, 1114, 650, + 653, 665, 1300, 1106, 1104, 1104, 1112, 1113, 1095, 670, + + 1100, 1106, 486, 579, 655, 661, 668, 726, 732, 1112, + 682, 1119, 1110, 688, 730, 1117, 1116, 1109, 1123, 1113, + 1104, 712, 1111, 0, 1102, 731, 1109, 1100, 733, 1107, + 1098, 734, 1105, 1096, 736, 1103, 1094, 737, 1101, 1092, + 738, 1099, 1090, 739, 1097, 1088, 740, 1095, 1086, 741, + 1093, 1084, 742, 1091, 1082, 743, 1089, 1080, 744, 1087, + 1078, 745, 1085, 1076, 746, 1083, 1074, 747, 1081, 1072, + 748, 1079, 1070, 749, 1077, 1080, 1073, 1080, 0, 1073, + 0, 1088, 1063, 750, 1070, 1061, 751, 1068, 0, 1059, + 752, 1066, 1057, 755, 1064, 1063, 1054, 758, 1061, 1052, + + 776, 1059, 1050, 777, 1057, 1048, 779, 1055, 1058, 1045, + 780, 1052, 1043, 782, 1050, 1041, 783, 1048, 1039, 784, + 1046, 1037, 785, 1044, 1035, 786, 1042, 1041, 0, 1032, + 1039, 1030, 1037, 1028, 1035, 1026, 1033, 787, 1032, 788, + 1047, 1022, 789, 1029, 1028, 1006, 1000, 1005, 1011, 994, + 1009, 424, 1300, 1008, 998, 1002, 1300, 1300, 992, 1001, + 987, 1004, 987, 990, 984, 1300, 985, 984, 981, 988, + 981, 989, 985, 995, 992, 974, 980, 987, 971, 970, + 988, 970, 982, 981, 1300, 980, 970, 974, 1300, 961, + 1300, 966, 966, 974, 957, 958, 968, 1300, 1300, 1000, + + 982, 998, 0, 798, 996, 996, 995, 994, 993, 992, + 991, 990, 989, 988, 987, 986, 985, 984, 983, 982, + 981, 980, 979, 978, 965, 958, 0, 0, 0, 975, + 974, 973, 972, 971, 970, 969, 968, 967, 945, 965, + 964, 963, 962, 961, 960, 959, 958, 957, 956, 955, + 929, 936, 793, 927, 934, 794, 950, 949, 918, 921, + 901, 0, 902, 895, 902, 901, 902, 894, 912, 1300, + 1300, 894, 892, 902, 895, 1300, 890, 907, 516, 1300, + 898, 882, 883, 892, 883, 882, 882, 1300, 881, 890, + 880, 896, 893, 1300, 892, 890, 879, 880, 876, 868, + + 875, 870, 871, 866, 892, 892, 890, 904, 903, 898, + 0, 886, 885, 884, 883, 882, 881, 880, 879, 878, + 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, + 0, 0, 867, 866, 865, 864, 863, 862, 861, 860, + 859, 804, 858, 857, 856, 855, 854, 853, 852, 851, + 850, 849, 848, 865, 839, 846, 862, 836, 843, 841, + 840, 818, 818, 0, 825, 0, 859, 858, 807, 825, + 1300, 820, 815, 808, 804, 816, 806, 804, 800, 816, + 807, 806, 1300, 1300, 809, 1300, 804, 797, 786, 797, + 789, 793, 806, 801, 804, 786, 1300, 1300, 798, 787, + + 1300, 0, 0, 0, 0, 0, 826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 539, 538, 536, 0, 0, - 0, 0, 0, 0, 0, 0, 494, 0, 0, 545, - 544, 955, 491, 955, 495, 495, 504, 955, 488, 502, - - 483, 485, 482, 490, 955, 468, 479, 955, 955, 483, - 479, 472, 470, 470, 483, 955, 467, 507, 0, 0, - 507, 0, 514, 513, 472, 433, 955, 955, 955, 435, - 435, 955, 429, 386, 377, 955, 366, 365, 323, 328, - 955, 955, 339, 348, 337, 955, 955, 307, 955, 305, - 955, 257, 955, 955, 247, 221, 955, 955, 955, 236, - 0, 213, 955, 150, 955, 955, 232, 955, 955, 162, - 138, 0, 0, 955, 541, 108, 544 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 814, 813, 802, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, + 798, 779, 792, 0, 0, 656, 0, 0, 706, 702, + 1300, 649, 1300, 648, 648, 654, 1300, 637, 645, 610, + 612, 608, 608, 1300, 572, 583, 1300, 1300, 577, 573, + 560, 557, 542, 555, 1300, 539, 573, 0, 0, 572, + 0, 555, 0, 546, 0, 562, 551, 495, 479, 1300, + + 1300, 1300, 481, 481, 1300, 480, 443, 31, 1300, 141, + 166, 171, 186, 1300, 1300, 211, 236, 276, 0, 0, + 1300, 1300, 290, 1300, 325, 1300, 346, 1300, 1300, 343, + 341, 1300, 1300, 1300, 365, 0, 380, 1300, 371, 1300, + 1300, 486, 1300, 1300, 451, 458, 0, 0, 1300, 836, + 503, 839 } ; -static yyconst flex_int16_t yy_def[678] = +static yyconst flex_int16_t yy_def[853] = { 0, - 674, 1, 674, 674, 674, 674, 674, 675, 676, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 674, 674, 675, 674, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 677, 674, 674, 674, 674, 674, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 676, 676, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 676, - 676, 674, 674, 674, 674, 674, 676, 674, 674, 676, - 676, 676, 676, 0, 674, 674, 674 + 849, 1, 849, 849, 849, 849, 849, 850, 851, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 850, 849, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 852, 849, 849, 849, 849, + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 849, 849, 849, 849, + 849, 851, 849, 849, 851, 851, 851, 851, 0, 849, + 849, 849 } ; -static yyconst flex_int16_t yy_nxt[1023] = +static yyconst flex_int16_t yy_nxt[1368] = { 0, 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, 9, 9, 9, 20, 21, 22, 9, 23, 24, - 9, 25, 26, 27, 9, 9, 9, 28, 9, 9, - 9, 9, 9, 9, 9, 9, 29, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 30, 9, 31, 32, - 33, 9, 34, 9, 9, 9, 9, 35, 79, 35, - 40, 80, 129, 108, 96, 81, 130, 41, 42, 42, - 42, 42, 42, 42, 76, 82, 77, 97, 98, 240, - 99, 109, 78, 65, 66, 66, 66, 66, 66, 66, - - 83, 241, 94, 100, 67, 127, 84, 95, 128, 39, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 131, - 132, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 67, 133, 61, 62, 63, 64, 65, 66, 66, 66, - 66, 66, 66, 35, 160, 35, 68, 67, 65, 66, - 66, 66, 66, 66, 66, 219, 673, 161, 69, 67, - 65, 66, 66, 66, 66, 66, 66, 71, 220, 72, - 70, 67, 140, 67, 134, 90, 73, 135, 141, 86, - 672, 87, 74, 91, 75, 67, 88, 101, 92, 89, - 178, 102, 103, 104, 93, 105, 179, 67, 42, 42, - - 42, 42, 42, 42, 106, 189, 107, 40, 122, 123, - 123, 142, 126, 123, 669, 123, 136, 137, 123, 217, - 124, 124, 123, 190, 147, 143, 123, 125, 125, 123, - 218, 337, 144, 123, 122, 148, 184, 185, 149, 151, - 152, 150, 670, 671, 338, 153, 186, 118, 119, 45, - 46, 47, 48, 154, 50, 51, 123, 162, 52, 53, - 54, 55, 56, 57, 120, 59, 60, 668, 155, 121, - 156, 286, 667, 157, 158, 163, 163, 163, 163, 666, - 287, 159, 164, 163, 165, 166, 167, 163, 163, 168, - 169, 163, 163, 163, 171, 171, 171, 171, 171, 171, - - 230, 665, 664, 260, 172, 65, 66, 66, 66, 66, - 66, 66, 198, 261, 154, 173, 67, 174, 174, 174, - 174, 174, 174, 233, 233, 364, 349, 257, 365, 233, - 172, 199, 231, 258, 232, 232, 232, 232, 232, 232, - 233, 350, 67, 233, 233, 236, 233, 233, 262, 233, - 247, 233, 233, 353, 263, 273, 233, 663, 233, 233, - 233, 428, 662, 233, 233, 274, 354, 233, 265, 233, - 661, 264, 266, 267, 233, 233, 660, 429, 233, 278, - 278, 278, 278, 524, 659, 233, 525, 658, 657, 233, - 278, 278, 278, 278, 279, 278, 278, 280, 281, 278, - - 278, 278, 278, 278, 278, 278, 282, 278, 278, 278, - 278, 278, 278, 278, 42, 42, 42, 42, 42, 42, - 656, 655, 654, 283, 122, 284, 284, 284, 284, 284, - 284, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 232, 232, 232, 232, 232, 232, 653, - 122, 232, 232, 232, 232, 232, 232, 335, 335, 335, - 335, 335, 335, 335, 374, 335, 375, 335, 376, 335, - 335, 367, 335, 652, 335, 335, 335, 335, 335, 651, - 650, 377, 380, 380, 380, 380, 335, 649, 335, 380, - 380, 380, 380, 381, 380, 380, 380, 380, 380, 380, - - 380, 380, 380, 380, 380, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 471, 472, 576, - 577, 648, 647, 646, 645, 644, 643, 642, 641, 640, - 639, 638, 637, 636, 635, 634, 633, 632, 631, 473, - 578, 37, 37, 37, 170, 170, 630, 629, 628, 627, - 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, - 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, - 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, - 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 575, 574, - - 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, - 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, - 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, - 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 532, 531, 530, 529, 528, 527, 526, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, - 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, - 481, 480, 479, 478, 477, 476, 475, 474, 470, 469, - - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - 386, 385, 384, 383, 382, 379, 378, 373, 372, 371, - 370, 369, 368, 366, 363, 362, 361, 360, 359, 358, - - 357, 356, 355, 352, 351, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 336, 264, 236, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 285, 277, 276, 275, 272, - 271, 270, 269, 268, 259, 256, 255, 254, 253, 252, - 251, 250, 249, 248, 246, 245, 244, 243, 242, 239, - 238, 237, 235, 234, 162, 229, 228, 227, 226, 225, - - 224, 223, 222, 221, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, - 200, 197, 196, 195, 194, 193, 192, 191, 188, 187, - 183, 182, 181, 180, 177, 176, 175, 146, 145, 139, - 138, 38, 117, 116, 115, 114, 113, 112, 111, 110, - 85, 38, 36, 674, 3, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 9, 25, 26, 27, 28, 9, 9, 29, 9, 9, + 9, 9, 9, 9, 9, 9, 30, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 31, 9, 32, 33, + 34, 9, 35, 9, 9, 9, 9, 36, 96, 36, + 41, 116, 137, 97, 80, 138, 829, 42, 43, 43, + 43, 43, 43, 43, 77, 81, 78, 119, 82, 117, + 83, 238, 79, 66, 67, 67, 67, 67, 67, 67, + + 84, 85, 239, 150, 68, 120, 36, 86, 36, 151, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 141, + 142, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 68, 143, 62, 63, 64, 65, 66, 67, 67, 67, + 67, 67, 67, 170, 194, 195, 69, 68, 66, 67, + 67, 67, 67, 67, 67, 218, 171, 219, 70, 68, + 66, 67, 67, 67, 67, 67, 67, 72, 139, 73, + 71, 68, 140, 68, 144, 92, 74, 145, 98, 88, + 467, 89, 75, 93, 76, 68, 90, 99, 94, 91, + 101, 100, 102, 103, 95, 468, 830, 68, 136, 133, + + 210, 133, 133, 152, 133, 104, 105, 133, 106, 107, + 108, 109, 110, 134, 111, 133, 112, 153, 133, 211, + 135, 831, 113, 114, 154, 115, 41, 43, 43, 43, + 43, 43, 43, 146, 147, 157, 832, 132, 165, 133, + 166, 161, 162, 167, 168, 833, 158, 163, 188, 159, + 133, 169, 160, 265, 189, 164, 834, 201, 133, 174, + 173, 175, 176, 132, 835, 266, 128, 129, 46, 47, + 48, 49, 172, 51, 52, 202, 285, 53, 54, 55, + 56, 57, 58, 130, 60, 61, 286, 243, 131, 244, + 173, 173, 173, 173, 177, 173, 173, 178, 179, 173, + + 173, 173, 181, 181, 181, 181, 181, 181, 228, 836, + 196, 197, 182, 66, 67, 67, 67, 67, 67, 67, + 198, 232, 229, 183, 68, 184, 184, 184, 184, 184, + 184, 240, 134, 241, 255, 233, 282, 287, 182, 135, + 258, 258, 283, 288, 242, 837, 258, 430, 164, 256, + 68, 257, 257, 257, 257, 257, 257, 258, 258, 258, + 261, 258, 258, 298, 258, 272, 258, 258, 258, 258, + 431, 258, 381, 299, 258, 258, 379, 838, 258, 432, + 440, 289, 258, 290, 258, 258, 291, 292, 380, 258, + 382, 839, 258, 303, 303, 303, 303, 840, 441, 841, + + 258, 842, 433, 258, 303, 303, 303, 303, 304, 303, + 303, 305, 306, 303, 303, 303, 303, 303, 303, 303, + 307, 303, 303, 303, 303, 303, 303, 303, 43, 43, + 43, 43, 43, 43, 843, 844, 434, 308, 132, 309, + 309, 309, 309, 309, 309, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 310, 313, 435, + 321, 325, 311, 314, 132, 322, 326, 438, 328, 847, + 565, 311, 315, 329, 322, 326, 848, 311, 314, 439, + 312, 316, 329, 323, 327, 331, 566, 334, 340, 337, + 332, 330, 335, 341, 338, 482, 845, 846, 483, 332, + + 436, 335, 341, 338, 40, 332, 828, 335, 333, 338, + 336, 342, 339, 343, 346, 349, 352, 355, 344, 347, + 350, 353, 356, 437, 827, 826, 825, 344, 347, 350, + 353, 356, 455, 824, 347, 350, 345, 348, 351, 354, + 357, 358, 361, 364, 823, 456, 359, 362, 365, 498, + 498, 498, 498, 367, 370, 359, 362, 365, 368, 371, + 822, 359, 362, 365, 360, 363, 366, 368, 371, 678, + 373, 821, 679, 368, 371, 374, 369, 372, 383, 820, + 386, 390, 393, 384, 374, 387, 391, 394, 819, 818, + 374, 817, 384, 375, 387, 391, 394, 397, 816, 815, + + 814, 385, 398, 388, 392, 395, 471, 400, 403, 406, + 410, 398, 401, 404, 407, 411, 813, 398, 812, 472, + 399, 401, 404, 407, 411, 811, 810, 401, 404, 407, + 402, 405, 408, 412, 413, 416, 419, 809, 808, 414, + 417, 420, 498, 498, 498, 498, 422, 425, 414, 417, + 420, 423, 426, 807, 414, 417, 420, 415, 418, 421, + 423, 426, 806, 442, 805, 804, 423, 426, 443, 424, + 427, 257, 257, 257, 257, 257, 257, 443, 257, 257, + 257, 257, 257, 257, 453, 453, 444, 453, 453, 803, + 453, 453, 453, 453, 453, 453, 802, 453, 801, 310, + + 453, 453, 800, 799, 453, 313, 485, 453, 453, 798, + 797, 453, 453, 492, 796, 493, 795, 494, 499, 498, + 498, 498, 312, 453, 498, 498, 498, 498, 316, 321, + 495, 498, 498, 498, 498, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 313, 325, 501, + 328, 331, 323, 334, 337, 340, 343, 346, 349, 352, + 355, 358, 361, 364, 367, 370, 373, 383, 386, 390, + 316, 327, 393, 330, 333, 397, 336, 339, 342, 345, + 348, 351, 354, 357, 360, 363, 366, 369, 372, 375, + 385, 388, 392, 400, 403, 395, 406, 410, 399, 413, + + 416, 419, 422, 425, 551, 554, 442, 794, 608, 609, + 655, 658, 793, 792, 736, 737, 402, 405, 791, 408, + 412, 790, 415, 418, 421, 424, 427, 552, 555, 444, + 610, 789, 788, 656, 659, 738, 38, 38, 38, 180, + 180, 787, 786, 785, 784, 783, 782, 781, 780, 779, + 778, 777, 776, 775, 774, 773, 772, 771, 770, 769, + 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, + 758, 757, 756, 755, 754, 753, 659, 752, 751, 656, + 750, 749, 748, 747, 746, 745, 744, 743, 742, 741, + 740, 739, 735, 734, 733, 732, 731, 730, 729, 728, + + 727, 726, 725, 724, 723, 722, 721, 720, 719, 718, + 717, 716, 715, 714, 713, 712, 711, 710, 709, 708, + 707, 706, 705, 704, 703, 702, 701, 700, 699, 698, + 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, + 687, 686, 685, 684, 683, 682, 681, 680, 677, 676, + 675, 674, 673, 672, 671, 670, 669, 668, 667, 666, + 665, 664, 663, 662, 661, 660, 657, 555, 654, 552, + 653, 652, 651, 650, 649, 648, 647, 646, 645, 644, + 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, + 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, + 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, + 570, 569, 568, 567, 564, 563, 562, 561, 560, 559, + 558, 557, 444, 556, 553, 550, 437, 549, 435, 548, + 433, 547, 431, 546, 545, 427, 544, 424, 543, 421, + 542, 418, 541, 415, 540, 412, 539, 538, 408, 537, + 405, 536, 402, 535, 399, 534, 533, 395, 532, 392, + + 531, 388, 530, 385, 529, 528, 527, 526, 525, 524, + 375, 523, 372, 522, 369, 521, 366, 520, 363, 519, + 360, 518, 357, 517, 354, 516, 351, 515, 348, 514, + 345, 513, 342, 512, 339, 511, 336, 510, 333, 509, + 330, 508, 327, 507, 323, 506, 505, 504, 503, 502, + 316, 500, 312, 497, 496, 491, 490, 489, 488, 487, + 486, 484, 481, 480, 479, 478, 477, 476, 475, 474, + 473, 470, 469, 466, 465, 464, 463, 462, 461, 460, + 459, 458, 457, 454, 289, 261, 452, 451, 450, 449, + 448, 447, 446, 445, 429, 428, 409, 396, 389, 378, + + 377, 376, 324, 320, 319, 318, 317, 302, 301, 300, + 297, 296, 295, 294, 293, 284, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 271, 270, 269, 268, 267, + 264, 263, 262, 260, 259, 172, 254, 253, 252, 251, + 250, 249, 248, 247, 246, 245, 237, 236, 235, 234, + 231, 230, 227, 226, 225, 224, 223, 222, 221, 220, + 217, 216, 215, 214, 213, 212, 209, 208, 207, 206, + 205, 204, 203, 200, 199, 193, 192, 191, 190, 187, + 186, 185, 156, 155, 149, 148, 39, 127, 126, 125, + 124, 123, 122, 121, 118, 87, 39, 37, 849, 3, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; -static yyconst flex_int16_t yy_chk[1023] = +static yyconst flex_int16_t yy_chk[1368] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -759,113 +856,150 @@ static yyconst flex_int16_t yy_chk[1023] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 17, 5, - 10, 17, 46, 27, 24, 18, 46, 10, 10, 10, - 10, 10, 10, 10, 16, 18, 16, 24, 25, 130, - 25, 27, 16, 11, 11, 11, 11, 11, 11, 11, - - 19, 130, 23, 25, 11, 45, 19, 23, 45, 676, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 47, - 47, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 47, 10, 10, 10, 10, 12, 12, 12, 12, - 12, 12, 12, 35, 60, 35, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 109, 671, 60, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 15, 109, 15, - 14, 14, 52, 12, 48, 22, 15, 48, 52, 21, - 670, 21, 15, 22, 15, 13, 21, 26, 22, 21, - 74, 26, 26, 26, 22, 26, 74, 14, 42, 42, - - 42, 42, 42, 42, 26, 82, 26, 40, 42, 43, - 43, 53, 44, 44, 664, 43, 49, 49, 44, 108, - 118, 43, 49, 82, 56, 53, 43, 118, 43, 44, - 108, 235, 53, 49, 42, 56, 79, 79, 56, 58, - 58, 56, 667, 667, 235, 58, 79, 40, 40, 40, - 40, 40, 40, 58, 40, 40, 58, 61, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 662, 59, 40, - 59, 176, 660, 59, 59, 61, 61, 61, 61, 656, - 176, 59, 62, 62, 62, 62, 63, 63, 63, 63, - 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, - - 120, 655, 652, 149, 65, 66, 66, 66, 66, 66, - 66, 66, 90, 149, 120, 67, 66, 67, 67, 67, - 67, 67, 67, 123, 123, 263, 249, 147, 263, 123, - 65, 90, 122, 147, 122, 122, 122, 122, 122, 122, - 123, 249, 66, 126, 126, 126, 136, 136, 150, 126, - 137, 137, 136, 252, 150, 159, 137, 650, 151, 151, - 126, 334, 648, 136, 151, 159, 252, 137, 152, 152, - 645, 151, 153, 153, 152, 151, 644, 334, 153, 163, - 163, 163, 163, 442, 643, 152, 442, 640, 639, 153, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 166, - - 166, 166, 167, 167, 167, 167, 168, 168, 168, 168, - 169, 169, 169, 169, 171, 171, 171, 171, 171, 171, - 638, 637, 635, 172, 171, 172, 172, 172, 172, 172, - 172, 173, 173, 173, 173, 173, 173, 174, 174, 174, - 174, 174, 174, 231, 231, 231, 231, 231, 231, 634, - 171, 232, 232, 232, 232, 232, 232, 233, 233, 247, - 247, 265, 265, 233, 275, 247, 275, 265, 275, 266, - 266, 267, 267, 633, 233, 266, 247, 267, 265, 631, - 630, 275, 278, 278, 278, 278, 266, 626, 267, 279, - 279, 279, 279, 280, 280, 280, 280, 281, 281, 281, - - 281, 282, 282, 282, 282, 283, 283, 283, 283, 283, - 283, 284, 284, 284, 284, 284, 284, 386, 386, 499, - 499, 625, 624, 623, 621, 618, 617, 615, 614, 613, - 612, 611, 610, 607, 606, 604, 603, 602, 601, 386, - 499, 675, 675, 675, 677, 677, 600, 599, 597, 596, - 595, 593, 591, 590, 587, 578, 577, 576, 553, 546, - 545, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 531, 528, 527, 526, 525, 524, 523, 522, 521, - 520, 519, 518, 516, 515, 514, 513, 511, 509, 508, - 507, 506, 505, 504, 503, 502, 501, 500, 498, 497, - - 496, 495, 494, 491, 490, 489, 488, 487, 486, 485, - 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, - 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 456, 455, 454, 453, - 452, 450, 449, 448, 447, 446, 445, 444, 441, 440, - 438, 437, 436, 435, 432, 431, 430, 429, 428, 427, - 426, 424, 423, 422, 421, 420, 419, 418, 417, 416, - 415, 414, 413, 412, 411, 410, 409, 408, 406, 405, - 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, - 394, 393, 392, 391, 390, 389, 388, 387, 384, 383, - - 382, 379, 378, 377, 376, 375, 374, 372, 370, 369, - 368, 366, 365, 364, 363, 362, 361, 360, 359, 358, - 357, 356, 355, 354, 353, 352, 351, 350, 349, 347, - 346, 345, 344, 343, 342, 341, 338, 337, 336, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 322, - 321, 320, 319, 318, 317, 316, 315, 313, 312, 311, - 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, - 300, 299, 298, 297, 296, 295, 294, 292, 291, 290, - 289, 288, 287, 286, 285, 277, 276, 274, 273, 272, - 271, 270, 269, 264, 262, 261, 260, 259, 258, 257, - - 256, 255, 253, 251, 250, 248, 246, 245, 242, 241, - 240, 239, 238, 237, 236, 234, 230, 229, 228, 227, - 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, - 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, - 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 195, 194, 192, 191, 189, 187, 186, 185, 184, 183, - 182, 181, 180, 179, 177, 175, 162, 161, 160, 158, - 157, 156, 155, 154, 148, 146, 145, 144, 143, 142, - 141, 140, 139, 138, 135, 134, 133, 132, 131, 129, - 128, 127, 125, 124, 121, 119, 117, 116, 115, 114, - - 113, 112, 111, 110, 107, 106, 105, 104, 103, 102, - 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, - 91, 89, 88, 87, 86, 85, 84, 83, 81, 80, - 78, 77, 76, 75, 73, 72, 71, 55, 54, 51, - 50, 37, 36, 34, 33, 32, 31, 30, 29, 28, - 20, 8, 7, 3, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 1, 1, 1, 1, 1, 1, 1, 5, 23, 5, + 10, 27, 46, 23, 17, 46, 808, 10, 10, 10, + 10, 10, 10, 10, 16, 17, 16, 29, 17, 27, + 18, 116, 16, 11, 11, 11, 11, 11, 11, 11, + + 18, 19, 116, 53, 11, 29, 36, 19, 36, 53, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 48, + 48, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 48, 10, 10, 10, 10, 12, 12, 12, 12, + 12, 12, 12, 61, 80, 80, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 99, 61, 99, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 15, 47, 15, + 14, 14, 47, 12, 49, 22, 15, 49, 24, 21, + 274, 21, 15, 22, 15, 13, 21, 24, 22, 21, + 25, 24, 25, 25, 22, 274, 810, 14, 45, 45, + + 92, 44, 44, 54, 45, 25, 26, 44, 26, 26, + 26, 26, 26, 44, 26, 45, 26, 54, 44, 92, + 44, 811, 26, 26, 54, 26, 41, 43, 43, 43, + 43, 43, 43, 50, 50, 57, 812, 43, 60, 50, + 60, 59, 59, 60, 60, 813, 57, 59, 75, 57, + 50, 60, 57, 140, 75, 59, 816, 84, 59, 63, + 63, 63, 63, 43, 817, 140, 41, 41, 41, 41, + 41, 41, 62, 41, 41, 84, 159, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 159, 118, 41, 118, + 62, 62, 62, 62, 64, 64, 64, 64, 65, 65, + + 65, 65, 66, 66, 66, 66, 66, 66, 108, 818, + 81, 81, 66, 67, 67, 67, 67, 67, 67, 67, + 81, 111, 108, 68, 67, 68, 68, 68, 68, 68, + 68, 117, 128, 117, 130, 111, 157, 160, 66, 128, + 133, 133, 157, 160, 117, 823, 133, 239, 130, 132, + 67, 132, 132, 132, 132, 132, 132, 133, 136, 136, + 136, 146, 146, 169, 136, 147, 147, 146, 161, 161, + 239, 147, 219, 169, 161, 136, 218, 825, 146, 240, + 244, 161, 147, 162, 162, 161, 163, 163, 218, 162, + 219, 827, 163, 173, 173, 173, 173, 830, 244, 831, + + 162, 835, 240, 163, 174, 174, 174, 174, 175, 175, + 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, + 178, 178, 178, 178, 179, 179, 179, 179, 181, 181, + 181, 181, 181, 181, 837, 839, 241, 182, 181, 182, + 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, + 183, 184, 184, 184, 184, 184, 184, 185, 186, 241, + 192, 194, 185, 186, 181, 192, 194, 243, 195, 845, + 452, 185, 186, 195, 192, 194, 846, 185, 186, 243, + 185, 186, 195, 192, 194, 196, 452, 197, 199, 198, + 196, 195, 197, 199, 198, 288, 842, 842, 288, 196, + + 242, 197, 199, 198, 851, 196, 807, 197, 196, 198, + 197, 199, 198, 201, 203, 204, 206, 207, 201, 203, + 204, 206, 207, 242, 806, 804, 803, 201, 203, 204, + 206, 207, 260, 799, 203, 204, 201, 203, 204, 206, + 207, 209, 210, 211, 798, 260, 209, 210, 211, 303, + 303, 303, 303, 212, 213, 209, 210, 211, 212, 213, + 797, 209, 210, 211, 209, 210, 211, 212, 213, 579, + 214, 796, 579, 212, 213, 214, 212, 213, 220, 794, + 221, 223, 224, 220, 214, 221, 223, 224, 792, 790, + 214, 787, 220, 214, 221, 223, 224, 226, 786, 784, + + 783, 220, 226, 221, 223, 224, 277, 227, 228, 229, + 231, 226, 227, 228, 229, 231, 782, 226, 781, 277, + 226, 227, 228, 229, 231, 780, 779, 227, 228, 229, + 227, 228, 229, 231, 232, 233, 234, 776, 775, 232, + 233, 234, 304, 304, 304, 304, 235, 236, 232, 233, + 234, 235, 236, 773, 232, 233, 234, 232, 233, 234, + 235, 236, 772, 245, 771, 770, 235, 236, 245, 235, + 236, 256, 256, 256, 256, 256, 256, 245, 257, 257, + 257, 257, 257, 257, 258, 258, 245, 272, 272, 769, + 258, 290, 290, 272, 291, 291, 768, 290, 766, 311, + + 291, 258, 765, 764, 272, 314, 292, 292, 290, 762, + 760, 291, 292, 300, 759, 300, 756, 300, 305, 305, + 305, 305, 311, 292, 306, 306, 306, 306, 314, 322, + 300, 307, 307, 307, 307, 308, 308, 308, 308, 308, + 308, 309, 309, 309, 309, 309, 309, 315, 326, 315, + 329, 332, 322, 335, 338, 341, 344, 347, 350, 353, + 356, 359, 362, 365, 368, 371, 374, 384, 387, 391, + 315, 326, 394, 329, 332, 398, 335, 338, 341, 344, + 347, 350, 353, 356, 359, 362, 365, 368, 371, 374, + 384, 387, 391, 401, 404, 394, 407, 411, 398, 414, + + 417, 420, 423, 426, 438, 440, 443, 753, 504, 504, + 553, 556, 752, 751, 642, 642, 401, 404, 750, 407, + 411, 738, 414, 417, 420, 423, 426, 438, 440, 443, + 504, 737, 736, 553, 556, 642, 850, 850, 850, 852, + 852, 707, 700, 699, 696, 695, 694, 693, 692, 691, + 690, 689, 688, 687, 685, 682, 681, 680, 679, 678, + 677, 676, 675, 674, 673, 672, 670, 669, 668, 667, + 665, 663, 662, 661, 660, 659, 658, 657, 656, 655, + 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, + 644, 643, 641, 640, 639, 638, 637, 636, 635, 634, + + 633, 630, 629, 628, 627, 626, 625, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 593, 592, 591, 590, + 589, 587, 586, 585, 584, 583, 582, 581, 578, 577, + 575, 574, 573, 572, 569, 568, 567, 566, 565, 564, + 563, 561, 560, 559, 558, 557, 555, 554, 552, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, + 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, + 530, 526, 525, 524, 523, 522, 521, 520, 519, 518, + + 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, + 507, 506, 505, 502, 501, 500, 497, 496, 495, 494, + 493, 492, 490, 488, 487, 486, 484, 483, 482, 481, + 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, + 470, 469, 468, 467, 465, 464, 463, 462, 461, 460, + 459, 456, 455, 454, 451, 450, 449, 448, 447, 446, + 445, 444, 442, 441, 439, 437, 436, 435, 434, 433, + 432, 431, 430, 428, 427, 425, 424, 422, 421, 419, + 418, 416, 415, 413, 412, 410, 409, 408, 406, 405, + 403, 402, 400, 399, 397, 396, 395, 393, 392, 390, + + 388, 386, 385, 383, 382, 380, 378, 377, 376, 375, + 373, 372, 370, 369, 367, 366, 364, 363, 361, 360, + 358, 357, 355, 354, 352, 351, 349, 348, 346, 345, + 343, 342, 340, 339, 337, 336, 334, 333, 331, 330, + 328, 327, 325, 323, 321, 320, 319, 318, 317, 316, + 313, 312, 310, 302, 301, 299, 298, 297, 296, 295, + 294, 289, 287, 286, 285, 284, 283, 282, 281, 280, + 278, 276, 275, 273, 271, 270, 267, 266, 265, 264, + 263, 262, 261, 259, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 238, 237, 230, 225, 222, 217, + + 216, 215, 193, 191, 190, 189, 187, 172, 171, 170, + 168, 167, 166, 165, 164, 158, 156, 155, 154, 153, + 152, 151, 150, 149, 148, 145, 144, 143, 142, 141, + 139, 138, 137, 135, 134, 131, 129, 127, 126, 125, + 124, 123, 122, 121, 120, 119, 115, 114, 113, 112, + 110, 109, 107, 106, 105, 104, 103, 102, 101, 100, + 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, + 87, 86, 85, 83, 82, 79, 78, 77, 76, 74, + 73, 72, 56, 55, 52, 51, 38, 37, 35, 34, + 33, 32, 31, 30, 28, 20, 8, 7, 3, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; /* The intent behind this definition is that it'll catch @@ -904,22 +1038,27 @@ static yyconst flex_int16_t yy_chk[1023] = #include "prog_instruction.h" #include "prog_statevars.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) +#ifndef HAVE_UNISTD_H +#define YY_NO_UNISTD_H +#endif + #define return_token_or_IDENTIFIER(condition, token) \ do { \ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -934,15 +1073,16 @@ static yyconst flex_int16_t yy_chk[1023] = } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -991,6 +1131,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -1004,7 +1153,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1008 "lex.yy.c" +#line 1157 "lex.yy.c" #define INITIAL 0 @@ -1149,7 +1298,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1160,7 +1309,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1245,10 +1394,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 137 "program_lexer.l" +#line 157 "program_lexer.l" -#line 1252 "lex.yy.c" +#line 1401 "lex.yy.c" yylval = yylval_param; @@ -1305,13 +1454,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 955 ); + while ( yy_base[yy_current_state] != 1300 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1337,17 +1486,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 159 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 160 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 141 "program_lexer.l" +#line 161 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1355,813 +1504,745 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 165 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 166 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 167 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 168 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 169 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 170 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 171 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 153 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, ABS, OFF); } +#line 173 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 154 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } +#line 174 "program_lexer.l" +{ return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 155 "program_lexer.l" -{ return_opcode( 1, BIN_OP, ADD, OFF); } +#line 175 "program_lexer.l" +{ return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 156 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } +#line 177 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 157 "program_lexer.l" -{ return_opcode(require_ARB_vp, ARL, ARL, OFF); } +#line 178 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 159 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } +#line 180 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 160 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } +#line 181 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 161 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } +#line 182 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 162 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } +#line 183 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 164 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP3, OFF); } +#line 184 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 165 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } +#line 185 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 166 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP4, OFF); } +#line 187 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 167 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } +#line 188 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 168 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DPH, OFF); } +#line 190 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 169 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } +#line 191 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 170 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DST, OFF); } +#line 193 "program_lexer.l" +{ return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 171 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } +#line 195 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 173 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, EX2, OFF); } +#line 196 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 174 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } +#line 197 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 175 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } +#line 198 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 177 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FLR, OFF); } +#line 200 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 178 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } +#line 201 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 179 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FRC, OFF); } +#line 202 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 180 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } +#line 203 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 182 "program_lexer.l" -{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } +#line 204 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 184 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, LIT, OFF); } +#line 206 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 185 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } +#line 207 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 186 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, LG2, OFF); } +#line 208 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 187 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } +#line 209 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 188 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } +#line 210 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 189 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } +#line 212 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 190 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } +#line 213 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 192 "program_lexer.l" -{ return_opcode( 1, TRI_OP, MAD, OFF); } +#line 214 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 193 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } +#line 216 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 194 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MAX, OFF); } +#line 217 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 195 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } +#line 218 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 196 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MIN, OFF); } +#line 219 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 197 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } +#line 220 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 198 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, MOV, OFF); } +#line 221 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 199 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } +#line 222 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 200 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MUL, OFF); } +#line 223 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 201 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } +#line 224 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 203 "program_lexer.l" -{ return_opcode( 1, BINSC_OP, POW, OFF); } +#line 225 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 204 "program_lexer.l" -{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } +#line 226 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 206 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RCP, OFF); } +#line 227 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 207 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +#line 229 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 208 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } +#line 230 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 209 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } +#line 231 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 211 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } +#line 232 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 212 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +#line 234 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 213 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SGE, OFF); } +#line 235 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 214 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +#line 236 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } YY_BREAK case 63: YY_RULE_SETUP -#line 215 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } +#line 237 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } YY_BREAK case 64: YY_RULE_SETUP -#line 216 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +#line 239 "program_lexer.l" +{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 65: YY_RULE_SETUP -#line 217 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SLT, OFF); } +#line 240 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 66: YY_RULE_SETUP -#line 218 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +#line 242 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 67: YY_RULE_SETUP -#line 219 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SUB, OFF); } +#line 243 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 68: YY_RULE_SETUP -#line 220 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } +#line 244 "program_lexer.l" +{ return PROGRAM; } YY_BREAK case 69: YY_RULE_SETUP -#line 221 "program_lexer.l" -{ return_opcode( 1, SWZ, SWZ, OFF); } +#line 245 "program_lexer.l" +{ return STATE; } YY_BREAK case 70: YY_RULE_SETUP -#line 222 "program_lexer.l" -{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } +#line 246 "program_lexer.l" +{ return RESULT; } YY_BREAK case 71: YY_RULE_SETUP -#line 224 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } +#line 248 "program_lexer.l" +{ return AMBIENT; } YY_BREAK case 72: YY_RULE_SETUP -#line 225 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } +#line 249 "program_lexer.l" +{ return ATTENUATION; } YY_BREAK case 73: YY_RULE_SETUP -#line 226 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } +#line 250 "program_lexer.l" +{ return BACK; } YY_BREAK case 74: YY_RULE_SETUP -#line 227 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +#line 251 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 75: YY_RULE_SETUP -#line 228 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } +#line 252 "program_lexer.l" +{ return COLOR; } YY_BREAK case 76: YY_RULE_SETUP -#line 229 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } +#line 253 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 77: YY_RULE_SETUP -#line 231 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, OFF); } +#line 254 "program_lexer.l" +{ return DIFFUSE; } YY_BREAK case 78: YY_RULE_SETUP -#line 232 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +#line 255 "program_lexer.l" +{ return DIRECTION; } YY_BREAK case 79: YY_RULE_SETUP -#line 234 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +#line 256 "program_lexer.l" +{ return EMISSION; } YY_BREAK case 80: YY_RULE_SETUP -#line 235 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +#line 257 "program_lexer.l" +{ return ENV; } YY_BREAK case 81: YY_RULE_SETUP -#line 236 "program_lexer.l" -{ return PROGRAM; } +#line 258 "program_lexer.l" +{ return EYE; } YY_BREAK case 82: YY_RULE_SETUP -#line 237 "program_lexer.l" -{ return STATE; } +#line 259 "program_lexer.l" +{ return FOGCOORD; } YY_BREAK case 83: YY_RULE_SETUP -#line 238 "program_lexer.l" -{ return RESULT; } +#line 260 "program_lexer.l" +{ return FOG; } YY_BREAK case 84: YY_RULE_SETUP -#line 240 "program_lexer.l" -{ return AMBIENT; } +#line 261 "program_lexer.l" +{ return FRONT; } YY_BREAK case 85: YY_RULE_SETUP -#line 241 "program_lexer.l" -{ return ATTENUATION; } +#line 262 "program_lexer.l" +{ return HALF; } YY_BREAK case 86: YY_RULE_SETUP -#line 242 "program_lexer.l" -{ return BACK; } +#line 263 "program_lexer.l" +{ return INVERSE; } YY_BREAK case 87: YY_RULE_SETUP -#line 243 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } +#line 264 "program_lexer.l" +{ return INVTRANS; } YY_BREAK case 88: YY_RULE_SETUP -#line 244 "program_lexer.l" -{ return COLOR; } +#line 265 "program_lexer.l" +{ return LIGHT; } YY_BREAK case 89: YY_RULE_SETUP -#line 245 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } +#line 266 "program_lexer.l" +{ return LIGHTMODEL; } YY_BREAK case 90: YY_RULE_SETUP -#line 246 "program_lexer.l" -{ return DIFFUSE; } +#line 267 "program_lexer.l" +{ return LIGHTPROD; } YY_BREAK case 91: YY_RULE_SETUP -#line 247 "program_lexer.l" -{ return DIRECTION; } +#line 268 "program_lexer.l" +{ return LOCAL; } YY_BREAK case 92: YY_RULE_SETUP -#line 248 "program_lexer.l" -{ return EMISSION; } +#line 269 "program_lexer.l" +{ return MATERIAL; } YY_BREAK case 93: YY_RULE_SETUP -#line 249 "program_lexer.l" -{ return ENV; } +#line 270 "program_lexer.l" +{ return MAT_PROGRAM; } YY_BREAK case 94: YY_RULE_SETUP -#line 250 "program_lexer.l" -{ return EYE; } +#line 271 "program_lexer.l" +{ return MATRIX; } YY_BREAK case 95: YY_RULE_SETUP -#line 251 "program_lexer.l" -{ return FOGCOORD; } +#line 272 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 96: YY_RULE_SETUP -#line 252 "program_lexer.l" -{ return FOG; } +#line 273 "program_lexer.l" +{ return MODELVIEW; } YY_BREAK case 97: YY_RULE_SETUP -#line 253 "program_lexer.l" -{ return FRONT; } +#line 274 "program_lexer.l" +{ return MVP; } YY_BREAK case 98: YY_RULE_SETUP -#line 254 "program_lexer.l" -{ return HALF; } +#line 275 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 99: YY_RULE_SETUP -#line 255 "program_lexer.l" -{ return INVERSE; } +#line 276 "program_lexer.l" +{ return OBJECT; } YY_BREAK case 100: YY_RULE_SETUP -#line 256 "program_lexer.l" -{ return INVTRANS; } +#line 277 "program_lexer.l" +{ return PALETTE; } YY_BREAK case 101: YY_RULE_SETUP -#line 257 "program_lexer.l" -{ return LIGHT; } +#line 278 "program_lexer.l" +{ return PARAMS; } YY_BREAK case 102: YY_RULE_SETUP -#line 258 "program_lexer.l" -{ return LIGHTMODEL; } +#line 279 "program_lexer.l" +{ return PLANE; } YY_BREAK case 103: YY_RULE_SETUP -#line 259 "program_lexer.l" -{ return LIGHTPROD; } +#line 280 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 104: YY_RULE_SETUP -#line 260 "program_lexer.l" -{ return LOCAL; } +#line 281 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 105: YY_RULE_SETUP -#line 261 "program_lexer.l" -{ return MATERIAL; } +#line 282 "program_lexer.l" +{ return POSITION; } YY_BREAK case 106: YY_RULE_SETUP -#line 262 "program_lexer.l" -{ return MAT_PROGRAM; } +#line 283 "program_lexer.l" +{ return PRIMARY; } YY_BREAK case 107: YY_RULE_SETUP -#line 263 "program_lexer.l" -{ return MATRIX; } +#line 284 "program_lexer.l" +{ return PROJECTION; } YY_BREAK case 108: YY_RULE_SETUP -#line 264 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } +#line 285 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 109: YY_RULE_SETUP -#line 265 "program_lexer.l" -{ return MODELVIEW; } +#line 286 "program_lexer.l" +{ return ROW; } YY_BREAK case 110: YY_RULE_SETUP -#line 266 "program_lexer.l" -{ return MVP; } +#line 287 "program_lexer.l" +{ return SCENECOLOR; } YY_BREAK case 111: YY_RULE_SETUP -#line 267 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } +#line 288 "program_lexer.l" +{ return SECONDARY; } YY_BREAK case 112: YY_RULE_SETUP -#line 268 "program_lexer.l" -{ return OBJECT; } +#line 289 "program_lexer.l" +{ return SHININESS; } YY_BREAK case 113: YY_RULE_SETUP -#line 269 "program_lexer.l" -{ return PALETTE; } +#line 290 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 114: YY_RULE_SETUP -#line 270 "program_lexer.l" -{ return PARAMS; } +#line 291 "program_lexer.l" +{ return SPECULAR; } YY_BREAK case 115: YY_RULE_SETUP -#line 271 "program_lexer.l" -{ return PLANE; } +#line 292 "program_lexer.l" +{ return SPOT; } YY_BREAK case 116: YY_RULE_SETUP -#line 272 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } +#line 293 "program_lexer.l" +{ return TEXCOORD; } YY_BREAK case 117: YY_RULE_SETUP -#line 273 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } +#line 294 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 118: YY_RULE_SETUP -#line 274 "program_lexer.l" -{ return POSITION; } +#line 295 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 119: YY_RULE_SETUP -#line 275 "program_lexer.l" -{ return PRIMARY; } +#line 296 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 120: YY_RULE_SETUP -#line 276 "program_lexer.l" -{ return PROJECTION; } +#line 297 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 121: YY_RULE_SETUP -#line 277 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } +#line 298 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 122: YY_RULE_SETUP -#line 278 "program_lexer.l" -{ return ROW; } +#line 299 "program_lexer.l" +{ return TEXTURE; } YY_BREAK case 123: YY_RULE_SETUP -#line 279 "program_lexer.l" -{ return SCENECOLOR; } +#line 300 "program_lexer.l" +{ return TRANSPOSE; } YY_BREAK case 124: YY_RULE_SETUP -#line 280 "program_lexer.l" -{ return SECONDARY; } +#line 301 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 125: YY_RULE_SETUP -#line 281 "program_lexer.l" -{ return SHININESS; } +#line 302 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 126: YY_RULE_SETUP -#line 282 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } +#line 304 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 127: YY_RULE_SETUP -#line 283 "program_lexer.l" -{ return SPECULAR; } +#line 305 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 128: YY_RULE_SETUP -#line 284 "program_lexer.l" -{ return SPOT; } +#line 306 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 129: YY_RULE_SETUP -#line 285 "program_lexer.l" -{ return TEXCOORD; } +#line 307 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 130: YY_RULE_SETUP -#line 286 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, TEXENV); } +#line 308 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 131: YY_RULE_SETUP -#line 287 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN); } +#line 309 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 132: YY_RULE_SETUP -#line 288 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } +#line 310 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 133: YY_RULE_SETUP -#line 289 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } +#line 311 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 134: YY_RULE_SETUP -#line 290 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } +#line 312 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 135: YY_RULE_SETUP -#line 291 "program_lexer.l" -{ return TEXTURE; } +#line 313 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 136: YY_RULE_SETUP -#line 292 "program_lexer.l" -{ return TRANSPOSE; } +#line 314 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 293 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } +#line 315 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 138: YY_RULE_SETUP -#line 294 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, WEIGHT); } +#line 316 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 139: YY_RULE_SETUP -#line 296 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } +#line 318 "program_lexer.l" +{ return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 140: YY_RULE_SETUP -#line 297 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 298 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 299 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 300 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 301 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 302 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 303 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 304 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 305 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 306 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 307 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 308 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 310 "program_lexer.l" -{ - yylval->string = strdup(yytext); - return IDENTIFIER; -} - YY_BREAK -case 153: -YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 320 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 154: +case 141: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 322 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 155: +case 142: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 326 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 156: -/* rule 156 can match eol */ +case 143: +/* rule 143 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 330 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 157: +case 144: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 334 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 158: +case 145: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 338 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 159: +case 146: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 343 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 160: +case 147: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 349 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2169,27 +2250,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 161: +case 148: YY_RULE_SETUP -#line 350 "program_lexer.l" +#line 355 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 162: +case 149: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 360 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 163: +case 150: YY_RULE_SETUP -#line 361 "program_lexer.l" +#line 366 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2197,9 +2278,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 164: +case 151: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 372 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2207,18 +2288,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 165: +case 152: YY_RULE_SETUP -#line 373 "program_lexer.l" +#line 378 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 166: +case 153: YY_RULE_SETUP -#line 379 "program_lexer.l" +#line 384 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2226,9 +2307,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 167: +case 154: YY_RULE_SETUP -#line 386 "program_lexer.l" +#line 391 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2238,18 +2319,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 168: +case 155: YY_RULE_SETUP -#line 395 "program_lexer.l" +#line 400 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 169: +case 156: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 406 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2257,27 +2338,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 170: +case 157: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 412 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 171: +case 158: YY_RULE_SETUP -#line 412 "program_lexer.l" +#line 417 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 172: +case 159: YY_RULE_SETUP -#line 418 "program_lexer.l" +#line 423 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2285,9 +2366,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 173: +case 160: YY_RULE_SETUP -#line 424 "program_lexer.l" +#line 429 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2295,18 +2376,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 174: +case 161: YY_RULE_SETUP -#line 430 "program_lexer.l" +#line 435 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 175: +case 162: YY_RULE_SETUP -#line 436 "program_lexer.l" +#line 441 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2314,9 +2395,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 176: +case 163: YY_RULE_SETUP -#line 444 "program_lexer.l" +#line 449 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2328,9 +2409,9 @@ YY_RULE_SETUP } } YY_BREAK -case 177: +case 164: YY_RULE_SETUP -#line 455 "program_lexer.l" +#line 460 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2340,15 +2421,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 178: +case 165: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 469 "program_lexer.l" { return DOT; } YY_BREAK -case 179: -/* rule 179 can match eol */ +case 166: +/* rule 166 can match eol */ YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 471 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2357,30 +2438,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 180: +case 167: YY_RULE_SETUP -#line 473 "program_lexer.l" +#line 478 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 181: +case 168: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 474 "program_lexer.l" +#line 479 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 182: +case 169: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 480 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 183: +case 170: YY_RULE_SETUP -#line 476 "program_lexer.l" +#line 481 "program_lexer.l" ECHO; YY_BREAK -#line 2384 "lex.yy.c" +#line 2465 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2674,7 +2755,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2703,11 +2784,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 674); + yy_is_jam = (yy_current_state == 849); return yy_is_jam ? 0 : yy_current_state; } @@ -3555,7 +3636,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 476 "program_lexer.l" +#line 481 "program_lexer.l" diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index 39a221eeab..1c687bc16c 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -121,7 +121,6 @@ /*@{*/ #define SATURATE_OFF 0 #define SATURATE_ZERO_ONE 1 -#define SATURATE_PLUS_MINUS_ONE 2 /*@}*/ diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index b71735aa80..ba4d39452f 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -788,7 +788,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!VP1.0\n"); else - _mesa_fprintf(f, "# Vertex Program/Shader\n"); + _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: @@ -797,7 +797,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!FP1.0\n"); else - _mesa_fprintf(f, "# Fragment Program/Shader\n"); + _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); break; } @@ -906,7 +906,8 @@ _mesa_fprint_parameter_list(FILE *f, if (!list) return; - _mesa_fprintf(f, "param list %p\n", (void *) list); + if (0) + _mesa_fprintf(f, "param list %p\n", (void *) list); _mesa_fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); for (i = 0; i < list->NumParameters; i++){ struct gl_program_parameter *param = list->Parameters + i; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2cd6eb8a38..532adf4d36 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -351,13 +351,6 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Attributes); } - /* XXX this is a little ugly */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; - if (vprog->TnlData) - _mesa_free(vprog->TnlData); - } - _mesa_free(prog); } diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index c2803ff707..e2acb3c0c9 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -26,22 +26,27 @@ #include "prog_instruction.h" #include "prog_statevars.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) +#ifndef HAVE_UNISTD_H +#define YY_NO_UNISTD_H +#endif + #define return_token_or_IDENTIFIER(condition, token) \ do { \ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -56,15 +61,16 @@ } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -113,6 +119,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -133,6 +148,11 @@ exp [Ee][-+]?[0-9]+ frac "."[0-9]+ dot "."[ \t]* +sz [HRX]? +szf [HR]? +cc C? +sat (_SAT)? + %option bison-bridge bison-locations reentrant noyywrap %% @@ -150,86 +170,74 @@ OUTPUT { return OUTPUT; } PARAM { return PARAM; } TEMP { yylval->integer = at_temp; return TEMP; } -ABS { return_opcode( 1, VECTOR_OP, ABS, OFF); } -ABS_SAT { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } -ADD { return_opcode( 1, BIN_OP, ADD, OFF); } -ADD_SAT { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } -ARL { return_opcode(require_ARB_vp, ARL, ARL, OFF); } - -CMP { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } -CMP_SAT { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } -COS { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } -COS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } - -DP3 { return_opcode( 1, BIN_OP, DP3, OFF); } -DP3_SAT { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } -DP4 { return_opcode( 1, BIN_OP, DP4, OFF); } -DP4_SAT { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } -DPH { return_opcode( 1, BIN_OP, DPH, OFF); } -DPH_SAT { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } -DST { return_opcode( 1, BIN_OP, DST, OFF); } -DST_SAT { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } - -EX2 { return_opcode( 1, SCALAR_OP, EX2, OFF); } -EX2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } -EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } - -FLR { return_opcode( 1, VECTOR_OP, FLR, OFF); } -FLR_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } -FRC { return_opcode( 1, VECTOR_OP, FRC, OFF); } -FRC_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } - -KIL { return_opcode(require_ARB_fp, KIL, KIL, OFF); } - -LIT { return_opcode( 1, VECTOR_OP, LIT, OFF); } -LIT_SAT { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } -LG2 { return_opcode( 1, SCALAR_OP, LG2, OFF); } -LG2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } -LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } -LRP { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } -LRP_SAT { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } - -MAD { return_opcode( 1, TRI_OP, MAD, OFF); } -MAD_SAT { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } -MAX { return_opcode( 1, BIN_OP, MAX, OFF); } -MAX_SAT { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } -MIN { return_opcode( 1, BIN_OP, MIN, OFF); } -MIN_SAT { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } -MOV { return_opcode( 1, VECTOR_OP, MOV, OFF); } -MOV_SAT { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } -MUL { return_opcode( 1, BIN_OP, MUL, OFF); } -MUL_SAT { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } - -POW { return_opcode( 1, BINSC_OP, POW, OFF); } -POW_SAT { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } - -RCP { return_opcode( 1, SCALAR_OP, RCP, OFF); } -RCP_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } -RSQ { return_opcode( 1, SCALAR_OP, RSQ, OFF); } -RSQ_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } - -SCS { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } -SCS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } -SGE { return_opcode( 1, BIN_OP, SGE, OFF); } -SGE_SAT { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } -SIN { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } -SIN_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } -SLT { return_opcode( 1, BIN_OP, SLT, OFF); } -SLT_SAT { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } -SUB { return_opcode( 1, BIN_OP, SUB, OFF); } -SUB_SAT { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } -SWZ { return_opcode( 1, SWZ, SWZ, OFF); } -SWZ_SAT { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } - -TEX { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } -TEX_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } -TXB { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } -TXB_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } -TXP { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } -TXP_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } - -XPD { return_opcode( 1, BIN_OP, XPD, OFF); } -XPD_SAT { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +ABS{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, ABS, 3); } +ADD{sz}{cc}{sat} { return_opcode( 1, BIN_OP, ADD, 3); } +ARL { return_opcode(require_ARB_vp, ARL, ARL, 3); } + +CMP{sat} { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } +COS{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } + +DDX{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } +DDY{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } +DP3{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP3, 3); } +DP4{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP4, 3); } +DPH{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DPH, 3); } +DST{szf}{cc}{sat} { return_opcode( 1, BIN_OP, DST, 3); } + +EX2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, EX2, 3); } +EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } + +FLR{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FLR, 3); } +FRC{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FRC, 3); } + +KIL { return_opcode(require_ARB_fp, KIL, KIL, 3); } + +LIT{szf}{cc}{sat} { return_opcode( 1, VECTOR_OP, LIT, 3); } +LG2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, LG2, 3); } +LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } +LRP{sz}{cc}{sat} { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } + +MAD{sz}{cc}{sat} { return_opcode( 1, TRI_OP, MAD, 3); } +MAX{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MAX, 3); } +MIN{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MIN, 3); } +MOV{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, MOV, 3); } +MUL{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MUL, 3); } + +PK2H { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } +PK2US { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } +PK4B { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } +PK4UB { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } +POW{szf}{cc}{sat} { return_opcode( 1, BINSC_OP, POW, 3); } + +RCP{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RCP, 3); } +RFL{szf}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } +RSQ{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RSQ, 3); } + +SCS{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } +SEQ{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } +SFL{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } +SGE{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SGE, 3); } +SGT{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } +SIN{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } +SLE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } +SLT{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SLT, 3); } +SNE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } +STR{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, STR, 3); } +SUB{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SUB, 3); } +SWZ{sat} { return_opcode( 1, SWZ, SWZ, 3); } + +TEX{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } +TXB{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } +TXD{cc}{sat} { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } +TXP{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } + +UP2H{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } +UP2US{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } +UP4B{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } +UP4UB{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } + +X2D{szf}{cc}{sat} { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } +XPD{sat} { return_opcode( 1, BIN_OP, XPD, 3); } vertex { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } fragment { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } @@ -307,10 +315,7 @@ ARRAY2D { return_token_or_IDENTIFIER(require_ARB_fp && require ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } -[_a-zA-Z$][_a-zA-Z0-9$]* { - yylval->string = strdup(yytext); - return IDENTIFIER; -} +[_a-zA-Z$][_a-zA-Z0-9$]* { return handle_ident(yyextra, yytext, yylval); } ".." { return DOT_DOT; } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 9f2d4de90f..c0f50147bd 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -139,10 +139,19 @@ static void init_dst_reg(struct prog_dst_register *r); static void init_src_reg(struct asm_src_register *r); +static void asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, const struct asm_src_register *src0, + const struct asm_src_register *src1, const struct asm_src_register *src2); + static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2); +static struct asm_instruction *asm_instruction_copy_ctor( + const struct prog_instruction *base, const struct prog_dst_register *dst, + const struct asm_src_register *src0, const struct asm_src_register *src1, + const struct asm_src_register *src2); + #ifndef FALSE #define FALSE 0 #define TRUE (!FALSE) @@ -170,7 +179,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Line 189 of yacc.c */ -#line 174 "program_parse.tab.c" +#line 183 "program_parse.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -216,90 +225,92 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -310,7 +321,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 107 "program_parse.y" +#line 116 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -339,7 +350,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 343 "program_parse.tab.c" +#line 354 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -363,14 +374,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 249 "program_parse.y" +#line 261 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 374 "program_parse.tab.c" +#line 385 "program_parse.tab.c" #ifdef short # undef short @@ -587,20 +598,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 342 +#define YYLAST 396 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 115 +#define YYNTOKENS 120 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 134 +#define YYNNTS 143 /* YYNRULES -- Number of rules. */ -#define YYNRULES 264 +#define YYNRULES 282 /* YYNRULES -- Number of states. */ -#define YYNSTATES 436 +#define YYNSTATES 475 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 360 +#define YYMAXUTOK 362 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -612,15 +623,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 110, 107, 111, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, - 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, + 115, 116, 2, 113, 109, 114, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 108, + 2, 117, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 108, 2, 109, 2, 2, 2, 2, 2, 2, + 2, 111, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 113, 2, 114, 2, 2, 2, 2, + 2, 2, 2, 118, 110, 119, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -644,7 +655,7 @@ static const yytype_uint8 yytranslate[] = 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105 + 105, 106, 107 }; #if YYDEBUG @@ -654,142 +665,152 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, - 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, - 99, 102, 105, 107, 109, 111, 113, 115, 117, 119, - 121, 123, 125, 127, 129, 136, 140, 144, 147, 150, - 158, 161, 163, 165, 167, 169, 174, 176, 178, 180, - 182, 184, 186, 188, 192, 193, 196, 199, 201, 203, - 205, 207, 209, 211, 213, 215, 217, 218, 220, 222, - 224, 226, 227, 229, 231, 233, 235, 237, 239, 244, - 247, 250, 252, 255, 257, 260, 262, 265, 270, 275, - 277, 278, 282, 284, 286, 289, 291, 294, 296, 298, - 302, 309, 310, 312, 315, 320, 322, 326, 328, 330, - 332, 334, 336, 338, 340, 342, 344, 346, 349, 352, - 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, - 386, 388, 390, 392, 398, 400, 402, 404, 407, 409, - 411, 414, 416, 419, 426, 428, 432, 434, 436, 438, - 440, 442, 447, 449, 451, 453, 455, 457, 459, 462, - 464, 466, 472, 474, 477, 479, 481, 487, 490, 491, - 498, 502, 503, 505, 507, 509, 511, 513, 516, 518, - 520, 523, 528, 533, 534, 538, 540, 542, 544, 547, - 549, 551, 553, 555, 561, 563, 567, 573, 579, 581, - 585, 591, 593, 595, 597, 599, 601, 603, 605, 607, - 609, 613, 619, 627, 637, 640, 643, 645, 647, 648, - 649, 653, 654, 658, 662, 664, 669, 672, 675, 678, - 681, 685, 688, 692, 693, 695, 697, 698, 700, 702, - 703, 705, 707, 708, 710, 712, 713, 717, 718, 722, - 723, 727, 729, 731, 733 + 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, + 92, 101, 104, 107, 120, 123, 125, 127, 129, 131, + 133, 135, 137, 139, 141, 143, 145, 147, 154, 157, + 162, 165, 167, 171, 177, 181, 184, 192, 195, 197, + 199, 201, 203, 208, 210, 212, 214, 216, 218, 220, + 222, 226, 227, 230, 233, 235, 237, 239, 241, 243, + 245, 247, 249, 251, 252, 254, 256, 258, 260, 261, + 265, 269, 270, 273, 276, 278, 280, 282, 284, 286, + 288, 290, 292, 297, 300, 303, 305, 308, 310, 313, + 315, 318, 323, 328, 330, 331, 335, 337, 339, 342, + 344, 347, 349, 351, 355, 362, 363, 365, 368, 373, + 375, 379, 381, 383, 385, 387, 389, 391, 393, 395, + 397, 399, 402, 405, 408, 411, 414, 417, 420, 423, + 426, 429, 432, 435, 439, 441, 443, 445, 451, 453, + 455, 457, 460, 462, 464, 467, 469, 472, 479, 481, + 485, 487, 489, 491, 493, 495, 500, 502, 504, 506, + 508, 510, 512, 515, 517, 519, 525, 527, 530, 532, + 534, 540, 543, 544, 551, 555, 556, 558, 560, 562, + 564, 566, 569, 571, 573, 576, 581, 586, 587, 591, + 593, 595, 597, 600, 602, 604, 606, 608, 614, 616, + 620, 626, 632, 634, 638, 644, 646, 648, 650, 652, + 654, 656, 658, 660, 662, 666, 672, 680, 690, 693, + 696, 698, 700, 701, 702, 707, 709, 710, 711, 715, + 719, 721, 727, 730, 733, 736, 739, 743, 746, 750, + 751, 753, 755, 756, 758, 760, 761, 763, 765, 766, + 768, 770, 771, 775, 776, 780, 781, 785, 787, 789, + 791, 796, 798 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 116, 0, -1, 117, 118, 120, 12, -1, 3, -1, - 4, -1, 118, 119, -1, -1, 8, 98, 106, -1, - 120, 121, -1, -1, 122, 106, -1, 158, 106, -1, - 123, -1, 124, -1, 125, -1, 126, -1, 127, -1, - 128, -1, 129, -1, 130, -1, 135, -1, 131, -1, - 132, -1, 19, 139, 107, 136, -1, 18, 138, 107, - 137, -1, 16, 138, 107, 136, -1, 14, 138, 107, - 136, 107, 136, -1, 13, 138, 107, 137, 107, 137, - -1, 17, 138, 107, 137, 107, 137, 107, 137, -1, - 15, 138, 107, 137, 107, 133, 107, 134, -1, 20, - 137, -1, 82, 243, -1, 83, -1, 84, -1, 85, - -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, - -1, 91, -1, 92, -1, 93, -1, 94, -1, 21, - 138, 107, 143, 107, 140, -1, 229, 143, 155, -1, - 229, 143, 156, -1, 144, 157, -1, 152, 154, -1, - 141, 107, 141, 107, 141, 107, 141, -1, 229, 142, - -1, 22, -1, 98, -1, 98, -1, 160, -1, 145, - 108, 146, 109, -1, 174, -1, 236, -1, 98, -1, - 98, -1, 147, -1, 148, -1, 22, -1, 152, 153, - 149, -1, -1, 110, 150, -1, 111, 151, -1, 22, - -1, 22, -1, 98, -1, 102, -1, 102, -1, 102, - -1, 102, -1, 99, -1, 103, -1, -1, 99, -1, - 100, -1, 101, -1, 102, -1, -1, 159, -1, 166, - -1, 230, -1, 232, -1, 235, -1, 248, -1, 7, - 98, 112, 160, -1, 95, 161, -1, 37, 165, -1, - 59, -1, 97, 163, -1, 52, -1, 28, 241, -1, - 36, -1, 73, 242, -1, 49, 108, 164, 109, -1, - 96, 108, 162, 109, -1, 22, -1, -1, 108, 164, - 109, -1, 22, -1, 59, -1, 28, 241, -1, 36, - -1, 73, 242, -1, 167, -1, 168, -1, 10, 98, - 170, -1, 10, 98, 108, 169, 109, 171, -1, -1, - 22, -1, 112, 173, -1, 112, 113, 172, 114, -1, - 175, -1, 172, 107, 175, -1, 177, -1, 213, -1, - 223, -1, 177, -1, 213, -1, 224, -1, 176, -1, - 214, -1, 223, -1, 177, -1, 72, 201, -1, 72, - 178, -1, 72, 180, -1, 72, 183, -1, 72, 185, - -1, 72, 191, -1, 72, 187, -1, 72, 194, -1, - 72, 196, -1, 72, 198, -1, 72, 200, -1, 72, - 212, -1, 46, 240, 179, -1, 189, -1, 32, -1, - 68, -1, 42, 108, 190, 109, 181, -1, 189, -1, - 59, -1, 25, -1, 71, 182, -1, 39, -1, 31, - -1, 43, 184, -1, 24, -1, 240, 66, -1, 44, - 108, 190, 109, 240, 186, -1, 189, -1, 74, 244, - 188, -1, 28, -1, 24, -1, 30, -1, 70, -1, - 22, -1, 75, 242, 192, 193, -1, 34, -1, 53, - -1, 78, -1, 79, -1, 77, -1, 76, -1, 35, - 195, -1, 28, -1, 55, -1, 27, 108, 197, 109, - 56, -1, 22, -1, 57, 199, -1, 69, -1, 25, - -1, 203, 65, 108, 206, 109, -1, 203, 202, -1, - -1, 65, 108, 206, 104, 206, 109, -1, 48, 207, - 204, -1, -1, 205, -1, 40, -1, 81, -1, 41, - -1, 22, -1, 50, 208, -1, 62, -1, 51, -1, - 80, 242, -1, 54, 108, 210, 109, -1, 47, 108, - 211, 109, -1, -1, 108, 209, 109, -1, 22, -1, - 22, -1, 22, -1, 29, 63, -1, 217, -1, 220, - -1, 215, -1, 218, -1, 61, 33, 108, 216, 109, - -1, 221, -1, 221, 104, 221, -1, 61, 33, 108, - 221, 109, -1, 61, 45, 108, 219, 109, -1, 222, - -1, 222, 104, 222, -1, 61, 45, 108, 222, 109, - -1, 22, -1, 22, -1, 225, -1, 227, -1, 226, - -1, 227, -1, 228, -1, 23, -1, 22, -1, 113, - 228, 114, -1, 113, 228, 107, 228, 114, -1, 113, - 228, 107, 228, 107, 228, 114, -1, 113, 228, 107, - 228, 107, 228, 107, 228, 114, -1, 229, 23, -1, - 229, 22, -1, 110, -1, 111, -1, -1, -1, 11, - 231, 234, -1, -1, 5, 233, 234, -1, 234, 107, - 98, -1, 98, -1, 9, 98, 112, 236, -1, 64, - 59, -1, 64, 36, -1, 64, 237, -1, 64, 58, - -1, 64, 73, 242, -1, 64, 29, -1, 28, 238, - 239, -1, -1, 38, -1, 26, -1, -1, 60, -1, - 67, -1, -1, 38, -1, 26, -1, -1, 60, -1, - 67, -1, -1, 108, 245, 109, -1, -1, 108, 246, - 109, -1, -1, 108, 247, 109, -1, 22, -1, 22, - -1, 22, -1, 6, 98, 112, 98, -1 + 121, 0, -1, 122, 123, 125, 12, -1, 3, -1, + 4, -1, 123, 124, -1, -1, 8, 262, 108, -1, + 125, 126, -1, -1, 127, 108, -1, 170, 108, -1, + 128, -1, 129, -1, 130, -1, 131, -1, 132, -1, + 133, -1, 134, -1, 135, -1, 141, -1, 136, -1, + 137, -1, 138, -1, 19, 146, 109, 142, -1, 18, + 145, 109, 144, -1, 16, 145, 109, 142, -1, 14, + 145, 109, 142, 109, 142, -1, 13, 145, 109, 144, + 109, 144, -1, 17, 145, 109, 144, 109, 144, 109, + 144, -1, 15, 145, 109, 144, 109, 139, 109, 140, + -1, 20, 144, -1, 20, 166, -1, 22, 145, 109, + 144, 109, 144, 109, 144, 109, 139, 109, 140, -1, + 83, 256, -1, 84, -1, 85, -1, 86, -1, 87, + -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, + -1, 93, -1, 94, -1, 95, -1, 21, 145, 109, + 150, 109, 147, -1, 241, 143, -1, 241, 110, 143, + 110, -1, 150, 162, -1, 238, -1, 241, 150, 163, + -1, 241, 110, 150, 163, 110, -1, 151, 164, 165, + -1, 159, 161, -1, 148, 109, 148, 109, 148, 109, + 148, -1, 241, 149, -1, 23, -1, 262, -1, 100, + -1, 172, -1, 152, 111, 153, 112, -1, 186, -1, + 249, -1, 100, -1, 100, -1, 154, -1, 155, -1, + 23, -1, 159, 160, 156, -1, -1, 113, 157, -1, + 114, 158, -1, 23, -1, 23, -1, 100, -1, 104, + -1, 104, -1, 104, -1, 104, -1, 101, -1, 105, + -1, -1, 101, -1, 102, -1, 103, -1, 104, -1, + -1, 115, 166, 116, -1, 115, 167, 116, -1, -1, + 168, 163, -1, 169, 163, -1, 99, -1, 100, -1, + 171, -1, 178, -1, 242, -1, 245, -1, 248, -1, + 261, -1, 7, 99, 117, 172, -1, 96, 173, -1, + 38, 177, -1, 60, -1, 98, 175, -1, 53, -1, + 29, 254, -1, 37, -1, 74, 255, -1, 50, 111, + 176, 112, -1, 97, 111, 174, 112, -1, 23, -1, + -1, 111, 176, 112, -1, 23, -1, 60, -1, 29, + 254, -1, 37, -1, 74, 255, -1, 179, -1, 180, + -1, 10, 99, 182, -1, 10, 99, 111, 181, 112, + 183, -1, -1, 23, -1, 117, 185, -1, 117, 118, + 184, 119, -1, 187, -1, 184, 109, 187, -1, 189, + -1, 225, -1, 235, -1, 189, -1, 225, -1, 236, + -1, 188, -1, 226, -1, 235, -1, 189, -1, 73, + 213, -1, 73, 190, -1, 73, 192, -1, 73, 195, + -1, 73, 197, -1, 73, 203, -1, 73, 199, -1, + 73, 206, -1, 73, 208, -1, 73, 210, -1, 73, + 212, -1, 73, 224, -1, 47, 253, 191, -1, 201, + -1, 33, -1, 69, -1, 43, 111, 202, 112, 193, + -1, 201, -1, 60, -1, 26, -1, 72, 194, -1, + 40, -1, 32, -1, 44, 196, -1, 25, -1, 253, + 67, -1, 45, 111, 202, 112, 253, 198, -1, 201, + -1, 75, 257, 200, -1, 29, -1, 25, -1, 31, + -1, 71, -1, 23, -1, 76, 255, 204, 205, -1, + 35, -1, 54, -1, 79, -1, 80, -1, 78, -1, + 77, -1, 36, 207, -1, 29, -1, 56, -1, 28, + 111, 209, 112, 57, -1, 23, -1, 58, 211, -1, + 70, -1, 26, -1, 215, 66, 111, 218, 112, -1, + 215, 214, -1, -1, 66, 111, 218, 106, 218, 112, + -1, 49, 219, 216, -1, -1, 217, -1, 41, -1, + 82, -1, 42, -1, 23, -1, 51, 220, -1, 63, + -1, 52, -1, 81, 255, -1, 55, 111, 222, 112, + -1, 48, 111, 223, 112, -1, -1, 111, 221, 112, + -1, 23, -1, 23, -1, 23, -1, 30, 64, -1, + 229, -1, 232, -1, 227, -1, 230, -1, 62, 34, + 111, 228, 112, -1, 233, -1, 233, 106, 233, -1, + 62, 34, 111, 233, 112, -1, 62, 46, 111, 231, + 112, -1, 234, -1, 234, 106, 234, -1, 62, 46, + 111, 234, 112, -1, 23, -1, 23, -1, 237, -1, + 239, -1, 238, -1, 239, -1, 240, -1, 24, -1, + 23, -1, 118, 240, 119, -1, 118, 240, 109, 240, + 119, -1, 118, 240, 109, 240, 109, 240, 119, -1, + 118, 240, 109, 240, 109, 240, 109, 240, 119, -1, + 241, 24, -1, 241, 23, -1, 113, -1, 114, -1, + -1, -1, 244, 11, 243, 247, -1, 262, -1, -1, + -1, 5, 246, 247, -1, 247, 109, 99, -1, 99, + -1, 244, 9, 99, 117, 249, -1, 65, 60, -1, + 65, 37, -1, 65, 250, -1, 65, 59, -1, 65, + 74, 255, -1, 65, 30, -1, 29, 251, 252, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 111, 258, 112, -1, -1, 111, 259, 112, -1, + -1, 111, 260, 112, -1, 23, -1, 23, -1, 23, + -1, 6, 99, 117, 100, -1, 99, -1, 100, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 256, 256, 259, 267, 279, 280, 283, 305, 306, - 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, - 345, 348, 349, 352, 358, 365, 372, 380, 387, 395, - 440, 447, 453, 454, 455, 456, 457, 458, 459, 460, - 461, 462, 463, 464, 467, 480, 493, 506, 528, 537, - 570, 577, 592, 642, 684, 695, 716, 726, 732, 763, - 780, 780, 782, 789, 801, 802, 803, 806, 818, 830, - 848, 859, 871, 873, 874, 875, 876, 879, 879, 879, - 879, 880, 883, 884, 885, 886, 887, 888, 891, 909, - 913, 919, 923, 927, 931, 940, 949, 953, 958, 964, - 975, 975, 976, 978, 982, 986, 990, 996, 996, 998, - 1014, 1037, 1040, 1051, 1057, 1063, 1064, 1071, 1077, 1083, - 1091, 1097, 1103, 1111, 1117, 1123, 1131, 1132, 1135, 1136, - 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1148, - 1157, 1161, 1165, 1171, 1180, 1184, 1188, 1197, 1201, 1207, - 1213, 1220, 1225, 1233, 1243, 1245, 1253, 1259, 1263, 1267, - 1273, 1284, 1293, 1297, 1302, 1306, 1310, 1314, 1320, 1327, - 1331, 1337, 1345, 1356, 1363, 1367, 1373, 1383, 1394, 1398, - 1416, 1425, 1428, 1434, 1438, 1442, 1448, 1459, 1464, 1469, - 1474, 1479, 1484, 1492, 1495, 1500, 1513, 1521, 1532, 1540, - 1540, 1542, 1542, 1544, 1554, 1559, 1566, 1576, 1585, 1590, - 1597, 1607, 1617, 1629, 1629, 1630, 1630, 1632, 1642, 1650, - 1660, 1668, 1676, 1685, 1696, 1700, 1706, 1707, 1708, 1711, - 1711, 1714, 1714, 1717, 1723, 1731, 1744, 1753, 1762, 1766, - 1775, 1784, 1795, 1802, 1807, 1816, 1828, 1831, 1840, 1851, - 1852, 1853, 1856, 1857, 1858, 1861, 1862, 1865, 1866, 1869, - 1870, 1873, 1884, 1895, 1906 + 0, 268, 268, 271, 279, 291, 292, 295, 317, 318, + 321, 336, 339, 344, 351, 352, 353, 354, 355, 356, + 357, 360, 361, 362, 365, 371, 377, 383, 390, 396, + 403, 447, 452, 462, 506, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 526, 538, 546, + 563, 570, 589, 600, 620, 645, 654, 687, 694, 709, + 759, 801, 812, 833, 843, 849, 880, 897, 897, 899, + 906, 918, 919, 920, 923, 937, 951, 969, 980, 992, + 994, 995, 996, 997, 1000, 1000, 1000, 1000, 1001, 1004, + 1008, 1013, 1020, 1027, 1034, 1057, 1080, 1081, 1082, 1083, + 1084, 1085, 1088, 1106, 1110, 1116, 1120, 1124, 1128, 1137, + 1146, 1150, 1155, 1161, 1172, 1172, 1173, 1175, 1179, 1183, + 1187, 1193, 1193, 1195, 1211, 1234, 1237, 1248, 1254, 1260, + 1261, 1268, 1274, 1280, 1288, 1294, 1300, 1308, 1314, 1320, + 1328, 1329, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, + 1340, 1341, 1342, 1345, 1354, 1358, 1362, 1368, 1377, 1381, + 1385, 1394, 1398, 1404, 1410, 1417, 1422, 1430, 1440, 1442, + 1450, 1456, 1460, 1464, 1470, 1481, 1490, 1494, 1499, 1503, + 1507, 1511, 1517, 1524, 1528, 1534, 1542, 1553, 1560, 1564, + 1570, 1580, 1591, 1595, 1613, 1622, 1625, 1631, 1635, 1639, + 1645, 1656, 1661, 1666, 1671, 1676, 1681, 1689, 1692, 1697, + 1710, 1718, 1729, 1737, 1737, 1739, 1739, 1741, 1751, 1756, + 1763, 1773, 1782, 1787, 1794, 1804, 1814, 1826, 1826, 1827, + 1827, 1829, 1839, 1847, 1857, 1865, 1873, 1882, 1893, 1897, + 1903, 1904, 1905, 1908, 1908, 1911, 1946, 1950, 1950, 1953, + 1959, 1967, 1980, 1989, 1998, 2002, 2011, 2020, 2031, 2038, + 2043, 2052, 2064, 2067, 2076, 2087, 2088, 2089, 2092, 2093, + 2094, 2097, 2098, 2101, 2102, 2105, 2106, 2109, 2120, 2131, + 2142, 2163, 2164 }; #endif @@ -801,9 +822,9 @@ static const char *const yytname[] = "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS", "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP", "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL", - "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK", - "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV", - "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", + "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", + "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", + "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL", "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL", "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE", @@ -814,49 +835,51 @@ static const char *const yytname[] = "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", - "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", - "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", - "'}'", "$accept", "program", "language", "optionSequence", "option", - "statementSequence", "statement", "instruction", "ALU_instruction", - "TexInstruction", "ARL_instruction", "VECTORop_instruction", - "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", - "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", - "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg", - "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle", - "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray", - "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel", - "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg", - "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix", - "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding", - "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", - "fragAttribItem", "PARAM_statement", "PARAM_singleStmt", - "PARAM_multipleStmt", "optArraySize", "paramSingleInit", - "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl", - "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem", - "stateSingleItem", "stateMaterialItem", "stateMatProperty", - "stateLightItem", "stateLightProperty", "stateSpotProperty", - "stateLightModelItem", "stateLModProperty", "stateLightProdItem", - "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty", - "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem", - "stateTexGenType", "stateTexGenCoord", "stateFogItem", - "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", - "statePointItem", "statePointProperty", "stateMatrixRow", - "stateMatrixRows", "optMatrixRows", "stateMatrixItem", - "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", - "stateMatrixName", "stateOptModMatNum", "stateModMatNum", - "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem", - "programSingleItem", "programMultipleItem", "progEnvParams", - "progEnvParamNums", "progEnvParam", "progLocalParams", - "progLocalParamNums", "progLocalParam", "progEnvParamNum", - "progLocalParamNum", "paramConstDecl", "paramConstUse", - "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", - "signedFloatConstant", "optionalSign", "TEMP_statement", "@1", + "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2", + "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", + "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program", + "language", "optionSequence", "option", "statementSequence", "statement", + "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", + "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", + "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", + "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget", + "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg", + "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp", + "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem", + "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset", + "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent", + "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask", + "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2", + "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem", + "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", + "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt", + "optArraySize", "paramSingleInit", "paramMultipleInit", + "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse", + "paramMultipleItem", "stateMultipleItem", "stateSingleItem", + "stateMaterialItem", "stateMatProperty", "stateLightItem", + "stateLightProperty", "stateSpotProperty", "stateLightModelItem", + "stateLModProperty", "stateLightProdItem", "stateLProdProperty", + "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty", + "stateLightNumber", "stateTexGenItem", "stateTexGenType", + "stateTexGenCoord", "stateFogItem", "stateFogProperty", + "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem", + "statePointProperty", "stateMatrixRow", "stateMatrixRows", + "optMatrixRows", "stateMatrixItem", "stateOptMatModifier", + "stateMatModifier", "stateMatrixRowNum", "stateMatrixName", + "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum", + "stateProgramMatNum", "stateDepthItem", "programSingleItem", + "programMultipleItem", "progEnvParams", "progEnvParamNums", + "progEnvParam", "progLocalParams", "progLocalParamNums", + "progLocalParam", "progEnvParamNum", "progLocalParamNum", + "paramConstDecl", "paramConstUse", "paramConstScalarDecl", + "paramConstScalarUse", "paramConstVector", "signedFloatConstant", + "optionalSign", "TEMP_statement", "@1", "optVarSize", "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", - "ALIAS_statement", 0 + "ALIAS_statement", "string", 0 }; #endif @@ -875,41 +898,43 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 59, 44, 91, 93, - 43, 45, 61, 123, 125 + 355, 356, 357, 358, 359, 360, 361, 362, 59, 44, + 124, 91, 93, 43, 45, 40, 41, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_uint16 yyr1[] = { - 0, 115, 116, 117, 117, 118, 118, 119, 120, 120, - 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, - 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 134, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 142, 143, 143, 143, 143, 144, 144, 145, - 146, 146, 147, 148, 149, 149, 149, 150, 151, 152, - 153, 154, 155, 156, 156, 156, 156, 157, 157, 157, - 157, 157, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 161, 161, 161, 161, 161, 161, 161, 161, 162, - 163, 163, 164, 165, 165, 165, 165, 166, 166, 167, - 168, 169, 169, 170, 171, 172, 172, 173, 173, 173, - 174, 174, 174, 175, 175, 175, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, - 179, 179, 179, 180, 181, 181, 181, 181, 181, 182, - 183, 184, 184, 185, 186, 187, 188, 189, 189, 189, - 190, 191, 192, 192, 193, 193, 193, 193, 194, 195, - 195, 196, 197, 198, 199, 199, 200, 201, 202, 202, - 203, 204, 204, 205, 205, 205, 206, 207, 207, 207, - 207, 207, 207, 208, 208, 209, 210, 211, 212, 213, - 213, 214, 214, 215, 216, 216, 217, 218, 219, 219, - 220, 221, 222, 223, 223, 224, 224, 225, 226, 226, - 227, 227, 227, 227, 228, 228, 229, 229, 229, 231, - 230, 233, 232, 234, 234, 235, 236, 236, 236, 236, - 236, 236, 237, 238, 238, 238, 239, 239, 239, 240, - 240, 240, 241, 241, 241, 242, 242, 243, 243, 244, - 244, 245, 246, 247, 248 + 0, 120, 121, 122, 122, 123, 123, 124, 125, 125, + 126, 126, 127, 127, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 137, 138, 139, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 141, 142, 142, + 143, 143, 144, 144, 145, 146, 147, 148, 149, 149, + 150, 150, 150, 150, 151, 151, 152, 153, 153, 154, + 155, 156, 156, 156, 157, 158, 159, 160, 161, 162, + 163, 163, 163, 163, 164, 164, 164, 164, 164, 165, + 165, 165, 166, 167, 168, 169, 170, 170, 170, 170, + 170, 170, 171, 172, 172, 173, 173, 173, 173, 173, + 173, 173, 173, 174, 175, 175, 176, 177, 177, 177, + 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, + 184, 185, 185, 185, 186, 186, 186, 187, 187, 187, + 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, + 189, 189, 189, 190, 191, 191, 191, 192, 193, 193, + 193, 193, 193, 194, 195, 196, 196, 197, 198, 199, + 200, 201, 201, 201, 202, 203, 204, 204, 205, 205, + 205, 205, 206, 207, 207, 208, 209, 210, 211, 211, + 212, 213, 214, 214, 215, 216, 216, 217, 217, 217, + 218, 219, 219, 219, 219, 219, 219, 220, 220, 221, + 222, 223, 224, 225, 225, 226, 226, 227, 228, 228, + 229, 230, 231, 231, 232, 233, 234, 235, 235, 236, + 236, 237, 238, 238, 239, 239, 239, 239, 240, 240, + 241, 241, 241, 243, 242, 244, 244, 246, 245, 247, + 247, 248, 249, 249, 249, 249, 249, 249, 250, 251, + 251, 251, 252, 252, 252, 253, 253, 253, 254, 254, + 254, 255, 255, 256, 256, 257, 257, 258, 259, 260, + 261, 262, 262 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -917,31 +942,33 @@ static const yytype_uint8 yyr2[] = { 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 6, 3, 3, 2, 2, 7, - 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, - 1, 1, 1, 3, 0, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 4, 2, - 2, 1, 2, 1, 2, 1, 2, 4, 4, 1, - 0, 3, 1, 1, 2, 1, 2, 1, 1, 3, - 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, - 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, - 2, 1, 2, 6, 1, 3, 1, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 5, 1, 2, 1, 1, 5, 2, 0, 6, - 3, 0, 1, 1, 1, 1, 1, 2, 1, 1, - 2, 4, 4, 0, 3, 1, 1, 1, 2, 1, - 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 5, 7, 9, 2, 2, 1, 1, 0, 0, - 3, 0, 3, 3, 1, 4, 2, 2, 2, 2, - 3, 2, 3, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 3, 0, 3, 0, - 3, 1, 1, 1, 4 + 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, + 8, 2, 2, 12, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 2, 4, + 2, 1, 3, 5, 3, 2, 7, 2, 1, 1, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 3, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 2, 2, 1, 2, 1, 2, 1, + 2, 4, 4, 1, 0, 3, 1, 1, 2, 1, + 2, 1, 1, 3, 6, 0, 1, 2, 4, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 1, 1, 1, 5, 1, 1, + 1, 2, 1, 1, 2, 1, 2, 6, 1, 3, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 5, 1, 2, 1, 1, + 5, 2, 0, 6, 3, 0, 1, 1, 1, 1, + 1, 2, 1, 1, 2, 4, 4, 0, 3, 1, + 1, 1, 2, 1, 1, 1, 1, 5, 1, 3, + 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 7, 9, 2, 2, + 1, 1, 0, 0, 4, 1, 0, 0, 3, 3, + 1, 5, 2, 2, 2, 2, 3, 2, 3, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 3, 0, 3, 0, 3, 1, 1, 1, + 4, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -949,272 +976,296 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 231, 0, 0, 0, 0, 229, 2, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 8, 0, 12, - 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, - 0, 82, 83, 107, 108, 84, 85, 86, 87, 7, - 0, 0, 0, 0, 0, 0, 0, 58, 0, 81, - 57, 0, 0, 0, 0, 0, 69, 0, 0, 226, - 227, 30, 0, 0, 10, 11, 234, 232, 0, 0, - 0, 111, 228, 109, 230, 243, 241, 237, 239, 236, - 255, 238, 228, 77, 78, 79, 80, 47, 228, 228, - 228, 228, 228, 228, 71, 48, 219, 218, 0, 0, - 0, 0, 53, 228, 76, 0, 54, 56, 120, 121, - 199, 200, 122, 215, 216, 0, 0, 264, 88, 235, - 112, 0, 113, 117, 118, 119, 213, 214, 217, 0, - 245, 244, 246, 0, 240, 0, 0, 0, 0, 25, - 0, 24, 23, 252, 105, 103, 255, 90, 0, 0, - 0, 0, 0, 0, 249, 0, 249, 0, 0, 259, - 255, 128, 129, 130, 131, 133, 132, 134, 135, 136, - 137, 0, 138, 252, 95, 0, 93, 91, 255, 0, - 100, 89, 0, 74, 73, 75, 46, 0, 0, 233, - 0, 225, 224, 247, 248, 242, 261, 0, 228, 228, - 0, 0, 228, 253, 254, 104, 106, 0, 0, 0, - 198, 169, 170, 168, 0, 151, 251, 250, 150, 0, - 0, 0, 0, 193, 189, 0, 188, 255, 181, 175, - 174, 173, 0, 0, 0, 0, 94, 0, 96, 0, - 0, 92, 228, 220, 62, 0, 60, 61, 0, 228, - 0, 110, 256, 27, 26, 72, 45, 257, 0, 0, - 211, 0, 212, 0, 172, 0, 160, 0, 152, 0, - 157, 158, 141, 142, 159, 139, 140, 0, 0, 187, - 0, 190, 183, 185, 184, 180, 182, 263, 0, 156, - 155, 162, 163, 0, 0, 102, 0, 99, 0, 0, - 0, 55, 70, 64, 44, 0, 0, 228, 0, 31, - 0, 228, 206, 210, 0, 0, 249, 197, 0, 195, - 0, 196, 0, 260, 167, 166, 164, 165, 161, 186, - 0, 97, 98, 101, 228, 221, 0, 0, 63, 228, - 51, 52, 50, 0, 0, 0, 115, 123, 126, 124, - 201, 202, 125, 262, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 29, 28, 171, - 146, 148, 145, 0, 143, 144, 0, 192, 194, 191, - 176, 0, 67, 65, 68, 66, 0, 0, 0, 127, - 178, 228, 114, 258, 149, 147, 153, 154, 228, 222, - 228, 0, 0, 0, 177, 116, 0, 0, 0, 204, - 0, 208, 0, 223, 228, 203, 0, 207, 0, 0, - 49, 205, 209, 0, 0, 179 + 0, 3, 4, 0, 6, 1, 9, 0, 5, 246, + 281, 282, 0, 247, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 242, 0, 0, 8, 0, + 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, + 23, 20, 0, 96, 97, 121, 122, 98, 0, 99, + 100, 101, 245, 7, 0, 0, 0, 0, 0, 65, + 0, 88, 64, 0, 0, 0, 0, 0, 76, 0, + 0, 94, 240, 241, 31, 32, 83, 0, 0, 0, + 10, 11, 0, 243, 250, 248, 0, 0, 125, 242, + 123, 259, 257, 253, 255, 252, 271, 254, 242, 84, + 85, 86, 87, 91, 242, 242, 242, 242, 242, 242, + 78, 55, 81, 80, 82, 92, 233, 232, 0, 0, + 0, 0, 60, 0, 242, 83, 0, 61, 63, 134, + 135, 213, 214, 136, 229, 230, 0, 242, 0, 0, + 0, 280, 102, 126, 0, 127, 131, 132, 133, 227, + 228, 231, 0, 261, 260, 262, 0, 256, 0, 0, + 54, 0, 0, 0, 26, 0, 25, 24, 268, 119, + 117, 271, 104, 0, 0, 0, 0, 0, 0, 265, + 0, 265, 0, 0, 275, 271, 142, 143, 144, 145, + 147, 146, 148, 149, 150, 151, 0, 152, 268, 109, + 0, 107, 105, 271, 0, 114, 103, 83, 0, 52, + 0, 0, 0, 0, 244, 249, 0, 239, 238, 263, + 264, 258, 277, 0, 242, 95, 0, 0, 83, 242, + 0, 48, 0, 51, 0, 242, 269, 270, 118, 120, + 0, 0, 0, 212, 183, 184, 182, 0, 165, 267, + 266, 164, 0, 0, 0, 0, 207, 203, 0, 202, + 271, 195, 189, 188, 187, 0, 0, 0, 0, 108, + 0, 110, 0, 0, 106, 0, 242, 234, 69, 0, + 67, 68, 0, 242, 242, 251, 0, 124, 272, 28, + 89, 90, 93, 27, 0, 79, 50, 273, 0, 0, + 225, 0, 226, 0, 186, 0, 174, 0, 166, 0, + 171, 172, 155, 156, 173, 153, 154, 0, 0, 201, + 0, 204, 197, 199, 198, 194, 196, 279, 0, 170, + 169, 176, 177, 0, 0, 116, 0, 113, 0, 0, + 53, 0, 62, 77, 71, 47, 0, 0, 0, 242, + 49, 0, 34, 0, 242, 220, 224, 0, 0, 265, + 211, 0, 209, 0, 210, 0, 276, 181, 180, 178, + 179, 175, 200, 0, 111, 112, 115, 242, 235, 0, + 0, 70, 242, 58, 57, 59, 242, 0, 0, 0, + 129, 137, 140, 138, 215, 216, 139, 278, 0, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 30, 29, 185, 160, 162, 159, 0, 157, 158, + 0, 206, 208, 205, 190, 0, 74, 72, 75, 73, + 0, 0, 0, 0, 141, 192, 242, 128, 274, 163, + 161, 167, 168, 242, 236, 242, 0, 0, 0, 0, + 191, 130, 0, 0, 0, 0, 218, 0, 222, 0, + 237, 242, 0, 217, 0, 221, 0, 0, 56, 33, + 219, 223, 0, 0, 193 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 268, 377, - 39, 146, 71, 58, 67, 314, 315, 352, 114, 59, - 115, 255, 256, 257, 348, 393, 395, 68, 313, 105, - 266, 196, 97, 40, 41, 116, 191, 308, 251, 306, - 157, 42, 43, 44, 131, 83, 261, 355, 132, 117, - 356, 357, 118, 171, 285, 172, 384, 405, 173, 228, - 174, 406, 175, 300, 286, 277, 176, 303, 338, 177, - 223, 178, 275, 179, 241, 180, 399, 414, 181, 295, - 296, 340, 238, 289, 330, 332, 328, 182, 119, 359, - 360, 418, 120, 361, 420, 121, 271, 273, 362, 122, - 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, - 47, 60, 91, 142, 205, 229, 215, 144, 319, 243, - 207, 364, 298, 48 + -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 298, + 411, 41, 161, 231, 74, 60, 69, 345, 346, 384, + 232, 61, 126, 279, 280, 281, 381, 427, 429, 70, + 344, 111, 296, 115, 103, 160, 75, 227, 76, 228, + 42, 43, 127, 206, 338, 274, 336, 172, 44, 45, + 46, 144, 90, 287, 389, 145, 128, 390, 391, 129, + 186, 315, 187, 418, 440, 188, 251, 189, 441, 190, + 330, 316, 307, 191, 333, 371, 192, 246, 193, 305, + 194, 264, 195, 434, 450, 196, 325, 326, 373, 261, + 319, 363, 365, 361, 197, 130, 393, 394, 455, 131, + 395, 457, 132, 301, 303, 396, 133, 149, 134, 135, + 151, 77, 47, 139, 48, 49, 54, 85, 50, 62, + 97, 155, 221, 252, 238, 157, 352, 266, 223, 398, + 328, 51, 12 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -369 +#define YYPACT_NINF -401 static const yytype_int16 yypact[] = { - 143, -369, -369, 36, -369, -369, 45, -39, -369, 169, - -33, -369, -19, -6, -4, 12, -369, -369, -34, -34, - -34, -34, -34, -34, 15, 62, -34, -369, 26, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - 60, -369, -369, -369, -369, -369, -369, -369, -369, -369, - 20, 56, 107, 110, 37, 20, -3, -369, 111, 109, - -369, 113, 114, 116, 117, 118, -369, 119, 125, -369, - -369, -369, -15, 121, -369, -369, -369, 122, 132, -18, - 167, 210, -11, -369, 122, 63, -369, -369, -369, -369, - 130, -369, 62, -369, -369, -369, -369, -369, 62, 62, - 62, 62, 62, 62, -369, -369, -369, -369, 9, 72, - 87, -1, 131, 62, 104, 134, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -15, 142, -369, -369, -369, - -369, 135, -369, -369, -369, -369, -369, -369, -369, 182, - -369, -369, 52, 219, -369, 138, 139, -15, 140, -369, - 141, -369, -369, 61, -369, -369, 130, -369, 144, 145, - 146, 180, 11, 147, 85, 148, 99, 89, -2, 149, - 130, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, 184, -369, 61, -369, 150, -369, -369, 130, 151, - 152, -369, 27, -369, -369, -369, -369, -10, 154, -369, - 153, -369, -369, -369, -369, -369, -369, 155, 62, 62, - 161, 168, 62, -369, -369, -369, -369, 229, 244, 246, - -369, -369, -369, -369, 247, -369, -369, -369, -369, 204, - 247, 17, 163, 164, -369, 165, -369, 130, 67, -369, - -369, -369, 252, 248, 18, 170, -369, 253, -369, 255, - 253, -369, 62, -369, -369, 171, -369, -369, 177, 62, - 172, -369, -369, -369, -369, -369, -369, 173, 175, 176, - -369, 178, -369, 179, -369, 181, -369, 183, -369, 185, - -369, -369, -369, -369, -369, -369, -369, 262, 264, -369, - 267, -369, -369, -369, -369, -369, -369, -369, 186, -369, - -369, -369, -369, 136, 269, -369, 187, -369, 188, 190, - 43, -369, -369, 106, -369, 193, -5, -7, 271, -369, - 108, 62, -369, -369, 245, 4, 99, -369, 194, -369, - 195, -369, 196, -369, -369, -369, -369, -369, -369, -369, - 197, -369, -369, -369, 62, -369, 280, 285, -369, 62, - -369, -369, -369, 93, 87, 53, -369, -369, -369, -369, - -369, -369, -369, -369, 199, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, 278, -369, -369, 8, -369, -369, -369, - -369, 57, -369, -369, -369, -369, 203, 205, 206, -369, - 250, -7, -369, -369, -369, -369, -369, -369, 62, -369, - 62, 229, 244, 208, -369, -369, 198, 211, 202, 213, - 214, 218, 269, -369, 62, -369, 229, -369, 244, 54, - -369, -369, -369, 269, 215, -369 + 193, -401, -401, 27, -401, -401, 62, 143, -401, 24, + -401, -401, -30, -401, -18, 12, 83, -401, 15, 15, + 15, 15, 15, 15, 67, 61, 15, 15, -401, 127, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, 144, -401, -401, -401, -401, -401, 204, -401, + -401, -401, -401, -401, 155, 136, 138, 34, 140, -401, + 147, 108, -401, 150, 156, 157, 158, 160, -401, 162, + 159, -401, -401, -401, -401, -401, 102, -13, 163, 164, + -401, -401, 165, -401, -401, 166, 170, 10, 235, 0, + -401, 141, -401, -401, -401, -401, 167, -401, 131, -401, + -401, -401, -401, 168, 131, 131, 131, 131, 131, 131, + -401, -401, -401, -401, -401, -401, -401, -401, 104, 97, + 114, 38, 169, 30, 131, 102, 171, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 30, 131, 172, 155, + 175, -401, -401, -401, 173, -401, -401, -401, -401, -401, + -401, -401, 223, -401, -401, 123, 253, -401, 177, 149, + -401, 178, -10, 181, -401, 182, -401, -401, 134, -401, + -401, 167, -401, 183, 184, 185, 213, 99, 186, 154, + 187, 146, 153, 7, 188, 167, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, 215, -401, 134, -401, + 190, -401, -401, 167, 191, 192, -401, 102, -48, -401, + 1, 195, 196, 214, 166, -401, 189, -401, -401, -401, + -401, -401, -401, 180, 131, -401, 194, 197, 102, 131, + 30, -401, 203, 205, 201, 131, -401, -401, -401, -401, + 285, 288, 289, -401, -401, -401, -401, 291, -401, -401, + -401, -401, 248, 291, 33, 206, 207, -401, 208, -401, + 167, 14, -401, -401, -401, 293, 292, 92, 209, -401, + 299, -401, 301, 299, -401, 216, 131, -401, -401, 217, + -401, -401, 221, 131, 131, -401, 212, -401, -401, -401, + -401, -401, -401, -401, 218, -401, -401, 220, 224, 225, + -401, 226, -401, 227, -401, 228, -401, 230, -401, 231, + -401, -401, -401, -401, -401, -401, -401, 304, 309, -401, + 312, -401, -401, -401, -401, -401, -401, -401, 232, -401, + -401, -401, -401, 161, 313, -401, 233, -401, 234, 238, + -401, 13, -401, -401, 137, -401, 242, -15, 243, 3, + -401, 314, -401, 133, 131, -401, -401, 296, 94, 146, + -401, 245, -401, 246, -401, 247, -401, -401, -401, -401, + -401, -401, -401, 249, -401, -401, -401, 131, -401, 332, + 337, -401, 131, -401, -401, -401, 131, 142, 114, 28, + -401, -401, -401, -401, -401, -401, -401, -401, 250, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, 331, -401, -401, + 68, -401, -401, -401, -401, 43, -401, -401, -401, -401, + 255, 256, 257, 258, -401, 300, 3, -401, -401, -401, + -401, -401, -401, 131, -401, 131, 201, 285, 288, 259, + -401, -401, 252, 264, 265, 263, 261, 266, 270, 313, + -401, 131, 133, -401, 285, -401, 288, 80, -401, -401, + -401, -401, 313, 267, -401 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -369, -94, -88, 133, -369, -369, -334, -369, -85, -369, - -369, -369, -369, -369, -369, -369, -369, 128, -369, -369, - -369, -369, -369, -369, -369, 251, -369, -369, -369, 77, - -369, -369, -369, -369, -369, -369, -369, -369, -369, -369, - -72, -369, -81, -369, -369, -369, -369, -369, -369, -369, - -369, -369, -369, -369, -305, 101, -369, -369, -369, -369, - -369, -369, -369, -369, -369, -369, -369, -369, -22, -369, - -369, -336, -369, -369, -369, -369, -369, -369, 254, -369, - -369, -369, -369, -369, -369, -369, -342, -368, 256, -369, - -369, -369, -80, -110, -82, -369, -369, -369, -369, 279, - -369, 257, -369, -369, -369, -161, 156, -146, -369, -369, - -369, -369, -369, -369 + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -69, + -82, -401, -100, 151, -86, 210, -401, -401, -366, -401, + -54, -401, -401, -401, -401, -401, -401, -401, -401, 174, + -401, -401, -401, -118, -401, -401, 229, -401, -401, -401, + -401, -401, 295, -401, -401, -401, 110, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -51, -401, -88, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -311, 139, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -2, -401, -401, -400, -401, + -401, -401, -401, -401, -401, 298, -401, -401, -401, -401, + -401, -401, -401, -390, -295, 302, -401, -401, -136, -87, + -120, -89, -401, -401, -401, -401, -401, 251, -401, 176, + -401, -401, -401, -176, 198, -153, -401, -401, -401, -401, + -401, -401, -6 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -60 +#define YYTABLE_NINF -230 static const yytype_int16 yytable[] = { - 139, 133, 137, 192, 145, 231, 149, 106, 107, 152, - 216, 148, 254, 150, 151, 396, 147, 350, 147, 108, - 385, 147, 108, 239, 244, 85, 86, 183, 280, 380, - 56, 139, 280, 87, 281, 184, 5, 153, 281, 221, - 198, 280, 248, 381, 421, 154, 109, 281, 185, 282, - 109, 186, 301, 7, 353, 88, 89, 110, 187, 10, - 432, 110, 210, 382, 57, 354, 222, 240, 155, 419, - 90, 302, 188, 49, 284, 383, 417, 111, 284, 51, - 111, 407, 156, 112, 431, 283, 429, 284, 66, 140, - 430, 291, 52, 351, 53, 189, 190, 434, 113, 69, - 70, 141, 113, 69, 70, 158, 113, 292, 293, 225, - 54, 226, 203, 66, 160, 264, 161, 159, 76, 204, - 263, 213, 162, 227, 269, 226, 397, 147, 214, 163, - 164, 165, 74, 166, 252, 167, 232, 227, 398, 233, - 234, 253, 310, 235, 168, 81, 1, 2, 294, 82, - 344, 236, 61, 62, 63, 64, 65, 345, 433, 73, - 401, 169, 170, 390, 408, 386, 75, 402, 78, 237, - 139, 409, 69, 70, 11, 12, 13, 316, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 193, 201, 202, 194, 195, 93, 94, - 95, 96, 334, 335, 336, 337, 346, 347, 92, 79, - 98, 99, 80, 100, 101, 102, 103, 104, 125, 126, - 127, 56, 130, 378, 391, 139, 358, 137, 143, -59, - 199, 206, 197, 220, 200, 208, 209, 211, 212, 245, - 267, 270, 217, 218, 219, 224, 230, 242, 247, 249, - 250, 259, 139, 265, 262, 260, 272, 316, 274, 276, - 278, 287, 288, 290, 297, 305, 299, 307, 304, 312, - 311, 318, 320, 321, 327, 317, 329, 322, 323, 331, - 324, 339, 325, 363, 326, 333, 341, 342, 416, 343, - 349, 379, 392, 387, 388, 389, 390, 394, 403, 404, - 410, 425, 423, 411, 412, 413, 422, 426, 424, 139, - 358, 137, 428, 427, 435, 258, 139, 309, 316, 415, - 128, 279, 400, 0, 84, 0, 134, 129, 135, 246, - 0, 0, 316 + 152, 146, 150, 52, 208, 254, 164, 209, 383, 167, + 116, 117, 158, 116, 117, 162, 430, 162, 239, 163, + 162, 165, 166, 125, 278, 118, 233, 5, 118, 13, + 14, 15, 267, 262, 16, 152, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 419, 118, 119, + 271, 212, 119, 116, 117, 322, 323, 456, 310, 467, + 120, 276, 119, 120, 311, 387, 312, 198, 118, 207, + 7, 277, 473, 120, 470, 199, 388, 263, 53, 453, + 58, 55, 211, 121, 10, 11, 121, 122, 200, 275, + 122, 201, 119, 310, 233, 468, 324, 123, 202, 311, + 230, 68, 313, 120, 314, 124, 121, 321, 124, 442, + 292, 56, 203, 72, 73, 59, 72, 73, 124, 310, + 414, 124, 377, 10, 11, 311, 121, 331, 244, 293, + 122, 173, 378, 168, 415, 204, 205, 436, 289, 314, + 162, 169, 175, 174, 176, 88, 332, 437, 124, 299, + 177, 89, 443, 458, 416, 245, 341, 178, 179, 180, + 71, 181, 444, 182, 170, 314, 417, 68, 153, 91, + 92, 471, 183, 249, 72, 73, 432, 93, 171, 248, + 154, 249, 57, 420, 219, 250, 472, 152, 433, 184, + 185, 220, 424, 250, 347, 236, 1, 2, 348, 94, + 95, 255, 237, 112, 256, 257, 113, 114, 258, 99, + 100, 101, 102, 82, 96, 83, 259, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 63, + 64, 65, 66, 67, 260, 80, 78, 79, 367, 368, + 369, 370, 10, 11, 72, 73, 217, 218, 71, 225, + 379, 380, 81, 86, 84, 87, 98, 425, 143, 104, + 152, 392, 150, 110, 138, 105, 106, 107, 412, 108, + 141, 109, 136, 137, 215, 140, 222, 243, 156, 58, + -66, 268, 210, 159, 297, 216, 224, 229, 152, 213, + 234, 235, 288, 347, 240, 241, 242, 247, 253, 265, + 431, 270, 272, 273, 283, 284, 286, 295, 300, -229, + 290, 302, 304, 291, 306, 308, 327, 317, 318, 320, + 334, 329, 335, 452, 337, 343, 340, 360, 350, 342, + 349, 351, 362, 353, 354, 364, 372, 397, 355, 356, + 357, 385, 358, 359, 366, 374, 375, 152, 392, 150, + 376, 382, 386, 413, 152, 426, 347, 421, 422, 423, + 428, 424, 438, 439, 445, 446, 449, 464, 447, 448, + 459, 460, 347, 461, 462, 463, 466, 454, 465, 474, + 469, 294, 142, 339, 282, 451, 435, 147, 226, 285, + 214, 148, 309, 0, 0, 0, 269 }; static const yytype_int16 yycheck[] = { - 82, 82, 82, 113, 92, 166, 100, 22, 23, 103, - 156, 99, 22, 101, 102, 349, 98, 22, 100, 37, - 325, 103, 37, 25, 170, 28, 29, 28, 24, 25, - 64, 113, 24, 36, 30, 36, 0, 28, 30, 28, - 125, 24, 188, 39, 412, 36, 61, 30, 49, 32, - 61, 52, 34, 8, 61, 58, 59, 72, 59, 98, - 428, 72, 147, 59, 98, 72, 55, 69, 59, 411, - 73, 53, 73, 106, 70, 71, 410, 95, 70, 98, - 95, 386, 73, 98, 426, 68, 422, 70, 98, 26, - 424, 237, 98, 98, 98, 96, 97, 433, 113, 110, - 111, 38, 113, 110, 111, 33, 113, 40, 41, 24, - 98, 26, 60, 98, 27, 209, 29, 45, 98, 67, - 208, 60, 35, 38, 212, 26, 33, 209, 67, 42, - 43, 44, 106, 46, 107, 48, 47, 38, 45, 50, - 51, 114, 252, 54, 57, 108, 3, 4, 81, 112, - 107, 62, 19, 20, 21, 22, 23, 114, 104, 26, - 107, 74, 75, 109, 107, 326, 106, 114, 112, 80, - 252, 114, 110, 111, 5, 6, 7, 259, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 99, 22, 23, 102, 103, 99, 100, - 101, 102, 76, 77, 78, 79, 110, 111, 107, 112, - 107, 107, 112, 107, 107, 107, 107, 102, 107, 107, - 98, 64, 22, 321, 344, 317, 317, 317, 108, 108, - 98, 22, 108, 63, 109, 107, 107, 107, 107, 65, - 82, 22, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 107, 344, 102, 109, 112, 22, 349, 22, 22, - 66, 108, 108, 108, 22, 22, 28, 22, 108, 102, - 109, 108, 107, 107, 22, 113, 22, 109, 109, 22, - 109, 22, 109, 22, 109, 109, 109, 109, 408, 109, - 107, 56, 22, 109, 109, 109, 109, 22, 109, 31, - 107, 109, 114, 108, 108, 65, 108, 104, 107, 401, - 401, 401, 104, 109, 109, 197, 408, 250, 410, 401, - 79, 230, 354, -1, 55, -1, 82, 80, 82, 183, - -1, -1, 424 + 89, 89, 89, 9, 124, 181, 106, 125, 23, 109, + 23, 24, 98, 23, 24, 104, 382, 106, 171, 105, + 109, 107, 108, 77, 23, 38, 162, 0, 38, 5, + 6, 7, 185, 26, 10, 124, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 358, 38, 62, + 203, 137, 62, 23, 24, 41, 42, 447, 25, 459, + 73, 109, 62, 73, 31, 62, 33, 29, 38, 123, + 8, 119, 472, 73, 464, 37, 73, 70, 108, 445, + 65, 99, 136, 96, 99, 100, 96, 100, 50, 207, + 100, 53, 62, 25, 230, 461, 82, 110, 60, 31, + 110, 100, 69, 73, 71, 118, 96, 260, 118, 420, + 228, 99, 74, 113, 114, 100, 113, 114, 118, 25, + 26, 118, 109, 99, 100, 31, 96, 35, 29, 229, + 100, 34, 119, 29, 40, 97, 98, 109, 224, 71, + 229, 37, 28, 46, 30, 111, 54, 119, 118, 235, + 36, 117, 109, 448, 60, 56, 276, 43, 44, 45, + 99, 47, 119, 49, 60, 71, 72, 100, 27, 29, + 30, 466, 58, 27, 113, 114, 34, 37, 74, 25, + 39, 27, 99, 359, 61, 39, 106, 276, 46, 75, + 76, 68, 112, 39, 283, 61, 3, 4, 284, 59, + 60, 48, 68, 101, 51, 52, 104, 105, 55, 101, + 102, 103, 104, 9, 74, 11, 63, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 19, + 20, 21, 22, 23, 81, 108, 26, 27, 77, 78, + 79, 80, 99, 100, 113, 114, 23, 24, 99, 100, + 113, 114, 108, 117, 99, 117, 109, 377, 23, 109, + 349, 349, 349, 104, 99, 109, 109, 109, 354, 109, + 100, 109, 109, 109, 99, 109, 23, 64, 111, 65, + 111, 66, 111, 115, 83, 112, 109, 109, 377, 117, + 109, 109, 112, 382, 111, 111, 111, 111, 111, 111, + 386, 111, 111, 111, 109, 109, 117, 104, 23, 104, + 116, 23, 23, 116, 23, 67, 23, 111, 111, 111, + 111, 29, 23, 443, 23, 104, 110, 23, 110, 112, + 118, 111, 23, 109, 109, 23, 23, 23, 112, 112, + 112, 347, 112, 112, 112, 112, 112, 436, 436, 436, + 112, 109, 109, 57, 443, 23, 445, 112, 112, 112, + 23, 112, 112, 32, 109, 109, 66, 106, 111, 111, + 111, 119, 461, 109, 109, 112, 106, 446, 112, 112, + 462, 230, 87, 273, 210, 436, 388, 89, 159, 213, + 139, 89, 253, -1, -1, -1, 198 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_uint16 yystos[] = { - 0, 3, 4, 116, 117, 0, 118, 8, 119, 120, - 98, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 135, - 158, 159, 166, 167, 168, 230, 232, 235, 248, 106, - 233, 98, 98, 98, 98, 231, 64, 98, 138, 144, - 236, 138, 138, 138, 138, 138, 98, 139, 152, 110, - 111, 137, 229, 138, 106, 106, 98, 234, 112, 112, - 112, 108, 112, 170, 234, 28, 29, 36, 58, 59, - 73, 237, 107, 99, 100, 101, 102, 157, 107, 107, - 107, 107, 107, 107, 102, 154, 22, 23, 37, 61, - 72, 95, 98, 113, 143, 145, 160, 174, 177, 213, - 217, 220, 224, 226, 227, 107, 107, 98, 160, 236, - 22, 169, 173, 177, 213, 223, 225, 227, 228, 229, - 26, 38, 238, 108, 242, 137, 136, 229, 137, 136, - 137, 137, 136, 28, 36, 59, 73, 165, 33, 45, - 27, 29, 35, 42, 43, 44, 46, 48, 57, 74, - 75, 178, 180, 183, 185, 187, 191, 194, 196, 198, - 200, 203, 212, 28, 36, 49, 52, 59, 73, 96, - 97, 161, 228, 99, 102, 103, 156, 108, 143, 98, - 109, 22, 23, 60, 67, 239, 22, 245, 107, 107, - 143, 107, 107, 60, 67, 241, 242, 108, 108, 108, - 63, 28, 55, 195, 108, 24, 26, 38, 184, 240, - 108, 240, 47, 50, 51, 54, 62, 80, 207, 25, - 69, 199, 108, 244, 242, 65, 241, 108, 242, 108, - 108, 163, 107, 114, 22, 146, 147, 148, 152, 107, - 112, 171, 109, 137, 136, 102, 155, 82, 133, 137, - 22, 221, 22, 222, 22, 197, 22, 190, 66, 190, - 24, 30, 32, 68, 70, 179, 189, 108, 108, 208, - 108, 242, 40, 41, 81, 204, 205, 22, 247, 28, - 188, 34, 53, 192, 108, 22, 164, 22, 162, 164, - 228, 109, 102, 153, 140, 141, 229, 113, 108, 243, - 107, 107, 109, 109, 109, 109, 109, 22, 211, 22, - 209, 22, 210, 109, 76, 77, 78, 79, 193, 22, - 206, 109, 109, 109, 107, 114, 110, 111, 149, 107, - 22, 98, 142, 61, 72, 172, 175, 176, 177, 214, - 215, 218, 223, 22, 246, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 134, 137, 56, - 25, 39, 59, 71, 181, 189, 240, 109, 109, 109, - 109, 228, 22, 150, 22, 151, 141, 33, 45, 201, - 203, 107, 114, 109, 31, 182, 186, 189, 107, 114, - 107, 108, 108, 65, 202, 175, 228, 141, 216, 221, - 219, 222, 108, 114, 107, 109, 104, 109, 104, 206, - 141, 221, 222, 104, 206, 109 + 0, 3, 4, 121, 122, 0, 123, 8, 124, 125, + 99, 100, 262, 5, 6, 7, 10, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 141, 170, 171, 178, 179, 180, 242, 244, 245, + 248, 261, 262, 108, 246, 99, 99, 99, 65, 100, + 145, 151, 249, 145, 145, 145, 145, 145, 100, 146, + 159, 99, 113, 114, 144, 166, 168, 241, 145, 145, + 108, 108, 9, 11, 99, 247, 117, 117, 111, 117, + 182, 29, 30, 37, 59, 60, 74, 250, 109, 101, + 102, 103, 104, 164, 109, 109, 109, 109, 109, 109, + 104, 161, 101, 104, 105, 163, 23, 24, 38, 62, + 73, 96, 100, 110, 118, 150, 152, 172, 186, 189, + 225, 229, 232, 236, 238, 239, 109, 109, 99, 243, + 109, 100, 172, 23, 181, 185, 189, 225, 235, 237, + 239, 240, 241, 27, 39, 251, 111, 255, 144, 115, + 165, 142, 241, 144, 142, 144, 144, 142, 29, 37, + 60, 74, 177, 34, 46, 28, 30, 36, 43, 44, + 45, 47, 49, 58, 75, 76, 190, 192, 195, 197, + 199, 203, 206, 208, 210, 212, 215, 224, 29, 37, + 50, 53, 60, 74, 97, 98, 173, 150, 240, 163, + 111, 150, 144, 117, 247, 99, 112, 23, 24, 61, + 68, 252, 23, 258, 109, 100, 166, 167, 169, 109, + 110, 143, 150, 238, 109, 109, 61, 68, 254, 255, + 111, 111, 111, 64, 29, 56, 207, 111, 25, 27, + 39, 196, 253, 111, 253, 48, 51, 52, 55, 63, + 81, 219, 26, 70, 211, 111, 257, 255, 66, 254, + 111, 255, 111, 111, 175, 163, 109, 119, 23, 153, + 154, 155, 159, 109, 109, 249, 117, 183, 112, 144, + 116, 116, 163, 142, 143, 104, 162, 83, 139, 144, + 23, 233, 23, 234, 23, 209, 23, 202, 67, 202, + 25, 31, 33, 69, 71, 191, 201, 111, 111, 220, + 111, 255, 41, 42, 82, 216, 217, 23, 260, 29, + 200, 35, 54, 204, 111, 23, 176, 23, 174, 176, + 110, 240, 112, 104, 160, 147, 148, 241, 144, 118, + 110, 111, 256, 109, 109, 112, 112, 112, 112, 112, + 23, 223, 23, 221, 23, 222, 112, 77, 78, 79, + 80, 205, 23, 218, 112, 112, 112, 109, 119, 113, + 114, 156, 109, 23, 149, 262, 109, 62, 73, 184, + 187, 188, 189, 226, 227, 230, 235, 23, 259, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 140, 144, 57, 26, 40, 60, 72, 193, 201, + 253, 112, 112, 112, 112, 240, 23, 157, 23, 158, + 148, 144, 34, 46, 213, 215, 109, 119, 112, 32, + 194, 198, 201, 109, 119, 109, 109, 111, 111, 66, + 214, 187, 240, 148, 139, 228, 233, 231, 234, 111, + 119, 109, 109, 112, 106, 112, 106, 218, 148, 140, + 233, 234, 106, 218, 112 }; #define yyerrok (yyerrstatus = 0) @@ -2068,7 +2119,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 260 "program_parse.y" +#line 272 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2081,7 +2132,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 268 "program_parse.y" +#line 280 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2096,7 +2147,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 284 "program_parse.y" +#line 296 "program_parse.y" { int valid = 0; @@ -2121,7 +2172,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 310 "program_parse.y" +#line 322 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2141,7 +2192,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 328 "program_parse.y" +#line 340 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2151,85 +2202,79 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 333 "program_parse.y" +#line 345 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; ;} break; - case 23: + case 24: /* Line 1455 of yacc.c */ -#line 353 "program_parse.y" +#line 366 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 24: + case 25: /* Line 1455 of yacc.c */ -#line 359 "program_parse.y" +#line 372 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 25: + case 26: /* Line 1455 of yacc.c */ -#line 366 "program_parse.y" +#line 378 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 26: + case 27: /* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 384 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; - case 27: + case 28: /* Line 1455 of yacc.c */ -#line 381 "program_parse.y" +#line 391 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; - case 28: + case 29: /* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 398 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} break; - case 29: + case 30: /* Line 1455 of yacc.c */ -#line 396 "program_parse.y" +#line 404 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { const GLbitfield tex_mask = (1U << (yyvsp[(6) - (8)].integer)); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; (yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer); if ((yyvsp[(8) - (8)].integer) < 0) { @@ -2265,113 +2310,173 @@ yyreduce: ;} break; - case 30: + case 31: /* Line 1455 of yacc.c */ -#line 441 "program_parse.y" +#line 448 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; ;} break; - case 31: + case 32: /* Line 1455 of yacc.c */ -#line 448 "program_parse.y" +#line 453 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; + (yyval.inst)->Base.DstReg.CondSwizzle = (yyvsp[(2) - (2)].dst_reg).CondSwizzle; + (yyval.inst)->Base.DstReg.CondSrc = (yyvsp[(2) - (2)].dst_reg).CondSrc; + state->fragment.UsesKill = 1; + ;} + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 463 "program_parse.y" + { + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); + if ((yyval.inst) != NULL) { + const GLbitfield tex_mask = (1U << (yyvsp[(10) - (12)].integer)); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + (yyval.inst)->Base.TexSrcUnit = (yyvsp[(10) - (12)].integer); + + if ((yyvsp[(12) - (12)].integer) < 0) { + shadow_tex = tex_mask; + + (yyval.inst)->Base.TexSrcTarget = -(yyvsp[(12) - (12)].integer); + (yyval.inst)->Base.TexShadow = 1; + } else { + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(12) - (12)].integer); + } + + target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != 0) + && ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& (yylsp[(12) - (12)]), state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + ;} + break; + + case 34: + +/* Line 1455 of yacc.c */ +#line 507 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 32: + case 35: /* Line 1455 of yacc.c */ -#line 453 "program_parse.y" +#line 512 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; - case 33: + case 36: /* Line 1455 of yacc.c */ -#line 454 "program_parse.y" +#line 513 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; - case 34: + case 37: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 514 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; - case 35: + case 38: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 515 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; - case 36: + case 39: /* Line 1455 of yacc.c */ -#line 457 "program_parse.y" +#line 516 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; - case 37: + case 40: /* Line 1455 of yacc.c */ -#line 458 "program_parse.y" +#line 517 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; - case 38: + case 41: /* Line 1455 of yacc.c */ -#line 459 "program_parse.y" +#line 518 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; - case 39: + case 42: /* Line 1455 of yacc.c */ -#line 460 "program_parse.y" +#line 519 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; - case 40: + case 43: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 520 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; - case 41: + case 44: /* Line 1455 of yacc.c */ -#line 462 "program_parse.y" +#line 521 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; - case 42: + case 45: /* Line 1455 of yacc.c */ -#line 463 "program_parse.y" +#line 522 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; - case 43: + case 46: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 523 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; - case 44: + case 47: /* Line 1455 of yacc.c */ -#line 468 "program_parse.y" +#line 527 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2379,31 +2484,81 @@ yyreduce: (yyvsp[(4) - (6)].src_reg).Base.Swizzle = (yyvsp[(6) - (6)].swiz_mask).swizzle; (yyvsp[(4) - (6)].src_reg).Base.Negate = (yyvsp[(6) - (6)].swiz_mask).mask; - (yyval.inst) = asm_instruction_ctor(OPCODE_SWZ, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); ;} break; - case 45: + case 48: /* Line 1455 of yacc.c */ -#line 481 "program_parse.y" +#line 539 "program_parse.y" { - (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); - if ((yyvsp[(1) - (3)].negate)) { + if ((yyvsp[(1) - (2)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + ;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 547 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (4)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (4)].negate)) { (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; } + (yyval.src_reg).Base.Abs = 1; + ;} + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 564 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, - (yyvsp[(3) - (3)].swiz_mask).swizzle); + (yyvsp[(2) - (2)].swiz_mask).swizzle); ;} break; - case 46: + case 51: + +/* Line 1455 of yacc.c */ +#line 571 "program_parse.y" + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(1) - (1)].vector)); + + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.File = PROGRAM_CONSTANT; + (yyval.src_reg).Base.Index = temp_sym.param_binding_begin; + ;} + break; + + case 52: /* Line 1455 of yacc.c */ -#line 494 "program_parse.y" +#line 590 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2416,13 +2571,38 @@ yyreduce: ;} break; - case 47: + case 53: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 601 "program_parse.y" { - (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); - (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (5)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (5)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Abs = 1; + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(4) - (5)].swiz_mask).swizzle); + ;} + break; + + case 54: + +/* Line 1455 of yacc.c */ +#line 621 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; + (yyval.dst_reg).CondMask = (yyvsp[(3) - (3)].dst_reg).CondMask; + (yyval.dst_reg).CondSwizzle = (yyvsp[(3) - (3)].dst_reg).CondSwizzle; + (yyval.dst_reg).CondSrc = (yyvsp[(3) - (3)].dst_reg).CondSrc; if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -2431,7 +2611,7 @@ yyreduce: */ if (state->option.PositionInvariant && ((yyval.dst_reg).Index == VERT_RESULT_HPOS)) { - yyerror(& (yylsp[(1) - (2)]), state, "position-invariant programs cannot " + yyerror(& (yylsp[(1) - (3)]), state, "position-invariant programs cannot " "write position"); YYERROR; } @@ -2441,10 +2621,10 @@ yyreduce: ;} break; - case 48: + case 55: /* Line 1455 of yacc.c */ -#line 529 "program_parse.y" +#line 646 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2453,10 +2633,10 @@ yyreduce: ;} break; - case 49: + case 56: /* Line 1455 of yacc.c */ -#line 538 "program_parse.y" +#line 655 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2489,20 +2669,20 @@ yyreduce: ;} break; - case 50: + case 57: /* Line 1455 of yacc.c */ -#line 571 "program_parse.y" +#line 688 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 51: + case 58: /* Line 1455 of yacc.c */ -#line 578 "program_parse.y" +#line 695 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2519,10 +2699,10 @@ yyreduce: ;} break; - case 52: + case 59: /* Line 1455 of yacc.c */ -#line 593 "program_parse.y" +#line 710 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2572,10 +2752,10 @@ yyreduce: ;} break; - case 53: + case 60: /* Line 1455 of yacc.c */ -#line 643 "program_parse.y" +#line 760 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2619,10 +2799,10 @@ yyreduce: ;} break; - case 54: + case 61: /* Line 1455 of yacc.c */ -#line 685 "program_parse.y" +#line 802 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2635,10 +2815,10 @@ yyreduce: ;} break; - case 55: + case 62: /* Line 1455 of yacc.c */ -#line 696 "program_parse.y" +#line 813 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2661,10 +2841,10 @@ yyreduce: ;} break; - case 56: + case 63: /* Line 1455 of yacc.c */ -#line 717 "program_parse.y" +#line 834 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2674,10 +2854,10 @@ yyreduce: ;} break; - case 57: + case 64: /* Line 1455 of yacc.c */ -#line 727 "program_parse.y" +#line 844 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2685,10 +2865,10 @@ yyreduce: ;} break; - case 58: + case 65: /* Line 1455 of yacc.c */ -#line 733 "program_parse.y" +#line 850 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2719,10 +2899,10 @@ yyreduce: ;} break; - case 59: + case 66: /* Line 1455 of yacc.c */ -#line 764 "program_parse.y" +#line 881 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2739,20 +2919,20 @@ yyreduce: ;} break; - case 62: + case 69: /* Line 1455 of yacc.c */ -#line 783 "program_parse.y" +#line 900 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 63: + case 70: /* Line 1455 of yacc.c */ -#line 790 "program_parse.y" +#line 907 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2764,35 +2944,37 @@ yyreduce: ;} break; - case 64: + case 71: /* Line 1455 of yacc.c */ -#line 801 "program_parse.y" +#line 918 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 65: + case 72: /* Line 1455 of yacc.c */ -#line 802 "program_parse.y" +#line 919 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 66: + case 73: /* Line 1455 of yacc.c */ -#line 803 "program_parse.y" +#line 920 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 67: + case 74: /* Line 1455 of yacc.c */ -#line 807 "program_parse.y" +#line 924 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -2800,14 +2982,16 @@ yyreduce: ;} break; - case 68: + case 75: /* Line 1455 of yacc.c */ -#line 819 "program_parse.y" +#line 938 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -2815,10 +2999,10 @@ yyreduce: ;} break; - case 69: + case 76: /* Line 1455 of yacc.c */ -#line 831 "program_parse.y" +#line 952 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2836,10 +3020,10 @@ yyreduce: ;} break; - case 70: + case 77: /* Line 1455 of yacc.c */ -#line 849 "program_parse.y" +#line 970 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2850,10 +3034,10 @@ yyreduce: ;} break; - case 71: + case 78: /* Line 1455 of yacc.c */ -#line 860 "program_parse.y" +#line 981 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2865,24 +3049,125 @@ yyreduce: ;} break; - case 76: + case 83: /* Line 1455 of yacc.c */ -#line 876 "program_parse.y" +#line 997 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 81: + case 88: /* Line 1455 of yacc.c */ -#line 880 "program_parse.y" +#line 1001 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 88: + case 89: + +/* Line 1455 of yacc.c */ +#line 1005 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); + ;} + break; + + case 90: + +/* Line 1455 of yacc.c */ +#line 1009 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); + ;} + break; + + case 91: + +/* Line 1455 of yacc.c */ +#line 1013 "program_parse.y" + { + (yyval.dst_reg).CondMask = COND_TR; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 92: + +/* Line 1455 of yacc.c */ +#line 1021 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; + ;} + break; + + case 93: + +/* Line 1455 of yacc.c */ +#line 1028 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; + ;} + break; + + case 94: /* Line 1455 of yacc.c */ -#line 892 "program_parse.y" +#line 1035 "program_parse.y" + { + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 95: + +/* Line 1455 of yacc.c */ +#line 1058 "program_parse.y" + { + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 1089 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2900,55 +3185,55 @@ yyreduce: ;} break; - case 89: + case 103: /* Line 1455 of yacc.c */ -#line 910 "program_parse.y" +#line 1107 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 90: + case 104: /* Line 1455 of yacc.c */ -#line 914 "program_parse.y" +#line 1111 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 91: + case 105: /* Line 1455 of yacc.c */ -#line 920 "program_parse.y" +#line 1117 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 92: + case 106: /* Line 1455 of yacc.c */ -#line 924 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 93: + case 107: /* Line 1455 of yacc.c */ -#line 928 "program_parse.y" +#line 1125 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 94: + case 108: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 1129 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2959,10 +3244,10 @@ yyreduce: ;} break; - case 95: + case 109: /* Line 1455 of yacc.c */ -#line 941 "program_parse.y" +#line 1138 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2973,38 +3258,38 @@ yyreduce: ;} break; - case 96: + case 110: /* Line 1455 of yacc.c */ -#line 950 "program_parse.y" +#line 1147 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 97: + case 111: /* Line 1455 of yacc.c */ -#line 954 "program_parse.y" +#line 1151 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 98: + case 112: /* Line 1455 of yacc.c */ -#line 959 "program_parse.y" +#line 1156 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 99: + case 113: /* Line 1455 of yacc.c */ -#line 965 "program_parse.y" +#line 1162 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3015,46 +3300,46 @@ yyreduce: ;} break; - case 103: + case 117: /* Line 1455 of yacc.c */ -#line 979 "program_parse.y" +#line 1176 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 104: + case 118: /* Line 1455 of yacc.c */ -#line 983 "program_parse.y" +#line 1180 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 105: + case 119: /* Line 1455 of yacc.c */ -#line 987 "program_parse.y" +#line 1184 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 106: + case 120: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 1188 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 109: + case 123: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1196 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3070,10 +3355,10 @@ yyreduce: ;} break; - case 110: + case 124: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1212 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3095,19 +3380,19 @@ yyreduce: ;} break; - case 111: + case 125: /* Line 1455 of yacc.c */ -#line 1037 "program_parse.y" +#line 1234 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 112: + case 126: /* Line 1455 of yacc.c */ -#line 1041 "program_parse.y" +#line 1238 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3118,38 +3403,38 @@ yyreduce: ;} break; - case 113: + case 127: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1249 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 114: + case 128: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1255 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 116: + case 130: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1262 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 117: + case 131: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1269 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3157,10 +3442,10 @@ yyreduce: ;} break; - case 118: + case 132: /* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" +#line 1275 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3168,10 +3453,10 @@ yyreduce: ;} break; - case 119: + case 133: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1281 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3179,10 +3464,10 @@ yyreduce: ;} break; - case 120: + case 134: /* Line 1455 of yacc.c */ -#line 1092 "program_parse.y" +#line 1289 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3190,10 +3475,10 @@ yyreduce: ;} break; - case 121: + case 135: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1295 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3201,10 +3486,10 @@ yyreduce: ;} break; - case 122: + case 136: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1301 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3212,10 +3497,10 @@ yyreduce: ;} break; - case 123: + case 137: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1309 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3223,10 +3508,10 @@ yyreduce: ;} break; - case 124: + case 138: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1315 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3234,10 +3519,10 @@ yyreduce: ;} break; - case 125: + case 139: /* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" +#line 1321 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3245,101 +3530,101 @@ yyreduce: ;} break; - case 126: + case 140: /* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" +#line 1328 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 127: + case 141: /* Line 1455 of yacc.c */ -#line 1132 "program_parse.y" +#line 1329 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 128: + case 142: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1332 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 129: + case 143: /* Line 1455 of yacc.c */ -#line 1136 "program_parse.y" +#line 1333 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 130: + case 144: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1334 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: + case 145: /* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" +#line 1335 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 132: + case 146: /* Line 1455 of yacc.c */ -#line 1139 "program_parse.y" +#line 1336 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 133: + case 147: /* Line 1455 of yacc.c */ -#line 1140 "program_parse.y" +#line 1337 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: + case 148: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1338 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 135: + case 149: /* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" +#line 1339 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 136: + case 150: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1340 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 137: + case 151: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1341 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 138: + case 152: /* Line 1455 of yacc.c */ -#line 1145 "program_parse.y" +#line 1342 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 139: + case 153: /* Line 1455 of yacc.c */ -#line 1149 "program_parse.y" +#line 1346 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3348,37 +3633,37 @@ yyreduce: ;} break; - case 140: + case 154: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1355 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 141: + case 155: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1359 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 142: + case 156: /* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" +#line 1363 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 143: + case 157: /* Line 1455 of yacc.c */ -#line 1172 "program_parse.y" +#line 1369 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3387,28 +3672,28 @@ yyreduce: ;} break; - case 144: + case 158: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1378 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 145: + case 159: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1382 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 146: + case 160: /* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" +#line 1386 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3419,57 +3704,57 @@ yyreduce: ;} break; - case 147: + case 161: /* Line 1455 of yacc.c */ -#line 1198 "program_parse.y" +#line 1395 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 148: + case 162: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1399 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 149: + case 163: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1405 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 150: + case 164: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1411 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 151: + case 165: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1418 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 152: + case 166: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1423 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3477,10 +3762,10 @@ yyreduce: ;} break; - case 153: + case 167: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1431 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3490,10 +3775,10 @@ yyreduce: ;} break; - case 155: + case 169: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1443 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3501,46 +3786,46 @@ yyreduce: ;} break; - case 156: + case 170: /* Line 1455 of yacc.c */ -#line 1254 "program_parse.y" +#line 1451 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 157: + case 171: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1457 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 158: + case 172: /* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" +#line 1461 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 159: + case 173: /* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" +#line 1465 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 160: + case 174: /* Line 1455 of yacc.c */ -#line 1274 "program_parse.y" +#line 1471 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3551,10 +3836,10 @@ yyreduce: ;} break; - case 161: + case 175: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1482 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3563,92 +3848,92 @@ yyreduce: ;} break; - case 162: + case 176: /* Line 1455 of yacc.c */ -#line 1294 "program_parse.y" +#line 1491 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 163: + case 177: /* Line 1455 of yacc.c */ -#line 1298 "program_parse.y" +#line 1495 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 164: + case 178: /* Line 1455 of yacc.c */ -#line 1303 "program_parse.y" +#line 1500 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 165: + case 179: /* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" +#line 1504 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 166: + case 180: /* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" +#line 1508 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 167: + case 181: /* Line 1455 of yacc.c */ -#line 1315 "program_parse.y" +#line 1512 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 168: + case 182: /* Line 1455 of yacc.c */ -#line 1321 "program_parse.y" +#line 1518 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 169: + case 183: /* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" +#line 1525 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 170: + case 184: /* Line 1455 of yacc.c */ -#line 1332 "program_parse.y" +#line 1529 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 171: + case 185: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1535 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3656,10 +3941,10 @@ yyreduce: ;} break; - case 172: + case 186: /* Line 1455 of yacc.c */ -#line 1346 "program_parse.y" +#line 1543 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3670,38 +3955,38 @@ yyreduce: ;} break; - case 173: + case 187: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1554 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 174: + case 188: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1561 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 175: + case 189: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1565 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 176: + case 190: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1571 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3711,10 +3996,10 @@ yyreduce: ;} break; - case 177: + case 191: /* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" +#line 1581 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3724,20 +4009,20 @@ yyreduce: ;} break; - case 178: + case 192: /* Line 1455 of yacc.c */ -#line 1394 "program_parse.y" +#line 1591 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 179: + case 193: /* Line 1455 of yacc.c */ -#line 1399 "program_parse.y" +#line 1596 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3755,10 +4040,10 @@ yyreduce: ;} break; - case 180: + case 194: /* Line 1455 of yacc.c */ -#line 1417 "program_parse.y" +#line 1614 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3766,55 +4051,55 @@ yyreduce: ;} break; - case 181: + case 195: /* Line 1455 of yacc.c */ -#line 1425 "program_parse.y" +#line 1622 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 182: + case 196: /* Line 1455 of yacc.c */ -#line 1429 "program_parse.y" +#line 1626 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 183: + case 197: /* Line 1455 of yacc.c */ -#line 1435 "program_parse.y" +#line 1632 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 184: + case 198: /* Line 1455 of yacc.c */ -#line 1439 "program_parse.y" +#line 1636 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 185: + case 199: /* Line 1455 of yacc.c */ -#line 1443 "program_parse.y" +#line 1640 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 186: + case 200: /* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" +#line 1646 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3825,88 +4110,88 @@ yyreduce: ;} break; - case 187: + case 201: /* Line 1455 of yacc.c */ -#line 1460 "program_parse.y" +#line 1657 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 188: + case 202: /* Line 1455 of yacc.c */ -#line 1465 "program_parse.y" +#line 1662 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 189: + case 203: /* Line 1455 of yacc.c */ -#line 1470 "program_parse.y" +#line 1667 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 190: + case 204: /* Line 1455 of yacc.c */ -#line 1475 "program_parse.y" +#line 1672 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 191: + case 205: /* Line 1455 of yacc.c */ -#line 1480 "program_parse.y" +#line 1677 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 192: + case 206: /* Line 1455 of yacc.c */ -#line 1485 "program_parse.y" +#line 1682 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 193: + case 207: /* Line 1455 of yacc.c */ -#line 1492 "program_parse.y" +#line 1689 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 194: + case 208: /* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" +#line 1693 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 195: + case 209: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1698 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3920,10 +4205,10 @@ yyreduce: ;} break; - case 196: + case 210: /* Line 1455 of yacc.c */ -#line 1514 "program_parse.y" +#line 1711 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3932,10 +4217,10 @@ yyreduce: ;} break; - case 197: + case 211: /* Line 1455 of yacc.c */ -#line 1522 "program_parse.y" +#line 1719 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3946,20 +4231,20 @@ yyreduce: ;} break; - case 198: + case 212: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1730 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 203: + case 217: /* Line 1455 of yacc.c */ -#line 1545 "program_parse.y" +#line 1742 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3969,30 +4254,30 @@ yyreduce: ;} break; - case 204: + case 218: /* Line 1455 of yacc.c */ -#line 1555 "program_parse.y" +#line 1752 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 205: + case 219: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1757 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 206: + case 220: /* Line 1455 of yacc.c */ -#line 1567 "program_parse.y" +#line 1764 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4002,10 +4287,10 @@ yyreduce: ;} break; - case 207: + case 221: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1774 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4015,30 +4300,30 @@ yyreduce: ;} break; - case 208: + case 222: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1783 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 209: + case 223: /* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" +#line 1788 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 210: + case 224: /* Line 1455 of yacc.c */ -#line 1598 "program_parse.y" +#line 1795 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4048,10 +4333,10 @@ yyreduce: ;} break; - case 211: + case 225: /* Line 1455 of yacc.c */ -#line 1608 "program_parse.y" +#line 1805 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4061,10 +4346,10 @@ yyreduce: ;} break; - case 212: + case 226: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1815 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4074,10 +4359,10 @@ yyreduce: ;} break; - case 217: + case 231: /* Line 1455 of yacc.c */ -#line 1633 "program_parse.y" +#line 1830 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4087,10 +4372,10 @@ yyreduce: ;} break; - case 218: + case 232: /* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" +#line 1840 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4100,10 +4385,10 @@ yyreduce: ;} break; - case 219: + case 233: /* Line 1455 of yacc.c */ -#line 1651 "program_parse.y" +#line 1848 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4113,10 +4398,10 @@ yyreduce: ;} break; - case 220: + case 234: /* Line 1455 of yacc.c */ -#line 1661 "program_parse.y" +#line 1858 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4126,10 +4411,10 @@ yyreduce: ;} break; - case 221: + case 235: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1866 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4139,10 +4424,10 @@ yyreduce: ;} break; - case 222: + case 236: /* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" +#line 1875 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4152,10 +4437,10 @@ yyreduce: ;} break; - case 223: + case 237: /* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" +#line 1884 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4165,63 +4450,110 @@ yyreduce: ;} break; - case 224: + case 238: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1894 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 225: + case 239: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1898 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 226: + case 240: /* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" +#line 1903 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 227: + case 241: /* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" +#line 1904 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 228: + case 242: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1905 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 229: + case 243: /* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} +#line 1908 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 231: + case 245: + +/* Line 1455 of yacc.c */ +#line 1912 "program_parse.y" + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", (yyvsp[(1) - (1)].string)) == 0) { + } else if (strcmp("LONG", (yyvsp[(1) - (1)].string)) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + ;} + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1946 "program_parse.y" + { + ;} + break; + + case 247: /* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" +#line 1950 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 233: + case 249: /* Line 1455 of yacc.c */ -#line 1718 "program_parse.y" +#line 1954 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4229,10 +4561,10 @@ yyreduce: ;} break; - case 234: + case 250: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1960 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4240,26 +4572,26 @@ yyreduce: ;} break; - case 235: + case 251: /* Line 1455 of yacc.c */ -#line 1732 "program_parse.y" +#line 1968 "program_parse.y" { struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); + declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); if (s == NULL) { YYERROR; } else { - s->output_binding = (yyvsp[(4) - (4)].result); + s->output_binding = (yyvsp[(5) - (5)].result); } ;} break; - case 236: + case 252: /* Line 1455 of yacc.c */ -#line 1745 "program_parse.y" +#line 1981 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4270,10 +4602,10 @@ yyreduce: ;} break; - case 237: + case 253: /* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" +#line 1990 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4284,19 +4616,19 @@ yyreduce: ;} break; - case 238: + case 254: /* Line 1455 of yacc.c */ -#line 1763 "program_parse.y" +#line 1999 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 239: + case 255: /* Line 1455 of yacc.c */ -#line 1767 "program_parse.y" +#line 2003 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4307,10 +4639,10 @@ yyreduce: ;} break; - case 240: + case 256: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 2012 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4321,10 +4653,10 @@ yyreduce: ;} break; - case 241: + case 257: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 2021 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4335,19 +4667,19 @@ yyreduce: ;} break; - case 242: + case 258: /* Line 1455 of yacc.c */ -#line 1796 "program_parse.y" +#line 2032 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 243: + case 259: /* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" +#line 2038 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4355,10 +4687,10 @@ yyreduce: ;} break; - case 244: + case 260: /* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" +#line 2044 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4369,10 +4701,10 @@ yyreduce: ;} break; - case 245: + case 261: /* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" +#line 2053 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4383,19 +4715,19 @@ yyreduce: ;} break; - case 246: + case 262: /* Line 1455 of yacc.c */ -#line 1828 "program_parse.y" +#line 2064 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: + case 263: /* Line 1455 of yacc.c */ -#line 1832 "program_parse.y" +#line 2068 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4406,10 +4738,10 @@ yyreduce: ;} break; - case 248: + case 264: /* Line 1455 of yacc.c */ -#line 1841 "program_parse.y" +#line 2077 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4420,94 +4752,94 @@ yyreduce: ;} break; - case 249: + case 265: /* Line 1455 of yacc.c */ -#line 1851 "program_parse.y" +#line 2087 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: + case 266: /* Line 1455 of yacc.c */ -#line 1852 "program_parse.y" +#line 2088 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: + case 267: /* Line 1455 of yacc.c */ -#line 1853 "program_parse.y" +#line 2089 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 252: + case 268: /* Line 1455 of yacc.c */ -#line 1856 "program_parse.y" +#line 2092 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 269: /* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" +#line 2093 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 270: /* Line 1455 of yacc.c */ -#line 1858 "program_parse.y" +#line 2094 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 255: + case 271: /* Line 1455 of yacc.c */ -#line 1861 "program_parse.y" +#line 2097 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 272: /* Line 1455 of yacc.c */ -#line 1862 "program_parse.y" +#line 2098 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 257: + case 273: /* Line 1455 of yacc.c */ -#line 1865 "program_parse.y" +#line 2101 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 274: /* Line 1455 of yacc.c */ -#line 1866 "program_parse.y" +#line 2102 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: + case 275: /* Line 1455 of yacc.c */ -#line 1869 "program_parse.y" +#line 2105 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: + case 276: /* Line 1455 of yacc.c */ -#line 1870 "program_parse.y" +#line 2106 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 261: + case 277: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 2110 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4518,10 +4850,10 @@ yyreduce: ;} break; - case 262: + case 278: /* Line 1455 of yacc.c */ -#line 1885 "program_parse.y" +#line 2121 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4532,10 +4864,10 @@ yyreduce: ;} break; - case 263: + case 279: /* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" +#line 2132 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4546,10 +4878,10 @@ yyreduce: ;} break; - case 264: + case 280: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 2143 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4573,7 +4905,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4577 "program_parse.tab.c" +#line 4909 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4792,7 +5124,49 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1927 "program_parse.y" +#line 2167 "program_parse.y" + + +void +asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } + + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); + } + + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); + } +} struct asm_instruction * @@ -4802,37 +5176,37 @@ asm_instruction_ctor(gl_inst_opcode op, const struct asm_src_register *src1, const struct asm_src_register *src2) { - struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - /* In the core ARB extensions only the KIL instruction doesn't have a - * destination register. - */ - if (dst == NULL) { - init_dst_reg(& inst->Base.DstReg); - } else { - inst->Base.DstReg = *dst; - } + asm_instruction_set_operands(inst, dst, src0, src1, src2); + } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + return inst; +} - if (src1 != NULL) { - inst->Base.SrcReg[1] = src1->Base; - inst->SrcReg[1] = *src1; - } else { - init_src_reg(& inst->SrcReg[1]); - } - if (src2 != NULL) { - inst->Base.SrcReg[2] = src2->Base; - inst->SrcReg[2] = *src2; - } else { - init_src_reg(& inst->SrcReg[2]); - } +struct asm_instruction * +asm_instruction_copy_ctor(const struct prog_instruction *base, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); + + if (inst) { + _mesa_init_instructions(& inst->Base, 1); + inst->Base.Opcode = base->Opcode; + inst->Base.CondUpdate = base->CondUpdate; + inst->Base.CondDst = base->CondDst; + inst->Base.SaturateMode = base->SaturateMode; + inst->Base.Precision = base->Precision; + + asm_instruction_set_operands(inst, dst, src0, src1, src2); } return inst; diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index dabb3bf1a3..860b6f886e 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -58,90 +58,92 @@ ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -152,7 +154,7 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 107 "program_parse.y" +#line 116 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -181,7 +183,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 185 "program_parse.tab.h" +#line 187 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 06c1915fbe..9703e8e670 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -68,10 +68,19 @@ static void init_dst_reg(struct prog_dst_register *r); static void init_src_reg(struct asm_src_register *r); +static void asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, const struct asm_src_register *src0, + const struct asm_src_register *src1, const struct asm_src_register *src2); + static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2); +static struct asm_instruction *asm_instruction_copy_ctor( + const struct prog_instruction *base, const struct prog_dst_register *dst, + const struct asm_src_register *src0, const struct asm_src_register *src1, + const struct asm_src_register *src2); + #ifndef FALSE #define FALSE 0 #define TRUE (!FALSE) @@ -142,7 +151,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Tokens for instructions */ %token <temp_inst> BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP -%token <temp_inst> ARL KIL SWZ +%token <temp_inst> ARL KIL SWZ TXD_OP %token <integer> INTEGER %token <real> REAL @@ -169,7 +178,8 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %token VERTEX VTXATTRIB %token WEIGHT -%token <string> IDENTIFIER +%token <string> IDENTIFIER USED_IDENTIFIER +%type <string> string %token <swiz_mask> MASK4 MASK3 MASK2 MASK1 SWIZZLE %token DOT_DOT %token DOT @@ -177,11 +187,11 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type <inst> instruction ALU_instruction TexInstruction %type <inst> ARL_instruction VECTORop_instruction %type <inst> SCALARop_instruction BINSCop_instruction BINop_instruction -%type <inst> TRIop_instruction SWZ_instruction SAMPLE_instruction +%type <inst> TRIop_instruction TXD_instruction SWZ_instruction SAMPLE_instruction %type <inst> KIL_instruction %type <dst_reg> dstReg maskedDstReg maskedAddrReg -%type <src_reg> srcReg scalarSrcReg swizzleSrcReg +%type <src_reg> srcReg scalarUse scalarSrcReg swizzleSrcReg %type <swiz_mask> scalarSuffix swizzleSuffix extendedSwizzle %type <ext_swizzle> extSwizComp extSwizSel %type <swiz_mask> optionalMask @@ -192,6 +202,8 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type <sym> addrReg %type <swiz_mask> addrComponent addrWriteMask +%type <dst_reg> ccMaskRule ccTest ccMaskRule2 ccTest2 optionalCcMask + %type <result> resultBinding resultColBinding %type <integer> optFaceType optColorType %type <integer> optResultFaceType optResultColorType @@ -280,7 +292,7 @@ optionSequence: optionSequence option | ; -option: OPTION IDENTIFIER ';' +option: OPTION string ';' { int valid = 0; @@ -347,6 +359,7 @@ ALU_instruction: ARL_instruction TexInstruction: SAMPLE_instruction | KIL_instruction + | TXD_instruction ; ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg @@ -357,51 +370,45 @@ ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; TRIop_instruction: TRI_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); } ; SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); if ($$ != NULL) { const GLbitfield tex_mask = (1U << $6); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - $$->Base.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $6; if ($8 < 0) { @@ -442,6 +449,58 @@ KIL_instruction: KIL swizzleSrcReg $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL); state->fragment.UsesKill = 1; } + | KIL ccTest + { + $$ = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + $$->Base.DstReg.CondMask = $2.CondMask; + $$->Base.DstReg.CondSwizzle = $2.CondSwizzle; + $$->Base.DstReg.CondSrc = $2.CondSrc; + state->fragment.UsesKill = 1; + } + ; + +TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget + { + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); + if ($$ != NULL) { + const GLbitfield tex_mask = (1U << $10); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + $$->Base.TexSrcUnit = $10; + + if ($12 < 0) { + shadow_tex = tex_mask; + + $$->Base.TexSrcTarget = -$12; + $$->Base.TexShadow = 1; + } else { + $$->Base.TexSrcTarget = $12; + } + + target_mask = (1U << $$->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[$10] != 0) + && ((state->prog->TexturesUsed[$10] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& @12, state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[$10] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + } ; texImageUnit: TEXTURE_UNIT optTexImageUnitNum @@ -472,21 +531,58 @@ SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle $4.Base.Swizzle = $6.swizzle; $4.Base.Negate = $6.mask; - $$ = asm_instruction_ctor(OPCODE_SWZ, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; -scalarSrcReg: optionalSign srcReg scalarSuffix +scalarSrcReg: optionalSign scalarUse { $$ = $2; if ($1) { $$.Base.Negate = ~$$.Base.Negate; } + } + | optionalSign '|' scalarUse '|' + { + $$ = $3; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "unexpected character '|'"); + YYERROR; + } + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Abs = 1; + } + ; + +scalarUse: srcReg scalarSuffix + { + $$ = $1; $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, - $3.swizzle); + $2.swizzle); + } + | paramConstScalarUse + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& @1, state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & $1); + + init_src_reg(& $$); + $$.Base.File = PROGRAM_CONSTANT; + $$.Base.Index = temp_sym.param_binding_begin; } ; @@ -501,12 +597,33 @@ swizzleSrcReg: optionalSign srcReg swizzleSuffix $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, $3.swizzle); } + | optionalSign '|' srcReg swizzleSuffix '|' + { + $$ = $3; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "unexpected character '|'"); + YYERROR; + } + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Abs = 1; + $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, + $4.swizzle); + } + ; -maskedDstReg: dstReg optionalMask +maskedDstReg: dstReg optionalMask optionalCcMask { $$ = $1; $$.WriteMask = $2.mask; + $$.CondMask = $3.CondMask; + $$.CondSwizzle = $3.CondSwizzle; + $$.CondSrc = $3.CondSrc; if ($$.File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -589,7 +706,7 @@ extSwizSel: INTEGER $$.xyzw_valid = 1; $$.rgba_valid = 1; } - | IDENTIFIER + | string { if (strlen($1) > 1) { yyerror(& @1, state, "invalid extended swizzle selector"); @@ -639,7 +756,7 @@ extSwizSel: INTEGER } ; -srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ +srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -729,7 +846,7 @@ dstReg: resultBinding $$.File = PROGRAM_OUTPUT; $$.Index = $1; } - | IDENTIFIER /* temporaryReg | vertexResultReg */ + | USED_IDENTIFIER /* temporaryReg | vertexResultReg */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -760,7 +877,7 @@ dstReg: resultBinding } ; -progParamArray: IDENTIFIER +progParamArray: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -806,8 +923,10 @@ addrRegRelOffset: { $$ = 0; } addrRegPosOffset: INTEGER { if (($1 < 0) || ($1 > 63)) { - yyerror(& @1, state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", $1); + yyerror(& @1, state, s); YYERROR; } else { $$ = $1; @@ -818,8 +937,10 @@ addrRegPosOffset: INTEGER addrRegNegOffset: INTEGER { if (($1 < 0) || ($1 > 64)) { - yyerror(& @1, state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", $1); + yyerror(& @1, state, s); YYERROR; } else { $$ = $1; @@ -827,7 +948,7 @@ addrRegNegOffset: INTEGER } ; -addrReg: IDENTIFIER +addrReg: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -880,6 +1001,82 @@ optionalMask: MASK4 | MASK3 | MASK2 | MASK1 | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } ; +optionalCcMask: '(' ccTest ')' + { + $$ = $2; + } + | '(' ccTest2 ')' + { + $$ = $2; + } + | + { + $$.CondMask = COND_TR; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + +ccTest: ccMaskRule swizzleSuffix + { + $$ = $1; + $$.CondSwizzle = $2.swizzle; + } + ; + +ccTest2: ccMaskRule2 swizzleSuffix + { + $$ = $1; + $$.CondSwizzle = $2.swizzle; + } + ; + +ccMaskRule: IDENTIFIER + { + const int cond = _mesa_parse_cc($1); + if ((cond == 0) || ($1[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + +ccMaskRule2: USED_IDENTIFIER + { + const int cond = _mesa_parse_cc($1); + if ((cond == 0) || ($1[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + namingStatement: ATTRIB_statement | PARAM_statement | TEMP_statement @@ -1708,7 +1905,46 @@ optionalSign: '+' { $$ = FALSE; } | { $$ = FALSE; } ; -TEMP_statement: TEMP { $<integer>$ = $1; } varNameList +TEMP_statement: optVarSize TEMP { $<integer>$ = $2; } varNameList + ; + +optVarSize: string + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& @1, state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", $1) == 0) { + } else if (strcmp("LONG", $1) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + } + | + { + } ; ADDRESS_statement: ADDRESS { $<integer>$ = $1; } varNameList @@ -1728,15 +1964,15 @@ varNameList: varNameList ',' IDENTIFIER } ; -OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding +OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding { struct asm_symbol *const s = - declare_variable(state, $2, at_output, & @2); + declare_variable(state, $3, at_output, & @3); if (s == NULL) { YYERROR; } else { - s->output_binding = $4; + s->output_binding = $5; } } ; @@ -1903,7 +2139,7 @@ legacyTexUnitNum: INTEGER } ; -ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER +ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $2); @@ -1924,8 +2160,54 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER } ; +string: IDENTIFIER + | USED_IDENTIFIER + ; + %% +void +asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } + + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); + } + + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); + } +} + + struct asm_instruction * asm_instruction_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, @@ -1933,37 +2215,37 @@ asm_instruction_ctor(gl_inst_opcode op, const struct asm_src_register *src1, const struct asm_src_register *src2) { - struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - /* In the core ARB extensions only the KIL instruction doesn't have a - * destination register. - */ - if (dst == NULL) { - init_dst_reg(& inst->Base.DstReg); - } else { - inst->Base.DstReg = *dst; - } + asm_instruction_set_operands(inst, dst, src0, src1, src2); + } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + return inst; +} - if (src1 != NULL) { - inst->Base.SrcReg[1] = src1->Base; - inst->SrcReg[1] = *src1; - } else { - init_src_reg(& inst->SrcReg[1]); - } - if (src2 != NULL) { - inst->Base.SrcReg[2] = src2->Base; - inst->SrcReg[2] = *src2; - } else { - init_src_reg(& inst->SrcReg[2]); - } +struct asm_instruction * +asm_instruction_copy_ctor(const struct prog_instruction *base, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); + + if (inst) { + _mesa_init_instructions(& inst->Base, 1); + inst->Base.Opcode = base->Opcode; + inst->Base.CondUpdate = base->CondUpdate; + inst->Base.CondDst = base->CondDst; + inst->Base.SaturateMode = base->SaturateMode; + inst->Base.Precision = base->Precision; + + asm_instruction_set_operands(inst, dst, src0, src1, src2); } return inst; diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index 8e4be606f1..0656c5eaa8 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -34,6 +34,121 @@ */ int +_mesa_parse_instruction_suffix(const struct asm_parser_state *state, + const char *suffix, + struct prog_instruction *inst) +{ + inst->CondUpdate = 0; + inst->CondDst = 0; + inst->SaturateMode = SATURATE_OFF; + inst->Precision = FLOAT32; + + + /* The first possible suffix element is the precision specifier from + * NV_fragment_program_option. + */ + if (state->option.NV_fragment) { + switch (suffix[0]) { + case 'H': + inst->Precision = FLOAT16; + suffix++; + break; + case 'R': + inst->Precision = FLOAT32; + suffix++; + break; + case 'X': + inst->Precision = FIXED12; + suffix++; + break; + default: + break; + } + } + + /* The next possible suffix element is the condition code modifier selection + * from NV_fragment_program_option. + */ + if (state->option.NV_fragment) { + if (suffix[0] == 'C') { + inst->CondUpdate = 1; + suffix++; + } + } + + + /* The final possible suffix element is the saturation selector from + * ARB_fragment_program. + */ + if (state->mode == ARB_fragment) { + if (strcmp(suffix, "_SAT") == 0) { + inst->SaturateMode = SATURATE_ZERO_ONE; + suffix += 4; + } + } + + + /* It is an error for all of the suffix string not to be consumed. + */ + return suffix[0] == '\0'; +} + + +int +_mesa_parse_cc(const char *s) +{ + int cond = 0; + + switch (s[0]) { + case 'E': + if (s[1] == 'Q') { + cond = COND_EQ; + } + break; + + case 'F': + if (s[1] == 'L') { + cond = COND_FL; + } + break; + + case 'G': + if (s[1] == 'E') { + cond = COND_GE; + } else if (s[1] == 'T') { + cond = COND_GT; + } + break; + + case 'L': + if (s[1] == 'E') { + cond = COND_LE; + } else if (s[1] == 'T') { + cond = COND_LT; + } + break; + + case 'N': + if (s[1] == 'E') { + cond = COND_NE; + } + break; + + case 'T': + if (s[1] == 'R') { + cond = COND_TR; + } + break; + + default: + break; + } + + return ((cond == 0) || (s[2] != '\0')) ? 0 : cond; +} + + +int _mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) { if (strcmp(option, "ARB_position_invariant") == 0) { @@ -102,6 +217,17 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) return 1; } } + } else if (strncmp(option, "NV_fragment_program", 19) == 0) { + option += 19; + + /* Other NV_fragment_program strings may be supported later. + */ + if (option[0] == '\0') { + if (state->ctx->Extensions.NV_fragment_program_option) { + state->option.NV_fragment = 1; + return 1; + } + } } else if (strncmp(option, "MESA_", 5) == 0) { option += 5; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index fa47d84565..bce6041381 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -202,6 +202,7 @@ struct asm_parser_state { unsigned Shadow:1; unsigned TexRect:1; unsigned TexArray:1; + unsigned NV_fragment:1; } option; struct { @@ -263,4 +264,31 @@ extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state, extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option); +/** + * Parses and processes instruction suffixes + * + * Instruction suffixes, such as \c _SAT, are processed. The relevant bits + * are set in \c inst. If suffixes are encountered that are either not known + * or not supported by the modes and options set in \c state, zero will be + * returned. + * + * \return + * Non-zero on success, zero on failure. + */ +extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state, + const char *suffix, struct prog_instruction *inst); + +/** + * Parses a condition code name + * + * The condition code names (e.g., \c LT, \c GT, \c NE) were added to assembly + * shaders with the \c GL_NV_fragment_program_option extension. This function + * converts a string representation into one of the \c COND_ macros. + * + * \return + * One of the \c COND_ macros defined in prog_instruction.h on success or zero + * on failure. + */ +extern int _mesa_parse_cc(const char *s); + /*@}*/ diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f70c75cec8..3b8529592d 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -573,3 +573,94 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) } } } + + +/** + * Make the given fragment program into a "no-op" shader. + * Actually, just copy the incoming fragment color (or texcoord) + * to the output color. + * This is for debug/test purposes. + */ +void +_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog) +{ + struct prog_instruction *inst; + GLuint inputAttr; + + inst = _mesa_alloc_instructions(2); + if (!inst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_fragment_program"); + return; + } + + _mesa_init_instructions(inst, 2); + + inst[0].Opcode = OPCODE_MOV; + inst[0].DstReg.File = PROGRAM_OUTPUT; + inst[0].DstReg.Index = FRAG_RESULT_COLOR; + inst[0].SrcReg[0].File = PROGRAM_INPUT; + if (prog->Base.InputsRead & FRAG_BIT_COL0) + inputAttr = FRAG_ATTRIB_COL0; + else + inputAttr = FRAG_ATTRIB_TEX0; + inst[0].SrcReg[0].Index = inputAttr; + + inst[1].Opcode = OPCODE_END; + + _mesa_free_instructions(prog->Base.Instructions, + prog->Base.NumInstructions); + + prog->Base.Instructions = inst; + prog->Base.NumInstructions = 2; + prog->Base.InputsRead = 1 << inputAttr; + prog->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR; +} + + +/** + * \sa _mesa_nop_fragment_program + * Replace the given vertex program with a "no-op" program that just + * transforms vertex position and emits color. + */ +void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog) +{ + struct prog_instruction *inst; + GLuint inputAttr; + + /* + * Start with a simple vertex program that emits color. + */ + inst = _mesa_alloc_instructions(2); + if (!inst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_vertex_program"); + return; + } + + _mesa_init_instructions(inst, 2); + + inst[0].Opcode = OPCODE_MOV; + inst[0].DstReg.File = PROGRAM_OUTPUT; + inst[0].DstReg.Index = VERT_RESULT_COL0; + inst[0].SrcReg[0].File = PROGRAM_INPUT; + if (prog->Base.InputsRead & VERT_BIT_COLOR0) + inputAttr = VERT_ATTRIB_COLOR0; + else + inputAttr = VERT_ATTRIB_TEX0; + inst[0].SrcReg[0].Index = inputAttr; + + inst[1].Opcode = OPCODE_END; + + _mesa_free_instructions(prog->Base.Instructions, + prog->Base.NumInstructions); + + prog->Base.Instructions = inst; + prog->Base.NumInstructions = 2; + prog->Base.InputsRead = 1 << inputAttr; + prog->Base.OutputsWritten = 1 << VERT_RESULT_COL0; + + /* + * Now insert code to do standard modelview/projection transformation. + */ + _mesa_insert_mvp_code(ctx, prog); +} diff --git a/src/mesa/shader/programopt.h b/src/mesa/shader/programopt.h index 96acaf9566..21fac07849 100644 --- a/src/mesa/shader/programopt.h +++ b/src/mesa/shader/programopt.h @@ -42,4 +42,11 @@ _mesa_count_texture_instructions(struct gl_program *prog); extern void _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type); +extern void +_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog); + +extern void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog); + + #endif /* PROGRAMOPT_H */ diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index b282d7af60..f473bd1173 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -380,12 +380,18 @@ get_shader_flags(void) flags |= GLSL_DUMP; if (_mesa_strstr(env, "log")) flags |= GLSL_LOG; + if (_mesa_strstr(env, "nopvert")) + flags |= GLSL_NOP_VERT; + if (_mesa_strstr(env, "nopfrag")) + flags |= GLSL_NOP_FRAG; if (_mesa_strstr(env, "nopt")) flags |= GLSL_NO_OPT; else if (_mesa_strstr(env, "opt")) flags |= GLSL_OPT; if (_mesa_strstr(env, "uniform")) flags |= GLSL_UNIFORMS; + if (_mesa_strstr(env, "useprog")) + flags |= GLSL_USE_PROG; } return flags; @@ -1520,19 +1526,32 @@ _mesa_use_program(GLcontext *ctx, GLuint program) } /* debug code */ - if (0) { + if (ctx->Shader.Flags & GLSL_USE_PROG) { GLuint i; - _mesa_printf("Use Shader %u\n", shProg->Name); + _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x, checksum %u\n", + const char *s; + switch (shProg->Shaders[i]->Type) { + case GL_VERTEX_SHADER: + s = "vertex"; + break; + case GL_FRAGMENT_SHADER: + s = "fragment"; + break; + case GL_GEOMETRY_SHADER: + s = "geometry"; + break; + default: + s = ""; + } + _mesa_printf(" %s shader %u, checksum %u\n", s, shProg->Shaders[i]->Name, - shProg->Shaders[i]->Type, shProg->Shaders[i]->SourceChecksum); } if (shProg->VertexProgram) - printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); if (shProg->FragmentProgram) - printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); } } else { diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index c1b97c7cb7..a270888443 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2814,6 +2814,16 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) (ctx->Shader.Flags & GLSL_NO_OPT) == 0) { _mesa_optimize_program(ctx, shader->Program); } + if ((ctx->Shader.Flags & GLSL_NOP_VERT) && + shader->Program->Target == GL_VERTEX_PROGRAM_ARB) { + _mesa_nop_vertex_program(ctx, + (struct gl_vertex_program *) shader->Program); + } + if ((ctx->Shader.Flags & GLSL_NOP_FRAG) && + shader->Program->Target == GL_FRAGMENT_PROGRAM_ARB) { + _mesa_nop_fragment_program(ctx, + (struct gl_fragment_program *) shader->Program); + } } if (ctx->Shader.Flags & GLSL_LOG) { diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index fa2a6307a4..7107538cee 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -115,7 +115,6 @@ SWRAST_SOURCES = \ swrast/s_feedback.c \ swrast/s_fog.c \ swrast/s_fragprog.c \ - swrast/s_imaging.c \ swrast/s_lines.c \ swrast/s_logic.c \ swrast/s_masking.c \ @@ -125,7 +124,6 @@ SWRAST_SOURCES = \ swrast/s_stencil.c \ swrast/s_texcombine.c \ swrast/s_texfilter.c \ - swrast/s_texstore.c \ swrast/s_triangle.c \ swrast/s_zoom.c diff --git a/src/mesa/sparc/clip.S b/src/mesa/sparc/clip.S index 208843c606..dc239171ff 100644 --- a/src/mesa/sparc/clip.S +++ b/src/mesa/sparc/clip.S @@ -58,7 +58,8 @@ clip_table: .byte 31, 29, 31, 30, 27, 25, 27, 26 /* GLvector4f *clip_vec, GLvector4f *proj_vec, - GLubyte clipMask[], GLubyte *orMask, GLubyte *andMask */ + GLubyte clipMask[], GLubyte *orMask, GLubyte *andMask, + GLboolean viewport_z_enable */ .align 64 __pc_tramp: diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 5b2c9e4a9a..aaa17e6a3b 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -771,23 +771,26 @@ gl_dispatch_functions_start: GL_STUB(glGetSynciv, _gloffset_GetSynciv) GL_STUB(glIsSync, _gloffset_IsSync) GL_STUB(glWaitSync, _gloffset_WaitSync) + GL_STUB(glDrawElementsBaseVertex, _gloffset_DrawElementsBaseVertex) + GL_STUB(glDrawRangeElementsBaseVertex, _gloffset_DrawRangeElementsBaseVertex) + GL_STUB(glMultiDrawElementsBaseVertex, _gloffset_MultiDrawElementsBaseVertex) GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT) - GL_STUB(gl_dispatch_stub_575, _gloffset_GetPixelTexGenParameterfvSGIS) - HIDDEN(gl_dispatch_stub_575) - GL_STUB(gl_dispatch_stub_576, _gloffset_GetPixelTexGenParameterivSGIS) - HIDDEN(gl_dispatch_stub_576) - GL_STUB(gl_dispatch_stub_577, _gloffset_PixelTexGenParameterfSGIS) - HIDDEN(gl_dispatch_stub_577) - GL_STUB(gl_dispatch_stub_578, _gloffset_PixelTexGenParameterfvSGIS) + GL_STUB(gl_dispatch_stub_578, _gloffset_GetPixelTexGenParameterfvSGIS) HIDDEN(gl_dispatch_stub_578) - GL_STUB(gl_dispatch_stub_579, _gloffset_PixelTexGenParameteriSGIS) + GL_STUB(gl_dispatch_stub_579, _gloffset_GetPixelTexGenParameterivSGIS) HIDDEN(gl_dispatch_stub_579) - GL_STUB(gl_dispatch_stub_580, _gloffset_PixelTexGenParameterivSGIS) + GL_STUB(gl_dispatch_stub_580, _gloffset_PixelTexGenParameterfSGIS) HIDDEN(gl_dispatch_stub_580) - GL_STUB(gl_dispatch_stub_581, _gloffset_SampleMaskSGIS) + GL_STUB(gl_dispatch_stub_581, _gloffset_PixelTexGenParameterfvSGIS) HIDDEN(gl_dispatch_stub_581) - GL_STUB(gl_dispatch_stub_582, _gloffset_SamplePatternSGIS) + GL_STUB(gl_dispatch_stub_582, _gloffset_PixelTexGenParameteriSGIS) HIDDEN(gl_dispatch_stub_582) + GL_STUB(gl_dispatch_stub_583, _gloffset_PixelTexGenParameterivSGIS) + HIDDEN(gl_dispatch_stub_583) + GL_STUB(gl_dispatch_stub_584, _gloffset_SampleMaskSGIS) + HIDDEN(gl_dispatch_stub_584) + GL_STUB(gl_dispatch_stub_585, _gloffset_SamplePatternSGIS) + HIDDEN(gl_dispatch_stub_585) GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT) GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT) GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT) @@ -798,10 +801,10 @@ gl_dispatch_functions_start: GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT) GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT) GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT) - GL_STUB(gl_dispatch_stub_593, _gloffset_CullParameterdvEXT) - HIDDEN(gl_dispatch_stub_593) - GL_STUB(gl_dispatch_stub_594, _gloffset_CullParameterfvEXT) - HIDDEN(gl_dispatch_stub_594) + GL_STUB(gl_dispatch_stub_596, _gloffset_CullParameterdvEXT) + HIDDEN(gl_dispatch_stub_596) + GL_STUB(gl_dispatch_stub_597, _gloffset_CullParameterfvEXT) + HIDDEN(gl_dispatch_stub_597) GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT) GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT) GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT) @@ -826,8 +829,8 @@ gl_dispatch_functions_start: GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT) GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT) GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT) - GL_STUB(gl_dispatch_stub_619, _gloffset_PixelTexGenSGIX) - HIDDEN(gl_dispatch_stub_619) + GL_STUB(gl_dispatch_stub_622, _gloffset_PixelTexGenSGIX) + HIDDEN(gl_dispatch_stub_622) GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT) GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV) GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV) @@ -869,24 +872,24 @@ gl_dispatch_functions_start: GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA) GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA) GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA) - GL_STUB(gl_dispatch_stub_661, _gloffset_MultiModeDrawArraysIBM) - HIDDEN(gl_dispatch_stub_661) - GL_STUB(gl_dispatch_stub_662, _gloffset_MultiModeDrawElementsIBM) - HIDDEN(gl_dispatch_stub_662) - GL_STUB(gl_dispatch_stub_663, _gloffset_DeleteFencesNV) - HIDDEN(gl_dispatch_stub_663) - GL_STUB(gl_dispatch_stub_664, _gloffset_FinishFenceNV) + GL_STUB(gl_dispatch_stub_664, _gloffset_MultiModeDrawArraysIBM) HIDDEN(gl_dispatch_stub_664) - GL_STUB(gl_dispatch_stub_665, _gloffset_GenFencesNV) + GL_STUB(gl_dispatch_stub_665, _gloffset_MultiModeDrawElementsIBM) HIDDEN(gl_dispatch_stub_665) - GL_STUB(gl_dispatch_stub_666, _gloffset_GetFenceivNV) + GL_STUB(gl_dispatch_stub_666, _gloffset_DeleteFencesNV) HIDDEN(gl_dispatch_stub_666) - GL_STUB(gl_dispatch_stub_667, _gloffset_IsFenceNV) + GL_STUB(gl_dispatch_stub_667, _gloffset_FinishFenceNV) HIDDEN(gl_dispatch_stub_667) - GL_STUB(gl_dispatch_stub_668, _gloffset_SetFenceNV) + GL_STUB(gl_dispatch_stub_668, _gloffset_GenFencesNV) HIDDEN(gl_dispatch_stub_668) - GL_STUB(gl_dispatch_stub_669, _gloffset_TestFenceNV) + GL_STUB(gl_dispatch_stub_669, _gloffset_GetFenceivNV) HIDDEN(gl_dispatch_stub_669) + GL_STUB(gl_dispatch_stub_670, _gloffset_IsFenceNV) + HIDDEN(gl_dispatch_stub_670) + GL_STUB(gl_dispatch_stub_671, _gloffset_SetFenceNV) + HIDDEN(gl_dispatch_stub_671) + GL_STUB(gl_dispatch_stub_672, _gloffset_TestFenceNV) + HIDDEN(gl_dispatch_stub_672) GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV) GL_STUB(glBindProgramNV, _gloffset_BindProgramNV) GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV) @@ -967,26 +970,26 @@ gl_dispatch_functions_start: GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI) GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV) GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV) - GL_STUB(gl_dispatch_stub_750, _gloffset_ActiveStencilFaceEXT) - HIDDEN(gl_dispatch_stub_750) - GL_STUB(gl_dispatch_stub_751, _gloffset_BindVertexArrayAPPLE) - HIDDEN(gl_dispatch_stub_751) - GL_STUB(gl_dispatch_stub_752, _gloffset_DeleteVertexArraysAPPLE) - HIDDEN(gl_dispatch_stub_752) - GL_STUB(gl_dispatch_stub_753, _gloffset_GenVertexArraysAPPLE) + GL_STUB(gl_dispatch_stub_753, _gloffset_ActiveStencilFaceEXT) HIDDEN(gl_dispatch_stub_753) - GL_STUB(gl_dispatch_stub_754, _gloffset_IsVertexArrayAPPLE) + GL_STUB(gl_dispatch_stub_754, _gloffset_BindVertexArrayAPPLE) HIDDEN(gl_dispatch_stub_754) + GL_STUB(gl_dispatch_stub_755, _gloffset_DeleteVertexArraysAPPLE) + HIDDEN(gl_dispatch_stub_755) + GL_STUB(gl_dispatch_stub_756, _gloffset_GenVertexArraysAPPLE) + HIDDEN(gl_dispatch_stub_756) + GL_STUB(gl_dispatch_stub_757, _gloffset_IsVertexArrayAPPLE) + HIDDEN(gl_dispatch_stub_757) GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV) GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV) GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV) GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV) GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV) GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV) - GL_STUB(gl_dispatch_stub_761, _gloffset_DepthBoundsEXT) - HIDDEN(gl_dispatch_stub_761) - GL_STUB(gl_dispatch_stub_762, _gloffset_BlendEquationSeparateEXT) - HIDDEN(gl_dispatch_stub_762) + GL_STUB(gl_dispatch_stub_764, _gloffset_DepthBoundsEXT) + HIDDEN(gl_dispatch_stub_764) + GL_STUB(gl_dispatch_stub_765, _gloffset_BlendEquationSeparateEXT) + HIDDEN(gl_dispatch_stub_765) GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT) GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT) GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT) @@ -1004,28 +1007,28 @@ gl_dispatch_functions_start: GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT) GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT) GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT) - GL_STUB(gl_dispatch_stub_780, _gloffset_BlitFramebufferEXT) - HIDDEN(gl_dispatch_stub_780) - GL_STUB(gl_dispatch_stub_781, _gloffset_BufferParameteriAPPLE) - HIDDEN(gl_dispatch_stub_781) - GL_STUB(gl_dispatch_stub_782, _gloffset_FlushMappedBufferRangeAPPLE) - HIDDEN(gl_dispatch_stub_782) + GL_STUB(gl_dispatch_stub_783, _gloffset_BlitFramebufferEXT) + HIDDEN(gl_dispatch_stub_783) + GL_STUB(gl_dispatch_stub_784, _gloffset_BufferParameteriAPPLE) + HIDDEN(gl_dispatch_stub_784) + GL_STUB(gl_dispatch_stub_785, _gloffset_FlushMappedBufferRangeAPPLE) + HIDDEN(gl_dispatch_stub_785) GL_STUB(glFramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT) GL_STUB(glProvokingVertexEXT, _gloffset_ProvokingVertexEXT) - GL_STUB(gl_dispatch_stub_785, _gloffset_GetTexParameterPointervAPPLE) - HIDDEN(gl_dispatch_stub_785) - GL_STUB(gl_dispatch_stub_786, _gloffset_TextureRangeAPPLE) - HIDDEN(gl_dispatch_stub_786) - GL_STUB(gl_dispatch_stub_787, _gloffset_StencilFuncSeparateATI) - HIDDEN(gl_dispatch_stub_787) - GL_STUB(gl_dispatch_stub_788, _gloffset_ProgramEnvParameters4fvEXT) + GL_STUB(gl_dispatch_stub_788, _gloffset_GetTexParameterPointervAPPLE) HIDDEN(gl_dispatch_stub_788) - GL_STUB(gl_dispatch_stub_789, _gloffset_ProgramLocalParameters4fvEXT) + GL_STUB(gl_dispatch_stub_789, _gloffset_TextureRangeAPPLE) HIDDEN(gl_dispatch_stub_789) - GL_STUB(gl_dispatch_stub_790, _gloffset_GetQueryObjecti64vEXT) + GL_STUB(gl_dispatch_stub_790, _gloffset_StencilFuncSeparateATI) HIDDEN(gl_dispatch_stub_790) - GL_STUB(gl_dispatch_stub_791, _gloffset_GetQueryObjectui64vEXT) + GL_STUB(gl_dispatch_stub_791, _gloffset_ProgramEnvParameters4fvEXT) HIDDEN(gl_dispatch_stub_791) + GL_STUB(gl_dispatch_stub_792, _gloffset_ProgramLocalParameters4fvEXT) + HIDDEN(gl_dispatch_stub_792) + GL_STUB(gl_dispatch_stub_793, _gloffset_GetQueryObjecti64vEXT) + HIDDEN(gl_dispatch_stub_793) + GL_STUB(gl_dispatch_stub_794, _gloffset_GetQueryObjectui64vEXT) + HIDDEN(gl_dispatch_stub_794) GL_STUB_ALIAS(glArrayElementEXT, glArrayElement) GL_STUB_ALIAS(glBindTextureEXT, glBindTexture) GL_STUB_ALIAS(glDrawArraysEXT, glDrawArrays) @@ -1359,6 +1362,7 @@ gl_dispatch_functions_start: GL_STUB_ALIAS(glIsRenderbuffer, glIsRenderbufferEXT) GL_STUB_ALIAS(glRenderbufferStorage, glRenderbufferStorageEXT) GL_STUB_ALIAS(glFramebufferTextureLayer, glFramebufferTextureLayerEXT) + GL_STUB_ALIAS(glProvokingVertex, glProvokingVertexEXT) .globl gl_dispatch_functions_end HIDDEN(gl_dispatch_functions_end) diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index d2286a2c83..cea0c7cecf 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -78,13 +78,15 @@ extern GLvector4f *_mesa_sparc_cliptest_points4(GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask); + GLubyte *andMask, + GLboolean viewport_z_clip); extern GLvector4f *_mesa_sparc_cliptest_points4_np(GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask); + GLubyte *andMask, + GLboolean viewport_z_clip); #define NORM_ARGS const GLmatrix *mat, \ GLfloat scale, \ diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 5d4d8eee02..77153889b6 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -39,6 +39,7 @@ #include "pipe/p_defines.h" #include "pipe/p_inlines.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_atom_constbuf.h" @@ -75,7 +76,7 @@ void st_upload_constants( struct st_context *st, PIPE_BUFFER_USAGE_CONSTANT, paramBytes ); - if (0) { + if (ST_DEBUG & DEBUG_CONSTANTS) { debug_printf("%s(shader=%d, numParams=%d, stateFlags=0x%x)\n", __FUNCTION__, shader_type, params->NumParameters, params->StateFlags); diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index 0aa128f947..88b80a07fc 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -104,10 +104,6 @@ update_depth_stencil_alpha(struct st_context *st) dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func); } - if (ctx->Query.CurrentOcclusionObject && - ctx->Query.CurrentOcclusionObject->Active) - dsa->depth.occlusion_count = 1; - if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) { dsa->stencil[0].enabled = 1; dsa->stencil[0].func = st_compare_func_to_pipe(ctx->Stencil.Function[0]); diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 5209a6a0c9..e18c0f6e0a 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -39,6 +39,7 @@ #include "pipe/p_context.h" #include "pipe/p_inlines.h" #include "cso_cache/cso_context.h" +#include "util/u_rect.h" @@ -162,10 +163,17 @@ update_framebuffer_state( struct st_context *st ) (void) st_get_framebuffer_surface(stfb, ST_SURFACE_FRONT_LEFT, &surf_front); (void) st_get_framebuffer_surface(stfb, ST_SURFACE_BACK_LEFT, &surf_back); - st->pipe->surface_copy(st->pipe, - surf_front, 0, 0, /* dest */ - surf_back, 0, 0, /* src */ - fb->Width, fb->Height); + if (st->pipe->surface_copy) { + st->pipe->surface_copy(st->pipe, + surf_front, 0, 0, /* dest */ + surf_back, 0, 0, /* src */ + fb->Width, fb->Height); + } else { + util_surface_copy(st->pipe, FALSE, + surf_front, 0, 0, + surf_back, 0, 0, + fb->Width, fb->Height); + } } /* we're assuming we'll really draw to the front buffer */ st->frontbuffer_status = FRONT_STATUS_DIRTY; diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index eff3666ca8..babfcc87b4 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -122,7 +122,8 @@ create_color_map_texture(GLcontext *ctx) const uint texSize = 256; /* simple, and usually perfect */ /* find an RGBA texture format */ - format = st_choose_format(pipe, GL_RGBA, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); + format = st_choose_format(pipe->screen, GL_RGBA, + PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); /* create texture for color map/table */ pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 95181578f6..a6b9765452 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -34,6 +34,7 @@ #include "main/image.h" #include "main/macros.h" +#include "st_debug.h" #include "st_context.h" #include "st_cb_accum.h" #include "st_cb_fbo.h" @@ -136,6 +137,9 @@ accum_accum(struct st_context *st, GLfloat value, GLubyte *data = acc_strb->data; GLfloat *buf; + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + color_trans = st_cond_flush_get_tex_transfer(st, color_strb->texture, 0, 0, 0, PIPE_TRANSFER_READ, xpos, ypos, @@ -181,6 +185,10 @@ accum_load(struct st_context *st, GLfloat value, GLubyte *data = acc_strb->data; GLfloat *buf; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + color_trans = st_cond_flush_get_tex_transfer(st, color_strb->texture, 0, 0, 0, PIPE_TRANSFER_READ, xpos, ypos, @@ -228,6 +236,9 @@ accum_return(GLcontext *ctx, GLfloat value, const GLubyte *data = acc_strb->data; GLfloat *buf; + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) @@ -241,7 +252,7 @@ accum_return(GLcontext *ctx, GLfloat value, xpos, ypos, width, height); - if (usage != PIPE_TRANSFER_WRITE) + if (usage & PIPE_TRANSFER_READ) pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); switch (acc_strb->format) { diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 902fb38d1a..a22fa68299 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -330,7 +330,18 @@ setup_bitmap_vertex_data(struct st_context *st, const GLfloat clip_y0 = (GLfloat)(y0 / fb_height * 2.0 - 1.0); const GLfloat clip_x1 = (GLfloat)(x1 / fb_width * 2.0 - 1.0); const GLfloat clip_y1 = (GLfloat)(y1 / fb_height * 2.0 - 1.0); - const GLuint max_slots = 4096 / sizeof(st->bitmap.vertices); + + /* XXX: Need to improve buffer_write to allow NO_WAIT (as well as + * no_flush) updates to buffers where we know there is no conflict + * with previous data. Currently using max_slots > 1 will cause + * synchronous rendering if the driver flushes its command buffers + * between one bitmap and the next. Our flush hook below isn't + * sufficient to catch this as the driver doesn't tell us when it + * flushes its own command buffers. Until this gets fixed, pay the + * price of allocating a new buffer for each bitmap cache-flush to + * avoid synchronous rendering. + */ + const GLuint max_slots = 1; /* 4096 / sizeof(st->bitmap.vertices); */ GLuint i; if (st->bitmap.vbuf_slot >= max_slots) { diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index c741940bcf..5626e25323 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -39,6 +39,7 @@ #include "shader/prog_print.h" #include "st_context.h" +#include "st_texture.h" #include "st_program.h" #include "st_cb_blit.h" #include "st_cb_fbo.h" @@ -110,17 +111,50 @@ st_BlitFramebuffer(GLcontext *ctx, } if (mask & GL_COLOR_BUFFER_BIT) { - struct st_renderbuffer *srcRb = - st_renderbuffer(readFB->_ColorReadBuffer); - struct st_renderbuffer *dstRb = - st_renderbuffer(drawFB->_ColorDrawBuffers[0]); - struct pipe_surface *srcSurf = srcRb->surface; - struct pipe_surface *dstSurf = dstRb->surface; - - util_blit_pixels(st->blit, - srcSurf, srcX0, srcY0, srcX1, srcY1, - dstSurf, dstX0, dstY0, dstX1, dstY1, - 0.0, pFilter); + struct gl_renderbuffer_attachment *srcAtt = + &readFB->Attachment[readFB->_ColorReadBufferIndex]; + + if(srcAtt->Type == GL_TEXTURE) { + struct pipe_screen *screen = ctx->st->pipe->screen; + const struct st_texture_object *srcObj = + st_texture_object(srcAtt->Texture); + struct st_renderbuffer *dstRb = + st_renderbuffer(drawFB->_ColorDrawBuffers[0]); + struct pipe_surface *srcSurf; + struct pipe_surface *dstSurf = dstRb->surface; + + if (!srcObj->pt) + return; + + srcSurf = screen->get_tex_surface(screen, + srcObj->pt, + srcAtt->CubeMapFace, + srcAtt->TextureLevel, + srcAtt->Zoffset, + PIPE_BUFFER_USAGE_GPU_READ); + if(!srcSurf) + return; + + util_blit_pixels(st->blit, + srcSurf, srcX0, srcY0, srcX1, srcY1, + dstSurf, dstX0, dstY0, dstX1, dstY1, + 0.0, pFilter); + + pipe_surface_reference(&srcSurf, NULL); + } + else { + struct st_renderbuffer *srcRb = + st_renderbuffer(readFB->_ColorReadBuffer); + struct st_renderbuffer *dstRb = + st_renderbuffer(drawFB->_ColorDrawBuffers[0]); + struct pipe_surface *srcSurf = srcRb->surface; + struct pipe_surface *dstSurf = dstRb->surface; + + util_blit_pixels(st->blit, + srcSurf, srcX0, srcY0, srcX1, srcY1, + dstSurf, dstX0, dstY0, dstX1, dstY1, + 0.0, pFilter); + } } if (mask & depthStencil) { diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 8a8c99f7e1..36510720a4 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -116,7 +116,18 @@ draw_quad(GLcontext *ctx, { struct st_context *st = ctx->st; struct pipe_context *pipe = st->pipe; - const GLuint max_slots = 1024 / sizeof(st->clear.vertices); + + /* XXX: Need to improve buffer_write to allow NO_WAIT (as well as + * no_flush) updates to buffers where we know there is no conflict + * with previous data. Currently using max_slots > 1 will cause + * synchronous rendering if the driver flushes its command buffers + * between one bitmap and the next. Our flush hook below isn't + * sufficient to catch this as the driver doesn't tell us when it + * flushes its own command buffers. Until this gets fixed, pay the + * price of allocating a new buffer for each bitmap cache-flush to + * avoid synchronous rendering. + */ + const GLuint max_slots = 1; /* 1024 / sizeof(st->clear.vertices); */ GLuint i; if (st->clear.vbuf_slot >= max_slots) { diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index c655690603..be44577117 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -40,6 +40,7 @@ #include "shader/prog_parameter.h" #include "shader/prog_print.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_atom_constbuf.h" @@ -61,6 +62,7 @@ #include "util/u_tile.h" #include "util/u_draw_quad.h" #include "util/u_math.h" +#include "util/u_rect.h" #include "shader/prog_instruction.h" #include "cso_cache/cso_context.h" @@ -98,7 +100,7 @@ is_passthrough_program(const struct gl_fragment_program *prog) static struct st_fragment_program * combined_drawpix_fragment_program(GLcontext *ctx) { - struct st_context *st = ctx->st; + struct st_context *st = st_context(ctx); struct st_fragment_program *stfp; if (st->pixel_xfer.program->serialNo == st->pixel_xfer.xfer_prog_sn @@ -445,8 +447,8 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z, GLfloat x1, GLfloat y1, const GLfloat *color, GLboolean invertTex, GLfloat maxXcoord, GLfloat maxYcoord) { - struct st_context *st = ctx->st; - struct pipe_context *pipe = ctx->st->pipe; + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */ /* setup vertex data */ @@ -540,9 +542,9 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, const GLfloat *color, GLboolean invertTex) { - struct st_context *st = ctx->st; - struct pipe_context *pipe = ctx->st->pipe; - struct cso_context *cso = ctx->st->cso_context; + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct cso_context *cso = st->cso_context; GLfloat x0, y0, x1, y1; GLsizei maxSize; @@ -652,7 +654,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) { - struct st_context *st = ctx->st; + struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; struct st_renderbuffer *strb; @@ -793,7 +795,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, { struct st_fragment_program *stfp; struct st_vertex_program *stvp; - struct st_context *st = ctx->st; + struct st_context *st = st_context(ctx); struct pipe_surface *ps; const GLfloat *color; @@ -811,21 +813,21 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, if (format == GL_DEPTH_COMPONENT) { ps = st->state.framebuffer.zsbuf; - stfp = make_fragment_shader_z(ctx->st); - stvp = st_make_passthrough_vertex_shader(ctx->st, GL_TRUE); + stfp = make_fragment_shader_z(st); + stvp = st_make_passthrough_vertex_shader(st, GL_TRUE); color = ctx->Current.RasterColor; } else { ps = st->state.framebuffer.cbufs[0]; stfp = combined_drawpix_fragment_program(ctx); - stvp = st_make_passthrough_vertex_shader(ctx->st, GL_FALSE); + stvp = st_make_passthrough_vertex_shader(st, GL_FALSE); color = NULL; } /* draw with textured quad */ { struct pipe_texture *pt - = make_texture(ctx->st, width, height, format, type, unpack, pixels); + = make_texture(st, width, height, format, type, unpack, pixels); if (pt) { draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2], width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, @@ -942,7 +944,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLint dstx, GLint dsty, GLenum type) { - struct st_context *st = ctx->st; + struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; struct st_renderbuffer *rbRead; @@ -995,14 +997,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, rbRead = st_get_color_read_renderbuffer(ctx); color = NULL; stfp = combined_drawpix_fragment_program(ctx); - stvp = st_make_passthrough_vertex_shader(ctx->st, GL_FALSE); + stvp = st_make_passthrough_vertex_shader(st, GL_FALSE); } else { assert(type == GL_DEPTH); rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - stfp = make_fragment_shader_z(ctx->st); - stvp = st_make_passthrough_vertex_shader(ctx->st, GL_TRUE); + stfp = make_fragment_shader_z(st); + stvp = st_make_passthrough_vertex_shader(st, GL_TRUE); } srcFormat = rbRead->texture->format; @@ -1014,13 +1016,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, else { /* srcFormat can't be used as a texture format */ if (type == GL_DEPTH) { - texFormat = st_choose_format(pipe, GL_DEPTH_COMPONENT, PIPE_TEXTURE_2D, + texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT, + PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL); assert(texFormat != PIPE_FORMAT_NONE); /* XXX no depth texture formats??? */ } else { /* default color format */ - texFormat = st_choose_format(pipe, GL_RGBA, PIPE_TEXTURE_2D, + texFormat = st_choose_format(screen, GL_RGBA, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); assert(texFormat != PIPE_FORMAT_NONE); } @@ -1059,7 +1062,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, assert(pth <= maxSize); } - pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, texFormat, 0, + pt = st_texture_create(st, PIPE_TEXTURE_2D, texFormat, 0, ptw, pth, 1, PIPE_TEXTURE_USAGE_SAMPLER); if (!pt) @@ -1073,11 +1076,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, PIPE_BUFFER_USAGE_GPU_READ); struct pipe_surface *psTex = screen->get_tex_surface(screen, pt, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE ); - pipe->surface_copy(pipe, - psTex, /* dest */ - 0, 0, /* destx/y */ - psRead, - srcx, srcy, width, height); + if (pipe->surface_copy) { + pipe->surface_copy(pipe, + psTex, /* dest */ + 0, 0, /* destx/y */ + psRead, + srcx, srcy, width, height); + } else { + util_surface_copy(pipe, FALSE, + psTex, + 0, 0, + psRead, + srcx, srcy, width, height); + } pipe_surface_reference(&psRead, NULL); pipe_surface_reference(&psTex, NULL); } @@ -1090,6 +1101,9 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, struct pipe_transfer *ptTex; enum pipe_transfer_usage transfer_usage; + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + if (type == GL_DEPTH && pf_is_depth_and_stencil(pt->format)) transfer_usage = PIPE_TRANSFER_READ_WRITE; else diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index e8399ded7b..73aa65955b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -49,6 +49,7 @@ #include "st_public.h" #include "st_texture.h" +#include "util/u_rect.h" /** @@ -93,7 +94,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, if (strb->format != PIPE_FORMAT_NONE) format = strb->format; else - format = st_choose_renderbuffer_format(pipe, internalFormat); + format = st_choose_renderbuffer_format(pipe->screen, internalFormat); /* init renderbuffer fields */ strb->Base.Width = width; @@ -384,6 +385,7 @@ st_render_texture(GLcontext *ctx, rb->Width = texImage->Width2; rb->Height = texImage->Height2; + rb->_BaseFormat = texImage->_BaseFormat; /*printf("***** render to texture level %d: %d x %d\n", att->TextureLevel, rb->Width, rb->Height);*/ /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/ @@ -537,10 +539,17 @@ copy_back_to_front(struct st_context *st, (void) st_get_framebuffer_surface(stfb, backIndex, &surf_back); if (surf_front && surf_back) { - st->pipe->surface_copy(st->pipe, - surf_front, 0, 0, /* dest */ - surf_back, 0, 0, /* src */ - fb->Width, fb->Height); + if (st->pipe->surface_copy) { + st->pipe->surface_copy(st->pipe, + surf_front, 0, 0, /* dest */ + surf_back, 0, 0, /* src */ + fb->Width, fb->Height); + } else { + util_surface_copy(st->pipe, FALSE, + surf_front, 0, 0, + surf_back, 0, 0, + fb->Width, fb->Height); + } } } diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 4398ab2839..b2d5c39a3a 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -45,6 +45,7 @@ #include "st_context.h" #include "st_program.h" #include "st_atom_shader.h" +#include "st_mesa_to_tgsi.h" #include "st_cb_program.h" @@ -152,7 +153,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stvp->state.tokens) { - _mesa_free((void *) stvp->state.tokens); + st_free_tokens(stvp->state.tokens); stvp->state.tokens = NULL; } } @@ -167,7 +168,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stfp->state.tokens) { - _mesa_free((void *) stfp->state.tokens); + st_free_tokens(stfp->state.tokens); stfp->state.tokens = NULL; } @@ -214,7 +215,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stfp->state.tokens) { - _mesa_free((void *) stfp->state.tokens); + st_free_tokens(stfp->state.tokens); stfp->state.tokens = NULL; } @@ -242,7 +243,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stvp->state.tokens) { - _mesa_free((void *) stvp->state.tokens); + st_free_tokens(stvp->state.tokens); stvp->state.tokens = NULL; } diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 75424aa2e7..772bb3bb69 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -43,6 +43,7 @@ #include "pipe/p_inlines.h" #include "util/u_tile.h" +#include "st_debug.h" #include "st_context.h" #include "st_cb_bitmap.h" #include "st_cb_readpixels.h" @@ -416,6 +417,9 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, yStep = 1; } + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + /* * Copy pixels from pipe_transfer to user memory */ diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 50675b5896..a1953342b4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -43,6 +43,7 @@ #include "main/texobj.h" #include "main/texstore.h" +#include "state_tracker/st_debug.h" #include "state_tracker/st_context.h" #include "state_tracker/st_cb_fbo.h" #include "state_tracker/st_cb_texture.h" @@ -328,10 +329,13 @@ guess_and_alloc_texture(struct st_context *st, stObj->base.MinFilter == GL_LINEAR || stImage->base._BaseFormat == GL_DEPTH_COMPONENT || stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) && + !stObj->base.GenerateMipmap && stImage->level == firstLevel) { + /* only alloc space for a single mipmap level */ lastLevel = firstLevel; } else { + /* alloc space for a full mipmap */ GLuint l2width = util_logbase2(width); GLuint l2height = util_logbase2(height); GLuint l2depth = util_logbase2(depth); @@ -768,10 +772,6 @@ done: st_texture_image_unmap(ctx->st, stImage); texImage->Data = NULL; } - - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } } @@ -904,6 +904,9 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width, height, format, type, row, 0); + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback format translation\n", __FUNCTION__); + /* get float[4] rgba row from surface */ pipe_get_tile_rgba(tex_xfer, 0, row, width, 1, rgba); @@ -1142,10 +1145,6 @@ done: st_texture_image_unmap(ctx->st, stImage); texImage->Data = NULL; } - - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } } @@ -1299,6 +1298,9 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, struct pipe_transfer *src_trans; GLvoid *texDest; enum pipe_transfer_usage transfer_usage; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); assert(width <= MAX_WIDTH); @@ -1424,6 +1426,12 @@ compatible_src_dst_formats(const struct gl_renderbuffer *src, return TGSI_WRITEMASK_XYZ; /* A ==> 1.0 */ } else { + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s failed for src %s, dst %s\n", + __FUNCTION__, + _mesa_lookup_enum_by_nr(srcFormat), + _mesa_lookup_enum_by_nr(dstLogicalFormat)); + /* Otherwise fail. */ return 0; @@ -1538,7 +1546,8 @@ st_copy_texsubimage(GLcontext *ctx, if (ctx->_ImageTransferState == 0x0) { - if (matching_base_formats && + if (pipe->surface_copy && + matching_base_formats && src_format == dest_format && !do_flip) { @@ -1609,10 +1618,6 @@ st_copy_texsubimage(GLcontext *ctx, destX, destY, destZ, srcX, srcY, width, height); } - - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 8514b6b375..f0eddafd33 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -36,6 +36,7 @@ #include "shader/shader_api.h" #include "glapi/glapi.h" #include "st_public.h" +#include "st_debug.h" #include "st_context.h" #include "st_cb_accum.h" #include "st_cb_bitmap.h" @@ -113,6 +114,9 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe ) st->ctx = ctx; st->pipe = pipe; + /* XXX: this is one-off, per-screen init: */ + st_debug_init(); + /* state tracker needs the VBO module */ _vbo_CreateContext(ctx); @@ -332,7 +336,7 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_feedback_functions(functions); #endif st_init_program_functions(functions); -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj st_init_query_functions(functions); #endif st_init_readpixels_functions(functions); diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index c7d26ce33c..3009cde9d5 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -41,6 +41,32 @@ +#ifdef DEBUG +int ST_DEBUG = 0; + +static const struct debug_named_value st_debug_flags[] = { + { "mesa", DEBUG_MESA }, + { "tgsi", DEBUG_TGSI }, + { "pipe", DEBUG_PIPE }, + { "tex", DEBUG_TEX }, + { "fallback", DEBUG_FALLBACK }, + { "screen", DEBUG_SCREEN }, + { "query", DEBUG_QUERY }, + {NULL, 0} +}; +#endif + + +void +st_debug_init(void) +{ +#ifdef DEBUG + ST_DEBUG = debug_get_flags_option("ST_DEBUG", st_debug_flags, 0 ); +#endif +} + + + /** * Print current state. May be called from inside gdb to see currently * bound vertex/fragment shaders and associated constants. @@ -68,3 +94,5 @@ st_print_current(void) if (st->fp->Base.Base.Parameters) _mesa_print_parameter_list(st->fp->Base.Base.Parameters); } + + diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h index 49d752e1b2..4a060d7759 100644 --- a/src/mesa/state_tracker/st_debug.h +++ b/src/mesa/state_tracker/st_debug.h @@ -29,8 +29,44 @@ #ifndef ST_DEBUG_H #define ST_DEBUG_H +#include "pipe/p_compiler.h" +#include "util/u_debug.h" + extern void st_print_current(void); +#define DEBUG_MESA 0x1 +#define DEBUG_TGSI 0x2 +#define DEBUG_CONSTANTS 0x4 +#define DEBUG_PIPE 0x8 +#define DEBUG_TEX 0x10 +#define DEBUG_FALLBACK 0x20 +#define DEBUG_QUERY 0x40 +#define DEBUG_SCREEN 0x80 + +#ifdef DEBUG +extern int ST_DEBUG; +#define DBSTR(x) x +#else +#define ST_DEBUG 0 +#define DBSTR(x) "" +#endif + +void st_debug_init( void ); + +static INLINE void +ST_DBG( unsigned flag, const char *fmt, ... ) +{ + if (ST_DEBUG & flag) + { + va_list args; + + va_start( args, fmt ); + debug_vprintf( fmt, args ); + va_end( args ); + } +} + + #endif /* ST_DEBUG_H */ diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index dcb90a3107..3e0db37414 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -392,10 +392,9 @@ default_depth_format(struct pipe_screen *screen, * or PIPE_TEXTURE_USAGE_SAMPLER */ enum pipe_format -st_choose_format(struct pipe_context *pipe, GLenum internalFormat, +st_choose_format(struct pipe_screen *screen, GLenum internalFormat, enum pipe_texture_target target, unsigned tex_usage) { - struct pipe_screen *screen = pipe->screen; unsigned geom_flags = 0; switch (internalFormat) { @@ -618,14 +617,15 @@ is_depth_or_stencil_format(GLenum internalFormat) * Called by FBO code to choose a PIPE_FORMAT_ for drawing surfaces. */ enum pipe_format -st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat) +st_choose_renderbuffer_format(struct pipe_screen *screen, + GLenum internalFormat) { uint usage; if (is_depth_or_stencil_format(internalFormat)) usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL; else usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; - return st_choose_format(pipe, internalFormat, PIPE_TEXTURE_2D, usage); + return st_choose_format(screen, internalFormat, PIPE_TEXTURE_2D, usage); } @@ -713,8 +713,8 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat, (void) format; (void) type; - pFormat = st_choose_format(ctx->st->pipe, internalFormat, PIPE_TEXTURE_2D, - PIPE_TEXTURE_USAGE_SAMPLER); + pFormat = st_choose_format(ctx->st->pipe->screen, internalFormat, + PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); if (pFormat == PIPE_FORMAT_NONE) return NULL; diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 9d9e02fe9b..e4a788c89b 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -64,11 +64,12 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat); extern enum pipe_format -st_choose_format(struct pipe_context *pipe, GLenum internalFormat, +st_choose_format(struct pipe_screen *screen, GLenum internalFormat, enum pipe_texture_target target, unsigned tex_usage); extern enum pipe_format -st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat); +st_choose_renderbuffer_format(struct pipe_screen *screen, + GLenum internalFormat); extern const struct gl_texture_format * diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index f75b2348b8..16ca2771b0 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -42,6 +42,7 @@ #include "cso_cache/cso_cache.h" #include "cso_cache/cso_context.h" +#include "st_debug.h" #include "st_context.h" #include "st_draw.h" #include "st_gen_mipmap.h" @@ -113,6 +114,9 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, uint dstLevel; GLenum datatype; GLuint comps; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); assert(target != GL_TEXTURE_3D); /* not done yet */ diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 2ab12d3cf3..70d7c4fee2 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -27,836 +27,649 @@ /* * \author - * Michal Krol + * Michal Krol, + * Keith Whitwell */ #include "pipe/p_compiler.h" #include "pipe/p_shader_tokens.h" -#include "tgsi/tgsi_parse.h" -#include "tgsi/tgsi_build.h" -#include "tgsi/tgsi_util.h" -#include "tgsi/tgsi_dump.h" -#include "tgsi/tgsi_sanity.h" +#include "pipe/p_state.h" +#include "tgsi/tgsi_ureg.h" #include "st_mesa_to_tgsi.h" #include "shader/prog_instruction.h" #include "shader/prog_parameter.h" #include "shader/prog_print.h" #include "util/u_debug.h" +#include "util/u_math.h" +#include "util/u_memory.h" + +struct label { + unsigned branch_target; + unsigned token; +}; + +struct st_translate { + struct ureg_program *ureg; + + struct ureg_dst temps[MAX_PROGRAM_TEMPS]; + struct ureg_src *constants; + struct ureg_dst outputs[PIPE_MAX_SHADER_OUTPUTS]; + struct ureg_src inputs[PIPE_MAX_SHADER_INPUTS]; + struct ureg_dst address[1]; + struct ureg_src samplers[PIPE_MAX_SAMPLERS]; + + const GLuint *inputMapping; + const GLuint *outputMapping; + + /* For every instruction that contains a label (eg CALL), keep + * details so that we can go back afterwards and emit the correct + * tgsi instruction number for each label. + */ + struct label *labels; + unsigned labels_size; + unsigned labels_count; + + /* Keep a record of the tgsi instruction number that each mesa + * instruction starts at, will be used to fix up labels after + * translation. + */ + unsigned *insn; + unsigned insn_size; + unsigned insn_count; + + unsigned procType; /**< TGSI_PROCESSOR_VERTEX/FRAGMENT */ + + boolean error; +}; + + +static unsigned *get_label( struct st_translate *t, + unsigned branch_target ) +{ + unsigned i; + + if (t->labels_count + 1 >= t->labels_size) { + unsigned old_size = t->labels_size; + t->labels_size = 1 << (util_logbase2(t->labels_size) + 1); + t->labels = REALLOC( t->labels, + old_size * sizeof t->labels[0], + t->labels_size * sizeof t->labels[0] ); + if (t->labels == NULL) { + static unsigned dummy; + t->error = TRUE; + return &dummy; + } + } + + i = t->labels_count++; + t->labels[i].branch_target = branch_target; + return &t->labels[i].token; +} + + +static void set_insn_start( struct st_translate *t, + unsigned start ) +{ + if (t->insn_count + 1 >= t->insn_size) { + unsigned old_size = t->insn_size; + t->insn_size = 1 << (util_logbase2(t->insn_size) + 1); + t->insn = REALLOC( t->insn, + old_size * sizeof t->insn[0], + t->insn_size * sizeof t->insn[0] ); + if (t->insn == NULL) { + t->error = TRUE; + return; + } + } + + t->insn[t->insn_count++] = start; +} + /* * Map mesa register file to TGSI register file. */ -static GLuint -map_register_file( - gl_register_file file, - GLuint index, - const GLuint immediateMapping[], - GLboolean indirectAccess ) +static struct ureg_dst +dst_register( struct st_translate *t, + gl_register_file file, + GLuint index ) { switch( file ) { case PROGRAM_UNDEFINED: - return TGSI_FILE_NULL; + return ureg_dst_undef(); + case PROGRAM_TEMPORARY: - return TGSI_FILE_TEMPORARY; - /*case PROGRAM_LOCAL_PARAM:*/ - /*case PROGRAM_ENV_PARAM:*/ - - /* Because of the longstanding problem with mesa arb shaders - * where constants, immediates and state variables are all - * bundled together as PROGRAM_STATE_VAR, we can't tell from the - * mesa register file whether this is a CONSTANT or an - * IMMEDIATE, hence we need all the other information. - */ - case PROGRAM_STATE_VAR: - case PROGRAM_NAMED_PARAM: - case PROGRAM_UNIFORM: - if (!indirectAccess && immediateMapping && immediateMapping[index] != ~0) - return TGSI_FILE_IMMEDIATE; - else - return TGSI_FILE_CONSTANT; - case PROGRAM_CONSTANT: - if (indirectAccess) - return TGSI_FILE_CONSTANT; - assert(immediateMapping[index] != ~0); - return TGSI_FILE_IMMEDIATE; - case PROGRAM_INPUT: - return TGSI_FILE_INPUT; + if (ureg_dst_is_undef(t->temps[index])) + t->temps[index] = ureg_DECL_temporary( t->ureg ); + + return t->temps[index]; + case PROGRAM_OUTPUT: - return TGSI_FILE_OUTPUT; + return t->outputs[t->outputMapping[index]]; + case PROGRAM_ADDRESS: - return TGSI_FILE_ADDRESS; + return t->address[index]; + default: - assert( 0 ); - return TGSI_FILE_NULL; + debug_assert( 0 ); + return ureg_dst_undef(); } } -/** - * Map mesa register file index to TGSI index. - * Take special care when processing input and output indices. - * \param file one of TGSI_FILE_x - * \param index the mesa register file index - * \param inputMapping maps Mesa input indexes to TGSI input indexes - * \param outputMapping maps Mesa output indexes to TGSI output indexes - */ -static GLuint -map_register_file_index( - GLuint procType, - GLuint file, - GLuint index, - GLuint *swizzle, - const GLuint inputMapping[], - const GLuint outputMapping[], - const GLuint immediateMapping[], - GLboolean indirectAccess ) + +static struct ureg_src +src_register( struct st_translate *t, + gl_register_file file, + GLuint index ) { switch( file ) { - case TGSI_FILE_INPUT: - /* inputs are mapped according to the user-defined map */ - return inputMapping[index]; + case PROGRAM_UNDEFINED: + return ureg_src_undef(); + + case PROGRAM_TEMPORARY: + if (ureg_dst_is_undef(t->temps[index])) + t->temps[index] = ureg_DECL_temporary( t->ureg ); + return ureg_src(t->temps[index]); + + case PROGRAM_STATE_VAR: + case PROGRAM_NAMED_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_UNIFORM: + case PROGRAM_CONSTANT: /* ie, immediate */ + return t->constants[index]; - case TGSI_FILE_OUTPUT: - return outputMapping[index]; + case PROGRAM_INPUT: + return t->inputs[t->inputMapping[index]]; - case TGSI_FILE_IMMEDIATE: - if (indirectAccess) - return index; - assert(immediateMapping[index] != ~0); - return immediateMapping[index]; + case PROGRAM_OUTPUT: + return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */ + + case PROGRAM_ADDRESS: + return ureg_src(t->address[index]); default: - return index; + debug_assert( 0 ); + return ureg_src_undef(); } } -/* + +/** * Map mesa texture target to TGSI texture target. */ -static GLuint -map_texture_target( - GLuint textarget, - GLboolean shadow ) +static unsigned +translate_texture_target( GLuint textarget, + GLboolean shadow ) { - switch( textarget ) { - case TEXTURE_1D_INDEX: - if (shadow) - return TGSI_TEXTURE_SHADOW1D; - else - return TGSI_TEXTURE_1D; - case TEXTURE_2D_INDEX: - if (shadow) - return TGSI_TEXTURE_SHADOW2D; - else - return TGSI_TEXTURE_2D; - case TEXTURE_3D_INDEX: - return TGSI_TEXTURE_3D; - case TEXTURE_CUBE_INDEX: - return TGSI_TEXTURE_CUBE; - case TEXTURE_RECT_INDEX: - if (shadow) - return TGSI_TEXTURE_SHADOWRECT; - else - return TGSI_TEXTURE_RECT; - default: - assert( 0 ); + if (shadow) { + switch( textarget ) { + case TEXTURE_1D_INDEX: return TGSI_TEXTURE_SHADOW1D; + case TEXTURE_2D_INDEX: return TGSI_TEXTURE_SHADOW2D; + case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_SHADOWRECT; + default: break; + } } - return TGSI_TEXTURE_1D; -} - -static GLuint -convert_sat( - GLuint sat ) -{ - switch( sat ) { - case SATURATE_OFF: - return TGSI_SAT_NONE; - case SATURATE_ZERO_ONE: - return TGSI_SAT_ZERO_ONE; - case SATURATE_PLUS_MINUS_ONE: - return TGSI_SAT_MINUS_PLUS_ONE; + switch( textarget ) { + case TEXTURE_1D_INDEX: return TGSI_TEXTURE_1D; + case TEXTURE_2D_INDEX: return TGSI_TEXTURE_2D; + case TEXTURE_3D_INDEX: return TGSI_TEXTURE_3D; + case TEXTURE_CUBE_INDEX: return TGSI_TEXTURE_CUBE; + case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_RECT; default: - assert( 0 ); - return TGSI_SAT_NONE; + debug_assert( 0 ); + return TGSI_TEXTURE_1D; } } -static GLuint -convert_writemask( - GLuint writemask ) + +static struct ureg_dst +translate_dst( struct st_translate *t, + const struct prog_dst_register *DstReg, + boolean saturate ) { - assert( WRITEMASK_X == TGSI_WRITEMASK_X ); - assert( WRITEMASK_Y == TGSI_WRITEMASK_Y ); - assert( WRITEMASK_Z == TGSI_WRITEMASK_Z ); - assert( WRITEMASK_W == TGSI_WRITEMASK_W ); - assert( (writemask & ~TGSI_WRITEMASK_XYZW) == 0 ); + struct ureg_dst dst = dst_register( t, + DstReg->File, + DstReg->Index ); + + dst = ureg_writemask( dst, + DstReg->WriteMask ); + + if (saturate) + dst = ureg_saturate( dst ); - return writemask; + if (DstReg->RelAddr) + dst = ureg_dst_indirect( dst, ureg_src(t->address[0]) ); + + return dst; } -static struct tgsi_full_immediate -make_immediate(const float *value, uint size) + +static struct ureg_src +translate_src( struct st_translate *t, + const struct prog_src_register *SrcReg ) { - struct tgsi_full_immediate imm; - unsigned i; + struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index ); + + src = ureg_swizzle( src, + GET_SWZ( SrcReg->Swizzle, 0 ) & 0x3, + GET_SWZ( SrcReg->Swizzle, 1 ) & 0x3, + GET_SWZ( SrcReg->Swizzle, 2 ) & 0x3, + GET_SWZ( SrcReg->Swizzle, 3 ) & 0x3); - imm = tgsi_default_full_immediate(); - imm.Immediate.NrTokens += size; - imm.Immediate.DataType = TGSI_IMM_FLOAT32; + if (SrcReg->Negate == NEGATE_XYZW) + src = ureg_negate(src); - for (i = 0; i < size; i++) - imm.u[i].Float = value[i]; + if (SrcReg->Abs) + src = ureg_abs(src); - return imm; + if (SrcReg->RelAddr) + src = ureg_src_indirect( src, ureg_src(t->address[0])); + + return src; } -static void -compile_instruction( - const struct prog_instruction *inst, - struct tgsi_full_instruction *fullinst, - const GLuint inputMapping[], - const GLuint outputMapping[], - const GLuint immediateMapping[], - GLboolean indirectAccess, - GLuint preamble_size, - GLuint procType, - GLboolean *insideSubroutine, - GLint wposTemp) + +static struct ureg_src swizzle_4v( struct ureg_src src, + const unsigned *swz ) { - GLuint i; - struct tgsi_full_dst_register *fulldst; - struct tgsi_full_src_register *fullsrc; - - *fullinst = tgsi_default_full_instruction(); - - fullinst->Instruction.Saturate = convert_sat( inst->SaturateMode ); - fullinst->Instruction.NumDstRegs = _mesa_num_inst_dst_regs( inst->Opcode ); - fullinst->Instruction.NumSrcRegs = _mesa_num_inst_src_regs( inst->Opcode ); - - fulldst = &fullinst->FullDstRegisters[0]; - fulldst->DstRegister.File = map_register_file( inst->DstReg.File, 0, NULL, GL_FALSE ); - fulldst->DstRegister.Index = map_register_file_index( - procType, - fulldst->DstRegister.File, - inst->DstReg.Index, - NULL, - inputMapping, - outputMapping, - NULL, - GL_FALSE ); - fulldst->DstRegister.WriteMask = convert_writemask( inst->DstReg.WriteMask ); - if (inst->DstReg.RelAddr) { - fulldst->DstRegister.Indirect = 1; - fulldst->DstRegisterInd.File = TGSI_FILE_ADDRESS; - fulldst->DstRegisterInd.Index = 0; + return ureg_swizzle( src, swz[0], swz[1], swz[2], swz[3] ); +} + + +/** + * Translate SWZ instructions into a single MAD. EG: + * + * SWZ dst, src.x-y10 + * + * becomes: + * + * MAD dst {1,-1,0,0}, src.xyxx, {0,0,1,0} + */ +static void emit_swz( struct st_translate *t, + struct ureg_dst dst, + const struct prog_src_register *SrcReg ) +{ + struct ureg_program *ureg = t->ureg; + struct ureg_src src = src_register( t, SrcReg->File, SrcReg->Index ); + + unsigned negate_mask = SrcReg->Negate; + + unsigned one_mask = ((GET_SWZ(SrcReg->Swizzle, 0) == SWIZZLE_ONE) << 0 | + (GET_SWZ(SrcReg->Swizzle, 1) == SWIZZLE_ONE) << 1 | + (GET_SWZ(SrcReg->Swizzle, 2) == SWIZZLE_ONE) << 2 | + (GET_SWZ(SrcReg->Swizzle, 3) == SWIZZLE_ONE) << 3); + + unsigned zero_mask = ((GET_SWZ(SrcReg->Swizzle, 0) == SWIZZLE_ZERO) << 0 | + (GET_SWZ(SrcReg->Swizzle, 1) == SWIZZLE_ZERO) << 1 | + (GET_SWZ(SrcReg->Swizzle, 2) == SWIZZLE_ZERO) << 2 | + (GET_SWZ(SrcReg->Swizzle, 3) == SWIZZLE_ZERO) << 3); + + unsigned negative_one_mask = one_mask & negate_mask; + unsigned positive_one_mask = one_mask & ~negate_mask; + + struct ureg_src imm; + unsigned i; + unsigned mul_swizzle[4] = {0,0,0,0}; + unsigned add_swizzle[4] = {0,0,0,0}; + unsigned src_swizzle[4] = {0,0,0,0}; + boolean need_add = FALSE; + boolean need_mul = FALSE; + + if (dst.WriteMask == 0) + return; + + /* Is this just a MOV? + */ + if (zero_mask == 0 && + one_mask == 0 && + (negate_mask == 0 || negate_mask == TGSI_WRITEMASK_XYZW)) + { + ureg_MOV( ureg, dst, translate_src( t, SrcReg )); + return; } - for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) { - GLuint j; - GLuint swizzle = inst->SrcReg[i].Swizzle; +#define IMM_ZERO 0 +#define IMM_ONE 1 +#define IMM_NEG_ONE 2 - fullsrc = &fullinst->FullSrcRegisters[i]; + imm = ureg_imm3f( ureg, 0, 1, -1 ); - if (procType == TGSI_PROCESSOR_FRAGMENT && - inst->SrcReg[i].File == PROGRAM_INPUT && - inst->SrcReg[i].Index == FRAG_ATTRIB_WPOS) { - /* special case of INPUT[WPOS] */ - fullsrc->SrcRegister.File = TGSI_FILE_TEMPORARY; - fullsrc->SrcRegister.Index = wposTemp; - } - else { - /* any other src register */ - fullsrc->SrcRegister.File = map_register_file( - inst->SrcReg[i].File, - inst->SrcReg[i].Index, - immediateMapping, - indirectAccess ); - fullsrc->SrcRegister.Index = map_register_file_index( - procType, - fullsrc->SrcRegister.File, - inst->SrcReg[i].Index, - &swizzle, - inputMapping, - outputMapping, - immediateMapping, - indirectAccess ); - } + for (i = 0; i < 4; i++) { + unsigned bit = 1 << i; - /* swizzle (ext swizzle also depends on negation) */ - { - GLuint swz[4]; - GLboolean extended = (inst->SrcReg[i].Negate != NEGATE_NONE && - inst->SrcReg[i].Negate != NEGATE_XYZW); - for( j = 0; j < 4; j++ ) { - swz[j] = GET_SWZ( swizzle, j ); - if (swz[j] > SWIZZLE_W) - extended = GL_TRUE; + if (dst.WriteMask & bit) { + if (positive_one_mask & bit) { + mul_swizzle[i] = IMM_ZERO; + add_swizzle[i] = IMM_ONE; + need_add = TRUE; } - if (extended) { - for (j = 0; j < 4; j++) { - tgsi_util_set_src_register_extswizzle(&fullsrc->SrcRegisterExtSwz, - swz[j], j); - } + else if (negative_one_mask & bit) { + mul_swizzle[i] = IMM_ZERO; + add_swizzle[i] = IMM_NEG_ONE; + need_add = TRUE; + } + else if (zero_mask & bit) { + mul_swizzle[i] = IMM_ZERO; + add_swizzle[i] = IMM_ZERO; + need_add = TRUE; } else { - for (j = 0; j < 4; j++) { - tgsi_util_set_src_register_swizzle(&fullsrc->SrcRegister, - swz[j], j); + add_swizzle[i] = IMM_ZERO; + src_swizzle[i] = GET_SWZ(SrcReg->Swizzle, i); + need_mul = TRUE; + if (negate_mask & bit) { + mul_swizzle[i] = IMM_NEG_ONE; + } + else { + mul_swizzle[i] = IMM_ONE; } } } + } - if( inst->SrcReg[i].Negate == NEGATE_XYZW ) { - fullsrc->SrcRegister.Negate = 1; - } - else if( inst->SrcReg[i].Negate != NEGATE_NONE ) { - if( inst->SrcReg[i].Negate & NEGATE_X ) { - fullsrc->SrcRegisterExtSwz.NegateX = 1; - } - if( inst->SrcReg[i].Negate & NEGATE_Y ) { - fullsrc->SrcRegisterExtSwz.NegateY = 1; - } - if( inst->SrcReg[i].Negate & NEGATE_Z ) { - fullsrc->SrcRegisterExtSwz.NegateZ = 1; - } - if( inst->SrcReg[i].Negate & NEGATE_W ) { - fullsrc->SrcRegisterExtSwz.NegateW = 1; - } - } + if (need_mul && need_add) { + ureg_MAD( ureg, + dst, + swizzle_4v( src, src_swizzle ), + swizzle_4v( imm, mul_swizzle ), + swizzle_4v( imm, add_swizzle ) ); + } + else if (need_mul) { + ureg_MUL( ureg, + dst, + swizzle_4v( src, src_swizzle ), + swizzle_4v( imm, mul_swizzle ) ); + } + else if (need_add) { + ureg_MOV( ureg, + dst, + swizzle_4v( imm, add_swizzle ) ); + } + else { + debug_assert(0); + } - if( inst->SrcReg[i].Abs ) { - fullsrc->SrcRegisterExtMod.Absolute = 1; - } +#undef IMM_ZERO +#undef IMM_ONE +#undef IMM_NEG_ONE +} - if( inst->SrcReg[i].RelAddr ) { - fullsrc->SrcRegister.Indirect = 1; - fullsrc->SrcRegisterInd.File = TGSI_FILE_ADDRESS; - fullsrc->SrcRegisterInd.Index = 0; - } - } - switch( inst->Opcode ) { +static unsigned +translate_opcode( unsigned op ) +{ + switch( op ) { case OPCODE_ARL: - fullinst->Instruction.Opcode = TGSI_OPCODE_ARL; - break; + return TGSI_OPCODE_ARL; case OPCODE_ABS: - fullinst->Instruction.Opcode = TGSI_OPCODE_ABS; - break; + return TGSI_OPCODE_ABS; case OPCODE_ADD: - fullinst->Instruction.Opcode = TGSI_OPCODE_ADD; - break; + return TGSI_OPCODE_ADD; case OPCODE_BGNLOOP: - fullinst->Instruction.Opcode = TGSI_OPCODE_BGNLOOP; - fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size; - break; + return TGSI_OPCODE_BGNLOOP; case OPCODE_BGNSUB: - fullinst->Instruction.Opcode = TGSI_OPCODE_BGNSUB; - *insideSubroutine = GL_TRUE; - break; + return TGSI_OPCODE_BGNSUB; case OPCODE_BRA: - fullinst->Instruction.Opcode = TGSI_OPCODE_BRA; - break; + return TGSI_OPCODE_BRA; case OPCODE_BRK: - fullinst->Instruction.Opcode = TGSI_OPCODE_BRK; - break; + return TGSI_OPCODE_BRK; case OPCODE_CAL: - fullinst->Instruction.Opcode = TGSI_OPCODE_CAL; - fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size; - break; + return TGSI_OPCODE_CAL; case OPCODE_CMP: - fullinst->Instruction.Opcode = TGSI_OPCODE_CMP; - break; + return TGSI_OPCODE_CMP; case OPCODE_CONT: - fullinst->Instruction.Opcode = TGSI_OPCODE_CONT; - break; + return TGSI_OPCODE_CONT; case OPCODE_COS: - fullinst->Instruction.Opcode = TGSI_OPCODE_COS; - break; + return TGSI_OPCODE_COS; case OPCODE_DDX: - fullinst->Instruction.Opcode = TGSI_OPCODE_DDX; - break; + return TGSI_OPCODE_DDX; case OPCODE_DDY: - fullinst->Instruction.Opcode = TGSI_OPCODE_DDY; - break; + return TGSI_OPCODE_DDY; case OPCODE_DP2: - fullinst->Instruction.Opcode = TGSI_OPCODE_DP2; - break; + return TGSI_OPCODE_DP2; case OPCODE_DP2A: - fullinst->Instruction.Opcode = TGSI_OPCODE_DP2A; - break; + return TGSI_OPCODE_DP2A; case OPCODE_DP3: - fullinst->Instruction.Opcode = TGSI_OPCODE_DP3; - break; + return TGSI_OPCODE_DP3; case OPCODE_DP4: - fullinst->Instruction.Opcode = TGSI_OPCODE_DP4; - break; + return TGSI_OPCODE_DP4; case OPCODE_DPH: - fullinst->Instruction.Opcode = TGSI_OPCODE_DPH; - break; + return TGSI_OPCODE_DPH; case OPCODE_DST: - fullinst->Instruction.Opcode = TGSI_OPCODE_DST; - break; + return TGSI_OPCODE_DST; case OPCODE_ELSE: - fullinst->Instruction.Opcode = TGSI_OPCODE_ELSE; - fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size; - break; + return TGSI_OPCODE_ELSE; case OPCODE_ENDIF: - fullinst->Instruction.Opcode = TGSI_OPCODE_ENDIF; - break; + return TGSI_OPCODE_ENDIF; case OPCODE_ENDLOOP: - fullinst->Instruction.Opcode = TGSI_OPCODE_ENDLOOP; - fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size; - break; + return TGSI_OPCODE_ENDLOOP; case OPCODE_ENDSUB: - fullinst->Instruction.Opcode = TGSI_OPCODE_ENDSUB; - *insideSubroutine = GL_FALSE; - break; + return TGSI_OPCODE_ENDSUB; case OPCODE_EX2: - fullinst->Instruction.Opcode = TGSI_OPCODE_EX2; - break; + return TGSI_OPCODE_EX2; case OPCODE_EXP: - fullinst->Instruction.Opcode = TGSI_OPCODE_EXP; - break; + return TGSI_OPCODE_EXP; case OPCODE_FLR: - fullinst->Instruction.Opcode = TGSI_OPCODE_FLR; - break; + return TGSI_OPCODE_FLR; case OPCODE_FRC: - fullinst->Instruction.Opcode = TGSI_OPCODE_FRC; - break; + return TGSI_OPCODE_FRC; case OPCODE_IF: - fullinst->Instruction.Opcode = TGSI_OPCODE_IF; - fullinst->InstructionExtLabel.Label = inst->BranchTarget + preamble_size; - break; + return TGSI_OPCODE_IF; case OPCODE_TRUNC: - fullinst->Instruction.Opcode = TGSI_OPCODE_TRUNC; - break; + return TGSI_OPCODE_TRUNC; case OPCODE_KIL: - /* conditional */ - fullinst->Instruction.Opcode = TGSI_OPCODE_KIL; - break; + return TGSI_OPCODE_KIL; case OPCODE_KIL_NV: - /* predicated */ - assert(inst->DstReg.CondMask == COND_TR); - fullinst->Instruction.Opcode = TGSI_OPCODE_KILP; - break; + return TGSI_OPCODE_KILP; case OPCODE_LG2: - fullinst->Instruction.Opcode = TGSI_OPCODE_LG2; - break; + return TGSI_OPCODE_LG2; case OPCODE_LOG: - fullinst->Instruction.Opcode = TGSI_OPCODE_LOG; - break; + return TGSI_OPCODE_LOG; case OPCODE_LIT: - fullinst->Instruction.Opcode = TGSI_OPCODE_LIT; - break; + return TGSI_OPCODE_LIT; case OPCODE_LRP: - fullinst->Instruction.Opcode = TGSI_OPCODE_LRP; - break; + return TGSI_OPCODE_LRP; case OPCODE_MAD: - fullinst->Instruction.Opcode = TGSI_OPCODE_MAD; - break; + return TGSI_OPCODE_MAD; case OPCODE_MAX: - fullinst->Instruction.Opcode = TGSI_OPCODE_MAX; - break; + return TGSI_OPCODE_MAX; case OPCODE_MIN: - fullinst->Instruction.Opcode = TGSI_OPCODE_MIN; - break; + return TGSI_OPCODE_MIN; case OPCODE_MOV: - fullinst->Instruction.Opcode = TGSI_OPCODE_MOV; - break; + return TGSI_OPCODE_MOV; case OPCODE_MUL: - fullinst->Instruction.Opcode = TGSI_OPCODE_MUL; - break; + return TGSI_OPCODE_MUL; case OPCODE_NOISE1: - fullinst->Instruction.Opcode = TGSI_OPCODE_NOISE1; - break; + return TGSI_OPCODE_NOISE1; case OPCODE_NOISE2: - fullinst->Instruction.Opcode = TGSI_OPCODE_NOISE2; - break; + return TGSI_OPCODE_NOISE2; case OPCODE_NOISE3: - fullinst->Instruction.Opcode = TGSI_OPCODE_NOISE3; - break; + return TGSI_OPCODE_NOISE3; case OPCODE_NOISE4: - fullinst->Instruction.Opcode = TGSI_OPCODE_NOISE4; - break; + return TGSI_OPCODE_NOISE4; case OPCODE_NOP: - fullinst->Instruction.Opcode = TGSI_OPCODE_NOP; - break; + return TGSI_OPCODE_NOP; case OPCODE_NRM3: - fullinst->Instruction.Opcode = TGSI_OPCODE_NRM; - break; + return TGSI_OPCODE_NRM; case OPCODE_NRM4: - fullinst->Instruction.Opcode = TGSI_OPCODE_NRM4; - break; + return TGSI_OPCODE_NRM4; case OPCODE_POW: - fullinst->Instruction.Opcode = TGSI_OPCODE_POW; - break; + return TGSI_OPCODE_POW; case OPCODE_RCP: - fullinst->Instruction.Opcode = TGSI_OPCODE_RCP; - break; + return TGSI_OPCODE_RCP; case OPCODE_RET: - /* If RET is used inside main (not a real subroutine) we may want - * to execute END instead of RET. TBD... - */ - if (1 /* *insideSubroutine */) { - fullinst->Instruction.Opcode = TGSI_OPCODE_RET; - } - else { - /* inside main() pseudo-function */ - fullinst->Instruction.Opcode = TGSI_OPCODE_END; - } - break; + return TGSI_OPCODE_RET; case OPCODE_RSQ: - fullinst->Instruction.Opcode = TGSI_OPCODE_RSQ; - break; + return TGSI_OPCODE_RSQ; case OPCODE_SCS: - fullinst->Instruction.Opcode = TGSI_OPCODE_SCS; - fulldst->DstRegister.WriteMask &= TGSI_WRITEMASK_XY; - break; + return TGSI_OPCODE_SCS; case OPCODE_SEQ: - fullinst->Instruction.Opcode = TGSI_OPCODE_SEQ; - break; + return TGSI_OPCODE_SEQ; case OPCODE_SGE: - fullinst->Instruction.Opcode = TGSI_OPCODE_SGE; - break; + return TGSI_OPCODE_SGE; case OPCODE_SGT: - fullinst->Instruction.Opcode = TGSI_OPCODE_SGT; - break; + return TGSI_OPCODE_SGT; case OPCODE_SIN: - fullinst->Instruction.Opcode = TGSI_OPCODE_SIN; - break; + return TGSI_OPCODE_SIN; case OPCODE_SLE: - fullinst->Instruction.Opcode = TGSI_OPCODE_SLE; - break; + return TGSI_OPCODE_SLE; case OPCODE_SLT: - fullinst->Instruction.Opcode = TGSI_OPCODE_SLT; - break; + return TGSI_OPCODE_SLT; case OPCODE_SNE: - fullinst->Instruction.Opcode = TGSI_OPCODE_SNE; - break; + return TGSI_OPCODE_SNE; case OPCODE_SSG: - fullinst->Instruction.Opcode = TGSI_OPCODE_SSG; - break; + return TGSI_OPCODE_SSG; case OPCODE_SUB: - fullinst->Instruction.Opcode = TGSI_OPCODE_SUB; - break; + return TGSI_OPCODE_SUB; case OPCODE_SWZ: - fullinst->Instruction.Opcode = TGSI_OPCODE_SWZ; - break; + return TGSI_OPCODE_SWZ; case OPCODE_TEX: - /* ordinary texture lookup */ - fullinst->Instruction.Opcode = TGSI_OPCODE_TEX; - fullinst->Instruction.NumSrcRegs = 2; - fullinst->InstructionExtTexture.Texture = - map_texture_target( inst->TexSrcTarget, inst->TexShadow ); - fullinst->FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_SAMPLER; - fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit; - break; + return TGSI_OPCODE_TEX; case OPCODE_TXB: - /* texture lookup with LOD bias */ - fullinst->Instruction.Opcode = TGSI_OPCODE_TXB; - fullinst->Instruction.NumSrcRegs = 2; - fullinst->InstructionExtTexture.Texture = - map_texture_target( inst->TexSrcTarget, inst->TexShadow ); - fullinst->FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_SAMPLER; - fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit; - break; + return TGSI_OPCODE_TXB; case OPCODE_TXD: - /* texture lookup with explicit partial derivatives */ - fullinst->Instruction.Opcode = TGSI_OPCODE_TXD; - fullinst->Instruction.NumSrcRegs = 4; - fullinst->InstructionExtTexture.Texture = - map_texture_target( inst->TexSrcTarget, inst->TexShadow ); - /* src[0] = coord, src[1] = d[strq]/dx, src[2] = d[strq]/dy */ - fullinst->FullSrcRegisters[3].SrcRegister.File = TGSI_FILE_SAMPLER; - fullinst->FullSrcRegisters[3].SrcRegister.Index = inst->TexSrcUnit; - break; + return TGSI_OPCODE_TXD; case OPCODE_TXL: - /* texture lookup with explicit LOD */ - fullinst->Instruction.Opcode = TGSI_OPCODE_TXL; - fullinst->Instruction.NumSrcRegs = 2; - fullinst->InstructionExtTexture.Texture = - map_texture_target( inst->TexSrcTarget, inst->TexShadow ); - fullinst->FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_SAMPLER; - fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit; - break; + return TGSI_OPCODE_TXL; case OPCODE_TXP: - /* texture lookup with divide by Q component */ - /* convert to TEX w/ special flag for division */ - fullinst->Instruction.Opcode = TGSI_OPCODE_TXP; - fullinst->Instruction.NumSrcRegs = 2; - fullinst->InstructionExtTexture.Texture = - map_texture_target( inst->TexSrcTarget, inst->TexShadow ); - fullinst->FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_SAMPLER; - fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit; - break; + return TGSI_OPCODE_TXP; case OPCODE_XPD: - fullinst->Instruction.Opcode = TGSI_OPCODE_XPD; - fulldst->DstRegister.WriteMask &= TGSI_WRITEMASK_XYZ; - break; + return TGSI_OPCODE_XPD; case OPCODE_END: - fullinst->Instruction.Opcode = TGSI_OPCODE_END; - break; + return TGSI_OPCODE_END; default: - assert( 0 ); + debug_assert( 0 ); + return TGSI_OPCODE_NOP; } } -/** - * \param usage_mask bitfield of TGSI_WRITEMASK_{XYZW} tokens - */ -static struct tgsi_full_declaration -make_input_decl( - GLuint index, - GLboolean interpolate_info, - GLuint interpolate, - GLuint usage_mask, - GLboolean semantic_info, - GLuint semantic_name, - GLbitfield semantic_index, - GLbitfield input_flags) -{ - struct tgsi_full_declaration decl; - - assert(semantic_name < TGSI_SEMANTIC_COUNT); - - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_INPUT; - decl.Declaration.UsageMask = usage_mask; - decl.Declaration.Semantic = semantic_info; - decl.DeclarationRange.First = index; - decl.DeclarationRange.Last = index; - if (semantic_info) { - decl.Semantic.SemanticName = semantic_name; - decl.Semantic.SemanticIndex = semantic_index; - } - if (interpolate_info) { - decl.Declaration.Interpolate = interpolate; - } - if (input_flags & PROG_PARAM_BIT_CENTROID) - decl.Declaration.Centroid = 1; - if (input_flags & PROG_PARAM_BIT_INVARIANT) - decl.Declaration.Invariant = 1; - - return decl; -} - -/** - * \param usage_mask bitfield of TGSI_WRITEMASK_{XYZW} tokens - */ -static struct tgsi_full_declaration -make_output_decl( - GLuint index, - GLuint semantic_name, - GLuint semantic_index, - GLuint usage_mask, - GLbitfield output_flags) -{ - struct tgsi_full_declaration decl; - - assert(semantic_name < TGSI_SEMANTIC_COUNT); - - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_OUTPUT; - decl.Declaration.UsageMask = usage_mask; - decl.Declaration.Semantic = 1; - decl.DeclarationRange.First = index; - decl.DeclarationRange.Last = index; - decl.Semantic.SemanticName = semantic_name; - decl.Semantic.SemanticIndex = semantic_index; - if (output_flags & PROG_PARAM_BIT_CENTROID) - decl.Declaration.Centroid = 1; - if (output_flags & PROG_PARAM_BIT_INVARIANT) - decl.Declaration.Invariant = 1; - - return decl; -} - -static struct tgsi_full_declaration -make_temp_decl( - GLuint start_index, - GLuint end_index ) +static void +compile_instruction( + struct st_translate *t, + const struct prog_instruction *inst ) { - struct tgsi_full_declaration decl; - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_TEMPORARY; - decl.DeclarationRange.First = start_index; - decl.DeclarationRange.Last = end_index; - return decl; -} + struct ureg_program *ureg = t->ureg; + GLuint i; + struct ureg_dst dst[1]; + struct ureg_src src[4]; + unsigned num_dst; + unsigned num_src; -static struct tgsi_full_declaration -make_addr_decl( - GLuint start_index, - GLuint end_index ) -{ - struct tgsi_full_declaration decl; + num_dst = _mesa_num_inst_dst_regs( inst->Opcode ); + num_src = _mesa_num_inst_src_regs( inst->Opcode ); - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_ADDRESS; - decl.DeclarationRange.First = start_index; - decl.DeclarationRange.Last = end_index; - return decl; -} + if (num_dst) + dst[0] = translate_dst( t, + &inst->DstReg, + inst->SaturateMode ); -static struct tgsi_full_declaration -make_sampler_decl(GLuint index) -{ - struct tgsi_full_declaration decl; - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_SAMPLER; - decl.DeclarationRange.First = index; - decl.DeclarationRange.Last = index; - return decl; -} + for (i = 0; i < num_src; i++) + src[i] = translate_src( t, &inst->SrcReg[i] ); -/** Reference into a constant buffer */ -static struct tgsi_full_declaration -make_constant_decl(GLuint first, GLuint last) -{ - struct tgsi_full_declaration decl; - decl = tgsi_default_full_declaration(); - decl.Declaration.File = TGSI_FILE_CONSTANT; - decl.DeclarationRange.First = first; - decl.DeclarationRange.Last = last; - return decl; -} + switch( inst->Opcode ) { + case OPCODE_SWZ: + emit_swz( t, dst[0], &inst->SrcReg[0] ); + return; + case OPCODE_BGNLOOP: + case OPCODE_CAL: + case OPCODE_ELSE: + case OPCODE_ENDLOOP: + case OPCODE_IF: + debug_assert(num_dst == 0); + ureg_label_insn( ureg, + translate_opcode( inst->Opcode ), + src, num_src, + get_label( t, inst->BranchTarget )); + return; + case OPCODE_TEX: + case OPCODE_TXB: + case OPCODE_TXD: + case OPCODE_TXL: + case OPCODE_TXP: + src[num_src++] = t->samplers[inst->TexSrcUnit]; + ureg_tex_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, + translate_texture_target( inst->TexSrcTarget, + inst->TexShadow ), + src, num_src ); + return; -/** - * Find the temporaries which are used in the given program. - */ -static void -find_temporaries(const struct gl_program *program, - GLboolean tempsUsed[MAX_PROGRAM_TEMPS]) -{ - GLuint i, j; + case OPCODE_SCS: + dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XY ); + ureg_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, + src, num_src ); + break; - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) - tempsUsed[i] = GL_FALSE; + case OPCODE_XPD: + dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ ); + ureg_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, + src, num_src ); + break; - for (i = 0; i < program->NumInstructions; i++) { - const struct prog_instruction *inst = program->Instructions + i; - const GLuint n = _mesa_num_inst_src_regs( inst->Opcode ); - for (j = 0; j < n; j++) { - if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) - tempsUsed[inst->SrcReg[j].Index] = GL_TRUE; - if (inst->DstReg.File == PROGRAM_TEMPORARY) - tempsUsed[inst->DstReg.Index] = GL_TRUE; - } + default: + ureg_insn( ureg, + translate_opcode( inst->Opcode ), + dst, num_dst, + src, num_src ); + break; } } /** - * Find an unused temporary in the tempsUsed array. + * Emit the TGSI instructions for inverting the WPOS y coordinate. */ -static int -find_free_temporary(GLboolean tempsUsed[MAX_PROGRAM_TEMPS]) -{ - int i; - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { - if (!tempsUsed[i]) { - tempsUsed[i] = GL_TRUE; - return i; - } - } - return -1; -} - - -/** helper for building simple TGSI instruction, one src register */ -static void -build_tgsi_instruction1(struct tgsi_full_instruction *inst, - int opcode, - int dstFile, int dstIndex, int writemask, - int srcFile1, int srcIndex1) -{ - *inst = tgsi_default_full_instruction(); - - inst->Instruction.Opcode = opcode; - - inst->Instruction.NumDstRegs = 1; - inst->FullDstRegisters[0].DstRegister.File = dstFile; - inst->FullDstRegisters[0].DstRegister.Index = dstIndex; - inst->FullDstRegisters[0].DstRegister.WriteMask = writemask; - - inst->Instruction.NumSrcRegs = 1; - inst->FullSrcRegisters[0].SrcRegister.File = srcFile1; - inst->FullSrcRegisters[0].SrcRegister.Index = srcIndex1; -} - - -/** helper for building simple TGSI instruction, two src registers */ static void -build_tgsi_instruction2(struct tgsi_full_instruction *inst, - int opcode, - int dstFile, int dstIndex, int writemask, - int srcFile1, int srcIndex1, - int srcFile2, int srcIndex2) +emit_inverted_wpos( struct st_translate *t, + const struct gl_program *program ) { - *inst = tgsi_default_full_instruction(); + struct ureg_program *ureg = t->ureg; - inst->Instruction.Opcode = opcode; - - inst->Instruction.NumDstRegs = 1; - inst->FullDstRegisters[0].DstRegister.File = dstFile; - inst->FullDstRegisters[0].DstRegister.Index = dstIndex; - inst->FullDstRegisters[0].DstRegister.WriteMask = writemask; + /* Fragment program uses fragment position input. + * Need to replace instances of INPUT[WPOS] with temp T + * where T = INPUT[WPOS] by y is inverted. + */ + static const gl_state_index winSizeState[STATE_LENGTH] + = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0 }; + + /* XXX: note we are modifying the incoming shader here! Need to + * do this before emitting the constant decls below, or this + * will be missed: + */ + unsigned winHeightConst = _mesa_add_state_reference(program->Parameters, + winSizeState); - inst->Instruction.NumSrcRegs = 2; - inst->FullSrcRegisters[0].SrcRegister.File = srcFile1; - inst->FullSrcRegisters[0].SrcRegister.Index = srcIndex1; - inst->FullSrcRegisters[1].SrcRegister.File = srcFile2; - inst->FullSrcRegisters[1].SrcRegister.Index = srcIndex2; -} + struct ureg_src winsize = ureg_DECL_constant( ureg, winHeightConst ); + struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg ); + struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; + /* MOV wpos_temp, input[wpos] + */ + ureg_MOV( ureg, wpos_temp, wpos_input ); + /* SUB wpos_temp.y, winsize_const, wpos_input + */ + ureg_SUB( ureg, + ureg_writemask(wpos_temp, TGSI_WRITEMASK_Y ), + winsize, + wpos_input); -/** - * Emit the TGSI instructions for inverting the WPOS y coordinate. - */ -static int -emit_inverted_wpos(struct tgsi_token *tokens, - int wpos_temp, - int winsize_const, - int wpos_input, - struct tgsi_header *header, int maxTokens) -{ - struct tgsi_full_instruction fullinst; - int ti = 0; - - /* MOV wpos_temp.xzw, input[wpos]; */ - build_tgsi_instruction1(&fullinst, - TGSI_OPCODE_MOV, - TGSI_FILE_TEMPORARY, wpos_temp, WRITEMASK_XZW, - TGSI_FILE_INPUT, 0); - - ti += tgsi_build_full_instruction(&fullinst, - &tokens[ti], - header, - maxTokens - ti); - - /* SUB wpos_temp.y, const[winsize_const] - input[wpos_input]; */ - build_tgsi_instruction2(&fullinst, - TGSI_OPCODE_SUB, - TGSI_FILE_TEMPORARY, wpos_temp, WRITEMASK_Y, - TGSI_FILE_CONSTANT, winsize_const, - TGSI_FILE_INPUT, wpos_input); - - ti += tgsi_build_full_instruction(&fullinst, - &tokens[ti], - header, - maxTokens - ti); - - return ti; + /* Use wpos_temp as position input from here on: + */ + t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp); } - - /** * Translate Mesa program to TGSI format. * \param program the program to translate @@ -864,20 +677,19 @@ emit_inverted_wpos(struct tgsi_token *tokens, * \param inputMapping maps Mesa fragment program inputs to TGSI generic * input indexes * \param inputSemanticName the TGSI_SEMANTIC flag for each input - * \param inputSemanticIndex the semantic index (ex: which texcoord) for each input + * \param inputSemanticIndex the semantic index (ex: which texcoord) for + * each input * \param interpMode the TGSI_INTERPOLATE_LINEAR/PERSP mode for each input - * \param numOutputs number of output registers used * \param outputMapping maps Mesa fragment program outputs to TGSI * generic outputs * \param outputSemanticName the TGSI_SEMANTIC flag for each output - * \param outputSemanticIndex the semantic index (ex: which texcoord) for each output - * \param tokens array to store translated tokens in - * \param maxTokens size of the tokens array + * \param outputSemanticIndex the semantic index (ex: which texcoord) for + * each output * - * \return number of tokens placed in 'tokens' buffer, or zero if error + * \return array of translated tokens, caller's responsibility to free */ -GLuint +const struct tgsi_token * st_translate_mesa_program( GLcontext *ctx, uint procType, @@ -892,252 +704,124 @@ st_translate_mesa_program( const GLuint outputMapping[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[], - const GLbitfield outputFlags[], - struct tgsi_token *tokens, - GLuint maxTokens ) + const GLbitfield outputFlags[] ) { - GLuint i; - GLuint ti; /* token index */ - struct tgsi_header *header; - struct tgsi_processor *processor; - GLuint preamble_size = 0; - GLuint immediates[1000]; - GLuint numImmediates = 0; - GLboolean insideSubroutine = GL_FALSE; - GLboolean indirectAccess = GL_FALSE; - GLboolean tempsUsed[MAX_PROGRAM_TEMPS + 1]; - GLint wposTemp = -1, winHeightConst = -1; - - assert(procType == TGSI_PROCESSOR_FRAGMENT || - procType == TGSI_PROCESSOR_VERTEX); - - find_temporaries(program, tempsUsed); - - if (procType == TGSI_PROCESSOR_FRAGMENT) { - if (program->InputsRead & FRAG_BIT_WPOS) { - /* Fragment program uses fragment position input. - * Need to replace instances of INPUT[WPOS] with temp T - * where T = INPUT[WPOS] by y is inverted. - */ - static const gl_state_index winSizeState[STATE_LENGTH] - = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0 }; - winHeightConst = _mesa_add_state_reference(program->Parameters, - winSizeState); - wposTemp = find_free_temporary(tempsUsed); - } - } - + struct st_translate translate, *t; + struct ureg_program *ureg; + const struct tgsi_token *tokens = NULL; + unsigned i; - *(struct tgsi_version *) &tokens[0] = tgsi_build_version(); + t = &translate; + memset(t, 0, sizeof *t); - header = (struct tgsi_header *) &tokens[1]; - *header = tgsi_build_header(); + t->procType = procType; + t->inputMapping = inputMapping; + t->outputMapping = outputMapping; + t->ureg = ureg_create( procType ); + if (t->ureg == NULL) + return NULL; - processor = (struct tgsi_processor *) &tokens[2]; - *processor = tgsi_build_processor( procType, header ); + ureg = t->ureg; - ti = 3; + /*_mesa_print_program(program);*/ /* * Declare input attributes. */ if (procType == TGSI_PROCESSOR_FRAGMENT) { for (i = 0; i < numInputs; i++) { - struct tgsi_full_declaration fulldecl; - fulldecl = make_input_decl(i, - GL_TRUE, interpMode[i], - TGSI_WRITEMASK_XYZW, - GL_TRUE, inputSemanticName[i], - inputSemanticIndex[i], - inputFlags[i]); - ti += tgsi_build_full_declaration(&fulldecl, - &tokens[ti], - header, - maxTokens - ti ); + t->inputs[i] = ureg_DECL_fs_input(ureg, + inputSemanticName[i], + inputSemanticIndex[i], + interpMode[i]); } - } - else { - /* vertex prog */ - /* XXX: this could probaby be merged with the clause above. - * the only difference is the semantic tags. - */ - for (i = 0; i < numInputs; i++) { - struct tgsi_full_declaration fulldecl; - fulldecl = make_input_decl(i, - GL_FALSE, 0, - TGSI_WRITEMASK_XYZW, - GL_FALSE, 0, 0, - inputFlags[i]); - ti += tgsi_build_full_declaration(&fulldecl, - &tokens[ti], - header, - maxTokens - ti ); + + if (program->InputsRead & FRAG_BIT_WPOS) { + /* Must do this after setting up t->inputs, and before + * emitting constant references, below: + */ + emit_inverted_wpos( t, program ); } - } - /* - * Declare output attributes. - */ - if (procType == TGSI_PROCESSOR_FRAGMENT) { + /* + * Declare output attributes. + */ for (i = 0; i < numOutputs; i++) { - struct tgsi_full_declaration fulldecl; switch (outputSemanticName[i]) { case TGSI_SEMANTIC_POSITION: - fulldecl = make_output_decl(i, - TGSI_SEMANTIC_POSITION, /* Z / Depth */ - outputSemanticIndex[i], - TGSI_WRITEMASK_Z, - outputFlags[i]); + t->outputs[i] = ureg_DECL_output( ureg, + TGSI_SEMANTIC_POSITION, /* Z / Depth */ + outputSemanticIndex[i] ); + + t->outputs[i] = ureg_writemask( t->outputs[i], + TGSI_WRITEMASK_Z ); break; case TGSI_SEMANTIC_COLOR: - fulldecl = make_output_decl(i, - TGSI_SEMANTIC_COLOR, - outputSemanticIndex[i], - TGSI_WRITEMASK_XYZW, - outputFlags[i]); + t->outputs[i] = ureg_DECL_output( ureg, + TGSI_SEMANTIC_COLOR, + outputSemanticIndex[i] ); break; default: - assert(0); + debug_assert(0); return 0; } - ti += tgsi_build_full_declaration(&fulldecl, - &tokens[ti], - header, - maxTokens - ti ); } } else { - /* vertex prog */ - for (i = 0; i < numOutputs; i++) { - struct tgsi_full_declaration fulldecl; - fulldecl = make_output_decl(i, - outputSemanticName[i], - outputSemanticIndex[i], - TGSI_WRITEMASK_XYZW, - outputFlags[i]); - ti += tgsi_build_full_declaration(&fulldecl, - &tokens[ti], - header, - maxTokens - ti ); + for (i = 0; i < numInputs; i++) { + t->inputs[i] = ureg_DECL_vs_input(ureg, i); } - } - /* temporary decls */ - { - GLboolean inside_range = GL_FALSE; - GLuint start_range = 0; - - tempsUsed[MAX_PROGRAM_TEMPS] = GL_FALSE; - for (i = 0; i < MAX_PROGRAM_TEMPS + 1; i++) { - if (tempsUsed[i] && !inside_range) { - inside_range = GL_TRUE; - start_range = i; - } - else if (!tempsUsed[i] && inside_range) { - struct tgsi_full_declaration fulldecl; - - inside_range = GL_FALSE; - fulldecl = make_temp_decl( start_range, i - 1 ); - ti += tgsi_build_full_declaration( - &fulldecl, - &tokens[ti], - header, - maxTokens - ti ); - } + for (i = 0; i < numOutputs; i++) { + t->outputs[i] = ureg_DECL_output( ureg, + outputSemanticName[i], + outputSemanticIndex[i] ); } } /* Declare address register. - */ + */ if (program->NumAddressRegs > 0) { - struct tgsi_full_declaration fulldecl; - - assert( program->NumAddressRegs == 1 ); - - fulldecl = make_addr_decl( 0, 0 ); - ti += tgsi_build_full_declaration( - &fulldecl, - &tokens[ti], - header, - maxTokens - ti ); - - indirectAccess = GL_TRUE; + debug_assert( program->NumAddressRegs == 1 ); + t->address[0] = ureg_DECL_address( ureg ); } - /* immediates/literals */ - memset(immediates, ~0, sizeof(immediates)); - /* Emit immediates only when there is no address register in use. - * FIXME: Be smarter and recognize param arrays -- indirect addressing is - * only valid within the referenced array. + /* Emit constants and immediates. Mesa uses a single index space + * for these, so we put all the translated regs in t->constants. */ - if (program->Parameters && !indirectAccess) { - for (i = 0; i < program->Parameters->NumParameters; i++) { - if (program->Parameters->Parameters[i].Type == PROGRAM_CONSTANT) { - struct tgsi_full_immediate fullimm; - - fullimm = make_immediate( program->Parameters->ParameterValues[i], 4 ); - ti += tgsi_build_full_immediate( - &fullimm, - &tokens[ti], - header, - maxTokens - ti ); - immediates[i] = numImmediates; - numImmediates++; - } - } - } - - /* constant buffer refs */ if (program->Parameters) { - GLint start = -1, end = -1; - + + t->constants = CALLOC( program->Parameters->NumParameters, + sizeof t->constants[0] ); + if (t->constants == NULL) + goto out; + for (i = 0; i < program->Parameters->NumParameters; i++) { - GLboolean emit = (i == program->Parameters->NumParameters - 1); - GLboolean matches; - switch (program->Parameters->Parameters[i].Type) { case PROGRAM_ENV_PARAM: case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: case PROGRAM_UNIFORM: - matches = GL_TRUE; + t->constants[i] = ureg_DECL_constant( ureg, i ); break; + + /* Emit immediates only when there is no address register + * in use. FIXME: Be smarter and recognize param arrays: + * indirect addressing is only valid within the referenced + * array. + */ case PROGRAM_CONSTANT: - matches = indirectAccess; + if (program->NumAddressRegs > 0) + t->constants[i] = ureg_DECL_constant( ureg, i ); + else + t->constants[i] = + ureg_DECL_immediate( ureg, + program->Parameters->ParameterValues[i], + 4 ); break; default: - matches = GL_FALSE; - } - - if (matches) { - if (start == -1) { - /* begin a sequence */ - start = i; - end = i; - } - else { - /* continue sequence */ - end = i; - } - } - else { - if (start != -1) { - /* end of sequence */ - emit = GL_TRUE; - } - } - - if (emit && start >= 0) { - struct tgsi_full_declaration fulldecl; - - fulldecl = make_constant_decl( start, end ); - ti += tgsi_build_full_declaration( - &fulldecl, - &tokens[ti], - header, - maxTokens - ti ); - start = end = -1; + break; } } } @@ -1145,58 +829,55 @@ st_translate_mesa_program( /* texture samplers */ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { if (program->SamplersUsed & (1 << i)) { - struct tgsi_full_declaration fulldecl; - - fulldecl = make_sampler_decl( i ); - ti += tgsi_build_full_declaration( - &fulldecl, - &tokens[ti], - header, - maxTokens - ti ); + t->samplers[i] = ureg_DECL_sampler( ureg, i ); } } - /* invert WPOS fragment input */ - if (wposTemp >= 0) { - ti += emit_inverted_wpos(&tokens[ti], wposTemp, winHeightConst, - inputMapping[FRAG_ATTRIB_WPOS], - header, maxTokens - ti); - preamble_size = 2; /* two instructions added */ + /* Emit each instruction in turn: + */ + for (i = 0; i < program->NumInstructions; i++) { + set_insn_start( t, ureg_get_instruction_number( ureg )); + compile_instruction( t, &program->Instructions[i] ); } - for (i = 0; i < program->NumInstructions; i++) { - struct tgsi_full_instruction fullinst; - - compile_instruction( - &program->Instructions[i], - &fullinst, - inputMapping, - outputMapping, - immediates, - indirectAccess, - preamble_size, - procType, - &insideSubroutine, - wposTemp); - - ti += tgsi_build_full_instruction( - &fullinst, - &tokens[ti], - header, - maxTokens - ti ); + /* Fix up all emitted labels: + */ + for (i = 0; i < t->labels_count; i++) { + ureg_fixup_label( ureg, + t->labels[i].token, + t->insn[t->labels[i].branch_target] ); } -#if DEBUG - if(!tgsi_sanity_check(tokens)) { - debug_printf("Due to sanity check failure(s) above the following shader program is invalid:\n"); - debug_printf("\nOriginal program:\n%s", program->String); - debug_printf("\nMesa program:\n"); + tokens = ureg_get_tokens( ureg, NULL ); + ureg_destroy( ureg ); + +out: + FREE(t->insn); + FREE(t->labels); + FREE(t->constants); + + if (t->error) { + debug_printf("%s: translate error flag set\n", __FUNCTION__); + FREE((void *)tokens); + tokens = NULL; + } + + if (!tokens) { + debug_printf("%s: failed to translate Mesa program:\n", __FUNCTION__); _mesa_print_program(program); - debug_printf("\nTGSI program:\n"); - tgsi_dump(tokens, 0); - assert(0); + debug_assert(0); } -#endif - return ti; + return tokens; +} + + +/** + * Tokens cannot be free with _mesa_free otherwise the builtin gallium + * malloc debugging will get confused. + */ +void +st_free_tokens(const struct tgsi_token *tokens) +{ + FREE((void *)tokens); } diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index b465b3bddc..c0d1ff59e1 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -39,7 +39,7 @@ extern "C" { struct tgsi_token; struct gl_program; -GLuint +const struct tgsi_token * st_translate_mesa_program( GLcontext *ctx, uint procType, @@ -54,9 +54,10 @@ st_translate_mesa_program( const GLuint outputMapping[], const ubyte outputSemanticName[], const ubyte outputSemanticIndex[], - const GLbitfield outputFlags[], - struct tgsi_token *tokens, - GLuint maxTokens ); + const GLbitfield outputFlags[] ); + +void +st_free_tokens(const struct tgsi_token *tokens); #if defined __cplusplus diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index d2da20ae42..a9be80ce8f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -42,6 +42,7 @@ #include "draw/draw_context.h" #include "tgsi/tgsi_dump.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_program.h" @@ -49,12 +50,6 @@ #include "cso_cache/cso_context.h" -#define ST_MAX_SHADER_TOKENS (8 * 1024) - - -#define TGSI_DEBUG 0 - - /** * Translate a Mesa vertex shader into a TGSI shader. * \param outputMapping to map vertex program output registers (VERT_RESULT_x) @@ -70,12 +65,9 @@ st_translate_vertex_program(struct st_context *st, const ubyte *outputSemanticIndex) { struct pipe_context *pipe = st->pipe; - struct tgsi_token *tokens; GLuint defaultOutputMapping[VERT_RESULT_MAX]; - struct pipe_shader_state vs; GLuint attr, i; GLuint num_generic = 0; - GLuint num_tokens; ubyte vs_input_semantic_name[PIPE_MAX_SHADER_INPUTS]; ubyte vs_input_semantic_index[PIPE_MAX_SHADER_INPUTS]; @@ -88,14 +80,7 @@ st_translate_vertex_program(struct st_context *st, GLbitfield input_flags[MAX_PROGRAM_INPUTS]; GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; - tokens = (struct tgsi_token *)MALLOC(ST_MAX_SHADER_TOKENS * sizeof *tokens); - if(!tokens) { - /* FIXME: propagate error to the caller */ - assert(0); - return; - } - - memset(&vs, 0, sizeof(vs)); +// memset(&vs, 0, sizeof(vs)); memset(input_flags, 0, sizeof(input_flags)); memset(output_flags, 0, sizeof(output_flags)); @@ -330,7 +315,7 @@ st_translate_vertex_program(struct st_context *st, /* free old shader state, if any */ if (stvp->state.tokens) { - _mesa_free((void *) stvp->state.tokens); + st_free_tokens(stvp->state.tokens); stvp->state.tokens = NULL; } if (stvp->driver_shader) { @@ -338,43 +323,36 @@ st_translate_vertex_program(struct st_context *st, stvp->driver_shader = NULL; } - /* XXX: fix static allocation of tokens: - */ - num_tokens = st_translate_mesa_program(st->ctx, - TGSI_PROCESSOR_VERTEX, - &stvp->Base.Base, - /* inputs */ - vs_num_inputs, - stvp->input_to_index, - vs_input_semantic_name, - vs_input_semantic_index, - NULL, - input_flags, - /* outputs */ - vs_num_outputs, - outputMapping, - vs_output_semantic_name, - vs_output_semantic_index, - output_flags, - /* tokenized result */ - tokens, ST_MAX_SHADER_TOKENS); - - assert(num_tokens < ST_MAX_SHADER_TOKENS); - - vs.tokens = (struct tgsi_token *) - _mesa_realloc(tokens, - ST_MAX_SHADER_TOKENS * sizeof *tokens, - num_tokens * sizeof *tokens); + stvp->state.tokens = + st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_VERTEX, + &stvp->Base.Base, + /* inputs */ + vs_num_inputs, + stvp->input_to_index, + vs_input_semantic_name, + vs_input_semantic_index, + NULL, + input_flags, + /* outputs */ + vs_num_outputs, + outputMapping, + vs_output_semantic_name, + vs_output_semantic_index, + output_flags ); stvp->num_inputs = vs_num_inputs; - stvp->state = vs; /* struct copy */ - stvp->driver_shader = pipe->create_vs_state(pipe, &vs); + stvp->driver_shader = pipe->create_vs_state(pipe, &stvp->state); - if (0) + if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stvp->Base.Base); + debug_printf("\n"); + } - if (TGSI_DEBUG) - tgsi_dump( vs.tokens, 0 ); + if (ST_DEBUG & DEBUG_TGSI) { + tgsi_dump( stvp->state.tokens, 0 ); + debug_printf("\n"); + } } @@ -383,7 +361,6 @@ st_translate_vertex_program(struct st_context *st, * Translate a Mesa fragment shader into a TGSI shader. * \param inputMapping to map fragment program input registers to TGSI * input slots - * \param tokensOut destination for TGSI tokens * \return pointer to cached pipe_shader object. */ void @@ -392,16 +369,13 @@ st_translate_fragment_program(struct st_context *st, const GLuint inputMapping[]) { struct pipe_context *pipe = st->pipe; - struct tgsi_token *tokens; GLuint outputMapping[FRAG_RESULT_MAX]; GLuint defaultInputMapping[FRAG_ATTRIB_MAX]; - struct pipe_shader_state fs; GLuint interpMode[16]; /* XXX size? */ GLuint attr; const GLbitfield inputsRead = stfp->Base.Base.InputsRead; GLuint vslot = 0; GLuint num_generic = 0; - GLuint num_tokens; uint fs_num_inputs = 0; @@ -412,14 +386,7 @@ st_translate_fragment_program(struct st_context *st, GLbitfield input_flags[MAX_PROGRAM_INPUTS]; GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; - tokens = (struct tgsi_token *)MALLOC(ST_MAX_SHADER_TOKENS * sizeof *tokens); - if(!tokens) { - /* FIXME: propagate error to the caller */ - assert(0); - return; - } - - memset(&fs, 0, sizeof(fs)); +// memset(&fs, 0, sizeof(fs)); memset(input_flags, 0, sizeof(input_flags)); memset(output_flags, 0, sizeof(output_flags)); @@ -541,42 +508,35 @@ st_translate_fragment_program(struct st_context *st, if (!inputMapping) inputMapping = defaultInputMapping; - /* XXX: fix static allocation of tokens: - */ - num_tokens = st_translate_mesa_program(st->ctx, - TGSI_PROCESSOR_FRAGMENT, - &stfp->Base.Base, - /* inputs */ - fs_num_inputs, - inputMapping, - stfp->input_semantic_name, - stfp->input_semantic_index, - interpMode, - input_flags, - /* outputs */ - fs_num_outputs, - outputMapping, - fs_output_semantic_name, - fs_output_semantic_index, - output_flags, - /* tokenized result */ - tokens, ST_MAX_SHADER_TOKENS); - - assert(num_tokens < ST_MAX_SHADER_TOKENS); - - fs.tokens = (struct tgsi_token *) - _mesa_realloc(tokens, - ST_MAX_SHADER_TOKENS * sizeof *tokens, - num_tokens * sizeof *tokens); - - stfp->state = fs; /* struct copy */ - stfp->driver_shader = pipe->create_fs_state(pipe, &fs); - - if (0) + stfp->state.tokens = + st_translate_mesa_program(st->ctx, + TGSI_PROCESSOR_FRAGMENT, + &stfp->Base.Base, + /* inputs */ + fs_num_inputs, + inputMapping, + stfp->input_semantic_name, + stfp->input_semantic_index, + interpMode, + input_flags, + /* outputs */ + fs_num_outputs, + outputMapping, + fs_output_semantic_name, + fs_output_semantic_index, + output_flags ); + + stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->state); + + if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stfp->Base.Base); + debug_printf("\n"); + } - if (TGSI_DEBUG) - tgsi_dump( fs.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); + if (ST_DEBUG & DEBUG_TGSI) { + tgsi_dump( stfp->state.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); + debug_printf("\n"); + } } diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index bbc2830e69..ba8d1e8cc1 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -577,7 +577,6 @@ st_teximage_flush_before_map(struct st_context *st, pipe->is_texture_referenced(pipe, pt, face, level); if (referenced && ((referenced & PIPE_REFERENCED_FOR_WRITE) || - usage == PIPE_TRANSFER_WRITE || - usage == PIPE_TRANSFER_READ_WRITE)) + (usage & PIPE_TRANSFER_WRITE))) st_flush(st, PIPE_FLUSH_RENDER_CACHE, NULL); } diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 7086cae0c8..17e00dda4f 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -497,6 +497,33 @@ depth_test_span32( GLcontext *ctx, GLuint n, return passed; } +/* Apply ARB_depth_clamp to span of fragments. */ +void +_swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ) +{ + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->_DepthBuffer; + const GLuint count = span->end; + GLuint *zValues = span->array->z; + GLuint near, far; + int i; + + if (rb->DataType == GL_UNSIGNED_SHORT) { + near = FLOAT_TO_UINT(ctx->Viewport.Near); + far = FLOAT_TO_UINT(ctx->Viewport.Far); + } else { + assert(rb->DataType == GL_UNSIGNED_INT); + CLAMPED_FLOAT_TO_USHORT(near, ctx->Viewport.Near); + CLAMPED_FLOAT_TO_USHORT(far, ctx->Viewport.Far); + } + for (i = 0; i < count; i++) { + if (zValues[i] < near) + zValues[i] = near; + if (zValues[i] > far) + zValues[i] = far; + } +} + /* diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h index 3688625683..7eae366742 100644 --- a/src/mesa/swrast/s_depth.h +++ b/src/mesa/swrast/s_depth.h @@ -33,6 +33,8 @@ extern GLuint _swrast_depth_test_span( GLcontext *ctx, SWspan *span); +extern void +_swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ); extern GLboolean _swrast_depth_bounds_test( GLcontext *ctx, SWspan *span ); diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c deleted file mode 100644 index 3578b713f6..0000000000 --- a/src/mesa/swrast/s_imaging.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - -/* KW: Moved these here to remove knowledge of swrast from core mesa. - * Should probably pull the entire software implementation of these - * extensions into either swrast or a sister module. - */ - -#include "main/glheader.h" -#include "main/colortab.h" -#include "main/convolve.h" -#include "s_context.h" -#include "s_span.h" - - -void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, rgba ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - /* store as convolution filter */ - _mesa_ConvolutionFilter1D(target, internalFormat, width, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - struct gl_pixelstore_attrib packSave; - GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4]; - GLint i; - struct gl_buffer_object *bufferSave; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - swrast_render_start(ctx); - - /* read pixels from framebuffer */ - for (i = 0; i < height; i++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y + i, CHAN_TYPE, rgba[i] ); - } - - swrast_render_finish(ctx); - - /* - * HACK: save & restore context state so we can store this as a - * convolution filter via the GL api. Doesn't call any callbacks - * hanging off ctx->Unpack statechanges. - */ - - packSave = ctx->Unpack; /* save pixel packing params */ - - ctx->Unpack.Alignment = 1; - ctx->Unpack.RowLength = MAX_CONVOLUTION_WIDTH; - ctx->Unpack.SkipPixels = 0; - ctx->Unpack.SkipRows = 0; - ctx->Unpack.ImageHeight = 0; - ctx->Unpack.SkipImages = 0; - ctx->Unpack.SwapBytes = GL_FALSE; - ctx->Unpack.LsbFirst = GL_FALSE; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - ctx->NewState |= _NEW_PACKUNPACK; - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ConvolutionFilter2D(target, internalFormat, width, height, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; - - ctx->Unpack = packSave; /* restore pixel packing params */ - ctx->NewState |= _NEW_PACKUNPACK; -} diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 48b9408d24..a1aeb2e01f 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -555,15 +555,15 @@ _swrast_ReadPixels( GLcontext *ctx, SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_pixelstore_attrib clippedPacking = *packing; + if (ctx->NewState) + _mesa_update_state(ctx); + /* Need to do swrast_render_start() before clipping or anything else * since this is where a driver may grab the hw lock and get an updated * window size. */ swrast_render_start(ctx); - if (ctx->NewState) - _mesa_update_state(ctx); - if (swrast->NewState) _swrast_validate_derived( ctx ); diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 0e2793b474..704230d1d7 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -880,6 +880,9 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) stipple_polygon_span(ctx, span); } + if (ctx->Transform.DepthClamp) + _swrast_depth_clamp_span(ctx, span); + /* Stencil and Z testing */ if (ctx->Stencil._Enabled || ctx->Depth.Test) { if (!(span->arrayMask & SPAN_Z)) @@ -901,7 +904,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; @@ -909,7 +911,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) for (i = 0; i < span->end; i++) q->Result += span->array->mask[i]; } -#endif /* we have to wait until after occlusion to do this test */ if (ctx->Color.IndexMask == 0) { @@ -1373,7 +1374,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; @@ -1381,7 +1381,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) for (i = 0; i < span->end; i++) q->Result += span->array->mask[i]; } -#endif /* We had to wait until now to check for glColorMask(0,0,0,0) because of * the occlusion test. diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index efe6f23474..004d4e05ae 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1905,8 +1905,12 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - newCoord[0] = ( sc / ma + 1.0F ) * 0.5F; - newCoord[1] = ( tc / ma + 1.0F ) * 0.5F; + { + const float ima = 1.0F / ma; + newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; + newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; + } + return (const struct gl_texture_image **) texObj->Image[face]; } diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c deleted file mode 100644 index f9ff9ad6a4..0000000000 --- a/src/mesa/swrast/s_texstore.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 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. - */ - -/* - * Authors: - * Brian Paul - */ - - -/* - * The functions in this file are mostly related to software texture fallbacks. - * This includes texture image transfer/packing and texel fetching. - * Hardware drivers will likely override most of this. - */ - - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/convolve.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/mipmap.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "main/texstore.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_span.h" - - -/** - * Read an RGBA image from the frame buffer. - * This is used by glCopyTex[Sub]Image[12]D(). - * \param x window source x - * \param y window source y - * \param width image width - * \param height image height - * \param type datatype for returned GL_RGBA image - * \return pointer to image - */ -static GLvoid * -read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type); - const GLint stride = width * pixelSize; - GLint row; - GLubyte *image, *dst; - - image = (GLubyte *) _mesa_malloc(width * height * pixelSize); - if (!image) - return NULL; - - swrast_render_start(ctx); - - dst = image; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst); - dst += stride; - } - - swrast_render_finish(ctx); - - return image; -} - - -/** - * As above, but read data from depth buffer. Returned as GLuints. - * \sa read_color_image - */ -static GLuint * -read_depth_image( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer; - GLuint *image, *dst; - GLint i; - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - swrast_render_start(ctx); - - dst = image; - for (i = 0; i < height; i++) { - _swrast_read_depth_span_uint(ctx, rb, width, x, y + i, dst); - dst += width; - } - - swrast_render_finish(ctx); - - return image; -} - - -/** - * As above, but read data from depth+stencil buffers. - */ -static GLuint * -read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height) -{ - struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer; - GLuint *image, *dst; - GLint i; - - ASSERT(depthRb); - ASSERT(stencilRb); - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - swrast_render_start(ctx); - - /* read from depth buffer */ - dst = image; - if (depthRb->DataType == GL_UNSIGNED_INT) { - for (i = 0; i < height; i++) { - _swrast_get_row(ctx, depthRb, width, x, y + i, dst, sizeof(GLuint)); - dst += width; - } - } - else { - GLushort z16[MAX_WIDTH]; - ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < height; i++) { - GLint j; - _swrast_get_row(ctx, depthRb, width, x, y + i, z16, sizeof(GLushort)); - /* convert GLushorts to GLuints */ - for (j = 0; j < width; j++) { - dst[j] = z16[j]; - } - dst += width; - } - } - - /* put depth values into bits 0xffffff00 */ - if (ctx->ReadBuffer->Visual.depthBits == 24) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] <<= 8; - } - } - else if (ctx->ReadBuffer->Visual.depthBits == 16) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] = (image[j] << 16) | (image[j] & 0xff00); - } - } - else { - /* this handles arbitrary depthBits >= 12 */ - const GLint rShift = ctx->ReadBuffer->Visual.depthBits; - const GLint lShift = 32 - rShift; - GLint j; - for (j = 0; j < width * height; j++) { - GLuint z = (image[j] << lShift); - image[j] = z | (z >> rShift); - } - } - - /* read stencil values and interleave into image array */ - dst = image; - for (i = 0; i < height; i++) { - GLstencil stencil[MAX_WIDTH]; - GLint j; - ASSERT(8 * sizeof(GLstencil) == stencilRb->StencilBits); - _swrast_get_row(ctx, stencilRb, width, x, y + i, - stencil, sizeof(GLstencil)); - for (j = 0; j < width; j++) { - dst[j] = (dst[j] & 0xffffff00) | (stencil[j] & 0xff); - } - dst += width; - } - - swrast_render_finish(ctx); - - return image; -} - - -static GLboolean -is_depth_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean -is_depth_stencil_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/* - * Fallback for Driver.CopyTexImage1D(). - */ -void -_swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/** - * Fallback for Driver.CopyTexImage2D(). - * - * We implement CopyTexImage by reading the image from the framebuffer - * then passing it to the ctx->Driver.TexImage2D() function. - * - * Device drivers should try to implement direct framebuffer->texture copies. - */ -void -_swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage1D(). - */ -void -_swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - - /* call glTexSubImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" ); - return; - } - /* now call glTexSubImage1D to do the real work */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/** - * Fallback for Driver.CopyTexSubImage2D(). - * - * Read the image from the framebuffer then hand it - * off to ctx->Driver.TexSubImage2D(). - */ -void -_swrast_copy_texsubimage2d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" ); - return; - } - /* now call glTexSubImage2D to do the real work */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage3D(). - */ -void -_swrast_copy_texsubimage3d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage3D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" ); - return; - } - /* now call glTexSubImage3D to do the real work */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } -} diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index c319ca62f9..c183b315b6 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -207,60 +207,6 @@ extern void _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ); -/* - * Imaging fallbacks (a better solution should be found, perhaps - * moving all the imaging fallback code to a new module) - */ -extern void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, - GLsizei height); -extern void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); - - -/* - * Texture fallbacks. Could also live in a new module - * with the rest of the texture store fallbacks? - */ -extern void -_swrast_copy_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border); - -extern void -_swrast_copy_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border); - - -extern void -_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width); - -extern void -_swrast_copy_texsubimage2d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - -extern void -_swrast_copy_texsubimage3d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - extern void _swrast_eject_texture_images(GLcontext *ctx); diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index c19eb3df3c..ca4edcfcb9 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -207,6 +207,7 @@ struct vertex_buffer GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ GLvector4f *NdcPtr; /* _TNL_BIT_POS */ + GLfloat *ClipDistancePtr[MAX_CLIP_PLANES]; /* _TNL_BIT_POS */ GLubyte ClipOrMask; /* _TNL_BIT_POS */ GLubyte ClipAndMask; /* _TNL_BIT_POS */ GLubyte *ClipMask; /* _TNL_BIT_POS */ @@ -548,4 +549,8 @@ typedef struct #define MAX_TYPES TYPE_IDX(GL_DOUBLE)+1 /* 0xa + 1 */ +extern void +tnl_clip_prepare(GLcontext *ctx); + + #endif diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index c64c2c2077..04fa106300 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -316,22 +316,27 @@ static void bind_indices( GLcontext *ctx, ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); - if (ib->type == GL_UNSIGNED_INT) { + if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) { VB->Elts = (GLuint *) ptr; } else { GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint)); VB->Elts = elts; - if (ib->type == GL_UNSIGNED_SHORT) { + if (ib->type == GL_UNSIGNED_INT) { + const GLuint *in = (GLuint *)ptr; + for (i = 0; i < ib->count; i++) + *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; + } + else if (ib->type == GL_UNSIGNED_SHORT) { const GLushort *in = (GLushort *)ptr; for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++); + *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; } else { const GLubyte *in = (GLubyte *)ptr; for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++); + *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; } } } @@ -390,10 +395,14 @@ void _tnl_draw_prims( GLcontext *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); const GLuint TEST_SPLIT = 0; const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES; + GLuint max_basevertex = prim->basevertex; + GLuint i; + + for (i = 1; i < nr_prims; i++) + max_basevertex = MAX2(max_basevertex, prim[i].basevertex); if (0) { - GLuint i; _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); for (i = 0; i < nr_prims; i++) _mesa_printf("prim %d: %s start %d count %d\n", i, @@ -410,7 +419,7 @@ void _tnl_draw_prims( GLcontext *ctx, _tnl_vbo_draw_prims ); return; } - else if (max_index > max) { + else if (max_index + max_basevertex > max) { /* The software TNL pipeline has a fixed amount of storage for * vertices and it is necessary to split incoming drawing commands * if they exceed that limit. @@ -424,7 +433,7 @@ void _tnl_draw_prims( GLcontext *ctx, * recursively call back into this function. */ vbo_split_prims( ctx, arrays, prim, nr_prims, ib, - 0, max_index, + 0, max_index + prim->basevertex, _tnl_vbo_draw_prims, &limits ); } @@ -435,17 +444,34 @@ void _tnl_draw_prims( GLcontext *ctx, struct gl_buffer_object *bo[VERT_ATTRIB_MAX + 1]; GLuint nr_bo = 0; - /* Binding inputs may imply mapping some vertex buffer objects. - * They will need to be unmapped below. - */ - bind_inputs(ctx, arrays, max_index+1, bo, &nr_bo); - bind_indices(ctx, ib, bo, &nr_bo); - bind_prims(ctx, prim, nr_prims ); + for (i = 0; i < nr_prims;) { + GLuint this_nr_prims; + + /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices + * will rebase the elements to the basevertex, and we'll only + * emit strings of prims with the same basevertex in one draw call. + */ + for (this_nr_prims = 1; i + this_nr_prims < nr_prims; + this_nr_prims++) { + if (prim[i].basevertex != prim[i + this_nr_prims].basevertex) + break; + } + + /* Binding inputs may imply mapping some vertex buffer objects. + * They will need to be unmapped below. + */ + bind_prims(ctx, &prim[i], this_nr_prims); + bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1, + bo, &nr_bo); + bind_indices(ctx, ib, bo, &nr_bo); - TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx); + TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx); - unmap_vbos(ctx, bo, nr_bo); - free_space(ctx); + unmap_vbos(ctx, bo, nr_bo); + free_space(ctx); + + i += this_nr_prims; + } } } diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c index f1fdddf0f5..99b6787455 100644 --- a/src/mesa/tnl/t_rasterpos.c +++ b/src/mesa/tnl/t_rasterpos.c @@ -46,11 +46,10 @@ * \return zero if outside view volume, or one if inside. */ static GLuint -viewclip_point( const GLfloat v[] ) +viewclip_point_xy( const GLfloat v[] ) { if ( v[0] > v[3] || v[0] < -v[3] - || v[1] > v[3] || v[1] < -v[3] - || v[2] > v[3] || v[2] < -v[3] ) { + || v[1] > v[3] || v[1] < -v[3] ) { return 0; } else { @@ -408,18 +407,18 @@ _tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) /* apply projection matrix: clip = Proj * eye */ TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye ); - /* clip to view volume */ - if (ctx->Transform.RasterPositionUnclipped) { - /* GL_IBM_rasterpos_clip: only clip against Z */ + /* clip to view volume. */ + if (!ctx->Transform.DepthClamp) { if (viewclip_point_z(clip) == 0) { ctx->Current.RasterPosValid = GL_FALSE; return; } } - else if (viewclip_point(clip) == 0) { - /* Normal OpenGL behaviour */ - ctx->Current.RasterPosValid = GL_FALSE; - return; + if (!ctx->Transform.RasterPositionUnclipped) { + if (viewclip_point_xy(clip) == 0) { + ctx->Current.RasterPosValid = GL_FALSE; + return; + } } /* clip to user clipping planes */ @@ -443,6 +442,12 @@ _tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) / ctx->DrawBuffer->_DepthMaxF; ctx->Current.RasterPos[3] = clip[3]; + if (ctx->Transform.DepthClamp) { + ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3], + ctx->Viewport.Near, + ctx->Viewport.Far); + } + /* compute raster distance */ if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0]; diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 618b8b3130..0d2183a9e6 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -80,6 +80,58 @@ do { \ } while (0) +#define POLY_USERCLIP(PLANE) \ +do { \ + if (mask & CLIP_USER_BIT) { \ + GLuint idxPrev = inlist[0]; \ + GLfloat dpPrev = VB->ClipDistancePtr[PLANE][idxPrev]; \ + GLuint outcount = 0; \ + GLuint i; \ + \ + inlist[n] = inlist[0]; /* prevent rotation of vertices */ \ + for (i = 1; i <= n; i++) { \ + GLuint idx = inlist[i]; \ + GLfloat dp = VB->ClipDistancePtr[PLANE][idx]; \ + \ + if (!IS_NEGATIVE(dpPrev)) { \ + outlist[outcount++] = idxPrev; \ + } \ + \ + if (DIFFERENT_SIGNS(dp, dpPrev)) { \ + if (IS_NEGATIVE(dp)) { \ + /* Going out of bounds. Avoid division by zero as we \ + * know dp != dpPrev from DIFFERENT_SIGNS, above. \ + */ \ + GLfloat t = dp / (dp - dpPrev); \ + INTERP_4F( t, coord[newvert], coord[idx], coord[idxPrev]); \ + interp( ctx, t, newvert, idx, idxPrev, GL_TRUE ); \ + } else { \ + /* Coming back in. \ + */ \ + GLfloat t = dpPrev / (dpPrev - dp); \ + INTERP_4F( t, coord[newvert], coord[idxPrev], coord[idx]); \ + interp( ctx, t, newvert, idxPrev, idx, GL_FALSE ); \ + } \ + outlist[outcount++] = newvert++; \ + } \ + \ + idxPrev = idx; \ + dpPrev = dp; \ + } \ + \ + if (outcount < 3) \ + return; \ + \ + { \ + GLuint *tmp = inlist; \ + inlist = outlist; \ + outlist = tmp; \ + n = outcount; \ + } \ + } \ +} while (0) + + #define LINE_CLIP(PLANE_BIT, A, B, C, D ) \ do { \ if (mask & PLANE_BIT) { \ @@ -111,6 +163,37 @@ do { \ } while (0) +#define LINE_USERCLIP(PLANE) \ +do { \ + if (mask & CLIP_USER_BIT) { \ + const GLfloat dp0 = VB->ClipDistancePtr[PLANE][v0]; \ + const GLfloat dp1 = VB->ClipDistancePtr[PLANE][v1]; \ + const GLboolean neg_dp0 = IS_NEGATIVE(dp0); \ + const GLboolean neg_dp1 = IS_NEGATIVE(dp1); \ + \ + /* For regular clipping, we know from the clipmask that one \ + * (or both) of these must be negative (otherwise we wouldn't \ + * be here). \ + * For userclip, there is only a single bit for all active \ + * planes, so we can end up here when there is nothing to do, \ + * hence the second IS_NEGATIVE() test: \ + */ \ + if (neg_dp0 && neg_dp1) \ + return; /* both vertices outside clip plane: discard */ \ + \ + if (neg_dp1) { \ + GLfloat t = dp1 / (dp1 - dp0); \ + if (t > t1) t1 = t; \ + } else if (neg_dp0) { \ + GLfloat t = dp0 / (dp0 - dp1); \ + if (t > t0) t0 = t; \ + } \ + if (t0 + t1 >= 1.0) \ + return; /* discard */ \ + } \ +} while (0) + + /* Clip a line against the viewport and user clip planes. */ @@ -139,11 +222,7 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - LINE_CLIP( CLIP_USER_BIT, a, b, c, d ); + LINE_USERCLIP(p); } } } @@ -228,11 +307,7 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); + POLY_USERCLIP(p); } } } @@ -291,11 +366,7 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); + POLY_USERCLIP(p); } } } @@ -317,4 +388,6 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, #undef SIZE #undef TAG #undef POLY_CLIP +#undef POLY_USERCLIP #undef LINE_CLIP +#undef LINE_USERCLIP diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index dc954bcba1..5fb83c2b01 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -66,6 +66,7 @@ struct vp_stage_data { GLvector4f results[VERT_RESULT_MAX]; GLvector4f ndcCoords; /**< normalized device coords */ + GLfloat *clipdistance[MAX_CLIP_PLANES]; GLubyte *clipmask; /**< clip flags */ GLubyte ormask, andmask; /**< for clipping */ }; @@ -77,6 +78,7 @@ struct vp_stage_data { static void userclip( GLcontext *ctx, GLvector4f *clip, + GLfloat *clipdistance[MAX_CLIP_PLANES], GLubyte *clipmask, GLubyte *clipormask, GLubyte *clipandmask ) @@ -105,6 +107,8 @@ userclip( GLcontext *ctx, clipmask[i] |= CLIP_USER_BIT; } + clipdistance[p][i] = dp; + STRIDE_F(coord, stride); } @@ -131,13 +135,16 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) store->ormask = 0; store->andmask = CLIP_FRUSTUM_BITS; + tnl_clip_prepare(ctx); + if (tnl->NeedNdcCoords) { VB->NdcPtr = _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr, &store->ndcCoords, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } else { VB->NdcPtr = NULL; @@ -145,7 +152,8 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) NULL, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } if (store->andmask) { @@ -160,6 +168,7 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) ctx->VertexProgram.Current->IsPositionInvariant)) { userclip( ctx, VB->ClipPtr, + store->clipdistance, store->clipmask, &store->ormask, &store->andmask ); @@ -167,6 +176,9 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) if (store->andmask) { return GL_FALSE; } + + memcpy(VB->ClipDistancePtr, store->clipdistance, + sizeof(store->clipdistance)); } VB->ClipAndMask = store->andmask; @@ -510,6 +522,10 @@ init_vp(GLcontext *ctx, struct tnl_pipeline_stage *stage) _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 ); store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); + for (i = 0; i < MAX_CLIP_PLANES; i++) + store->clipdistance[i] = + (GLfloat *) ALIGN_MALLOC(sizeof(GLfloat) * size, 32); + return GL_TRUE; } @@ -533,6 +549,9 @@ dtr(struct tnl_pipeline_stage *stage) _mesa_vector4f_free( &store->ndcCoords ); ALIGN_FREE( store->clipmask ); + for (i = 0; i < MAX_CLIP_PLANES; i++) + ALIGN_FREE(store->clipdistance[i]); + FREE( store ); stage->privatePtr = NULL; } diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 30aa7c4086..2a61ff1177 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -44,6 +44,7 @@ struct vertex_stage_data { GLvector4f eye; GLvector4f clip; GLvector4f proj; + GLfloat *clipdistance[MAX_CLIP_PLANES]; GLubyte *clipmask; GLubyte ormask; GLubyte andmask; @@ -56,11 +57,12 @@ struct vertex_stage_data { /* This function implements cliptesting for user-defined clip planes. * The clipping of primitives to these planes is implemented in - * t_render_clip.h. + * t_vp_cliptmp.h. */ #define USER_CLIPTEST(NAME, SZ) \ static void NAME( GLcontext *ctx, \ GLvector4f *clip, \ + GLfloat *clipdistances[MAX_CLIP_PLANES], \ GLubyte *clipmask, \ GLubyte *clipormask, \ GLubyte *clipandmask ) \ @@ -88,6 +90,8 @@ static void NAME( GLcontext *ctx, \ clipmask[i] |= CLIP_USER_BIT; \ } \ \ + clipdistances[p][i] = dp; \ + \ STRIDE_F(coord, stride); \ } \ \ @@ -107,8 +111,9 @@ USER_CLIPTEST(userclip3, 3) USER_CLIPTEST(userclip4, 4) static void (*(usercliptab[5]))( GLcontext *, - GLvector4f *, GLubyte *, - GLubyte *, GLubyte * ) = + GLvector4f *, + GLfloat *[MAX_CLIP_PLANES], + GLubyte *, GLubyte *, GLubyte * ) = { NULL, NULL, @@ -118,6 +123,22 @@ static void (*(usercliptab[5]))( GLcontext *, }; +void +tnl_clip_prepare(GLcontext *ctx) +{ + /* Neither the x86 nor sparc asm cliptest functions have been updated + * for ARB_depth_clamp, so force the C paths. + */ + if (ctx->Transform.DepthClamp) { + static GLboolean c_funcs_installed = GL_FALSE; + if (!c_funcs_installed) { + init_c_cliptest(); + c_funcs_installed = GL_TRUE; + } + } +} + + static GLboolean run_vertex_stage( GLcontext *ctx, struct tnl_pipeline_stage *stage ) @@ -129,6 +150,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx, if (ctx->VertexProgram._Current) return GL_TRUE; + tnl_clip_prepare(ctx); + if (ctx->_NeedEyeCoords) { /* Separate modelview transformation: * Use combined ModelProject to avoid some depth artifacts @@ -173,7 +196,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx, &store->proj, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } else { VB->NdcPtr = NULL; @@ -181,7 +205,8 @@ static GLboolean run_vertex_stage( GLcontext *ctx, NULL, store->clipmask, &store->ormask, - &store->andmask ); + &store->andmask, + !ctx->Transform.DepthClamp ); } if (store->andmask) @@ -194,12 +219,16 @@ static GLboolean run_vertex_stage( GLcontext *ctx, if (ctx->Transform.ClipPlanesEnabled) { usercliptab[VB->ClipPtr->size]( ctx, VB->ClipPtr, + store->clipdistance, store->clipmask, &store->ormask, &store->andmask ); if (store->andmask) return GL_FALSE; + + memcpy(VB->ClipDistancePtr, store->clipdistance, + sizeof(store->clipdistance)); } VB->ClipAndMask = store->andmask; @@ -216,6 +245,7 @@ static GLboolean init_vertex_stage( GLcontext *ctx, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_stage_data *store; GLuint size = VB->Size; + unsigned i; stage->privatePtr = CALLOC(sizeof(*store)); store = VERTEX_STAGE_DATA(stage); @@ -227,8 +257,17 @@ static GLboolean init_vertex_stage( GLcontext *ctx, _mesa_vector4f_alloc( &store->proj, 0, size, 32 ); store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); + for (i = 0; i < MAX_CLIP_PLANES; i++) + store->clipdistance[i] = + (GLfloat *) ALIGN_MALLOC(sizeof(GLfloat) * size, 32); if (!store->clipmask || + !store->clipdistance[0] || + !store->clipdistance[1] || + !store->clipdistance[2] || + !store->clipdistance[3] || + !store->clipdistance[4] || + !store->clipdistance[5] || !store->eye.data || !store->clip.data || !store->proj.data) @@ -242,10 +281,16 @@ static void dtr( struct tnl_pipeline_stage *stage ) struct vertex_stage_data *store = VERTEX_STAGE_DATA(stage); if (store) { + unsigned i; + _mesa_vector4f_free( &store->eye ); _mesa_vector4f_free( &store->clip ); _mesa_vector4f_free( &store->proj ); ALIGN_FREE( store->clipmask ); + + for (i = 0; i < MAX_CLIP_PLANES; i++) + ALIGN_FREE(store->clipdistance[i]); + FREE(store); stage->privatePtr = NULL; stage->run = init_vertex_stage; diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 5986e93576..b24ecfd7cd 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -44,6 +44,7 @@ struct _mesa_prim { GLuint start; GLuint count; + GLint basevertex; }; /* Would like to call this a "vbo_index_buffer", but this would be diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index e0f44892cf..516be0995b 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -161,8 +161,26 @@ void vbo_exec_array_destroy( struct vbo_exec_context *exec ); void vbo_exec_vtx_init( struct vbo_exec_context *exec ); void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ); + +#if FEATURE_beginend + void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ); void vbo_exec_vtx_map( struct vbo_exec_context *exec ); + +#else /* FEATURE_beginend */ + +static INLINE void +vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) +{ +} + +static INLINE void +vbo_exec_vtx_map( struct vbo_exec_context *exec ) +{ +} + +#endif /* FEATURE_beginend */ + void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ); void vbo_exec_eval_update( struct vbo_exec_context *exec ); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 387d4ee3d4..f88df5aac7 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -35,9 +35,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/macros.h" #include "main/vtxfmt.h" -#if FEATURE_dlist #include "main/dlist.h" -#endif +#include "main/eval.h" #include "main/state.h" #include "main/light.h" #include "main/api_arrayelt.h" @@ -58,7 +57,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. static void reset_attrfv( struct vbo_exec_context *exec ); -/* Close off the last primitive, execute the buffer, restart the +/** + * Close off the last primitive, execute the buffer, restart the * primitive. */ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) @@ -107,7 +107,8 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) } -/* Deal with buffer wrapping where provoked by the vertex buffer +/** + * Deal with buffer wrapping where provoked by the vertex buffer * filling up, as opposed to upgrade_vertex(). */ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) @@ -136,7 +137,7 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) } -/* +/** * Copy the active vertex's values to the ctx->Current fields. */ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) @@ -209,7 +210,8 @@ static void vbo_exec_copy_from_current( struct vbo_exec_context *exec ) } -/* Flush existing data, set new attrib size, replay copied vertices. +/** + * Flush existing data, set new attrib size, replay copied vertices. */ static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec, GLuint attr, @@ -349,7 +351,7 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx, } - +#if FEATURE_beginend /* */ @@ -392,8 +394,8 @@ do { \ -/* Eval - */ +#if FEATURE_evaluators + static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) { GET_CURRENT_CONTEXT( ctx ); @@ -485,9 +487,15 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) vbo_exec_EvalCoord2f( u, v ); } +/* use noop eval mesh */ +#define vbo_exec_EvalMesh1 _mesa_noop_EvalMesh1 +#define vbo_exec_EvalMesh2 _mesa_noop_EvalMesh2 + +#endif /* FEATURE_evaluators */ -/* Build a list of primitives on the fly. Keep - * ctx->Driver.CurrentExecPrimitive uptodate as well. + +/** + * Called via glBegin. */ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) { @@ -531,6 +539,10 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) } + +/** + * Called via glEnd. + */ static void GLAPIENTRY vbo_exec_End( void ) { GET_CURRENT_CONTEXT( ctx ); @@ -557,24 +569,15 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) { GLvertexformat *vfmt = &exec->vtxfmt; - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = vbo_exec_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif vfmt->End = vbo_exec_End; - vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; - vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; - vfmt->EvalCoord2f = vbo_exec_EvalCoord2f; - vfmt->EvalCoord2fv = vbo_exec_EvalCoord2fv; - vfmt->EvalPoint1 = vbo_exec_EvalPoint1; - vfmt->EvalPoint2 = vbo_exec_EvalPoint2; - vfmt->Rectf = _mesa_noop_Rectf; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + _MESA_INIT_EVAL_VTXFMT(vfmt, vbo_exec_); + vfmt->Rectf = _mesa_noop_Rectf; /* from attrib_tmp.h: */ @@ -638,6 +641,98 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) } +#else /* FEATURE_beginend */ + + +#define ATTR( A, N, V0, V1, V2, V3 ) \ +do { \ + struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \ + \ + /* FLUSH_UPDATE_CURRENT needs to be set manually */ \ + exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ + \ + if (exec->vtx.active_sz[A] != N) \ + vbo_exec_fixup_vertex(ctx, A, N); \ + \ + { \ + GLfloat *dest = exec->vtx.attrptr[A]; \ + if (N>0) dest[0] = V0; \ + if (N>1) dest[1] = V1; \ + if (N>2) dest[2] = V2; \ + if (N>3) dest[3] = V3; \ + } \ +} while (0) + +#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ) +#define TAG(x) vbo_##x + +#include "vbo_attrib_tmp.h" + +static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) +{ + /* silence warnings */ + (void) vbo_Color3f; + (void) vbo_Color3fv; + (void) vbo_Color4f; + (void) vbo_Color4fv; + (void) vbo_FogCoordfEXT; + (void) vbo_FogCoordfvEXT; + (void) vbo_MultiTexCoord1f; + (void) vbo_MultiTexCoord1fv; + (void) vbo_MultiTexCoord2f; + (void) vbo_MultiTexCoord2fv; + (void) vbo_MultiTexCoord3f; + (void) vbo_MultiTexCoord3fv; + (void) vbo_MultiTexCoord4f; + (void) vbo_MultiTexCoord4fv; + (void) vbo_Normal3f; + (void) vbo_Normal3fv; + (void) vbo_SecondaryColor3fEXT; + (void) vbo_SecondaryColor3fvEXT; + (void) vbo_TexCoord1f; + (void) vbo_TexCoord1fv; + (void) vbo_TexCoord2f; + (void) vbo_TexCoord2fv; + (void) vbo_TexCoord3f; + (void) vbo_TexCoord3fv; + (void) vbo_TexCoord4f; + (void) vbo_TexCoord4fv; + (void) vbo_Vertex2f; + (void) vbo_Vertex2fv; + (void) vbo_Vertex3f; + (void) vbo_Vertex3fv; + (void) vbo_Vertex4f; + (void) vbo_Vertex4fv; + + (void) vbo_VertexAttrib1fARB; + (void) vbo_VertexAttrib1fvARB; + (void) vbo_VertexAttrib2fARB; + (void) vbo_VertexAttrib2fvARB; + (void) vbo_VertexAttrib3fARB; + (void) vbo_VertexAttrib3fvARB; + (void) vbo_VertexAttrib4fARB; + (void) vbo_VertexAttrib4fvARB; + + (void) vbo_VertexAttrib1fNV; + (void) vbo_VertexAttrib1fvNV; + (void) vbo_VertexAttrib2fNV; + (void) vbo_VertexAttrib2fvNV; + (void) vbo_VertexAttrib3fNV; + (void) vbo_VertexAttrib3fvNV; + (void) vbo_VertexAttrib4fNV; + (void) vbo_VertexAttrib4fvNV; + + (void) vbo_Materialfv; + + (void) vbo_EdgeFlag; + (void) vbo_Indexf; + (void) vbo_Indexfv; +} + + +#endif /* FEATURE_beginend */ + + /** * Tell the VBO module to use a real OpenGL vertex buffer object to * store accumulated immediate-mode vertex data. diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 39c2957631..fd70b57b72 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -33,6 +33,7 @@ #include "main/api_noop.h" #include "main/varray.h" #include "main/bufferobj.h" +#include "main/enums.h" #include "main/macros.h" #include "glapi/dispatch.h" @@ -53,10 +54,9 @@ vbo_get_minmax_index(GLcontext *ctx, const void *indices; if (_mesa_is_bufferobj(ib->obj)) { - const GLvoid *map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - ib->obj); + const GLvoid *map = + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, + GL_READ_ONLY, ib->obj); indices = ADD_POINTERS(map, ib->ptr); } else { indices = ib->ptr; @@ -105,9 +105,7 @@ vbo_get_minmax_index(GLcontext *ctx, } if (_mesa_is_bufferobj(ib->obj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - ib->obj); + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj); } } @@ -125,10 +123,9 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, if (_mesa_is_bufferobj(array->BufferObj)) { if (!array->BufferObj->Pointer) { /* need to map now */ - array->BufferObj->Pointer = ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - array->BufferObj); + array->BufferObj->Pointer = + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, + GL_READ_ONLY, array->BufferObj); } data = ADD_POINTERS(data, array->BufferObj->Pointer); } @@ -169,9 +166,7 @@ unmap_array_buffer(GLcontext *ctx, struct gl_client_array *array) if (array->Enabled && _mesa_is_bufferobj(array->BufferObj) && _mesa_bufferobj_mapped(array->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - array->BufferObj); + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj); } } @@ -181,7 +176,7 @@ unmap_array_buffer(GLcontext *ctx, struct gl_client_array *array) */ static void check_draw_elements_data(GLcontext *ctx, GLsizei count, GLenum elemType, - const void *elements) + const void *elements, GLint basevertex) { struct gl_array_object *arrayObj = ctx->Array.ArrayObj; const void *elemMap; @@ -222,13 +217,13 @@ check_draw_elements_data(GLcontext *ctx, GLsizei count, GLenum elemType, check_array_data(ctx, &arrayObj->TexCoord[k], VERT_ATTRIB_TEX0 + k, j); } for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { - check_array_data(ctx, &arrayObj->VertexAttrib[k], VERT_ATTRIB_GENERIC0 + k, j); + check_array_data(ctx, &arrayObj->VertexAttrib[k], + VERT_ATTRIB_GENERIC0 + k, j); } } if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ctx->Array.ElementArrayBufferObj); } @@ -459,7 +454,6 @@ bind_arrays(GLcontext *ctx) } else if (exec->array.program_mode != get_program_mode(ctx) || exec->array.enabled_flags != ctx->Array.ArrayObj->_Enabled) { - recalculate_input_bindings(ctx); } #else @@ -482,6 +476,10 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) struct vbo_exec_context *exec = &vbo->exec; struct _mesa_prim prim[1]; + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, count); + if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) return; @@ -518,6 +516,7 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) prim[0].start = start; prim[0].count = count; prim[0].indexed = 0; + prim[0].basevertex = 0; vbo->draw_prims( ctx, exec->array.inputs, prim, 1, NULL, GL_TRUE, start, start + count - 1 ); @@ -581,18 +580,19 @@ dump_element_buffer(GLcontext *ctx, GLenum type) ; } - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ctx->Array.ElementArrayBufferObj); } + /* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ static void vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, GLboolean index_bounds_valid, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices) + const GLvoid *indices, + GLint basevertex) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; @@ -626,6 +626,7 @@ vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, prim[0].start = 0; prim[0].count = count; prim[0].indexed = 1; + prim[0].basevertex = basevertex; /* Need to give special consideration to rendering a range of * indices starting somewhere above zero. Typically the @@ -663,17 +664,31 @@ vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, } static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid *indices) +vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, + GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, + GLint basevertex) { static GLuint warnCount = 0; GET_CURRENT_CONTEXT(ctx); + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, + "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, end, count, + _mesa_lookup_enum_by_nr(type), indices, basevertex); + if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, - type, indices )) + type, indices, basevertex )) return; + /* NOTE: It's important that 'end' is a reasonable value. + * in _tnl_draw_prims(), we use end to determine how many vertices + * to transform. If it's too large, we can unnecessarily split prims + * or we can read/write out of memory in several different places! + */ + if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ warnCount++; @@ -726,10 +741,12 @@ vbo_exec_DrawRangeElements(GLenum mode, #endif } else if (0) { - _mesa_printf("glDraw[Range]Elements" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n", + _mesa_printf("glDraw[Range]Elements{,BaseVertex}" + "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " + "base %d\n", start, end, type, count, - ctx->Array.ElementArrayBufferObj->Name); + ctx->Array.ElementArrayBufferObj->Name, + basevertex); } #if 0 @@ -739,7 +756,24 @@ vbo_exec_DrawRangeElements(GLenum mode, #endif vbo_validated_drawrangeelements(ctx, mode, GL_TRUE, start, end, - count, type, indices); + count, type, indices, basevertex); +} + + +static void GLAPIENTRY +vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, const GLvoid *indices) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, + "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n", + _mesa_lookup_enum_by_nr(mode), start, end, count, + _mesa_lookup_enum_by_nr(type), indices); + + vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, + indices, 0); } @@ -749,18 +783,45 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, { GET_CURRENT_CONTEXT(ctx); - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices); + + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices); + count, type, indices, 0); } -/* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ + +static void GLAPIENTRY +vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices, basevertex); + + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, + basevertex )) + return; + + vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, + count, type, indices, basevertex); +} + + +/** Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ static void vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount) + const GLvoid **indices, GLsizei primcount, + const GLint *basevertex) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; @@ -854,6 +915,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size; prim[i].count = count[i]; prim[i].indexed = 1; + if (basevertex != NULL) + prim[i].basevertex = basevertex[i]; + else + prim[i].basevertex = 0; } vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib, @@ -874,6 +939,10 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, prim[0].start = 0; prim[0].count = count[i]; prim[0].indexed = 1; + if (basevertex != NULL) + prim[0].basevertex = basevertex[i]; + else + prim[0].basevertex = 0; } vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib, @@ -882,6 +951,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, _mesa_free(prim); } + static void GLAPIENTRY vbo_exec_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, @@ -894,14 +964,38 @@ vbo_exec_MultiDrawElements(GLenum mode, ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements( ctx, mode, count[i], type, indices[i] )) + if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], + 0)) return; } - vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount); + vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, + NULL); } +static void GLAPIENTRY +vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLsizei *basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + for (i = 0; i < primcount; i++) { + if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], + basevertex[i])) + return; + } + + vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, + basevertex); +} + /*********************************************************************** * Initialization @@ -915,11 +1009,17 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) exec->vtxfmt.DrawElements = vbo_exec_DrawElements; exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements; + exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex; + exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex; + exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex; #else exec->vtxfmt.DrawArrays = _mesa_noop_DrawArrays; exec->vtxfmt.DrawElements = _mesa_noop_DrawElements; exec->vtxfmt.DrawRangeElements = _mesa_noop_DrawRangeElements; exec->vtxfmt.MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; + exec->vtxfmt.DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; + exec->vtxfmt.DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; + exec->vtxfmt.MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; #endif } @@ -947,6 +1047,13 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, vbo_exec_DrawElements(mode, count, type, indices); } +void GLAPIENTRY +_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex); +} + /* This API entrypoint is not ordinarily used */ void GLAPIENTRY @@ -956,6 +1063,17 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, vbo_exec_DrawRangeElements(mode, start, end, count, type, indices); } + +void GLAPIENTRY +_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, + indices, basevertex); +} + + /* GL_EXT_multi_draw_arrays */ void GLAPIENTRY _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, @@ -963,3 +1081,14 @@ _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, { vbo_exec_MultiDrawElements(mode, count, type, indices, primcount); } + + +void GLAPIENTRY +_mesa_MultiDrawElementsBaseVertex(GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount, + const GLint *basevertex) +{ + vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices, + primcount, basevertex); +} diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 0c258c535e..ee148df4a1 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -35,6 +35,9 @@ #include "vbo_context.h" +#if FEATURE_beginend + + static void vbo_exec_debug_verts( struct vbo_exec_context *exec ) { @@ -411,3 +414,6 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) exec->vtx.prim_count = 0; exec->vtx.vert_count = 0; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 3bf7ef580f..55a82ee369 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -126,7 +126,23 @@ void vbo_rebase_prims( GLcontext *ctx, if (0) _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); - if (ib) { + + /* XXX this path is disabled for now. + * There's rendering corruption in some apps when it's enabled. + */ + if (0 && ib && ctx->Extensions.ARB_draw_elements_base_vertex) { + /* If we can just tell the hardware or the TNL to interpret our + * indices with a different base, do so. + */ + tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); + + for (i = 0; i < nr_prims; i++) { + tmp_prims[i] = prim[i]; + tmp_prims[i].basevertex -= min_index; + } + + prim = tmp_prims; + } else if (ib) { /* Unfortunately need to adjust each index individually. */ GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 1771510d84..3f86c68b24 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -72,6 +72,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/dlist.h" #include "main/enums.h" +#include "main/eval.h" #include "main/macros.h" #include "main/api_noop.h" #include "main/api_validate.h" @@ -269,7 +270,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) * being compiled. */ node = (struct vbo_save_vertex_list *) - _mesa_alloc_instruction(ctx, save->opcode_vertex_list, sizeof(*node)); + _mesa_dlist_alloc(ctx, save->opcode_vertex_list, sizeof(*node)); if (!node) return; @@ -826,6 +827,33 @@ static void GLAPIENTRY _save_DrawRangeElements(GLenum mode, _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" ); } +static void GLAPIENTRY _save_DrawElementsBaseVertex(GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) count; (void) type; (void) indices; (void)basevertex; + + _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" ); +} + +static void GLAPIENTRY _save_DrawRangeElementsBaseVertex(GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) start; (void) end; (void) count; (void) type; + (void) indices; (void)basevertex; + + _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" ); +} + static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) { GET_CURRENT_CONTEXT(ctx); @@ -907,7 +935,7 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum GET_CURRENT_CONTEXT(ctx); GLint i; - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices )) + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; _ae_map_vbos( ctx ); @@ -948,7 +976,7 @@ static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode, GET_CURRENT_CONTEXT(ctx); if (_mesa_validate_DrawRangeElements( ctx, mode, start, end, - count, type, indices )) + count, type, indices, 0 )) _save_OBE_DrawElements( mode, count, type, indices ); } @@ -961,7 +989,8 @@ static void _save_vtxfmt_init( GLcontext *ctx ) struct vbo_save_context *save = &vbo_context(ctx)->save; GLvertexformat *vfmt = &save->vtxfmt; - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _save_Begin; vfmt->Color3f = _save_Color3f; vfmt->Color3fv = _save_Color3fv; @@ -1020,28 +1049,23 @@ static void _save_vtxfmt_init( GLcontext *ctx ) /* This will all require us to fallback to saving the list as opcodes: */ - vfmt->CallList = _save_CallList; /* inside begin/end */ - vfmt->CallLists = _save_CallLists; /* inside begin/end */ - vfmt->EvalCoord1f = _save_EvalCoord1f; - vfmt->EvalCoord1fv = _save_EvalCoord1fv; - vfmt->EvalCoord2f = _save_EvalCoord2f; - vfmt->EvalCoord2fv = _save_EvalCoord2fv; - vfmt->EvalPoint1 = _save_EvalPoint1; - vfmt->EvalPoint2 = _save_EvalPoint2; + _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */ + + _MESA_INIT_EVAL_VTXFMT(vfmt, _save_); /* These are all errors as we at least know we are in some sort of * begin/end pair: */ - vfmt->EvalMesh1 = _save_EvalMesh1; - vfmt->EvalMesh2 = _save_EvalMesh2; vfmt->Begin = _save_Begin; vfmt->Rectf = _save_Rectf; vfmt->DrawArrays = _save_DrawArrays; vfmt->DrawElements = _save_DrawElements; vfmt->DrawRangeElements = _save_DrawRangeElements; + vfmt->DrawElementsBaseVertex = _save_DrawElementsBaseVertex; + vfmt->DrawRangeElementsBaseVertex = _save_DrawRangeElementsBaseVertex; /* Loops back into vfmt->DrawElements */ vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; - + vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; } @@ -1209,11 +1233,11 @@ void vbo_save_api_init( struct vbo_save_context *save ) GLuint i; save->opcode_vertex_list = - _mesa_alloc_opcode( ctx, - sizeof(struct vbo_save_vertex_list), - vbo_save_playback_vertex_list, - vbo_destroy_vertex_list, - vbo_print_vertex_list ); + _mesa_dlist_alloc_opcode( ctx, + sizeof(struct vbo_save_vertex_list), + vbo_save_playback_vertex_list, + vbo_destroy_vertex_list, + vbo_print_vertex_list ); ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin; @@ -1233,6 +1257,7 @@ void vbo_save_api_init( struct vbo_save_context *save ) ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements; /* loops back into _save_OBE_DrawElements */ ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; + ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); } diff --git a/src/mesa/vbo/vbo_split.c b/src/mesa/vbo/vbo_split.c index 58e879628d..c445acca7d 100644 --- a/src/mesa/vbo/vbo_split.c +++ b/src/mesa/vbo/vbo_split.c @@ -50,6 +50,7 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/mtypes.h" +#include "main/macros.h" #include "vbo_split.h" #include "vbo.h" @@ -107,7 +108,12 @@ void vbo_split_prims( GLcontext *ctx, vbo_draw_func draw, const struct split_limits *limits ) { - + GLuint max_basevertex = prim->basevertex; + GLuint i; + + for (i = 1; i < nr_prims; i++) + max_basevertex = MAX2(max_basevertex, prim[i].basevertex); + if (ib) { if (limits->max_indices == 0) { /* Could traverse the indices, re-emitting vertices in turn. diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 8ec180d550..c45190b9dd 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -589,28 +589,40 @@ void vbo_split_copy( GLcontext *ctx, const struct split_limits *limits ) { struct copy_context copy; - GLuint i; + GLuint i, this_nr_prims; + + for (i = 0; i < nr_prims;) { + /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices + * will rebase the elements to the basevertex, and we'll only + * emit strings of prims with the same basevertex in one draw call. + */ + for (this_nr_prims = 1; i + this_nr_prims < nr_prims; + this_nr_prims++) { + if (prim[i].basevertex != prim[i + this_nr_prims].basevertex) + break; + } - memset(©, 0, sizeof(copy)); + memset(©, 0, sizeof(copy)); - /* Require indexed primitives: - */ - assert(ib); - - copy.ctx = ctx; - copy.array = arrays; - copy.prim = prim; - copy.nr_prims = nr_prims; - copy.ib = ib; - copy.draw = draw; - copy.limits = limits; + /* Require indexed primitives: + */ + assert(ib); - /* Clear the vertex cache: - */ - for (i = 0; i < ELT_TABLE_SIZE; i++) - copy.vert_cache[i].in = ~0; + copy.ctx = ctx; + copy.array = arrays; + copy.prim = &prim[i]; + copy.nr_prims = this_nr_prims; + copy.ib = ib; + copy.draw = draw; + copy.limits = limits; - replay_init(©); - replay_elts(©); - replay_finish(©); + /* Clear the vertex cache: + */ + for (i = 0; i < ELT_TABLE_SIZE; i++) + copy.vert_cache[i].in = ~0; + + replay_init(©); + replay_elts(©); + replay_finish(©); + } } diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index db917f3982..72d0532906 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -21601,21 +21601,25 @@ GL_PREFIX(WaitSync): .size GL_PREFIX(WaitSync), .-GL_PREFIX(WaitSync) .p2align 4,,15 - .globl GL_PREFIX(PolygonOffsetEXT) - .type GL_PREFIX(PolygonOffsetEXT), @function -GL_PREFIX(PolygonOffsetEXT): + .globl GL_PREFIX(DrawElementsBaseVertex) + .type GL_PREFIX(DrawElementsBaseVertex), @function +GL_PREFIX(DrawElementsBaseVertex): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4592(%rax), %r11 jmp *%r11 #else @@ -21625,23 +21629,26 @@ GL_PREFIX(PolygonOffsetEXT): movq 4592(%rax), %r11 jmp *%r11 1: - subq $24, %rsp - movq %xmm0, (%rsp) - movq %xmm1, 8(%rsp) + pushq %rdi + pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 call _glapi_get_dispatch - movq 8(%rsp), %xmm1 - movq (%rsp), %xmm0 - addq $24, %rsp + popq %r8 + popq %rcx + popq %rdx + popq %rsi + popq %rdi movq 4592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) + .size GL_PREFIX(DrawElementsBaseVertex), .-GL_PREFIX(DrawElementsBaseVertex) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_575) - .type GL_PREFIX(_dispatch_stub_575), @function - HIDDEN(GL_PREFIX(_dispatch_stub_575)) -GL_PREFIX(_dispatch_stub_575): + .globl GL_PREFIX(DrawRangeElementsBaseVertex) + .type GL_PREFIX(DrawRangeElementsBaseVertex), @function +GL_PREFIX(DrawRangeElementsBaseVertex): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4600(%rax), %r11 @@ -21649,9 +21656,17 @@ GL_PREFIX(_dispatch_stub_575): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 4600(%rax), %r11 @@ -21665,21 +21680,28 @@ GL_PREFIX(_dispatch_stub_575): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 4600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_575), .-GL_PREFIX(_dispatch_stub_575) + .size GL_PREFIX(DrawRangeElementsBaseVertex), .-GL_PREFIX(DrawRangeElementsBaseVertex) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_576) - .type GL_PREFIX(_dispatch_stub_576), @function - HIDDEN(GL_PREFIX(_dispatch_stub_576)) -GL_PREFIX(_dispatch_stub_576): + .globl GL_PREFIX(MultiDrawElementsBaseVertex) + .type GL_PREFIX(MultiDrawElementsBaseVertex), @function +GL_PREFIX(MultiDrawElementsBaseVertex): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4608(%rax), %r11 @@ -21687,9 +21709,17 @@ GL_PREFIX(_dispatch_stub_576): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 4608(%rax), %r11 @@ -21703,32 +21733,39 @@ GL_PREFIX(_dispatch_stub_576): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx + pushq %r8 + pushq %r9 pushq %rbp call _glapi_get_dispatch popq %rbp + popq %r9 + popq %r8 + popq %rcx + popq %rdx popq %rsi popq %rdi movq 4608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_576), .-GL_PREFIX(_dispatch_stub_576) + .size GL_PREFIX(MultiDrawElementsBaseVertex), .-GL_PREFIX(MultiDrawElementsBaseVertex) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_577) - .type GL_PREFIX(_dispatch_stub_577), @function - HIDDEN(GL_PREFIX(_dispatch_stub_577)) -GL_PREFIX(_dispatch_stub_577): + .globl GL_PREFIX(PolygonOffsetEXT) + .type GL_PREFIX(PolygonOffsetEXT), @function +GL_PREFIX(PolygonOffsetEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 4616(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + movq %xmm0, (%rsp) + movq %xmm1, 8(%rsp) call _x86_64_get_dispatch@PLT - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi + movq 8(%rsp), %xmm1 + movq (%rsp), %xmm0 addq $24, %rsp movq 4616(%rax), %r11 jmp *%r11 @@ -21740,16 +21777,16 @@ GL_PREFIX(_dispatch_stub_577): jmp *%r11 1: subq $24, %rsp - movq %rdi, (%rsp) - movq %xmm0, 8(%rsp) + movq %xmm0, (%rsp) + movq %xmm1, 8(%rsp) call _glapi_get_dispatch - movq 8(%rsp), %xmm0 - movq (%rsp), %rdi + movq 8(%rsp), %xmm1 + movq (%rsp), %xmm0 addq $24, %rsp movq 4616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_577), .-GL_PREFIX(_dispatch_stub_577) + .size GL_PREFIX(PolygonOffsetEXT), .-GL_PREFIX(PolygonOffsetEXT) .p2align 4,,15 .globl GL_PREFIX(_dispatch_stub_578) @@ -21837,13 +21874,13 @@ GL_PREFIX(_dispatch_stub_580): movq 4640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _x86_64_get_dispatch@PLT - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 4640(%rax), %r11 jmp *%r11 #else @@ -21853,13 +21890,13 @@ GL_PREFIX(_dispatch_stub_580): movq 4640(%rax), %r11 jmp *%r11 1: - pushq %rdi - pushq %rsi - pushq %rbp + subq $24, %rsp + movq %rdi, (%rsp) + movq %xmm0, 8(%rsp) call _glapi_get_dispatch - popq %rbp - popq %rsi - popq %rdi + movq 8(%rsp), %xmm0 + movq (%rsp), %rdi + addq $24, %rsp movq 4640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ @@ -21914,7 +21951,11 @@ GL_PREFIX(_dispatch_stub_582): jmp *%r11 #elif defined(PTHREADS) pushq %rdi + pushq %rsi + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi popq %rdi movq 4656(%rax), %r11 jmp *%r11 @@ -21926,7 +21967,11 @@ GL_PREFIX(_dispatch_stub_582): jmp *%r11 1: pushq %rdi + pushq %rsi + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rsi popq %rdi movq 4656(%rax), %r11 jmp *%r11 @@ -21934,12 +21979,118 @@ GL_PREFIX(_dispatch_stub_582): .size GL_PREFIX(_dispatch_stub_582), .-GL_PREFIX(_dispatch_stub_582) .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_583) + .type GL_PREFIX(_dispatch_stub_583), @function + HIDDEN(GL_PREFIX(_dispatch_stub_583)) +GL_PREFIX(_dispatch_stub_583): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4664(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rbp + call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi + popq %rdi + movq 4664(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4664(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rbp + call _glapi_get_dispatch + popq %rbp + popq %rsi + popq %rdi + movq 4664(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_583), .-GL_PREFIX(_dispatch_stub_583) + + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_584) + .type GL_PREFIX(_dispatch_stub_584), @function + HIDDEN(GL_PREFIX(_dispatch_stub_584)) +GL_PREFIX(_dispatch_stub_584): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4672(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rbp + call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi + popq %rdi + movq 4672(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4672(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rbp + call _glapi_get_dispatch + popq %rbp + popq %rsi + popq %rdi + movq 4672(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_584), .-GL_PREFIX(_dispatch_stub_584) + + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_585) + .type GL_PREFIX(_dispatch_stub_585), @function + HIDDEN(GL_PREFIX(_dispatch_stub_585)) +GL_PREFIX(_dispatch_stub_585): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 4680(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + call _x86_64_get_dispatch@PLT + popq %rdi + movq 4680(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 4680(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + call _glapi_get_dispatch + popq %rdi + movq 4680(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_585), .-GL_PREFIX(_dispatch_stub_585) + + .p2align 4,,15 .globl GL_PREFIX(ColorPointerEXT) .type GL_PREFIX(ColorPointerEXT), @function GL_PREFIX(ColorPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21953,13 +22104,13 @@ GL_PREFIX(ColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -21973,7 +22124,7 @@ GL_PREFIX(ColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4664(%rax), %r11 + movq 4688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorPointerEXT), .-GL_PREFIX(ColorPointerEXT) @@ -21984,7 +22135,7 @@ GL_PREFIX(ColorPointerEXT): GL_PREFIX(EdgeFlagPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -21994,13 +22145,13 @@ GL_PREFIX(EdgeFlagPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22010,7 +22161,7 @@ GL_PREFIX(EdgeFlagPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4672(%rax), %r11 + movq 4696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EdgeFlagPointerEXT), .-GL_PREFIX(EdgeFlagPointerEXT) @@ -22021,7 +22172,7 @@ GL_PREFIX(EdgeFlagPointerEXT): GL_PREFIX(IndexPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22035,13 +22186,13 @@ GL_PREFIX(IndexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22055,7 +22206,7 @@ GL_PREFIX(IndexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4680(%rax), %r11 + movq 4704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IndexPointerEXT), .-GL_PREFIX(IndexPointerEXT) @@ -22066,7 +22217,7 @@ GL_PREFIX(IndexPointerEXT): GL_PREFIX(NormalPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22080,13 +22231,13 @@ GL_PREFIX(NormalPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22100,7 +22251,7 @@ GL_PREFIX(NormalPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4688(%rax), %r11 + movq 4712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(NormalPointerEXT), .-GL_PREFIX(NormalPointerEXT) @@ -22111,7 +22262,7 @@ GL_PREFIX(NormalPointerEXT): GL_PREFIX(TexCoordPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22125,13 +22276,13 @@ GL_PREFIX(TexCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22145,7 +22296,7 @@ GL_PREFIX(TexCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4696(%rax), %r11 + movq 4720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TexCoordPointerEXT), .-GL_PREFIX(TexCoordPointerEXT) @@ -22156,7 +22307,7 @@ GL_PREFIX(TexCoordPointerEXT): GL_PREFIX(VertexPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22170,13 +22321,13 @@ GL_PREFIX(VertexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22190,7 +22341,7 @@ GL_PREFIX(VertexPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4704(%rax), %r11 + movq 4728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexPointerEXT), .-GL_PREFIX(VertexPointerEXT) @@ -22201,7 +22352,7 @@ GL_PREFIX(VertexPointerEXT): GL_PREFIX(PointParameterfEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -22211,13 +22362,13 @@ GL_PREFIX(PointParameterfEXT): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22227,7 +22378,7 @@ GL_PREFIX(PointParameterfEXT): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 4712(%rax), %r11 + movq 4736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterfEXT), .-GL_PREFIX(PointParameterfEXT) @@ -22238,7 +22389,7 @@ GL_PREFIX(PointParameterfEXT): GL_PREFIX(PointParameterfvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22248,13 +22399,13 @@ GL_PREFIX(PointParameterfvEXT): popq %rbp popq %rsi popq %rdi - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22264,7 +22415,7 @@ GL_PREFIX(PointParameterfvEXT): popq %rbp popq %rsi popq %rdi - movq 4720(%rax), %r11 + movq 4744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterfvEXT), .-GL_PREFIX(PointParameterfvEXT) @@ -22275,7 +22426,7 @@ GL_PREFIX(PointParameterfvEXT): GL_PREFIX(LockArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22285,13 +22436,13 @@ GL_PREFIX(LockArraysEXT): popq %rbp popq %rsi popq %rdi - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22301,7 +22452,7 @@ GL_PREFIX(LockArraysEXT): popq %rbp popq %rsi popq %rdi - movq 4728(%rax), %r11 + movq 4752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(LockArraysEXT), .-GL_PREFIX(LockArraysEXT) @@ -22312,37 +22463,37 @@ GL_PREFIX(LockArraysEXT): GL_PREFIX(UnlockArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4736(%rax), %r11 + movq 4760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(UnlockArraysEXT), .-GL_PREFIX(UnlockArraysEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_593) - .type GL_PREFIX(_dispatch_stub_593), @function - HIDDEN(GL_PREFIX(_dispatch_stub_593)) -GL_PREFIX(_dispatch_stub_593): + .globl GL_PREFIX(_dispatch_stub_596) + .type GL_PREFIX(_dispatch_stub_596), @function + HIDDEN(GL_PREFIX(_dispatch_stub_596)) +GL_PREFIX(_dispatch_stub_596): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22352,13 +22503,13 @@ GL_PREFIX(_dispatch_stub_593): popq %rbp popq %rsi popq %rdi - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22368,19 +22519,19 @@ GL_PREFIX(_dispatch_stub_593): popq %rbp popq %rsi popq %rdi - movq 4744(%rax), %r11 + movq 4768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_593), .-GL_PREFIX(_dispatch_stub_593) + .size GL_PREFIX(_dispatch_stub_596), .-GL_PREFIX(_dispatch_stub_596) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_594) - .type GL_PREFIX(_dispatch_stub_594), @function - HIDDEN(GL_PREFIX(_dispatch_stub_594)) -GL_PREFIX(_dispatch_stub_594): + .globl GL_PREFIX(_dispatch_stub_597) + .type GL_PREFIX(_dispatch_stub_597), @function + HIDDEN(GL_PREFIX(_dispatch_stub_597)) +GL_PREFIX(_dispatch_stub_597): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22390,13 +22541,13 @@ GL_PREFIX(_dispatch_stub_594): popq %rbp popq %rsi popq %rdi - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22406,10 +22557,10 @@ GL_PREFIX(_dispatch_stub_594): popq %rbp popq %rsi popq %rdi - movq 4752(%rax), %r11 + movq 4776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_594), .-GL_PREFIX(_dispatch_stub_594) + .size GL_PREFIX(_dispatch_stub_597), .-GL_PREFIX(_dispatch_stub_597) .p2align 4,,15 .globl GL_PREFIX(SecondaryColor3bEXT) @@ -22417,7 +22568,7 @@ GL_PREFIX(_dispatch_stub_594): GL_PREFIX(SecondaryColor3bEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22427,13 +22578,13 @@ GL_PREFIX(SecondaryColor3bEXT): popq %rdx popq %rsi popq %rdi - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22443,7 +22594,7 @@ GL_PREFIX(SecondaryColor3bEXT): popq %rdx popq %rsi popq %rdi - movq 4760(%rax), %r11 + movq 4784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3bEXT), .-GL_PREFIX(SecondaryColor3bEXT) @@ -22454,25 +22605,25 @@ GL_PREFIX(SecondaryColor3bEXT): GL_PREFIX(SecondaryColor3bvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4768(%rax), %r11 + movq 4792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3bvEXT), .-GL_PREFIX(SecondaryColor3bvEXT) @@ -22483,7 +22634,7 @@ GL_PREFIX(SecondaryColor3bvEXT): GL_PREFIX(SecondaryColor3dEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -22495,13 +22646,13 @@ GL_PREFIX(SecondaryColor3dEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22513,7 +22664,7 @@ GL_PREFIX(SecondaryColor3dEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4776(%rax), %r11 + movq 4800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3dEXT), .-GL_PREFIX(SecondaryColor3dEXT) @@ -22524,25 +22675,25 @@ GL_PREFIX(SecondaryColor3dEXT): GL_PREFIX(SecondaryColor3dvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4784(%rax), %r11 + movq 4808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3dvEXT), .-GL_PREFIX(SecondaryColor3dvEXT) @@ -22553,7 +22704,7 @@ GL_PREFIX(SecondaryColor3dvEXT): GL_PREFIX(SecondaryColor3fEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -22565,13 +22716,13 @@ GL_PREFIX(SecondaryColor3fEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -22583,7 +22734,7 @@ GL_PREFIX(SecondaryColor3fEXT): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 4792(%rax), %r11 + movq 4816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3fEXT), .-GL_PREFIX(SecondaryColor3fEXT) @@ -22594,25 +22745,25 @@ GL_PREFIX(SecondaryColor3fEXT): GL_PREFIX(SecondaryColor3fvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4800(%rax), %r11 + movq 4824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3fvEXT), .-GL_PREFIX(SecondaryColor3fvEXT) @@ -22623,7 +22774,7 @@ GL_PREFIX(SecondaryColor3fvEXT): GL_PREFIX(SecondaryColor3iEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22633,13 +22784,13 @@ GL_PREFIX(SecondaryColor3iEXT): popq %rdx popq %rsi popq %rdi - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22649,7 +22800,7 @@ GL_PREFIX(SecondaryColor3iEXT): popq %rdx popq %rsi popq %rdi - movq 4808(%rax), %r11 + movq 4832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3iEXT), .-GL_PREFIX(SecondaryColor3iEXT) @@ -22660,25 +22811,25 @@ GL_PREFIX(SecondaryColor3iEXT): GL_PREFIX(SecondaryColor3ivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4816(%rax), %r11 + movq 4840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ivEXT), .-GL_PREFIX(SecondaryColor3ivEXT) @@ -22689,7 +22840,7 @@ GL_PREFIX(SecondaryColor3ivEXT): GL_PREFIX(SecondaryColor3sEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22699,13 +22850,13 @@ GL_PREFIX(SecondaryColor3sEXT): popq %rdx popq %rsi popq %rdi - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22715,7 +22866,7 @@ GL_PREFIX(SecondaryColor3sEXT): popq %rdx popq %rsi popq %rdi - movq 4824(%rax), %r11 + movq 4848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3sEXT), .-GL_PREFIX(SecondaryColor3sEXT) @@ -22726,25 +22877,25 @@ GL_PREFIX(SecondaryColor3sEXT): GL_PREFIX(SecondaryColor3svEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4832(%rax), %r11 + movq 4856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3svEXT), .-GL_PREFIX(SecondaryColor3svEXT) @@ -22755,7 +22906,7 @@ GL_PREFIX(SecondaryColor3svEXT): GL_PREFIX(SecondaryColor3ubEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22765,13 +22916,13 @@ GL_PREFIX(SecondaryColor3ubEXT): popq %rdx popq %rsi popq %rdi - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22781,7 +22932,7 @@ GL_PREFIX(SecondaryColor3ubEXT): popq %rdx popq %rsi popq %rdi - movq 4840(%rax), %r11 + movq 4864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ubEXT), .-GL_PREFIX(SecondaryColor3ubEXT) @@ -22792,25 +22943,25 @@ GL_PREFIX(SecondaryColor3ubEXT): GL_PREFIX(SecondaryColor3ubvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4848(%rax), %r11 + movq 4872(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3ubvEXT), .-GL_PREFIX(SecondaryColor3ubvEXT) @@ -22821,7 +22972,7 @@ GL_PREFIX(SecondaryColor3ubvEXT): GL_PREFIX(SecondaryColor3uiEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22831,13 +22982,13 @@ GL_PREFIX(SecondaryColor3uiEXT): popq %rdx popq %rsi popq %rdi - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22847,7 +22998,7 @@ GL_PREFIX(SecondaryColor3uiEXT): popq %rdx popq %rsi popq %rdi - movq 4856(%rax), %r11 + movq 4880(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3uiEXT), .-GL_PREFIX(SecondaryColor3uiEXT) @@ -22858,25 +23009,25 @@ GL_PREFIX(SecondaryColor3uiEXT): GL_PREFIX(SecondaryColor3uivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4864(%rax), %r11 + movq 4888(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3uivEXT), .-GL_PREFIX(SecondaryColor3uivEXT) @@ -22887,7 +23038,7 @@ GL_PREFIX(SecondaryColor3uivEXT): GL_PREFIX(SecondaryColor3usEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22897,13 +23048,13 @@ GL_PREFIX(SecondaryColor3usEXT): popq %rdx popq %rsi popq %rdi - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22913,7 +23064,7 @@ GL_PREFIX(SecondaryColor3usEXT): popq %rdx popq %rsi popq %rdi - movq 4872(%rax), %r11 + movq 4896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3usEXT), .-GL_PREFIX(SecondaryColor3usEXT) @@ -22924,25 +23075,25 @@ GL_PREFIX(SecondaryColor3usEXT): GL_PREFIX(SecondaryColor3usvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4880(%rax), %r11 + movq 4904(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColor3usvEXT), .-GL_PREFIX(SecondaryColor3usvEXT) @@ -22953,7 +23104,7 @@ GL_PREFIX(SecondaryColor3usvEXT): GL_PREFIX(SecondaryColorPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -22967,13 +23118,13 @@ GL_PREFIX(SecondaryColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -22987,7 +23138,7 @@ GL_PREFIX(SecondaryColorPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4888(%rax), %r11 + movq 4912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SecondaryColorPointerEXT), .-GL_PREFIX(SecondaryColorPointerEXT) @@ -22998,7 +23149,7 @@ GL_PREFIX(SecondaryColorPointerEXT): GL_PREFIX(MultiDrawArraysEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23012,13 +23163,13 @@ GL_PREFIX(MultiDrawArraysEXT): popq %rdx popq %rsi popq %rdi - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23032,7 +23183,7 @@ GL_PREFIX(MultiDrawArraysEXT): popq %rdx popq %rsi popq %rdi - movq 4896(%rax), %r11 + movq 4920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(MultiDrawArraysEXT), .-GL_PREFIX(MultiDrawArraysEXT) @@ -23043,7 +23194,7 @@ GL_PREFIX(MultiDrawArraysEXT): GL_PREFIX(MultiDrawElementsEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23057,13 +23208,13 @@ GL_PREFIX(MultiDrawElementsEXT): popq %rdx popq %rsi popq %rdi - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23077,7 +23228,7 @@ GL_PREFIX(MultiDrawElementsEXT): popq %rdx popq %rsi popq %rdi - movq 4904(%rax), %r11 + movq 4928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(MultiDrawElementsEXT), .-GL_PREFIX(MultiDrawElementsEXT) @@ -23088,7 +23239,7 @@ GL_PREFIX(MultiDrawElementsEXT): GL_PREFIX(FogCoordPointerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23098,13 +23249,13 @@ GL_PREFIX(FogCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23114,7 +23265,7 @@ GL_PREFIX(FogCoordPointerEXT): popq %rdx popq %rsi popq %rdi - movq 4912(%rax), %r11 + movq 4936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordPointerEXT), .-GL_PREFIX(FogCoordPointerEXT) @@ -23125,7 +23276,7 @@ GL_PREFIX(FogCoordPointerEXT): GL_PREFIX(FogCoorddEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $8, %rsp @@ -23133,13 +23284,13 @@ GL_PREFIX(FogCoorddEXT): call _x86_64_get_dispatch@PLT movq (%rsp), %xmm0 addq $8, %rsp - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 1: subq $8, %rsp @@ -23147,7 +23298,7 @@ GL_PREFIX(FogCoorddEXT): call _glapi_get_dispatch movq (%rsp), %xmm0 addq $8, %rsp - movq 4920(%rax), %r11 + movq 4944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoorddEXT), .-GL_PREFIX(FogCoorddEXT) @@ -23158,25 +23309,25 @@ GL_PREFIX(FogCoorddEXT): GL_PREFIX(FogCoorddvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4928(%rax), %r11 + movq 4952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoorddvEXT), .-GL_PREFIX(FogCoorddvEXT) @@ -23187,7 +23338,7 @@ GL_PREFIX(FogCoorddvEXT): GL_PREFIX(FogCoordfEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $8, %rsp @@ -23195,13 +23346,13 @@ GL_PREFIX(FogCoordfEXT): call _x86_64_get_dispatch@PLT movq (%rsp), %xmm0 addq $8, %rsp - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 1: subq $8, %rsp @@ -23209,7 +23360,7 @@ GL_PREFIX(FogCoordfEXT): call _glapi_get_dispatch movq (%rsp), %xmm0 addq $8, %rsp - movq 4936(%rax), %r11 + movq 4960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordfEXT), .-GL_PREFIX(FogCoordfEXT) @@ -23220,58 +23371,58 @@ GL_PREFIX(FogCoordfEXT): GL_PREFIX(FogCoordfvEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4944(%rax), %r11 + movq 4968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FogCoordfvEXT), .-GL_PREFIX(FogCoordfvEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_619) - .type GL_PREFIX(_dispatch_stub_619), @function - HIDDEN(GL_PREFIX(_dispatch_stub_619)) -GL_PREFIX(_dispatch_stub_619): + .globl GL_PREFIX(_dispatch_stub_622) + .type GL_PREFIX(_dispatch_stub_622), @function + HIDDEN(GL_PREFIX(_dispatch_stub_622)) +GL_PREFIX(_dispatch_stub_622): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 4952(%rax), %r11 + movq 4976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_619), .-GL_PREFIX(_dispatch_stub_619) + .size GL_PREFIX(_dispatch_stub_622), .-GL_PREFIX(_dispatch_stub_622) .p2align 4,,15 .globl GL_PREFIX(BlendFuncSeparateEXT) @@ -23279,7 +23430,7 @@ GL_PREFIX(_dispatch_stub_619): GL_PREFIX(BlendFuncSeparateEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23293,13 +23444,13 @@ GL_PREFIX(BlendFuncSeparateEXT): popq %rdx popq %rsi popq %rdi - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23313,7 +23464,7 @@ GL_PREFIX(BlendFuncSeparateEXT): popq %rdx popq %rsi popq %rdi - movq 4960(%rax), %r11 + movq 4984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BlendFuncSeparateEXT), .-GL_PREFIX(BlendFuncSeparateEXT) @@ -23324,25 +23475,25 @@ GL_PREFIX(BlendFuncSeparateEXT): GL_PREFIX(FlushVertexArrayRangeNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 4968(%rax), %r11 + movq 4992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FlushVertexArrayRangeNV), .-GL_PREFIX(FlushVertexArrayRangeNV) @@ -23353,7 +23504,7 @@ GL_PREFIX(FlushVertexArrayRangeNV): GL_PREFIX(VertexArrayRangeNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23363,13 +23514,13 @@ GL_PREFIX(VertexArrayRangeNV): popq %rbp popq %rsi popq %rdi - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23379,7 +23530,7 @@ GL_PREFIX(VertexArrayRangeNV): popq %rbp popq %rsi popq %rdi - movq 4976(%rax), %r11 + movq 5000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexArrayRangeNV), .-GL_PREFIX(VertexArrayRangeNV) @@ -23390,7 +23541,7 @@ GL_PREFIX(VertexArrayRangeNV): GL_PREFIX(CombinerInputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23408,13 +23559,13 @@ GL_PREFIX(CombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23432,7 +23583,7 @@ GL_PREFIX(CombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 4984(%rax), %r11 + movq 5008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerInputNV), .-GL_PREFIX(CombinerInputNV) @@ -23443,7 +23594,7 @@ GL_PREFIX(CombinerInputNV): GL_PREFIX(CombinerOutputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23461,13 +23612,13 @@ GL_PREFIX(CombinerOutputNV): popq %rdx popq %rsi popq %rdi - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23485,7 +23636,7 @@ GL_PREFIX(CombinerOutputNV): popq %rdx popq %rsi popq %rdi - movq 4992(%rax), %r11 + movq 5016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerOutputNV), .-GL_PREFIX(CombinerOutputNV) @@ -23496,7 +23647,7 @@ GL_PREFIX(CombinerOutputNV): GL_PREFIX(CombinerParameterfNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23506,13 +23657,13 @@ GL_PREFIX(CombinerParameterfNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23522,7 +23673,7 @@ GL_PREFIX(CombinerParameterfNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5000(%rax), %r11 + movq 5024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterfNV), .-GL_PREFIX(CombinerParameterfNV) @@ -23533,7 +23684,7 @@ GL_PREFIX(CombinerParameterfNV): GL_PREFIX(CombinerParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23543,13 +23694,13 @@ GL_PREFIX(CombinerParameterfvNV): popq %rbp popq %rsi popq %rdi - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23559,7 +23710,7 @@ GL_PREFIX(CombinerParameterfvNV): popq %rbp popq %rsi popq %rdi - movq 5008(%rax), %r11 + movq 5032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterfvNV), .-GL_PREFIX(CombinerParameterfvNV) @@ -23570,7 +23721,7 @@ GL_PREFIX(CombinerParameterfvNV): GL_PREFIX(CombinerParameteriNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23580,13 +23731,13 @@ GL_PREFIX(CombinerParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23596,7 +23747,7 @@ GL_PREFIX(CombinerParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5016(%rax), %r11 + movq 5040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameteriNV), .-GL_PREFIX(CombinerParameteriNV) @@ -23607,7 +23758,7 @@ GL_PREFIX(CombinerParameteriNV): GL_PREFIX(CombinerParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23617,13 +23768,13 @@ GL_PREFIX(CombinerParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23633,7 +23784,7 @@ GL_PREFIX(CombinerParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5024(%rax), %r11 + movq 5048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CombinerParameterivNV), .-GL_PREFIX(CombinerParameterivNV) @@ -23644,7 +23795,7 @@ GL_PREFIX(CombinerParameterivNV): GL_PREFIX(FinalCombinerInputNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23658,13 +23809,13 @@ GL_PREFIX(FinalCombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23678,7 +23829,7 @@ GL_PREFIX(FinalCombinerInputNV): popq %rdx popq %rsi popq %rdi - movq 5032(%rax), %r11 + movq 5056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FinalCombinerInputNV), .-GL_PREFIX(FinalCombinerInputNV) @@ -23689,7 +23840,7 @@ GL_PREFIX(FinalCombinerInputNV): GL_PREFIX(GetCombinerInputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23703,13 +23854,13 @@ GL_PREFIX(GetCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23723,7 +23874,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5040(%rax), %r11 + movq 5064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerInputParameterfvNV), .-GL_PREFIX(GetCombinerInputParameterfvNV) @@ -23734,7 +23885,7 @@ GL_PREFIX(GetCombinerInputParameterfvNV): GL_PREFIX(GetCombinerInputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23748,13 +23899,13 @@ GL_PREFIX(GetCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23768,7 +23919,7 @@ GL_PREFIX(GetCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 5048(%rax), %r11 + movq 5072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerInputParameterivNV), .-GL_PREFIX(GetCombinerInputParameterivNV) @@ -23779,7 +23930,7 @@ GL_PREFIX(GetCombinerInputParameterivNV): GL_PREFIX(GetCombinerOutputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23793,13 +23944,13 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23813,7 +23964,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5056(%rax), %r11 + movq 5080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerOutputParameterfvNV), .-GL_PREFIX(GetCombinerOutputParameterfvNV) @@ -23824,7 +23975,7 @@ GL_PREFIX(GetCombinerOutputParameterfvNV): GL_PREFIX(GetCombinerOutputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23838,13 +23989,13 @@ GL_PREFIX(GetCombinerOutputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23858,7 +24009,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 5064(%rax), %r11 + movq 5088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetCombinerOutputParameterivNV), .-GL_PREFIX(GetCombinerOutputParameterivNV) @@ -23869,7 +24020,7 @@ GL_PREFIX(GetCombinerOutputParameterivNV): GL_PREFIX(GetFinalCombinerInputParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23879,13 +24030,13 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23895,7 +24046,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5072(%rax), %r11 + movq 5096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFinalCombinerInputParameterfvNV), .-GL_PREFIX(GetFinalCombinerInputParameterfvNV) @@ -23906,7 +24057,7 @@ GL_PREFIX(GetFinalCombinerInputParameterfvNV): GL_PREFIX(GetFinalCombinerInputParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -23916,13 +24067,13 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -23932,7 +24083,7 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): popq %rdx popq %rsi popq %rdi - movq 5080(%rax), %r11 + movq 5104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFinalCombinerInputParameterivNV), .-GL_PREFIX(GetFinalCombinerInputParameterivNV) @@ -23943,25 +24094,25 @@ GL_PREFIX(GetFinalCombinerInputParameterivNV): GL_PREFIX(ResizeBuffersMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5088(%rax), %r11 + movq 5112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ResizeBuffersMESA), .-GL_PREFIX(ResizeBuffersMESA) @@ -23972,7 +24123,7 @@ GL_PREFIX(ResizeBuffersMESA): GL_PREFIX(WindowPos2dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -23982,13 +24133,13 @@ GL_PREFIX(WindowPos2dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -23998,7 +24149,7 @@ GL_PREFIX(WindowPos2dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5096(%rax), %r11 + movq 5120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2dMESA), .-GL_PREFIX(WindowPos2dMESA) @@ -24009,25 +24160,25 @@ GL_PREFIX(WindowPos2dMESA): GL_PREFIX(WindowPos2dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5104(%rax), %r11 + movq 5128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2dvMESA), .-GL_PREFIX(WindowPos2dvMESA) @@ -24038,7 +24189,7 @@ GL_PREFIX(WindowPos2dvMESA): GL_PREFIX(WindowPos2fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -24048,13 +24199,13 @@ GL_PREFIX(WindowPos2fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -24064,7 +24215,7 @@ GL_PREFIX(WindowPos2fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5112(%rax), %r11 + movq 5136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2fMESA), .-GL_PREFIX(WindowPos2fMESA) @@ -24075,25 +24226,25 @@ GL_PREFIX(WindowPos2fMESA): GL_PREFIX(WindowPos2fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5120(%rax), %r11 + movq 5144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2fvMESA), .-GL_PREFIX(WindowPos2fvMESA) @@ -24104,7 +24255,7 @@ GL_PREFIX(WindowPos2fvMESA): GL_PREFIX(WindowPos2iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24114,13 +24265,13 @@ GL_PREFIX(WindowPos2iMESA): popq %rbp popq %rsi popq %rdi - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24130,7 +24281,7 @@ GL_PREFIX(WindowPos2iMESA): popq %rbp popq %rsi popq %rdi - movq 5128(%rax), %r11 + movq 5152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2iMESA), .-GL_PREFIX(WindowPos2iMESA) @@ -24141,25 +24292,25 @@ GL_PREFIX(WindowPos2iMESA): GL_PREFIX(WindowPos2ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5136(%rax), %r11 + movq 5160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2ivMESA), .-GL_PREFIX(WindowPos2ivMESA) @@ -24170,7 +24321,7 @@ GL_PREFIX(WindowPos2ivMESA): GL_PREFIX(WindowPos2sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24180,13 +24331,13 @@ GL_PREFIX(WindowPos2sMESA): popq %rbp popq %rsi popq %rdi - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24196,7 +24347,7 @@ GL_PREFIX(WindowPos2sMESA): popq %rbp popq %rsi popq %rdi - movq 5144(%rax), %r11 + movq 5168(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2sMESA), .-GL_PREFIX(WindowPos2sMESA) @@ -24207,25 +24358,25 @@ GL_PREFIX(WindowPos2sMESA): GL_PREFIX(WindowPos2svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5152(%rax), %r11 + movq 5176(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos2svMESA), .-GL_PREFIX(WindowPos2svMESA) @@ -24236,7 +24387,7 @@ GL_PREFIX(WindowPos2svMESA): GL_PREFIX(WindowPos3dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -24248,13 +24399,13 @@ GL_PREFIX(WindowPos3dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -24266,7 +24417,7 @@ GL_PREFIX(WindowPos3dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5160(%rax), %r11 + movq 5184(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3dMESA), .-GL_PREFIX(WindowPos3dMESA) @@ -24277,25 +24428,25 @@ GL_PREFIX(WindowPos3dMESA): GL_PREFIX(WindowPos3dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5168(%rax), %r11 + movq 5192(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3dvMESA), .-GL_PREFIX(WindowPos3dvMESA) @@ -24306,7 +24457,7 @@ GL_PREFIX(WindowPos3dvMESA): GL_PREFIX(WindowPos3fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -24318,13 +24469,13 @@ GL_PREFIX(WindowPos3fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -24336,7 +24487,7 @@ GL_PREFIX(WindowPos3fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $24, %rsp - movq 5176(%rax), %r11 + movq 5200(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3fMESA), .-GL_PREFIX(WindowPos3fMESA) @@ -24347,25 +24498,25 @@ GL_PREFIX(WindowPos3fMESA): GL_PREFIX(WindowPos3fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5184(%rax), %r11 + movq 5208(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3fvMESA), .-GL_PREFIX(WindowPos3fvMESA) @@ -24376,7 +24527,7 @@ GL_PREFIX(WindowPos3fvMESA): GL_PREFIX(WindowPos3iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24386,13 +24537,13 @@ GL_PREFIX(WindowPos3iMESA): popq %rdx popq %rsi popq %rdi - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24402,7 +24553,7 @@ GL_PREFIX(WindowPos3iMESA): popq %rdx popq %rsi popq %rdi - movq 5192(%rax), %r11 + movq 5216(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3iMESA), .-GL_PREFIX(WindowPos3iMESA) @@ -24413,25 +24564,25 @@ GL_PREFIX(WindowPos3iMESA): GL_PREFIX(WindowPos3ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5200(%rax), %r11 + movq 5224(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3ivMESA), .-GL_PREFIX(WindowPos3ivMESA) @@ -24442,7 +24593,7 @@ GL_PREFIX(WindowPos3ivMESA): GL_PREFIX(WindowPos3sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24452,13 +24603,13 @@ GL_PREFIX(WindowPos3sMESA): popq %rdx popq %rsi popq %rdi - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24468,7 +24619,7 @@ GL_PREFIX(WindowPos3sMESA): popq %rdx popq %rsi popq %rdi - movq 5208(%rax), %r11 + movq 5232(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3sMESA), .-GL_PREFIX(WindowPos3sMESA) @@ -24479,25 +24630,25 @@ GL_PREFIX(WindowPos3sMESA): GL_PREFIX(WindowPos3svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5216(%rax), %r11 + movq 5240(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos3svMESA), .-GL_PREFIX(WindowPos3svMESA) @@ -24508,7 +24659,7 @@ GL_PREFIX(WindowPos3svMESA): GL_PREFIX(WindowPos4dMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -24522,13 +24673,13 @@ GL_PREFIX(WindowPos4dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -24542,7 +24693,7 @@ GL_PREFIX(WindowPos4dMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5224(%rax), %r11 + movq 5248(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4dMESA), .-GL_PREFIX(WindowPos4dMESA) @@ -24553,25 +24704,25 @@ GL_PREFIX(WindowPos4dMESA): GL_PREFIX(WindowPos4dvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5232(%rax), %r11 + movq 5256(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4dvMESA), .-GL_PREFIX(WindowPos4dvMESA) @@ -24582,7 +24733,7 @@ GL_PREFIX(WindowPos4dvMESA): GL_PREFIX(WindowPos4fMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -24596,13 +24747,13 @@ GL_PREFIX(WindowPos4fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -24616,7 +24767,7 @@ GL_PREFIX(WindowPos4fMESA): movq 8(%rsp), %xmm1 movq (%rsp), %xmm0 addq $40, %rsp - movq 5240(%rax), %r11 + movq 5264(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4fMESA), .-GL_PREFIX(WindowPos4fMESA) @@ -24627,25 +24778,25 @@ GL_PREFIX(WindowPos4fMESA): GL_PREFIX(WindowPos4fvMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5248(%rax), %r11 + movq 5272(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4fvMESA), .-GL_PREFIX(WindowPos4fvMESA) @@ -24656,7 +24807,7 @@ GL_PREFIX(WindowPos4fvMESA): GL_PREFIX(WindowPos4iMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24670,13 +24821,13 @@ GL_PREFIX(WindowPos4iMESA): popq %rdx popq %rsi popq %rdi - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24690,7 +24841,7 @@ GL_PREFIX(WindowPos4iMESA): popq %rdx popq %rsi popq %rdi - movq 5256(%rax), %r11 + movq 5280(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4iMESA), .-GL_PREFIX(WindowPos4iMESA) @@ -24701,25 +24852,25 @@ GL_PREFIX(WindowPos4iMESA): GL_PREFIX(WindowPos4ivMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5264(%rax), %r11 + movq 5288(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4ivMESA), .-GL_PREFIX(WindowPos4ivMESA) @@ -24730,7 +24881,7 @@ GL_PREFIX(WindowPos4ivMESA): GL_PREFIX(WindowPos4sMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24744,13 +24895,13 @@ GL_PREFIX(WindowPos4sMESA): popq %rdx popq %rsi popq %rdi - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24764,7 +24915,7 @@ GL_PREFIX(WindowPos4sMESA): popq %rdx popq %rsi popq %rdi - movq 5272(%rax), %r11 + movq 5296(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4sMESA), .-GL_PREFIX(WindowPos4sMESA) @@ -24775,37 +24926,37 @@ GL_PREFIX(WindowPos4sMESA): GL_PREFIX(WindowPos4svMESA): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5280(%rax), %r11 + movq 5304(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(WindowPos4svMESA), .-GL_PREFIX(WindowPos4svMESA) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_661) - .type GL_PREFIX(_dispatch_stub_661), @function - HIDDEN(GL_PREFIX(_dispatch_stub_661)) -GL_PREFIX(_dispatch_stub_661): + .globl GL_PREFIX(_dispatch_stub_664) + .type GL_PREFIX(_dispatch_stub_664), @function + HIDDEN(GL_PREFIX(_dispatch_stub_664)) +GL_PREFIX(_dispatch_stub_664): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24819,13 +24970,13 @@ GL_PREFIX(_dispatch_stub_661): popq %rdx popq %rsi popq %rdi - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24839,19 +24990,19 @@ GL_PREFIX(_dispatch_stub_661): popq %rdx popq %rsi popq %rdi - movq 5288(%rax), %r11 + movq 5312(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_661), .-GL_PREFIX(_dispatch_stub_661) + .size GL_PREFIX(_dispatch_stub_664), .-GL_PREFIX(_dispatch_stub_664) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_662) - .type GL_PREFIX(_dispatch_stub_662), @function - HIDDEN(GL_PREFIX(_dispatch_stub_662)) -GL_PREFIX(_dispatch_stub_662): + .globl GL_PREFIX(_dispatch_stub_665) + .type GL_PREFIX(_dispatch_stub_665), @function + HIDDEN(GL_PREFIX(_dispatch_stub_665)) +GL_PREFIX(_dispatch_stub_665): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24869,13 +25020,13 @@ GL_PREFIX(_dispatch_stub_662): popq %rdx popq %rsi popq %rdi - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24893,19 +25044,19 @@ GL_PREFIX(_dispatch_stub_662): popq %rdx popq %rsi popq %rdi - movq 5296(%rax), %r11 + movq 5320(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_662), .-GL_PREFIX(_dispatch_stub_662) + .size GL_PREFIX(_dispatch_stub_665), .-GL_PREFIX(_dispatch_stub_665) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_663) - .type GL_PREFIX(_dispatch_stub_663), @function - HIDDEN(GL_PREFIX(_dispatch_stub_663)) -GL_PREFIX(_dispatch_stub_663): + .globl GL_PREFIX(_dispatch_stub_666) + .type GL_PREFIX(_dispatch_stub_666), @function + HIDDEN(GL_PREFIX(_dispatch_stub_666)) +GL_PREFIX(_dispatch_stub_666): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24915,13 +25066,13 @@ GL_PREFIX(_dispatch_stub_663): popq %rbp popq %rsi popq %rdi - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24931,49 +25082,49 @@ GL_PREFIX(_dispatch_stub_663): popq %rbp popq %rsi popq %rdi - movq 5304(%rax), %r11 + movq 5328(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_663), .-GL_PREFIX(_dispatch_stub_663) + .size GL_PREFIX(_dispatch_stub_666), .-GL_PREFIX(_dispatch_stub_666) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_664) - .type GL_PREFIX(_dispatch_stub_664), @function - HIDDEN(GL_PREFIX(_dispatch_stub_664)) -GL_PREFIX(_dispatch_stub_664): + .globl GL_PREFIX(_dispatch_stub_667) + .type GL_PREFIX(_dispatch_stub_667), @function + HIDDEN(GL_PREFIX(_dispatch_stub_667)) +GL_PREFIX(_dispatch_stub_667): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5312(%rax), %r11 + movq 5336(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_664), .-GL_PREFIX(_dispatch_stub_664) + .size GL_PREFIX(_dispatch_stub_667), .-GL_PREFIX(_dispatch_stub_667) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_665) - .type GL_PREFIX(_dispatch_stub_665), @function - HIDDEN(GL_PREFIX(_dispatch_stub_665)) -GL_PREFIX(_dispatch_stub_665): + .globl GL_PREFIX(_dispatch_stub_668) + .type GL_PREFIX(_dispatch_stub_668), @function + HIDDEN(GL_PREFIX(_dispatch_stub_668)) +GL_PREFIX(_dispatch_stub_668): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -24983,13 +25134,13 @@ GL_PREFIX(_dispatch_stub_665): popq %rbp popq %rsi popq %rdi - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -24999,19 +25150,19 @@ GL_PREFIX(_dispatch_stub_665): popq %rbp popq %rsi popq %rdi - movq 5320(%rax), %r11 + movq 5344(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_665), .-GL_PREFIX(_dispatch_stub_665) + .size GL_PREFIX(_dispatch_stub_668), .-GL_PREFIX(_dispatch_stub_668) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_666) - .type GL_PREFIX(_dispatch_stub_666), @function - HIDDEN(GL_PREFIX(_dispatch_stub_666)) -GL_PREFIX(_dispatch_stub_666): + .globl GL_PREFIX(_dispatch_stub_669) + .type GL_PREFIX(_dispatch_stub_669), @function + HIDDEN(GL_PREFIX(_dispatch_stub_669)) +GL_PREFIX(_dispatch_stub_669): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25021,13 +25172,13 @@ GL_PREFIX(_dispatch_stub_666): popq %rdx popq %rsi popq %rdi - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25037,49 +25188,49 @@ GL_PREFIX(_dispatch_stub_666): popq %rdx popq %rsi popq %rdi - movq 5328(%rax), %r11 + movq 5352(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_666), .-GL_PREFIX(_dispatch_stub_666) + .size GL_PREFIX(_dispatch_stub_669), .-GL_PREFIX(_dispatch_stub_669) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_667) - .type GL_PREFIX(_dispatch_stub_667), @function - HIDDEN(GL_PREFIX(_dispatch_stub_667)) -GL_PREFIX(_dispatch_stub_667): + .globl GL_PREFIX(_dispatch_stub_670) + .type GL_PREFIX(_dispatch_stub_670), @function + HIDDEN(GL_PREFIX(_dispatch_stub_670)) +GL_PREFIX(_dispatch_stub_670): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5336(%rax), %r11 + movq 5360(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_667), .-GL_PREFIX(_dispatch_stub_667) + .size GL_PREFIX(_dispatch_stub_670), .-GL_PREFIX(_dispatch_stub_670) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_668) - .type GL_PREFIX(_dispatch_stub_668), @function - HIDDEN(GL_PREFIX(_dispatch_stub_668)) -GL_PREFIX(_dispatch_stub_668): + .globl GL_PREFIX(_dispatch_stub_671) + .type GL_PREFIX(_dispatch_stub_671), @function + HIDDEN(GL_PREFIX(_dispatch_stub_671)) +GL_PREFIX(_dispatch_stub_671): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25089,13 +25240,13 @@ GL_PREFIX(_dispatch_stub_668): popq %rbp popq %rsi popq %rdi - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25105,40 +25256,40 @@ GL_PREFIX(_dispatch_stub_668): popq %rbp popq %rsi popq %rdi - movq 5344(%rax), %r11 + movq 5368(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_668), .-GL_PREFIX(_dispatch_stub_668) + .size GL_PREFIX(_dispatch_stub_671), .-GL_PREFIX(_dispatch_stub_671) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_669) - .type GL_PREFIX(_dispatch_stub_669), @function - HIDDEN(GL_PREFIX(_dispatch_stub_669)) -GL_PREFIX(_dispatch_stub_669): + .globl GL_PREFIX(_dispatch_stub_672) + .type GL_PREFIX(_dispatch_stub_672), @function + HIDDEN(GL_PREFIX(_dispatch_stub_672)) +GL_PREFIX(_dispatch_stub_672): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5352(%rax), %r11 + movq 5376(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_669), .-GL_PREFIX(_dispatch_stub_669) + .size GL_PREFIX(_dispatch_stub_672), .-GL_PREFIX(_dispatch_stub_672) .p2align 4,,15 .globl GL_PREFIX(AreProgramsResidentNV) @@ -25146,7 +25297,7 @@ GL_PREFIX(_dispatch_stub_669): GL_PREFIX(AreProgramsResidentNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25156,13 +25307,13 @@ GL_PREFIX(AreProgramsResidentNV): popq %rdx popq %rsi popq %rdi - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25172,7 +25323,7 @@ GL_PREFIX(AreProgramsResidentNV): popq %rdx popq %rsi popq %rdi - movq 5360(%rax), %r11 + movq 5384(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AreProgramsResidentNV), .-GL_PREFIX(AreProgramsResidentNV) @@ -25183,7 +25334,7 @@ GL_PREFIX(AreProgramsResidentNV): GL_PREFIX(BindProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25193,13 +25344,13 @@ GL_PREFIX(BindProgramNV): popq %rbp popq %rsi popq %rdi - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25209,7 +25360,7 @@ GL_PREFIX(BindProgramNV): popq %rbp popq %rsi popq %rdi - movq 5368(%rax), %r11 + movq 5392(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindProgramNV), .-GL_PREFIX(BindProgramNV) @@ -25220,7 +25371,7 @@ GL_PREFIX(BindProgramNV): GL_PREFIX(DeleteProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25230,13 +25381,13 @@ GL_PREFIX(DeleteProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25246,7 +25397,7 @@ GL_PREFIX(DeleteProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5376(%rax), %r11 + movq 5400(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteProgramsNV), .-GL_PREFIX(DeleteProgramsNV) @@ -25257,7 +25408,7 @@ GL_PREFIX(DeleteProgramsNV): GL_PREFIX(ExecuteProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25267,13 +25418,13 @@ GL_PREFIX(ExecuteProgramNV): popq %rdx popq %rsi popq %rdi - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25283,7 +25434,7 @@ GL_PREFIX(ExecuteProgramNV): popq %rdx popq %rsi popq %rdi - movq 5384(%rax), %r11 + movq 5408(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ExecuteProgramNV), .-GL_PREFIX(ExecuteProgramNV) @@ -25294,7 +25445,7 @@ GL_PREFIX(ExecuteProgramNV): GL_PREFIX(GenProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25304,13 +25455,13 @@ GL_PREFIX(GenProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25320,7 +25471,7 @@ GL_PREFIX(GenProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5392(%rax), %r11 + movq 5416(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenProgramsNV), .-GL_PREFIX(GenProgramsNV) @@ -25331,7 +25482,7 @@ GL_PREFIX(GenProgramsNV): GL_PREFIX(GetProgramParameterdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25345,13 +25496,13 @@ GL_PREFIX(GetProgramParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25365,7 +25516,7 @@ GL_PREFIX(GetProgramParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 5400(%rax), %r11 + movq 5424(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramParameterdvNV), .-GL_PREFIX(GetProgramParameterdvNV) @@ -25376,7 +25527,7 @@ GL_PREFIX(GetProgramParameterdvNV): GL_PREFIX(GetProgramParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25390,13 +25541,13 @@ GL_PREFIX(GetProgramParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25410,7 +25561,7 @@ GL_PREFIX(GetProgramParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 5408(%rax), %r11 + movq 5432(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramParameterfvNV), .-GL_PREFIX(GetProgramParameterfvNV) @@ -25421,7 +25572,7 @@ GL_PREFIX(GetProgramParameterfvNV): GL_PREFIX(GetProgramStringNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25431,13 +25582,13 @@ GL_PREFIX(GetProgramStringNV): popq %rdx popq %rsi popq %rdi - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25447,7 +25598,7 @@ GL_PREFIX(GetProgramStringNV): popq %rdx popq %rsi popq %rdi - movq 5416(%rax), %r11 + movq 5440(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramStringNV), .-GL_PREFIX(GetProgramStringNV) @@ -25458,7 +25609,7 @@ GL_PREFIX(GetProgramStringNV): GL_PREFIX(GetProgramivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25468,13 +25619,13 @@ GL_PREFIX(GetProgramivNV): popq %rdx popq %rsi popq %rdi - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25484,7 +25635,7 @@ GL_PREFIX(GetProgramivNV): popq %rdx popq %rsi popq %rdi - movq 5424(%rax), %r11 + movq 5448(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramivNV), .-GL_PREFIX(GetProgramivNV) @@ -25495,7 +25646,7 @@ GL_PREFIX(GetProgramivNV): GL_PREFIX(GetTrackMatrixivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25509,13 +25660,13 @@ GL_PREFIX(GetTrackMatrixivNV): popq %rdx popq %rsi popq %rdi - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25529,7 +25680,7 @@ GL_PREFIX(GetTrackMatrixivNV): popq %rdx popq %rsi popq %rdi - movq 5432(%rax), %r11 + movq 5456(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetTrackMatrixivNV), .-GL_PREFIX(GetTrackMatrixivNV) @@ -25540,7 +25691,7 @@ GL_PREFIX(GetTrackMatrixivNV): GL_PREFIX(GetVertexAttribPointervNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25550,13 +25701,13 @@ GL_PREFIX(GetVertexAttribPointervNV): popq %rdx popq %rsi popq %rdi - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25566,7 +25717,7 @@ GL_PREFIX(GetVertexAttribPointervNV): popq %rdx popq %rsi popq %rdi - movq 5440(%rax), %r11 + movq 5464(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribPointervNV), .-GL_PREFIX(GetVertexAttribPointervNV) @@ -25577,7 +25728,7 @@ GL_PREFIX(GetVertexAttribPointervNV): GL_PREFIX(GetVertexAttribdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25587,13 +25738,13 @@ GL_PREFIX(GetVertexAttribdvNV): popq %rdx popq %rsi popq %rdi - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25603,7 +25754,7 @@ GL_PREFIX(GetVertexAttribdvNV): popq %rdx popq %rsi popq %rdi - movq 5448(%rax), %r11 + movq 5472(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribdvNV), .-GL_PREFIX(GetVertexAttribdvNV) @@ -25614,7 +25765,7 @@ GL_PREFIX(GetVertexAttribdvNV): GL_PREFIX(GetVertexAttribfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25624,13 +25775,13 @@ GL_PREFIX(GetVertexAttribfvNV): popq %rdx popq %rsi popq %rdi - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25640,7 +25791,7 @@ GL_PREFIX(GetVertexAttribfvNV): popq %rdx popq %rsi popq %rdi - movq 5456(%rax), %r11 + movq 5480(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribfvNV), .-GL_PREFIX(GetVertexAttribfvNV) @@ -25651,7 +25802,7 @@ GL_PREFIX(GetVertexAttribfvNV): GL_PREFIX(GetVertexAttribivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25661,13 +25812,13 @@ GL_PREFIX(GetVertexAttribivNV): popq %rdx popq %rsi popq %rdi - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25677,7 +25828,7 @@ GL_PREFIX(GetVertexAttribivNV): popq %rdx popq %rsi popq %rdi - movq 5464(%rax), %r11 + movq 5488(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetVertexAttribivNV), .-GL_PREFIX(GetVertexAttribivNV) @@ -25688,25 +25839,25 @@ GL_PREFIX(GetVertexAttribivNV): GL_PREFIX(IsProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5472(%rax), %r11 + movq 5496(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsProgramNV), .-GL_PREFIX(IsProgramNV) @@ -25717,7 +25868,7 @@ GL_PREFIX(IsProgramNV): GL_PREFIX(LoadProgramNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25731,13 +25882,13 @@ GL_PREFIX(LoadProgramNV): popq %rdx popq %rsi popq %rdi - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25751,7 +25902,7 @@ GL_PREFIX(LoadProgramNV): popq %rdx popq %rsi popq %rdi - movq 5480(%rax), %r11 + movq 5504(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(LoadProgramNV), .-GL_PREFIX(LoadProgramNV) @@ -25762,7 +25913,7 @@ GL_PREFIX(LoadProgramNV): GL_PREFIX(ProgramParameters4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25776,13 +25927,13 @@ GL_PREFIX(ProgramParameters4dvNV): popq %rdx popq %rsi popq %rdi - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25796,7 +25947,7 @@ GL_PREFIX(ProgramParameters4dvNV): popq %rdx popq %rsi popq %rdi - movq 5488(%rax), %r11 + movq 5512(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameters4dvNV), .-GL_PREFIX(ProgramParameters4dvNV) @@ -25807,7 +25958,7 @@ GL_PREFIX(ProgramParameters4dvNV): GL_PREFIX(ProgramParameters4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25821,13 +25972,13 @@ GL_PREFIX(ProgramParameters4fvNV): popq %rdx popq %rsi popq %rdi - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25841,7 +25992,7 @@ GL_PREFIX(ProgramParameters4fvNV): popq %rdx popq %rsi popq %rdi - movq 5496(%rax), %r11 + movq 5520(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramParameters4fvNV), .-GL_PREFIX(ProgramParameters4fvNV) @@ -25852,7 +26003,7 @@ GL_PREFIX(ProgramParameters4fvNV): GL_PREFIX(RequestResidentProgramsNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25862,13 +26013,13 @@ GL_PREFIX(RequestResidentProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25878,7 +26029,7 @@ GL_PREFIX(RequestResidentProgramsNV): popq %rbp popq %rsi popq %rdi - movq 5504(%rax), %r11 + movq 5528(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(RequestResidentProgramsNV), .-GL_PREFIX(RequestResidentProgramsNV) @@ -25889,7 +26040,7 @@ GL_PREFIX(RequestResidentProgramsNV): GL_PREFIX(TrackMatrixNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25903,13 +26054,13 @@ GL_PREFIX(TrackMatrixNV): popq %rdx popq %rsi popq %rdi - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25923,7 +26074,7 @@ GL_PREFIX(TrackMatrixNV): popq %rdx popq %rsi popq %rdi - movq 5512(%rax), %r11 + movq 5536(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TrackMatrixNV), .-GL_PREFIX(TrackMatrixNV) @@ -25934,7 +26085,7 @@ GL_PREFIX(TrackMatrixNV): GL_PREFIX(VertexAttrib1dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -25944,13 +26095,13 @@ GL_PREFIX(VertexAttrib1dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -25960,7 +26111,7 @@ GL_PREFIX(VertexAttrib1dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5520(%rax), %r11 + movq 5544(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1dNV), .-GL_PREFIX(VertexAttrib1dNV) @@ -25971,7 +26122,7 @@ GL_PREFIX(VertexAttrib1dNV): GL_PREFIX(VertexAttrib1dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -25981,13 +26132,13 @@ GL_PREFIX(VertexAttrib1dvNV): popq %rbp popq %rsi popq %rdi - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -25997,7 +26148,7 @@ GL_PREFIX(VertexAttrib1dvNV): popq %rbp popq %rsi popq %rdi - movq 5528(%rax), %r11 + movq 5552(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1dvNV), .-GL_PREFIX(VertexAttrib1dvNV) @@ -26008,7 +26159,7 @@ GL_PREFIX(VertexAttrib1dvNV): GL_PREFIX(VertexAttrib1fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -26018,13 +26169,13 @@ GL_PREFIX(VertexAttrib1fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -26034,7 +26185,7 @@ GL_PREFIX(VertexAttrib1fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5536(%rax), %r11 + movq 5560(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1fNV), .-GL_PREFIX(VertexAttrib1fNV) @@ -26045,7 +26196,7 @@ GL_PREFIX(VertexAttrib1fNV): GL_PREFIX(VertexAttrib1fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26055,13 +26206,13 @@ GL_PREFIX(VertexAttrib1fvNV): popq %rbp popq %rsi popq %rdi - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26071,7 +26222,7 @@ GL_PREFIX(VertexAttrib1fvNV): popq %rbp popq %rsi popq %rdi - movq 5544(%rax), %r11 + movq 5568(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1fvNV), .-GL_PREFIX(VertexAttrib1fvNV) @@ -26082,7 +26233,7 @@ GL_PREFIX(VertexAttrib1fvNV): GL_PREFIX(VertexAttrib1sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26092,13 +26243,13 @@ GL_PREFIX(VertexAttrib1sNV): popq %rbp popq %rsi popq %rdi - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26108,7 +26259,7 @@ GL_PREFIX(VertexAttrib1sNV): popq %rbp popq %rsi popq %rdi - movq 5552(%rax), %r11 + movq 5576(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1sNV), .-GL_PREFIX(VertexAttrib1sNV) @@ -26119,7 +26270,7 @@ GL_PREFIX(VertexAttrib1sNV): GL_PREFIX(VertexAttrib1svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26129,13 +26280,13 @@ GL_PREFIX(VertexAttrib1svNV): popq %rbp popq %rsi popq %rdi - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26145,7 +26296,7 @@ GL_PREFIX(VertexAttrib1svNV): popq %rbp popq %rsi popq %rdi - movq 5560(%rax), %r11 + movq 5584(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib1svNV), .-GL_PREFIX(VertexAttrib1svNV) @@ -26156,7 +26307,7 @@ GL_PREFIX(VertexAttrib1svNV): GL_PREFIX(VertexAttrib2dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -26168,13 +26319,13 @@ GL_PREFIX(VertexAttrib2dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -26186,7 +26337,7 @@ GL_PREFIX(VertexAttrib2dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5568(%rax), %r11 + movq 5592(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2dNV), .-GL_PREFIX(VertexAttrib2dNV) @@ -26197,7 +26348,7 @@ GL_PREFIX(VertexAttrib2dNV): GL_PREFIX(VertexAttrib2dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26207,13 +26358,13 @@ GL_PREFIX(VertexAttrib2dvNV): popq %rbp popq %rsi popq %rdi - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26223,7 +26374,7 @@ GL_PREFIX(VertexAttrib2dvNV): popq %rbp popq %rsi popq %rdi - movq 5576(%rax), %r11 + movq 5600(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2dvNV), .-GL_PREFIX(VertexAttrib2dvNV) @@ -26234,7 +26385,7 @@ GL_PREFIX(VertexAttrib2dvNV): GL_PREFIX(VertexAttrib2fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $24, %rsp @@ -26246,13 +26397,13 @@ GL_PREFIX(VertexAttrib2fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 1: subq $24, %rsp @@ -26264,7 +26415,7 @@ GL_PREFIX(VertexAttrib2fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $24, %rsp - movq 5584(%rax), %r11 + movq 5608(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2fNV), .-GL_PREFIX(VertexAttrib2fNV) @@ -26275,7 +26426,7 @@ GL_PREFIX(VertexAttrib2fNV): GL_PREFIX(VertexAttrib2fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26285,13 +26436,13 @@ GL_PREFIX(VertexAttrib2fvNV): popq %rbp popq %rsi popq %rdi - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26301,7 +26452,7 @@ GL_PREFIX(VertexAttrib2fvNV): popq %rbp popq %rsi popq %rdi - movq 5592(%rax), %r11 + movq 5616(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2fvNV), .-GL_PREFIX(VertexAttrib2fvNV) @@ -26312,7 +26463,7 @@ GL_PREFIX(VertexAttrib2fvNV): GL_PREFIX(VertexAttrib2sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26322,13 +26473,13 @@ GL_PREFIX(VertexAttrib2sNV): popq %rdx popq %rsi popq %rdi - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26338,7 +26489,7 @@ GL_PREFIX(VertexAttrib2sNV): popq %rdx popq %rsi popq %rdi - movq 5600(%rax), %r11 + movq 5624(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2sNV), .-GL_PREFIX(VertexAttrib2sNV) @@ -26349,7 +26500,7 @@ GL_PREFIX(VertexAttrib2sNV): GL_PREFIX(VertexAttrib2svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26359,13 +26510,13 @@ GL_PREFIX(VertexAttrib2svNV): popq %rbp popq %rsi popq %rdi - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26375,7 +26526,7 @@ GL_PREFIX(VertexAttrib2svNV): popq %rbp popq %rsi popq %rdi - movq 5608(%rax), %r11 + movq 5632(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib2svNV), .-GL_PREFIX(VertexAttrib2svNV) @@ -26386,7 +26537,7 @@ GL_PREFIX(VertexAttrib2svNV): GL_PREFIX(VertexAttrib3dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26400,13 +26551,13 @@ GL_PREFIX(VertexAttrib3dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26420,7 +26571,7 @@ GL_PREFIX(VertexAttrib3dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5616(%rax), %r11 + movq 5640(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3dNV), .-GL_PREFIX(VertexAttrib3dNV) @@ -26431,7 +26582,7 @@ GL_PREFIX(VertexAttrib3dNV): GL_PREFIX(VertexAttrib3dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26441,13 +26592,13 @@ GL_PREFIX(VertexAttrib3dvNV): popq %rbp popq %rsi popq %rdi - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26457,7 +26608,7 @@ GL_PREFIX(VertexAttrib3dvNV): popq %rbp popq %rsi popq %rdi - movq 5624(%rax), %r11 + movq 5648(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3dvNV), .-GL_PREFIX(VertexAttrib3dvNV) @@ -26468,7 +26619,7 @@ GL_PREFIX(VertexAttrib3dvNV): GL_PREFIX(VertexAttrib3fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26482,13 +26633,13 @@ GL_PREFIX(VertexAttrib3fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26502,7 +26653,7 @@ GL_PREFIX(VertexAttrib3fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5632(%rax), %r11 + movq 5656(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3fNV), .-GL_PREFIX(VertexAttrib3fNV) @@ -26513,7 +26664,7 @@ GL_PREFIX(VertexAttrib3fNV): GL_PREFIX(VertexAttrib3fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26523,13 +26674,13 @@ GL_PREFIX(VertexAttrib3fvNV): popq %rbp popq %rsi popq %rdi - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26539,7 +26690,7 @@ GL_PREFIX(VertexAttrib3fvNV): popq %rbp popq %rsi popq %rdi - movq 5640(%rax), %r11 + movq 5664(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3fvNV), .-GL_PREFIX(VertexAttrib3fvNV) @@ -26550,7 +26701,7 @@ GL_PREFIX(VertexAttrib3fvNV): GL_PREFIX(VertexAttrib3sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26564,13 +26715,13 @@ GL_PREFIX(VertexAttrib3sNV): popq %rdx popq %rsi popq %rdi - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26584,7 +26735,7 @@ GL_PREFIX(VertexAttrib3sNV): popq %rdx popq %rsi popq %rdi - movq 5648(%rax), %r11 + movq 5672(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3sNV), .-GL_PREFIX(VertexAttrib3sNV) @@ -26595,7 +26746,7 @@ GL_PREFIX(VertexAttrib3sNV): GL_PREFIX(VertexAttrib3svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26605,13 +26756,13 @@ GL_PREFIX(VertexAttrib3svNV): popq %rbp popq %rsi popq %rdi - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26621,7 +26772,7 @@ GL_PREFIX(VertexAttrib3svNV): popq %rbp popq %rsi popq %rdi - movq 5656(%rax), %r11 + movq 5680(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib3svNV), .-GL_PREFIX(VertexAttrib3svNV) @@ -26632,7 +26783,7 @@ GL_PREFIX(VertexAttrib3svNV): GL_PREFIX(VertexAttrib4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26648,13 +26799,13 @@ GL_PREFIX(VertexAttrib4dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26670,7 +26821,7 @@ GL_PREFIX(VertexAttrib4dNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5664(%rax), %r11 + movq 5688(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4dNV), .-GL_PREFIX(VertexAttrib4dNV) @@ -26681,7 +26832,7 @@ GL_PREFIX(VertexAttrib4dNV): GL_PREFIX(VertexAttrib4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26691,13 +26842,13 @@ GL_PREFIX(VertexAttrib4dvNV): popq %rbp popq %rsi popq %rdi - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26707,7 +26858,7 @@ GL_PREFIX(VertexAttrib4dvNV): popq %rbp popq %rsi popq %rdi - movq 5672(%rax), %r11 + movq 5696(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4dvNV), .-GL_PREFIX(VertexAttrib4dvNV) @@ -26718,7 +26869,7 @@ GL_PREFIX(VertexAttrib4dvNV): GL_PREFIX(VertexAttrib4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $40, %rsp @@ -26734,13 +26885,13 @@ GL_PREFIX(VertexAttrib4fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 1: subq $40, %rsp @@ -26756,7 +26907,7 @@ GL_PREFIX(VertexAttrib4fNV): movq 8(%rsp), %xmm0 movq (%rsp), %rdi addq $40, %rsp - movq 5680(%rax), %r11 + movq 5704(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4fNV), .-GL_PREFIX(VertexAttrib4fNV) @@ -26767,7 +26918,7 @@ GL_PREFIX(VertexAttrib4fNV): GL_PREFIX(VertexAttrib4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26777,13 +26928,13 @@ GL_PREFIX(VertexAttrib4fvNV): popq %rbp popq %rsi popq %rdi - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26793,7 +26944,7 @@ GL_PREFIX(VertexAttrib4fvNV): popq %rbp popq %rsi popq %rdi - movq 5688(%rax), %r11 + movq 5712(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4fvNV), .-GL_PREFIX(VertexAttrib4fvNV) @@ -26804,7 +26955,7 @@ GL_PREFIX(VertexAttrib4fvNV): GL_PREFIX(VertexAttrib4sNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26818,13 +26969,13 @@ GL_PREFIX(VertexAttrib4sNV): popq %rdx popq %rsi popq %rdi - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26838,7 +26989,7 @@ GL_PREFIX(VertexAttrib4sNV): popq %rdx popq %rsi popq %rdi - movq 5696(%rax), %r11 + movq 5720(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4sNV), .-GL_PREFIX(VertexAttrib4sNV) @@ -26849,7 +27000,7 @@ GL_PREFIX(VertexAttrib4sNV): GL_PREFIX(VertexAttrib4svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26859,13 +27010,13 @@ GL_PREFIX(VertexAttrib4svNV): popq %rbp popq %rsi popq %rdi - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26875,7 +27026,7 @@ GL_PREFIX(VertexAttrib4svNV): popq %rbp popq %rsi popq %rdi - movq 5704(%rax), %r11 + movq 5728(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4svNV), .-GL_PREFIX(VertexAttrib4svNV) @@ -26886,7 +27037,7 @@ GL_PREFIX(VertexAttrib4svNV): GL_PREFIX(VertexAttrib4ubNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26900,13 +27051,13 @@ GL_PREFIX(VertexAttrib4ubNV): popq %rdx popq %rsi popq %rdi - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26920,7 +27071,7 @@ GL_PREFIX(VertexAttrib4ubNV): popq %rdx popq %rsi popq %rdi - movq 5712(%rax), %r11 + movq 5736(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4ubNV), .-GL_PREFIX(VertexAttrib4ubNV) @@ -26931,7 +27082,7 @@ GL_PREFIX(VertexAttrib4ubNV): GL_PREFIX(VertexAttrib4ubvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26941,13 +27092,13 @@ GL_PREFIX(VertexAttrib4ubvNV): popq %rbp popq %rsi popq %rdi - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -26957,7 +27108,7 @@ GL_PREFIX(VertexAttrib4ubvNV): popq %rbp popq %rsi popq %rdi - movq 5720(%rax), %r11 + movq 5744(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttrib4ubvNV), .-GL_PREFIX(VertexAttrib4ubvNV) @@ -26968,7 +27119,7 @@ GL_PREFIX(VertexAttrib4ubvNV): GL_PREFIX(VertexAttribPointerNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -26982,13 +27133,13 @@ GL_PREFIX(VertexAttribPointerNV): popq %rdx popq %rsi popq %rdi - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27002,7 +27153,7 @@ GL_PREFIX(VertexAttribPointerNV): popq %rdx popq %rsi popq %rdi - movq 5728(%rax), %r11 + movq 5752(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribPointerNV), .-GL_PREFIX(VertexAttribPointerNV) @@ -27013,7 +27164,7 @@ GL_PREFIX(VertexAttribPointerNV): GL_PREFIX(VertexAttribs1dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27023,13 +27174,13 @@ GL_PREFIX(VertexAttribs1dvNV): popq %rdx popq %rsi popq %rdi - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27039,7 +27190,7 @@ GL_PREFIX(VertexAttribs1dvNV): popq %rdx popq %rsi popq %rdi - movq 5736(%rax), %r11 + movq 5760(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1dvNV), .-GL_PREFIX(VertexAttribs1dvNV) @@ -27050,7 +27201,7 @@ GL_PREFIX(VertexAttribs1dvNV): GL_PREFIX(VertexAttribs1fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27060,13 +27211,13 @@ GL_PREFIX(VertexAttribs1fvNV): popq %rdx popq %rsi popq %rdi - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27076,7 +27227,7 @@ GL_PREFIX(VertexAttribs1fvNV): popq %rdx popq %rsi popq %rdi - movq 5744(%rax), %r11 + movq 5768(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1fvNV), .-GL_PREFIX(VertexAttribs1fvNV) @@ -27087,7 +27238,7 @@ GL_PREFIX(VertexAttribs1fvNV): GL_PREFIX(VertexAttribs1svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27097,13 +27248,13 @@ GL_PREFIX(VertexAttribs1svNV): popq %rdx popq %rsi popq %rdi - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27113,7 +27264,7 @@ GL_PREFIX(VertexAttribs1svNV): popq %rdx popq %rsi popq %rdi - movq 5752(%rax), %r11 + movq 5776(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs1svNV), .-GL_PREFIX(VertexAttribs1svNV) @@ -27124,7 +27275,7 @@ GL_PREFIX(VertexAttribs1svNV): GL_PREFIX(VertexAttribs2dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27134,13 +27285,13 @@ GL_PREFIX(VertexAttribs2dvNV): popq %rdx popq %rsi popq %rdi - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27150,7 +27301,7 @@ GL_PREFIX(VertexAttribs2dvNV): popq %rdx popq %rsi popq %rdi - movq 5760(%rax), %r11 + movq 5784(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2dvNV), .-GL_PREFIX(VertexAttribs2dvNV) @@ -27161,7 +27312,7 @@ GL_PREFIX(VertexAttribs2dvNV): GL_PREFIX(VertexAttribs2fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27171,13 +27322,13 @@ GL_PREFIX(VertexAttribs2fvNV): popq %rdx popq %rsi popq %rdi - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27187,7 +27338,7 @@ GL_PREFIX(VertexAttribs2fvNV): popq %rdx popq %rsi popq %rdi - movq 5768(%rax), %r11 + movq 5792(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2fvNV), .-GL_PREFIX(VertexAttribs2fvNV) @@ -27198,7 +27349,7 @@ GL_PREFIX(VertexAttribs2fvNV): GL_PREFIX(VertexAttribs2svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27208,13 +27359,13 @@ GL_PREFIX(VertexAttribs2svNV): popq %rdx popq %rsi popq %rdi - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27224,7 +27375,7 @@ GL_PREFIX(VertexAttribs2svNV): popq %rdx popq %rsi popq %rdi - movq 5776(%rax), %r11 + movq 5800(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs2svNV), .-GL_PREFIX(VertexAttribs2svNV) @@ -27235,7 +27386,7 @@ GL_PREFIX(VertexAttribs2svNV): GL_PREFIX(VertexAttribs3dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27245,13 +27396,13 @@ GL_PREFIX(VertexAttribs3dvNV): popq %rdx popq %rsi popq %rdi - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27261,7 +27412,7 @@ GL_PREFIX(VertexAttribs3dvNV): popq %rdx popq %rsi popq %rdi - movq 5784(%rax), %r11 + movq 5808(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3dvNV), .-GL_PREFIX(VertexAttribs3dvNV) @@ -27272,7 +27423,7 @@ GL_PREFIX(VertexAttribs3dvNV): GL_PREFIX(VertexAttribs3fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27282,13 +27433,13 @@ GL_PREFIX(VertexAttribs3fvNV): popq %rdx popq %rsi popq %rdi - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27298,7 +27449,7 @@ GL_PREFIX(VertexAttribs3fvNV): popq %rdx popq %rsi popq %rdi - movq 5792(%rax), %r11 + movq 5816(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3fvNV), .-GL_PREFIX(VertexAttribs3fvNV) @@ -27309,7 +27460,7 @@ GL_PREFIX(VertexAttribs3fvNV): GL_PREFIX(VertexAttribs3svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27319,13 +27470,13 @@ GL_PREFIX(VertexAttribs3svNV): popq %rdx popq %rsi popq %rdi - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27335,7 +27486,7 @@ GL_PREFIX(VertexAttribs3svNV): popq %rdx popq %rsi popq %rdi - movq 5800(%rax), %r11 + movq 5824(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs3svNV), .-GL_PREFIX(VertexAttribs3svNV) @@ -27346,7 +27497,7 @@ GL_PREFIX(VertexAttribs3svNV): GL_PREFIX(VertexAttribs4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27356,13 +27507,13 @@ GL_PREFIX(VertexAttribs4dvNV): popq %rdx popq %rsi popq %rdi - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27372,7 +27523,7 @@ GL_PREFIX(VertexAttribs4dvNV): popq %rdx popq %rsi popq %rdi - movq 5808(%rax), %r11 + movq 5832(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4dvNV), .-GL_PREFIX(VertexAttribs4dvNV) @@ -27383,7 +27534,7 @@ GL_PREFIX(VertexAttribs4dvNV): GL_PREFIX(VertexAttribs4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27393,13 +27544,13 @@ GL_PREFIX(VertexAttribs4fvNV): popq %rdx popq %rsi popq %rdi - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27409,7 +27560,7 @@ GL_PREFIX(VertexAttribs4fvNV): popq %rdx popq %rsi popq %rdi - movq 5816(%rax), %r11 + movq 5840(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4fvNV), .-GL_PREFIX(VertexAttribs4fvNV) @@ -27420,7 +27571,7 @@ GL_PREFIX(VertexAttribs4fvNV): GL_PREFIX(VertexAttribs4svNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27430,13 +27581,13 @@ GL_PREFIX(VertexAttribs4svNV): popq %rdx popq %rsi popq %rdi - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27446,7 +27597,7 @@ GL_PREFIX(VertexAttribs4svNV): popq %rdx popq %rsi popq %rdi - movq 5824(%rax), %r11 + movq 5848(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4svNV), .-GL_PREFIX(VertexAttribs4svNV) @@ -27457,7 +27608,7 @@ GL_PREFIX(VertexAttribs4svNV): GL_PREFIX(VertexAttribs4ubvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27467,13 +27618,13 @@ GL_PREFIX(VertexAttribs4ubvNV): popq %rdx popq %rsi popq %rdi - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27483,7 +27634,7 @@ GL_PREFIX(VertexAttribs4ubvNV): popq %rdx popq %rsi popq %rdi - movq 5832(%rax), %r11 + movq 5856(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(VertexAttribs4ubvNV), .-GL_PREFIX(VertexAttribs4ubvNV) @@ -27494,7 +27645,7 @@ GL_PREFIX(VertexAttribs4ubvNV): GL_PREFIX(GetTexBumpParameterfvATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27504,13 +27655,13 @@ GL_PREFIX(GetTexBumpParameterfvATI): popq %rbp popq %rsi popq %rdi - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27520,7 +27671,7 @@ GL_PREFIX(GetTexBumpParameterfvATI): popq %rbp popq %rsi popq %rdi - movq 5840(%rax), %r11 + movq 5864(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetTexBumpParameterfvATI), .-GL_PREFIX(GetTexBumpParameterfvATI) @@ -27531,7 +27682,7 @@ GL_PREFIX(GetTexBumpParameterfvATI): GL_PREFIX(GetTexBumpParameterivATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27541,13 +27692,13 @@ GL_PREFIX(GetTexBumpParameterivATI): popq %rbp popq %rsi popq %rdi - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27557,7 +27708,7 @@ GL_PREFIX(GetTexBumpParameterivATI): popq %rbp popq %rsi popq %rdi - movq 5848(%rax), %r11 + movq 5872(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetTexBumpParameterivATI), .-GL_PREFIX(GetTexBumpParameterivATI) @@ -27568,7 +27719,7 @@ GL_PREFIX(GetTexBumpParameterivATI): GL_PREFIX(TexBumpParameterfvATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27578,13 +27729,13 @@ GL_PREFIX(TexBumpParameterfvATI): popq %rbp popq %rsi popq %rdi - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27594,7 +27745,7 @@ GL_PREFIX(TexBumpParameterfvATI): popq %rbp popq %rsi popq %rdi - movq 5856(%rax), %r11 + movq 5880(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TexBumpParameterfvATI), .-GL_PREFIX(TexBumpParameterfvATI) @@ -27605,7 +27756,7 @@ GL_PREFIX(TexBumpParameterfvATI): GL_PREFIX(TexBumpParameterivATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27615,13 +27766,13 @@ GL_PREFIX(TexBumpParameterivATI): popq %rbp popq %rsi popq %rdi - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27631,7 +27782,7 @@ GL_PREFIX(TexBumpParameterivATI): popq %rbp popq %rsi popq %rdi - movq 5864(%rax), %r11 + movq 5888(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(TexBumpParameterivATI), .-GL_PREFIX(TexBumpParameterivATI) @@ -27642,7 +27793,7 @@ GL_PREFIX(TexBumpParameterivATI): GL_PREFIX(AlphaFragmentOp1ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27660,13 +27811,13 @@ GL_PREFIX(AlphaFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27684,7 +27835,7 @@ GL_PREFIX(AlphaFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5872(%rax), %r11 + movq 5896(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp1ATI), .-GL_PREFIX(AlphaFragmentOp1ATI) @@ -27695,7 +27846,7 @@ GL_PREFIX(AlphaFragmentOp1ATI): GL_PREFIX(AlphaFragmentOp2ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27713,13 +27864,13 @@ GL_PREFIX(AlphaFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27737,7 +27888,7 @@ GL_PREFIX(AlphaFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5880(%rax), %r11 + movq 5904(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp2ATI), .-GL_PREFIX(AlphaFragmentOp2ATI) @@ -27748,7 +27899,7 @@ GL_PREFIX(AlphaFragmentOp2ATI): GL_PREFIX(AlphaFragmentOp3ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27766,13 +27917,13 @@ GL_PREFIX(AlphaFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27790,7 +27941,7 @@ GL_PREFIX(AlphaFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5888(%rax), %r11 + movq 5912(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(AlphaFragmentOp3ATI), .-GL_PREFIX(AlphaFragmentOp3ATI) @@ -27801,25 +27952,25 @@ GL_PREFIX(AlphaFragmentOp3ATI): GL_PREFIX(BeginFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5896(%rax), %r11 + movq 5920(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BeginFragmentShaderATI), .-GL_PREFIX(BeginFragmentShaderATI) @@ -27830,25 +27981,25 @@ GL_PREFIX(BeginFragmentShaderATI): GL_PREFIX(BindFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5904(%rax), %r11 + movq 5928(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindFragmentShaderATI), .-GL_PREFIX(BindFragmentShaderATI) @@ -27859,7 +28010,7 @@ GL_PREFIX(BindFragmentShaderATI): GL_PREFIX(ColorFragmentOp1ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27877,13 +28028,13 @@ GL_PREFIX(ColorFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27901,7 +28052,7 @@ GL_PREFIX(ColorFragmentOp1ATI): popq %rdx popq %rsi popq %rdi - movq 5912(%rax), %r11 + movq 5936(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp1ATI), .-GL_PREFIX(ColorFragmentOp1ATI) @@ -27912,7 +28063,7 @@ GL_PREFIX(ColorFragmentOp1ATI): GL_PREFIX(ColorFragmentOp2ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27930,13 +28081,13 @@ GL_PREFIX(ColorFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -27954,7 +28105,7 @@ GL_PREFIX(ColorFragmentOp2ATI): popq %rdx popq %rsi popq %rdi - movq 5920(%rax), %r11 + movq 5944(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp2ATI), .-GL_PREFIX(ColorFragmentOp2ATI) @@ -27965,7 +28116,7 @@ GL_PREFIX(ColorFragmentOp2ATI): GL_PREFIX(ColorFragmentOp3ATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -27983,13 +28134,13 @@ GL_PREFIX(ColorFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28007,7 +28158,7 @@ GL_PREFIX(ColorFragmentOp3ATI): popq %rdx popq %rsi popq %rdi - movq 5928(%rax), %r11 + movq 5952(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ColorFragmentOp3ATI), .-GL_PREFIX(ColorFragmentOp3ATI) @@ -28018,25 +28169,25 @@ GL_PREFIX(ColorFragmentOp3ATI): GL_PREFIX(DeleteFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5936(%rax), %r11 + movq 5960(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteFragmentShaderATI), .-GL_PREFIX(DeleteFragmentShaderATI) @@ -28047,25 +28198,25 @@ GL_PREFIX(DeleteFragmentShaderATI): GL_PREFIX(EndFragmentShaderATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 1: pushq %rbp call _glapi_get_dispatch popq %rbp - movq 5944(%rax), %r11 + movq 5968(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EndFragmentShaderATI), .-GL_PREFIX(EndFragmentShaderATI) @@ -28076,25 +28227,25 @@ GL_PREFIX(EndFragmentShaderATI): GL_PREFIX(GenFragmentShadersATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 5952(%rax), %r11 + movq 5976(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenFragmentShadersATI), .-GL_PREFIX(GenFragmentShadersATI) @@ -28105,7 +28256,7 @@ GL_PREFIX(GenFragmentShadersATI): GL_PREFIX(PassTexCoordATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28115,13 +28266,13 @@ GL_PREFIX(PassTexCoordATI): popq %rdx popq %rsi popq %rdi - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28131,7 +28282,7 @@ GL_PREFIX(PassTexCoordATI): popq %rdx popq %rsi popq %rdi - movq 5960(%rax), %r11 + movq 5984(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PassTexCoordATI), .-GL_PREFIX(PassTexCoordATI) @@ -28142,7 +28293,7 @@ GL_PREFIX(PassTexCoordATI): GL_PREFIX(SampleMapATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28152,13 +28303,13 @@ GL_PREFIX(SampleMapATI): popq %rdx popq %rsi popq %rdi - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28168,7 +28319,7 @@ GL_PREFIX(SampleMapATI): popq %rdx popq %rsi popq %rdi - movq 5968(%rax), %r11 + movq 5992(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SampleMapATI), .-GL_PREFIX(SampleMapATI) @@ -28179,7 +28330,7 @@ GL_PREFIX(SampleMapATI): GL_PREFIX(SetFragmentShaderConstantATI): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28189,13 +28340,13 @@ GL_PREFIX(SetFragmentShaderConstantATI): popq %rbp popq %rsi popq %rdi - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28205,7 +28356,7 @@ GL_PREFIX(SetFragmentShaderConstantATI): popq %rbp popq %rsi popq %rdi - movq 5976(%rax), %r11 + movq 6000(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(SetFragmentShaderConstantATI), .-GL_PREFIX(SetFragmentShaderConstantATI) @@ -28216,7 +28367,7 @@ GL_PREFIX(SetFragmentShaderConstantATI): GL_PREFIX(PointParameteriNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28226,13 +28377,13 @@ GL_PREFIX(PointParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28242,7 +28393,7 @@ GL_PREFIX(PointParameteriNV): popq %rbp popq %rsi popq %rdi - movq 5984(%rax), %r11 + movq 6008(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameteriNV), .-GL_PREFIX(PointParameteriNV) @@ -28253,7 +28404,7 @@ GL_PREFIX(PointParameteriNV): GL_PREFIX(PointParameterivNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28263,13 +28414,13 @@ GL_PREFIX(PointParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28279,79 +28430,79 @@ GL_PREFIX(PointParameterivNV): popq %rbp popq %rsi popq %rdi - movq 5992(%rax), %r11 + movq 6016(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(PointParameterivNV), .-GL_PREFIX(PointParameterivNV) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_750) - .type GL_PREFIX(_dispatch_stub_750), @function - HIDDEN(GL_PREFIX(_dispatch_stub_750)) -GL_PREFIX(_dispatch_stub_750): + .globl GL_PREFIX(_dispatch_stub_753) + .type GL_PREFIX(_dispatch_stub_753), @function + HIDDEN(GL_PREFIX(_dispatch_stub_753)) +GL_PREFIX(_dispatch_stub_753): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6000(%rax), %r11 + movq 6024(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_750), .-GL_PREFIX(_dispatch_stub_750) + .size GL_PREFIX(_dispatch_stub_753), .-GL_PREFIX(_dispatch_stub_753) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_751) - .type GL_PREFIX(_dispatch_stub_751), @function - HIDDEN(GL_PREFIX(_dispatch_stub_751)) -GL_PREFIX(_dispatch_stub_751): + .globl GL_PREFIX(_dispatch_stub_754) + .type GL_PREFIX(_dispatch_stub_754), @function + HIDDEN(GL_PREFIX(_dispatch_stub_754)) +GL_PREFIX(_dispatch_stub_754): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6008(%rax), %r11 + movq 6032(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_751), .-GL_PREFIX(_dispatch_stub_751) + .size GL_PREFIX(_dispatch_stub_754), .-GL_PREFIX(_dispatch_stub_754) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_752) - .type GL_PREFIX(_dispatch_stub_752), @function - HIDDEN(GL_PREFIX(_dispatch_stub_752)) -GL_PREFIX(_dispatch_stub_752): + .globl GL_PREFIX(_dispatch_stub_755) + .type GL_PREFIX(_dispatch_stub_755), @function + HIDDEN(GL_PREFIX(_dispatch_stub_755)) +GL_PREFIX(_dispatch_stub_755): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28361,13 +28512,13 @@ GL_PREFIX(_dispatch_stub_752): popq %rbp popq %rsi popq %rdi - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28377,19 +28528,19 @@ GL_PREFIX(_dispatch_stub_752): popq %rbp popq %rsi popq %rdi - movq 6016(%rax), %r11 + movq 6040(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_752), .-GL_PREFIX(_dispatch_stub_752) + .size GL_PREFIX(_dispatch_stub_755), .-GL_PREFIX(_dispatch_stub_755) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_753) - .type GL_PREFIX(_dispatch_stub_753), @function - HIDDEN(GL_PREFIX(_dispatch_stub_753)) -GL_PREFIX(_dispatch_stub_753): + .globl GL_PREFIX(_dispatch_stub_756) + .type GL_PREFIX(_dispatch_stub_756), @function + HIDDEN(GL_PREFIX(_dispatch_stub_756)) +GL_PREFIX(_dispatch_stub_756): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28399,13 +28550,13 @@ GL_PREFIX(_dispatch_stub_753): popq %rbp popq %rsi popq %rdi - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28415,40 +28566,40 @@ GL_PREFIX(_dispatch_stub_753): popq %rbp popq %rsi popq %rdi - movq 6024(%rax), %r11 + movq 6048(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_753), .-GL_PREFIX(_dispatch_stub_753) + .size GL_PREFIX(_dispatch_stub_756), .-GL_PREFIX(_dispatch_stub_756) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_754) - .type GL_PREFIX(_dispatch_stub_754), @function - HIDDEN(GL_PREFIX(_dispatch_stub_754)) -GL_PREFIX(_dispatch_stub_754): + .globl GL_PREFIX(_dispatch_stub_757) + .type GL_PREFIX(_dispatch_stub_757), @function + HIDDEN(GL_PREFIX(_dispatch_stub_757)) +GL_PREFIX(_dispatch_stub_757): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6032(%rax), %r11 + movq 6056(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_754), .-GL_PREFIX(_dispatch_stub_754) + .size GL_PREFIX(_dispatch_stub_757), .-GL_PREFIX(_dispatch_stub_757) .p2align 4,,15 .globl GL_PREFIX(GetProgramNamedParameterdvNV) @@ -28456,7 +28607,7 @@ GL_PREFIX(_dispatch_stub_754): GL_PREFIX(GetProgramNamedParameterdvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28470,13 +28621,13 @@ GL_PREFIX(GetProgramNamedParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28490,7 +28641,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV): popq %rdx popq %rsi popq %rdi - movq 6040(%rax), %r11 + movq 6064(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramNamedParameterdvNV), .-GL_PREFIX(GetProgramNamedParameterdvNV) @@ -28501,7 +28652,7 @@ GL_PREFIX(GetProgramNamedParameterdvNV): GL_PREFIX(GetProgramNamedParameterfvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28515,13 +28666,13 @@ GL_PREFIX(GetProgramNamedParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28535,7 +28686,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV): popq %rdx popq %rsi popq %rdi - movq 6048(%rax), %r11 + movq 6072(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetProgramNamedParameterfvNV), .-GL_PREFIX(GetProgramNamedParameterfvNV) @@ -28546,7 +28697,7 @@ GL_PREFIX(GetProgramNamedParameterfvNV): GL_PREFIX(ProgramNamedParameter4dNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -28566,13 +28717,13 @@ GL_PREFIX(ProgramNamedParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -28592,7 +28743,7 @@ GL_PREFIX(ProgramNamedParameter4dNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 6056(%rax), %r11 + movq 6080(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4dNV), .-GL_PREFIX(ProgramNamedParameter4dNV) @@ -28603,7 +28754,7 @@ GL_PREFIX(ProgramNamedParameter4dNV): GL_PREFIX(ProgramNamedParameter4dvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28617,13 +28768,13 @@ GL_PREFIX(ProgramNamedParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28637,7 +28788,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV): popq %rdx popq %rsi popq %rdi - movq 6064(%rax), %r11 + movq 6088(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4dvNV), .-GL_PREFIX(ProgramNamedParameter4dvNV) @@ -28648,7 +28799,7 @@ GL_PREFIX(ProgramNamedParameter4dvNV): GL_PREFIX(ProgramNamedParameter4fNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) subq $56, %rsp @@ -28668,13 +28819,13 @@ GL_PREFIX(ProgramNamedParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 1: subq $56, %rsp @@ -28694,7 +28845,7 @@ GL_PREFIX(ProgramNamedParameter4fNV): movq 8(%rsp), %rsi movq (%rsp), %rdi addq $56, %rsp - movq 6072(%rax), %r11 + movq 6096(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4fNV), .-GL_PREFIX(ProgramNamedParameter4fNV) @@ -28705,7 +28856,7 @@ GL_PREFIX(ProgramNamedParameter4fNV): GL_PREFIX(ProgramNamedParameter4fvNV): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28719,13 +28870,13 @@ GL_PREFIX(ProgramNamedParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28739,19 +28890,19 @@ GL_PREFIX(ProgramNamedParameter4fvNV): popq %rdx popq %rsi popq %rdi - movq 6080(%rax), %r11 + movq 6104(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProgramNamedParameter4fvNV), .-GL_PREFIX(ProgramNamedParameter4fvNV) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_761) - .type GL_PREFIX(_dispatch_stub_761), @function - HIDDEN(GL_PREFIX(_dispatch_stub_761)) -GL_PREFIX(_dispatch_stub_761): + .globl GL_PREFIX(_dispatch_stub_764) + .type GL_PREFIX(_dispatch_stub_764), @function + HIDDEN(GL_PREFIX(_dispatch_stub_764)) +GL_PREFIX(_dispatch_stub_764): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28761,13 +28912,13 @@ GL_PREFIX(_dispatch_stub_761): popq %rbp popq %rsi popq %rdi - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28777,19 +28928,19 @@ GL_PREFIX(_dispatch_stub_761): popq %rbp popq %rsi popq %rdi - movq 6088(%rax), %r11 + movq 6112(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_761), .-GL_PREFIX(_dispatch_stub_761) + .size GL_PREFIX(_dispatch_stub_764), .-GL_PREFIX(_dispatch_stub_764) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_762) - .type GL_PREFIX(_dispatch_stub_762), @function - HIDDEN(GL_PREFIX(_dispatch_stub_762)) -GL_PREFIX(_dispatch_stub_762): + .globl GL_PREFIX(_dispatch_stub_765) + .type GL_PREFIX(_dispatch_stub_765), @function + HIDDEN(GL_PREFIX(_dispatch_stub_765)) +GL_PREFIX(_dispatch_stub_765): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28799,13 +28950,13 @@ GL_PREFIX(_dispatch_stub_762): popq %rbp popq %rsi popq %rdi - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28815,10 +28966,10 @@ GL_PREFIX(_dispatch_stub_762): popq %rbp popq %rsi popq %rdi - movq 6096(%rax), %r11 + movq 6120(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_762), .-GL_PREFIX(_dispatch_stub_762) + .size GL_PREFIX(_dispatch_stub_765), .-GL_PREFIX(_dispatch_stub_765) .p2align 4,,15 .globl GL_PREFIX(BindFramebufferEXT) @@ -28826,7 +28977,7 @@ GL_PREFIX(_dispatch_stub_762): GL_PREFIX(BindFramebufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28836,13 +28987,13 @@ GL_PREFIX(BindFramebufferEXT): popq %rbp popq %rsi popq %rdi - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28852,7 +29003,7 @@ GL_PREFIX(BindFramebufferEXT): popq %rbp popq %rsi popq %rdi - movq 6104(%rax), %r11 + movq 6128(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindFramebufferEXT), .-GL_PREFIX(BindFramebufferEXT) @@ -28863,7 +29014,7 @@ GL_PREFIX(BindFramebufferEXT): GL_PREFIX(BindRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28873,13 +29024,13 @@ GL_PREFIX(BindRenderbufferEXT): popq %rbp popq %rsi popq %rdi - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28889,7 +29040,7 @@ GL_PREFIX(BindRenderbufferEXT): popq %rbp popq %rsi popq %rdi - movq 6112(%rax), %r11 + movq 6136(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(BindRenderbufferEXT), .-GL_PREFIX(BindRenderbufferEXT) @@ -28900,25 +29051,25 @@ GL_PREFIX(BindRenderbufferEXT): GL_PREFIX(CheckFramebufferStatusEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6120(%rax), %r11 + movq 6144(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(CheckFramebufferStatusEXT), .-GL_PREFIX(CheckFramebufferStatusEXT) @@ -28929,7 +29080,7 @@ GL_PREFIX(CheckFramebufferStatusEXT): GL_PREFIX(DeleteFramebuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28939,13 +29090,13 @@ GL_PREFIX(DeleteFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28955,7 +29106,7 @@ GL_PREFIX(DeleteFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6128(%rax), %r11 + movq 6152(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteFramebuffersEXT), .-GL_PREFIX(DeleteFramebuffersEXT) @@ -28966,7 +29117,7 @@ GL_PREFIX(DeleteFramebuffersEXT): GL_PREFIX(DeleteRenderbuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -28976,13 +29127,13 @@ GL_PREFIX(DeleteRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -28992,7 +29143,7 @@ GL_PREFIX(DeleteRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6136(%rax), %r11 + movq 6160(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(DeleteRenderbuffersEXT), .-GL_PREFIX(DeleteRenderbuffersEXT) @@ -29003,7 +29154,7 @@ GL_PREFIX(DeleteRenderbuffersEXT): GL_PREFIX(FramebufferRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29017,13 +29168,13 @@ GL_PREFIX(FramebufferRenderbufferEXT): popq %rdx popq %rsi popq %rdi - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29037,7 +29188,7 @@ GL_PREFIX(FramebufferRenderbufferEXT): popq %rdx popq %rsi popq %rdi - movq 6144(%rax), %r11 + movq 6168(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferRenderbufferEXT), .-GL_PREFIX(FramebufferRenderbufferEXT) @@ -29048,7 +29199,7 @@ GL_PREFIX(FramebufferRenderbufferEXT): GL_PREFIX(FramebufferTexture1DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6152(%rax), %r11 + movq 6176(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29062,13 +29213,13 @@ GL_PREFIX(FramebufferTexture1DEXT): popq %rdx popq %rsi popq %rdi - movq 6152(%rax), %r11 + movq 6176(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6152(%rax), %r11 + movq 6176(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29082,7 +29233,7 @@ GL_PREFIX(FramebufferTexture1DEXT): popq %rdx popq %rsi popq %rdi - movq 6152(%rax), %r11 + movq 6176(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture1DEXT), .-GL_PREFIX(FramebufferTexture1DEXT) @@ -29093,7 +29244,7 @@ GL_PREFIX(FramebufferTexture1DEXT): GL_PREFIX(FramebufferTexture2DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6160(%rax), %r11 + movq 6184(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29107,13 +29258,13 @@ GL_PREFIX(FramebufferTexture2DEXT): popq %rdx popq %rsi popq %rdi - movq 6160(%rax), %r11 + movq 6184(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6160(%rax), %r11 + movq 6184(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29127,7 +29278,7 @@ GL_PREFIX(FramebufferTexture2DEXT): popq %rdx popq %rsi popq %rdi - movq 6160(%rax), %r11 + movq 6184(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture2DEXT), .-GL_PREFIX(FramebufferTexture2DEXT) @@ -29138,7 +29289,7 @@ GL_PREFIX(FramebufferTexture2DEXT): GL_PREFIX(FramebufferTexture3DEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6168(%rax), %r11 + movq 6192(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29156,13 +29307,13 @@ GL_PREFIX(FramebufferTexture3DEXT): popq %rdx popq %rsi popq %rdi - movq 6168(%rax), %r11 + movq 6192(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6168(%rax), %r11 + movq 6192(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29180,7 +29331,7 @@ GL_PREFIX(FramebufferTexture3DEXT): popq %rdx popq %rsi popq %rdi - movq 6168(%rax), %r11 + movq 6192(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTexture3DEXT), .-GL_PREFIX(FramebufferTexture3DEXT) @@ -29191,7 +29342,7 @@ GL_PREFIX(FramebufferTexture3DEXT): GL_PREFIX(GenFramebuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6176(%rax), %r11 + movq 6200(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29201,13 +29352,13 @@ GL_PREFIX(GenFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6176(%rax), %r11 + movq 6200(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6176(%rax), %r11 + movq 6200(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29217,7 +29368,7 @@ GL_PREFIX(GenFramebuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6176(%rax), %r11 + movq 6200(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenFramebuffersEXT), .-GL_PREFIX(GenFramebuffersEXT) @@ -29228,7 +29379,7 @@ GL_PREFIX(GenFramebuffersEXT): GL_PREFIX(GenRenderbuffersEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6184(%rax), %r11 + movq 6208(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29238,13 +29389,13 @@ GL_PREFIX(GenRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6184(%rax), %r11 + movq 6208(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6184(%rax), %r11 + movq 6208(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29254,7 +29405,7 @@ GL_PREFIX(GenRenderbuffersEXT): popq %rbp popq %rsi popq %rdi - movq 6184(%rax), %r11 + movq 6208(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenRenderbuffersEXT), .-GL_PREFIX(GenRenderbuffersEXT) @@ -29265,25 +29416,25 @@ GL_PREFIX(GenRenderbuffersEXT): GL_PREFIX(GenerateMipmapEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6192(%rax), %r11 + movq 6216(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6192(%rax), %r11 + movq 6216(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6192(%rax), %r11 + movq 6216(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6192(%rax), %r11 + movq 6216(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GenerateMipmapEXT), .-GL_PREFIX(GenerateMipmapEXT) @@ -29294,7 +29445,7 @@ GL_PREFIX(GenerateMipmapEXT): GL_PREFIX(GetFramebufferAttachmentParameterivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6200(%rax), %r11 + movq 6224(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29308,13 +29459,13 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6200(%rax), %r11 + movq 6224(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6200(%rax), %r11 + movq 6224(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29328,7 +29479,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6200(%rax), %r11 + movq 6224(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetFramebufferAttachmentParameterivEXT), .-GL_PREFIX(GetFramebufferAttachmentParameterivEXT) @@ -29339,7 +29490,7 @@ GL_PREFIX(GetFramebufferAttachmentParameterivEXT): GL_PREFIX(GetRenderbufferParameterivEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6208(%rax), %r11 + movq 6232(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29349,13 +29500,13 @@ GL_PREFIX(GetRenderbufferParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6208(%rax), %r11 + movq 6232(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6208(%rax), %r11 + movq 6232(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29365,7 +29516,7 @@ GL_PREFIX(GetRenderbufferParameterivEXT): popq %rdx popq %rsi popq %rdi - movq 6208(%rax), %r11 + movq 6232(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(GetRenderbufferParameterivEXT), .-GL_PREFIX(GetRenderbufferParameterivEXT) @@ -29376,25 +29527,25 @@ GL_PREFIX(GetRenderbufferParameterivEXT): GL_PREFIX(IsFramebufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6216(%rax), %r11 + movq 6240(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6216(%rax), %r11 + movq 6240(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6216(%rax), %r11 + movq 6240(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6216(%rax), %r11 + movq 6240(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsFramebufferEXT), .-GL_PREFIX(IsFramebufferEXT) @@ -29405,25 +29556,25 @@ GL_PREFIX(IsFramebufferEXT): GL_PREFIX(IsRenderbufferEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6224(%rax), %r11 + movq 6248(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6224(%rax), %r11 + movq 6248(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6224(%rax), %r11 + movq 6248(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6224(%rax), %r11 + movq 6248(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(IsRenderbufferEXT), .-GL_PREFIX(IsRenderbufferEXT) @@ -29434,7 +29585,7 @@ GL_PREFIX(IsRenderbufferEXT): GL_PREFIX(RenderbufferStorageEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6232(%rax), %r11 + movq 6256(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29448,13 +29599,13 @@ GL_PREFIX(RenderbufferStorageEXT): popq %rdx popq %rsi popq %rdi - movq 6232(%rax), %r11 + movq 6256(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6232(%rax), %r11 + movq 6256(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29468,19 +29619,19 @@ GL_PREFIX(RenderbufferStorageEXT): popq %rdx popq %rsi popq %rdi - movq 6232(%rax), %r11 + movq 6256(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(RenderbufferStorageEXT), .-GL_PREFIX(RenderbufferStorageEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_780) - .type GL_PREFIX(_dispatch_stub_780), @function - HIDDEN(GL_PREFIX(_dispatch_stub_780)) -GL_PREFIX(_dispatch_stub_780): + .globl GL_PREFIX(_dispatch_stub_783) + .type GL_PREFIX(_dispatch_stub_783), @function + HIDDEN(GL_PREFIX(_dispatch_stub_783)) +GL_PREFIX(_dispatch_stub_783): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6240(%rax), %r11 + movq 6264(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29498,13 +29649,13 @@ GL_PREFIX(_dispatch_stub_780): popq %rdx popq %rsi popq %rdi - movq 6240(%rax), %r11 + movq 6264(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6240(%rax), %r11 + movq 6264(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29522,19 +29673,19 @@ GL_PREFIX(_dispatch_stub_780): popq %rdx popq %rsi popq %rdi - movq 6240(%rax), %r11 + movq 6264(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_780), .-GL_PREFIX(_dispatch_stub_780) + .size GL_PREFIX(_dispatch_stub_783), .-GL_PREFIX(_dispatch_stub_783) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_781) - .type GL_PREFIX(_dispatch_stub_781), @function - HIDDEN(GL_PREFIX(_dispatch_stub_781)) -GL_PREFIX(_dispatch_stub_781): + .globl GL_PREFIX(_dispatch_stub_784) + .type GL_PREFIX(_dispatch_stub_784), @function + HIDDEN(GL_PREFIX(_dispatch_stub_784)) +GL_PREFIX(_dispatch_stub_784): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6248(%rax), %r11 + movq 6272(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29544,13 +29695,13 @@ GL_PREFIX(_dispatch_stub_781): popq %rdx popq %rsi popq %rdi - movq 6248(%rax), %r11 + movq 6272(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6248(%rax), %r11 + movq 6272(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29560,19 +29711,19 @@ GL_PREFIX(_dispatch_stub_781): popq %rdx popq %rsi popq %rdi - movq 6248(%rax), %r11 + movq 6272(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_781), .-GL_PREFIX(_dispatch_stub_781) + .size GL_PREFIX(_dispatch_stub_784), .-GL_PREFIX(_dispatch_stub_784) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_782) - .type GL_PREFIX(_dispatch_stub_782), @function - HIDDEN(GL_PREFIX(_dispatch_stub_782)) -GL_PREFIX(_dispatch_stub_782): + .globl GL_PREFIX(_dispatch_stub_785) + .type GL_PREFIX(_dispatch_stub_785), @function + HIDDEN(GL_PREFIX(_dispatch_stub_785)) +GL_PREFIX(_dispatch_stub_785): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6256(%rax), %r11 + movq 6280(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29582,13 +29733,13 @@ GL_PREFIX(_dispatch_stub_782): popq %rdx popq %rsi popq %rdi - movq 6256(%rax), %r11 + movq 6280(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6256(%rax), %r11 + movq 6280(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29598,10 +29749,10 @@ GL_PREFIX(_dispatch_stub_782): popq %rdx popq %rsi popq %rdi - movq 6256(%rax), %r11 + movq 6280(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_782), .-GL_PREFIX(_dispatch_stub_782) + .size GL_PREFIX(_dispatch_stub_785), .-GL_PREFIX(_dispatch_stub_785) .p2align 4,,15 .globl GL_PREFIX(FramebufferTextureLayerEXT) @@ -29609,7 +29760,7 @@ GL_PREFIX(_dispatch_stub_782): GL_PREFIX(FramebufferTextureLayerEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6264(%rax), %r11 + movq 6288(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29623,13 +29774,13 @@ GL_PREFIX(FramebufferTextureLayerEXT): popq %rdx popq %rsi popq %rdi - movq 6264(%rax), %r11 + movq 6288(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6264(%rax), %r11 + movq 6288(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29643,7 +29794,7 @@ GL_PREFIX(FramebufferTextureLayerEXT): popq %rdx popq %rsi popq %rdi - movq 6264(%rax), %r11 + movq 6288(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(FramebufferTextureLayerEXT), .-GL_PREFIX(FramebufferTextureLayerEXT) @@ -29654,37 +29805,37 @@ GL_PREFIX(FramebufferTextureLayerEXT): GL_PREFIX(ProvokingVertexEXT): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6272(%rax), %r11 + movq 6296(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi call _x86_64_get_dispatch@PLT popq %rdi - movq 6272(%rax), %r11 + movq 6296(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6272(%rax), %r11 + movq 6296(%rax), %r11 jmp *%r11 1: pushq %rdi call _glapi_get_dispatch popq %rdi - movq 6272(%rax), %r11 + movq 6296(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(ProvokingVertexEXT), .-GL_PREFIX(ProvokingVertexEXT) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_785) - .type GL_PREFIX(_dispatch_stub_785), @function - HIDDEN(GL_PREFIX(_dispatch_stub_785)) -GL_PREFIX(_dispatch_stub_785): + .globl GL_PREFIX(_dispatch_stub_788) + .type GL_PREFIX(_dispatch_stub_788), @function + HIDDEN(GL_PREFIX(_dispatch_stub_788)) +GL_PREFIX(_dispatch_stub_788): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6280(%rax), %r11 + movq 6304(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29694,13 +29845,13 @@ GL_PREFIX(_dispatch_stub_785): popq %rdx popq %rsi popq %rdi - movq 6280(%rax), %r11 + movq 6304(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6280(%rax), %r11 + movq 6304(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29710,19 +29861,19 @@ GL_PREFIX(_dispatch_stub_785): popq %rdx popq %rsi popq %rdi - movq 6280(%rax), %r11 + movq 6304(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_785), .-GL_PREFIX(_dispatch_stub_785) + .size GL_PREFIX(_dispatch_stub_788), .-GL_PREFIX(_dispatch_stub_788) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_786) - .type GL_PREFIX(_dispatch_stub_786), @function - HIDDEN(GL_PREFIX(_dispatch_stub_786)) -GL_PREFIX(_dispatch_stub_786): + .globl GL_PREFIX(_dispatch_stub_789) + .type GL_PREFIX(_dispatch_stub_789), @function + HIDDEN(GL_PREFIX(_dispatch_stub_789)) +GL_PREFIX(_dispatch_stub_789): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6288(%rax), %r11 + movq 6312(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29732,13 +29883,13 @@ GL_PREFIX(_dispatch_stub_786): popq %rdx popq %rsi popq %rdi - movq 6288(%rax), %r11 + movq 6312(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6288(%rax), %r11 + movq 6312(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29748,19 +29899,19 @@ GL_PREFIX(_dispatch_stub_786): popq %rdx popq %rsi popq %rdi - movq 6288(%rax), %r11 + movq 6312(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_786), .-GL_PREFIX(_dispatch_stub_786) + .size GL_PREFIX(_dispatch_stub_789), .-GL_PREFIX(_dispatch_stub_789) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_787) - .type GL_PREFIX(_dispatch_stub_787), @function - HIDDEN(GL_PREFIX(_dispatch_stub_787)) -GL_PREFIX(_dispatch_stub_787): + .globl GL_PREFIX(_dispatch_stub_790) + .type GL_PREFIX(_dispatch_stub_790), @function + HIDDEN(GL_PREFIX(_dispatch_stub_790)) +GL_PREFIX(_dispatch_stub_790): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6296(%rax), %r11 + movq 6320(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29774,13 +29925,13 @@ GL_PREFIX(_dispatch_stub_787): popq %rdx popq %rsi popq %rdi - movq 6296(%rax), %r11 + movq 6320(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6296(%rax), %r11 + movq 6320(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29794,19 +29945,19 @@ GL_PREFIX(_dispatch_stub_787): popq %rdx popq %rsi popq %rdi - movq 6296(%rax), %r11 + movq 6320(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_787), .-GL_PREFIX(_dispatch_stub_787) + .size GL_PREFIX(_dispatch_stub_790), .-GL_PREFIX(_dispatch_stub_790) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_788) - .type GL_PREFIX(_dispatch_stub_788), @function - HIDDEN(GL_PREFIX(_dispatch_stub_788)) -GL_PREFIX(_dispatch_stub_788): + .globl GL_PREFIX(_dispatch_stub_791) + .type GL_PREFIX(_dispatch_stub_791), @function + HIDDEN(GL_PREFIX(_dispatch_stub_791)) +GL_PREFIX(_dispatch_stub_791): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6304(%rax), %r11 + movq 6328(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29820,13 +29971,13 @@ GL_PREFIX(_dispatch_stub_788): popq %rdx popq %rsi popq %rdi - movq 6304(%rax), %r11 + movq 6328(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6304(%rax), %r11 + movq 6328(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29840,19 +29991,19 @@ GL_PREFIX(_dispatch_stub_788): popq %rdx popq %rsi popq %rdi - movq 6304(%rax), %r11 + movq 6328(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_788), .-GL_PREFIX(_dispatch_stub_788) + .size GL_PREFIX(_dispatch_stub_791), .-GL_PREFIX(_dispatch_stub_791) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_789) - .type GL_PREFIX(_dispatch_stub_789), @function - HIDDEN(GL_PREFIX(_dispatch_stub_789)) -GL_PREFIX(_dispatch_stub_789): + .globl GL_PREFIX(_dispatch_stub_792) + .type GL_PREFIX(_dispatch_stub_792), @function + HIDDEN(GL_PREFIX(_dispatch_stub_792)) +GL_PREFIX(_dispatch_stub_792): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6312(%rax), %r11 + movq 6336(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29866,13 +30017,13 @@ GL_PREFIX(_dispatch_stub_789): popq %rdx popq %rsi popq %rdi - movq 6312(%rax), %r11 + movq 6336(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6312(%rax), %r11 + movq 6336(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29886,19 +30037,19 @@ GL_PREFIX(_dispatch_stub_789): popq %rdx popq %rsi popq %rdi - movq 6312(%rax), %r11 + movq 6336(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_789), .-GL_PREFIX(_dispatch_stub_789) + .size GL_PREFIX(_dispatch_stub_792), .-GL_PREFIX(_dispatch_stub_792) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_790) - .type GL_PREFIX(_dispatch_stub_790), @function - HIDDEN(GL_PREFIX(_dispatch_stub_790)) -GL_PREFIX(_dispatch_stub_790): + .globl GL_PREFIX(_dispatch_stub_793) + .type GL_PREFIX(_dispatch_stub_793), @function + HIDDEN(GL_PREFIX(_dispatch_stub_793)) +GL_PREFIX(_dispatch_stub_793): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6320(%rax), %r11 + movq 6344(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29908,13 +30059,13 @@ GL_PREFIX(_dispatch_stub_790): popq %rdx popq %rsi popq %rdi - movq 6320(%rax), %r11 + movq 6344(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6320(%rax), %r11 + movq 6344(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29924,19 +30075,19 @@ GL_PREFIX(_dispatch_stub_790): popq %rdx popq %rsi popq %rdi - movq 6320(%rax), %r11 + movq 6344(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_790), .-GL_PREFIX(_dispatch_stub_790) + .size GL_PREFIX(_dispatch_stub_793), .-GL_PREFIX(_dispatch_stub_793) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_791) - .type GL_PREFIX(_dispatch_stub_791), @function - HIDDEN(GL_PREFIX(_dispatch_stub_791)) -GL_PREFIX(_dispatch_stub_791): + .globl GL_PREFIX(_dispatch_stub_794) + .type GL_PREFIX(_dispatch_stub_794), @function + HIDDEN(GL_PREFIX(_dispatch_stub_794)) +GL_PREFIX(_dispatch_stub_794): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6328(%rax), %r11 + movq 6352(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -29946,13 +30097,13 @@ GL_PREFIX(_dispatch_stub_791): popq %rdx popq %rsi popq %rdi - movq 6328(%rax), %r11 + movq 6352(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6328(%rax), %r11 + movq 6352(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -29962,10 +30113,10 @@ GL_PREFIX(_dispatch_stub_791): popq %rdx popq %rsi popq %rdi - movq 6328(%rax), %r11 + movq 6352(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_791), .-GL_PREFIX(_dispatch_stub_791) + .size GL_PREFIX(_dispatch_stub_794), .-GL_PREFIX(_dispatch_stub_794) .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement) .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture) @@ -30220,9 +30371,9 @@ GL_PREFIX(_dispatch_stub_791): .globl GL_PREFIX(IsProgramARB) ; .set GL_PREFIX(IsProgramARB), GL_PREFIX(IsProgramNV) .globl GL_PREFIX(PointParameteri) ; .set GL_PREFIX(PointParameteri), GL_PREFIX(PointParameteriNV) .globl GL_PREFIX(PointParameteriv) ; .set GL_PREFIX(PointParameteriv), GL_PREFIX(PointParameterivNV) - .globl GL_PREFIX(DeleteVertexArrays) ; .set GL_PREFIX(DeleteVertexArrays), GL_PREFIX(_dispatch_stub_752) - .globl GL_PREFIX(IsVertexArray) ; .set GL_PREFIX(IsVertexArray), GL_PREFIX(_dispatch_stub_754) - .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_762) + .globl GL_PREFIX(DeleteVertexArrays) ; .set GL_PREFIX(DeleteVertexArrays), GL_PREFIX(_dispatch_stub_755) + .globl GL_PREFIX(IsVertexArray) ; .set GL_PREFIX(IsVertexArray), GL_PREFIX(_dispatch_stub_757) + .globl GL_PREFIX(BlendEquationSeparate) ; .set GL_PREFIX(BlendEquationSeparate), GL_PREFIX(_dispatch_stub_765) .globl GL_PREFIX(BindFramebuffer) ; .set GL_PREFIX(BindFramebuffer), GL_PREFIX(BindFramebufferEXT) .globl GL_PREFIX(BindRenderbuffer) ; .set GL_PREFIX(BindRenderbuffer), GL_PREFIX(BindRenderbufferEXT) .globl GL_PREFIX(CheckFramebufferStatus) ; .set GL_PREFIX(CheckFramebufferStatus), GL_PREFIX(CheckFramebufferStatusEXT) @@ -30240,8 +30391,9 @@ GL_PREFIX(_dispatch_stub_791): .globl GL_PREFIX(IsFramebuffer) ; .set GL_PREFIX(IsFramebuffer), GL_PREFIX(IsFramebufferEXT) .globl GL_PREFIX(IsRenderbuffer) ; .set GL_PREFIX(IsRenderbuffer), GL_PREFIX(IsRenderbufferEXT) .globl GL_PREFIX(RenderbufferStorage) ; .set GL_PREFIX(RenderbufferStorage), GL_PREFIX(RenderbufferStorageEXT) - .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_780) + .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_783) .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT) + .globl GL_PREFIX(ProvokingVertex) ; .set GL_PREFIX(ProvokingVertex), GL_PREFIX(ProvokingVertexEXT) #if defined(GLX_USE_TLS) && defined(__linux__) .section ".note.ABI-tag", "a" diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 46794adaf7..12c77f434e 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -725,23 +725,26 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(GetSynciv, _gloffset_GetSynciv, GetSynciv@20) GL_STUB(IsSync, _gloffset_IsSync, IsSync@4) GL_STUB(WaitSync, _gloffset_WaitSync, WaitSync@12) + GL_STUB(DrawElementsBaseVertex, _gloffset_DrawElementsBaseVertex, DrawElementsBaseVertex@20) + GL_STUB(DrawRangeElementsBaseVertex, _gloffset_DrawRangeElementsBaseVertex, DrawRangeElementsBaseVertex@28) + GL_STUB(MultiDrawElementsBaseVertex, _gloffset_MultiDrawElementsBaseVertex, MultiDrawElementsBaseVertex@24) GL_STUB(PolygonOffsetEXT, _gloffset_PolygonOffsetEXT, PolygonOffsetEXT@8) - GL_STUB(_dispatch_stub_575, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_575@8) - HIDDEN(GL_PREFIX(_dispatch_stub_575, _dispatch_stub_575@8)) - GL_STUB(_dispatch_stub_576, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_576@8) - HIDDEN(GL_PREFIX(_dispatch_stub_576, _dispatch_stub_576@8)) - GL_STUB(_dispatch_stub_577, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_577@8) - HIDDEN(GL_PREFIX(_dispatch_stub_577, _dispatch_stub_577@8)) - GL_STUB(_dispatch_stub_578, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_578@8) + GL_STUB(_dispatch_stub_578, _gloffset_GetPixelTexGenParameterfvSGIS, _dispatch_stub_578@8) HIDDEN(GL_PREFIX(_dispatch_stub_578, _dispatch_stub_578@8)) - GL_STUB(_dispatch_stub_579, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_579@8) + GL_STUB(_dispatch_stub_579, _gloffset_GetPixelTexGenParameterivSGIS, _dispatch_stub_579@8) HIDDEN(GL_PREFIX(_dispatch_stub_579, _dispatch_stub_579@8)) - GL_STUB(_dispatch_stub_580, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_580@8) + GL_STUB(_dispatch_stub_580, _gloffset_PixelTexGenParameterfSGIS, _dispatch_stub_580@8) HIDDEN(GL_PREFIX(_dispatch_stub_580, _dispatch_stub_580@8)) - GL_STUB(_dispatch_stub_581, _gloffset_SampleMaskSGIS, _dispatch_stub_581@8) + GL_STUB(_dispatch_stub_581, _gloffset_PixelTexGenParameterfvSGIS, _dispatch_stub_581@8) HIDDEN(GL_PREFIX(_dispatch_stub_581, _dispatch_stub_581@8)) - GL_STUB(_dispatch_stub_582, _gloffset_SamplePatternSGIS, _dispatch_stub_582@4) - HIDDEN(GL_PREFIX(_dispatch_stub_582, _dispatch_stub_582@4)) + GL_STUB(_dispatch_stub_582, _gloffset_PixelTexGenParameteriSGIS, _dispatch_stub_582@8) + HIDDEN(GL_PREFIX(_dispatch_stub_582, _dispatch_stub_582@8)) + GL_STUB(_dispatch_stub_583, _gloffset_PixelTexGenParameterivSGIS, _dispatch_stub_583@8) + HIDDEN(GL_PREFIX(_dispatch_stub_583, _dispatch_stub_583@8)) + GL_STUB(_dispatch_stub_584, _gloffset_SampleMaskSGIS, _dispatch_stub_584@8) + HIDDEN(GL_PREFIX(_dispatch_stub_584, _dispatch_stub_584@8)) + GL_STUB(_dispatch_stub_585, _gloffset_SamplePatternSGIS, _dispatch_stub_585@4) + HIDDEN(GL_PREFIX(_dispatch_stub_585, _dispatch_stub_585@4)) GL_STUB(ColorPointerEXT, _gloffset_ColorPointerEXT, ColorPointerEXT@20) GL_STUB(EdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT, EdgeFlagPointerEXT@12) GL_STUB(IndexPointerEXT, _gloffset_IndexPointerEXT, IndexPointerEXT@16) @@ -752,10 +755,10 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(PointParameterfvEXT, _gloffset_PointParameterfvEXT, PointParameterfvEXT@8) GL_STUB(LockArraysEXT, _gloffset_LockArraysEXT, LockArraysEXT@8) GL_STUB(UnlockArraysEXT, _gloffset_UnlockArraysEXT, UnlockArraysEXT@0) - GL_STUB(_dispatch_stub_593, _gloffset_CullParameterdvEXT, _dispatch_stub_593@8) - HIDDEN(GL_PREFIX(_dispatch_stub_593, _dispatch_stub_593@8)) - GL_STUB(_dispatch_stub_594, _gloffset_CullParameterfvEXT, _dispatch_stub_594@8) - HIDDEN(GL_PREFIX(_dispatch_stub_594, _dispatch_stub_594@8)) + GL_STUB(_dispatch_stub_596, _gloffset_CullParameterdvEXT, _dispatch_stub_596@8) + HIDDEN(GL_PREFIX(_dispatch_stub_596, _dispatch_stub_596@8)) + GL_STUB(_dispatch_stub_597, _gloffset_CullParameterfvEXT, _dispatch_stub_597@8) + HIDDEN(GL_PREFIX(_dispatch_stub_597, _dispatch_stub_597@8)) GL_STUB(SecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT, SecondaryColor3bEXT@12) GL_STUB(SecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT, SecondaryColor3bvEXT@4) GL_STUB(SecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT, SecondaryColor3dEXT@24) @@ -780,8 +783,8 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(FogCoorddvEXT, _gloffset_FogCoorddvEXT, FogCoorddvEXT@4) GL_STUB(FogCoordfEXT, _gloffset_FogCoordfEXT, FogCoordfEXT@4) GL_STUB(FogCoordfvEXT, _gloffset_FogCoordfvEXT, FogCoordfvEXT@4) - GL_STUB(_dispatch_stub_619, _gloffset_PixelTexGenSGIX, _dispatch_stub_619@4) - HIDDEN(GL_PREFIX(_dispatch_stub_619, _dispatch_stub_619@4)) + GL_STUB(_dispatch_stub_622, _gloffset_PixelTexGenSGIX, _dispatch_stub_622@4) + HIDDEN(GL_PREFIX(_dispatch_stub_622, _dispatch_stub_622@4)) GL_STUB(BlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT, BlendFuncSeparateEXT@16) GL_STUB(FlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV, FlushVertexArrayRangeNV@0) GL_STUB(VertexArrayRangeNV, _gloffset_VertexArrayRangeNV, VertexArrayRangeNV@8) @@ -823,24 +826,24 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(WindowPos4ivMESA, _gloffset_WindowPos4ivMESA, WindowPos4ivMESA@4) GL_STUB(WindowPos4sMESA, _gloffset_WindowPos4sMESA, WindowPos4sMESA@16) GL_STUB(WindowPos4svMESA, _gloffset_WindowPos4svMESA, WindowPos4svMESA@4) - GL_STUB(_dispatch_stub_661, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_661@20) - HIDDEN(GL_PREFIX(_dispatch_stub_661, _dispatch_stub_661@20)) - GL_STUB(_dispatch_stub_662, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_662@24) - HIDDEN(GL_PREFIX(_dispatch_stub_662, _dispatch_stub_662@24)) - GL_STUB(_dispatch_stub_663, _gloffset_DeleteFencesNV, _dispatch_stub_663@8) - HIDDEN(GL_PREFIX(_dispatch_stub_663, _dispatch_stub_663@8)) - GL_STUB(_dispatch_stub_664, _gloffset_FinishFenceNV, _dispatch_stub_664@4) - HIDDEN(GL_PREFIX(_dispatch_stub_664, _dispatch_stub_664@4)) - GL_STUB(_dispatch_stub_665, _gloffset_GenFencesNV, _dispatch_stub_665@8) - HIDDEN(GL_PREFIX(_dispatch_stub_665, _dispatch_stub_665@8)) - GL_STUB(_dispatch_stub_666, _gloffset_GetFenceivNV, _dispatch_stub_666@12) - HIDDEN(GL_PREFIX(_dispatch_stub_666, _dispatch_stub_666@12)) - GL_STUB(_dispatch_stub_667, _gloffset_IsFenceNV, _dispatch_stub_667@4) + GL_STUB(_dispatch_stub_664, _gloffset_MultiModeDrawArraysIBM, _dispatch_stub_664@20) + HIDDEN(GL_PREFIX(_dispatch_stub_664, _dispatch_stub_664@20)) + GL_STUB(_dispatch_stub_665, _gloffset_MultiModeDrawElementsIBM, _dispatch_stub_665@24) + HIDDEN(GL_PREFIX(_dispatch_stub_665, _dispatch_stub_665@24)) + GL_STUB(_dispatch_stub_666, _gloffset_DeleteFencesNV, _dispatch_stub_666@8) + HIDDEN(GL_PREFIX(_dispatch_stub_666, _dispatch_stub_666@8)) + GL_STUB(_dispatch_stub_667, _gloffset_FinishFenceNV, _dispatch_stub_667@4) HIDDEN(GL_PREFIX(_dispatch_stub_667, _dispatch_stub_667@4)) - GL_STUB(_dispatch_stub_668, _gloffset_SetFenceNV, _dispatch_stub_668@8) + GL_STUB(_dispatch_stub_668, _gloffset_GenFencesNV, _dispatch_stub_668@8) HIDDEN(GL_PREFIX(_dispatch_stub_668, _dispatch_stub_668@8)) - GL_STUB(_dispatch_stub_669, _gloffset_TestFenceNV, _dispatch_stub_669@4) - HIDDEN(GL_PREFIX(_dispatch_stub_669, _dispatch_stub_669@4)) + GL_STUB(_dispatch_stub_669, _gloffset_GetFenceivNV, _dispatch_stub_669@12) + HIDDEN(GL_PREFIX(_dispatch_stub_669, _dispatch_stub_669@12)) + GL_STUB(_dispatch_stub_670, _gloffset_IsFenceNV, _dispatch_stub_670@4) + HIDDEN(GL_PREFIX(_dispatch_stub_670, _dispatch_stub_670@4)) + GL_STUB(_dispatch_stub_671, _gloffset_SetFenceNV, _dispatch_stub_671@8) + HIDDEN(GL_PREFIX(_dispatch_stub_671, _dispatch_stub_671@8)) + GL_STUB(_dispatch_stub_672, _gloffset_TestFenceNV, _dispatch_stub_672@4) + HIDDEN(GL_PREFIX(_dispatch_stub_672, _dispatch_stub_672@4)) GL_STUB(AreProgramsResidentNV, _gloffset_AreProgramsResidentNV, AreProgramsResidentNV@12) GL_STUB(BindProgramNV, _gloffset_BindProgramNV, BindProgramNV@8) GL_STUB(DeleteProgramsNV, _gloffset_DeleteProgramsNV, DeleteProgramsNV@8) @@ -921,26 +924,26 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(SetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI, SetFragmentShaderConstantATI@8) GL_STUB(PointParameteriNV, _gloffset_PointParameteriNV, PointParameteriNV@8) GL_STUB(PointParameterivNV, _gloffset_PointParameterivNV, PointParameterivNV@8) - GL_STUB(_dispatch_stub_750, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_750@4) - HIDDEN(GL_PREFIX(_dispatch_stub_750, _dispatch_stub_750@4)) - GL_STUB(_dispatch_stub_751, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_751@4) - HIDDEN(GL_PREFIX(_dispatch_stub_751, _dispatch_stub_751@4)) - GL_STUB(_dispatch_stub_752, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_752@8) - HIDDEN(GL_PREFIX(_dispatch_stub_752, _dispatch_stub_752@8)) - GL_STUB(_dispatch_stub_753, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_753@8) - HIDDEN(GL_PREFIX(_dispatch_stub_753, _dispatch_stub_753@8)) - GL_STUB(_dispatch_stub_754, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_754@4) + GL_STUB(_dispatch_stub_753, _gloffset_ActiveStencilFaceEXT, _dispatch_stub_753@4) + HIDDEN(GL_PREFIX(_dispatch_stub_753, _dispatch_stub_753@4)) + GL_STUB(_dispatch_stub_754, _gloffset_BindVertexArrayAPPLE, _dispatch_stub_754@4) HIDDEN(GL_PREFIX(_dispatch_stub_754, _dispatch_stub_754@4)) + GL_STUB(_dispatch_stub_755, _gloffset_DeleteVertexArraysAPPLE, _dispatch_stub_755@8) + HIDDEN(GL_PREFIX(_dispatch_stub_755, _dispatch_stub_755@8)) + GL_STUB(_dispatch_stub_756, _gloffset_GenVertexArraysAPPLE, _dispatch_stub_756@8) + HIDDEN(GL_PREFIX(_dispatch_stub_756, _dispatch_stub_756@8)) + GL_STUB(_dispatch_stub_757, _gloffset_IsVertexArrayAPPLE, _dispatch_stub_757@4) + HIDDEN(GL_PREFIX(_dispatch_stub_757, _dispatch_stub_757@4)) GL_STUB(GetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV, GetProgramNamedParameterdvNV@16) GL_STUB(GetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV, GetProgramNamedParameterfvNV@16) GL_STUB(ProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV, ProgramNamedParameter4dNV@44) GL_STUB(ProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV, ProgramNamedParameter4dvNV@16) GL_STUB(ProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV, ProgramNamedParameter4fNV@28) GL_STUB(ProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV, ProgramNamedParameter4fvNV@16) - GL_STUB(_dispatch_stub_761, _gloffset_DepthBoundsEXT, _dispatch_stub_761@16) - HIDDEN(GL_PREFIX(_dispatch_stub_761, _dispatch_stub_761@16)) - GL_STUB(_dispatch_stub_762, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_762@8) - HIDDEN(GL_PREFIX(_dispatch_stub_762, _dispatch_stub_762@8)) + GL_STUB(_dispatch_stub_764, _gloffset_DepthBoundsEXT, _dispatch_stub_764@16) + HIDDEN(GL_PREFIX(_dispatch_stub_764, _dispatch_stub_764@16)) + GL_STUB(_dispatch_stub_765, _gloffset_BlendEquationSeparateEXT, _dispatch_stub_765@8) + HIDDEN(GL_PREFIX(_dispatch_stub_765, _dispatch_stub_765@8)) GL_STUB(BindFramebufferEXT, _gloffset_BindFramebufferEXT, BindFramebufferEXT@8) GL_STUB(BindRenderbufferEXT, _gloffset_BindRenderbufferEXT, BindRenderbufferEXT@8) GL_STUB(CheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT, CheckFramebufferStatusEXT@4) @@ -958,28 +961,28 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(IsFramebufferEXT, _gloffset_IsFramebufferEXT, IsFramebufferEXT@4) GL_STUB(IsRenderbufferEXT, _gloffset_IsRenderbufferEXT, IsRenderbufferEXT@4) GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16) - GL_STUB(_dispatch_stub_780, _gloffset_BlitFramebufferEXT, _dispatch_stub_780@40) - HIDDEN(GL_PREFIX(_dispatch_stub_780, _dispatch_stub_780@40)) - GL_STUB(_dispatch_stub_781, _gloffset_BufferParameteriAPPLE, _dispatch_stub_781@12) - HIDDEN(GL_PREFIX(_dispatch_stub_781, _dispatch_stub_781@12)) - GL_STUB(_dispatch_stub_782, _gloffset_FlushMappedBufferRangeAPPLE, _dispatch_stub_782@12) - HIDDEN(GL_PREFIX(_dispatch_stub_782, _dispatch_stub_782@12)) + GL_STUB(_dispatch_stub_783, _gloffset_BlitFramebufferEXT, _dispatch_stub_783@40) + HIDDEN(GL_PREFIX(_dispatch_stub_783, _dispatch_stub_783@40)) + GL_STUB(_dispatch_stub_784, _gloffset_BufferParameteriAPPLE, _dispatch_stub_784@12) + HIDDEN(GL_PREFIX(_dispatch_stub_784, _dispatch_stub_784@12)) + GL_STUB(_dispatch_stub_785, _gloffset_FlushMappedBufferRangeAPPLE, _dispatch_stub_785@12) + HIDDEN(GL_PREFIX(_dispatch_stub_785, _dispatch_stub_785@12)) GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) GL_STUB(ProvokingVertexEXT, _gloffset_ProvokingVertexEXT, ProvokingVertexEXT@4) - GL_STUB(_dispatch_stub_785, _gloffset_GetTexParameterPointervAPPLE, _dispatch_stub_785@12) - HIDDEN(GL_PREFIX(_dispatch_stub_785, _dispatch_stub_785@12)) - GL_STUB(_dispatch_stub_786, _gloffset_TextureRangeAPPLE, _dispatch_stub_786@12) - HIDDEN(GL_PREFIX(_dispatch_stub_786, _dispatch_stub_786@12)) - GL_STUB(_dispatch_stub_787, _gloffset_StencilFuncSeparateATI, _dispatch_stub_787@16) - HIDDEN(GL_PREFIX(_dispatch_stub_787, _dispatch_stub_787@16)) - GL_STUB(_dispatch_stub_788, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_788@16) - HIDDEN(GL_PREFIX(_dispatch_stub_788, _dispatch_stub_788@16)) - GL_STUB(_dispatch_stub_789, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_789@16) - HIDDEN(GL_PREFIX(_dispatch_stub_789, _dispatch_stub_789@16)) - GL_STUB(_dispatch_stub_790, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_790@12) - HIDDEN(GL_PREFIX(_dispatch_stub_790, _dispatch_stub_790@12)) - GL_STUB(_dispatch_stub_791, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_791@12) - HIDDEN(GL_PREFIX(_dispatch_stub_791, _dispatch_stub_791@12)) + GL_STUB(_dispatch_stub_788, _gloffset_GetTexParameterPointervAPPLE, _dispatch_stub_788@12) + HIDDEN(GL_PREFIX(_dispatch_stub_788, _dispatch_stub_788@12)) + GL_STUB(_dispatch_stub_789, _gloffset_TextureRangeAPPLE, _dispatch_stub_789@12) + HIDDEN(GL_PREFIX(_dispatch_stub_789, _dispatch_stub_789@12)) + GL_STUB(_dispatch_stub_790, _gloffset_StencilFuncSeparateATI, _dispatch_stub_790@16) + HIDDEN(GL_PREFIX(_dispatch_stub_790, _dispatch_stub_790@16)) + GL_STUB(_dispatch_stub_791, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_791@16) + HIDDEN(GL_PREFIX(_dispatch_stub_791, _dispatch_stub_791@16)) + GL_STUB(_dispatch_stub_792, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_792@16) + HIDDEN(GL_PREFIX(_dispatch_stub_792, _dispatch_stub_792@16)) + GL_STUB(_dispatch_stub_793, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_793@12) + HIDDEN(GL_PREFIX(_dispatch_stub_793, _dispatch_stub_793@12)) + GL_STUB(_dispatch_stub_794, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_794@12) + HIDDEN(GL_PREFIX(_dispatch_stub_794, _dispatch_stub_794@12)) GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8) GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12) @@ -1313,6 +1316,7 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(IsRenderbuffer, _gloffset_IsRenderbufferEXT, IsRenderbuffer@4, IsRenderbufferEXT, IsRenderbufferEXT@4) GL_STUB_ALIAS(RenderbufferStorage, _gloffset_RenderbufferStorageEXT, RenderbufferStorage@16, RenderbufferStorageEXT, RenderbufferStorageEXT@16) GL_STUB_ALIAS(FramebufferTextureLayer, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayer@20, FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) + GL_STUB_ALIAS(ProvokingVertex, _gloffset_ProvokingVertexEXT, ProvokingVertex@4, ProvokingVertexEXT, ProvokingVertexEXT@4) GLOBL GLNAME(gl_dispatch_functions_end) HIDDEN(GLNAME(gl_dispatch_functions_end)) diff --git a/src/mesa/x86/x86_xform.c b/src/mesa/x86/x86_xform.c index 16b2b26bcc..52f6b25d81 100644 --- a/src/mesa/x86/x86_xform.c +++ b/src/mesa/x86/x86_xform.c @@ -60,21 +60,24 @@ _mesa_x86_cliptest_points4( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ); + GLubyte *andMask, + GLboolean viewport_z_clip ); extern GLvector4f * _ASMAPI _mesa_x86_cliptest_points4_np( GLvector4f *clip_vec, GLvector4f *proj_vec, GLubyte clipMask[], GLubyte *orMask, - GLubyte *andMask ); + GLubyte *andMask, + GLboolean viewport_z_clip ); extern void _ASMAPI _mesa_v16_x86_cliptest_points4( GLfloat *first_vert, GLfloat *last_vert, GLubyte *or_mask, GLubyte *and_mask, - GLubyte *clip_mask ); + GLubyte *clip_mask, + GLboolean viewport_z_clip ); extern void _ASMAPI _mesa_v16_x86_general_xform( GLfloat *dest, |