diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-04-10 17:16:08 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-04-10 17:16:08 -0400 |
commit | 04f335fd16c2a13b9425797acf5c3989cb6def7f (patch) | |
tree | 9e92cecb0b2ac512fac1fc4ef911878849eaeb42 /src/mesa | |
parent | c0419f190c836130932164ac47cfb53de668d423 (diff) | |
parent | 5e361c47abf2ee20140628d327eda9b39351d415 (diff) |
Merge branch 'radeon-rewrite' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa into r6xx-rewrite
Diffstat (limited to 'src/mesa')
130 files changed, 7177 insertions, 6479 deletions
diff --git a/src/mesa/SConscript b/src/mesa/SConscript index d1b9e93c0c..9ffc15eeb7 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -91,6 +91,7 @@ if env['platform'] != 'winddk': 'main/texenvprogram.c', 'main/texformat.c', 'main/texgen.c', + 'main/texgetimage.c', 'main/teximage.c', 'main/texobj.c', 'main/texparam.c', diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 44adaf8682..276da41f4e 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -34,6 +34,7 @@ #include "main/renderbuffer.h" #include "main/texcompress.h" #include "main/texformat.h" +#include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/texstore.h" diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index ae79055405..38c2e7b00d 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -163,21 +163,18 @@ static int driBindContext(__DRIcontext *pcp, { __DRIscreenPrivate *psp = pcp->driScreenPriv; - /* - ** Assume error checking is done properly in glXMakeCurrent before - ** calling driBindContext. - */ - - if (pcp == NULL || pdp == None || prp == None) - return GL_FALSE; - /* Bind the drawable to the context */ - pcp->driDrawablePriv = pdp; - pcp->driReadablePriv = prp; - pdp->driContextPriv = pcp; - pdp->refcount++; - if ( pdp != prp ) { - prp->refcount++; + + if (pcp) { + pcp->driDrawablePriv = pdp; + pcp->driReadablePriv = prp; + if (pdp) { + pdp->driContextPriv = pcp; + pdp->refcount++; + } + if ( prp && pdp != prp ) { + prp->refcount++; + } } /* @@ -186,23 +183,21 @@ static int driBindContext(__DRIcontext *pcp, */ if (!psp->dri2.enabled) { - if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) { + if (pdp && !pdp->pStamp) { DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); __driUtilUpdateDrawableInfo(pdp); DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); } - - if ((pdp != prp) && (!prp->pStamp || *prp->pStamp != prp->lastStamp)) { + if (prp && pdp != prp && !prp->pStamp) { DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); __driUtilUpdateDrawableInfo(prp); DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); - } + } } /* Call device-specific MakeCurrent */ - (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp); - return GL_TRUE; + return (*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp); } /*@}*/ diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index c9acd81be7..66f277c10b 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -481,7 +481,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, - const u_int8_t * msaa_samples, unsigned num_msaa_modes) + const uint8_t * msaa_samples, unsigned num_msaa_modes) { static const uint8_t bits_table[4][4] = { /* R G B A */ diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c index ca33c1740f..97797d4788 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tex.c +++ b/src/mesa/drivers/dri/gamma/gamma_tex.c @@ -107,9 +107,14 @@ static void gammaSetTexFilter(gammaContextPtr gmesa, static void gammaSetTexBorderColor(gammaContextPtr gmesa, gammaTextureObjectPtr t, - GLubyte color[4]) + const GLfloat color[4]) { - t->TextureBorderColor = PACK_COLOR_8888(color[0], color[1], color[2], color[3]); + 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]); + t->TextureBorderColor = PACK_COLOR_8888(c[0], c[1], c[2], c[3]); } @@ -143,7 +148,7 @@ static void gammaTexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan ); + gammaSetTexBorderColor( gmesa, t, tObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: @@ -347,7 +352,7 @@ static void gammaBindTexture( GLcontext *ctx, GLenum target, gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - gammaSetTexBorderColor( gmesa, t, tObj->_BorderChan ); + gammaSetTexBorderColor( gmesa, t, tObj->BorderColor ); } } diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index ba4e6b5b0b..cd6e1a8e6e 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -162,7 +162,7 @@ static void i810SetTexFilter(i810ContextPtr imesa, static void -i810SetTexBorderColor( i810TextureObjectPtr t, GLubyte color[4] ) +i810SetTexBorderColor( i810TextureObjectPtr t, const GLfloat color[4] ) { /* Need a fallback. */ @@ -211,7 +211,7 @@ i810AllocTexObj( GLcontext *ctx, struct gl_texture_object *texObj ) i810SetTexWrapping( t, texObj->WrapS, texObj->WrapT ); /*i830SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/ i810SetTexFilter( imesa, t, texObj->MinFilter, texObj->MagFilter, bias ); - i810SetTexBorderColor( t, texObj->_BorderChan ); + i810SetTexBorderColor( t, texObj->BorderColor ); } return t; @@ -252,7 +252,7 @@ static void i810TexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - i810SetTexBorderColor( t, tObj->_BorderChan ); + i810SetTexBorderColor( t, tObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index df43b779a7..753c25b57e 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -122,6 +122,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) struct gl_texture_image *firstImage; GLuint *state = i830->state.Tex[unit], format, pitch; GLint lodbias; + GLubyte border[4]; memset(state, 0, sizeof(state)); @@ -294,11 +295,16 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) (ws))); } + /* convert border color from float to ubyte */ + CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->BorderColor[0]); + CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->BorderColor[1]); + CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor[2]); + CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor[3]); - state[I830_TEXREG_TM0S4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0], - tObj->_BorderChan[1], - tObj->_BorderChan[2], - tObj->_BorderChan[3]); + state[I830_TEXREG_TM0S4] = INTEL_PACKCOLOR8888(border[0], + border[1], + border[2], + border[3]); I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), GL_TRUE); diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 6d25f8dd8e..43f65392b5 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -133,6 +133,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) struct gl_texture_image *firstImage; GLuint *state = i915->state.Tex[unit], format, pitch; GLint lodbias; + GLubyte border[4]; memset(state, 0, sizeof(state)); @@ -318,21 +319,26 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) state[I915_TEXREG_SS3] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT); } + /* convert border color from float to ubyte */ + CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->BorderColor[0]); + CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->BorderColor[1]); + CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor[2]); + CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor[3]); if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { /* GL specs that border color for depth textures is taken from the * R channel, while the hardware uses A. Spam R into all the channels * for safety. */ - state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0], - tObj->_BorderChan[0], - tObj->_BorderChan[0], - tObj->_BorderChan[0]); + state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(border[0], + border[0], + border[0], + border[0]); } else { - state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(tObj->_BorderChan[0], - tObj->_BorderChan[1], - tObj->_BorderChan[2], - tObj->_BorderChan[3]); + state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(border[0], + border[1], + border[2], + border[3]); } diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 48ed4325be..01e07c967f 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -167,6 +167,9 @@ struct brw_fragment_program { struct gl_fragment_program program; GLuint id; /**< serial no. to identify frag progs, never re-used */ GLboolean isGLSL; /**< really, any IF/LOOP/CONT/BREAK instructions */ + + /** Program constant buffer/surface */ + dri_bo *const_buffer; }; @@ -238,8 +241,16 @@ struct brw_vs_ouput_sizes { }; +/** Number of texture sampler units */ #define BRW_MAX_TEX_UNIT 16 -#define BRW_WM_MAX_SURF BRW_MAX_TEX_UNIT + MAX_DRAW_BUFFERS + +/** + * Size of our surface binding table. + * This contains pointers to the drawing surfaces and current texture + * objects and shader constant buffer (+1). + */ +#define BRW_WM_MAX_SURF (MAX_DRAW_BUFFERS + BRW_MAX_TEX_UNIT + 1) + enum brw_cache_id { BRW_CC_VP, @@ -513,8 +524,8 @@ struct brw_context /* BRW_NEW_CURBE_OFFSETS: */ struct { - GLuint wm_start; - GLuint wm_size; + GLuint wm_start; /**< pos of first wm const in CURBE buffer */ + GLuint wm_size; /**< number of float[4] consts, multiple of 16 */ GLuint clip_start; GLuint clip_size; GLuint vs_start; @@ -588,7 +599,7 @@ struct brw_context GLuint nr_surfaces; GLuint max_threads; - dri_bo *scratch_buffer; + dri_bo *scratch_bo; GLuint sampler_count; dri_bo *sampler_bo; diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 545dedd34b..a6bfb7507e 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -38,6 +38,7 @@ #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "intel_batchbuffer.h" +#include "intel_regions.h" #include "brw_context.h" #include "brw_defines.h" #include "brw_state.h" @@ -251,6 +252,7 @@ static void prepare_constant_buffer(struct brw_context *brw) _mesa_load_state_parameters(ctx, vp->program.Base.Parameters); + /* XXX just use a memcpy here */ for (i = 0; i < nr; i++) { const GLfloat *value = vp->program.Base.Parameters->ParameterValues[i]; buf[offset + i * 4 + 0] = value[0]; @@ -330,11 +332,39 @@ static void prepare_constant_buffer(struct brw_context *brw) } +/** + * Vertex/fragment shader constants are stored in a pseudo 1D texture. + * This function updates the constants in that buffer. + */ +static void +update_texture_constant_buffer(struct brw_context *brw) +{ + struct brw_fragment_program *fp = + (struct brw_fragment_program *) brw->fragment_program; + const struct gl_program_parameter_list *params = fp->program.Base.Parameters; + const int size = params->NumParameters * 4 * sizeof(GLfloat); + + assert(fp->const_buffer); + assert(fp->const_buffer->size >= size); + + /* copy constants into the buffer */ + if (size > 0) { + GLubyte *map; + dri_bo_map(fp->const_buffer, GL_TRUE); + map = fp->const_buffer->virtual; + memcpy(map, params->ParameterValues, size); + dri_bo_unmap(fp->const_buffer); + } +} + + static void emit_constant_buffer(struct brw_context *brw) { struct intel_context *intel = &brw->intel; GLuint sz = brw->curbe.total_size; + update_texture_constant_buffer(brw); + BEGIN_BATCH(2, IGNORE_CLIPRECTS); if (sz == 0) { OUT_BATCH((CMD_CONST_BUFFER << 16) | (2 - 2)); diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 590b064c7e..98fc909c2a 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -225,6 +225,24 @@ #define BRW_RASTRULE_UPPER_LEFT 0 #define BRW_RASTRULE_UPPER_RIGHT 1 +/* These are listed as "Reserved, but not seen as useful" + * in Intel documentation (page 212, "Point Rasterization Rule", + * section 7.4 "SF Pipeline State Summary", of document + * "Intel® 965 Express Chipset Family and Intel® G35 Express + * Chipset Graphics Controller Programmer's Reference Manual, + * Volume 2: 3D/Media", Revision 1.0b as of January 2008, + * available at + * http://intellinuxgraphics.org/documentation.html + * at the time of this writing). + * + * These appear to be supported on at least some + * i965-family devices, and the BRW_RASTRULE_LOWER_RIGHT + * is useful when using OpenGL to render to a FBO + * (which has the pixel coordinate Y orientation inverted + * with respect to the normal OpenGL pixel coordinate system). + */ +#define BRW_RASTRULE_LOWER_LEFT 2 +#define BRW_RASTRULE_LOWER_RIGHT 3 #define BRW_RENDERTARGET_CLAMPRANGE_UNORM 0 #define BRW_RENDERTARGET_CLAMPRANGE_SNORM 1 @@ -349,9 +367,10 @@ #define BRW_SURFACEFORMAT_L8A8_UNORM 0x114 #define BRW_SURFACEFORMAT_I16_FLOAT 0x115 #define BRW_SURFACEFORMAT_L16_FLOAT 0x116 -#define BRW_SURFACEFORMAT_A16_FLOAT 0x117 -#define BRW_SURFACEFORMAT_R5G5_SNORM_B6_UNORM 0x119 -#define BRW_SURFACEFORMAT_B5G5R5X1_UNORM 0x11A +#define BRW_SURFACEFORMAT_A16_FLOAT 0x117 +#define BRW_SURFACEFORMAT_L8A8_UNORM_SRGB 0x118 +#define BRW_SURFACEFORMAT_R5G5_SNORM_B6_UNORM 0x119 +#define BRW_SURFACEFORMAT_B5G5R5X1_UNORM 0x11A #define BRW_SURFACEFORMAT_B5G5R5X1_UNORM_SRGB 0x11B #define BRW_SURFACEFORMAT_R8G8_SSCALED 0x11C #define BRW_SURFACEFORMAT_R8G8_USCALED 0x11D @@ -368,6 +387,7 @@ #define BRW_SURFACEFORMAT_A4P4_UNORM 0x148 #define BRW_SURFACEFORMAT_R8_SSCALED 0x149 #define BRW_SURFACEFORMAT_R8_USCALED 0x14A +#define BRW_SURFACEFORMAT_L8_UNORM_SRGB 0x14C #define BRW_SURFACEFORMAT_R1_UINT 0x181 #define BRW_SURFACEFORMAT_YCRCB_NORMAL 0x182 #define BRW_SURFACEFORMAT_YCRCB_SWAPUVY 0x183 diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 02998d5957..b91b20bec6 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -277,6 +277,7 @@ copy_array_to_vbo_array( struct brw_context *brw, struct brw_vertex_element *element, GLuint dst_stride) { + struct intel_context *intel = &brw->intel; GLuint size = element->count * dst_stride; get_space(brw, size, &element->bo, &element->offset); @@ -289,29 +290,52 @@ copy_array_to_vbo_array( struct brw_context *brw, } if (dst_stride == element->glarray->StrideB) { - dri_bo_subdata(element->bo, - element->offset, - size, - element->glarray->Ptr); + if (intel->intelScreen->kernel_exec_fencing) { + drm_intel_gem_bo_map_gtt(element->bo); + memcpy((char *)element->bo->virtual + element->offset, + element->glarray->Ptr, size); + drm_intel_gem_bo_unmap_gtt(element->bo); + } else { + dri_bo_subdata(element->bo, + element->offset, + size, + element->glarray->Ptr); + } } else { - void *data; char *dest; const unsigned char *src = element->glarray->Ptr; int i; - data = _mesa_malloc(dst_stride * element->count); - dest = data; - for (i = 0; i < element->count; i++) { - memcpy(dest, src, dst_stride); - src += element->glarray->StrideB; - dest += dst_stride; - } + if (intel->intelScreen->kernel_exec_fencing) { + drm_intel_gem_bo_map_gtt(element->bo); + dest = element->bo->virtual; + dest += element->offset; - dri_bo_subdata(element->bo, - element->offset, - size, - data); - _mesa_free(data); + for (i = 0; i < element->count; i++) { + memcpy(dest, src, dst_stride); + src += element->glarray->StrideB; + dest += dst_stride; + } + + drm_intel_gem_bo_unmap_gtt(element->bo); + } else { + void *data; + + data = _mesa_malloc(dst_stride * element->count); + dest = data; + for (i = 0; i < element->count; i++) { + memcpy(dest, src, dst_stride); + src += element->glarray->StrideB; + dest += dst_stride; + } + + dri_bo_subdata(element->bo, + element->offset, + size, + data); + + _mesa_free(data); + } } } @@ -563,7 +587,13 @@ static void brw_prepare_indices(struct brw_context *brw) /* Straight upload */ - dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr); + if (intel->intelScreen->kernel_exec_fencing) { + drm_intel_gem_bo_map_gtt(bo); + memcpy((char *)bo->virtual + offset, index_buffer->ptr, ib_size); + drm_intel_gem_bo_unmap_gtt(bo); + } else { + dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr); + } } else { offset = (GLuint) (unsigned long) index_buffer->ptr; diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index eb99c21711..d05f2e6c41 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -730,6 +730,13 @@ static INLINE struct brw_indirect brw_indirect( GLuint addr_subnr, GLint offset return ptr; } +/** Do two brw_regs refer to the same register? */ +static INLINE GLboolean +brw_same_reg(struct brw_reg r1, struct brw_reg r2) +{ + return r1.file == r2.file && r1.nr == r2.nr; +} + static INLINE struct brw_instruction *current_insn( struct brw_compile *p) { return &p->store[p->nr_insn]; @@ -851,6 +858,13 @@ void brw_dp_READ_16( struct brw_compile *p, GLuint msg_reg_nr, GLuint scratch_offset ); +void brw_dp_READ_4( struct brw_compile *p, + struct brw_reg dest, + GLuint msg_reg_nr, + GLboolean relAddr, + GLuint scratch_offset, + GLuint bind_table_index ); + void brw_dp_WRITE_16( struct brw_compile *p, struct brw_reg src, GLuint msg_reg_nr, diff --git a/src/mesa/drivers/dri/i965/brw_eu_debug.c b/src/mesa/drivers/dri/i965/brw_eu_debug.c index 91dbbd5af6..29f3f6d02f 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_debug.c +++ b/src/mesa/drivers/dri/i965/brw_eu_debug.c @@ -65,6 +65,7 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.width == BRW_WIDTH_8 && hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 && hwreg.type == BRW_REGISTER_TYPE_F) { + /* vector register */ _mesa_printf("vec%d", hwreg.nr); } else if (hwreg.file == BRW_GENERAL_REGISTER_FILE && @@ -72,8 +73,12 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.width == BRW_WIDTH_1 && hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 && hwreg.type == BRW_REGISTER_TYPE_F) { + /* "scalar" register */ _mesa_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); } + else if (hwreg.file == BRW_IMMEDIATE_VALUE) { + _mesa_printf("imm %f", hwreg.dw1.f); + } else { _mesa_printf("%s%d.%d<%d;%d,%d>:%s", file[hwreg.file], diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 6dce1ca48e..21ce8369db 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -320,14 +320,15 @@ static void brw_set_dp_read_message( struct brw_instruction *insn, { brw_set_src1(insn, brw_imm_d(0)); - insn->bits3.dp_read.binding_table_index = binding_table_index; - insn->bits3.dp_read.msg_control = msg_control; - insn->bits3.dp_read.msg_type = msg_type; - insn->bits3.dp_read.target_cache = target_cache; - insn->bits3.dp_read.response_length = response_length; - insn->bits3.dp_read.msg_length = msg_length; - insn->bits3.dp_read.msg_target = BRW_MESSAGE_TARGET_DATAPORT_READ; - insn->bits3.dp_read.end_of_thread = end_of_thread; + insn->bits3.dp_read.binding_table_index = binding_table_index; /*0:7*/ + insn->bits3.dp_read.msg_control = msg_control; /*8:11*/ + insn->bits3.dp_read.msg_type = msg_type; /*12:13*/ + insn->bits3.dp_read.target_cache = target_cache; /*14:15*/ + insn->bits3.dp_read.response_length = response_length; /*16:19*/ + insn->bits3.dp_read.msg_length = msg_length; /*20:23*/ + insn->bits3.dp_read.msg_target = BRW_MESSAGE_TARGET_DATAPORT_READ; /*24:27*/ + insn->bits3.dp_read.pad1 = 0; /*28:30*/ + insn->bits3.dp_read.end_of_thread = end_of_thread; /*31*/ } static void brw_set_sampler_message(struct brw_context *brw, @@ -770,7 +771,7 @@ void brw_CMP(struct brw_compile *p, * Helpers for the various SEND message types: */ -/* Invert 8 values +/** Extended math function, float[8]. */ void brw_math( struct brw_compile *p, struct brw_reg dest, @@ -802,7 +803,9 @@ void brw_math( struct brw_compile *p, data_type); } -/* Use 2 send instructions to invert 16 elements +/** + * Extended math function, float[16]. + * Use 2 send instructions. */ void brw_math_16( struct brw_compile *p, struct brw_reg dest, @@ -855,8 +858,11 @@ void brw_math_16( struct brw_compile *p, } - - +/** + * Write block of 16 dwords/floats to the data port Render Cache scratch buffer. + * Scratch offset should be a multiple of 64. + * Used for register spilling. + */ void brw_dp_WRITE_16( struct brw_compile *p, struct brw_reg src, GLuint msg_reg_nr, @@ -867,6 +873,7 @@ void brw_dp_WRITE_16( struct brw_compile *p, brw_set_mask_control(p, BRW_MASK_DISABLE); brw_set_compression_control(p, BRW_COMPRESSION_NONE); + /* set message header global offset field (reg 0, element 2) */ brw_MOV(p, retype(brw_vec1_grf(0, 2), BRW_REGISTER_TYPE_D), brw_imm_d(scratch_offset)); @@ -887,7 +894,7 @@ void brw_dp_WRITE_16( struct brw_compile *p, brw_set_src0(insn, src); brw_set_dp_write_message(insn, - 255, /* bti */ + 255, /* binding table index (255=stateless) */ BRW_DATAPORT_OWORD_BLOCK_4_OWORDS, /* msg_control */ BRW_DATAPORT_WRITE_MESSAGE_OWORD_BLOCK_WRITE, /* msg_type */ msg_length, @@ -895,10 +902,14 @@ void brw_dp_WRITE_16( struct brw_compile *p, 0, /* response_length */ 0); /* eot */ } - } +/** + * Read block of 16 dwords/floats from the data port Render Cache scratch buffer. + * Scratch offset should be a multiple of 64. + * Used for register spilling. + */ void brw_dp_READ_16( struct brw_compile *p, struct brw_reg dest, GLuint msg_reg_nr, @@ -909,6 +920,7 @@ void brw_dp_READ_16( struct brw_compile *p, brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_set_mask_control(p, BRW_MASK_DISABLE); + /* set message header global offset field (reg 0, element 2) */ brw_MOV(p, retype(brw_vec1_grf(0, 2), BRW_REGISTER_TYPE_D), brw_imm_d(scratch_offset)); @@ -927,10 +939,10 @@ void brw_dp_READ_16( struct brw_compile *p, brw_set_src0(insn, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW)); brw_set_dp_read_message(insn, - 255, /* bti */ - 3, /* msg_control */ + 255, /* binding table index (255=stateless) */ + 3, /* msg_control (3 means 4 Owords) */ BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ, /* msg_type */ - 1, /* target cache */ + 1, /* target cache (render/scratch) */ 1, /* msg_length */ 2, /* response_length */ 0); /* eot */ @@ -938,6 +950,56 @@ void brw_dp_READ_16( struct brw_compile *p, } +/** + * Read a float[4] vector from the data port Data Cache (const buffer). + * Scratch offset should be a multiple of 16. + * Used for fetching shader constants. + * If relAddr is true, we'll do an indirect fetch using the address register. + */ +void brw_dp_READ_4( struct brw_compile *p, + struct brw_reg dest, + GLuint msg_reg_nr, + GLboolean relAddr, + GLuint scratch_offset, + GLuint bind_table_index ) +{ + { + brw_push_insn_state(p); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_set_mask_control(p, BRW_MASK_DISABLE); + + /* set message header global offset field (reg 0, element 2) */ + brw_MOV(p, + retype(brw_vec1_grf(0, 2), BRW_REGISTER_TYPE_UD), + brw_imm_d(scratch_offset)); + brw_pop_insn_state(p); + } + + { + struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); + + insn->header.predicate_control = 0; /* XXX */ + insn->header.compression_control = BRW_COMPRESSION_NONE; + insn->header.destreg__conditonalmod = msg_reg_nr; + + /* cast dest to a uword[8] vector */ + dest = retype(vec8(dest), BRW_REGISTER_TYPE_UW); + + brw_set_dest(insn, dest); + brw_set_src0(insn, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW)); + + brw_set_dp_read_message(insn, + bind_table_index, /* binding table index (255=stateless) */ + 0, /* msg_control (0 means 1 Oword) */ + BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ, /* msg_type */ + 0, /* source cache = data cache */ + 1, /* msg_length */ + 1, /* response_length (1 Oword) */ + 0); /* eot */ + } +} + + void brw_fb_WRITE(struct brw_compile *p, struct brw_reg dest, GLuint msg_reg_nr, @@ -966,7 +1028,11 @@ void brw_fb_WRITE(struct brw_compile *p, } - +/** + * Texture sample instruction. + * Note: the msg_type plus msg_length values determine exactly what kind + * of sampling operation is performed. See volume 4, page 161 of docs. + */ void brw_SAMPLE(struct brw_compile *p, struct brw_reg dest, GLuint msg_reg_nr, @@ -1061,7 +1127,7 @@ void brw_SAMPLE(struct brw_compile *p, /* mov (8) r9.0<1>:f r9.0<8;8,1>:f { Align1 } */ brw_push_insn_state(p); - brw_set_compression_control(p, GL_FALSE); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_MOV(p, reg, reg); brw_pop_insn_state(p); } diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index d90bd82038..457bc2fc7f 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -111,6 +111,8 @@ static void brwProgramStringNotify( GLcontext *ctx, struct gl_program *prog ) { struct brw_context *brw = brw_context(ctx); + struct intel_context *intel = &brw->intel; + if (target == GL_FRAGMENT_PROGRAM_ARB) { struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog; struct brw_fragment_program *newFP = brw_fragment_program(fprog); @@ -126,6 +128,24 @@ static void brwProgramStringNotify( GLcontext *ctx, brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM; newFP->id = brw->program_id++; newFP->isGLSL = brw_wm_is_glsl(fprog); + + /* alloc constant buffer/surface */ + { + const struct gl_program_parameter_list *params = prog->Parameters; + const int size = params->NumParameters * 4 * sizeof(GLfloat); + + /* free old const buffer if too small */ + if (newFP->const_buffer && newFP->const_buffer->size < size) { + dri_bo_unreference(newFP->const_buffer); + newFP->const_buffer = NULL; + } + + if (!newFP->const_buffer) { + newFP->const_buffer = drm_intel_bo_alloc(intel->bufmgr, + "fp_const_buffer", + size, 64); + } + } } else if (target == GL_VERTEX_PROGRAM_ARB) { struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index ffdb0ae6df..862835f157 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -59,37 +59,6 @@ static GLboolean have_attr(struct brw_sf_compile *c, return (c->key.attrs & (1<<attr)) ? 1 : 0; } -/** - * Sets VERT_RESULT_FOGC.Y for gl_FrontFacing - * - * This is currently executed if the fragment program uses VERT_RESULT_FOGC - * at all, but this could be eliminated with a scan of the FP contents. - */ -static void -do_front_facing( struct brw_sf_compile *c ) -{ - struct brw_compile *p = &c->func; - int i; - - if (!have_attr(c, VERT_RESULT_FOGC)) - return; - - brw_push_insn_state(p); - brw_CMP(p, brw_null_reg(), - c->key.frontface_ccw ? BRW_CONDITIONAL_G : BRW_CONDITIONAL_L, - c->det, brw_imm_f(0)); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); - for (i = 0; i < 3; i++) { - struct brw_reg fogc = get_vert_attr(c, c->vert[i],FRAG_ATTRIB_FOGC); - brw_MOV(p, get_element(fogc, 1), brw_imm_f(0)); - brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); - brw_MOV(p, get_element(fogc, 1), brw_imm_f(1)); - brw_set_predicate_control(p, BRW_PREDICATE_NONE); - } - brw_pop_insn_state(p); -} - - /*********************************************************************** * Twoside lighting */ @@ -384,7 +353,6 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) invert_det(c); copy_z_inv_w(c); - do_front_facing(c); if (c->key.do_twoside_color) do_twoside_color(c); diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index 93a9686f71..fc4eddda0a 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -231,7 +231,33 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, sf.sf6.line_width = 0; /* _NEW_POINT */ - sf.sf6.point_rast_rule = BRW_RASTRULE_UPPER_RIGHT; /* opengl conventions */ + key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; + if (!key->render_to_fbo) { + /* Rendering to an OpenGL window */ + sf.sf6.point_rast_rule = BRW_RASTRULE_UPPER_RIGHT; + } + else { + /* If rendering to an FBO, the pixel coordinate system is + * inverted with respect to the normal OpenGL coordinate + * system, so BRW_RASTRULE_LOWER_RIGHT is correct. + * But this value is listed as "Reserved, but not seen as useful" + * in Intel documentation (page 212, "Point Rasterization Rule", + * section 7.4 "SF Pipeline State Summary", of document + * "Intel® 965 Express Chipset Family and Intel® G35 Express + * Chipset Graphics Controller Programmer's Reference Manual, + * Volume 2: 3D/Media", Revision 1.0b as of January 2008, + * available at + * http://intellinuxgraphics.org/documentation.html + * at the time of this writing). + * + * It does work on at least some devices, if not all; + * if devices that don't support it can be identified, + * the likely failure case is that points are rasterized + * incorrectly, which is no worse than occurs without + * the value, so we're using it here. + */ + sf.sf6.point_rast_rule = BRW_RASTRULE_LOWER_RIGHT; + } /* XXX clamp max depends on AA vs. non-AA */ sf.sf7.sprite_point = key->point_sprite; diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index ef99e9c1ae..71bff166dd 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -32,21 +32,12 @@ #include "main/glheader.h" #include "main/mtypes.h" -#include "main/imports.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "main/image.h" #include "main/teximage.h" -#include "main/texstore.h" -#include "main/texformat.h" - -#include "texmem.h" #include "intel_context.h" #include "intel_regions.h" #include "intel_tex.h" #include "brw_context.h" -#include "brw_defines.h" void brw_FrameBufferTexInit( struct brw_context *brw, diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 3807dff991..0d6c6ab9a8 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -49,7 +49,8 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) /* r0 -- reserved as usual */ - c->r0 = brw_vec8_grf(reg, 0); reg++; + c->r0 = brw_vec8_grf(reg, 0); + reg++; /* User clip planes from curbe: */ @@ -60,7 +61,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) /* Deal with curbe alignment: */ - reg += ((6+c->key.nr_userclip+3)/4)*2; + reg += ((6 + c->key.nr_userclip + 3) / 4) * 2; } /* Vertex program parameters from curbe: @@ -69,7 +70,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) for (i = 0; i < nr_params; i++) { c->regs[PROGRAM_STATE_VAR][i] = stride( brw_vec4_grf(reg+i/2, (i%2) * 4), 0, 4, 1); } - reg += (nr_params+1)/2; + reg += (nr_params + 1) / 2; c->prog_data.curb_read_length = reg - 1; @@ -77,7 +78,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) */ c->nr_inputs = 0; for (i = 0; i < VERT_ATTRIB_MAX; i++) { - if (c->prog_data.inputs_read & (1<<i)) { + if (c->prog_data.inputs_read & (1 << i)) { c->nr_inputs++; c->regs[PROGRAM_INPUT][i] = brw_vec8_grf(reg, 0); reg++; @@ -91,7 +92,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->first_output = reg; mrf = 4; for (i = 0; i < VERT_RESULT_MAX; i++) { - if (c->prog_data.outputs_written & (1<<i)) { + if (c->prog_data.outputs_written & (1 << i)) { c->nr_outputs++; if (i == VERT_RESULT_HPOS) { c->regs[PROGRAM_OUTPUT][i] = brw_vec8_grf(reg, 0); @@ -133,16 +134,15 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) } for (i = 0; i < 128; i++) { - if (c->output_regs[i].used_in_src) { - c->output_regs[i].reg = brw_vec8_grf(reg, 0); - reg++; - } + if (c->output_regs[i].used_in_src) { + c->output_regs[i].reg = brw_vec8_grf(reg, 0); + reg++; + } } c->stack = brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, reg, 0); reg += 2; - - + /* Some opcodes need an internal temporary: */ c->first_tmp = reg; @@ -152,9 +152,9 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) * urb_read_length is the number of registers read from *each* * vertex urb, so is half the amount: */ - c->prog_data.urb_read_length = (c->nr_inputs+1)/2; + c->prog_data.urb_read_length = (c->nr_inputs + 1) / 2; - c->prog_data.urb_entry_size = (c->nr_outputs+2+3)/4; + c->prog_data.urb_entry_size = (c->nr_outputs + 2 + 3) / 4; c->prog_data.total_grf = reg; if (INTEL_DEBUG & DEBUG_VS) { @@ -187,6 +187,10 @@ static void release_tmps( struct brw_vs_compile *c ) } +/** + * If an instruction uses a temp reg both as a src and the dest, we + * sometimes need to allocate an intermediate temporary. + */ static void unalias1( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, @@ -206,6 +210,10 @@ static void unalias1( struct brw_vs_compile *c, } } +/** + * \sa unalias2 + * Checkes if 2-operand instruction needs an intermediate temporary. + */ static void unalias2( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, @@ -228,6 +236,10 @@ static void unalias2( struct brw_vs_compile *c, } } +/** + * \sa unalias2 + * Checkes if 3-operand instruction needs an intermediate temporary. + */ static void unalias3( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, @@ -981,7 +993,7 @@ post_vs_emit( struct brw_vs_compile *c, } -/* Emit the fragment program instructions here. +/* Emit the vertex program instructions here. */ void brw_vs_emit(struct brw_vs_compile *c ) { @@ -1038,7 +1050,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) struct prog_src_register *src = &inst->SrcReg[i]; index = src->Index; file = src->File; - if (file == PROGRAM_OUTPUT&&c->output_regs[index].used_in_src) + if (file == PROGRAM_OUTPUT && c->output_regs[index].used_in_src) args[i] = c->output_regs[index].reg; else args[i] = get_arg(c, src); diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 1645ca0b70..90d74c2885 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -40,6 +40,8 @@ GLuint brw_wm_nr_args( GLuint opcode ) { switch (opcode) { + case WM_FRONTFACING: + return 0; case WM_PIXELXY: case WM_CINTERP: case WM_WPOSXY: @@ -103,12 +105,17 @@ brw_wm_non_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) brw_wm_pass1(c); /* Register allocation. + * Divide by two because we operate on 16 pixels at a time and require + * two GRF entries for each logical shader register. */ c->grf_limit = BRW_WM_MAX_GRF / 2; brw_wm_pass2(c); + /* how many general-purpose registers are used */ c->prog_data.total_grf = c->max_wm_grf; + + /* Scratch space is used for register spilling */ if (c->last_scratch) { c->prog_data.total_scratch = c->last_scratch + 0x40; } diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 7f0e5702f2..d0ab3bdc65 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -172,7 +172,8 @@ struct brw_wm_instruction { #define WM_CINTERP (MAX_OPCODE + 5) #define WM_WPOSXY (MAX_OPCODE + 6) #define WM_FB_WRITE (MAX_OPCODE + 7) -#define MAX_WM_OPCODE (MAX_OPCODE + 8) +#define WM_FRONTFACING (MAX_OPCODE + 8) +#define MAX_WM_OPCODE (MAX_OPCODE + 9) #define PROGRAM_PAYLOAD (PROGRAM_FILE_MAX) #define PAYLOAD_DEPTH (FRAG_ATTRIB_MAX) @@ -241,8 +242,8 @@ struct brw_wm_compile { /** Mapping from Mesa registers to hardware registers */ struct { - GLboolean inited; - struct brw_reg reg; + GLboolean inited; + struct brw_reg reg; } wm_regs[PROGRAM_PAYLOAD+1][256][4]; struct brw_reg stack; @@ -252,6 +253,14 @@ struct brw_wm_compile { GLuint tmp_index; GLuint tmp_max; GLuint subroutines[BRW_WM_MAX_SUBROUTINE]; + + /** using a real constant buffer? */ + GLboolean use_const_buffer; + /** we may need up to 3 constants per instruction (if use_const_buffer) */ + struct { + GLint index; + struct brw_reg reg; + } current_const[3]; }; diff --git a/src/mesa/drivers/dri/i965/brw_wm_debug.c b/src/mesa/drivers/dri/i965/brw_wm_debug.c index 8f07f89ebc..220821087c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_debug.c +++ b/src/mesa/drivers/dri/i965/brw_wm_debug.c @@ -130,6 +130,9 @@ void brw_wm_print_insn( struct brw_wm_compile *c, case WM_FB_WRITE: _mesa_printf(" = FB_WRITE"); break; + case WM_FRONTFACING: + _mesa_printf(" = FRONTFACING"); + break; default: _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode)); break; diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index f2dca9caa6..d65b1332c6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -254,6 +254,34 @@ static void emit_cinterp( struct brw_compile *p, } } +/* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */ +static void emit_frontfacing( struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask ) +{ + struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); + GLuint i; + + if (!(mask & WRITEMASK_XYZW)) + return; + + for (i = 0; i < 4; i++) { + if (mask & (1<<i)) { + brw_MOV(p, dst[i], brw_imm_f(0.0)); + } + } + + /* bit 31 is "primitive is back face", so checking < (1 << 31) gives + * us front face + */ + brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, r1_6ud, brw_imm_ud(1 << 31)); + for (i = 0; i < 4; i++) { + if (mask & (1<<i)) { + brw_MOV(p, dst[i], brw_imm_f(1.0)); + } + } + brw_set_predicate_control_flag_value(p, 0xff); +} static void emit_alu1( struct brw_compile *p, struct brw_instruction *(*func)(struct brw_compile *, @@ -996,8 +1024,8 @@ static void emit_fb_write( struct brw_wm_compile *c, } -/* Post-fragment-program processing. Send the results to the - * framebuffer. +/** + * Move a GPR to scratch memory. */ static void emit_spill( struct brw_wm_compile *c, struct brw_reg reg, @@ -1021,6 +1049,9 @@ static void emit_spill( struct brw_wm_compile *c, } +/** + * Load a GPR from scratch memory. + */ static void emit_unspill( struct brw_wm_compile *c, struct brw_reg reg, GLuint slot ) @@ -1041,13 +1072,14 @@ static void emit_unspill( struct brw_wm_compile *c, brw_dp_READ_16(p, retype(vec16(reg), BRW_REGISTER_TYPE_UW), - 1, + 1, slot); } /** - * Retrieve upto 4 GEN4 register pairs for the given wm reg: + * Retrieve up to 4 GEN4 register pairs for the given wm reg: + * Args with unspill_reg != 0 will be loaded from scratch memory. */ static void get_argument_regs( struct brw_wm_compile *c, struct brw_wm_ref *arg[], @@ -1057,13 +1089,12 @@ static void get_argument_regs( struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (arg[i]) { - - if (arg[i]->unspill_reg) - emit_unspill(c, + if (arg[i]->unspill_reg) + emit_unspill(c, brw_vec8_grf(arg[i]->unspill_reg, 0), arg[i]->value->spill_slot); - regs[i] = arg[i]->hw_reg; + regs[i] = arg[i]->hw_reg; } else { regs[i] = brw_null_reg(); @@ -1072,6 +1103,9 @@ static void get_argument_regs( struct brw_wm_compile *c, } +/** + * For values that have a spill_slot!=0, write those regs to scratch memory. + */ static void spill_values( struct brw_wm_compile *c, struct brw_wm_value *values, GLuint nr ) @@ -1160,6 +1194,10 @@ void brw_wm_emit( struct brw_wm_compile *c ) emit_fb_write(c, args[0], args[1], args[2], inst->target, inst->eot); break; + case WM_FRONTFACING: + emit_frontfacing(p, dst, dst_flags); + break; + /* Straightforward arithmetic: */ case OPCODE_ADD: diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 533be3858e..a7f5f1b9a2 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -58,7 +58,8 @@ static const char *wm_opcode_strings[] = { "PINTERP", "CINTERP", "WPOSXY", - "FB_WRITE" + "FB_WRITE", + "FRONTFACING", }; #if 0 @@ -313,18 +314,13 @@ static void emit_interp( struct brw_wm_compile *c, struct prog_dst_register dst = dst_reg(PROGRAM_INPUT, idx); struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx); struct prog_src_register deltas = get_delta_xy(c); - struct prog_src_register arg2; - GLuint opcode; - + /* Need to use PINTERP on attributes which have been * multiplied by 1/W in the SF program, and LINTERP on those * which have not: */ switch (idx) { case FRAG_ATTRIB_WPOS: - opcode = WM_LINTERP; - arg2 = src_undef(); - /* Have to treat wpos.xy specially: */ emit_op(c, @@ -345,7 +341,7 @@ static void emit_interp( struct brw_wm_compile *c, 0, interp, deltas, - arg2); + src_undef()); break; case FRAG_ATTRIB_COL0: case FRAG_ATTRIB_COL1: @@ -368,6 +364,56 @@ static void emit_interp( struct brw_wm_compile *c, src_undef()); } break; + case FRAG_ATTRIB_FOGC: + /* The FOGC input is really special. When a program uses glFogFragCoord, + * the results returned are supposed to be (f,0,0,1). But for Mesa GLSL, + * the glFrontFacing and glPointCoord values are also stashed in FOGC. + * So, write the interpolated fog value to X, then either 0, 1, or the + * stashed values to Y, Z, W. Note that this means that + * glFogFragCoord.yzw can be wrong in those cases! + */ + + /* Interpolate the fog coordinate */ + emit_op(c, + WM_PINTERP, + dst_mask(dst, WRITEMASK_X), + 0, + interp, + deltas, + get_pixel_w(c)); + + /* Move the front facing value into FOGC.y if it's needed. */ + if (c->fp->program.UsesFrontFacing) { + emit_op(c, + WM_FRONTFACING, + dst_mask(dst, WRITEMASK_Y), + 0, + src_undef(), + src_undef(), + src_undef()); + } else { + emit_op(c, + OPCODE_MOV, + dst_mask(dst, WRITEMASK_Y), + 0, + src_swizzle1(interp, SWIZZLE_ZERO), + src_undef(), + src_undef()); + } + + /* Should do the PointCoord thing here. */ + emit_op(c, + OPCODE_MOV, + dst_mask(dst, WRITEMASK_ZW), + 0, + src_swizzle(interp, + SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ONE), + src_undef(), + src_undef()); + break; default: emit_op(c, WM_PINTERP, diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 4cf092226c..575cd45d57 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -192,28 +192,42 @@ static void prealloc_reg(struct brw_wm_compile *c) /* constants */ { const int nr_params = c->fp->program.Base.Parameters->NumParameters; - const struct gl_program_parameter_list *plist = - c->fp->program.Base.Parameters; - int index = 0; - - /* number of float constants */ - c->prog_data.nr_params = 4 * nr_params; - - /* loop over program constants (float[4]) */ - for (i = 0; i < nr_params; i++) { - /* loop over XYZW channels */ - for (j = 0; j < 4; j++, index++) { - reg = brw_vec1_grf(c->reg_index + index / 8, index % 8); - /* Save pointer to parameter/constant value. - * Constants will be copied in prepare_constant_buffer() - */ - c->prog_data.param[index] = &plist->ParameterValues[i][j]; - set_reg(c, PROGRAM_STATE_VAR, i, j, reg); - } - } - /* number of constant regs used (each reg is float[8]) */ - c->nr_creg = 2 * ((4 * nr_params + 15) / 16); - c->reg_index += c->nr_creg; + + /* use a real constant buffer, or just use a section of the GRF? */ + c->use_const_buffer = GL_FALSE; /* (nr_params > 8);*/ + + if (c->use_const_buffer) { + /* We'll use a real constant buffer and fetch constants from + * it with a dataport read message. + */ + + /* number of float constants in CURBE */ + c->prog_data.nr_params = 0; + } + else { + const struct gl_program_parameter_list *plist = + c->fp->program.Base.Parameters; + int index = 0; + + /* number of float constants in CURBE */ + c->prog_data.nr_params = 4 * nr_params; + + /* loop over program constants (float[4]) */ + for (i = 0; i < nr_params; i++) { + /* loop over XYZW channels */ + for (j = 0; j < 4; j++, index++) { + reg = brw_vec1_grf(c->reg_index + index / 8, index % 8); + /* Save pointer to parameter/constant value. + * Constants will be copied in prepare_constant_buffer() + */ + c->prog_data.param[index] = &plist->ParameterValues[i][j]; + set_reg(c, PROGRAM_STATE_VAR, i, j, reg); + } + } + /* number of constant regs used (each reg is float[8]) */ + c->nr_creg = 2 * ((4 * nr_params + 15) / 16); + c->reg_index += c->nr_creg; + } } /* fragment shader inputs */ @@ -234,6 +248,81 @@ static void prealloc_reg(struct brw_wm_compile *c) c->reg_index++; c->stack = brw_uw16_reg(BRW_GENERAL_REGISTER_FILE, c->reg_index, 0); c->reg_index += 2; + + /* An instruction may reference up to three constants. + * They'll be found in these registers. + * XXX alloc these on demand! + */ + if (c->use_const_buffer) { + c->current_const[0].reg = alloc_tmp(c); + c->current_const[1].reg = alloc_tmp(c); + c->current_const[2].reg = alloc_tmp(c); + } + /* + printf("USE CONST BUFFER? %d\n", c->use_const_buffer); + printf("AFTER PRE_ALLOC, reg_index = %d\n", c->reg_index); + */ +} + + +/** + * Check if any of the instruction's src registers are constants, uniforms, + * or statevars. If so, fetch any constants that we don't already have in + * the three GRF slots. + */ +static void fetch_constants(struct brw_wm_compile *c, + const struct prog_instruction *inst) +{ + struct brw_compile *p = &c->func; + GLuint i; + + /* loop over instruction src regs */ + for (i = 0; i < 3; i++) { + const struct prog_src_register *src = &inst->SrcReg[i]; + if (src->File == PROGRAM_STATE_VAR || + src->File == PROGRAM_CONSTANT || + src->File == PROGRAM_UNIFORM) { + if (c->current_const[i].index != src->Index) { + + c->current_const[i].index = src->Index; + /*c->current_const[i].reg = alloc_tmp(c);*/ + + /* + printf(" fetch const[%d] for arg %d into reg %d\n", + src->Index, i, c->current_const[i].reg.nr); + */ + + /* need to fetch the constant now */ + brw_dp_READ_4(p, + c->current_const[i].reg, /* writeback dest */ + 1, /* msg_reg */ + src->RelAddr, /* relative indexing? */ + 16 * src->Index, /* byte offset */ + BRW_WM_MAX_SURF - 1 /* binding table index */ + ); + +#if 0 + /* dependency stall */ + { + int response_length = 1; + int mark = mark_tmps( c ); + struct brw_reg src = c->current_const[i].reg; + struct brw_reg tmp = alloc_tmp(c); + + /* mov (8) r9.0<1>:f r9.0<8;8,1>:f { Align1 } + */ + brw_push_insn_state(p); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_MOV(p, tmp, src); + brw_MOV(p, src, tmp); + brw_pop_insn_state(p); + + release_tmps( c, mark ); + } +#endif + } + } + } } @@ -241,24 +330,112 @@ static void prealloc_reg(struct brw_wm_compile *c) * Convert Mesa dst register to brw register. */ static struct brw_reg get_dst_reg(struct brw_wm_compile *c, - struct prog_instruction *inst, int component, int nr) + const struct prog_instruction *inst, + GLuint component) { + const int nr = 1; return get_reg(c, inst->DstReg.File, inst->DstReg.Index, component, nr, 0, 0); } +static struct brw_reg +get_src_reg_const(struct brw_wm_compile *c, + const struct prog_instruction *inst, + GLuint srcRegIndex, GLuint component) +{ + /* We should have already fetched the constant from the constant + * buffer in fetch_constants(). Now we just have to return a + * register description that extracts the needed component and + * smears it across all eight vector components. + */ + const struct prog_src_register *src = &inst->SrcReg[srcRegIndex]; + struct brw_reg const_reg; + + assert(component < 4); + assert(srcRegIndex < 3); + assert(c->current_const[srcRegIndex].index != -1); + const_reg = c->current_const[srcRegIndex].reg; + + /* extract desired float from the const_reg, and smear */ + const_reg = stride(const_reg, 0, 1, 0); + const_reg.subnr = component * 4; + + if (src->NegateBase) + const_reg = negate(const_reg); + if (src->Abs) + const_reg = brw_abs(const_reg); + + /* + printf(" form const[%d] for arg %d, comp %d, reg %d\n", + c->current_const[srcRegIndex].index, + srcRegIndex, + component, + const_reg.nr); + */ + + return const_reg; +} + + /** * Convert Mesa src register to brw register. */ static struct brw_reg get_src_reg(struct brw_wm_compile *c, - struct prog_src_register *src, int index, int nr) -{ - int component = GET_SWZ(src->Swizzle, index); - return get_reg(c, src->File, src->Index, component, nr, - src->NegateBase, src->Abs); + const struct prog_instruction *inst, + GLuint srcRegIndex, GLuint channel) +{ + const struct prog_src_register *src = &inst->SrcReg[srcRegIndex]; + const GLuint nr = 1; + const GLuint component = GET_SWZ(src->Swizzle, channel); + + if (c->use_const_buffer && + (src->File == PROGRAM_STATE_VAR || + src->File == PROGRAM_CONSTANT || + src->File == PROGRAM_UNIFORM)) { + return get_src_reg_const(c, inst, srcRegIndex, component); + } + else { + /* other type of source register */ + return get_reg(c, src->File, src->Index, component, nr, + src->NegateBase, src->Abs); + } +} + + +/** + * Same as \sa get_src_reg() but if the register is a literal, emit + * a brw_reg encoding the literal. + * Note that a brw instruction only allows one src operand to be a literal. + * For instructions with more than one operand, only the second can be a + * literal. This means that we treat some literals as constants/uniforms + * (which why PROGRAM_CONSTANT is checked in fetch_constants()). + * + */ +static struct brw_reg get_src_reg_imm(struct brw_wm_compile *c, + const struct prog_instruction *inst, + GLuint srcRegIndex, GLuint channel) +{ + const struct prog_src_register *src = &inst->SrcReg[srcRegIndex]; + if (src->File == PROGRAM_CONSTANT) { + /* a literal */ + const int component = GET_SWZ(src->Swizzle, channel); + const GLfloat *param = + c->fp->program.Base.Parameters->ParameterValues[src->Index]; + GLfloat value = param[component]; + if (src->NegateBase) + value = -value; + if (src->Abs) + value = FABSF(value); + /*printf(" form imm reg %f\n", value);*/ + return brw_imm_f(value); + } + else { + return get_src_reg(c, inst, srcRegIndex, channel); + } } + /** * Subroutines are minimal support for resusable instruction sequences. * They are implemented as simply as possible to minimise overhead: there @@ -332,8 +509,8 @@ static void emit_abs( struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (inst->DstReg.WriteMask & (1<<i)) { struct brw_reg src, dst; - dst = get_dst_reg(c, inst, i, 1); - src = get_src_reg(c, &inst->SrcReg[0], i, 1); + dst = get_dst_reg(c, inst, i); + src = get_src_reg(c, inst, 0, i); brw_MOV(p, dst, brw_abs(src)); } } @@ -350,8 +527,8 @@ static void emit_trunc( struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (mask & (1<<i)) { struct brw_reg src, dst; - dst = get_dst_reg(c, inst, i, 1) ; - src = get_src_reg(c, &inst->SrcReg[0], i, 1); + dst = get_dst_reg(c, inst, i); + src = get_src_reg(c, inst, 0, i); brw_RNDZ(p, dst, src); } } @@ -368,8 +545,8 @@ static void emit_mov( struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (mask & (1<<i)) { struct brw_reg src, dst; - dst = get_dst_reg(c, inst, i, 1); - src = get_src_reg(c, &inst->SrcReg[0], i, 1); + dst = get_dst_reg(c, inst, i); + src = get_src_reg_imm(c, inst, 0, i); brw_MOV(p, dst, src); } } @@ -386,8 +563,8 @@ static void emit_pixel_xy(struct brw_wm_compile *c, struct brw_compile *p = &c->func; GLuint mask = inst->DstReg.WriteMask; - dst0 = get_dst_reg(c, inst, 0, 1); - dst1 = get_dst_reg(c, inst, 1, 1); + dst0 = get_dst_reg(c, inst, 0); + dst1 = get_dst_reg(c, inst, 1); /* Calculate pixel centers by adding 1 or 0 to each of the * micro-tile coordinates passed in r1. */ @@ -414,10 +591,10 @@ static void emit_delta_xy(struct brw_wm_compile *c, struct brw_compile *p = &c->func; GLuint mask = inst->DstReg.WriteMask; - dst0 = get_dst_reg(c, inst, 0, 1); - dst1 = get_dst_reg(c, inst, 1, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); - src1 = get_src_reg(c, &inst->SrcReg[0], 1, 1); + dst0 = get_dst_reg(c, inst, 0); + dst1 = get_dst_reg(c, inst, 1); + src0 = get_src_reg(c, inst, 0, 0); + src1 = get_src_reg(c, inst, 0, 1); /* Calc delta X,Y by subtracting origin in r1 from the pixel * centers. */ @@ -482,7 +659,7 @@ static void emit_fb_write(struct brw_wm_compile *c, brw_push_insn_state(p); for (channel = 0; channel < 4; channel++) { - src0 = get_src_reg(c, &inst->SrcReg[0], channel, 1); + src0 = get_src_reg(c, inst, 0, channel); /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ brw_MOV(p, brw_message_reg(nr + channel), src0); @@ -493,11 +670,11 @@ static void emit_fb_write(struct brw_wm_compile *c, if (c->key.source_depth_to_render_target) { if (c->key.computes_depth) { - src0 = get_src_reg(c, &inst->SrcReg[2], 2, 1); + src0 = get_src_reg(c, inst, 2, 2); brw_MOV(p, brw_message_reg(nr), src0); } else { - src0 = get_src_reg(c, &inst->SrcReg[1], 1, 1); + src0 = get_src_reg(c, inst, 1, 1); brw_MOV(p, brw_message_reg(nr), src0); } @@ -524,7 +701,7 @@ static void emit_fb_write(struct brw_wm_compile *c, else #endif { - struct brw_reg src = get_src_reg(c, &inst->SrcReg[1], 1, 1); + struct brw_reg src = get_src_reg(c, inst, 1, 1); brw_MOV(p, brw_message_reg(nr), src); } nr += 2; @@ -544,10 +721,10 @@ static void emit_pixel_w( struct brw_wm_compile *c, struct brw_reg dst, src0, delta0, delta1; struct brw_reg interp3; - dst = get_dst_reg(c, inst, 3, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); - delta0 = get_src_reg(c, &inst->SrcReg[1], 0, 1); - delta1 = get_src_reg(c, &inst->SrcReg[1], 1, 1); + dst = get_dst_reg(c, inst, 3); + src0 = get_src_reg(c, inst, 0, 0); + delta0 = get_src_reg(c, inst, 1, 0); + delta1 = get_src_reg(c, inst, 1, 1); interp3 = brw_vec1_grf(src0.nr+1, 4); /* Calc 1/w - just linterp wpos[3] optimized by putting the @@ -575,9 +752,9 @@ static void emit_linterp(struct brw_wm_compile *c, struct brw_reg src0; GLuint nr, i; - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); - delta0 = get_src_reg(c, &inst->SrcReg[1], 0, 1); - delta1 = get_src_reg(c, &inst->SrcReg[1], 1, 1); + src0 = get_src_reg(c, inst, 0, 0); + delta0 = get_src_reg(c, inst, 1, 0); + delta1 = get_src_reg(c, inst, 1, 1); nr = src0.nr; interp[0] = brw_vec1_grf(nr, 0); @@ -587,7 +764,7 @@ static void emit_linterp(struct brw_wm_compile *c, for(i = 0; i < 4; i++ ) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_LINE(p, brw_null_reg(), interp[i], delta0); brw_MAC(p, dst, suboffset(interp[i],1), delta1); } @@ -604,7 +781,7 @@ static void emit_cinterp(struct brw_wm_compile *c, struct brw_reg dst, src0; GLuint nr, i; - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); + src0 = get_src_reg(c, inst, 0, 0); nr = src0.nr; interp[0] = brw_vec1_grf(nr, 0); @@ -614,7 +791,7 @@ static void emit_cinterp(struct brw_wm_compile *c, for(i = 0; i < 4; i++ ) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_MOV(p, dst, suboffset(interp[i],3)); } } @@ -631,10 +808,10 @@ static void emit_pinterp(struct brw_wm_compile *c, struct brw_reg src0, w; GLuint nr, i; - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); - delta0 = get_src_reg(c, &inst->SrcReg[1], 0, 1); - delta1 = get_src_reg(c, &inst->SrcReg[1], 1, 1); - w = get_src_reg(c, &inst->SrcReg[2], 3, 1); + src0 = get_src_reg(c, inst, 0, 0); + delta0 = get_src_reg(c, inst, 1, 0); + delta1 = get_src_reg(c, inst, 1, 1); + w = get_src_reg(c, inst, 2, 3); nr = src0.nr; interp[0] = brw_vec1_grf(nr, 0); @@ -644,7 +821,7 @@ static void emit_pinterp(struct brw_wm_compile *c, for(i = 0; i < 4; i++ ) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_LINE(p, brw_null_reg(), interp[i], delta0); brw_MAC(p, dst, suboffset(interp[i],1), delta1); @@ -653,6 +830,36 @@ static void emit_pinterp(struct brw_wm_compile *c, } } +/* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */ +static void emit_frontfacing(struct brw_wm_compile *c, + struct prog_instruction *inst) +{ + struct brw_compile *p = &c->func; + struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); + struct brw_reg dst; + GLuint mask = inst->DstReg.WriteMask; + int i; + + for (i = 0; i < 4; i++) { + if (mask & (1<<i)) { + dst = get_dst_reg(c, inst, i); + brw_MOV(p, dst, brw_imm_f(0.0)); + } + } + + /* bit 31 is "primitive is back face", so checking < (1 << 31) gives + * us front face + */ + brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, r1_6ud, brw_imm_ud(1 << 31)); + for (i = 0; i < 4; i++) { + if (mask & (1<<i)) { + dst = get_dst_reg(c, inst, i); + brw_MOV(p, dst, brw_imm_f(1.0)); + } + } + brw_set_predicate_control_flag_value(p, 0xff); +} + static void emit_xpd(struct brw_wm_compile *c, struct prog_instruction *inst) { @@ -664,12 +871,12 @@ static void emit_xpd(struct brw_wm_compile *c, GLuint i1 = (i+1)%3; if (mask & (1<<i)) { struct brw_reg src0, src1, dst; - dst = get_dst_reg(c, inst, i, 1); - src0 = negate(get_src_reg(c, &inst->SrcReg[0], i2, 1)); - src1 = get_src_reg(c, &inst->SrcReg[1], i1, 1); + dst = get_dst_reg(c, inst, i); + src0 = negate(get_src_reg(c, inst, 0, i2)); + src1 = get_src_reg_imm(c, inst, 1, i1); brw_MUL(p, brw_null_reg(), src0, src1); - src0 = get_src_reg(c, &inst->SrcReg[0], i1, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i2, 1); + src0 = get_src_reg(c, inst, 0, i1); + src1 = get_src_reg_imm(c, inst, 1, i2); brw_set_saturate(p, inst->SaturateMode != SATURATE_OFF); brw_MAC(p, dst, src0, src1); brw_set_saturate(p, 0); @@ -685,11 +892,11 @@ static void emit_dp3(struct brw_wm_compile *c, int i; struct brw_compile *p = &c->func; for (i = 0; i < 3; i++) { - src0[i] = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1[i] = get_src_reg(c, &inst->SrcReg[1], i, 1); + src0[i] = get_src_reg(c, inst, 0, i); + src1[i] = get_src_reg_imm(c, inst, 1, i); } - dst = get_dst_reg(c, inst, get_scalar_dst_index(inst), 1); + dst = get_dst_reg(c, inst, get_scalar_dst_index(inst)); brw_MUL(p, brw_null_reg(), src0[0], src1[0]); brw_MAC(p, brw_null_reg(), src0[1], src1[1]); brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); @@ -704,10 +911,10 @@ static void emit_dp4(struct brw_wm_compile *c, int i; struct brw_compile *p = &c->func; for (i = 0; i < 4; i++) { - src0[i] = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1[i] = get_src_reg(c, &inst->SrcReg[1], i, 1); + src0[i] = get_src_reg(c, inst, 0, i); + src1[i] = get_src_reg_imm(c, inst, 1, i); } - dst = get_dst_reg(c, inst, get_scalar_dst_index(inst), 1); + dst = get_dst_reg(c, inst, get_scalar_dst_index(inst)); brw_MUL(p, brw_null_reg(), src0[0], src1[0]); brw_MAC(p, brw_null_reg(), src0[1], src1[1]); brw_MAC(p, brw_null_reg(), src0[2], src1[2]); @@ -723,10 +930,10 @@ static void emit_dph(struct brw_wm_compile *c, int i; struct brw_compile *p = &c->func; for (i = 0; i < 4; i++) { - src0[i] = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1[i] = get_src_reg(c, &inst->SrcReg[1], i, 1); + src0[i] = get_src_reg(c, inst, 0, i); + src1[i] = get_src_reg_imm(c, inst, 1, i); } - dst = get_dst_reg(c, inst, get_scalar_dst_index(inst), 1); + dst = get_dst_reg(c, inst, get_scalar_dst_index(inst)); brw_MUL(p, brw_null_reg(), src0[0], src1[0]); brw_MAC(p, brw_null_reg(), src0[1], src1[1]); brw_MAC(p, dst, src0[2], src1[2]); @@ -751,7 +958,7 @@ static void emit_math1(struct brw_wm_compile *c, tmp = alloc_tmp(c); /* Get first component of source register */ - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); + src0 = get_src_reg(c, inst, 0, 0); /* tmp = func(src0) */ brw_MOV(p, brw_message_reg(2), src0); @@ -769,7 +976,7 @@ static void emit_math1(struct brw_wm_compile *c, /* replicate tmp value across enabled dest channels */ for (i = 0; i < 4; i++) { if (inst->DstReg.WriteMask & (1 << i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_MOV(p, dst, tmp); } } @@ -823,15 +1030,28 @@ static void emit_add(struct brw_wm_compile *c, brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg(c, inst, 0, i); + src1 = get_src_reg_imm(c, inst, 1, i); brw_ADD(p, dst, src0, src1); } } brw_set_saturate(p, 0); } +static void emit_arl(struct brw_wm_compile *c, + struct prog_instruction *inst) +{ + struct brw_compile *p = &c->func; + struct brw_reg src0, addr_reg; + brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); + addr_reg = brw_uw8_reg(BRW_ARCHITECTURE_REGISTER_FILE, + BRW_ARF_ADDRESS, 0); + src0 = get_src_reg(c, inst, 0, 0); /* channel 0 */ + brw_MOV(p, addr_reg, src0); + brw_set_saturate(p, 0); +} + static void emit_sub(struct brw_wm_compile *c, struct prog_instruction *inst) { @@ -842,9 +1062,9 @@ static void emit_sub(struct brw_wm_compile *c, brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg(c, inst, 0, i); + src1 = get_src_reg_imm(c, inst, 1, i); brw_ADD(p, dst, src0, negate(src1)); } } @@ -861,9 +1081,9 @@ static void emit_mul(struct brw_wm_compile *c, brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg(c, inst, 0, i); + src1 = get_src_reg_imm(c, inst, 1, i); brw_MUL(p, dst, src0, src1); } } @@ -880,8 +1100,8 @@ static void emit_frc(struct brw_wm_compile *c, brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg_imm(c, inst, 0, i); brw_FRC(p, dst, src0); } } @@ -899,68 +1119,61 @@ static void emit_flr(struct brw_wm_compile *c, brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg_imm(c, inst, 0, i); brw_RNDD(p, dst, src0); } } brw_set_saturate(p, 0); } -static void emit_max(struct brw_wm_compile *c, - struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg src0, src1, dst; - int i; - brw_push_insn_state(p); - for (i = 0; i < 4; i++) { - if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_MOV(p, dst, src0); - brw_set_saturate(p, 0); - - brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, src0, src1); - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); - brw_MOV(p, dst, src1); - brw_set_saturate(p, 0); - brw_set_predicate_control_flag_value(p, 0xff); - } - } - brw_pop_insn_state(p); -} -static void emit_min(struct brw_wm_compile *c, - struct prog_instruction *inst) +static void emit_min_max(struct brw_wm_compile *c, + const struct prog_instruction *inst) { struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg src0, src1, dst; + const GLuint mask = inst->DstReg.WriteMask; + const int mark = mark_tmps(c); int i; brw_push_insn_state(p); for (i = 0; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + struct brw_reg real_dst = get_dst_reg(c, inst, i); + struct brw_reg src0 = get_src_reg(c, inst, 0, i); + struct brw_reg src1 = get_src_reg(c, inst, 1, i); + struct brw_reg dst; + /* if dst==src0 or dst==src1 we need to use a temp reg */ + GLboolean use_temp = brw_same_reg(dst, src0) || + brw_same_reg(dst, src1); + if (use_temp) + dst = alloc_tmp(c); + else + dst = real_dst; + + /* + printf(" Min/max: dst %d src0 %d src1 %d\n", + dst.nr, src0.nr, src1.nr); + */ brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); brw_MOV(p, dst, src0); brw_set_saturate(p, 0); - brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, src1, src0); + if (inst->Opcode == OPCODE_MIN) + brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, src1, src0); + else + brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_G, src1, src0); + brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); brw_MOV(p, dst, src1); brw_set_saturate(p, 0); brw_set_predicate_control_flag_value(p, 0xff); + if (use_temp) + brw_MOV(p, real_dst, dst); } } brw_pop_insn_state(p); + release_tmps(c, mark); } static void emit_pow(struct brw_wm_compile *c, @@ -968,9 +1181,9 @@ static void emit_pow(struct brw_wm_compile *c, { struct brw_compile *p = &c->func; struct brw_reg dst, src0, src1; - dst = get_dst_reg(c, inst, get_scalar_dst_index(inst), 1); - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], 0, 1); + dst = get_dst_reg(c, inst, get_scalar_dst_index(inst)); + src0 = get_src_reg_imm(c, inst, 0, 0); + src1 = get_src_reg_imm(c, inst, 1, 0); brw_MOV(p, brw_message_reg(2), src0); brw_MOV(p, brw_message_reg(3), src1); @@ -995,10 +1208,10 @@ static void emit_lrp(struct brw_wm_compile *c, int mark = mark_tmps(c); for (i = 0; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg(c, inst, 0, i); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + src1 = get_src_reg_imm(c, inst, 1, i); if (src1.nr == dst.nr) { tmp1 = alloc_tmp(c); @@ -1006,7 +1219,7 @@ static void emit_lrp(struct brw_wm_compile *c, } else tmp1 = src1; - src2 = get_src_reg(c, &inst->SrcReg[2], i, 1); + src2 = get_src_reg(c, inst, 2, i); if (src2.nr == dst.nr) { tmp2 = alloc_tmp(c); brw_MOV(p, tmp2, src2); @@ -1048,10 +1261,10 @@ static void emit_mad(struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); - src2 = get_src_reg(c, &inst->SrcReg[2], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg(c, inst, 0, i); + src1 = get_src_reg_imm(c, inst, 1, i); + src2 = get_src_reg_imm(c, inst, 2, i); brw_MUL(p, dst, src0, src1); brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); @@ -1071,9 +1284,9 @@ static void emit_sop(struct brw_wm_compile *c, for (i = 0; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); - src0 = get_src_reg(c, &inst->SrcReg[0], i, 1); - src1 = get_src_reg(c, &inst->SrcReg[1], i, 1); + dst = get_dst_reg(c, inst, i); + src0 = get_src_reg(c, inst, 0, i); + src1 = get_src_reg_imm(c, inst, 1, i); brw_push_insn_state(p); brw_CMP(p, brw_null_reg(), cond, src0, src1); brw_set_predicate_control(p, BRW_PREDICATE_NONE); @@ -1130,8 +1343,8 @@ static void emit_ddx(struct brw_wm_compile *c, struct brw_reg dst; struct brw_reg src0, w; GLuint nr, i; - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); - w = get_src_reg(c, &inst->SrcReg[1], 3, 1); + 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); @@ -1140,7 +1353,7 @@ static void emit_ddx(struct brw_wm_compile *c, 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, 1); + dst = get_dst_reg(c, inst, i); brw_MOV(p, dst, interp[i]); brw_MUL(p, dst, dst, w); } @@ -1158,9 +1371,9 @@ static void emit_ddy(struct brw_wm_compile *c, struct brw_reg src0, w; GLuint nr, i; - src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); + src0 = get_src_reg(c, inst, 0, 0); nr = src0.nr; - w = get_src_reg(c, &inst->SrcReg[1], 3, 1); + 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); @@ -1168,7 +1381,7 @@ static void emit_ddy(struct brw_wm_compile *c, 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, 1); + dst = get_dst_reg(c, inst, i); brw_MOV(p, dst, suboffset(interp[i], 1)); brw_MUL(p, dst, dst, w); } @@ -1302,7 +1515,7 @@ static void emit_noise1( struct brw_wm_compile *c, assert( mark == 0 ); - src = get_src_reg( c, inst->SrcReg, 0, 1 ); + src = get_src_reg( c, inst, 0, 0 ); param = alloc_tmp( c ); @@ -1314,7 +1527,7 @@ static void emit_noise1( struct brw_wm_compile *c, brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE ); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_MOV( p, dst, param ); } } @@ -1472,8 +1685,8 @@ static void emit_noise2( struct brw_wm_compile *c, assert( mark == 0 ); - src0 = get_src_reg( c, inst->SrcReg, 0, 1 ); - src1 = get_src_reg( c, inst->SrcReg, 1, 1 ); + src0 = get_src_reg( c, inst, 0, 0 ); + src1 = get_src_reg( c, inst, 0, 1 ); param0 = alloc_tmp( c ); param1 = alloc_tmp( c ); @@ -1487,7 +1700,7 @@ static void emit_noise2( struct brw_wm_compile *c, brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE ); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_MOV( p, dst, param0 ); } } @@ -1775,9 +1988,9 @@ static void emit_noise3( struct brw_wm_compile *c, assert( mark == 0 ); - src0 = get_src_reg( c, inst->SrcReg, 0, 1 ); - src1 = get_src_reg( c, inst->SrcReg, 1, 1 ); - src2 = get_src_reg( c, inst->SrcReg, 2, 1 ); + src0 = get_src_reg( c, inst, 0, 0 ); + src1 = get_src_reg( c, inst, 0, 1 ); + src2 = get_src_reg( c, inst, 0, 2 ); param0 = alloc_tmp( c ); param1 = alloc_tmp( c ); @@ -1793,7 +2006,7 @@ static void emit_noise3( struct brw_wm_compile *c, brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE ); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_MOV( p, dst, param0 ); } } @@ -2198,10 +2411,10 @@ static void emit_noise4( struct brw_wm_compile *c, assert( mark == 0 ); - src0 = get_src_reg( c, inst->SrcReg, 0, 1 ); - src1 = get_src_reg( c, inst->SrcReg, 1, 1 ); - src2 = get_src_reg( c, inst->SrcReg, 2, 1 ); - src3 = get_src_reg( c, inst->SrcReg, 3, 1 ); + src0 = get_src_reg( c, inst, 0, 0 ); + src1 = get_src_reg( c, inst, 0, 1 ); + src2 = get_src_reg( c, inst, 0, 2 ); + src3 = get_src_reg( c, inst, 0, 3 ); param0 = alloc_tmp( c ); param1 = alloc_tmp( c ); @@ -2219,7 +2432,7 @@ static void emit_noise4( struct brw_wm_compile *c, brw_set_saturate( p, inst->SaturateMode == SATURATE_ZERO_ONE ); for (i = 0 ; i < 4; i++) { if (mask & (1<<i)) { - dst = get_dst_reg(c, inst, i, 1); + dst = get_dst_reg(c, inst, i); brw_MOV( p, dst, param0 ); } } @@ -2236,11 +2449,11 @@ static void emit_wpos_xy(struct brw_wm_compile *c, GLuint mask = inst->DstReg.WriteMask; struct brw_reg src0[2], dst[2]; - dst[0] = get_dst_reg(c, inst, 0, 1); - dst[1] = get_dst_reg(c, inst, 1, 1); + dst[0] = get_dst_reg(c, inst, 0); + dst[1] = get_dst_reg(c, inst, 1); - src0[0] = get_src_reg(c, &inst->SrcReg[0], 0, 1); - src0[1] = get_src_reg(c, &inst->SrcReg[0], 1, 1); + src0[0] = get_src_reg(c, inst, 0, 0); + src0[1] = get_src_reg(c, inst, 0, 1); /* Calculate the pixel offset from window bottom left into destination * X and Y channels. @@ -2263,7 +2476,7 @@ static void emit_wpos_xy(struct brw_wm_compile *c, } /* TODO - BIAS on SIMD8 not workind yet... + BIAS on SIMD8 not working yet... */ static void emit_txb(struct brw_wm_compile *c, struct prog_instruction *inst) @@ -2271,19 +2484,20 @@ static void emit_txb(struct brw_wm_compile *c, struct brw_compile *p = &c->func; struct brw_reg dst[4], src[4], payload_reg; GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; - GLuint i; + payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); + for (i = 0; i < 4; i++) - dst[i] = get_dst_reg(c, inst, i, 1); + dst[i] = get_dst_reg(c, inst, i); for (i = 0; i < 4; i++) - src[i] = get_src_reg(c, &inst->SrcReg[0], i, 1); + src[i] = get_src_reg(c, inst, 0, i); switch (inst->TexSrcTarget) { case TEXTURE_1D_INDEX: - brw_MOV(p, brw_message_reg(2), src[0]); - brw_MOV(p, brw_message_reg(3), brw_imm_f(0)); - brw_MOV(p, brw_message_reg(4), brw_imm_f(0)); + brw_MOV(p, brw_message_reg(2), src[0]); /* s coord */ + brw_MOV(p, brw_message_reg(3), brw_imm_f(0)); /* t coord */ + brw_MOV(p, brw_message_reg(4), brw_imm_f(0)); /* r coord */ break; case TEXTURE_2D_INDEX: case TEXTURE_RECT_INDEX: @@ -2297,28 +2511,28 @@ static void emit_txb(struct brw_wm_compile *c, brw_MOV(p, brw_message_reg(4), src[2]); break; } - brw_MOV(p, brw_message_reg(5), src[3]); - brw_MOV(p, brw_message_reg(6), brw_imm_f(0)); + brw_MOV(p, brw_message_reg(5), src[3]); /* bias */ + brw_MOV(p, brw_message_reg(6), brw_imm_f(0)); /* ref (unused?) */ brw_SAMPLE(p, - retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), - 1, - retype(payload_reg, BRW_REGISTER_TYPE_UW), - unit + MAX_DRAW_BUFFERS, /* surface */ - unit, /* sampler */ - inst->DstReg.WriteMask, - BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS, - 4, - 4, - 0); + retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), /* dest */ + 1, /* msg_reg_nr */ + retype(payload_reg, BRW_REGISTER_TYPE_UW), /* src0 */ + unit + MAX_DRAW_BUFFERS, /* surface */ + unit, /* sampler */ + inst->DstReg.WriteMask, /* writemask */ + BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS, /* msg_type */ + 4, /* response_length */ + 4, /* msg_length */ + 0); /* eot */ } + static void emit_tex(struct brw_wm_compile *c, struct prog_instruction *inst) { struct brw_compile *p = &c->func; struct brw_reg dst[4], src[4], payload_reg; GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; - GLuint msg_len; GLuint i, nr; GLuint emit; @@ -2327,10 +2541,9 @@ static void emit_tex(struct brw_wm_compile *c, payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); for (i = 0; i < 4; i++) - dst[i] = get_dst_reg(c, inst, i, 1); + dst[i] = get_dst_reg(c, inst, i); for (i = 0; i < 4; i++) - src[i] = get_src_reg(c, &inst->SrcReg[0], i, 1); - + src[i] = get_src_reg(c, inst, 0, i); switch (inst->TexSrcTarget) { case TEXTURE_1D_INDEX: @@ -2349,6 +2562,7 @@ static void emit_tex(struct brw_wm_compile *c, } msg_len = 1; + /* move/load S, T, R coords */ for (i = 0; i < nr; i++) { static const GLuint swz[4] = {0,1,2,2}; if (emit & (1<<i)) @@ -2359,26 +2573,27 @@ static void emit_tex(struct brw_wm_compile *c, } if (shadow) { - brw_MOV(p, brw_message_reg(5), brw_imm_f(0)); - brw_MOV(p, brw_message_reg(6), src[2]); + brw_MOV(p, brw_message_reg(5), brw_imm_f(0)); /* lod / bias */ + brw_MOV(p, brw_message_reg(6), src[2]); /* ref value / R coord */ } brw_SAMPLE(p, - retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), - 1, - retype(payload_reg, BRW_REGISTER_TYPE_UW), - unit + MAX_DRAW_BUFFERS, /* surface */ - unit, /* sampler */ - inst->DstReg.WriteMask, - BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE, - 4, - shadow ? 6 : 4, - 0); + retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), /* dest */ + 1, /* msg_reg_nr */ + retype(payload_reg, BRW_REGISTER_TYPE_UW), /* src0 */ + unit + MAX_DRAW_BUFFERS, /* surface */ + unit, /* sampler */ + inst->DstReg.WriteMask, /* writemask */ + BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE, /* msg_type */ + 4, /* response_length */ + shadow ? 6 : 4, /* msg_length */ + 0); /* eot */ if (shadow) brw_MOV(p, dst[3], brw_imm_f(1.0)); } + /** * Resolve subroutine calls after code emit is done. */ @@ -2410,6 +2625,15 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) else brw_set_conditionalmod(p, BRW_CONDITIONAL_NONE); + /* + _mesa_printf("Inst %d: ", i); + _mesa_print_instruction(inst); + */ + + /* fetch any constants that this instruction needs */ + if (c->use_const_buffer) + fetch_constants(c, inst); + switch (inst->Opcode) { case WM_PIXELXY: emit_pixel_xy(c, inst); @@ -2435,12 +2659,18 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) case WM_FB_WRITE: emit_fb_write(c, inst); break; + case WM_FRONTFACING: + emit_frontfacing(c, inst); + break; case OPCODE_ABS: emit_abs(c, inst); break; case OPCODE_ADD: emit_add(c, inst); break; + case OPCODE_ARL: + emit_arl(c, inst); + break; case OPCODE_SUB: emit_sub(c, inst); break; @@ -2489,11 +2719,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) case OPCODE_LG2: emit_lg2(c, inst); break; - case OPCODE_MAX: - emit_max(c, inst); - break; case OPCODE_MIN: - emit_min(c, inst); + case OPCODE_MAX: + emit_min_max(c, inst); break; case OPCODE_DDX: emit_ddx(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 cf031899dd..ab9aa2f10d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass1.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass1.c @@ -268,6 +268,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) break; case OPCODE_DST: + case WM_FRONTFACING: default: break; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 68a9296a71..1fc9f01372 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -217,6 +217,7 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key, sampler->ss2.default_color_pointer = sdc_bo->offset >> 5; /* reloc */ } + /** Sets up the cache key for sampler state for all texture units */ static void brw_wm_sampler_populate_key(struct brw_context *brw, diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 63fc8a004f..58fa6aaf8f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -113,7 +113,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) /* temporary sanity check assertion */ ASSERT(bfp->isGLSL == brw_wm_is_glsl(fp)); - /* XXX: This needs a flag to indicate when it changes. */ + /* _NEW_DEPTH */ key->stats_wm = intel->stats_wm; /* _NEW_LINE */ @@ -125,6 +125,9 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) key->offset_factor = ctx->Polygon.OffsetFactor; } +/** + * Setup wm hardware state. See page 225 of Volume 2 + */ static dri_bo * wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, dri_bo **reloc_bufs) @@ -142,7 +145,7 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, if (key->total_scratch != 0) { wm.thread2.scratch_space_base_pointer = - brw->wm.scratch_buffer->offset >> 10; /* reloc */ + brw->wm.scratch_bo->offset >> 10; /* reloc */ wm.thread2.per_thread_scratch_space = key->total_scratch / 1024 - 1; } else { wm.thread2.scratch_space_base_pointer = 0; @@ -151,9 +154,9 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, wm.thread3.dispatch_grf_start_reg = key->dispatch_grf_start_reg; wm.thread3.urb_entry_read_length = key->urb_entry_read_length; + wm.thread3.urb_entry_read_offset = 0; wm.thread3.const_urb_entry_read_length = key->curb_entry_read_length; wm.thread3.const_urb_entry_read_offset = key->curbe_offset * 2; - wm.thread3.urb_entry_read_offset = 0; wm.wm4.sampler_count = (key->sampler_count + 1) / 4; if (brw->wm.sampler_bo != NULL) { @@ -220,7 +223,7 @@ wm_unit_create_from_key(struct brw_context *brw, struct brw_wm_unit_key *key, 0, 0, wm.thread2.per_thread_scratch_space, offsetof(struct brw_wm_unit_state, thread2), - brw->wm.scratch_buffer); + brw->wm.scratch_bo); } /* Emit sampler state relocation */ @@ -251,20 +254,20 @@ static void upload_wm_unit( struct brw_context *brw ) if (key.total_scratch) { GLuint total = key.total_scratch * key.max_threads; - if (brw->wm.scratch_buffer && total > brw->wm.scratch_buffer->size) { - dri_bo_unreference(brw->wm.scratch_buffer); - brw->wm.scratch_buffer = NULL; + if (brw->wm.scratch_bo && total > brw->wm.scratch_bo->size) { + dri_bo_unreference(brw->wm.scratch_bo); + brw->wm.scratch_bo = NULL; } - if (brw->wm.scratch_buffer == NULL) { - brw->wm.scratch_buffer = dri_bo_alloc(intel->bufmgr, - "wm scratch", - total, - 4096); + if (brw->wm.scratch_bo == NULL) { + brw->wm.scratch_bo = dri_bo_alloc(intel->bufmgr, + "wm scratch", + total, + 4096); } } reloc_bufs[0] = brw->wm.prog_bo; - reloc_bufs[1] = brw->wm.scratch_buffer; + reloc_bufs[1] = brw->wm.scratch_bo; reloc_bufs[2] = brw->wm.sampler_bo; dri_bo_unreference(brw->wm.state_bo); @@ -282,7 +285,8 @@ const struct brw_tracked_state brw_wm_unit = { .mesa = (_NEW_POLYGON | _NEW_POLYGONSTIPPLE | _NEW_LINE | - _NEW_COLOR), + _NEW_COLOR | + _NEW_DEPTH), .brw = (BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_CURBE_OFFSETS | 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 e6113eff87..e7d55d5dbd 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -33,6 +33,7 @@ #include "main/mtypes.h" #include "main/texformat.h" #include "main/texstore.h" +#include "shader/prog_parameter.h" #include "intel_mipmap_tree.h" #include "intel_batchbuffer.h" @@ -140,8 +141,15 @@ static GLuint translate_tex_format( GLuint mesa_format, GLenum internal_format, case MESA_FORMAT_RGBA_DXT5: return BRW_SURFACEFORMAT_BC3_UNORM; - case MESA_FORMAT_SRGBA8: - return BRW_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB; + case MESA_FORMAT_SARGB8: + return BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB; + + case MESA_FORMAT_SLA8: + return BRW_SURFACEFORMAT_L8A8_UNORM_SRGB; + + case MESA_FORMAT_SL8: + return BRW_SURFACEFORMAT_L8_UNORM_SRGB; + case MESA_FORMAT_SRGB_DXT1: return BRW_SURFACEFORMAT_BC1_UNORM_SRGB; @@ -159,6 +167,9 @@ static GLuint translate_tex_format( GLuint mesa_format, GLenum internal_format, case MESA_FORMAT_DUDV8: return BRW_SURFACEFORMAT_R8G8_SNORM; + case MESA_FORMAT_SIGNED_RGBA8888_REV: + return BRW_SURFACEFORMAT_R8G8B8A8_SNORM; + default: assert(0); return 0; @@ -277,6 +288,7 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) struct intel_texture_object *intelObj = intel_texture_object(tObj); struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel]; struct brw_wm_surface_key key; + const GLuint j = MAX_DRAW_BUFFERS + unit; memset(&key, 0, sizeof(key)); @@ -303,16 +315,111 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) key.cpp = intelObj->mt->cpp; key.tiling = intelObj->mt->region->tiling; - dri_bo_unreference(brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS]); - brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS] = brw_search_cache(&brw->cache, BRW_SS_SURFACE, - &key, sizeof(key), - &key.bo, key.bo ? 1 : 0, - NULL); - if (brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS] == NULL) { - brw->wm.surf_bo[unit + MAX_DRAW_BUFFERS] = brw_create_texture_surface(brw, &key); + dri_bo_unreference(brw->wm.surf_bo[j]); + brw->wm.surf_bo[j] = brw_search_cache(&brw->cache, BRW_SS_SURFACE, + &key, sizeof(key), + &key.bo, key.bo ? 1 : 0, + NULL); + if (brw->wm.surf_bo[j] == NULL) { + brw->wm.surf_bo[j] = brw_create_texture_surface(brw, &key); + } +} + + + +/** + * Create the constant buffer surface. Fragment shader constanst will be + * read from this buffer with Data Port Read instructions/messages. + */ +static dri_bo * +brw_create_constant_surface( struct brw_context *brw, + struct brw_wm_surface_key *key ) +{ + const GLint w = key->width - 1; + struct brw_surface_state surf; + dri_bo *bo; + + memset(&surf, 0, sizeof(surf)); + + surf.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; + surf.ss0.surface_type = BRW_SURFACE_BUFFER; + surf.ss0.surface_format = BRW_SURFACEFORMAT_R32G32B32A32_FLOAT; + + /* This is ok for all textures with channel width 8bit or less: + */ + assert(key->bo); + if (key->bo) + surf.ss1.base_addr = key->bo->offset; /* reloc */ + else + surf.ss1.base_addr = key->offset; + + surf.ss2.width = w & 0x7f; /* bits 6:0 of size or width */ + surf.ss2.height = (w >> 7) & 0x1fff; /* bits 19:7 of size or width */ + surf.ss3.depth = (w >> 20) & 0x7f; /* bits 26:20 of size or width */ + surf.ss3.pitch = (key->pitch * key->cpp) - 1; + brw_set_surface_tiling(&surf, key->tiling); + + bo = brw_upload_cache(&brw->cache, BRW_SS_SURFACE, + key, sizeof(*key), + &key->bo, key->bo ? 1 : 0, + &surf, sizeof(surf), + NULL, NULL); + + if (key->bo) { + /* Emit relocation to surface contents */ + dri_bo_emit_reloc(bo, + I915_GEM_DOMAIN_SAMPLER, 0, + 0, + offsetof(struct brw_surface_state, ss1), + key->bo); } + + return bo; } + +/** + * Update the constant buffer surface. + */ +static void +brw_update_constant_surface( GLcontext *ctx, + const struct brw_fragment_program *fp ) +{ + struct brw_context *brw = brw_context(ctx); + struct brw_wm_surface_key key; + const GLuint j = BRW_WM_MAX_SURF - 1; + const GLuint numParams = fp->program.Base.Parameters->NumParameters; + + memset(&key, 0, sizeof(key)); + + key.format = MESA_FORMAT_RGBA_FLOAT32; + key.internal_format = GL_RGBA; + key.bo = fp->const_buffer; + + key.depthmode = GL_NONE; + key.pitch = numParams; + key.width = numParams; + key.height = 1; + key.depth = 1; + key.cpp = 16; + + /* + printf("%s:\n", __FUNCTION__); + printf(" width %d height %d depth %d cpp %d pitch %d\n", + key.width, key.height, key.depth, key.cpp, key.pitch); + */ + + dri_bo_unreference(brw->wm.surf_bo[j]); + brw->wm.surf_bo[j] = brw_search_cache(&brw->cache, BRW_SS_SURFACE, + &key, sizeof(key), + &key.bo, key.bo ? 1 : 0, + NULL); + if (brw->wm.surf_bo[j] == NULL) { + brw->wm.surf_bo[j] = brw_create_constant_surface(brw, &key); + } +} + + /** * Sets up a surface state structure to point at the given region. * While it is only used for the front/back buffer currently, it should be @@ -467,7 +574,8 @@ static void prepare_wm_surfaces(struct brw_context *brw ) GLuint i; int old_nr_surfaces; - if (brw->state.nr_color_regions > 1) { + /* Update surfaces for drawing buffers */ + if (brw->state.nr_color_regions > 1) { for (i = 0; i < brw->state.nr_color_regions; i++) { brw_update_region_surface(brw, brw->state.color_regions[i], i, GL_FALSE); @@ -479,27 +587,41 @@ static void prepare_wm_surfaces(struct brw_context *brw ) old_nr_surfaces = brw->wm.nr_surfaces; brw->wm.nr_surfaces = MAX_DRAW_BUFFERS; + /* Update surfaces for textures */ for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; + const GLuint j = MAX_DRAW_BUFFERS + i; /* _NEW_TEXTURE, BRW_NEW_TEXDATA */ - if(texUnit->_ReallyEnabled) { + if (texUnit->_ReallyEnabled) { if (texUnit->_Current == intel->frame_buffer_texobj) { - dri_bo_unreference(brw->wm.surf_bo[i+MAX_DRAW_BUFFERS]); - brw->wm.surf_bo[i+MAX_DRAW_BUFFERS] = brw->wm.surf_bo[0]; - dri_bo_reference(brw->wm.surf_bo[i+MAX_DRAW_BUFFERS]); - brw->wm.nr_surfaces = i + MAX_DRAW_BUFFERS + 1; + /* render to texture */ + dri_bo_unreference(brw->wm.surf_bo[j]); + brw->wm.surf_bo[j] = brw->wm.surf_bo[0]; + dri_bo_reference(brw->wm.surf_bo[j]); + brw->wm.nr_surfaces = j + 1; } else { + /* regular texture */ brw_update_texture_surface(ctx, i); - brw->wm.nr_surfaces = i + MAX_DRAW_BUFFERS + 1; + brw->wm.nr_surfaces = j + 1; } } else { - dri_bo_unreference(brw->wm.surf_bo[i+MAX_DRAW_BUFFERS]); - brw->wm.surf_bo[i+MAX_DRAW_BUFFERS] = NULL; + dri_bo_unreference(brw->wm.surf_bo[j]); + brw->wm.surf_bo[j] = NULL; } + } + + /* Update surface for fragment shader constant buffer */ + { + const GLuint j = BRW_WM_MAX_SURF - 1; + const struct brw_fragment_program *fp = + brw_fragment_program_const(brw->fragment_program); + brw_update_constant_surface(ctx, fp); + brw->wm.nr_surfaces = j + 1; } + dri_bo_unreference(brw->wm.bind_bo); brw->wm.bind_bo = brw_wm_get_binding_table(brw); diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 4e033082b4..4ae9b118a3 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -98,11 +98,11 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv, ASSERT(src->cpp == dst->cpp); if (cpp == 2) { - BR13 = (0xCC << 16) | (1 << 24); + BR13 = (0xCC << 16) | BR13_565; CMD = XY_SRC_COPY_BLT_CMD; } else { - BR13 = (0xCC << 16) | (1 << 24) | (1 << 25); + BR13 = (0xCC << 16) | BR13_8888; CMD = XY_SRC_COPY_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; } @@ -194,13 +194,15 @@ intelEmitFillBlit(struct intel_context *intel, switch (cpp) { case 1: + BR13 = (0xF0 << 16); + CMD = XY_COLOR_BLT_CMD; + break; case 2: - case 3: - BR13 = (0xF0 << 16) | (1 << 24); + BR13 = (0xF0 << 16) | BR13_565; CMD = XY_COLOR_BLT_CMD; break; case 4: - BR13 = (0xF0 << 16) | (1 << 24) | (1 << 25); + BR13 = (0xF0 << 16) | BR13_8888; CMD = XY_COLOR_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; break; default: @@ -335,12 +337,11 @@ intelEmitCopyBlit(struct intel_context *intel, CMD = XY_SRC_COPY_BLT_CMD; break; case 2: - case 3: - BR13 |= (1 << 24); + BR13 |= BR13_565; CMD = XY_SRC_COPY_BLT_CMD; break; case 4: - BR13 |= (1 << 24) | (1 << 25); + BR13 |= BR13_8888; CMD = XY_SRC_COPY_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; break; default: @@ -510,7 +511,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) /* Setup the blit command */ if (cpp == 4) { - BR13 |= (1 << 24) | (1 << 25); + BR13 |= BR13_8888; if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL) { if (clearMask & BUFFER_BIT_DEPTH) CMD |= XY_BLT_WRITE_RGB; @@ -523,8 +524,8 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) } } else { - ASSERT(cpp == 2 || cpp == 0); - BR13 |= (1 << 24); + ASSERT(cpp == 2); + BR13 |= BR13_565; } #ifndef I915 diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 888bb3f18f..a664e74936 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -307,9 +307,11 @@ intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) if (!driContext->driScreenPriv->dri2.enabled) return; - intel_update_renderbuffers(driContext, driContext->driDrawablePriv); - if (driContext->driDrawablePriv != driContext->driReadablePriv) - intel_update_renderbuffers(driContext, driContext->driReadablePriv); + if (!intel->internal_viewport_call) { + intel_update_renderbuffers(driContext, driContext->driDrawablePriv); + if (driContext->driDrawablePriv != driContext->driReadablePriv) + intel_update_renderbuffers(driContext, driContext->driReadablePriv); + } old_viewport = ctx->Driver.Viewport; ctx->Driver.Viewport = NULL; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index e520ecf220..d635f3f50d 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -180,6 +180,7 @@ struct intel_context struct intel_region *front_region; struct intel_region *back_region; struct intel_region *depth_region; + GLboolean internal_viewport_call; /** * This value indicates that the kernel memory manager is being used diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c index f2e2e61935..f04638206d 100644 --- a/src/mesa/drivers/dri/intel/intel_decode.c +++ b/src/mesa/drivers/dri/intel/intel_decode.c @@ -1513,7 +1513,7 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, int *failures) for (i = 1; i < len;) { instr_out(data, hw_offset, i, "buffer %d: %svalid, type 0x%04x, " - "src offset 0x%04xd bytes\n", + "src offset 0x%04x bytes\n", data[i] >> 27, data[i] & (1 << 26) ? "" : "in", (data[i] >> 16) & 0x1ff, diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 8dd0b2461b..9ec1b4ec2f 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -132,6 +132,7 @@ static const struct dri_extension brw_extensions[] = { { "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 }, diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 7041ff389a..fc0ac0b79c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -184,7 +184,9 @@ intel_meta_set_passthrough_transform(struct intel_context *intel) intel->meta.saved_vp_height = ctx->Viewport.Height; intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode; + intel->internal_viewport_call = GL_TRUE; _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height); + intel->internal_viewport_call = GL_FALSE; _mesa_MatrixMode(GL_PROJECTION); _mesa_PushMatrix(); @@ -206,8 +208,10 @@ intel_meta_restore_transform(struct intel_context *intel) _mesa_MatrixMode(intel->meta.saved_matrix_mode); + intel->internal_viewport_call = GL_TRUE; _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, intel->meta.saved_vp_width, intel->meta.saved_vp_height); + intel->internal_viewport_call = GL_FALSE; } /** diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index d20ea15187..65e62947ef 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -563,6 +563,7 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen) GLboolean gem_supported; struct drm_i915_getparam gp; __DRIscreenPrivate *spriv = intelScreen->driScrnPriv; + int num_fences; intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL; @@ -613,8 +614,10 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen) &intelScreen->sarea->last_dispatch); } - /* XXX bufmgr should be per-screen, not per-context */ - intelScreen->ttm = intelScreen->ttm; + if (intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences)) + intelScreen->kernel_exec_fencing = !!num_fences; + else + intelScreen->kernel_exec_fencing = GL_FALSE; return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index e1036de4db..a9b9e109a6 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -79,6 +79,7 @@ typedef struct GLboolean no_vbo; int ttm; dri_bufmgr *bufmgr; + GLboolean kernel_exec_fencing; /** * Configuration cache with default values for all contexts diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index 8732354e7a..3322a71130 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -1,5 +1,6 @@ #include "intel_context.h" #include "intel_tex.h" +#include "intel_chipset.h" #include "main/texformat.h" #include "main/enums.h" @@ -160,24 +161,36 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_SRGB8_EXT: case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: - case GL_SLUMINANCE_EXT: - case GL_SLUMINANCE8_EXT: - case GL_SLUMINANCE_ALPHA_EXT: - case GL_SLUMINANCE8_ALPHA8_EXT: case GL_COMPRESSED_SRGB_EXT: case GL_COMPRESSED_SRGB_ALPHA_EXT: case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return &_mesa_texformat_srgba8; + return &_mesa_texformat_sargb8; + case GL_SLUMINANCE_EXT: + case GL_SLUMINANCE8_EXT: + if (IS_G4X(intel->intelScreen->deviceID)) + return &_mesa_texformat_sl8; + else + return &_mesa_texformat_sargb8; + case GL_SLUMINANCE_ALPHA_EXT: + case GL_SLUMINANCE8_ALPHA8_EXT: + if (IS_G4X(intel->intelScreen->deviceID)) + return &_mesa_texformat_sla8; + else + return &_mesa_texformat_sargb8; case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return &_mesa_texformat_srgb_dxt1; + /* i915 could also do this */ case GL_DUDV_ATI: case GL_DU8DV8_ATI: return &_mesa_texformat_dudv8; + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return &_mesa_texformat_signed_rgba8888_rev; #endif default: diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index e902187637..71561cf85c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -12,6 +12,7 @@ #include "main/simple_list.h" #include "main/texcompress.h" #include "main/texformat.h" +#include "main/texgetimage.h" #include "main/texobj.h" #include "main/texstore.h" #include "main/teximage.h" @@ -482,12 +483,13 @@ intelTexImage(GLcontext * ctx, LOCK_HARDWARE(intel); if (intelImage->mt) { - texImage->Data = intel_miptree_image_map(intel, - intelImage->mt, - intelImage->face, - intelImage->level, - &dstRowStride, - intelImage->base.ImageOffsets); + if (pixels) + texImage->Data = intel_miptree_image_map(intel, + intelImage->mt, + intelImage->face, + intelImage->level, + &dstRowStride, + intelImage->base.ImageOffsets); texImage->RowStride = dstRowStride / intelImage->mt->cpp; } else { @@ -537,17 +539,18 @@ intelTexImage(GLcontext * ctx, format, type, pixels, unpack)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } - } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - intel_generate_mipmap(ctx, target, texObj); + /* GL_SGIS_generate_mipmap */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + intel_generate_mipmap(ctx, target, texObj); + } } _mesa_unmap_teximage_pbo(ctx, unpack); if (intelImage->mt) { - intel_miptree_image_unmap(intel, intelImage->mt); + if (pixels) + intel_miptree_image_unmap(intel, intelImage->mt); texImage->Data = NULL; } diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 9fe267eafd..225d23179e 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -99,7 +99,7 @@ static void mach64SetTexFilter( mach64TexObjPtr t, } } -static void mach64SetTexBorderColor( mach64TexObjPtr t, GLubyte c[4] ) +static void mach64SetTexBorderColor( mach64TexObjPtr t, const GLfloat c[4] ) { #if 0 GLuint border = mach64PackColor( 4, c[0], c[1], c[2], c[3] ); @@ -131,7 +131,7 @@ mach64AllocTexObj( struct gl_texture_object *texObj ) mach64SetTexWrap( t, texObj->WrapS, texObj->WrapT ); mach64SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - mach64SetTexBorderColor( t, texObj->_BorderChan ); + mach64SetTexBorderColor( t, texObj->BorderColor ); return t; } @@ -471,7 +471,7 @@ static void mach64DDTexParameter( GLcontext *ctx, GLenum target, case GL_TEXTURE_BORDER_COLOR: if ( t->base.bound ) FLUSH_BATCH( mmesa ); - mach64SetTexBorderColor( t, tObj->_BorderChan ); + mach64SetTexBorderColor( t, tObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index 2392622b90..33eb0be449 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -153,10 +153,14 @@ mgaSetTexFilter( mgaTextureObjectPtr t, GLenum minf, GLenum magf ) t->setup.texfilter |= val; } -static void mgaSetTexBorderColor(mgaTextureObjectPtr t, GLubyte color[4]) +static void mgaSetTexBorderColor(mgaTextureObjectPtr t, const GLfloat color[4]) { - t->setup.texbordercol = PACK_COLOR_8888(color[3], color[0], - color[1], color[2] ); + 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]); + t->setup.texbordercol = PACK_COLOR_8888(c[3], c[0], c[1], c[2] ); } @@ -329,7 +333,7 @@ mgaAllocTexObj( struct gl_texture_object *tObj ) mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); - mgaSetTexBorderColor( t, tObj->_BorderChan ); + mgaSetTexBorderColor( t, tObj->BorderColor ); } return( t ); @@ -458,7 +462,7 @@ mgaTexParameter( GLcontext *ctx, GLenum target, case GL_TEXTURE_BORDER_COLOR: FLUSH_BATCH(mmesa); - mgaSetTexBorderColor(t, tObj->_BorderChan); + mgaSetTexBorderColor(t, tObj->BorderColor); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index 3fc9c06cfa..0920270d7b 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -135,8 +135,13 @@ static void r128SetTexFilter( r128TexObjPtr t, GLenum minf, GLenum magf ) } } -static void r128SetTexBorderColor( r128TexObjPtr t, GLubyte c[4] ) +static void r128SetTexBorderColor( r128TexObjPtr 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]); t->setup.tex_border_color = r128PackColor( 4, c[0], c[1], c[2], c[3] ); } @@ -165,7 +170,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj ) r128SetTexWrap( t, texObj->WrapS, texObj->WrapT ); r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - r128SetTexBorderColor( t, texObj->_BorderChan ); + r128SetTexBorderColor( t, texObj->BorderColor ); } return t; @@ -531,7 +536,7 @@ static void r128TexParameter( GLcontext *ctx, GLenum target, case GL_TEXTURE_BORDER_COLOR: if ( t->base.bound ) FLUSH_BATCH( rmesa ); - r128SetTexBorderColor( t, tObj->_BorderChan ); + r128SetTexBorderColor( t, tObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 1b9724d642..ebf389efe2 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1117,7 +1117,7 @@ void r200UpdateMaterial( GLcontext *ctx ) * _VP_inf_norm * _h_inf_norm * _Position - * _NormDirection + * _NormSpotDirection * _ModelViewInvScale * _NeedEyeCoords * _EyeZDir @@ -1174,9 +1174,9 @@ static void update_light( GLcontext *ctx ) fcmd[LIT_DIRECTION_W] = 0; } else { COPY_4V( &fcmd[LIT_POSITION_X], l->_Position ); - fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0]; - fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1]; - fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2]; + fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0]; + fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1]; + fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2]; fcmd[LIT_DIRECTION_W] = 0; } diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index fc2caabb5a..9f79157915 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -270,15 +270,16 @@ static void r200SetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf ) } } -static void r200SetTexBorderColor( radeonTexObjPtr t, GLubyte c[4] ) +static void r200SetTexBorderColor( radeonTexObjPtr 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]); t->pp_border_color = radeonPackColor( 4, c[0], c[1], c[2], c[3] ); } - - - - static void r200TexEnv( GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *param ) { @@ -378,7 +379,7 @@ static void r200TexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - r200SetTexBorderColor( t, texObj->_BorderChan ); + r200SetTexBorderColor( t, texObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: @@ -481,7 +482,7 @@ static struct gl_texture_object *r200NewTextureObject(GLcontext * ctx, r200SetTexWrap( t, t->base.WrapS, t->base.WrapT, t->base.WrapR ); r200SetTexMaxAnisotropy( t, t->base.MaxAnisotropy ); r200SetTexFilter(t, t->base.MinFilter, t->base.MagFilter); - r200SetTexBorderColor(t, t->base._BorderChan); + r200SetTexBorderColor(t, t->base.BorderColor); return &t->base; } diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 2dd2c6a4df..c575c9ac49 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -214,6 +214,7 @@ static void emit_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) struct radeon_renderbuffer *rrb; uint32_t cbpitch; uint32_t offset = r300->radeon.state.color.draw_offset; + uint32_t dw = 6; rrb = radeon_get_colorbuffer(&r300->radeon); if (!rrb || !rrb->bo) { @@ -230,11 +231,16 @@ static void emit_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) cbpitch |= R300_COLOR_TILE_ENABLE; - BEGIN_BATCH_NO_AUTOSTATE(8); + if (r300->radeon.radeonScreen->kernel_mm) + dw += 2; + BEGIN_BATCH_NO_AUTOSTATE(dw); OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); OUT_BATCH_RELOC(offset, rrb->bo, offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_BATCH_REGSEQ(R300_RB3D_COLORPITCH0, 1); - OUT_BATCH_RELOC(cbpitch, rrb->bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); + if (!r300->radeon.radeonScreen->kernel_mm) + OUT_BATCH(cbpitch); + else + OUT_BATCH_RELOC(cbpitch, rrb->bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); END_BATCH(); if (r300->radeon.radeonScreen->driScreen->dri2.enabled) { if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 06db7ab8ff..5f279d6629 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -345,10 +345,10 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, ctx->Const.MaxTextureMaxAnisotropy = 16.0; ctx->Const.MaxTextureLodBias = 16.0; - if (screen->chip_family >= CHIP_FAMILY_RV515) { + if (screen->chip_family >= CHIP_FAMILY_RV515) ctx->Const.MaxTextureLevels = 13; - ctx->Const.MaxTextureRectSize = 4096; - } + else + ctx->Const.MaxTextureLevels = 12; ctx->Const.MinPointSize = 1.0; ctx->Const.MinPointSizeAA = 1.0; diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 86e68e35fc..602f86ba66 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -76,8 +76,6 @@ typedef struct r300_context *r300ContextPtr; -/************ DMA BUFFERS **************/ - /* The blit width for texture uploads */ #define R300_BLIT_WIDTH_BYTES 1024 diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index bcf8803875..4fd6ba9b91 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -191,7 +191,7 @@ GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten) fprintf(stderr, "\tout of free texcoords to write fog coord\n"); _mesa_exit(-1); } - ret |= 4 << (3 * first_free_texcoord); + ret |= 1 << (3 * first_free_texcoord); } return ret; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 6796d36d4c..46c3df7099 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1510,9 +1510,9 @@ static void r300SetupRSUnit(GLcontext * ctx) /* with TCL we always seem to route 4 components */ if (hw_tcl_on) - count = 4; + count = 4; else - count = VB->AttribPtr[_TNL_ATTRIB_TEX(i)]->size; + count = VB->AttribPtr[_TNL_ATTRIB_TEX(i)]->size; switch(count) { case 4: swiz = R300_RS_SEL_S(0) | R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3); break; @@ -1530,12 +1530,22 @@ static void r300SetupRSUnit(GLcontext * ctx) ++fp_reg; } + if (InputsRead & FRAG_BIT_WPOS) { + r300->hw.ri.cmd[R300_RI_INTERP_0 + tex_ip] |= R300_RS_SEL_S(0) | R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3) | R300_RS_TEX_PTR(rs_tex_count); + r300->hw.rr.cmd[R300_RR_INST_0 + tex_ip] |= R300_RS_INST_TEX_ID(tex_ip) | R300_RS_INST_TEX_CN_WRITE | R300_RS_INST_TEX_ADDR(fp_reg); + InputsRead &= ~FRAG_BIT_WPOS; + rs_tex_count += 4; + ++tex_ip; + ++fp_reg; + } + if (InputsRead & FRAG_BIT_FOGC) { if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_FOGC, _TNL_ATTRIB_FOG)) { - r300->hw.ri.cmd[R300_RI_INTERP_0 + tex_ip] |= R300_RS_SEL_S(0) | R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3) | R300_RS_TEX_PTR(rs_tex_count); + r300->hw.ri.cmd[R300_RI_INTERP_0 + tex_ip] |= R300_RS_SEL_S(0) | R300_RS_SEL_T(R300_RS_SEL_K0) | R300_RS_SEL_R(R300_RS_SEL_K0); + r300->hw.ri.cmd[R300_RI_INTERP_0 + tex_ip] |= R300_RS_SEL_Q(R300_RS_SEL_K1) | R300_RS_TEX_PTR(rs_tex_count); r300->hw.rr.cmd[R300_RR_INST_0 + tex_ip] |= R300_RS_INST_TEX_ID(tex_ip) | R300_RS_INST_TEX_CN_WRITE | R300_RS_INST_TEX_ADDR(fp_reg); InputsRead &= ~FRAG_BIT_FOGC; - rs_tex_count += 4; + rs_tex_count += 1; ++tex_ip; ++fp_reg; } else { @@ -1543,16 +1553,6 @@ static void r300SetupRSUnit(GLcontext * ctx) } } - if (InputsRead & FRAG_BIT_WPOS) { - r300->hw.ri.cmd[R300_RI_INTERP_0 + tex_ip] |= R300_RS_SEL_S(0) | R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3) | R300_RS_TEX_PTR(rs_tex_count); - r300->hw.rr.cmd[R300_RR_INST_0 + tex_ip] |= R300_RS_INST_TEX_ID(tex_ip) | R300_RS_INST_TEX_CN_WRITE | R300_RS_INST_TEX_ADDR(fp_reg); - InputsRead &= ~FRAG_BIT_WPOS; - rs_tex_count += 4; - ++tex_ip; - ++fp_reg; - } - InputsRead &= ~FRAG_BIT_WPOS; - /* Setup default color if no color or tex was set */ if (rs_tex_count == 0 && col_ip == 0) { r300->hw.rr.cmd[R300_RR_INST_0] = R300_RS_INST_COL_ID(0) | R300_RS_INST_COL_CN_WRITE | R300_RS_INST_COL_ADDR(0) | R300_RS_COL_FMT(R300_RS_COL_FMT_0001); @@ -1560,10 +1560,10 @@ static void r300SetupRSUnit(GLcontext * ctx) } high_rr = (col_ip > tex_ip) ? col_ip : tex_ip; - r300->hw.rc.cmd[1] |= (rs_tex_count << R300_IT_COUNT_SHIFT) | (col_ip << R300_IC_COUNT_SHIFT) | R300_HIRES_EN; + r300->hw.rc.cmd[1] |= (rs_tex_count << R300_IT_COUNT_SHIFT) | (col_ip << R300_IC_COUNT_SHIFT) | R300_HIRES_EN; r300->hw.rc.cmd[2] |= high_rr - 1; - r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(r300->radeon.radeonScreen, R300_RS_INST_0, high_rr); + r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(r300->radeon.radeonScreen, R300_RS_INST_0, high_rr); if (InputsRead) WARN_ONCE("Don't know how to satisfy InputsRead=0x%08x\n", InputsRead); diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index d8a68f7fc5..03c1521de7 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -63,7 +63,7 @@ do { \ ++num_attrs; \ } while (0) -static void r300SwtclVAPSetup(GLcontext *ctx, GLuint InputsRead, GLuint OutputsWritten) +static void r300SwtclVAPSetup(GLcontext *ctx, GLuint InputsRead, GLuint OutputsWritten, GLuint vap_out_fmt_1) { r300ContextPtr rmesa = R300_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -139,7 +139,12 @@ static void r300SwtclVAPSetup(GLcontext *ctx, GLuint InputsRead, GLuint OutputsW rmesa->hw.vic.cmd[R300_VIC_CNTL_0] = r300VAPInputCntl0(ctx, InputsRead); rmesa->hw.vic.cmd[R300_VIC_CNTL_1] = r300VAPInputCntl1(ctx, InputsRead); rmesa->hw.vof.cmd[R300_VOF_CNTL_0] = r300VAPOutputCntl0(ctx, OutputsWritten); - rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = r300VAPOutputCntl1(ctx, OutputsWritten); + /** + * Can't use r300VAPOutputCntl1 function because it assumes + * that all texture coords have 4 components and that's the case + * for HW TCL path, but not for SW TCL. + */ + rmesa->hw.vof.cmd[R300_VOF_CNTL_1] = vap_out_fmt_1; vte = rmesa->hw.vte.cmd[1]; vte &= ~(R300_VTX_XY_FMT | R300_VTX_Z_FMT | R300_VTX_W0_FMT); @@ -166,7 +171,7 @@ static void r300SetVertexFormat( GLcontext *ctx ) r300ContextPtr rmesa = R300_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - int fog_id = -1; + int first_free_tex = 0, vap_out_fmt_1 = 0; GLuint InputsRead = 0; GLuint OutputsWritten = 0; int num_attrs = 0; @@ -217,34 +222,8 @@ static void r300SetVertexFormat( GLcontext *ctx ) ADD_ATTR(VERT_ATTRIB_POINT_SIZE, EMIT_1F, SWTCL_OVM_POINT_SIZE, swiz, MASK_X); } - if (RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_FOG)) { - /* find first free tex coord slot */ - if (RENDERINPUTS_TEST_RANGE(tnl->render_inputs_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { - int i; - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (!RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) )) { - fog_id = i; - break; - } - } - } else { - fog_id = 0; - } - - if (fog_id == -1) { - fprintf(stderr, "\tout of free texcoords to do fog\n"); - _mesa_exit(-1); - } - - InputsRead |= 1 << VERT_ATTRIB_FOG; - OutputsWritten |= 1 << VERT_RESULT_FOGC; - GLuint swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO); - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F ); - ADD_ATTR(VERT_ATTRIB_FOG, EMIT_1F, SWTCL_OVM_TEX(fog_id), swiz, MASK_X); - } - if (RENDERINPUTS_TEST_RANGE(tnl->render_inputs_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { - int i; + int i, size; GLuint swiz, mask, format; for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { if (RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) )) { @@ -254,16 +233,19 @@ static void r300SetVertexFormat( GLcontext *ctx ) format = EMIT_2F; swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ZERO, SWIZZLE_ZERO); mask = MASK_X | MASK_Y; + size = 2; break; case 3: format = EMIT_3F; swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); mask = MASK_X | MASK_Y | MASK_Z; + size = 3; break; case 4: format = EMIT_4F; swiz = SWIZZLE_XYZW; mask = MASK_XYZW; + size = 4; break; default: continue; @@ -272,42 +254,43 @@ static void r300SetVertexFormat( GLcontext *ctx ) OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i); EMIT_ATTR(_TNL_ATTRIB_TEX(i), format); ADD_ATTR(VERT_ATTRIB_TEX0 + i, format, SWTCL_OVM_TEX(i), swiz, mask); + vap_out_fmt_1 |= size << (i * 3); + ++first_free_tex; } } } /* RS can't put fragment position on the pixel stack, so stuff it in texcoord if needed */ if (RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_POS) && (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_WPOS)) { - int first_free_tex = -1; - if (fog_id >= 0) { - first_free_tex = fog_id+1; - } else { - if (RENDERINPUTS_TEST_RANGE(tnl->render_inputs_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { - int i; - for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (!RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) )) { - first_free_tex = i; - break; - } - } - } else { - first_free_tex = 0; - } - } - - if (first_free_tex == -1) { + if (first_free_tex >= ctx->Const.MaxTextureUnits) { fprintf(stderr, "\tout of free texcoords to write w pos\n"); _mesa_exit(-1); } InputsRead |= 1 << (VERT_ATTRIB_TEX0 + first_free_tex); OutputsWritten |= 1 << (VERT_RESULT_TEX0 + first_free_tex); - EMIT_ATTR( _TNL_ATTRIB_TEX(first_free_tex), EMIT_4F ); - ADD_ATTR(VERT_ATTRIB_TEX0 + first_free_tex, EMIT_4F, SWTCL_OVM_TEX(first_free_tex), SWIZZLE_XYZW, MASK_XYZW); + EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F ); + ADD_ATTR(VERT_ATTRIB_POS, EMIT_4F, SWTCL_OVM_TEX(first_free_tex), SWIZZLE_XYZW, MASK_XYZW); + vap_out_fmt_1 |= 4 << (first_free_tex * 3); + ++first_free_tex; + } + + if (RENDERINPUTS_TEST(tnl->render_inputs_bitset, _TNL_ATTRIB_FOG)) { + if (first_free_tex >= ctx->Const.MaxTextureUnits) { + fprintf(stderr, "\tout of free texcoords to write fog coordinate\n"); + _mesa_exit(-1); + } + + InputsRead |= 1 << VERT_ATTRIB_FOG; + OutputsWritten |= 1 << VERT_RESULT_FOGC; + GLuint swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO); + EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F ); + ADD_ATTR(VERT_ATTRIB_FOG, EMIT_1F, SWTCL_OVM_TEX(first_free_tex), swiz, MASK_X); + vap_out_fmt_1 |= 1 << (first_free_tex * 3); } R300_NEWPRIM(rmesa); - r300SwtclVAPSetup(ctx, InputsRead, OutputsWritten); + r300SwtclVAPSetup(ctx, InputsRead, OutputsWritten, vap_out_fmt_1); rmesa->radeon.swtcl.vertex_size = _tnl_install_attrs( ctx, @@ -460,7 +443,7 @@ do { \ #define LOCAL_VARS(n) \ r300ContextPtr rmesa = R300_CONTEXT(ctx); \ - GLuint color[n] = { 0, }, spec[n] = { 0, }; \ + GLuint color[n] = { 0, }, spec[n] = { 0, }; \ GLuint coloroffset = rmesa->swtcl.coloroffset; \ GLuint specoffset = rmesa->swtcl.specoffset; \ (void) color; (void) spec; (void) coloroffset; (void) specoffset; diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 0cbb2bcf3f..0af5bb4f46 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -176,8 +176,13 @@ static void r300SetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, GLfloa } } -static void r300SetTexBorderColor(radeonTexObjPtr t, GLubyte c[4]) +static void r300SetTexBorderColor(radeonTexObjPtr 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]); t->pp_border_color = PACK_COLOR_8888(c[3], c[0], c[1], c[2]); } @@ -211,7 +216,7 @@ static void r300TexParameter(GLcontext * ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - r300SetTexBorderColor(t, texObj->_BorderChan); + r300SetTexBorderColor(t, texObj->BorderColor); break; case GL_TEXTURE_BASE_LEVEL: @@ -308,7 +313,7 @@ static struct gl_texture_object *r300NewTextureObject(GLcontext * ctx, /* Initialize hardware state */ r300UpdateTexWrap(t); r300SetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy); - r300SetTexBorderColor(t, t->base._BorderChan); + r300SetTexBorderColor(t, t->base.BorderColor); return &t->base; } diff --git a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h index 9921d350e3..6f1a0b4535 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h +++ b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h @@ -5,6 +5,17 @@ #define RADEON_PARAM_DEVICE_ID 16 #endif +#ifndef RADEON_INFO_DEVICE_ID +#define RADEON_INFO_DEVICE_ID 0 +#endif +#ifndef RADEON_INFO_NUM_GB_PIPES +#define RADEON_INFO_NUM_GB_PIPES 0 +#endif + +#ifndef DRM_RADEON_INFO +#define DRM_RADEON_INFO 0x1 +#endif + #ifdef HAVE_LIBDRM_RADEON #include "radeon_bo.h" @@ -27,12 +38,16 @@ #define DRM_RADEON_GEM_INFO 0x1c struct drm_radeon_gem_info { - uint64_t gart_start; uint64_t gart_size; - uint64_t vram_start; uint64_t vram_size; uint64_t vram_visible; }; + +struct drm_radeon_info { + uint32_t request; + uint32_t pad; + uint32_t value; +}; #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_lighting.c b/src/mesa/drivers/dri/radeon/radeon_lighting.c index 6d9ccfa24d..ac3b94e4a6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lighting.c +++ b/src/mesa/drivers/dri/radeon/radeon_lighting.c @@ -246,7 +246,7 @@ void radeonUpdateMaterial( GLcontext *ctx ) * _VP_inf_norm * _h_inf_norm * _Position - * _NormDirection + * _NormSpotDirection * _ModelViewInvScale * _NeedEyeCoords * _EyeZDir @@ -308,9 +308,9 @@ void radeonUpdateLighting( GLcontext *ctx ) fcmd[LIT_DIRECTION_W] = 0; } else { COPY_4V( &fcmd[LIT_POSITION_X], l->_Position ); - fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0]; - fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1]; - fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2]; + fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0]; + fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1]; + fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2]; fcmd[LIT_DIRECTION_W] = 0; } diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 08a24a2c2b..df0128c378 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -287,8 +287,6 @@ radeonFillInModes( __DRIscreenPrivate *psp, __GLcontextModes *m; unsigned depth_buffer_factor; unsigned back_buffer_factor; - GLenum fb_format; - GLenum fb_type; int i; /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy @@ -319,20 +317,27 @@ radeonFillInModes( __DRIscreenPrivate *psp, depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; - if ( pixel_bits == 16 ) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } - else { - fb_format = GL_BGRA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } + if (pixel_bits == 16) { + __DRIconfig **configs_a8r8g8b8; + __DRIconfig **configs_r5g6b5; + + configs_r5g6b5 = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, back_buffer_modes, + back_buffer_factor, msaa_samples_array, + 1); + configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, + depth_bits_array, stencil_bits_array, + 1, back_buffer_modes, 1, + msaa_samples_array, 1); + configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8); + } else + configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, back_buffer_factor, + msaa_samples_array, 1); - configs = driCreateConfigs(fb_format, fb_type, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 80cfdaa2bf..d9a7ef6061 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -873,7 +873,7 @@ void radeonUpdateMaterial( GLcontext *ctx ) * _VP_inf_norm * _h_inf_norm * _Position - * _NormDirection + * _NormSpotDirection * _ModelViewInvScale * _NeedEyeCoords * _EyeZDir @@ -934,9 +934,9 @@ static void update_light( GLcontext *ctx ) fcmd[LIT_DIRECTION_W] = 0; } else { COPY_4V( &fcmd[LIT_POSITION_X], l->_Position ); - fcmd[LIT_DIRECTION_X] = -l->_NormDirection[0]; - fcmd[LIT_DIRECTION_Y] = -l->_NormDirection[1]; - fcmd[LIT_DIRECTION_Z] = -l->_NormDirection[2]; + fcmd[LIT_DIRECTION_X] = -l->_NormSpotDirection[0]; + fcmd[LIT_DIRECTION_Y] = -l->_NormSpotDirection[1]; + fcmd[LIT_DIRECTION_Z] = -l->_NormSpotDirection[2]; fcmd[LIT_DIRECTION_W] = 0; } diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 21509c6e5e..2549d5cb5c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -243,8 +243,13 @@ static void radeonSetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf ) } } -static void radeonSetTexBorderColor( radeonTexObjPtr t, GLubyte c[4] ) +static void radeonSetTexBorderColor( radeonTexObjPtr 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]); t->pp_border_color = radeonPackColor( 4, c[0], c[1], c[2], c[3] ); } @@ -339,7 +344,7 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - radeonSetTexBorderColor( t, texObj->_BorderChan ); + radeonSetTexBorderColor( t, texObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: @@ -439,7 +444,7 @@ radeonNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) radeonSetTexWrap( t, t->base.WrapS, t->base.WrapT ); radeonSetTexMaxAnisotropy( t, t->base.MaxAnisotropy ); radeonSetTexFilter( t, t->base.MinFilter, t->base.MagFilter ); - radeonSetTexBorderColor( t, t->base._BorderChan ); + radeonSetTexBorderColor( t, t->base.BorderColor ); return &t->base; } diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c index db66026363..9b92519862 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ b/src/mesa/drivers/dri/s3v/s3v_tex.c @@ -132,8 +132,14 @@ static void s3vSetTexFilter(s3vContextPtr vmesa, static void s3vSetTexBorderColor(s3vContextPtr vmesa, s3vTextureObjectPtr t, - GLubyte color[4]) + 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)); @@ -143,8 +149,7 @@ static void s3vSetTexBorderColor(s3vContextPtr vmesa, /* switch(t0 ... t->TextureColorMode) */ /* case TEX_COL_ARGB1555: */ - t->TextureBorderColor = - S3VIRGEPACKCOLOR555(color[0], color[1], color[2], color[3]); + t->TextureBorderColor = S3VIRGEPACKCOLOR555(c[0], c[1], c[2], c[3]); DEBUG(("TextureBorderColor = 0x%x\n", t->TextureBorderColor)); @@ -182,7 +187,7 @@ static void s3vTexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - s3vSetTexBorderColor( vmesa, t, tObj->_BorderChan ); + s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index a3bebfa8cf..fe239e1b05 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -474,7 +474,7 @@ static void savageSetTexFilter(savageTexObjPtr t, GLenum minf, GLenum magf) /* Need a fallback ? */ -static void savageSetTexBorderColor(savageTexObjPtr t, GLubyte color[4]) +static void savageSetTexBorderColor(savageTexObjPtr t, const GLfloat color[4]) { /* t->Setup[SAVAGE_TEXREG_TEXBORDERCOL] = */ /*t->setup.borderColor = SAVAGEPACKCOLOR8888(color[0],color[1],color[2],color[3]); */ @@ -512,7 +512,7 @@ savageAllocTexObj( struct gl_texture_object *texObj ) savageSetTexWrapping(t,texObj->WrapS,texObj->WrapT); savageSetTexFilter(t,texObj->MinFilter,texObj->MagFilter); - savageSetTexBorderColor(t,texObj->_BorderChan); + savageSetTexBorderColor(t,texObj->BorderColor); } return t; @@ -2018,7 +2018,7 @@ static void savageTexParameter( GLcontext *ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - savageSetTexBorderColor(t,tObj->_BorderChan); + savageSetTexBorderColor(t,tObj->BorderColor); break; default: diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 63f23fc014..46417ce414 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -456,11 +456,16 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj, break; } - current->texture[hw_unit].hwTextureBorderColor = - ((GLuint) texObj->_BorderChan[3] << 24) + - ((GLuint) texObj->_BorderChan[0] << 16) + - ((GLuint) texObj->_BorderChan[1] << 8) + - ((GLuint) texObj->_BorderChan[2]); + { + GLubyte c[4]; + CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor[3]); + + current->texture[hw_unit].hwTextureBorderColor = + PACK_COLOR_8888(c[3], c[0], c[1], c[2]); + } if (current->texture[hw_unit].hwTextureBorderColor != prev->texture[hw_unit].hwTextureBorderColor) diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index cc3e3ae6bf..4b66793e1c 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -5039,7 +5039,7 @@ <type name="char" size="1" glx_name="CARD8"/> - <enum name="GL_BLEND_EQUATION_RGB" value="0x8009"/> + <enum name="BLEND_EQUATION_RGB" value="0x8009"/> <enum name="VERTEX_ATTRIB_ARRAY_ENABLED" value="0x8622"/> <enum name="VERTEX_ATTRIB_ARRAY_SIZE" value="0x8623"/> <enum name="VERTEX_ATTRIB_ARRAY_STRIDE" value="0x8624"/> @@ -5684,29 +5684,29 @@ <!-- XXX some of the enums and functions probably need additional --> <!-- flags/attributes. --> - <enum name="GL_CURRENT_RASTER_SECONDARY_COLOR" value="0x845F"/> - <enum name="GL_PIXEL_PACK_BUFFER" value="0x88EB"/> - <enum name="GL_PIXEL_UNPACK_BUFFER" value="0x88EC"/> - <enum name="GL_PIXEL_PACK_BUFFER_BINDING" value="0x88ED"/> - <enum name="GL_PIXEL_UNPACK_BUFFER_BINDING" value="0x88EF"/> - <enum name="GL_FLOAT_MAT2x3" value="0x8B65"/> - <enum name="GL_FLOAT_MAT2x4" value="0x8B66"/> - <enum name="GL_FLOAT_MAT3x2" value="0x8B67"/> - <enum name="GL_FLOAT_MAT3x4" value="0x8B68"/> - <enum name="GL_FLOAT_MAT4x2" value="0x8B69"/> - <enum name="GL_FLOAT_MAT4x3" value="0x8B6A"/> - <enum name="GL_SRGB" value="0x8C40"/> - <enum name="GL_SRGB8" value="0x8C41"/> - <enum name="GL_SRGB_ALPHA" value="0x8C42"/> - <enum name="GL_SRGB8_ALPHA8" value="0x8C43"/> - <enum name="GL_SLUMINANCE_ALPHA" value="0x8C44"/> - <enum name="GL_SLUMINANCE8_ALPHA8" value="0x8C45"/> - <enum name="GL_SLUMINANCE" value="0x8C46"/> - <enum name="GL_SLUMINANCE8" value="0x8C47"/> - <enum name="GL_COMPRESSED_SRGB" value="0x8C48"/> - <enum name="GL_COMPRESSED_SRGB_ALPHA" value="0x8C49"/> - <enum name="GL_COMPRESSED_SLUMINANCE" value="0x8C4A"/> - <enum name="GL_COMPRESSED_SLUMINANCE_ALPHA" value="0x8C4B"/> + <enum name="CURRENT_RASTER_SECONDARY_COLOR" value="0x845F"/> + <enum name="PIXEL_PACK_BUFFER" value="0x88EB"/> + <enum name="PIXEL_UNPACK_BUFFER" value="0x88EC"/> + <enum name="PIXEL_PACK_BUFFER_BINDING" value="0x88ED"/> + <enum name="PIXEL_UNPACK_BUFFER_BINDING" value="0x88EF"/> + <enum name="FLOAT_MAT2x3" value="0x8B65"/> + <enum name="FLOAT_MAT2x4" value="0x8B66"/> + <enum name="FLOAT_MAT3x2" value="0x8B67"/> + <enum name="FLOAT_MAT3x4" value="0x8B68"/> + <enum name="FLOAT_MAT4x2" value="0x8B69"/> + <enum name="FLOAT_MAT4x3" value="0x8B6A"/> + <enum name="SRGB" value="0x8C40"/> + <enum name="SRGB8" value="0x8C41"/> + <enum name="SRGB_ALPHA" value="0x8C42"/> + <enum name="SRGB8_ALPHA8" value="0x8C43"/> + <enum name="SLUMINANCE_ALPHA" value="0x8C44"/> + <enum name="SLUMINANCE8_ALPHA8" value="0x8C45"/> + <enum name="SLUMINANCE" value="0x8C46"/> + <enum name="SLUMINANCE8" value="0x8C47"/> + <enum name="COMPRESSED_SRGB" value="0x8C48"/> + <enum name="COMPRESSED_SRGB_ALPHA" value="0x8C49"/> + <enum name="COMPRESSED_SLUMINANCE" value="0x8C4A"/> + <enum name="COMPRESSED_SLUMINANCE_ALPHA" value="0x8C4B"/> <function name="UniformMatrix2x3fv" offset="assign"> <param name="location" type="GLint"/> @@ -12326,6 +12326,12 @@ </function> </category> +<category name="GL_MESA_texture_signed_rgba"> + <enum name="SIGNED_NORMALIZED" value="0x8F9C"/> + <enum name="RGBA_SNORM" value="0x8F93"/> + <enum name="RGBA8_SNORM" value="0x8F97"/> +</category> + <category name="GL_MESA_shader_debug"> <enum name="DEBUG_OBJECT_MESA" value="0x8759"/> <enum name="DEBUG_PRINT_MESA" value="0x875A"/> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 1d2c460488..d5d0a552db 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1104,7 +1104,7 @@ _mesa_PopAttrib(void) _mesa_light(ctx, i, GL_DIFFUSE, l->Diffuse); _mesa_light(ctx, i, GL_SPECULAR, l->Specular ); _mesa_light(ctx, i, GL_POSITION, l->EyePosition); - _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->EyeDirection); + _mesa_light(ctx, i, GL_SPOT_DIRECTION, l->SpotDirection); _mesa_light(ctx, i, GL_SPOT_EXPONENT, &l->SpotExponent); _mesa_light(ctx, i, GL_SPOT_CUTOFF, &l->SpotCutoff); _mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 74692e9a98..815624ee50 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -71,9 +71,6 @@ /** \def COPY_CHAN4 * Copy a GLchan[4] array */ -/** \def CHAN_PRODUCT - * Scaled product (usually approximated) between two GLchan arguments */ - #if CHAN_BITS == 8 #define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (GLchan) (b)) @@ -91,8 +88,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4UBV(DST, SRC) -#define CHAN_PRODUCT(a, b) ((GLubyte) (((GLint)(a) * ((GLint)(b) + 1)) >> 8)) - #elif CHAN_BITS == 16 #define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (((GLchan) (b)) * 516)) @@ -110,8 +105,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) -#define CHAN_PRODUCT(a, b) ((GLchan) ((((GLuint) (a)) * ((GLuint) (b))) / 65535)) - #elif CHAN_BITS == 32 /* XXX floating-point color channels not fully thought-out */ @@ -130,8 +123,6 @@ #define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC) -#define CHAN_PRODUCT(a, b) ((a) * (b)) - #else #error unexpected CHAN_BITS size diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 39b19bb776..93103fe878 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -230,7 +230,10 @@ extern "C" { #if defined(__linux__) #include <byteswap.h> #define CPU_TO_LE32( x ) bswap_32( x ) -#else /*__linux__*/ +#elif defined(__APPLE__) +#include <CoreFoundation/CFByteOrder.h> +#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) +#else /*__linux__ __APPLE__*/ #include <sys/endian.h> #define CPU_TO_LE32( x ) bswap32( x ) #endif /*__linux__*/ diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index fc31155b35..2a9fdf9ca0 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -184,7 +184,7 @@ #define MAX_PROGRAM_MATRICES 8 #define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 #define MAX_PROGRAM_CALL_DEPTH 8 -#define MAX_PROGRAM_TEMPS 128 +#define MAX_PROGRAM_TEMPS 256 #define MAX_PROGRAM_ADDRESS_REGS 2 #define MAX_UNIFORMS 1024 /**< number of vec4 uniforms */ #define MAX_VARYING 8 /**< number of float[4] vectors */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 8f7f703da9..537ff5881f 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -975,7 +975,7 @@ _mesa_save_CallList(GLuint list) ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; if (ctx->ExecuteFlag) { - CALL_CallList(ctx->Exec, (list)); + _mesa_CallList(list); } } diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index e9de0c097a..6682b5e725 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -77,28 +77,30 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, } if (ctx->RenderMode == GL_RENDER) { - /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ - GLint x = IROUND(ctx->Current.RasterPos[0]); - GLint y = IROUND(ctx->Current.RasterPos[1]); - - if (ctx->Unpack.BufferObj->Name) { - /* unpack from PBO */ - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1, - format, type, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(invalid PBO access)"); - return; + if (width > 0 && height > 0) { + /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ + GLint x = IROUND(ctx->Current.RasterPos[0]); + GLint y = IROUND(ctx->Current.RasterPos[1]); + + if (ctx->Unpack.BufferObj->Name) { + /* unpack from PBO */ + if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1, + format, type, pixels)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDrawPixels(invalid PBO access)"); + return; + } + if (ctx->Unpack.BufferObj->Pointer) { + /* buffer is mapped - that's an error */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDrawPixels(PBO is mapped)"); + return; + } } - if (ctx->Unpack.BufferObj->Pointer) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(PBO is mapped)"); - return; - } - } - ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type, - &ctx->Unpack, pixels); + ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type, + &ctx->Unpack, pixels); + } } else if (ctx->RenderMode == GL_FEEDBACK) { /* Feedback the current raster pos info */ @@ -159,10 +161,12 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, if (ctx->RenderMode == GL_RENDER) { /* Round to satisfy conformance tests (matches SGI's OpenGL) */ - GLint destx = IROUND(ctx->Current.RasterPos[0]); - GLint desty = IROUND(ctx->Current.RasterPos[1]); - ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty, - type ); + if (width > 0 && height > 0) { + GLint destx = IROUND(ctx->Current.RasterPos[0]); + GLint desty = IROUND(ctx->Current.RasterPos[1]); + ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty, + type ); + } } else if (ctx->RenderMode == GL_FEEDBACK) { FLUSH_CURRENT( ctx, 0 ); diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index e63a04e915..c077bc0a89 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -120,6 +120,7 @@ LONGSTRING static const char enum_string_table[] = "GL_BLEND_EQUATION_ALPHA\0" "GL_BLEND_EQUATION_ALPHA_EXT\0" "GL_BLEND_EQUATION_EXT\0" + "GL_BLEND_EQUATION_RGB\0" "GL_BLEND_EQUATION_RGB_EXT\0" "GL_BLEND_SRC\0" "GL_BLEND_SRC_ALPHA\0" @@ -297,6 +298,10 @@ LONGSTRING static const char enum_string_table[] = "GL_COMPRESSED_RGB_ARB\0" "GL_COMPRESSED_RGB_FXT1_3DFX\0" "GL_COMPRESSED_RGB_S3TC_DXT1_EXT\0" + "GL_COMPRESSED_SLUMINANCE\0" + "GL_COMPRESSED_SLUMINANCE_ALPHA\0" + "GL_COMPRESSED_SRGB\0" + "GL_COMPRESSED_SRGB_ALPHA\0" "GL_COMPRESSED_TEXTURE_FORMATS\0" "GL_CONSTANT\0" "GL_CONSTANT_ALPHA\0" @@ -355,6 +360,7 @@ LONGSTRING static const char enum_string_table[] = "GL_CURRENT_RASTER_INDEX\0" "GL_CURRENT_RASTER_POSITION\0" "GL_CURRENT_RASTER_POSITION_VALID\0" + "GL_CURRENT_RASTER_SECONDARY_COLOR\0" "GL_CURRENT_RASTER_TEXTURE_COORDS\0" "GL_CURRENT_SECONDARY_COLOR\0" "GL_CURRENT_TEXTURE_COORDS\0" @@ -510,10 +516,16 @@ LONGSTRING static const char enum_string_table[] = "GL_FLOAT\0" "GL_FLOAT_MAT2\0" "GL_FLOAT_MAT2_ARB\0" + "GL_FLOAT_MAT2x3\0" + "GL_FLOAT_MAT2x4\0" "GL_FLOAT_MAT3\0" "GL_FLOAT_MAT3_ARB\0" + "GL_FLOAT_MAT3x2\0" + "GL_FLOAT_MAT3x4\0" "GL_FLOAT_MAT4\0" "GL_FLOAT_MAT4_ARB\0" + "GL_FLOAT_MAT4x2\0" + "GL_FLOAT_MAT4x3\0" "GL_FLOAT_VEC2\0" "GL_FLOAT_VEC2_ARB\0" "GL_FLOAT_VEC3\0" @@ -607,30 +619,6 @@ LONGSTRING static const char enum_string_table[] = "GL_GENERATE_MIPMAP_HINT_SGIS\0" "GL_GENERATE_MIPMAP_SGIS\0" "GL_GEQUAL\0" - "GL_GL_BLEND_EQUATION_RGB\0" - "GL_GL_COMPRESSED_SLUMINANCE\0" - "GL_GL_COMPRESSED_SLUMINANCE_ALPHA\0" - "GL_GL_COMPRESSED_SRGB\0" - "GL_GL_COMPRESSED_SRGB_ALPHA\0" - "GL_GL_CURRENT_RASTER_SECONDARY_COLOR\0" - "GL_GL_FLOAT_MAT2x3\0" - "GL_GL_FLOAT_MAT2x4\0" - "GL_GL_FLOAT_MAT3x2\0" - "GL_GL_FLOAT_MAT3x4\0" - "GL_GL_FLOAT_MAT4x2\0" - "GL_GL_FLOAT_MAT4x3\0" - "GL_GL_PIXEL_PACK_BUFFER\0" - "GL_GL_PIXEL_PACK_BUFFER_BINDING\0" - "GL_GL_PIXEL_UNPACK_BUFFER\0" - "GL_GL_PIXEL_UNPACK_BUFFER_BINDING\0" - "GL_GL_SLUMINANCE\0" - "GL_GL_SLUMINANCE8\0" - "GL_GL_SLUMINANCE8_ALPHA8\0" - "GL_GL_SLUMINANCE_ALPHA\0" - "GL_GL_SRGB\0" - "GL_GL_SRGB8\0" - "GL_GL_SRGB8_ALPHA8\0" - "GL_GL_SRGB_ALPHA\0" "GL_GREATER\0" "GL_GREEN\0" "GL_GREEN_BIAS\0" @@ -1152,8 +1140,12 @@ LONGSTRING static const char enum_string_table[] = "GL_PIXEL_MAP_S_TO_S\0" "GL_PIXEL_MAP_S_TO_S_SIZE\0" "GL_PIXEL_MODE_BIT\0" + "GL_PIXEL_PACK_BUFFER\0" + "GL_PIXEL_PACK_BUFFER_BINDING\0" "GL_PIXEL_PACK_BUFFER_BINDING_EXT\0" "GL_PIXEL_PACK_BUFFER_EXT\0" + "GL_PIXEL_UNPACK_BUFFER\0" + "GL_PIXEL_UNPACK_BUFFER_BINDING\0" "GL_PIXEL_UNPACK_BUFFER_BINDING_EXT\0" "GL_PIXEL_UNPACK_BUFFER_EXT\0" "GL_POINT\0" @@ -1385,9 +1377,11 @@ LONGSTRING static const char enum_string_table[] = "GL_RGBA4_S3TC\0" "GL_RGBA8\0" "GL_RGBA8_EXT\0" + "GL_RGBA8_SNORM\0" "GL_RGBA_DXT5_S3TC\0" "GL_RGBA_MODE\0" "GL_RGBA_S3TC\0" + "GL_RGBA_SNORM\0" "GL_RGB_S3TC\0" "GL_RGB_SCALE\0" "GL_RGB_SCALE_ARB\0" @@ -1444,9 +1438,14 @@ LONGSTRING static const char enum_string_table[] = "GL_SHARED_TEXTURE_PALETTE_EXT\0" "GL_SHININESS\0" "GL_SHORT\0" + "GL_SIGNED_NORMALIZED\0" "GL_SINGLE_COLOR\0" "GL_SINGLE_COLOR_EXT\0" "GL_SLICE_ACCUM_SUN\0" + "GL_SLUMINANCE\0" + "GL_SLUMINANCE8\0" + "GL_SLUMINANCE8_ALPHA8\0" + "GL_SLUMINANCE_ALPHA\0" "GL_SMOOTH\0" "GL_SMOOTH_LINE_WIDTH_GRANULARITY\0" "GL_SMOOTH_LINE_WIDTH_RANGE\0" @@ -1487,6 +1486,9 @@ LONGSTRING static const char enum_string_table[] = "GL_SRC_ALPHA_SATURATE\0" "GL_SRC_COLOR\0" "GL_SRGB\0" + "GL_SRGB8\0" + "GL_SRGB8_ALPHA8\0" + "GL_SRGB_ALPHA\0" "GL_STACK_OVERFLOW\0" "GL_STACK_UNDERFLOW\0" "GL_STATIC_COPY\0" @@ -1856,7 +1858,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1818] = +static const enum_elt all_enums[1820] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -1942,3059 +1944,3064 @@ static const enum_elt all_enums[1818] = { 1320, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA */ { 1344, 0x0000883D }, /* GL_BLEND_EQUATION_ALPHA_EXT */ { 1372, 0x00008009 }, /* GL_BLEND_EQUATION_EXT */ - { 1394, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ - { 1420, 0x00000BE1 }, /* GL_BLEND_SRC */ - { 1433, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ - { 1452, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ - { 1469, 0x00001905 }, /* GL_BLUE */ - { 1477, 0x00000D1B }, /* GL_BLUE_BIAS */ - { 1490, 0x00000D54 }, /* GL_BLUE_BITS */ - { 1503, 0x00000D1A }, /* GL_BLUE_SCALE */ - { 1517, 0x00008B56 }, /* GL_BOOL */ - { 1525, 0x00008B56 }, /* GL_BOOL_ARB */ - { 1537, 0x00008B57 }, /* GL_BOOL_VEC2 */ - { 1550, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ - { 1567, 0x00008B58 }, /* GL_BOOL_VEC3 */ - { 1580, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ - { 1597, 0x00008B59 }, /* GL_BOOL_VEC4 */ - { 1610, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ - { 1627, 0x000088BB }, /* GL_BUFFER_ACCESS */ - { 1644, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ - { 1665, 0x000088BC }, /* GL_BUFFER_MAPPED */ - { 1682, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ - { 1703, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ - { 1725, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ - { 1751, 0x00008764 }, /* GL_BUFFER_SIZE */ - { 1766, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ - { 1785, 0x00008765 }, /* GL_BUFFER_USAGE */ - { 1801, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ - { 1821, 0x0000877B }, /* GL_BUMP_ENVMAP_ATI */ - { 1840, 0x00008777 }, /* GL_BUMP_NUM_TEX_UNITS_ATI */ - { 1866, 0x00008775 }, /* GL_BUMP_ROT_MATRIX_ATI */ - { 1889, 0x00008776 }, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ - { 1917, 0x0000877C }, /* GL_BUMP_TARGET_ATI */ - { 1936, 0x00008778 }, /* GL_BUMP_TEX_UNITS_ATI */ - { 1958, 0x00001400 }, /* GL_BYTE */ - { 1966, 0x00002A24 }, /* GL_C3F_V3F */ - { 1977, 0x00002A26 }, /* GL_C4F_N3F_V3F */ - { 1992, 0x00002A22 }, /* GL_C4UB_V2F */ - { 2004, 0x00002A23 }, /* GL_C4UB_V3F */ - { 2016, 0x00000901 }, /* GL_CCW */ - { 2023, 0x00002900 }, /* GL_CLAMP */ - { 2032, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ - { 2051, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ - { 2074, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ - { 2098, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ - { 2115, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ - { 2137, 0x00001500 }, /* GL_CLEAR */ - { 2146, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ - { 2171, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ - { 2200, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ - { 2226, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - { 2255, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ - { 2281, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ - { 2308, 0x00003000 }, /* GL_CLIP_PLANE0 */ - { 2323, 0x00003001 }, /* GL_CLIP_PLANE1 */ - { 2338, 0x00003002 }, /* GL_CLIP_PLANE2 */ - { 2353, 0x00003003 }, /* GL_CLIP_PLANE3 */ - { 2368, 0x00003004 }, /* GL_CLIP_PLANE4 */ - { 2383, 0x00003005 }, /* GL_CLIP_PLANE5 */ - { 2398, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - { 2431, 0x00000A00 }, /* GL_COEFF */ - { 2440, 0x00001800 }, /* GL_COLOR */ - { 2449, 0x00008076 }, /* GL_COLOR_ARRAY */ - { 2464, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - { 2494, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 2528, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ - { 2551, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ - { 2571, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ - { 2593, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ - { 2613, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */ - { 2634, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ - { 2659, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */ - { 2680, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */ - { 2702, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ - { 2728, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */ - { 2750, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ - { 2776, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */ - { 2798, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ - { 2824, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */ - { 2846, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ - { 2872, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */ - { 2894, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ - { 2920, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */ - { 2942, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ - { 2968, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ - { 2993, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */ - { 3014, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ - { 3039, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */ - { 3060, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ - { 3085, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */ - { 3106, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ - { 3131, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */ - { 3152, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ - { 3177, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */ - { 3198, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ - { 3223, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */ - { 3244, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ - { 3269, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */ - { 3290, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ - { 3315, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */ - { 3336, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ - { 3361, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ - { 3381, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ - { 3402, 0x00001900 }, /* GL_COLOR_INDEX */ - { 3417, 0x00001603 }, /* GL_COLOR_INDEXES */ - { 3434, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ - { 3452, 0x00000B57 }, /* GL_COLOR_MATERIAL */ - { 3470, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ - { 3493, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ - { 3521, 0x000080B1 }, /* GL_COLOR_MATRIX */ - { 3537, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ - { 3557, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ - { 3585, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 3617, 0x00008458 }, /* GL_COLOR_SUM */ - { 3630, 0x00008458 }, /* GL_COLOR_SUM_ARB */ - { 3647, 0x000080D0 }, /* GL_COLOR_TABLE */ - { 3662, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ - { 3688, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ - { 3718, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ - { 3748, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ - { 3768, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ - { 3792, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ - { 3817, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ - { 3846, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ - { 3875, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ - { 3897, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ - { 3923, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ - { 3949, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ - { 3975, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ - { 4005, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ - { 4035, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - { 4065, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ - { 4099, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ - { 4133, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - { 4163, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ - { 4197, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ - { 4231, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ - { 4255, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ - { 4283, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ - { 4311, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ - { 4332, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ - { 4357, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ - { 4378, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ - { 4403, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ - { 4428, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ - { 4447, 0x00008570 }, /* GL_COMBINE */ - { 4458, 0x00008503 }, /* GL_COMBINE4 */ - { 4470, 0x00008572 }, /* GL_COMBINE_ALPHA */ - { 4487, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ - { 4508, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ - { 4529, 0x00008570 }, /* GL_COMBINE_ARB */ - { 4544, 0x00008570 }, /* GL_COMBINE_EXT */ - { 4559, 0x00008571 }, /* GL_COMBINE_RGB */ - { 4574, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ - { 4593, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 4612, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ - { 4648, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 4672, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4700, 0x00001300 }, /* GL_COMPILE */ - { 4711, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4734, 0x00008B81 }, /* GL_COMPILE_STATUS */ - { 4752, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4772, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4796, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4820, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4848, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4872, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 4902, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 4936, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 4964, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 4982, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 5001, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 5024, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 5053, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 5086, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 5119, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 5152, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 5174, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 5202, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 5234, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 5264, 0x00008576 }, /* GL_CONSTANT */ - { 5276, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 5294, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 5316, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 5332, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 5356, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 5378, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 5396, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 5418, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 5434, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 5452, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 5470, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 5498, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 5529, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 5556, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 5587, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 5614, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 5645, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 5673, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5705, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5727, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5753, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 5775, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 5801, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 5822, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 5847, 0x00008862 }, /* GL_COORD_REPLACE */ - { 5864, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 5885, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 5905, 0x00001503 }, /* GL_COPY */ - { 5913, 0x0000150C }, /* GL_COPY_INVERTED */ - { 5930, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 5950, 0x00000B44 }, /* GL_CULL_FACE */ - { 5963, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 5981, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 6000, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 6032, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 6067, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 6088, 0x00000001 }, /* GL_CURRENT_BIT */ - { 6103, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 6120, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 6141, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 6167, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 6184, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 6206, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 6234, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 6255, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 6289, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 6322, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 6340, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 6370, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ - { 6389, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 6406, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 6427, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 6451, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 6478, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 6502, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 6529, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 6562, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 6595, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 6622, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 6648, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ - { 6673, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 6702, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 6724, 0x00000900 }, /* GL_CW */ - { 6730, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 6751, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 6772, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 6792, 0x00002101 }, /* GL_DECAL */ - { 6801, 0x00001E03 }, /* GL_DECR */ - { 6809, 0x00008508 }, /* GL_DECR_WRAP */ - { 6822, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 6839, 0x00008B80 }, /* GL_DELETE_STATUS */ - { 6856, 0x00001801 }, /* GL_DEPTH */ - { 6865, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ - { 6885, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ - { 6905, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 6929, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 6943, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 6957, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 6977, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 7002, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 7022, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 7040, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 7061, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 7080, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 7101, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 7126, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 7152, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 7173, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 7198, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 7224, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 7245, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 7270, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 7296, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 7310, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 7325, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 7340, 0x000084F9 }, /* GL_DEPTH_STENCIL */ - { 7357, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ - { 7385, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 7405, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 7433, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 7461, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 7475, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 7497, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 7523, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 7542, 0x00001201 }, /* GL_DIFFUSE */ - { 7553, 0x00000BD0 }, /* GL_DITHER */ - { 7563, 0x00000A02 }, /* GL_DOMAIN */ - { 7573, 0x00001100 }, /* GL_DONT_CARE */ - { 7586, 0x000086AE }, /* GL_DOT3_RGB */ - { 7598, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7611, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7628, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7645, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7661, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7677, 0x0000140A }, /* GL_DOUBLE */ - { 7687, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 7703, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 7718, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 7734, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 7754, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 7774, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 7790, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 7807, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 7828, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 7849, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 7866, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 7887, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 7908, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 7925, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 7946, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 7967, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 7984, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 8005, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 8026, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 8043, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 8064, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 8085, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 8102, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 8123, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 8144, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 8164, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 8184, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 8200, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 8220, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 8240, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 8256, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 8276, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 8296, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 8312, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 8332, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 8352, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 8368, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 8388, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 8408, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 8424, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 8444, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 8464, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 8480, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 8500, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 8520, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 8536, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 8556, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8576, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8592, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8612, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8632, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ - { 8652, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 8684, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 8708, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 8728, 0x00000304 }, /* GL_DST_ALPHA */ - { 8741, 0x00000306 }, /* GL_DST_COLOR */ - { 8754, 0x0000877A }, /* GL_DU8DV8_ATI */ - { 8768, 0x00008779 }, /* GL_DUDV_ATI */ - { 8780, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 8796, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 8816, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 8832, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 8852, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 8868, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 8888, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 8901, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 8920, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 8954, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 8992, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 9019, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 9045, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 9069, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 9101, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 9137, 0x00001600 }, /* GL_EMISSION */ - { 9149, 0x00002000 }, /* GL_ENABLE_BIT */ - { 9163, 0x00000202 }, /* GL_EQUAL */ - { 9172, 0x00001509 }, /* GL_EQUIV */ - { 9181, 0x00010000 }, /* GL_EVAL_BIT */ - { 9193, 0x00000800 }, /* GL_EXP */ - { 9200, 0x00000801 }, /* GL_EXP2 */ - { 9208, 0x00001F03 }, /* GL_EXTENSIONS */ - { 9222, 0x00002400 }, /* GL_EYE_LINEAR */ - { 9236, 0x00002502 }, /* GL_EYE_PLANE */ - { 9249, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 9274, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 9291, 0x00000000 }, /* GL_FALSE */ - { 9300, 0x00001101 }, /* GL_FASTEST */ - { 9311, 0x00001C01 }, /* GL_FEEDBACK */ - { 9323, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 9350, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 9374, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 9398, 0x00001B02 }, /* GL_FILL */ - { 9406, 0x00001D00 }, /* GL_FLAT */ - { 9414, 0x00001406 }, /* GL_FLOAT */ - { 9423, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 9437, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 9455, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 9469, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 9487, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 9501, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 9519, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 9533, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 9551, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 9565, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 9583, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 9597, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 9615, 0x00000B60 }, /* GL_FOG */ - { 9622, 0x00000080 }, /* GL_FOG_BIT */ - { 9633, 0x00000B66 }, /* GL_FOG_COLOR */ - { 9646, 0x00008451 }, /* GL_FOG_COORD */ - { 9659, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 9677, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 9701, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 9740, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 9783, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 9815, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 9846, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 9875, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 9900, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 9919, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 9953, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 9980, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 10006, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 10030, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 10047, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 10062, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 10086, 0x00000B64 }, /* GL_FOG_END */ - { 10097, 0x00000C54 }, /* GL_FOG_HINT */ - { 10109, 0x00000B61 }, /* GL_FOG_INDEX */ - { 10122, 0x00000B65 }, /* GL_FOG_MODE */ - { 10134, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 10153, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 10178, 0x00000B63 }, /* GL_FOG_START */ - { 10191, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 10209, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 10233, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 10252, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 10275, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 10310, 0x00008D40 }, /* GL_FRAMEBUFFER */ - { 10325, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - { 10362, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - { 10398, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - { 10439, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - { 10480, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - { 10517, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - { 10554, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - { 10592, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 10634, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - { 10672, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 10714, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - { 10749, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - { 10788, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 10837, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - { 10885, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 10937, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - { 10977, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 11021, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - { 11061, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 11105, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 11132, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ - { 11156, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 11184, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ - { 11207, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 11226, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - { 11263, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 11304, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 11345, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 11387, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 11438, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 11476, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - { 11521, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 11570, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - { 11608, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 11650, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 11682, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ - { 11707, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ - { 11734, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 11765, 0x00000404 }, /* GL_FRONT */ - { 11774, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 11792, 0x00000B46 }, /* GL_FRONT_FACE */ - { 11806, 0x00000400 }, /* GL_FRONT_LEFT */ - { 11820, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 11835, 0x00008006 }, /* GL_FUNC_ADD */ - { 11847, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 11863, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 11888, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 11917, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 11934, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 11955, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 11974, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 11998, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 12027, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 12051, 0x00000206 }, /* GL_GEQUAL */ - { 12061, 0x00008009 }, /* GL_GL_BLEND_EQUATION_RGB */ - { 12086, 0x00008C4A }, /* GL_GL_COMPRESSED_SLUMINANCE */ - { 12114, 0x00008C4B }, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - { 12148, 0x00008C48 }, /* GL_GL_COMPRESSED_SRGB */ - { 12170, 0x00008C49 }, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - { 12198, 0x0000845F }, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ - { 12235, 0x00008B65 }, /* GL_GL_FLOAT_MAT2x3 */ - { 12254, 0x00008B66 }, /* GL_GL_FLOAT_MAT2x4 */ - { 12273, 0x00008B67 }, /* GL_GL_FLOAT_MAT3x2 */ - { 12292, 0x00008B68 }, /* GL_GL_FLOAT_MAT3x4 */ - { 12311, 0x00008B69 }, /* GL_GL_FLOAT_MAT4x2 */ - { 12330, 0x00008B6A }, /* GL_GL_FLOAT_MAT4x3 */ - { 12349, 0x000088EB }, /* GL_GL_PIXEL_PACK_BUFFER */ - { 12373, 0x000088ED }, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - { 12405, 0x000088EC }, /* GL_GL_PIXEL_UNPACK_BUFFER */ - { 12431, 0x000088EF }, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 12465, 0x00008C46 }, /* GL_GL_SLUMINANCE */ - { 12482, 0x00008C47 }, /* GL_GL_SLUMINANCE8 */ - { 12500, 0x00008C45 }, /* GL_GL_SLUMINANCE8_ALPHA8 */ - { 12525, 0x00008C44 }, /* GL_GL_SLUMINANCE_ALPHA */ - { 12548, 0x00008C40 }, /* GL_GL_SRGB */ - { 12559, 0x00008C41 }, /* GL_GL_SRGB8 */ - { 12571, 0x00008C43 }, /* GL_GL_SRGB8_ALPHA8 */ - { 12590, 0x00008C42 }, /* GL_GL_SRGB_ALPHA */ - { 12607, 0x00000204 }, /* GL_GREATER */ - { 12618, 0x00001904 }, /* GL_GREEN */ - { 12627, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 12641, 0x00000D53 }, /* GL_GREEN_BITS */ - { 12655, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12670, 0x00008000 }, /* GL_HINT_BIT */ - { 12682, 0x00008024 }, /* GL_HISTOGRAM */ - { 12695, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12719, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12747, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12770, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12797, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12814, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12834, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 12858, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 12882, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 12910, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 12938, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 12970, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 12992, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 13018, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 13036, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 13058, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 13077, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 13100, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13115, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13135, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13175, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13213, 0x00001E02 }, /* GL_INCR */ - { 13221, 0x00008507 }, /* GL_INCR_WRAP */ - { 13234, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13251, 0x00008222 }, /* GL_INDEX */ - { 13260, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13275, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13305, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13339, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13362, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13384, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13404, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13418, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13439, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13457, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13471, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13487, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13502, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13521, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13540, 0x00001404 }, /* GL_INT */ - { 13547, 0x00008049 }, /* GL_INTENSITY */ - { 13560, 0x0000804C }, /* GL_INTENSITY12 */ - { 13575, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13594, 0x0000804D }, /* GL_INTENSITY16 */ - { 13609, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13628, 0x0000804A }, /* GL_INTENSITY4 */ - { 13642, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13660, 0x0000804B }, /* GL_INTENSITY8 */ - { 13674, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13692, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13709, 0x00008575 }, /* GL_INTERPOLATE */ - { 13724, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13743, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13762, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13774, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13790, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13802, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13818, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13830, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 13846, 0x00000500 }, /* GL_INVALID_ENUM */ - { 13862, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 13895, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 13932, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 13953, 0x00000501 }, /* GL_INVALID_VALUE */ - { 13970, 0x0000862B }, /* GL_INVERSE_NV */ - { 13984, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 14008, 0x0000150A }, /* GL_INVERT */ - { 14018, 0x00001E00 }, /* GL_KEEP */ - { 14026, 0x00000406 }, /* GL_LEFT */ - { 14034, 0x00000203 }, /* GL_LEQUAL */ - { 14044, 0x00000201 }, /* GL_LESS */ - { 14052, 0x00004000 }, /* GL_LIGHT0 */ - { 14062, 0x00004001 }, /* GL_LIGHT1 */ - { 14072, 0x00004002 }, /* GL_LIGHT2 */ - { 14082, 0x00004003 }, /* GL_LIGHT3 */ - { 14092, 0x00004004 }, /* GL_LIGHT4 */ - { 14102, 0x00004005 }, /* GL_LIGHT5 */ - { 14112, 0x00004006 }, /* GL_LIGHT6 */ - { 14122, 0x00004007 }, /* GL_LIGHT7 */ - { 14132, 0x00000B50 }, /* GL_LIGHTING */ - { 14144, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14160, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14183, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14212, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14245, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14273, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14297, 0x00001B01 }, /* GL_LINE */ - { 14305, 0x00002601 }, /* GL_LINEAR */ - { 14315, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14337, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14367, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14398, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14422, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14447, 0x00000001 }, /* GL_LINES */ - { 14456, 0x00000004 }, /* GL_LINE_BIT */ - { 14468, 0x00000002 }, /* GL_LINE_LOOP */ - { 14481, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14501, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14516, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14536, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14552, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14576, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14599, 0x00000003 }, /* GL_LINE_STRIP */ - { 14613, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14627, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14641, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14667, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14687, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14702, 0x00000B32 }, /* GL_LIST_BASE */ - { 14715, 0x00020000 }, /* GL_LIST_BIT */ - { 14727, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14741, 0x00000B30 }, /* GL_LIST_MODE */ - { 14754, 0x00000101 }, /* GL_LOAD */ - { 14762, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14774, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 14791, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 14805, 0x00001909 }, /* GL_LUMINANCE */ - { 14818, 0x00008041 }, /* GL_LUMINANCE12 */ - { 14833, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 14856, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 14883, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 14905, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 14931, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 14950, 0x00008042 }, /* GL_LUMINANCE16 */ - { 14965, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 14988, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 15015, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 15034, 0x0000803F }, /* GL_LUMINANCE4 */ - { 15048, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 15069, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15094, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15112, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15133, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15158, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15172, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15193, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15218, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15236, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15255, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15271, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15291, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15313, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15327, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15342, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15366, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15390, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15414, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15438, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15455, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15472, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15500, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15529, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15558, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15587, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15616, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15645, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15674, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15702, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15730, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15758, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15786, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 15814, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 15842, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 15870, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 15898, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 15926, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 15942, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 15962, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 15984, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 15998, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 16013, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 16037, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 16061, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16085, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16109, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16126, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16143, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16171, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16200, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16229, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16258, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16287, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16316, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16345, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16373, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16401, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16429, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16457, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16485, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16513, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16541, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16569, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16597, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16610, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16625, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16640, 0x00008630 }, /* GL_MATRIX0_NV */ - { 16654, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 16670, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 16686, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 16702, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 16718, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 16734, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 16750, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 16766, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 16782, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 16798, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 16814, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 16829, 0x00008631 }, /* GL_MATRIX1_NV */ - { 16843, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 16859, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 16875, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 16891, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 16907, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 16923, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 16939, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 16955, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 16971, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 16987, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17003, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17018, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17032, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17048, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17064, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17079, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17093, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17108, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17122, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17137, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17151, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17166, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17180, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17195, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17209, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17224, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17239, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17265, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17299, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17330, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17363, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17394, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17409, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17431, 0x00008008 }, /* GL_MAX */ - { 17438, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17461, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17493, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17519, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17552, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17578, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17612, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17631, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 17660, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 17692, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 17728, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 17764, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 17804, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 17830, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 17860, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 17885, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 17914, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 17943, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 17976, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 17996, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18020, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18044, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18068, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18093, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18111, 0x00008008 }, /* GL_MAX_EXT */ - { 18122, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18157, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18196, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18210, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18230, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18268, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18297, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18321, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18349, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18372, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18409, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18445, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18472, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18501, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18535, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18571, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18598, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 18630, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 18666, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 18695, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 18724, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 18752, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 18790, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 18834, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 18877, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 18911, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 18950, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 18987, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19025, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19068, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19111, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19141, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19172, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19208, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19244, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19274, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19308, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19341, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19370, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19385, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19405, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19429, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19451, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19477, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19504, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19535, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 19559, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 19593, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 19613, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 19640, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 19661, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 19686, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 19711, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 19746, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 19768, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19794, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 19816, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 19842, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 19876, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 19914, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 19947, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 19984, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20008, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20029, 0x00008007 }, /* GL_MIN */ - { 20036, 0x0000802E }, /* GL_MINMAX */ - { 20046, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20060, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20077, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20098, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20113, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20132, 0x00008007 }, /* GL_MIN_EXT */ - { 20143, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20162, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20185, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20208, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20228, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20248, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20278, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20306, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20334, 0x00001700 }, /* GL_MODELVIEW */ - { 20347, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20365, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20384, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20403, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20422, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20441, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20460, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20479, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20498, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20517, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20536, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 20555, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 20573, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 20592, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 20611, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 20630, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 20649, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 20668, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 20687, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 20706, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 20725, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 20744, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 20763, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 20781, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 20800, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 20819, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 20837, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 20855, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 20873, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 20891, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 20909, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 20927, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 20945, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 20965, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 20992, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21017, 0x00002100 }, /* GL_MODULATE */ - { 21029, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21049, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21076, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21101, 0x00000103 }, /* GL_MULT */ - { 21109, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21124, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21144, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21163, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21182, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21206, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21229, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21259, 0x00002A25 }, /* GL_N3F_V3F */ - { 21270, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21290, 0x0000150E }, /* GL_NAND */ - { 21298, 0x00002600 }, /* GL_NEAREST */ - { 21309, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21340, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21372, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21397, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21423, 0x00000200 }, /* GL_NEVER */ - { 21432, 0x00001102 }, /* GL_NICEST */ - { 21442, 0x00000000 }, /* GL_NONE */ - { 21450, 0x00001505 }, /* GL_NOOP */ - { 21458, 0x00001508 }, /* GL_NOR */ - { 21465, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21478, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21494, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21525, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 21560, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 21584, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 21607, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 21628, 0x00008511 }, /* GL_NORMAL_MAP */ - { 21642, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 21660, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 21677, 0x00000205 }, /* GL_NOTEQUAL */ - { 21689, 0x00000000 }, /* GL_NO_ERROR */ - { 21701, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 21735, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 21773, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 21805, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 21847, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 21877, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 21917, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 21948, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 21977, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22005, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22035, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22052, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22078, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22094, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22129, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22151, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22170, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22200, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22221, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22249, 0x00000001 }, /* GL_ONE */ - { 22256, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22284, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22316, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22344, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22376, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22399, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22422, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22445, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22468, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22486, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22508, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22530, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 22546, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 22566, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 22586, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 22604, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 22626, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 22648, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 22664, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 22684, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 22704, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 22722, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 22744, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 22766, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 22782, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 22802, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 22822, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 22843, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 22862, 0x00001507 }, /* GL_OR */ - { 22868, 0x00000A01 }, /* GL_ORDER */ - { 22877, 0x0000150D }, /* GL_OR_INVERTED */ - { 22892, 0x0000150B }, /* GL_OR_REVERSE */ - { 22906, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 22923, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 22941, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 22962, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 22982, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23000, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23019, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23039, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23059, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23077, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23096, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23121, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23145, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23166, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23188, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23210, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23235, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23259, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23280, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23302, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23324, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23346, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23377, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23397, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23422, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23442, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23467, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23487, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23512, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23532, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 23557, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 23577, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 23602, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 23622, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 23647, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 23667, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 23692, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 23712, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 23737, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 23757, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 23782, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 23802, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 23827, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 23845, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 23878, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 23903, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 23938, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 23965, 0x00001B00 }, /* GL_POINT */ - { 23974, 0x00000000 }, /* GL_POINTS */ - { 23984, 0x00000002 }, /* GL_POINT_BIT */ - { 23997, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24027, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24061, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24095, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24130, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24159, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24192, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24225, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24259, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24273, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24299, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24317, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24339, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24361, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24384, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24402, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24424, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 24446, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 24469, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 24489, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 24505, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 24526, 0x00008861 }, /* GL_POINT_SPRITE */ - { 24542, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 24562, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 24591, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 24610, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 24636, 0x00000701 }, /* GL_POINT_TOKEN */ - { 24651, 0x00000009 }, /* GL_POLYGON */ - { 24662, 0x00000008 }, /* GL_POLYGON_BIT */ - { 24677, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 24693, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 24716, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 24741, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 24764, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 24787, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 24811, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 24835, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 24853, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 24876, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 24895, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 24918, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 24935, 0x00001203 }, /* GL_POSITION */ - { 24947, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 24979, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25015, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25048, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25085, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25116, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25151, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25183, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25219, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25252, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25284, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25320, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25353, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25390, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25420, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 25454, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 25485, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 25520, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 25551, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 25586, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 25618, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 25654, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 25684, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 25718, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 25749, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 25784, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 25816, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 25847, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 25882, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 25914, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 25950, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 25979, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26012, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26042, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26076, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26115, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26148, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26188, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26222, 0x00008578 }, /* GL_PREVIOUS */ - { 26234, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26250, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26266, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26283, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26304, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26325, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26358, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26390, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26413, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 26436, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 26466, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 26495, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 26523, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 26545, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 26573, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 26601, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 26623, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 26644, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 26684, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 26723, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 26753, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 26788, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 26821, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 26855, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 26894, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 26933, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 26955, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 26981, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27005, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27028, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27050, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27071, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27092, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27119, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27151, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27183, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27218, 0x00001701 }, /* GL_PROJECTION */ - { 27232, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27253, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27279, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27300, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27319, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27342, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27381, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 27419, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 27439, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 27469, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 27493, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 27513, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 27543, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 27567, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 27587, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 27620, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 27646, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 27676, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 27707, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 27737, 0x00002003 }, /* GL_Q */ - { 27742, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 27767, 0x00000007 }, /* GL_QUADS */ - { 27776, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 27793, 0x00000008 }, /* GL_QUAD_STRIP */ - { 27807, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 27829, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 27855, 0x00008866 }, /* GL_QUERY_RESULT */ - { 27871, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 27891, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 27917, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 27947, 0x00002002 }, /* GL_R */ - { 27952, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 27964, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 27997, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28012, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28032, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28064, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28088, 0x000088B8 }, /* GL_READ_ONLY */ - { 28101, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28118, 0x000088BA }, /* GL_READ_WRITE */ - { 28132, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28150, 0x00001903 }, /* GL_RED */ - { 28157, 0x00008016 }, /* GL_REDUCE */ - { 28167, 0x00008016 }, /* GL_REDUCE_EXT */ - { 28181, 0x00000D15 }, /* GL_RED_BIAS */ - { 28193, 0x00000D52 }, /* GL_RED_BITS */ - { 28205, 0x00000D14 }, /* GL_RED_SCALE */ - { 28218, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 28236, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 28258, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 28279, 0x00001C00 }, /* GL_RENDER */ - { 28289, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 28305, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 28332, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 28360, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 28386, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 28413, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 28433, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 28460, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 28483, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 28510, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 28542, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 28578, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 28603, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 28627, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 28656, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 28678, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 28704, 0x00001F01 }, /* GL_RENDERER */ - { 28716, 0x00000C40 }, /* GL_RENDER_MODE */ - { 28731, 0x00002901 }, /* GL_REPEAT */ - { 28741, 0x00001E01 }, /* GL_REPLACE */ - { 28752, 0x00008062 }, /* GL_REPLACE_EXT */ - { 28767, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 28790, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 28808, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 28830, 0x00000102 }, /* GL_RETURN */ - { 28840, 0x00001907 }, /* GL_RGB */ - { 28847, 0x00008052 }, /* GL_RGB10 */ - { 28856, 0x00008059 }, /* GL_RGB10_A2 */ - { 28868, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 28884, 0x00008052 }, /* GL_RGB10_EXT */ - { 28897, 0x00008053 }, /* GL_RGB12 */ - { 28906, 0x00008053 }, /* GL_RGB12_EXT */ - { 28919, 0x00008054 }, /* GL_RGB16 */ - { 28928, 0x00008054 }, /* GL_RGB16_EXT */ - { 28941, 0x0000804E }, /* GL_RGB2_EXT */ - { 28953, 0x0000804F }, /* GL_RGB4 */ - { 28961, 0x0000804F }, /* GL_RGB4_EXT */ - { 28973, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 28986, 0x00008050 }, /* GL_RGB5 */ - { 28994, 0x00008057 }, /* GL_RGB5_A1 */ - { 29005, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29020, 0x00008050 }, /* GL_RGB5_EXT */ - { 29032, 0x00008051 }, /* GL_RGB8 */ - { 29040, 0x00008051 }, /* GL_RGB8_EXT */ - { 29052, 0x00001908 }, /* GL_RGBA */ - { 29060, 0x0000805A }, /* GL_RGBA12 */ - { 29070, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29084, 0x0000805B }, /* GL_RGBA16 */ - { 29094, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29108, 0x00008055 }, /* GL_RGBA2 */ - { 29117, 0x00008055 }, /* GL_RGBA2_EXT */ - { 29130, 0x00008056 }, /* GL_RGBA4 */ - { 29139, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 29158, 0x00008056 }, /* GL_RGBA4_EXT */ - { 29171, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 29185, 0x00008058 }, /* GL_RGBA8 */ - { 29194, 0x00008058 }, /* GL_RGBA8_EXT */ - { 29207, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 29225, 0x00000C31 }, /* GL_RGBA_MODE */ - { 29238, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 29251, 0x000083A0 }, /* GL_RGB_S3TC */ - { 29263, 0x00008573 }, /* GL_RGB_SCALE */ - { 29276, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 29293, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 29310, 0x00000407 }, /* GL_RIGHT */ - { 29319, 0x00002000 }, /* GL_S */ - { 29324, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 29338, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 29359, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 29373, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 29394, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 29408, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 29424, 0x000080A9 }, /* GL_SAMPLES */ - { 29435, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 29451, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 29466, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 29484, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 29506, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 29534, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 29566, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 29589, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 29616, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 29634, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 29657, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 29679, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 29698, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 29721, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 29747, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 29777, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 29802, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 29831, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 29846, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 29861, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 29877, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 29902, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 29942, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 29986, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30019, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30049, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30081, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 30111, 0x00001C02 }, /* GL_SELECT */ - { 30121, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 30149, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 30174, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 30190, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 30217, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 30248, 0x0000150F }, /* GL_SET */ - { 30255, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 30276, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 30300, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 30315, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 30330, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 30358, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 30381, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 30411, 0x00001601 }, /* GL_SHININESS */ - { 30424, 0x00001402 }, /* GL_SHORT */ - { 30433, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 30449, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 30469, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 30488, 0x00001D01 }, /* GL_SMOOTH */ - { 30498, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 30531, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 30558, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 30591, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 30618, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 30635, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 30656, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 30677, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 30692, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 30711, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 30730, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 30747, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 30768, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 30789, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 30804, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 30823, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 30842, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 30859, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 30880, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 30901, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 30916, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 30935, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 30954, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 30974, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 30992, 0x00001202 }, /* GL_SPECULAR */ - { 31004, 0x00002402 }, /* GL_SPHERE_MAP */ - { 31018, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 31033, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 31051, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 31068, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 31082, 0x00008580 }, /* GL_SRC0_RGB */ - { 31094, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 31108, 0x00008581 }, /* GL_SRC1_RGB */ - { 31120, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 31134, 0x00008582 }, /* GL_SRC2_RGB */ - { 31146, 0x00000302 }, /* GL_SRC_ALPHA */ - { 31159, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 31181, 0x00000300 }, /* GL_SRC_COLOR */ - { 31194, 0x00008C40 }, /* GL_SRGB */ - { 31202, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 31220, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 31239, 0x000088E6 }, /* GL_STATIC_COPY */ - { 31254, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 31273, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 31288, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 31307, 0x000088E5 }, /* GL_STATIC_READ */ - { 31322, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 31341, 0x00001802 }, /* GL_STENCIL */ - { 31352, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 31374, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 31400, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 31421, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 31446, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 31467, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 31492, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 31524, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 31560, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 31592, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 31628, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 31648, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 31675, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 31701, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 31717, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 31739, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 31762, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 31778, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 31794, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 31811, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 31834, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 31856, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 31878, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 31900, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 31921, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 31948, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 31975, 0x00000B97 }, /* GL_STENCIL_REF */ - { 31990, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 32006, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 32035, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 32057, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 32078, 0x00000C33 }, /* GL_STEREO */ - { 32088, 0x000088E2 }, /* GL_STREAM_COPY */ - { 32103, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 32122, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 32137, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 32156, 0x000088E1 }, /* GL_STREAM_READ */ - { 32171, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 32190, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 32207, 0x000084E7 }, /* GL_SUBTRACT */ - { 32219, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 32235, 0x00002001 }, /* GL_T */ - { 32240, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 32255, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 32274, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 32290, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 32305, 0x00002A27 }, /* GL_T2F_V3F */ - { 32316, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 32335, 0x00002A28 }, /* GL_T4F_V4F */ - { 32346, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 32369, 0x00001702 }, /* GL_TEXTURE */ - { 32380, 0x000084C0 }, /* GL_TEXTURE0 */ - { 32392, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 32408, 0x000084C1 }, /* GL_TEXTURE1 */ - { 32420, 0x000084CA }, /* GL_TEXTURE10 */ - { 32433, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 32450, 0x000084CB }, /* GL_TEXTURE11 */ - { 32463, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 32480, 0x000084CC }, /* GL_TEXTURE12 */ - { 32493, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 32510, 0x000084CD }, /* GL_TEXTURE13 */ - { 32523, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 32540, 0x000084CE }, /* GL_TEXTURE14 */ - { 32553, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 32570, 0x000084CF }, /* GL_TEXTURE15 */ - { 32583, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 32600, 0x000084D0 }, /* GL_TEXTURE16 */ - { 32613, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 32630, 0x000084D1 }, /* GL_TEXTURE17 */ - { 32643, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 32660, 0x000084D2 }, /* GL_TEXTURE18 */ - { 32673, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 32690, 0x000084D3 }, /* GL_TEXTURE19 */ - { 32703, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 32720, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 32736, 0x000084C2 }, /* GL_TEXTURE2 */ - { 32748, 0x000084D4 }, /* GL_TEXTURE20 */ - { 32761, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 32778, 0x000084D5 }, /* GL_TEXTURE21 */ - { 32791, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 32808, 0x000084D6 }, /* GL_TEXTURE22 */ - { 32821, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 32838, 0x000084D7 }, /* GL_TEXTURE23 */ - { 32851, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 32868, 0x000084D8 }, /* GL_TEXTURE24 */ - { 32881, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 32898, 0x000084D9 }, /* GL_TEXTURE25 */ - { 32911, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 32928, 0x000084DA }, /* GL_TEXTURE26 */ - { 32941, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 32958, 0x000084DB }, /* GL_TEXTURE27 */ - { 32971, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 32988, 0x000084DC }, /* GL_TEXTURE28 */ - { 33001, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 33018, 0x000084DD }, /* GL_TEXTURE29 */ - { 33031, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 33048, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 33064, 0x000084C3 }, /* GL_TEXTURE3 */ - { 33076, 0x000084DE }, /* GL_TEXTURE30 */ - { 33089, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 33106, 0x000084DF }, /* GL_TEXTURE31 */ - { 33119, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 33136, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 33152, 0x000084C4 }, /* GL_TEXTURE4 */ - { 33164, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 33180, 0x000084C5 }, /* GL_TEXTURE5 */ - { 33192, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 33208, 0x000084C6 }, /* GL_TEXTURE6 */ - { 33220, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 33236, 0x000084C7 }, /* GL_TEXTURE7 */ - { 33248, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 33264, 0x000084C8 }, /* GL_TEXTURE8 */ - { 33276, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 33292, 0x000084C9 }, /* GL_TEXTURE9 */ - { 33304, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 33320, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 33334, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 33358, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 33372, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 33396, 0x0000806F }, /* GL_TEXTURE_3D */ - { 33410, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 33432, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 33458, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 33480, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 33502, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 33534, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 33556, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 33588, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 33610, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 33638, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 33670, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 33703, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 33735, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 33750, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 33771, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 33796, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 33814, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 33838, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 33869, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 33899, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 33929, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 33964, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 33995, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 34033, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 34060, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 34092, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 34126, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 34150, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 34178, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 34202, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 34230, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 34263, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 34287, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 34309, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 34331, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 34357, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 34391, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 34424, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 34461, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 34489, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 34521, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 34544, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 34582, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 34624, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 34655, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 34683, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 34713, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 34741, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 34761, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 34785, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 34816, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 34851, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 34882, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 34917, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 34948, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 34983, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 35014, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 35049, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 35080, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 35115, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 35146, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 35181, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 35198, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 35220, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 35246, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 35261, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 35282, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 35302, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 35328, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 35348, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 35365, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 35382, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 35399, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 35416, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 35441, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 35463, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 35489, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 35507, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 35533, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 35559, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 35589, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 35616, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 35641, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 35661, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 35685, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 35712, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 35739, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 35766, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 35792, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 35822, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 35844, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 35862, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 35892, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 35920, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 35948, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 35976, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 35997, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 36016, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 36038, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 36057, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 36077, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 36102, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 36126, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 36146, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 36170, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 36190, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 36213, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 36237, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 36262, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 36296, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 36313, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 36331, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 36349, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 36367, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 36387, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 36406, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 36435, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 36452, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 36478, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 36508, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 36540, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 36570, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 36604, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 36620, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 36651, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 36686, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 36714, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 36746, 0x00000004 }, /* GL_TRIANGLES */ - { 36759, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 36775, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 36796, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 36814, 0x00000001 }, /* GL_TRUE */ - { 36822, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 36842, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 36865, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 36885, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 36906, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 36928, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 36950, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 36970, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 36991, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 37008, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 37035, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 37058, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 37074, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 37101, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 37122, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 37146, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 37177, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 37201, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 37229, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 37252, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 37270, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 37300, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 37326, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 37356, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 37382, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 37406, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 37434, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 37462, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 37489, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 37521, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 37552, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 37566, 0x00002A20 }, /* GL_V2F */ - { 37573, 0x00002A21 }, /* GL_V3F */ - { 37580, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 37599, 0x00001F00 }, /* GL_VENDOR */ - { 37609, 0x00001F02 }, /* GL_VERSION */ - { 37620, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 37636, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 37666, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 37697, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 37732, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 37756, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 37777, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 37800, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 37821, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 37848, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 37876, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 37904, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 37932, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 37960, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 37988, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 38016, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 38043, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 38070, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 38097, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 38124, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 38151, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 38178, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 38205, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 38232, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 38259, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 38297, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 38339, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 38370, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 38405, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 38439, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 38477, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 38508, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 38543, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 38571, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 38603, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 38633, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 38667, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 38695, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 38727, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 38747, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 38769, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 38798, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 38819, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 38848, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 38881, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 38913, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 38940, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 38971, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 39001, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 39018, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 39039, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 39066, 0x00000BA2 }, /* GL_VIEWPORT */ - { 39078, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 39094, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 39114, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 39145, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 39180, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 39208, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 39233, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 39260, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 39285, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 39309, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 39328, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 39342, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 39360, 0x00001506 }, /* GL_XOR */ - { 39367, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 39386, 0x00008757 }, /* GL_YCBCR_MESA */ - { 39400, 0x00000000 }, /* GL_ZERO */ - { 39408, 0x00000D16 }, /* GL_ZOOM_X */ - { 39418, 0x00000D17 }, /* GL_ZOOM_Y */ + { 1394, 0x00008009 }, /* GL_BLEND_EQUATION_RGB */ + { 1416, 0x00008009 }, /* GL_BLEND_EQUATION_RGB_EXT */ + { 1442, 0x00000BE1 }, /* GL_BLEND_SRC */ + { 1455, 0x000080CB }, /* GL_BLEND_SRC_ALPHA */ + { 1474, 0x000080C9 }, /* GL_BLEND_SRC_RGB */ + { 1491, 0x00001905 }, /* GL_BLUE */ + { 1499, 0x00000D1B }, /* GL_BLUE_BIAS */ + { 1512, 0x00000D54 }, /* GL_BLUE_BITS */ + { 1525, 0x00000D1A }, /* GL_BLUE_SCALE */ + { 1539, 0x00008B56 }, /* GL_BOOL */ + { 1547, 0x00008B56 }, /* GL_BOOL_ARB */ + { 1559, 0x00008B57 }, /* GL_BOOL_VEC2 */ + { 1572, 0x00008B57 }, /* GL_BOOL_VEC2_ARB */ + { 1589, 0x00008B58 }, /* GL_BOOL_VEC3 */ + { 1602, 0x00008B58 }, /* GL_BOOL_VEC3_ARB */ + { 1619, 0x00008B59 }, /* GL_BOOL_VEC4 */ + { 1632, 0x00008B59 }, /* GL_BOOL_VEC4_ARB */ + { 1649, 0x000088BB }, /* GL_BUFFER_ACCESS */ + { 1666, 0x000088BB }, /* GL_BUFFER_ACCESS_ARB */ + { 1687, 0x000088BC }, /* GL_BUFFER_MAPPED */ + { 1704, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ + { 1725, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ + { 1747, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ + { 1773, 0x00008764 }, /* GL_BUFFER_SIZE */ + { 1788, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ + { 1807, 0x00008765 }, /* GL_BUFFER_USAGE */ + { 1823, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ + { 1843, 0x0000877B }, /* GL_BUMP_ENVMAP_ATI */ + { 1862, 0x00008777 }, /* GL_BUMP_NUM_TEX_UNITS_ATI */ + { 1888, 0x00008775 }, /* GL_BUMP_ROT_MATRIX_ATI */ + { 1911, 0x00008776 }, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ + { 1939, 0x0000877C }, /* GL_BUMP_TARGET_ATI */ + { 1958, 0x00008778 }, /* GL_BUMP_TEX_UNITS_ATI */ + { 1980, 0x00001400 }, /* GL_BYTE */ + { 1988, 0x00002A24 }, /* GL_C3F_V3F */ + { 1999, 0x00002A26 }, /* GL_C4F_N3F_V3F */ + { 2014, 0x00002A22 }, /* GL_C4UB_V2F */ + { 2026, 0x00002A23 }, /* GL_C4UB_V3F */ + { 2038, 0x00000901 }, /* GL_CCW */ + { 2045, 0x00002900 }, /* GL_CLAMP */ + { 2054, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ + { 2073, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ + { 2096, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ + { 2120, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ + { 2137, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ + { 2159, 0x00001500 }, /* GL_CLEAR */ + { 2168, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ + { 2193, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ + { 2222, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ + { 2248, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + { 2277, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ + { 2303, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ + { 2330, 0x00003000 }, /* GL_CLIP_PLANE0 */ + { 2345, 0x00003001 }, /* GL_CLIP_PLANE1 */ + { 2360, 0x00003002 }, /* GL_CLIP_PLANE2 */ + { 2375, 0x00003003 }, /* GL_CLIP_PLANE3 */ + { 2390, 0x00003004 }, /* GL_CLIP_PLANE4 */ + { 2405, 0x00003005 }, /* GL_CLIP_PLANE5 */ + { 2420, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + { 2453, 0x00000A00 }, /* GL_COEFF */ + { 2462, 0x00001800 }, /* GL_COLOR */ + { 2471, 0x00008076 }, /* GL_COLOR_ARRAY */ + { 2486, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + { 2516, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 2550, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ + { 2573, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ + { 2593, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ + { 2615, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ + { 2635, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */ + { 2656, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ + { 2681, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */ + { 2702, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */ + { 2724, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ + { 2750, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */ + { 2772, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ + { 2798, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */ + { 2820, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ + { 2846, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */ + { 2868, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ + { 2894, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */ + { 2916, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ + { 2942, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */ + { 2964, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ + { 2990, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ + { 3015, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */ + { 3036, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ + { 3061, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */ + { 3082, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ + { 3107, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */ + { 3128, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ + { 3153, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */ + { 3174, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ + { 3199, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */ + { 3220, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ + { 3245, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */ + { 3266, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ + { 3291, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */ + { 3312, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ + { 3337, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */ + { 3358, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ + { 3383, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ + { 3403, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ + { 3424, 0x00001900 }, /* GL_COLOR_INDEX */ + { 3439, 0x00001603 }, /* GL_COLOR_INDEXES */ + { 3456, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ + { 3474, 0x00000B57 }, /* GL_COLOR_MATERIAL */ + { 3492, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ + { 3515, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ + { 3543, 0x000080B1 }, /* GL_COLOR_MATRIX */ + { 3559, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ + { 3579, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ + { 3607, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 3639, 0x00008458 }, /* GL_COLOR_SUM */ + { 3652, 0x00008458 }, /* GL_COLOR_SUM_ARB */ + { 3669, 0x000080D0 }, /* GL_COLOR_TABLE */ + { 3684, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ + { 3710, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ + { 3740, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ + { 3770, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ + { 3790, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ + { 3814, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ + { 3839, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ + { 3868, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ + { 3897, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ + { 3919, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ + { 3945, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ + { 3971, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ + { 3997, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ + { 4027, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ + { 4057, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + { 4087, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ + { 4121, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ + { 4155, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + { 4185, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ + { 4219, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ + { 4253, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ + { 4277, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ + { 4305, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ + { 4333, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ + { 4354, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ + { 4379, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ + { 4400, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ + { 4425, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ + { 4450, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ + { 4469, 0x00008570 }, /* GL_COMBINE */ + { 4480, 0x00008503 }, /* GL_COMBINE4 */ + { 4492, 0x00008572 }, /* GL_COMBINE_ALPHA */ + { 4509, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ + { 4530, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ + { 4551, 0x00008570 }, /* GL_COMBINE_ARB */ + { 4566, 0x00008570 }, /* GL_COMBINE_EXT */ + { 4581, 0x00008571 }, /* GL_COMBINE_RGB */ + { 4596, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ + { 4615, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ + { 4634, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ + { 4670, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ + { 4694, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ + { 4722, 0x00001300 }, /* GL_COMPILE */ + { 4733, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ + { 4756, 0x00008B81 }, /* GL_COMPILE_STATUS */ + { 4774, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ + { 4794, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ + { 4818, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ + { 4842, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ + { 4870, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ + { 4894, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + { 4924, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ + { 4958, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ + { 4986, 0x000084ED }, /* GL_COMPRESSED_RGB */ + { 5004, 0x000084EE }, /* GL_COMPRESSED_RGBA */ + { 5023, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ + { 5046, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + { 5075, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + { 5108, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + { 5141, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + { 5174, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ + { 5196, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + { 5224, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + { 5256, 0x00008C4A }, /* GL_COMPRESSED_SLUMINANCE */ + { 5281, 0x00008C4B }, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ + { 5312, 0x00008C48 }, /* GL_COMPRESSED_SRGB */ + { 5331, 0x00008C49 }, /* GL_COMPRESSED_SRGB_ALPHA */ + { 5356, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ + { 5386, 0x00008576 }, /* GL_CONSTANT */ + { 5398, 0x00008003 }, /* GL_CONSTANT_ALPHA */ + { 5416, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ + { 5438, 0x00008576 }, /* GL_CONSTANT_ARB */ + { 5454, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ + { 5478, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ + { 5500, 0x00008001 }, /* GL_CONSTANT_COLOR */ + { 5518, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ + { 5540, 0x00008576 }, /* GL_CONSTANT_EXT */ + { 5556, 0x00008010 }, /* GL_CONVOLUTION_1D */ + { 5574, 0x00008011 }, /* GL_CONVOLUTION_2D */ + { 5592, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ + { 5620, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ + { 5651, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ + { 5678, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ + { 5709, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ + { 5736, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ + { 5767, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ + { 5795, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ + { 5827, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ + { 5849, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ + { 5875, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ + { 5897, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ + { 5923, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ + { 5944, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ + { 5969, 0x00008862 }, /* GL_COORD_REPLACE */ + { 5986, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ + { 6007, 0x00008862 }, /* GL_COORD_REPLACE_NV */ + { 6027, 0x00001503 }, /* GL_COPY */ + { 6035, 0x0000150C }, /* GL_COPY_INVERTED */ + { 6052, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ + { 6072, 0x00000B44 }, /* GL_CULL_FACE */ + { 6085, 0x00000B45 }, /* GL_CULL_FACE_MODE */ + { 6103, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ + { 6122, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + { 6154, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + { 6189, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ + { 6210, 0x00000001 }, /* GL_CURRENT_BIT */ + { 6225, 0x00000B00 }, /* GL_CURRENT_COLOR */ + { 6242, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ + { 6263, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ + { 6289, 0x00000B01 }, /* GL_CURRENT_INDEX */ + { 6306, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ + { 6328, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ + { 6356, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ + { 6377, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + { 6411, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ + { 6444, 0x00000B02 }, /* GL_CURRENT_NORMAL */ + { 6462, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + { 6492, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ + { 6511, 0x00008865 }, /* GL_CURRENT_QUERY */ + { 6528, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ + { 6549, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ + { 6573, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ + { 6600, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ + { 6624, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ + { 6651, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ + { 6684, 0x0000845F }, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ + { 6718, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + { 6751, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ + { 6778, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ + { 6804, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ + { 6829, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ + { 6858, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ + { 6880, 0x00000900 }, /* GL_CW */ + { 6886, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ + { 6907, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ + { 6928, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ + { 6948, 0x00002101 }, /* GL_DECAL */ + { 6957, 0x00001E03 }, /* GL_DECR */ + { 6965, 0x00008508 }, /* GL_DECR_WRAP */ + { 6978, 0x00008508 }, /* GL_DECR_WRAP_EXT */ + { 6995, 0x00008B80 }, /* GL_DELETE_STATUS */ + { 7012, 0x00001801 }, /* GL_DEPTH */ + { 7021, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ + { 7041, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ + { 7061, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 7085, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 7099, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 7113, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 7133, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 7158, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 7178, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 7196, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 7217, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 7236, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 7257, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 7282, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7308, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7329, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7354, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7380, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7401, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7426, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7452, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7466, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7481, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7496, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7513, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7541, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7561, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7589, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7617, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7631, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7653, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7679, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7698, 0x00001201 }, /* GL_DIFFUSE */ + { 7709, 0x00000BD0 }, /* GL_DITHER */ + { 7719, 0x00000A02 }, /* GL_DOMAIN */ + { 7729, 0x00001100 }, /* GL_DONT_CARE */ + { 7742, 0x000086AE }, /* GL_DOT3_RGB */ + { 7754, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7767, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7784, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 7801, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 7817, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 7833, 0x0000140A }, /* GL_DOUBLE */ + { 7843, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 7859, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 7874, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 7890, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 7910, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 7930, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 7946, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 7963, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 7984, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 8005, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 8022, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 8043, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 8064, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 8081, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 8102, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 8123, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 8140, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 8161, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 8182, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 8199, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 8220, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 8241, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 8258, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 8279, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8300, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8320, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8340, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8356, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8376, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8396, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8412, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8432, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8452, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8468, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8488, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8508, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8524, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8544, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8564, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8580, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8600, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8620, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8636, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8656, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8676, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8692, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8712, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8732, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8748, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8768, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8788, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 8808, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 8840, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 8864, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 8884, 0x00000304 }, /* GL_DST_ALPHA */ + { 8897, 0x00000306 }, /* GL_DST_COLOR */ + { 8910, 0x0000877A }, /* GL_DU8DV8_ATI */ + { 8924, 0x00008779 }, /* GL_DUDV_ATI */ + { 8936, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 8952, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 8972, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 8988, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 9008, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 9024, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 9044, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 9057, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 9076, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 9110, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 9148, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 9175, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 9201, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 9225, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 9257, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 9293, 0x00001600 }, /* GL_EMISSION */ + { 9305, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9319, 0x00000202 }, /* GL_EQUAL */ + { 9328, 0x00001509 }, /* GL_EQUIV */ + { 9337, 0x00010000 }, /* GL_EVAL_BIT */ + { 9349, 0x00000800 }, /* GL_EXP */ + { 9356, 0x00000801 }, /* GL_EXP2 */ + { 9364, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9378, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9392, 0x00002502 }, /* GL_EYE_PLANE */ + { 9405, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9430, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9447, 0x00000000 }, /* GL_FALSE */ + { 9456, 0x00001101 }, /* GL_FASTEST */ + { 9467, 0x00001C01 }, /* GL_FEEDBACK */ + { 9479, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9506, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9530, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9554, 0x00001B02 }, /* GL_FILL */ + { 9562, 0x00001D00 }, /* GL_FLAT */ + { 9570, 0x00001406 }, /* GL_FLOAT */ + { 9579, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9593, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9611, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ + { 9627, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ + { 9643, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9657, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9675, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ + { 9691, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ + { 9707, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 9721, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 9739, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ + { 9755, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ + { 9771, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 9785, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 9803, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 9817, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 9835, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 9849, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 9867, 0x00000B60 }, /* GL_FOG */ + { 9874, 0x00000080 }, /* GL_FOG_BIT */ + { 9885, 0x00000B66 }, /* GL_FOG_COLOR */ + { 9898, 0x00008451 }, /* GL_FOG_COORD */ + { 9911, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 9929, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 9953, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 9992, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 10035, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 10067, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 10098, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 10127, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 10152, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 10171, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 10205, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 10232, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 10258, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 10282, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 10299, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 10314, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 10338, 0x00000B64 }, /* GL_FOG_END */ + { 10349, 0x00000C54 }, /* GL_FOG_HINT */ + { 10361, 0x00000B61 }, /* GL_FOG_INDEX */ + { 10374, 0x00000B65 }, /* GL_FOG_MODE */ + { 10386, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 10405, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10430, 0x00000B63 }, /* GL_FOG_START */ + { 10443, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10461, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10485, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10504, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10527, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10562, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10577, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10614, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10650, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10691, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 10732, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 10769, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 10806, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 10844, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 10886, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 10924, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 10966, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 11001, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 11040, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 11089, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 11137, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 11189, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 11229, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 11273, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 11313, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 11357, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 11384, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 11408, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11436, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11459, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11478, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11515, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11556, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11597, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11639, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 11690, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 11728, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 11773, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 11822, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 11860, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 11902, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 11934, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 11959, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 11986, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 12017, 0x00000404 }, /* GL_FRONT */ + { 12026, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 12044, 0x00000B46 }, /* GL_FRONT_FACE */ + { 12058, 0x00000400 }, /* GL_FRONT_LEFT */ + { 12072, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 12087, 0x00008006 }, /* GL_FUNC_ADD */ + { 12099, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 12115, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 12140, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 12169, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 12186, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 12207, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 12226, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 12250, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 12279, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 12303, 0x00000206 }, /* GL_GEQUAL */ + { 12313, 0x00000204 }, /* GL_GREATER */ + { 12324, 0x00001904 }, /* GL_GREEN */ + { 12333, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12347, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12361, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12376, 0x00008000 }, /* GL_HINT_BIT */ + { 12388, 0x00008024 }, /* GL_HISTOGRAM */ + { 12401, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12425, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12453, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12476, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12503, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12520, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12540, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 12564, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 12588, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 12616, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 12644, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 12676, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 12698, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 12724, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 12742, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 12764, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 12783, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 12806, 0x0000862A }, /* GL_IDENTITY_NV */ + { 12821, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 12841, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 12881, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 12919, 0x00001E02 }, /* GL_INCR */ + { 12927, 0x00008507 }, /* GL_INCR_WRAP */ + { 12940, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 12957, 0x00008222 }, /* GL_INDEX */ + { 12966, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 12981, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13011, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13045, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13068, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13090, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13110, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13124, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13145, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13163, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13177, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13193, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13208, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13227, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13246, 0x00001404 }, /* GL_INT */ + { 13253, 0x00008049 }, /* GL_INTENSITY */ + { 13266, 0x0000804C }, /* GL_INTENSITY12 */ + { 13281, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13300, 0x0000804D }, /* GL_INTENSITY16 */ + { 13315, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13334, 0x0000804A }, /* GL_INTENSITY4 */ + { 13348, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13366, 0x0000804B }, /* GL_INTENSITY8 */ + { 13380, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13398, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13415, 0x00008575 }, /* GL_INTERPOLATE */ + { 13430, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13449, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13468, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13480, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13496, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13508, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13524, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13536, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13552, 0x00000500 }, /* GL_INVALID_ENUM */ + { 13568, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 13601, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 13638, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 13659, 0x00000501 }, /* GL_INVALID_VALUE */ + { 13676, 0x0000862B }, /* GL_INVERSE_NV */ + { 13690, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 13714, 0x0000150A }, /* GL_INVERT */ + { 13724, 0x00001E00 }, /* GL_KEEP */ + { 13732, 0x00000406 }, /* GL_LEFT */ + { 13740, 0x00000203 }, /* GL_LEQUAL */ + { 13750, 0x00000201 }, /* GL_LESS */ + { 13758, 0x00004000 }, /* GL_LIGHT0 */ + { 13768, 0x00004001 }, /* GL_LIGHT1 */ + { 13778, 0x00004002 }, /* GL_LIGHT2 */ + { 13788, 0x00004003 }, /* GL_LIGHT3 */ + { 13798, 0x00004004 }, /* GL_LIGHT4 */ + { 13808, 0x00004005 }, /* GL_LIGHT5 */ + { 13818, 0x00004006 }, /* GL_LIGHT6 */ + { 13828, 0x00004007 }, /* GL_LIGHT7 */ + { 13838, 0x00000B50 }, /* GL_LIGHTING */ + { 13850, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 13866, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 13889, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 13918, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 13951, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 13979, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14003, 0x00001B01 }, /* GL_LINE */ + { 14011, 0x00002601 }, /* GL_LINEAR */ + { 14021, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14043, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14073, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14104, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14128, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14153, 0x00000001 }, /* GL_LINES */ + { 14162, 0x00000004 }, /* GL_LINE_BIT */ + { 14174, 0x00000002 }, /* GL_LINE_LOOP */ + { 14187, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14207, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14222, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14242, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14258, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14282, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14305, 0x00000003 }, /* GL_LINE_STRIP */ + { 14319, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14333, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14347, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14373, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14393, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14408, 0x00000B32 }, /* GL_LIST_BASE */ + { 14421, 0x00020000 }, /* GL_LIST_BIT */ + { 14433, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14447, 0x00000B30 }, /* GL_LIST_MODE */ + { 14460, 0x00000101 }, /* GL_LOAD */ + { 14468, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14480, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14497, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 14511, 0x00001909 }, /* GL_LUMINANCE */ + { 14524, 0x00008041 }, /* GL_LUMINANCE12 */ + { 14539, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 14562, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 14589, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 14611, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 14637, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 14656, 0x00008042 }, /* GL_LUMINANCE16 */ + { 14671, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 14694, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 14721, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 14740, 0x0000803F }, /* GL_LUMINANCE4 */ + { 14754, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 14775, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 14800, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 14818, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 14839, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 14864, 0x00008040 }, /* GL_LUMINANCE8 */ + { 14878, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 14899, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 14924, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 14942, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 14961, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 14977, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 14997, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15019, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15033, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15048, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15072, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15096, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15120, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15144, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15161, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15178, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15206, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15235, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15264, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15293, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15322, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15351, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15380, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15408, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15436, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15464, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15492, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 15520, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 15548, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 15576, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 15604, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 15632, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 15648, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 15668, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 15690, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 15704, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 15719, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 15743, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 15767, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 15791, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 15815, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 15832, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 15849, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 15877, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 15906, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 15935, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 15964, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 15993, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16022, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16051, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16079, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16107, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16135, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16163, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16191, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16219, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16247, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16275, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16303, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16316, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16331, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16346, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16360, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 16376, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 16392, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 16408, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 16424, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 16440, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 16456, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 16472, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 16488, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 16504, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 16520, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 16535, 0x00008631 }, /* GL_MATRIX1_NV */ + { 16549, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 16565, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 16581, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 16597, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 16613, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 16629, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 16645, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 16661, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 16677, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 16693, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 16709, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 16724, 0x00008632 }, /* GL_MATRIX2_NV */ + { 16738, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 16754, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 16770, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 16785, 0x00008633 }, /* GL_MATRIX3_NV */ + { 16799, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 16814, 0x00008634 }, /* GL_MATRIX4_NV */ + { 16828, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 16843, 0x00008635 }, /* GL_MATRIX5_NV */ + { 16857, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 16872, 0x00008636 }, /* GL_MATRIX6_NV */ + { 16886, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 16901, 0x00008637 }, /* GL_MATRIX7_NV */ + { 16915, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 16930, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 16945, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 16971, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17005, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17036, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17069, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17100, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17115, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17137, 0x00008008 }, /* GL_MAX */ + { 17144, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17167, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17199, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17225, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17258, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17284, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17318, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17337, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 17366, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 17398, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 17434, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 17470, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 17510, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 17536, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 17566, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 17591, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 17620, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 17649, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 17682, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 17702, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 17726, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 17750, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 17774, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 17799, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 17817, 0x00008008 }, /* GL_MAX_EXT */ + { 17828, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 17863, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 17902, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 17916, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 17936, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 17974, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18003, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18027, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18055, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18078, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18115, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18151, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18178, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18207, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18241, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18277, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18304, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18336, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 18372, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 18401, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 18430, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 18458, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 18496, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 18540, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 18583, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 18617, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 18656, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 18693, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 18731, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 18774, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 18817, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 18847, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 18878, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 18914, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 18950, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 18980, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19014, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19047, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19076, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19091, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19111, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19135, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19157, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19183, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19210, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19241, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19265, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 19299, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 19319, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 19346, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 19367, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 19392, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 19417, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 19452, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 19474, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 19500, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19522, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 19548, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 19582, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 19620, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 19653, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 19690, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 19714, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 19735, 0x00008007 }, /* GL_MIN */ + { 19742, 0x0000802E }, /* GL_MINMAX */ + { 19752, 0x0000802E }, /* GL_MINMAX_EXT */ + { 19766, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 19783, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 19804, 0x00008030 }, /* GL_MINMAX_SINK */ + { 19819, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 19838, 0x00008007 }, /* GL_MIN_EXT */ + { 19849, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 19868, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 19891, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 19914, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 19934, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 19954, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 19984, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20012, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20040, 0x00001700 }, /* GL_MODELVIEW */ + { 20053, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20071, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20090, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20109, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20128, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20147, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20166, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20185, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20204, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20223, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20242, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20261, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 20279, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 20298, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 20317, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 20336, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 20355, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 20374, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 20393, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 20412, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 20431, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 20450, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 20469, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 20487, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 20506, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 20525, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 20543, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 20561, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 20579, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 20597, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 20615, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 20633, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 20651, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 20671, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 20698, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 20723, 0x00002100 }, /* GL_MODULATE */ + { 20735, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 20755, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 20782, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 20807, 0x00000103 }, /* GL_MULT */ + { 20815, 0x0000809D }, /* GL_MULTISAMPLE */ + { 20830, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 20850, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 20869, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 20888, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 20912, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 20935, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 20965, 0x00002A25 }, /* GL_N3F_V3F */ + { 20976, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 20996, 0x0000150E }, /* GL_NAND */ + { 21004, 0x00002600 }, /* GL_NEAREST */ + { 21015, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21046, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21078, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21103, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21129, 0x00000200 }, /* GL_NEVER */ + { 21138, 0x00001102 }, /* GL_NICEST */ + { 21148, 0x00000000 }, /* GL_NONE */ + { 21156, 0x00001505 }, /* GL_NOOP */ + { 21164, 0x00001508 }, /* GL_NOR */ + { 21171, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21184, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21200, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21231, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21266, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 21290, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 21313, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 21334, 0x00008511 }, /* GL_NORMAL_MAP */ + { 21348, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 21366, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 21383, 0x00000205 }, /* GL_NOTEQUAL */ + { 21395, 0x00000000 }, /* GL_NO_ERROR */ + { 21407, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 21441, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 21479, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 21511, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 21553, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 21583, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 21623, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 21654, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 21683, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 21711, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 21741, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 21758, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 21784, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 21800, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 21835, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 21857, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 21876, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 21906, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 21927, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 21955, 0x00000001 }, /* GL_ONE */ + { 21962, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 21990, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22022, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22050, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22082, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22105, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22128, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22151, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22174, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22192, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22214, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22236, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22252, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 22272, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 22292, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 22310, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 22332, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 22354, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 22370, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 22390, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 22410, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 22428, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 22450, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 22472, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 22488, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 22508, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 22528, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 22549, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 22568, 0x00001507 }, /* GL_OR */ + { 22574, 0x00000A01 }, /* GL_ORDER */ + { 22583, 0x0000150D }, /* GL_OR_INVERTED */ + { 22598, 0x0000150B }, /* GL_OR_REVERSE */ + { 22612, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 22629, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 22647, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 22668, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 22688, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 22706, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 22725, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 22745, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 22765, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 22783, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 22802, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 22827, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 22851, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 22872, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 22894, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 22916, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 22941, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 22965, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 22986, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23008, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23030, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23052, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23083, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23103, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23128, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23148, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23173, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23193, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23218, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23238, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 23263, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 23283, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 23308, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 23328, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 23353, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 23373, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 23398, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 23418, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 23443, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 23463, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 23488, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 23508, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 23533, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 23551, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 23572, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 23601, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 23634, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 23659, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 23682, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 23713, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 23748, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 23775, 0x00001B00 }, /* GL_POINT */ + { 23784, 0x00000000 }, /* GL_POINTS */ + { 23794, 0x00000002 }, /* GL_POINT_BIT */ + { 23807, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 23837, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 23871, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 23905, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 23940, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 23969, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24002, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24035, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24069, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24083, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24109, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24127, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24149, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24171, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24194, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24212, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24234, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 24256, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 24279, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 24299, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 24315, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 24336, 0x00008861 }, /* GL_POINT_SPRITE */ + { 24352, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 24372, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 24401, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 24420, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 24446, 0x00000701 }, /* GL_POINT_TOKEN */ + { 24461, 0x00000009 }, /* GL_POLYGON */ + { 24472, 0x00000008 }, /* GL_POLYGON_BIT */ + { 24487, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 24503, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 24526, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 24551, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 24574, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 24597, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 24621, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 24645, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 24663, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 24686, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 24705, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 24728, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 24745, 0x00001203 }, /* GL_POSITION */ + { 24757, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 24789, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 24825, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 24858, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 24895, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 24926, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 24961, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 24993, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25029, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25062, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25094, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25130, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25163, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25200, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25230, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 25264, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 25295, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 25330, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 25361, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 25396, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 25428, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 25464, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 25494, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 25528, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 25559, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 25594, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 25626, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 25657, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 25692, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 25724, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 25760, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 25789, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 25822, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 25852, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 25886, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 25925, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 25958, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 25998, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26032, 0x00008578 }, /* GL_PREVIOUS */ + { 26044, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26060, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26076, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26093, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26114, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26135, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26168, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26200, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26223, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26246, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 26276, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 26305, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 26333, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 26355, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 26383, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 26411, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 26433, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 26454, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 26494, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 26533, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 26563, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 26598, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 26631, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 26665, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 26704, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 26743, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 26765, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 26791, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 26815, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 26838, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 26860, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 26881, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 26902, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 26929, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 26961, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 26993, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27028, 0x00001701 }, /* GL_PROJECTION */ + { 27042, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27063, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27089, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27110, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27129, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27152, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27191, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 27229, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 27249, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 27279, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 27303, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 27323, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 27353, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 27377, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 27397, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 27430, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 27456, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 27486, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 27517, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 27547, 0x00002003 }, /* GL_Q */ + { 27552, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 27577, 0x00000007 }, /* GL_QUADS */ + { 27586, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 27603, 0x00000008 }, /* GL_QUAD_STRIP */ + { 27617, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 27639, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 27665, 0x00008866 }, /* GL_QUERY_RESULT */ + { 27681, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 27701, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 27727, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 27757, 0x00002002 }, /* GL_R */ + { 27762, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 27774, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 27807, 0x00000C02 }, /* GL_READ_BUFFER */ + { 27822, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 27842, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 27874, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 27898, 0x000088B8 }, /* GL_READ_ONLY */ + { 27911, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 27928, 0x000088BA }, /* GL_READ_WRITE */ + { 27942, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 27960, 0x00001903 }, /* GL_RED */ + { 27967, 0x00008016 }, /* GL_REDUCE */ + { 27977, 0x00008016 }, /* GL_REDUCE_EXT */ + { 27991, 0x00000D15 }, /* GL_RED_BIAS */ + { 28003, 0x00000D52 }, /* GL_RED_BITS */ + { 28015, 0x00000D14 }, /* GL_RED_SCALE */ + { 28028, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28046, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28068, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28089, 0x00001C00 }, /* GL_RENDER */ + { 28099, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 28115, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 28142, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 28170, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 28196, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 28223, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 28243, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 28270, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 28293, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 28320, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 28352, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 28388, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 28413, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 28437, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 28466, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 28488, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 28514, 0x00001F01 }, /* GL_RENDERER */ + { 28526, 0x00000C40 }, /* GL_RENDER_MODE */ + { 28541, 0x00002901 }, /* GL_REPEAT */ + { 28551, 0x00001E01 }, /* GL_REPLACE */ + { 28562, 0x00008062 }, /* GL_REPLACE_EXT */ + { 28577, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 28600, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 28618, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 28640, 0x00000102 }, /* GL_RETURN */ + { 28650, 0x00001907 }, /* GL_RGB */ + { 28657, 0x00008052 }, /* GL_RGB10 */ + { 28666, 0x00008059 }, /* GL_RGB10_A2 */ + { 28678, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 28694, 0x00008052 }, /* GL_RGB10_EXT */ + { 28707, 0x00008053 }, /* GL_RGB12 */ + { 28716, 0x00008053 }, /* GL_RGB12_EXT */ + { 28729, 0x00008054 }, /* GL_RGB16 */ + { 28738, 0x00008054 }, /* GL_RGB16_EXT */ + { 28751, 0x0000804E }, /* GL_RGB2_EXT */ + { 28763, 0x0000804F }, /* GL_RGB4 */ + { 28771, 0x0000804F }, /* GL_RGB4_EXT */ + { 28783, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 28796, 0x00008050 }, /* GL_RGB5 */ + { 28804, 0x00008057 }, /* GL_RGB5_A1 */ + { 28815, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 28830, 0x00008050 }, /* GL_RGB5_EXT */ + { 28842, 0x00008051 }, /* GL_RGB8 */ + { 28850, 0x00008051 }, /* GL_RGB8_EXT */ + { 28862, 0x00001908 }, /* GL_RGBA */ + { 28870, 0x0000805A }, /* GL_RGBA12 */ + { 28880, 0x0000805A }, /* GL_RGBA12_EXT */ + { 28894, 0x0000805B }, /* GL_RGBA16 */ + { 28904, 0x0000805B }, /* GL_RGBA16_EXT */ + { 28918, 0x00008055 }, /* GL_RGBA2 */ + { 28927, 0x00008055 }, /* GL_RGBA2_EXT */ + { 28940, 0x00008056 }, /* GL_RGBA4 */ + { 28949, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 28968, 0x00008056 }, /* GL_RGBA4_EXT */ + { 28981, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 28995, 0x00008058 }, /* GL_RGBA8 */ + { 29004, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29017, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 29032, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 29050, 0x00000C31 }, /* GL_RGBA_MODE */ + { 29063, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 29076, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 29090, 0x000083A0 }, /* GL_RGB_S3TC */ + { 29102, 0x00008573 }, /* GL_RGB_SCALE */ + { 29115, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 29132, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 29149, 0x00000407 }, /* GL_RIGHT */ + { 29158, 0x00002000 }, /* GL_S */ + { 29163, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 29177, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 29198, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 29212, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 29233, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 29247, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 29263, 0x000080A9 }, /* GL_SAMPLES */ + { 29274, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 29290, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 29305, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 29323, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 29345, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 29373, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 29405, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 29428, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 29455, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 29473, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 29496, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 29518, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 29537, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 29560, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 29586, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 29616, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 29641, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 29670, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 29685, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 29700, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 29716, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 29741, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 29781, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 29825, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 29858, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 29888, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 29920, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 29950, 0x00001C02 }, /* GL_SELECT */ + { 29960, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 29988, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30013, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30029, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 30056, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 30087, 0x0000150F }, /* GL_SET */ + { 30094, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 30115, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 30139, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 30154, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 30169, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 30197, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 30220, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 30250, 0x00001601 }, /* GL_SHININESS */ + { 30263, 0x00001402 }, /* GL_SHORT */ + { 30272, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 30293, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 30309, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 30329, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 30348, 0x00008C46 }, /* GL_SLUMINANCE */ + { 30362, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 30377, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 30399, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 30419, 0x00001D01 }, /* GL_SMOOTH */ + { 30429, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 30462, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 30489, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 30522, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 30549, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 30566, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 30587, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 30608, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 30623, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 30642, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 30661, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 30678, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 30699, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 30720, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 30735, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 30754, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 30773, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 30790, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 30811, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 30832, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 30847, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 30866, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 30885, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 30905, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 30923, 0x00001202 }, /* GL_SPECULAR */ + { 30935, 0x00002402 }, /* GL_SPHERE_MAP */ + { 30949, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 30964, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 30982, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 30999, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 31013, 0x00008580 }, /* GL_SRC0_RGB */ + { 31025, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 31039, 0x00008581 }, /* GL_SRC1_RGB */ + { 31051, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 31065, 0x00008582 }, /* GL_SRC2_RGB */ + { 31077, 0x00000302 }, /* GL_SRC_ALPHA */ + { 31090, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 31112, 0x00000300 }, /* GL_SRC_COLOR */ + { 31125, 0x00008C40 }, /* GL_SRGB */ + { 31133, 0x00008C41 }, /* GL_SRGB8 */ + { 31142, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 31158, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 31172, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 31190, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 31209, 0x000088E6 }, /* GL_STATIC_COPY */ + { 31224, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 31243, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 31258, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 31277, 0x000088E5 }, /* GL_STATIC_READ */ + { 31292, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 31311, 0x00001802 }, /* GL_STENCIL */ + { 31322, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 31344, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 31370, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 31391, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 31416, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 31437, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 31462, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 31494, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 31530, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 31562, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 31598, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 31618, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 31645, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 31671, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 31687, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 31709, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 31732, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 31748, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 31764, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 31781, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 31804, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 31826, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 31848, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 31870, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 31891, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 31918, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 31945, 0x00000B97 }, /* GL_STENCIL_REF */ + { 31960, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 31976, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 32005, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 32027, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 32048, 0x00000C33 }, /* GL_STEREO */ + { 32058, 0x000088E2 }, /* GL_STREAM_COPY */ + { 32073, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 32092, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 32107, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 32126, 0x000088E1 }, /* GL_STREAM_READ */ + { 32141, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 32160, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 32177, 0x000084E7 }, /* GL_SUBTRACT */ + { 32189, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 32205, 0x00002001 }, /* GL_T */ + { 32210, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 32225, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 32244, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 32260, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 32275, 0x00002A27 }, /* GL_T2F_V3F */ + { 32286, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 32305, 0x00002A28 }, /* GL_T4F_V4F */ + { 32316, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 32339, 0x00001702 }, /* GL_TEXTURE */ + { 32350, 0x000084C0 }, /* GL_TEXTURE0 */ + { 32362, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 32378, 0x000084C1 }, /* GL_TEXTURE1 */ + { 32390, 0x000084CA }, /* GL_TEXTURE10 */ + { 32403, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 32420, 0x000084CB }, /* GL_TEXTURE11 */ + { 32433, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 32450, 0x000084CC }, /* GL_TEXTURE12 */ + { 32463, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 32480, 0x000084CD }, /* GL_TEXTURE13 */ + { 32493, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 32510, 0x000084CE }, /* GL_TEXTURE14 */ + { 32523, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 32540, 0x000084CF }, /* GL_TEXTURE15 */ + { 32553, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 32570, 0x000084D0 }, /* GL_TEXTURE16 */ + { 32583, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 32600, 0x000084D1 }, /* GL_TEXTURE17 */ + { 32613, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 32630, 0x000084D2 }, /* GL_TEXTURE18 */ + { 32643, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 32660, 0x000084D3 }, /* GL_TEXTURE19 */ + { 32673, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 32690, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 32706, 0x000084C2 }, /* GL_TEXTURE2 */ + { 32718, 0x000084D4 }, /* GL_TEXTURE20 */ + { 32731, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 32748, 0x000084D5 }, /* GL_TEXTURE21 */ + { 32761, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 32778, 0x000084D6 }, /* GL_TEXTURE22 */ + { 32791, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 32808, 0x000084D7 }, /* GL_TEXTURE23 */ + { 32821, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 32838, 0x000084D8 }, /* GL_TEXTURE24 */ + { 32851, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 32868, 0x000084D9 }, /* GL_TEXTURE25 */ + { 32881, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 32898, 0x000084DA }, /* GL_TEXTURE26 */ + { 32911, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 32928, 0x000084DB }, /* GL_TEXTURE27 */ + { 32941, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 32958, 0x000084DC }, /* GL_TEXTURE28 */ + { 32971, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 32988, 0x000084DD }, /* GL_TEXTURE29 */ + { 33001, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 33018, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 33034, 0x000084C3 }, /* GL_TEXTURE3 */ + { 33046, 0x000084DE }, /* GL_TEXTURE30 */ + { 33059, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 33076, 0x000084DF }, /* GL_TEXTURE31 */ + { 33089, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 33106, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 33122, 0x000084C4 }, /* GL_TEXTURE4 */ + { 33134, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 33150, 0x000084C5 }, /* GL_TEXTURE5 */ + { 33162, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 33178, 0x000084C6 }, /* GL_TEXTURE6 */ + { 33190, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 33206, 0x000084C7 }, /* GL_TEXTURE7 */ + { 33218, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 33234, 0x000084C8 }, /* GL_TEXTURE8 */ + { 33246, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 33262, 0x000084C9 }, /* GL_TEXTURE9 */ + { 33274, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 33290, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 33304, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 33328, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 33342, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 33366, 0x0000806F }, /* GL_TEXTURE_3D */ + { 33380, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 33402, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 33428, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 33450, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 33472, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 33504, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 33526, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 33558, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 33580, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 33608, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 33640, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 33673, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 33705, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 33720, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 33741, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 33766, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 33784, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 33808, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 33839, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 33869, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 33899, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 33934, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 33965, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 34003, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 34030, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 34062, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 34096, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 34120, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 34148, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 34172, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 34200, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 34233, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 34257, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 34279, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 34301, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 34327, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 34361, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 34394, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 34431, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 34459, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 34491, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 34514, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 34552, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 34594, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 34625, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 34653, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 34683, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 34711, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 34731, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 34755, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 34786, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 34821, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 34852, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 34887, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 34918, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 34953, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 34984, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 35019, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 35050, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 35085, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 35116, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 35151, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 35168, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 35190, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 35216, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 35231, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 35252, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 35272, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 35298, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 35318, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 35335, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 35352, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 35369, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 35386, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 35411, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 35433, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 35459, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 35477, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 35503, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 35529, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 35559, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 35586, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 35611, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 35631, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 35655, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 35682, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 35709, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 35736, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 35762, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 35792, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 35814, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 35832, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 35862, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 35890, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 35918, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 35946, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 35967, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 35986, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 36008, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 36027, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 36047, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 36072, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 36096, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 36116, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 36140, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 36160, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 36183, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 36207, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 36232, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 36266, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 36283, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 36301, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 36319, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 36337, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 36357, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 36376, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 36405, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 36422, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 36448, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 36478, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 36510, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 36540, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 36574, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 36590, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 36621, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 36656, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 36684, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 36716, 0x00000004 }, /* GL_TRIANGLES */ + { 36729, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 36745, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 36766, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 36784, 0x00000001 }, /* GL_TRUE */ + { 36792, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 36812, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 36835, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 36855, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 36876, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 36898, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 36920, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 36940, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 36961, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 36978, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 37005, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 37028, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 37044, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 37071, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 37092, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 37116, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 37147, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 37171, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 37199, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 37222, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 37240, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 37270, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 37296, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 37326, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 37352, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 37376, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 37404, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 37432, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 37459, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 37491, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 37522, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 37536, 0x00002A20 }, /* GL_V2F */ + { 37543, 0x00002A21 }, /* GL_V3F */ + { 37550, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 37569, 0x00001F00 }, /* GL_VENDOR */ + { 37579, 0x00001F02 }, /* GL_VERSION */ + { 37590, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 37606, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 37636, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 37667, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 37702, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 37726, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 37747, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 37770, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 37791, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 37818, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 37846, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 37874, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 37902, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 37930, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 37958, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 37986, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 38013, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 38040, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 38067, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 38094, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 38121, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 38148, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 38175, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 38202, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 38229, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 38267, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 38309, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 38340, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 38375, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 38409, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 38447, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 38478, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 38513, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 38541, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 38573, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 38603, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 38637, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 38665, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 38697, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 38717, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 38739, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 38768, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 38789, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 38818, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 38851, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 38883, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 38910, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 38941, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 38971, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 38988, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 39009, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 39036, 0x00000BA2 }, /* GL_VIEWPORT */ + { 39048, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 39064, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 39084, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 39115, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 39150, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 39178, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 39203, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 39230, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 39255, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 39279, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 39298, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 39312, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 39330, 0x00001506 }, /* GL_XOR */ + { 39337, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 39356, 0x00008757 }, /* GL_YCBCR_MESA */ + { 39370, 0x00000000 }, /* GL_ZERO */ + { 39378, 0x00000D16 }, /* GL_ZOOM_X */ + { 39388, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1316] = +static const unsigned reduced_enums[1319] = { - 463, /* GL_FALSE */ - 695, /* GL_LINES */ - 697, /* GL_LINE_LOOP */ - 704, /* GL_LINE_STRIP */ - 1707, /* GL_TRIANGLES */ - 1710, /* GL_TRIANGLE_STRIP */ - 1708, /* GL_TRIANGLE_FAN */ - 1262, /* GL_QUADS */ - 1264, /* GL_QUAD_STRIP */ - 1150, /* GL_POLYGON */ - 1162, /* GL_POLYGON_STIPPLE_BIT */ - 1115, /* GL_PIXEL_MODE_BIT */ - 682, /* GL_LIGHTING_BIT */ - 485, /* GL_FOG_BIT */ + 469, /* GL_FALSE */ + 683, /* GL_LINES */ + 685, /* GL_LINE_LOOP */ + 692, /* GL_LINE_STRIP */ + 1709, /* GL_TRIANGLES */ + 1712, /* GL_TRIANGLE_STRIP */ + 1710, /* GL_TRIANGLE_FAN */ + 1254, /* GL_QUADS */ + 1256, /* GL_QUAD_STRIP */ + 1142, /* GL_POLYGON */ + 1154, /* GL_POLYGON_STIPPLE_BIT */ + 1103, /* GL_PIXEL_MODE_BIT */ + 670, /* GL_LIGHTING_BIT */ + 497, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 714, /* GL_LOAD */ - 1316, /* GL_RETURN */ - 988, /* GL_MULT */ + 702, /* GL_LOAD */ + 1308, /* GL_RETURN */ + 976, /* GL_MULT */ 23, /* GL_ADD */ - 1004, /* GL_NEVER */ - 672, /* GL_LESS */ - 453, /* GL_EQUAL */ - 671, /* GL_LEQUAL */ - 595, /* GL_GREATER */ - 1019, /* GL_NOTEQUAL */ - 570, /* GL_GEQUAL */ + 992, /* GL_NEVER */ + 660, /* GL_LESS */ + 459, /* GL_EQUAL */ + 659, /* GL_LEQUAL */ + 583, /* GL_GREATER */ + 1007, /* GL_NOTEQUAL */ + 582, /* GL_GEQUAL */ 46, /* GL_ALWAYS */ - 1449, /* GL_SRC_COLOR */ - 1048, /* GL_ONE_MINUS_SRC_COLOR */ - 1447, /* GL_SRC_ALPHA */ - 1047, /* GL_ONE_MINUS_SRC_ALPHA */ - 432, /* GL_DST_ALPHA */ - 1045, /* GL_ONE_MINUS_DST_ALPHA */ - 433, /* GL_DST_COLOR */ - 1046, /* GL_ONE_MINUS_DST_COLOR */ - 1448, /* GL_SRC_ALPHA_SATURATE */ - 558, /* GL_FRONT_LEFT */ - 559, /* GL_FRONT_RIGHT */ + 1448, /* GL_SRC_COLOR */ + 1036, /* GL_ONE_MINUS_SRC_COLOR */ + 1446, /* GL_SRC_ALPHA */ + 1035, /* GL_ONE_MINUS_SRC_ALPHA */ + 438, /* GL_DST_ALPHA */ + 1033, /* GL_ONE_MINUS_DST_ALPHA */ + 439, /* GL_DST_COLOR */ + 1034, /* GL_ONE_MINUS_DST_COLOR */ + 1447, /* GL_SRC_ALPHA_SATURATE */ + 570, /* GL_FRONT_LEFT */ + 571, /* GL_FRONT_RIGHT */ 68, /* GL_BACK_LEFT */ 69, /* GL_BACK_RIGHT */ - 555, /* GL_FRONT */ + 567, /* GL_FRONT */ 67, /* GL_BACK */ - 670, /* GL_LEFT */ - 1356, /* GL_RIGHT */ - 556, /* GL_FRONT_AND_BACK */ + 658, /* GL_LEFT */ + 1350, /* GL_RIGHT */ + 568, /* GL_FRONT_AND_BACK */ 62, /* GL_AUX0 */ 63, /* GL_AUX1 */ 64, /* GL_AUX2 */ 65, /* GL_AUX3 */ - 661, /* GL_INVALID_ENUM */ - 665, /* GL_INVALID_VALUE */ - 664, /* GL_INVALID_OPERATION */ - 1451, /* GL_STACK_OVERFLOW */ - 1452, /* GL_STACK_UNDERFLOW */ - 1073, /* GL_OUT_OF_MEMORY */ - 662, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 649, /* GL_INVALID_ENUM */ + 653, /* GL_INVALID_VALUE */ + 652, /* GL_INVALID_OPERATION */ + 1453, /* GL_STACK_OVERFLOW */ + 1454, /* GL_STACK_UNDERFLOW */ + 1061, /* GL_OUT_OF_MEMORY */ + 650, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1093, /* GL_PASS_THROUGH_TOKEN */ - 1149, /* GL_POINT_TOKEN */ - 705, /* GL_LINE_TOKEN */ - 1163, /* GL_POLYGON_TOKEN */ + 1081, /* GL_PASS_THROUGH_TOKEN */ + 1141, /* GL_POINT_TOKEN */ + 693, /* GL_LINE_TOKEN */ + 1155, /* GL_POLYGON_TOKEN */ 73, /* GL_BITMAP_TOKEN */ - 431, /* GL_DRAW_PIXEL_TOKEN */ - 292, /* GL_COPY_PIXEL_TOKEN */ - 698, /* GL_LINE_RESET_TOKEN */ - 456, /* GL_EXP */ - 457, /* GL_EXP2 */ - 325, /* GL_CW */ - 121, /* GL_CCW */ - 142, /* GL_COEFF */ - 1070, /* GL_ORDER */ - 369, /* GL_DOMAIN */ - 300, /* GL_CURRENT_COLOR */ - 303, /* GL_CURRENT_INDEX */ - 309, /* GL_CURRENT_NORMAL */ - 321, /* GL_CURRENT_TEXTURE_COORDS */ - 314, /* GL_CURRENT_RASTER_COLOR */ - 316, /* GL_CURRENT_RASTER_INDEX */ - 319, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - 317, /* GL_CURRENT_RASTER_POSITION */ - 318, /* GL_CURRENT_RASTER_POSITION_VALID */ - 315, /* GL_CURRENT_RASTER_DISTANCE */ - 1142, /* GL_POINT_SMOOTH */ - 1131, /* GL_POINT_SIZE */ - 1141, /* GL_POINT_SIZE_RANGE */ - 1132, /* GL_POINT_SIZE_GRANULARITY */ - 699, /* GL_LINE_SMOOTH */ - 706, /* GL_LINE_WIDTH */ - 708, /* GL_LINE_WIDTH_RANGE */ - 707, /* GL_LINE_WIDTH_GRANULARITY */ - 701, /* GL_LINE_STIPPLE */ - 702, /* GL_LINE_STIPPLE_PATTERN */ - 703, /* GL_LINE_STIPPLE_REPEAT */ - 713, /* GL_LIST_MODE */ - 872, /* GL_MAX_LIST_NESTING */ - 710, /* GL_LIST_BASE */ - 712, /* GL_LIST_INDEX */ - 1152, /* GL_POLYGON_MODE */ - 1159, /* GL_POLYGON_SMOOTH */ - 1161, /* GL_POLYGON_STIPPLE */ - 442, /* GL_EDGE_FLAG */ - 293, /* GL_CULL_FACE */ - 294, /* GL_CULL_FACE_MODE */ - 557, /* GL_FRONT_FACE */ - 681, /* GL_LIGHTING */ - 686, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 687, /* GL_LIGHT_MODEL_TWO_SIDE */ - 683, /* GL_LIGHT_MODEL_AMBIENT */ - 1402, /* GL_SHADE_MODEL */ - 189, /* GL_COLOR_MATERIAL_FACE */ - 190, /* GL_COLOR_MATERIAL_PARAMETER */ - 188, /* GL_COLOR_MATERIAL */ - 484, /* GL_FOG */ - 506, /* GL_FOG_INDEX */ - 502, /* GL_FOG_DENSITY */ - 510, /* GL_FOG_START */ - 504, /* GL_FOG_END */ - 507, /* GL_FOG_MODE */ - 486, /* GL_FOG_COLOR */ - 356, /* GL_DEPTH_RANGE */ - 363, /* GL_DEPTH_TEST */ - 366, /* GL_DEPTH_WRITEMASK */ - 344, /* GL_DEPTH_CLEAR_VALUE */ - 355, /* GL_DEPTH_FUNC */ + 437, /* GL_DRAW_PIXEL_TOKEN */ + 297, /* GL_COPY_PIXEL_TOKEN */ + 686, /* GL_LINE_RESET_TOKEN */ + 462, /* GL_EXP */ + 463, /* GL_EXP2 */ + 331, /* GL_CW */ + 122, /* GL_CCW */ + 143, /* GL_COEFF */ + 1058, /* GL_ORDER */ + 375, /* GL_DOMAIN */ + 305, /* GL_CURRENT_COLOR */ + 308, /* GL_CURRENT_INDEX */ + 314, /* GL_CURRENT_NORMAL */ + 327, /* GL_CURRENT_TEXTURE_COORDS */ + 319, /* GL_CURRENT_RASTER_COLOR */ + 321, /* GL_CURRENT_RASTER_INDEX */ + 325, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + 322, /* GL_CURRENT_RASTER_POSITION */ + 323, /* GL_CURRENT_RASTER_POSITION_VALID */ + 320, /* GL_CURRENT_RASTER_DISTANCE */ + 1134, /* GL_POINT_SMOOTH */ + 1123, /* GL_POINT_SIZE */ + 1133, /* GL_POINT_SIZE_RANGE */ + 1124, /* GL_POINT_SIZE_GRANULARITY */ + 687, /* GL_LINE_SMOOTH */ + 694, /* GL_LINE_WIDTH */ + 696, /* GL_LINE_WIDTH_RANGE */ + 695, /* GL_LINE_WIDTH_GRANULARITY */ + 689, /* GL_LINE_STIPPLE */ + 690, /* GL_LINE_STIPPLE_PATTERN */ + 691, /* GL_LINE_STIPPLE_REPEAT */ + 701, /* GL_LIST_MODE */ + 860, /* GL_MAX_LIST_NESTING */ + 698, /* GL_LIST_BASE */ + 700, /* GL_LIST_INDEX */ + 1144, /* GL_POLYGON_MODE */ + 1151, /* GL_POLYGON_SMOOTH */ + 1153, /* GL_POLYGON_STIPPLE */ + 448, /* GL_EDGE_FLAG */ + 298, /* GL_CULL_FACE */ + 299, /* GL_CULL_FACE_MODE */ + 569, /* GL_FRONT_FACE */ + 669, /* GL_LIGHTING */ + 674, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 675, /* GL_LIGHT_MODEL_TWO_SIDE */ + 671, /* GL_LIGHT_MODEL_AMBIENT */ + 1396, /* GL_SHADE_MODEL */ + 190, /* GL_COLOR_MATERIAL_FACE */ + 191, /* GL_COLOR_MATERIAL_PARAMETER */ + 189, /* GL_COLOR_MATERIAL */ + 496, /* GL_FOG */ + 518, /* GL_FOG_INDEX */ + 514, /* GL_FOG_DENSITY */ + 522, /* GL_FOG_START */ + 516, /* GL_FOG_END */ + 519, /* GL_FOG_MODE */ + 498, /* GL_FOG_COLOR */ + 362, /* GL_DEPTH_RANGE */ + 369, /* GL_DEPTH_TEST */ + 372, /* GL_DEPTH_WRITEMASK */ + 350, /* GL_DEPTH_CLEAR_VALUE */ + 361, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1487, /* GL_STENCIL_TEST */ - 1475, /* GL_STENCIL_CLEAR_VALUE */ - 1477, /* GL_STENCIL_FUNC */ - 1489, /* GL_STENCIL_VALUE_MASK */ - 1476, /* GL_STENCIL_FAIL */ - 1484, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1485, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1486, /* GL_STENCIL_REF */ - 1490, /* GL_STENCIL_WRITEMASK */ - 841, /* GL_MATRIX_MODE */ - 1009, /* GL_NORMALIZE */ - 1799, /* GL_VIEWPORT */ - 983, /* GL_MODELVIEW_STACK_DEPTH */ - 1242, /* GL_PROJECTION_STACK_DEPTH */ - 1685, /* GL_TEXTURE_STACK_DEPTH */ - 981, /* GL_MODELVIEW_MATRIX */ - 1241, /* GL_PROJECTION_MATRIX */ - 1670, /* GL_TEXTURE_MATRIX */ + 1489, /* GL_STENCIL_TEST */ + 1477, /* GL_STENCIL_CLEAR_VALUE */ + 1479, /* GL_STENCIL_FUNC */ + 1491, /* GL_STENCIL_VALUE_MASK */ + 1478, /* GL_STENCIL_FAIL */ + 1486, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1487, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1488, /* GL_STENCIL_REF */ + 1492, /* GL_STENCIL_WRITEMASK */ + 829, /* GL_MATRIX_MODE */ + 997, /* GL_NORMALIZE */ + 1801, /* GL_VIEWPORT */ + 971, /* GL_MODELVIEW_STACK_DEPTH */ + 1234, /* GL_PROJECTION_STACK_DEPTH */ + 1687, /* GL_TEXTURE_STACK_DEPTH */ + 969, /* GL_MODELVIEW_MATRIX */ + 1233, /* GL_PROJECTION_MATRIX */ + 1672, /* GL_TEXTURE_MATRIX */ 60, /* GL_ATTRIB_STACK_DEPTH */ - 132, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + 133, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 368, /* GL_DITHER */ + 374, /* GL_DITHER */ 77, /* GL_BLEND_DST */ - 85, /* GL_BLEND_SRC */ + 86, /* GL_BLEND_SRC */ 74, /* GL_BLEND */ - 716, /* GL_LOGIC_OP_MODE */ - 635, /* GL_INDEX_LOGIC_OP */ - 187, /* GL_COLOR_LOGIC_OP */ + 704, /* GL_LOGIC_OP_MODE */ + 623, /* GL_INDEX_LOGIC_OP */ + 188, /* GL_COLOR_LOGIC_OP */ 66, /* GL_AUX_BUFFERS */ - 379, /* GL_DRAW_BUFFER */ - 1274, /* GL_READ_BUFFER */ - 1383, /* GL_SCISSOR_BOX */ - 1384, /* GL_SCISSOR_TEST */ - 634, /* GL_INDEX_CLEAR_VALUE */ - 639, /* GL_INDEX_WRITEMASK */ - 184, /* GL_COLOR_CLEAR_VALUE */ - 226, /* GL_COLOR_WRITEMASK */ - 636, /* GL_INDEX_MODE */ - 1350, /* GL_RGBA_MODE */ - 378, /* GL_DOUBLEBUFFER */ - 1491, /* GL_STEREO */ - 1309, /* GL_RENDER_MODE */ - 1094, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1143, /* GL_POINT_SMOOTH_HINT */ - 700, /* GL_LINE_SMOOTH_HINT */ - 1160, /* GL_POLYGON_SMOOTH_HINT */ - 505, /* GL_FOG_HINT */ - 1651, /* GL_TEXTURE_GEN_S */ - 1652, /* GL_TEXTURE_GEN_T */ - 1650, /* GL_TEXTURE_GEN_R */ - 1649, /* GL_TEXTURE_GEN_Q */ - 1107, /* GL_PIXEL_MAP_I_TO_I */ - 1113, /* GL_PIXEL_MAP_S_TO_S */ - 1109, /* GL_PIXEL_MAP_I_TO_R */ - 1105, /* GL_PIXEL_MAP_I_TO_G */ - 1103, /* GL_PIXEL_MAP_I_TO_B */ - 1101, /* GL_PIXEL_MAP_I_TO_A */ - 1111, /* GL_PIXEL_MAP_R_TO_R */ - 1099, /* GL_PIXEL_MAP_G_TO_G */ - 1097, /* GL_PIXEL_MAP_B_TO_B */ - 1095, /* GL_PIXEL_MAP_A_TO_A */ - 1108, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1114, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1110, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1106, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1104, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1102, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1112, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1100, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1098, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1096, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1719, /* GL_UNPACK_SWAP_BYTES */ - 1714, /* GL_UNPACK_LSB_FIRST */ - 1715, /* GL_UNPACK_ROW_LENGTH */ - 1718, /* GL_UNPACK_SKIP_ROWS */ - 1717, /* GL_UNPACK_SKIP_PIXELS */ - 1712, /* GL_UNPACK_ALIGNMENT */ - 1082, /* GL_PACK_SWAP_BYTES */ - 1077, /* GL_PACK_LSB_FIRST */ - 1078, /* GL_PACK_ROW_LENGTH */ - 1081, /* GL_PACK_SKIP_ROWS */ - 1080, /* GL_PACK_SKIP_PIXELS */ - 1074, /* GL_PACK_ALIGNMENT */ - 794, /* GL_MAP_COLOR */ - 795, /* GL_MAP_STENCIL */ - 638, /* GL_INDEX_SHIFT */ - 637, /* GL_INDEX_OFFSET */ - 1287, /* GL_RED_SCALE */ - 1285, /* GL_RED_BIAS */ - 1816, /* GL_ZOOM_X */ - 1817, /* GL_ZOOM_Y */ - 599, /* GL_GREEN_SCALE */ - 597, /* GL_GREEN_BIAS */ - 91, /* GL_BLUE_SCALE */ - 89, /* GL_BLUE_BIAS */ + 385, /* GL_DRAW_BUFFER */ + 1266, /* GL_READ_BUFFER */ + 1377, /* GL_SCISSOR_BOX */ + 1378, /* GL_SCISSOR_TEST */ + 622, /* GL_INDEX_CLEAR_VALUE */ + 627, /* GL_INDEX_WRITEMASK */ + 185, /* GL_COLOR_CLEAR_VALUE */ + 227, /* GL_COLOR_WRITEMASK */ + 624, /* GL_INDEX_MODE */ + 1343, /* GL_RGBA_MODE */ + 384, /* GL_DOUBLEBUFFER */ + 1493, /* GL_STEREO */ + 1301, /* GL_RENDER_MODE */ + 1082, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1135, /* GL_POINT_SMOOTH_HINT */ + 688, /* GL_LINE_SMOOTH_HINT */ + 1152, /* GL_POLYGON_SMOOTH_HINT */ + 517, /* GL_FOG_HINT */ + 1653, /* GL_TEXTURE_GEN_S */ + 1654, /* GL_TEXTURE_GEN_T */ + 1652, /* GL_TEXTURE_GEN_R */ + 1651, /* GL_TEXTURE_GEN_Q */ + 1095, /* GL_PIXEL_MAP_I_TO_I */ + 1101, /* GL_PIXEL_MAP_S_TO_S */ + 1097, /* GL_PIXEL_MAP_I_TO_R */ + 1093, /* GL_PIXEL_MAP_I_TO_G */ + 1091, /* GL_PIXEL_MAP_I_TO_B */ + 1089, /* GL_PIXEL_MAP_I_TO_A */ + 1099, /* GL_PIXEL_MAP_R_TO_R */ + 1087, /* GL_PIXEL_MAP_G_TO_G */ + 1085, /* GL_PIXEL_MAP_B_TO_B */ + 1083, /* GL_PIXEL_MAP_A_TO_A */ + 1096, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1102, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1098, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1094, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1092, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1090, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1100, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1088, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1086, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1084, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1721, /* GL_UNPACK_SWAP_BYTES */ + 1716, /* GL_UNPACK_LSB_FIRST */ + 1717, /* GL_UNPACK_ROW_LENGTH */ + 1720, /* GL_UNPACK_SKIP_ROWS */ + 1719, /* GL_UNPACK_SKIP_PIXELS */ + 1714, /* GL_UNPACK_ALIGNMENT */ + 1070, /* GL_PACK_SWAP_BYTES */ + 1065, /* GL_PACK_LSB_FIRST */ + 1066, /* GL_PACK_ROW_LENGTH */ + 1069, /* GL_PACK_SKIP_ROWS */ + 1068, /* GL_PACK_SKIP_PIXELS */ + 1062, /* GL_PACK_ALIGNMENT */ + 782, /* GL_MAP_COLOR */ + 783, /* GL_MAP_STENCIL */ + 626, /* GL_INDEX_SHIFT */ + 625, /* GL_INDEX_OFFSET */ + 1279, /* GL_RED_SCALE */ + 1277, /* GL_RED_BIAS */ + 1818, /* GL_ZOOM_X */ + 1819, /* GL_ZOOM_Y */ + 587, /* GL_GREEN_SCALE */ + 585, /* GL_GREEN_BIAS */ + 92, /* GL_BLUE_SCALE */ + 90, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 357, /* GL_DEPTH_SCALE */ - 338, /* GL_DEPTH_BIAS */ - 867, /* GL_MAX_EVAL_ORDER */ - 871, /* GL_MAX_LIGHTS */ - 850, /* GL_MAX_CLIP_PLANES */ - 916, /* GL_MAX_TEXTURE_SIZE */ - 877, /* GL_MAX_PIXEL_MAP_TABLE */ - 846, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 874, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 875, /* GL_MAX_NAME_STACK_DEPTH */ - 903, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 917, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 931, /* GL_MAX_VIEWPORT_DIMS */ - 847, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1498, /* GL_SUBPIXEL_BITS */ - 633, /* GL_INDEX_BITS */ - 1286, /* GL_RED_BITS */ - 598, /* GL_GREEN_BITS */ - 90, /* GL_BLUE_BITS */ + 363, /* GL_DEPTH_SCALE */ + 344, /* GL_DEPTH_BIAS */ + 855, /* GL_MAX_EVAL_ORDER */ + 859, /* GL_MAX_LIGHTS */ + 838, /* GL_MAX_CLIP_PLANES */ + 904, /* GL_MAX_TEXTURE_SIZE */ + 865, /* GL_MAX_PIXEL_MAP_TABLE */ + 834, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 862, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 863, /* GL_MAX_NAME_STACK_DEPTH */ + 891, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 905, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 919, /* GL_MAX_VIEWPORT_DIMS */ + 835, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1500, /* GL_SUBPIXEL_BITS */ + 621, /* GL_INDEX_BITS */ + 1278, /* GL_RED_BITS */ + 586, /* GL_GREEN_BITS */ + 91, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 339, /* GL_DEPTH_BITS */ - 1473, /* GL_STENCIL_BITS */ + 345, /* GL_DEPTH_BITS */ + 1475, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 997, /* GL_NAME_STACK_DEPTH */ + 985, /* GL_NAME_STACK_DEPTH */ 61, /* GL_AUTO_NORMAL */ - 740, /* GL_MAP1_COLOR_4 */ - 743, /* GL_MAP1_INDEX */ - 744, /* GL_MAP1_NORMAL */ - 745, /* GL_MAP1_TEXTURE_COORD_1 */ - 746, /* GL_MAP1_TEXTURE_COORD_2 */ - 747, /* GL_MAP1_TEXTURE_COORD_3 */ - 748, /* GL_MAP1_TEXTURE_COORD_4 */ - 749, /* GL_MAP1_VERTEX_3 */ - 750, /* GL_MAP1_VERTEX_4 */ - 767, /* GL_MAP2_COLOR_4 */ - 770, /* GL_MAP2_INDEX */ - 771, /* GL_MAP2_NORMAL */ - 772, /* GL_MAP2_TEXTURE_COORD_1 */ - 773, /* GL_MAP2_TEXTURE_COORD_2 */ - 774, /* GL_MAP2_TEXTURE_COORD_3 */ - 775, /* GL_MAP2_TEXTURE_COORD_4 */ - 776, /* GL_MAP2_VERTEX_3 */ - 777, /* GL_MAP2_VERTEX_4 */ - 741, /* GL_MAP1_GRID_DOMAIN */ - 742, /* GL_MAP1_GRID_SEGMENTS */ - 768, /* GL_MAP2_GRID_DOMAIN */ - 769, /* GL_MAP2_GRID_SEGMENTS */ - 1575, /* GL_TEXTURE_1D */ - 1577, /* GL_TEXTURE_2D */ - 466, /* GL_FEEDBACK_BUFFER_POINTER */ - 467, /* GL_FEEDBACK_BUFFER_SIZE */ - 468, /* GL_FEEDBACK_BUFFER_TYPE */ - 1393, /* GL_SELECTION_BUFFER_POINTER */ - 1394, /* GL_SELECTION_BUFFER_SIZE */ - 1689, /* GL_TEXTURE_WIDTH */ - 1656, /* GL_TEXTURE_HEIGHT */ - 1612, /* GL_TEXTURE_COMPONENTS */ - 1596, /* GL_TEXTURE_BORDER_COLOR */ - 1595, /* GL_TEXTURE_BORDER */ - 370, /* GL_DONT_CARE */ - 464, /* GL_FASTEST */ - 1005, /* GL_NICEST */ + 728, /* GL_MAP1_COLOR_4 */ + 731, /* GL_MAP1_INDEX */ + 732, /* GL_MAP1_NORMAL */ + 733, /* GL_MAP1_TEXTURE_COORD_1 */ + 734, /* GL_MAP1_TEXTURE_COORD_2 */ + 735, /* GL_MAP1_TEXTURE_COORD_3 */ + 736, /* GL_MAP1_TEXTURE_COORD_4 */ + 737, /* GL_MAP1_VERTEX_3 */ + 738, /* GL_MAP1_VERTEX_4 */ + 755, /* GL_MAP2_COLOR_4 */ + 758, /* GL_MAP2_INDEX */ + 759, /* GL_MAP2_NORMAL */ + 760, /* GL_MAP2_TEXTURE_COORD_1 */ + 761, /* GL_MAP2_TEXTURE_COORD_2 */ + 762, /* GL_MAP2_TEXTURE_COORD_3 */ + 763, /* GL_MAP2_TEXTURE_COORD_4 */ + 764, /* GL_MAP2_VERTEX_3 */ + 765, /* GL_MAP2_VERTEX_4 */ + 729, /* GL_MAP1_GRID_DOMAIN */ + 730, /* GL_MAP1_GRID_SEGMENTS */ + 756, /* GL_MAP2_GRID_DOMAIN */ + 757, /* GL_MAP2_GRID_SEGMENTS */ + 1577, /* GL_TEXTURE_1D */ + 1579, /* GL_TEXTURE_2D */ + 472, /* GL_FEEDBACK_BUFFER_POINTER */ + 473, /* GL_FEEDBACK_BUFFER_SIZE */ + 474, /* GL_FEEDBACK_BUFFER_TYPE */ + 1387, /* GL_SELECTION_BUFFER_POINTER */ + 1388, /* GL_SELECTION_BUFFER_SIZE */ + 1691, /* GL_TEXTURE_WIDTH */ + 1658, /* GL_TEXTURE_HEIGHT */ + 1614, /* GL_TEXTURE_COMPONENTS */ + 1598, /* GL_TEXTURE_BORDER_COLOR */ + 1597, /* GL_TEXTURE_BORDER */ + 376, /* GL_DONT_CARE */ + 470, /* GL_FASTEST */ + 993, /* GL_NICEST */ 47, /* GL_AMBIENT */ - 367, /* GL_DIFFUSE */ - 1436, /* GL_SPECULAR */ - 1164, /* GL_POSITION */ - 1439, /* GL_SPOT_DIRECTION */ - 1440, /* GL_SPOT_EXPONENT */ - 1438, /* GL_SPOT_CUTOFF */ - 266, /* GL_CONSTANT_ATTENUATION */ - 690, /* GL_LINEAR_ATTENUATION */ - 1261, /* GL_QUADRATIC_ATTENUATION */ - 240, /* GL_COMPILE */ - 241, /* GL_COMPILE_AND_EXECUTE */ - 116, /* GL_BYTE */ - 1720, /* GL_UNSIGNED_BYTE */ - 1407, /* GL_SHORT */ - 1731, /* GL_UNSIGNED_SHORT */ - 641, /* GL_INT */ - 1723, /* GL_UNSIGNED_INT */ - 471, /* GL_FLOAT */ + 373, /* GL_DIFFUSE */ + 1435, /* GL_SPECULAR */ + 1156, /* GL_POSITION */ + 1438, /* GL_SPOT_DIRECTION */ + 1439, /* GL_SPOT_EXPONENT */ + 1437, /* GL_SPOT_CUTOFF */ + 271, /* GL_CONSTANT_ATTENUATION */ + 678, /* GL_LINEAR_ATTENUATION */ + 1253, /* GL_QUADRATIC_ATTENUATION */ + 241, /* GL_COMPILE */ + 242, /* GL_COMPILE_AND_EXECUTE */ + 117, /* GL_BYTE */ + 1722, /* GL_UNSIGNED_BYTE */ + 1401, /* GL_SHORT */ + 1733, /* GL_UNSIGNED_SHORT */ + 629, /* GL_INT */ + 1725, /* GL_UNSIGNED_INT */ + 477, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 377, /* GL_DOUBLE */ - 128, /* GL_CLEAR */ + 383, /* GL_DOUBLE */ + 129, /* GL_CLEAR */ 49, /* GL_AND */ 51, /* GL_AND_REVERSE */ - 290, /* GL_COPY */ + 295, /* GL_COPY */ 50, /* GL_AND_INVERTED */ - 1007, /* GL_NOOP */ - 1812, /* GL_XOR */ - 1069, /* GL_OR */ - 1008, /* GL_NOR */ - 454, /* GL_EQUIV */ - 668, /* GL_INVERT */ - 1072, /* GL_OR_REVERSE */ - 291, /* GL_COPY_INVERTED */ - 1071, /* GL_OR_INVERTED */ - 998, /* GL_NAND */ - 1398, /* GL_SET */ - 451, /* GL_EMISSION */ - 1406, /* GL_SHININESS */ + 995, /* GL_NOOP */ + 1814, /* GL_XOR */ + 1057, /* GL_OR */ + 996, /* GL_NOR */ + 460, /* GL_EQUIV */ + 656, /* GL_INVERT */ + 1060, /* GL_OR_REVERSE */ + 296, /* GL_COPY_INVERTED */ + 1059, /* GL_OR_INVERTED */ + 986, /* GL_NAND */ + 1392, /* GL_SET */ + 457, /* GL_EMISSION */ + 1400, /* GL_SHININESS */ 48, /* GL_AMBIENT_AND_DIFFUSE */ - 186, /* GL_COLOR_INDEXES */ - 948, /* GL_MODELVIEW */ - 1240, /* GL_PROJECTION */ - 1510, /* GL_TEXTURE */ - 143, /* GL_COLOR */ - 334, /* GL_DEPTH */ - 1459, /* GL_STENCIL */ - 185, /* GL_COLOR_INDEX */ - 1478, /* GL_STENCIL_INDEX */ - 345, /* GL_DEPTH_COMPONENT */ - 1282, /* GL_RED */ - 596, /* GL_GREEN */ - 88, /* GL_BLUE */ + 187, /* GL_COLOR_INDEXES */ + 936, /* GL_MODELVIEW */ + 1232, /* GL_PROJECTION */ + 1512, /* GL_TEXTURE */ + 144, /* GL_COLOR */ + 340, /* GL_DEPTH */ + 1461, /* GL_STENCIL */ + 186, /* GL_COLOR_INDEX */ + 1480, /* GL_STENCIL_INDEX */ + 351, /* GL_DEPTH_COMPONENT */ + 1274, /* GL_RED */ + 584, /* GL_GREEN */ + 89, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1317, /* GL_RGB */ - 1336, /* GL_RGBA */ - 718, /* GL_LUMINANCE */ - 739, /* GL_LUMINANCE_ALPHA */ + 1309, /* GL_RGB */ + 1328, /* GL_RGBA */ + 706, /* GL_LUMINANCE */ + 727, /* GL_LUMINANCE_ALPHA */ 72, /* GL_BITMAP */ - 1120, /* GL_POINT */ - 688, /* GL_LINE */ - 469, /* GL_FILL */ - 1291, /* GL_RENDER */ - 465, /* GL_FEEDBACK */ - 1392, /* GL_SELECT */ - 470, /* GL_FLAT */ - 1411, /* GL_SMOOTH */ - 669, /* GL_KEEP */ - 1311, /* GL_REPLACE */ - 623, /* GL_INCR */ - 330, /* GL_DECR */ - 1746, /* GL_VENDOR */ - 1308, /* GL_RENDERER */ - 1747, /* GL_VERSION */ - 458, /* GL_EXTENSIONS */ - 1357, /* GL_S */ - 1501, /* GL_T */ - 1271, /* GL_R */ - 1260, /* GL_Q */ - 984, /* GL_MODULATE */ - 329, /* GL_DECAL */ - 1646, /* GL_TEXTURE_ENV_MODE */ - 1645, /* GL_TEXTURE_ENV_COLOR */ - 1644, /* GL_TEXTURE_ENV */ - 459, /* GL_EYE_LINEAR */ - 1031, /* GL_OBJECT_LINEAR */ - 1437, /* GL_SPHERE_MAP */ - 1648, /* GL_TEXTURE_GEN_MODE */ - 1033, /* GL_OBJECT_PLANE */ - 460, /* GL_EYE_PLANE */ - 999, /* GL_NEAREST */ - 689, /* GL_LINEAR */ - 1003, /* GL_NEAREST_MIPMAP_NEAREST */ - 694, /* GL_LINEAR_MIPMAP_NEAREST */ - 1002, /* GL_NEAREST_MIPMAP_LINEAR */ - 693, /* GL_LINEAR_MIPMAP_LINEAR */ - 1669, /* GL_TEXTURE_MAG_FILTER */ - 1677, /* GL_TEXTURE_MIN_FILTER */ - 1691, /* GL_TEXTURE_WRAP_S */ - 1692, /* GL_TEXTURE_WRAP_T */ - 122, /* GL_CLAMP */ - 1310, /* GL_REPEAT */ - 1158, /* GL_POLYGON_OFFSET_UNITS */ - 1157, /* GL_POLYGON_OFFSET_POINT */ - 1156, /* GL_POLYGON_OFFSET_LINE */ - 1272, /* GL_R3_G3_B2 */ - 1743, /* GL_V2F */ - 1744, /* GL_V3F */ - 119, /* GL_C4UB_V2F */ - 120, /* GL_C4UB_V3F */ - 117, /* GL_C3F_V3F */ - 996, /* GL_N3F_V3F */ - 118, /* GL_C4F_N3F_V3F */ - 1506, /* GL_T2F_V3F */ - 1508, /* GL_T4F_V4F */ - 1504, /* GL_T2F_C4UB_V3F */ - 1502, /* GL_T2F_C3F_V3F */ - 1505, /* GL_T2F_N3F_V3F */ - 1503, /* GL_T2F_C4F_N3F_V3F */ - 1507, /* GL_T4F_C4F_N3F_V4F */ - 135, /* GL_CLIP_PLANE0 */ - 136, /* GL_CLIP_PLANE1 */ - 137, /* GL_CLIP_PLANE2 */ - 138, /* GL_CLIP_PLANE3 */ - 139, /* GL_CLIP_PLANE4 */ - 140, /* GL_CLIP_PLANE5 */ - 673, /* GL_LIGHT0 */ - 674, /* GL_LIGHT1 */ - 675, /* GL_LIGHT2 */ - 676, /* GL_LIGHT3 */ - 677, /* GL_LIGHT4 */ - 678, /* GL_LIGHT5 */ - 679, /* GL_LIGHT6 */ - 680, /* GL_LIGHT7 */ - 600, /* GL_HINT_BIT */ - 268, /* GL_CONSTANT_COLOR */ - 1043, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 263, /* GL_CONSTANT_ALPHA */ - 1041, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1112, /* GL_POINT */ + 676, /* GL_LINE */ + 475, /* GL_FILL */ + 1283, /* GL_RENDER */ + 471, /* GL_FEEDBACK */ + 1386, /* GL_SELECT */ + 476, /* GL_FLAT */ + 1410, /* GL_SMOOTH */ + 657, /* GL_KEEP */ + 1303, /* GL_REPLACE */ + 611, /* GL_INCR */ + 336, /* GL_DECR */ + 1748, /* GL_VENDOR */ + 1300, /* GL_RENDERER */ + 1749, /* GL_VERSION */ + 464, /* GL_EXTENSIONS */ + 1351, /* GL_S */ + 1503, /* GL_T */ + 1263, /* GL_R */ + 1252, /* GL_Q */ + 972, /* GL_MODULATE */ + 335, /* GL_DECAL */ + 1648, /* GL_TEXTURE_ENV_MODE */ + 1647, /* GL_TEXTURE_ENV_COLOR */ + 1646, /* GL_TEXTURE_ENV */ + 465, /* GL_EYE_LINEAR */ + 1019, /* GL_OBJECT_LINEAR */ + 1436, /* GL_SPHERE_MAP */ + 1650, /* GL_TEXTURE_GEN_MODE */ + 1021, /* GL_OBJECT_PLANE */ + 466, /* GL_EYE_PLANE */ + 987, /* GL_NEAREST */ + 677, /* GL_LINEAR */ + 991, /* GL_NEAREST_MIPMAP_NEAREST */ + 682, /* GL_LINEAR_MIPMAP_NEAREST */ + 990, /* GL_NEAREST_MIPMAP_LINEAR */ + 681, /* GL_LINEAR_MIPMAP_LINEAR */ + 1671, /* GL_TEXTURE_MAG_FILTER */ + 1679, /* GL_TEXTURE_MIN_FILTER */ + 1693, /* GL_TEXTURE_WRAP_S */ + 1694, /* GL_TEXTURE_WRAP_T */ + 123, /* GL_CLAMP */ + 1302, /* GL_REPEAT */ + 1150, /* GL_POLYGON_OFFSET_UNITS */ + 1149, /* GL_POLYGON_OFFSET_POINT */ + 1148, /* GL_POLYGON_OFFSET_LINE */ + 1264, /* GL_R3_G3_B2 */ + 1745, /* GL_V2F */ + 1746, /* GL_V3F */ + 120, /* GL_C4UB_V2F */ + 121, /* GL_C4UB_V3F */ + 118, /* GL_C3F_V3F */ + 984, /* GL_N3F_V3F */ + 119, /* GL_C4F_N3F_V3F */ + 1508, /* GL_T2F_V3F */ + 1510, /* GL_T4F_V4F */ + 1506, /* GL_T2F_C4UB_V3F */ + 1504, /* GL_T2F_C3F_V3F */ + 1507, /* GL_T2F_N3F_V3F */ + 1505, /* GL_T2F_C4F_N3F_V3F */ + 1509, /* GL_T4F_C4F_N3F_V4F */ + 136, /* GL_CLIP_PLANE0 */ + 137, /* GL_CLIP_PLANE1 */ + 138, /* GL_CLIP_PLANE2 */ + 139, /* GL_CLIP_PLANE3 */ + 140, /* GL_CLIP_PLANE4 */ + 141, /* GL_CLIP_PLANE5 */ + 661, /* GL_LIGHT0 */ + 662, /* GL_LIGHT1 */ + 663, /* GL_LIGHT2 */ + 664, /* GL_LIGHT3 */ + 665, /* GL_LIGHT4 */ + 666, /* GL_LIGHT5 */ + 667, /* GL_LIGHT6 */ + 668, /* GL_LIGHT7 */ + 588, /* GL_HINT_BIT */ + 273, /* GL_CONSTANT_COLOR */ + 1031, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 268, /* GL_CONSTANT_ALPHA */ + 1029, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 75, /* GL_BLEND_COLOR */ - 560, /* GL_FUNC_ADD */ - 932, /* GL_MIN */ - 843, /* GL_MAX */ + 572, /* GL_FUNC_ADD */ + 920, /* GL_MIN */ + 831, /* GL_MAX */ 80, /* GL_BLEND_EQUATION */ - 564, /* GL_FUNC_SUBTRACT */ - 562, /* GL_FUNC_REVERSE_SUBTRACT */ - 271, /* GL_CONVOLUTION_1D */ - 272, /* GL_CONVOLUTION_2D */ - 1395, /* GL_SEPARABLE_2D */ - 275, /* GL_CONVOLUTION_BORDER_MODE */ - 279, /* GL_CONVOLUTION_FILTER_SCALE */ - 277, /* GL_CONVOLUTION_FILTER_BIAS */ - 1283, /* GL_REDUCE */ - 281, /* GL_CONVOLUTION_FORMAT */ - 285, /* GL_CONVOLUTION_WIDTH */ - 283, /* GL_CONVOLUTION_HEIGHT */ - 858, /* GL_MAX_CONVOLUTION_WIDTH */ - 856, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1197, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1193, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1188, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1184, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1195, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1191, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1186, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1182, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 601, /* GL_HISTOGRAM */ - 1244, /* GL_PROXY_HISTOGRAM */ - 617, /* GL_HISTOGRAM_WIDTH */ - 607, /* GL_HISTOGRAM_FORMAT */ - 613, /* GL_HISTOGRAM_RED_SIZE */ - 609, /* GL_HISTOGRAM_GREEN_SIZE */ - 604, /* GL_HISTOGRAM_BLUE_SIZE */ - 602, /* GL_HISTOGRAM_ALPHA_SIZE */ - 611, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 615, /* GL_HISTOGRAM_SINK */ - 933, /* GL_MINMAX */ - 935, /* GL_MINMAX_FORMAT */ - 937, /* GL_MINMAX_SINK */ - 1509, /* GL_TABLE_TOO_LARGE_EXT */ - 1722, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1733, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1735, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1728, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1724, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1155, /* GL_POLYGON_OFFSET_FILL */ - 1154, /* GL_POLYGON_OFFSET_FACTOR */ - 1153, /* GL_POLYGON_OFFSET_BIAS */ - 1314, /* GL_RESCALE_NORMAL */ + 576, /* GL_FUNC_SUBTRACT */ + 574, /* GL_FUNC_REVERSE_SUBTRACT */ + 276, /* GL_CONVOLUTION_1D */ + 277, /* GL_CONVOLUTION_2D */ + 1389, /* GL_SEPARABLE_2D */ + 280, /* GL_CONVOLUTION_BORDER_MODE */ + 284, /* GL_CONVOLUTION_FILTER_SCALE */ + 282, /* GL_CONVOLUTION_FILTER_BIAS */ + 1275, /* GL_REDUCE */ + 286, /* GL_CONVOLUTION_FORMAT */ + 290, /* GL_CONVOLUTION_WIDTH */ + 288, /* GL_CONVOLUTION_HEIGHT */ + 846, /* GL_MAX_CONVOLUTION_WIDTH */ + 844, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1189, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1185, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1180, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1176, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1187, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1183, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1178, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1174, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 589, /* GL_HISTOGRAM */ + 1236, /* GL_PROXY_HISTOGRAM */ + 605, /* GL_HISTOGRAM_WIDTH */ + 595, /* GL_HISTOGRAM_FORMAT */ + 601, /* GL_HISTOGRAM_RED_SIZE */ + 597, /* GL_HISTOGRAM_GREEN_SIZE */ + 592, /* GL_HISTOGRAM_BLUE_SIZE */ + 590, /* GL_HISTOGRAM_ALPHA_SIZE */ + 599, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 603, /* GL_HISTOGRAM_SINK */ + 921, /* GL_MINMAX */ + 923, /* GL_MINMAX_FORMAT */ + 925, /* GL_MINMAX_SINK */ + 1511, /* GL_TABLE_TOO_LARGE_EXT */ + 1724, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1735, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1737, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1730, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1726, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1147, /* GL_POLYGON_OFFSET_FILL */ + 1146, /* GL_POLYGON_OFFSET_FACTOR */ + 1145, /* GL_POLYGON_OFFSET_BIAS */ + 1306, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 729, /* GL_LUMINANCE4 */ - 735, /* GL_LUMINANCE8 */ - 719, /* GL_LUMINANCE12 */ - 725, /* GL_LUMINANCE16 */ - 730, /* GL_LUMINANCE4_ALPHA4 */ - 733, /* GL_LUMINANCE6_ALPHA2 */ - 736, /* GL_LUMINANCE8_ALPHA8 */ - 722, /* GL_LUMINANCE12_ALPHA4 */ - 720, /* GL_LUMINANCE12_ALPHA12 */ - 726, /* GL_LUMINANCE16_ALPHA16 */ - 642, /* GL_INTENSITY */ - 647, /* GL_INTENSITY4 */ - 649, /* GL_INTENSITY8 */ - 643, /* GL_INTENSITY12 */ - 645, /* GL_INTENSITY16 */ - 1326, /* GL_RGB2_EXT */ - 1327, /* GL_RGB4 */ - 1330, /* GL_RGB5 */ - 1334, /* GL_RGB8 */ - 1318, /* GL_RGB10 */ - 1322, /* GL_RGB12 */ - 1324, /* GL_RGB16 */ - 1341, /* GL_RGBA2 */ - 1343, /* GL_RGBA4 */ - 1331, /* GL_RGB5_A1 */ - 1347, /* GL_RGBA8 */ - 1319, /* GL_RGB10_A2 */ - 1337, /* GL_RGBA12 */ - 1339, /* GL_RGBA16 */ - 1682, /* GL_TEXTURE_RED_SIZE */ - 1654, /* GL_TEXTURE_GREEN_SIZE */ - 1593, /* GL_TEXTURE_BLUE_SIZE */ - 1580, /* GL_TEXTURE_ALPHA_SIZE */ - 1667, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1658, /* GL_TEXTURE_INTENSITY_SIZE */ - 1312, /* GL_REPLACE_EXT */ - 1248, /* GL_PROXY_TEXTURE_1D */ - 1251, /* GL_PROXY_TEXTURE_2D */ - 1687, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1679, /* GL_TEXTURE_PRIORITY */ - 1684, /* GL_TEXTURE_RESIDENT */ - 1583, /* GL_TEXTURE_BINDING_1D */ - 1585, /* GL_TEXTURE_BINDING_2D */ - 1587, /* GL_TEXTURE_BINDING_3D */ - 1079, /* GL_PACK_SKIP_IMAGES */ - 1075, /* GL_PACK_IMAGE_HEIGHT */ - 1716, /* GL_UNPACK_SKIP_IMAGES */ - 1713, /* GL_UNPACK_IMAGE_HEIGHT */ - 1579, /* GL_TEXTURE_3D */ - 1254, /* GL_PROXY_TEXTURE_3D */ - 1641, /* GL_TEXTURE_DEPTH */ - 1690, /* GL_TEXTURE_WRAP_R */ - 844, /* GL_MAX_3D_TEXTURE_SIZE */ - 1748, /* GL_VERTEX_ARRAY */ - 1010, /* GL_NORMAL_ARRAY */ - 144, /* GL_COLOR_ARRAY */ - 627, /* GL_INDEX_ARRAY */ - 1620, /* GL_TEXTURE_COORD_ARRAY */ - 443, /* GL_EDGE_FLAG_ARRAY */ - 1753, /* GL_VERTEX_ARRAY_SIZE */ - 1755, /* GL_VERTEX_ARRAY_TYPE */ - 1754, /* GL_VERTEX_ARRAY_STRIDE */ - 1015, /* GL_NORMAL_ARRAY_TYPE */ - 1014, /* GL_NORMAL_ARRAY_STRIDE */ - 148, /* GL_COLOR_ARRAY_SIZE */ - 150, /* GL_COLOR_ARRAY_TYPE */ - 149, /* GL_COLOR_ARRAY_STRIDE */ - 632, /* GL_INDEX_ARRAY_TYPE */ - 631, /* GL_INDEX_ARRAY_STRIDE */ - 1624, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1626, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1625, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 447, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1752, /* GL_VERTEX_ARRAY_POINTER */ - 1013, /* GL_NORMAL_ARRAY_POINTER */ - 147, /* GL_COLOR_ARRAY_POINTER */ - 630, /* GL_INDEX_ARRAY_POINTER */ - 1623, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 446, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 989, /* GL_MULTISAMPLE */ - 1369, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1371, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1376, /* GL_SAMPLE_COVERAGE */ - 1373, /* GL_SAMPLE_BUFFERS */ - 1364, /* GL_SAMPLES */ - 1380, /* GL_SAMPLE_COVERAGE_VALUE */ - 1378, /* GL_SAMPLE_COVERAGE_INVERT */ - 191, /* GL_COLOR_MATRIX */ - 193, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 852, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1180, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1176, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1171, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1167, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1178, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1174, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1169, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1165, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1603, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1255, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1605, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 717, /* GL_LUMINANCE4 */ + 723, /* GL_LUMINANCE8 */ + 707, /* GL_LUMINANCE12 */ + 713, /* GL_LUMINANCE16 */ + 718, /* GL_LUMINANCE4_ALPHA4 */ + 721, /* GL_LUMINANCE6_ALPHA2 */ + 724, /* GL_LUMINANCE8_ALPHA8 */ + 710, /* GL_LUMINANCE12_ALPHA4 */ + 708, /* GL_LUMINANCE12_ALPHA12 */ + 714, /* GL_LUMINANCE16_ALPHA16 */ + 630, /* GL_INTENSITY */ + 635, /* GL_INTENSITY4 */ + 637, /* GL_INTENSITY8 */ + 631, /* GL_INTENSITY12 */ + 633, /* GL_INTENSITY16 */ + 1318, /* GL_RGB2_EXT */ + 1319, /* GL_RGB4 */ + 1322, /* GL_RGB5 */ + 1326, /* GL_RGB8 */ + 1310, /* GL_RGB10 */ + 1314, /* GL_RGB12 */ + 1316, /* GL_RGB16 */ + 1333, /* GL_RGBA2 */ + 1335, /* GL_RGBA4 */ + 1323, /* GL_RGB5_A1 */ + 1339, /* GL_RGBA8 */ + 1311, /* GL_RGB10_A2 */ + 1329, /* GL_RGBA12 */ + 1331, /* GL_RGBA16 */ + 1684, /* GL_TEXTURE_RED_SIZE */ + 1656, /* GL_TEXTURE_GREEN_SIZE */ + 1595, /* GL_TEXTURE_BLUE_SIZE */ + 1582, /* GL_TEXTURE_ALPHA_SIZE */ + 1669, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1660, /* GL_TEXTURE_INTENSITY_SIZE */ + 1304, /* GL_REPLACE_EXT */ + 1240, /* GL_PROXY_TEXTURE_1D */ + 1243, /* GL_PROXY_TEXTURE_2D */ + 1689, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1681, /* GL_TEXTURE_PRIORITY */ + 1686, /* GL_TEXTURE_RESIDENT */ + 1585, /* GL_TEXTURE_BINDING_1D */ + 1587, /* GL_TEXTURE_BINDING_2D */ + 1589, /* GL_TEXTURE_BINDING_3D */ + 1067, /* GL_PACK_SKIP_IMAGES */ + 1063, /* GL_PACK_IMAGE_HEIGHT */ + 1718, /* GL_UNPACK_SKIP_IMAGES */ + 1715, /* GL_UNPACK_IMAGE_HEIGHT */ + 1581, /* GL_TEXTURE_3D */ + 1246, /* GL_PROXY_TEXTURE_3D */ + 1643, /* GL_TEXTURE_DEPTH */ + 1692, /* GL_TEXTURE_WRAP_R */ + 832, /* GL_MAX_3D_TEXTURE_SIZE */ + 1750, /* GL_VERTEX_ARRAY */ + 998, /* GL_NORMAL_ARRAY */ + 145, /* GL_COLOR_ARRAY */ + 615, /* GL_INDEX_ARRAY */ + 1622, /* GL_TEXTURE_COORD_ARRAY */ + 449, /* GL_EDGE_FLAG_ARRAY */ + 1755, /* GL_VERTEX_ARRAY_SIZE */ + 1757, /* GL_VERTEX_ARRAY_TYPE */ + 1756, /* GL_VERTEX_ARRAY_STRIDE */ + 1003, /* GL_NORMAL_ARRAY_TYPE */ + 1002, /* GL_NORMAL_ARRAY_STRIDE */ + 149, /* GL_COLOR_ARRAY_SIZE */ + 151, /* GL_COLOR_ARRAY_TYPE */ + 150, /* GL_COLOR_ARRAY_STRIDE */ + 620, /* GL_INDEX_ARRAY_TYPE */ + 619, /* GL_INDEX_ARRAY_STRIDE */ + 1626, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1628, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1627, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 453, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1754, /* GL_VERTEX_ARRAY_POINTER */ + 1001, /* GL_NORMAL_ARRAY_POINTER */ + 148, /* GL_COLOR_ARRAY_POINTER */ + 618, /* GL_INDEX_ARRAY_POINTER */ + 1625, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 452, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 977, /* GL_MULTISAMPLE */ + 1363, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1365, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1370, /* GL_SAMPLE_COVERAGE */ + 1367, /* GL_SAMPLE_BUFFERS */ + 1358, /* GL_SAMPLES */ + 1374, /* GL_SAMPLE_COVERAGE_VALUE */ + 1372, /* GL_SAMPLE_COVERAGE_INVERT */ + 192, /* GL_COLOR_MATRIX */ + 194, /* GL_COLOR_MATRIX_STACK_DEPTH */ + 840, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1172, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1168, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1163, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1159, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1170, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1166, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1161, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1157, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1605, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1247, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1607, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 79, /* GL_BLEND_DST_RGB */ - 87, /* GL_BLEND_SRC_RGB */ + 88, /* GL_BLEND_SRC_RGB */ 78, /* GL_BLEND_DST_ALPHA */ - 86, /* GL_BLEND_SRC_ALPHA */ - 197, /* GL_COLOR_TABLE */ - 1190, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1173, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1243, /* GL_PROXY_COLOR_TABLE */ - 1247, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1246, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - 221, /* GL_COLOR_TABLE_SCALE */ - 201, /* GL_COLOR_TABLE_BIAS */ - 206, /* GL_COLOR_TABLE_FORMAT */ - 223, /* GL_COLOR_TABLE_WIDTH */ - 218, /* GL_COLOR_TABLE_RED_SIZE */ - 209, /* GL_COLOR_TABLE_GREEN_SIZE */ - 203, /* GL_COLOR_TABLE_BLUE_SIZE */ - 198, /* GL_COLOR_TABLE_ALPHA_SIZE */ - 215, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - 212, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + 87, /* GL_BLEND_SRC_ALPHA */ + 198, /* GL_COLOR_TABLE */ + 1182, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1165, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1235, /* GL_PROXY_COLOR_TABLE */ + 1239, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1238, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 222, /* GL_COLOR_TABLE_SCALE */ + 202, /* GL_COLOR_TABLE_BIAS */ + 207, /* GL_COLOR_TABLE_FORMAT */ + 224, /* GL_COLOR_TABLE_WIDTH */ + 219, /* GL_COLOR_TABLE_RED_SIZE */ + 210, /* GL_COLOR_TABLE_GREEN_SIZE */ + 204, /* GL_COLOR_TABLE_BLUE_SIZE */ + 199, /* GL_COLOR_TABLE_ALPHA_SIZE */ + 216, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + 213, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 70, /* GL_BGR */ 71, /* GL_BGRA */ - 866, /* GL_MAX_ELEMENTS_VERTICES */ - 865, /* GL_MAX_ELEMENTS_INDICES */ - 1657, /* GL_TEXTURE_INDEX_SIZE_EXT */ - 141, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1137, /* GL_POINT_SIZE_MIN */ - 1133, /* GL_POINT_SIZE_MAX */ - 1127, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1123, /* GL_POINT_DISTANCE_ATTENUATION */ - 123, /* GL_CLAMP_TO_BORDER */ - 126, /* GL_CLAMP_TO_EDGE */ - 1678, /* GL_TEXTURE_MIN_LOD */ - 1676, /* GL_TEXTURE_MAX_LOD */ - 1582, /* GL_TEXTURE_BASE_LEVEL */ - 1675, /* GL_TEXTURE_MAX_LEVEL */ - 620, /* GL_IGNORE_BORDER_HP */ - 267, /* GL_CONSTANT_BORDER_HP */ - 1313, /* GL_REPLICATE_BORDER_HP */ - 273, /* GL_CONVOLUTION_BORDER_COLOR */ - 1038, /* GL_OCCLUSION_TEST_HP */ - 1039, /* GL_OCCLUSION_TEST_RESULT_HP */ - 691, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1597, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1599, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1601, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1602, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1600, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1598, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 848, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 849, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1200, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1202, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1199, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1201, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1665, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1666, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1664, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 566, /* GL_GENERATE_MIPMAP */ - 567, /* GL_GENERATE_MIPMAP_HINT */ - 508, /* GL_FOG_OFFSET_SGIX */ - 509, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1611, /* GL_TEXTURE_COMPARE_SGIX */ - 1610, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1661, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1653, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 346, /* GL_DEPTH_COMPONENT16 */ - 349, /* GL_DEPTH_COMPONENT24 */ - 352, /* GL_DEPTH_COMPONENT32 */ - 295, /* GL_CULL_VERTEX_EXT */ - 297, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - 296, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1809, /* GL_WRAP_BORDER_SUN */ - 1604, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 684, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1408, /* GL_SINGLE_COLOR */ - 1396, /* GL_SEPARATE_SPECULAR_COLOR */ - 1405, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 519, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - 520, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - 527, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - 522, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - 518, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - 517, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - 521, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - 528, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - 539, /* GL_FRAMEBUFFER_DEFAULT */ - 552, /* GL_FRAMEBUFFER_UNDEFINED */ - 359, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 626, /* GL_INDEX */ - 1721, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1736, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1737, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1734, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1732, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1729, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1727, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1673, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1674, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1672, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 940, /* GL_MIRRORED_REPEAT */ - 1352, /* GL_RGB_S3TC */ - 1329, /* GL_RGB4_S3TC */ - 1351, /* GL_RGBA_S3TC */ - 1346, /* GL_RGBA4_S3TC */ - 1349, /* GL_RGBA_DXT5_S3TC */ - 1344, /* GL_RGBA4_DXT5_S3TC */ - 260, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - 255, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - 256, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - 257, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1001, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1000, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 692, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 495, /* GL_FOG_COORDINATE_SOURCE */ - 487, /* GL_FOG_COORD */ - 511, /* GL_FRAGMENT_DEPTH */ - 301, /* GL_CURRENT_FOG_COORD */ - 494, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 493, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 492, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 489, /* GL_FOG_COORDINATE_ARRAY */ - 195, /* GL_COLOR_SUM */ - 320, /* GL_CURRENT_SECONDARY_COLOR */ - 1389, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1391, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1390, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1388, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1385, /* GL_SECONDARY_COLOR_ARRAY */ - 576, /* GL_GL_CURRENT_RASTER_SECONDARY_COLOR */ + 854, /* GL_MAX_ELEMENTS_VERTICES */ + 853, /* GL_MAX_ELEMENTS_INDICES */ + 1659, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 142, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + 1129, /* GL_POINT_SIZE_MIN */ + 1125, /* GL_POINT_SIZE_MAX */ + 1119, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1115, /* GL_POINT_DISTANCE_ATTENUATION */ + 124, /* GL_CLAMP_TO_BORDER */ + 127, /* GL_CLAMP_TO_EDGE */ + 1680, /* GL_TEXTURE_MIN_LOD */ + 1678, /* GL_TEXTURE_MAX_LOD */ + 1584, /* GL_TEXTURE_BASE_LEVEL */ + 1677, /* GL_TEXTURE_MAX_LEVEL */ + 608, /* GL_IGNORE_BORDER_HP */ + 272, /* GL_CONSTANT_BORDER_HP */ + 1305, /* GL_REPLICATE_BORDER_HP */ + 278, /* GL_CONVOLUTION_BORDER_COLOR */ + 1026, /* GL_OCCLUSION_TEST_HP */ + 1027, /* GL_OCCLUSION_TEST_RESULT_HP */ + 679, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1599, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1601, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1603, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1604, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1602, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1600, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 836, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 837, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1192, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1194, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1191, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1193, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1667, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1668, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1666, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 578, /* GL_GENERATE_MIPMAP */ + 579, /* GL_GENERATE_MIPMAP_HINT */ + 520, /* GL_FOG_OFFSET_SGIX */ + 521, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1613, /* GL_TEXTURE_COMPARE_SGIX */ + 1612, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1663, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1655, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 352, /* GL_DEPTH_COMPONENT16 */ + 355, /* GL_DEPTH_COMPONENT24 */ + 358, /* GL_DEPTH_COMPONENT32 */ + 300, /* GL_CULL_VERTEX_EXT */ + 302, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + 301, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + 1811, /* GL_WRAP_BORDER_SUN */ + 1606, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 672, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1403, /* GL_SINGLE_COLOR */ + 1390, /* GL_SEPARATE_SPECULAR_COLOR */ + 1399, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 531, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 532, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 539, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 534, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 530, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 529, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 533, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 540, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 551, /* GL_FRAMEBUFFER_DEFAULT */ + 564, /* GL_FRAMEBUFFER_UNDEFINED */ + 365, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 614, /* GL_INDEX */ + 1723, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1738, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1739, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1736, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1734, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1731, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1729, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1675, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1676, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1674, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 928, /* GL_MIRRORED_REPEAT */ + 1346, /* GL_RGB_S3TC */ + 1321, /* GL_RGB4_S3TC */ + 1344, /* GL_RGBA_S3TC */ + 1338, /* GL_RGBA4_S3TC */ + 1342, /* GL_RGBA_DXT5_S3TC */ + 1336, /* GL_RGBA4_DXT5_S3TC */ + 261, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + 256, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + 257, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + 258, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + 989, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 988, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 680, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 507, /* GL_FOG_COORDINATE_SOURCE */ + 499, /* GL_FOG_COORD */ + 523, /* GL_FRAGMENT_DEPTH */ + 306, /* GL_CURRENT_FOG_COORD */ + 506, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 505, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 504, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 501, /* GL_FOG_COORDINATE_ARRAY */ + 196, /* GL_COLOR_SUM */ + 326, /* GL_CURRENT_SECONDARY_COLOR */ + 1383, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1385, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1384, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1382, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1379, /* GL_SECONDARY_COLOR_ARRAY */ + 324, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1511, /* GL_TEXTURE0 */ - 1513, /* GL_TEXTURE1 */ - 1535, /* GL_TEXTURE2 */ - 1557, /* GL_TEXTURE3 */ - 1563, /* GL_TEXTURE4 */ - 1565, /* GL_TEXTURE5 */ - 1567, /* GL_TEXTURE6 */ - 1569, /* GL_TEXTURE7 */ - 1571, /* GL_TEXTURE8 */ - 1573, /* GL_TEXTURE9 */ - 1514, /* GL_TEXTURE10 */ - 1516, /* GL_TEXTURE11 */ - 1518, /* GL_TEXTURE12 */ - 1520, /* GL_TEXTURE13 */ - 1522, /* GL_TEXTURE14 */ - 1524, /* GL_TEXTURE15 */ - 1526, /* GL_TEXTURE16 */ - 1528, /* GL_TEXTURE17 */ - 1530, /* GL_TEXTURE18 */ - 1532, /* GL_TEXTURE19 */ - 1536, /* GL_TEXTURE20 */ - 1538, /* GL_TEXTURE21 */ - 1540, /* GL_TEXTURE22 */ - 1542, /* GL_TEXTURE23 */ - 1544, /* GL_TEXTURE24 */ - 1546, /* GL_TEXTURE25 */ - 1548, /* GL_TEXTURE26 */ - 1550, /* GL_TEXTURE27 */ - 1552, /* GL_TEXTURE28 */ - 1554, /* GL_TEXTURE29 */ - 1558, /* GL_TEXTURE30 */ - 1560, /* GL_TEXTURE31 */ + 1513, /* GL_TEXTURE0 */ + 1515, /* GL_TEXTURE1 */ + 1537, /* GL_TEXTURE2 */ + 1559, /* GL_TEXTURE3 */ + 1565, /* GL_TEXTURE4 */ + 1567, /* GL_TEXTURE5 */ + 1569, /* GL_TEXTURE6 */ + 1571, /* GL_TEXTURE7 */ + 1573, /* GL_TEXTURE8 */ + 1575, /* GL_TEXTURE9 */ + 1516, /* GL_TEXTURE10 */ + 1518, /* GL_TEXTURE11 */ + 1520, /* GL_TEXTURE12 */ + 1522, /* GL_TEXTURE13 */ + 1524, /* GL_TEXTURE14 */ + 1526, /* GL_TEXTURE15 */ + 1528, /* GL_TEXTURE16 */ + 1530, /* GL_TEXTURE17 */ + 1532, /* GL_TEXTURE18 */ + 1534, /* GL_TEXTURE19 */ + 1538, /* GL_TEXTURE20 */ + 1540, /* GL_TEXTURE21 */ + 1542, /* GL_TEXTURE22 */ + 1544, /* GL_TEXTURE23 */ + 1546, /* GL_TEXTURE24 */ + 1548, /* GL_TEXTURE25 */ + 1550, /* GL_TEXTURE26 */ + 1552, /* GL_TEXTURE27 */ + 1554, /* GL_TEXTURE28 */ + 1556, /* GL_TEXTURE29 */ + 1560, /* GL_TEXTURE30 */ + 1562, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ - 129, /* GL_CLIENT_ACTIVE_TEXTURE */ - 918, /* GL_MAX_TEXTURE_UNITS */ - 1700, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1703, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1705, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1697, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1499, /* GL_SUBTRACT */ - 906, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - 243, /* GL_COMPRESSED_ALPHA */ - 247, /* GL_COMPRESSED_LUMINANCE */ - 248, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - 245, /* GL_COMPRESSED_INTENSITY */ - 251, /* GL_COMPRESSED_RGB */ - 252, /* GL_COMPRESSED_RGBA */ - 1618, /* GL_TEXTURE_COMPRESSION_HINT */ - 1680, /* GL_TEXTURE_RECTANGLE_ARB */ - 1590, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1258, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 904, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 358, /* GL_DEPTH_STENCIL */ - 1725, /* GL_UNSIGNED_INT_24_8 */ - 914, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1671, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 915, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1647, /* GL_TEXTURE_FILTER_CONTROL */ - 1662, /* GL_TEXTURE_LOD_BIAS */ - 228, /* GL_COMBINE4 */ - 908, /* GL_MAX_SHININESS_NV */ - 909, /* GL_MAX_SPOT_EXPONENT_NV */ - 624, /* GL_INCR_WRAP */ - 331, /* GL_DECR_WRAP */ - 960, /* GL_MODELVIEW1_ARB */ - 1016, /* GL_NORMAL_MAP */ - 1288, /* GL_REFLECTION_MAP */ - 1627, /* GL_TEXTURE_CUBE_MAP */ - 1588, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1635, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1629, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1637, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1631, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1639, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1633, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1256, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 860, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 995, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 503, /* GL_FOG_DISTANCE_MODE_NV */ - 462, /* GL_EYE_RADIAL_NV */ - 461, /* GL_EYE_PLANE_ABSOLUTE_NV */ - 227, /* GL_COMBINE */ - 234, /* GL_COMBINE_RGB */ - 229, /* GL_COMBINE_ALPHA */ - 1353, /* GL_RGB_SCALE */ + 130, /* GL_CLIENT_ACTIVE_TEXTURE */ + 906, /* GL_MAX_TEXTURE_UNITS */ + 1702, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1705, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1707, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1699, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1501, /* GL_SUBTRACT */ + 894, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 244, /* GL_COMPRESSED_ALPHA */ + 248, /* GL_COMPRESSED_LUMINANCE */ + 249, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + 246, /* GL_COMPRESSED_INTENSITY */ + 252, /* GL_COMPRESSED_RGB */ + 253, /* GL_COMPRESSED_RGBA */ + 1620, /* GL_TEXTURE_COMPRESSION_HINT */ + 1682, /* GL_TEXTURE_RECTANGLE_ARB */ + 1592, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1250, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 892, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 364, /* GL_DEPTH_STENCIL */ + 1727, /* GL_UNSIGNED_INT_24_8 */ + 902, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1673, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 903, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1649, /* GL_TEXTURE_FILTER_CONTROL */ + 1664, /* GL_TEXTURE_LOD_BIAS */ + 229, /* GL_COMBINE4 */ + 896, /* GL_MAX_SHININESS_NV */ + 897, /* GL_MAX_SPOT_EXPONENT_NV */ + 612, /* GL_INCR_WRAP */ + 337, /* GL_DECR_WRAP */ + 948, /* GL_MODELVIEW1_ARB */ + 1004, /* GL_NORMAL_MAP */ + 1280, /* GL_REFLECTION_MAP */ + 1629, /* GL_TEXTURE_CUBE_MAP */ + 1590, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1637, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1631, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1639, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1633, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1641, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1635, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1248, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 848, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 983, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 515, /* GL_FOG_DISTANCE_MODE_NV */ + 468, /* GL_EYE_RADIAL_NV */ + 467, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 228, /* GL_COMBINE */ + 235, /* GL_COMBINE_RGB */ + 230, /* GL_COMBINE_ALPHA */ + 1347, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 652, /* GL_INTERPOLATE */ - 262, /* GL_CONSTANT */ - 1206, /* GL_PRIMARY_COLOR */ - 1203, /* GL_PREVIOUS */ - 1419, /* GL_SOURCE0_RGB */ - 1425, /* GL_SOURCE1_RGB */ - 1431, /* GL_SOURCE2_RGB */ - 1435, /* GL_SOURCE3_RGB_NV */ - 1416, /* GL_SOURCE0_ALPHA */ - 1422, /* GL_SOURCE1_ALPHA */ - 1428, /* GL_SOURCE2_ALPHA */ - 1434, /* GL_SOURCE3_ALPHA_NV */ - 1052, /* GL_OPERAND0_RGB */ - 1058, /* GL_OPERAND1_RGB */ - 1064, /* GL_OPERAND2_RGB */ - 1068, /* GL_OPERAND3_RGB_NV */ - 1049, /* GL_OPERAND0_ALPHA */ - 1055, /* GL_OPERAND1_ALPHA */ - 1061, /* GL_OPERAND2_ALPHA */ - 1067, /* GL_OPERAND3_ALPHA_NV */ - 1749, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - 1813, /* GL_YCBCR_422_APPLE */ - 1738, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1740, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1410, /* GL_SLICE_ACCUM_SUN */ - 1263, /* GL_QUAD_MESH_SUN */ - 1709, /* GL_TRIANGLE_MESH_SUN */ - 1787, /* GL_VERTEX_PROGRAM_ARB */ - 1798, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1774, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1780, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1782, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1784, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - 322, /* GL_CURRENT_VERTEX_ATTRIB */ - 1219, /* GL_PROGRAM_LENGTH_ARB */ - 1233, /* GL_PROGRAM_STRING_ARB */ - 982, /* GL_MODELVIEW_PROJECTION_NV */ - 619, /* GL_IDENTITY_NV */ - 666, /* GL_INVERSE_NV */ - 1702, /* GL_TRANSPOSE_NV */ - 667, /* GL_INVERSE_TRANSPOSE_NV */ - 890, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 889, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 797, /* GL_MATRIX0_NV */ - 809, /* GL_MATRIX1_NV */ - 821, /* GL_MATRIX2_NV */ - 825, /* GL_MATRIX3_NV */ - 827, /* GL_MATRIX4_NV */ - 829, /* GL_MATRIX5_NV */ - 831, /* GL_MATRIX6_NV */ - 833, /* GL_MATRIX7_NV */ - 307, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - 304, /* GL_CURRENT_MATRIX_ARB */ - 1790, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1793, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1231, /* GL_PROGRAM_PARAMETER_NV */ - 1778, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1235, /* GL_PROGRAM_TARGET_NV */ - 1232, /* GL_PROGRAM_RESIDENT_NV */ - 1694, /* GL_TRACK_MATRIX_NV */ - 1695, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1788, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1213, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 343, /* GL_DEPTH_CLAMP_NV */ - 1756, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1763, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1764, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1765, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1766, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1767, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1768, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1769, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1770, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1771, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1757, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1758, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1759, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1760, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1761, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1762, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 751, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 763, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 764, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 765, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 766, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 752, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 753, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 754, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 755, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 756, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 757, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 778, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 787, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 788, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 789, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 790, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1212, /* GL_PROGRAM_BINDING_ARB */ - 792, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 793, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 779, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 780, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 781, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 782, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 783, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 784, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1616, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1613, /* GL_TEXTURE_COMPRESSED */ - 1021, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 261, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 930, /* GL_MAX_VERTEX_UNITS_ARB */ + 640, /* GL_INTERPOLATE */ + 267, /* GL_CONSTANT */ + 1198, /* GL_PRIMARY_COLOR */ + 1195, /* GL_PREVIOUS */ + 1418, /* GL_SOURCE0_RGB */ + 1424, /* GL_SOURCE1_RGB */ + 1430, /* GL_SOURCE2_RGB */ + 1434, /* GL_SOURCE3_RGB_NV */ + 1415, /* GL_SOURCE0_ALPHA */ + 1421, /* GL_SOURCE1_ALPHA */ + 1427, /* GL_SOURCE2_ALPHA */ + 1433, /* GL_SOURCE3_ALPHA_NV */ + 1040, /* GL_OPERAND0_RGB */ + 1046, /* GL_OPERAND1_RGB */ + 1052, /* GL_OPERAND2_RGB */ + 1056, /* GL_OPERAND3_RGB_NV */ + 1037, /* GL_OPERAND0_ALPHA */ + 1043, /* GL_OPERAND1_ALPHA */ + 1049, /* GL_OPERAND2_ALPHA */ + 1055, /* GL_OPERAND3_ALPHA_NV */ + 1751, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + 1815, /* GL_YCBCR_422_APPLE */ + 1740, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1742, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1405, /* GL_SLICE_ACCUM_SUN */ + 1255, /* GL_QUAD_MESH_SUN */ + 1711, /* GL_TRIANGLE_MESH_SUN */ + 1789, /* GL_VERTEX_PROGRAM_ARB */ + 1800, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1776, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1782, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1784, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1786, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 328, /* GL_CURRENT_VERTEX_ATTRIB */ + 1211, /* GL_PROGRAM_LENGTH_ARB */ + 1225, /* GL_PROGRAM_STRING_ARB */ + 970, /* GL_MODELVIEW_PROJECTION_NV */ + 607, /* GL_IDENTITY_NV */ + 654, /* GL_INVERSE_NV */ + 1704, /* GL_TRANSPOSE_NV */ + 655, /* GL_INVERSE_TRANSPOSE_NV */ + 878, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 877, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 785, /* GL_MATRIX0_NV */ + 797, /* GL_MATRIX1_NV */ + 809, /* GL_MATRIX2_NV */ + 813, /* GL_MATRIX3_NV */ + 815, /* GL_MATRIX4_NV */ + 817, /* GL_MATRIX5_NV */ + 819, /* GL_MATRIX6_NV */ + 821, /* GL_MATRIX7_NV */ + 312, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + 309, /* GL_CURRENT_MATRIX_ARB */ + 1792, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1795, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1223, /* GL_PROGRAM_PARAMETER_NV */ + 1780, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1227, /* GL_PROGRAM_TARGET_NV */ + 1224, /* GL_PROGRAM_RESIDENT_NV */ + 1696, /* GL_TRACK_MATRIX_NV */ + 1697, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1790, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1205, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 349, /* GL_DEPTH_CLAMP_NV */ + 1758, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1765, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1766, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1767, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1768, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1769, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1770, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1771, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1772, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1773, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1759, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1760, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1761, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1762, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1763, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1764, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 739, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 746, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 747, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 748, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 749, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 750, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 751, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 752, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 753, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 754, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 740, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 741, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 742, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 743, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 744, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 745, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 766, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 773, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 774, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 775, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 776, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 777, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 778, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1204, /* GL_PROGRAM_BINDING_ARB */ + 780, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 781, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 767, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 768, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 769, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 770, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 771, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 772, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1618, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1615, /* GL_TEXTURE_COMPRESSED */ + 1009, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 266, /* GL_COMPRESSED_TEXTURE_FORMATS */ + 918, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1808, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1786, /* GL_VERTEX_BLEND_ARB */ - 324, /* GL_CURRENT_WEIGHT_ARB */ - 1807, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1806, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1805, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1804, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1801, /* GL_WEIGHT_ARRAY_ARB */ - 371, /* GL_DOT3_RGB */ - 372, /* GL_DOT3_RGBA */ - 259, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 254, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 990, /* GL_MULTISAMPLE_3DFX */ - 1374, /* GL_SAMPLE_BUFFERS_3DFX */ - 1365, /* GL_SAMPLES_3DFX */ - 971, /* GL_MODELVIEW2_ARB */ - 974, /* GL_MODELVIEW3_ARB */ - 975, /* GL_MODELVIEW4_ARB */ - 976, /* GL_MODELVIEW5_ARB */ - 977, /* GL_MODELVIEW6_ARB */ - 978, /* GL_MODELVIEW7_ARB */ - 979, /* GL_MODELVIEW8_ARB */ - 980, /* GL_MODELVIEW9_ARB */ - 950, /* GL_MODELVIEW10_ARB */ - 951, /* GL_MODELVIEW11_ARB */ - 952, /* GL_MODELVIEW12_ARB */ - 953, /* GL_MODELVIEW13_ARB */ - 954, /* GL_MODELVIEW14_ARB */ - 955, /* GL_MODELVIEW15_ARB */ - 956, /* GL_MODELVIEW16_ARB */ - 957, /* GL_MODELVIEW17_ARB */ - 958, /* GL_MODELVIEW18_ARB */ - 959, /* GL_MODELVIEW19_ARB */ - 961, /* GL_MODELVIEW20_ARB */ - 962, /* GL_MODELVIEW21_ARB */ - 963, /* GL_MODELVIEW22_ARB */ - 964, /* GL_MODELVIEW23_ARB */ - 965, /* GL_MODELVIEW24_ARB */ - 966, /* GL_MODELVIEW25_ARB */ - 967, /* GL_MODELVIEW26_ARB */ - 968, /* GL_MODELVIEW27_ARB */ - 969, /* GL_MODELVIEW28_ARB */ - 970, /* GL_MODELVIEW29_ARB */ - 972, /* GL_MODELVIEW30_ARB */ - 973, /* GL_MODELVIEW31_ARB */ - 376, /* GL_DOT3_RGB_EXT */ - 374, /* GL_DOT3_RGBA_EXT */ - 944, /* GL_MIRROR_CLAMP_EXT */ - 947, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 985, /* GL_MODULATE_ADD_ATI */ - 986, /* GL_MODULATE_SIGNED_ADD_ATI */ - 987, /* GL_MODULATE_SUBTRACT_ATI */ - 1814, /* GL_YCBCR_MESA */ - 1076, /* GL_PACK_INVERT_MESA */ - 327, /* GL_DEBUG_OBJECT_MESA */ - 328, /* GL_DEBUG_PRINT_MESA */ - 326, /* GL_DEBUG_ASSERT_MESA */ - 106, /* GL_BUFFER_SIZE */ - 108, /* GL_BUFFER_USAGE */ - 112, /* GL_BUMP_ROT_MATRIX_ATI */ - 113, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ - 111, /* GL_BUMP_NUM_TEX_UNITS_ATI */ - 115, /* GL_BUMP_TEX_UNITS_ATI */ - 435, /* GL_DUDV_ATI */ - 434, /* GL_DU8DV8_ATI */ - 110, /* GL_BUMP_ENVMAP_ATI */ - 114, /* GL_BUMP_TARGET_ATI */ - 1464, /* GL_STENCIL_BACK_FUNC */ - 1462, /* GL_STENCIL_BACK_FAIL */ - 1466, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1468, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 512, /* GL_FRAGMENT_PROGRAM_ARB */ - 1210, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1238, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1237, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1222, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1228, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1227, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 879, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 902, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 901, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 892, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 898, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 897, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 862, /* GL_MAX_DRAW_BUFFERS */ - 380, /* GL_DRAW_BUFFER0 */ - 383, /* GL_DRAW_BUFFER1 */ - 404, /* GL_DRAW_BUFFER2 */ - 407, /* GL_DRAW_BUFFER3 */ - 410, /* GL_DRAW_BUFFER4 */ - 413, /* GL_DRAW_BUFFER5 */ - 416, /* GL_DRAW_BUFFER6 */ - 419, /* GL_DRAW_BUFFER7 */ - 422, /* GL_DRAW_BUFFER8 */ - 425, /* GL_DRAW_BUFFER9 */ - 384, /* GL_DRAW_BUFFER10 */ - 387, /* GL_DRAW_BUFFER11 */ - 390, /* GL_DRAW_BUFFER12 */ - 393, /* GL_DRAW_BUFFER13 */ - 396, /* GL_DRAW_BUFFER14 */ - 399, /* GL_DRAW_BUFFER15 */ + 1810, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1788, /* GL_VERTEX_BLEND_ARB */ + 330, /* GL_CURRENT_WEIGHT_ARB */ + 1809, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1808, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1807, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1806, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1803, /* GL_WEIGHT_ARRAY_ARB */ + 377, /* GL_DOT3_RGB */ + 378, /* GL_DOT3_RGBA */ + 260, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + 255, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + 978, /* GL_MULTISAMPLE_3DFX */ + 1368, /* GL_SAMPLE_BUFFERS_3DFX */ + 1359, /* GL_SAMPLES_3DFX */ + 959, /* GL_MODELVIEW2_ARB */ + 962, /* GL_MODELVIEW3_ARB */ + 963, /* GL_MODELVIEW4_ARB */ + 964, /* GL_MODELVIEW5_ARB */ + 965, /* GL_MODELVIEW6_ARB */ + 966, /* GL_MODELVIEW7_ARB */ + 967, /* GL_MODELVIEW8_ARB */ + 968, /* GL_MODELVIEW9_ARB */ + 938, /* GL_MODELVIEW10_ARB */ + 939, /* GL_MODELVIEW11_ARB */ + 940, /* GL_MODELVIEW12_ARB */ + 941, /* GL_MODELVIEW13_ARB */ + 942, /* GL_MODELVIEW14_ARB */ + 943, /* GL_MODELVIEW15_ARB */ + 944, /* GL_MODELVIEW16_ARB */ + 945, /* GL_MODELVIEW17_ARB */ + 946, /* GL_MODELVIEW18_ARB */ + 947, /* GL_MODELVIEW19_ARB */ + 949, /* GL_MODELVIEW20_ARB */ + 950, /* GL_MODELVIEW21_ARB */ + 951, /* GL_MODELVIEW22_ARB */ + 952, /* GL_MODELVIEW23_ARB */ + 953, /* GL_MODELVIEW24_ARB */ + 954, /* GL_MODELVIEW25_ARB */ + 955, /* GL_MODELVIEW26_ARB */ + 956, /* GL_MODELVIEW27_ARB */ + 957, /* GL_MODELVIEW28_ARB */ + 958, /* GL_MODELVIEW29_ARB */ + 960, /* GL_MODELVIEW30_ARB */ + 961, /* GL_MODELVIEW31_ARB */ + 382, /* GL_DOT3_RGB_EXT */ + 380, /* GL_DOT3_RGBA_EXT */ + 932, /* GL_MIRROR_CLAMP_EXT */ + 935, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 973, /* GL_MODULATE_ADD_ATI */ + 974, /* GL_MODULATE_SIGNED_ADD_ATI */ + 975, /* GL_MODULATE_SUBTRACT_ATI */ + 1816, /* GL_YCBCR_MESA */ + 1064, /* GL_PACK_INVERT_MESA */ + 333, /* GL_DEBUG_OBJECT_MESA */ + 334, /* GL_DEBUG_PRINT_MESA */ + 332, /* GL_DEBUG_ASSERT_MESA */ + 107, /* GL_BUFFER_SIZE */ + 109, /* GL_BUFFER_USAGE */ + 113, /* GL_BUMP_ROT_MATRIX_ATI */ + 114, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ + 112, /* GL_BUMP_NUM_TEX_UNITS_ATI */ + 116, /* GL_BUMP_TEX_UNITS_ATI */ + 441, /* GL_DUDV_ATI */ + 440, /* GL_DU8DV8_ATI */ + 111, /* GL_BUMP_ENVMAP_ATI */ + 115, /* GL_BUMP_TARGET_ATI */ + 1466, /* GL_STENCIL_BACK_FUNC */ + 1464, /* GL_STENCIL_BACK_FAIL */ + 1468, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1470, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 524, /* GL_FRAGMENT_PROGRAM_ARB */ + 1202, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1230, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1229, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1214, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1220, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1219, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 867, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 890, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 889, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 880, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 886, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 885, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 850, /* GL_MAX_DRAW_BUFFERS */ + 386, /* GL_DRAW_BUFFER0 */ + 389, /* GL_DRAW_BUFFER1 */ + 410, /* GL_DRAW_BUFFER2 */ + 413, /* GL_DRAW_BUFFER3 */ + 416, /* GL_DRAW_BUFFER4 */ + 419, /* GL_DRAW_BUFFER5 */ + 422, /* GL_DRAW_BUFFER6 */ + 425, /* GL_DRAW_BUFFER7 */ + 428, /* GL_DRAW_BUFFER8 */ + 431, /* GL_DRAW_BUFFER9 */ + 390, /* GL_DRAW_BUFFER10 */ + 393, /* GL_DRAW_BUFFER11 */ + 396, /* GL_DRAW_BUFFER12 */ + 399, /* GL_DRAW_BUFFER13 */ + 402, /* GL_DRAW_BUFFER14 */ + 405, /* GL_DRAW_BUFFER15 */ 81, /* GL_BLEND_EQUATION_ALPHA */ - 842, /* GL_MATRIX_PALETTE_ARB */ - 873, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 876, /* GL_MAX_PALETTE_MATRICES_ARB */ - 310, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 836, /* GL_MATRIX_INDEX_ARRAY_ARB */ - 305, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 838, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 840, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 839, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 837, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1642, /* GL_TEXTURE_DEPTH_SIZE */ - 364, /* GL_DEPTH_TEXTURE_MODE */ - 1608, /* GL_TEXTURE_COMPARE_MODE */ - 1606, /* GL_TEXTURE_COMPARE_FUNC */ - 238, /* GL_COMPARE_R_TO_TEXTURE */ - 1144, /* GL_POINT_SPRITE */ - 287, /* GL_COORD_REPLACE */ - 1148, /* GL_POINT_SPRITE_R_MODE_NV */ - 1265, /* GL_QUERY_COUNTER_BITS */ - 312, /* GL_CURRENT_QUERY */ - 1267, /* GL_QUERY_RESULT */ - 1269, /* GL_QUERY_RESULT_AVAILABLE */ - 924, /* GL_MAX_VERTEX_ATTRIBS */ - 1776, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 362, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 361, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 910, /* GL_MAX_TEXTURE_COORDS */ - 912, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1215, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1217, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1216, /* GL_PROGRAM_FORMAT_ARB */ - 1688, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 341, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 340, /* GL_DEPTH_BOUNDS_EXT */ + 830, /* GL_MATRIX_PALETTE_ARB */ + 861, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 864, /* GL_MAX_PALETTE_MATRICES_ARB */ + 315, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + 824, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 310, /* GL_CURRENT_MATRIX_INDEX_ARB */ + 826, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 828, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 827, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 825, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1644, /* GL_TEXTURE_DEPTH_SIZE */ + 370, /* GL_DEPTH_TEXTURE_MODE */ + 1610, /* GL_TEXTURE_COMPARE_MODE */ + 1608, /* GL_TEXTURE_COMPARE_FUNC */ + 239, /* GL_COMPARE_R_TO_TEXTURE */ + 1136, /* GL_POINT_SPRITE */ + 292, /* GL_COORD_REPLACE */ + 1140, /* GL_POINT_SPRITE_R_MODE_NV */ + 1257, /* GL_QUERY_COUNTER_BITS */ + 317, /* GL_CURRENT_QUERY */ + 1259, /* GL_QUERY_RESULT */ + 1261, /* GL_QUERY_RESULT_AVAILABLE */ + 912, /* GL_MAX_VERTEX_ATTRIBS */ + 1778, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 368, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 367, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 898, /* GL_MAX_TEXTURE_COORDS */ + 900, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1207, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1209, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1208, /* GL_PROGRAM_FORMAT_ARB */ + 1690, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 347, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 346, /* GL_DEPTH_BOUNDS_EXT */ 52, /* GL_ARRAY_BUFFER */ - 448, /* GL_ELEMENT_ARRAY_BUFFER */ + 454, /* GL_ELEMENT_ARRAY_BUFFER */ 53, /* GL_ARRAY_BUFFER_BINDING */ - 449, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1750, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1011, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - 145, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 628, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1621, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 444, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1386, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 490, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1802, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1772, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1218, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 885, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1224, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 894, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1236, /* GL_PROGRAM_TEMPORARIES_ARB */ - 900, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1226, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 896, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1230, /* GL_PROGRAM_PARAMETERS_ARB */ - 899, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1225, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 895, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1211, /* GL_PROGRAM_ATTRIBS_ARB */ - 880, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1223, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 893, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1209, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 878, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1221, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 891, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 886, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 882, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1239, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1699, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1278, /* GL_READ_ONLY */ - 1810, /* GL_WRITE_ONLY */ - 1280, /* GL_READ_WRITE */ - 100, /* GL_BUFFER_ACCESS */ - 102, /* GL_BUFFER_MAPPED */ - 104, /* GL_BUFFER_MAP_POINTER */ - 1693, /* GL_TIME_ELAPSED_EXT */ - 796, /* GL_MATRIX0_ARB */ - 808, /* GL_MATRIX1_ARB */ - 820, /* GL_MATRIX2_ARB */ - 824, /* GL_MATRIX3_ARB */ - 826, /* GL_MATRIX4_ARB */ - 828, /* GL_MATRIX5_ARB */ - 830, /* GL_MATRIX6_ARB */ - 832, /* GL_MATRIX7_ARB */ - 834, /* GL_MATRIX8_ARB */ - 835, /* GL_MATRIX9_ARB */ - 798, /* GL_MATRIX10_ARB */ - 799, /* GL_MATRIX11_ARB */ - 800, /* GL_MATRIX12_ARB */ - 801, /* GL_MATRIX13_ARB */ - 802, /* GL_MATRIX14_ARB */ - 803, /* GL_MATRIX15_ARB */ - 804, /* GL_MATRIX16_ARB */ - 805, /* GL_MATRIX17_ARB */ - 806, /* GL_MATRIX18_ARB */ - 807, /* GL_MATRIX19_ARB */ - 810, /* GL_MATRIX20_ARB */ - 811, /* GL_MATRIX21_ARB */ - 812, /* GL_MATRIX22_ARB */ - 813, /* GL_MATRIX23_ARB */ - 814, /* GL_MATRIX24_ARB */ - 815, /* GL_MATRIX25_ARB */ - 816, /* GL_MATRIX26_ARB */ - 817, /* GL_MATRIX27_ARB */ - 818, /* GL_MATRIX28_ARB */ - 819, /* GL_MATRIX29_ARB */ - 822, /* GL_MATRIX30_ARB */ - 823, /* GL_MATRIX31_ARB */ - 1494, /* GL_STREAM_DRAW */ - 1496, /* GL_STREAM_READ */ - 1492, /* GL_STREAM_COPY */ - 1455, /* GL_STATIC_DRAW */ - 1457, /* GL_STATIC_READ */ - 1453, /* GL_STATIC_COPY */ - 438, /* GL_DYNAMIC_DRAW */ - 440, /* GL_DYNAMIC_READ */ - 436, /* GL_DYNAMIC_COPY */ - 583, /* GL_GL_PIXEL_PACK_BUFFER */ - 585, /* GL_GL_PIXEL_UNPACK_BUFFER */ - 584, /* GL_GL_PIXEL_PACK_BUFFER_BINDING */ - 586, /* GL_GL_PIXEL_UNPACK_BUFFER_BINDING */ - 335, /* GL_DEPTH24_STENCIL8 */ - 1686, /* GL_TEXTURE_STENCIL_SIZE */ - 883, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 881, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 884, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 888, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 887, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 845, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1488, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 455, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1752, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 999, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 146, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + 616, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1623, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 450, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1380, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 502, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1804, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1774, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1210, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 873, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1216, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 882, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1228, /* GL_PROGRAM_TEMPORARIES_ARB */ + 888, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1218, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 884, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1222, /* GL_PROGRAM_PARAMETERS_ARB */ + 887, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1217, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 883, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1203, /* GL_PROGRAM_ATTRIBS_ARB */ + 868, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1215, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 881, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1201, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 866, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1213, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 879, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 874, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 870, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1231, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1701, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1270, /* GL_READ_ONLY */ + 1812, /* GL_WRITE_ONLY */ + 1272, /* GL_READ_WRITE */ + 101, /* GL_BUFFER_ACCESS */ + 103, /* GL_BUFFER_MAPPED */ + 105, /* GL_BUFFER_MAP_POINTER */ + 1695, /* GL_TIME_ELAPSED_EXT */ + 784, /* GL_MATRIX0_ARB */ + 796, /* GL_MATRIX1_ARB */ + 808, /* GL_MATRIX2_ARB */ + 812, /* GL_MATRIX3_ARB */ + 814, /* GL_MATRIX4_ARB */ + 816, /* GL_MATRIX5_ARB */ + 818, /* GL_MATRIX6_ARB */ + 820, /* GL_MATRIX7_ARB */ + 822, /* GL_MATRIX8_ARB */ + 823, /* GL_MATRIX9_ARB */ + 786, /* GL_MATRIX10_ARB */ + 787, /* GL_MATRIX11_ARB */ + 788, /* GL_MATRIX12_ARB */ + 789, /* GL_MATRIX13_ARB */ + 790, /* GL_MATRIX14_ARB */ + 791, /* GL_MATRIX15_ARB */ + 792, /* GL_MATRIX16_ARB */ + 793, /* GL_MATRIX17_ARB */ + 794, /* GL_MATRIX18_ARB */ + 795, /* GL_MATRIX19_ARB */ + 798, /* GL_MATRIX20_ARB */ + 799, /* GL_MATRIX21_ARB */ + 800, /* GL_MATRIX22_ARB */ + 801, /* GL_MATRIX23_ARB */ + 802, /* GL_MATRIX24_ARB */ + 803, /* GL_MATRIX25_ARB */ + 804, /* GL_MATRIX26_ARB */ + 805, /* GL_MATRIX27_ARB */ + 806, /* GL_MATRIX28_ARB */ + 807, /* GL_MATRIX29_ARB */ + 810, /* GL_MATRIX30_ARB */ + 811, /* GL_MATRIX31_ARB */ + 1496, /* GL_STREAM_DRAW */ + 1498, /* GL_STREAM_READ */ + 1494, /* GL_STREAM_COPY */ + 1457, /* GL_STATIC_DRAW */ + 1459, /* GL_STATIC_READ */ + 1455, /* GL_STATIC_COPY */ + 444, /* GL_DYNAMIC_DRAW */ + 446, /* GL_DYNAMIC_READ */ + 442, /* GL_DYNAMIC_COPY */ + 1104, /* GL_PIXEL_PACK_BUFFER */ + 1108, /* GL_PIXEL_UNPACK_BUFFER */ + 1105, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1109, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 341, /* GL_DEPTH24_STENCIL8 */ + 1688, /* GL_TEXTURE_STENCIL_SIZE */ + 871, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + 869, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 872, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 876, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 875, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 833, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1490, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 945, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1367, /* GL_SAMPLES_PASSED */ - 513, /* GL_FRAGMENT_SHADER */ - 1796, /* GL_VERTEX_SHADER */ - 1229, /* GL_PROGRAM_OBJECT_ARB */ - 1399, /* GL_SHADER_OBJECT_ARB */ - 869, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 928, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 922, /* GL_MAX_VARYING_FLOATS */ - 926, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 854, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1036, /* GL_OBJECT_TYPE_ARB */ - 1401, /* GL_SHADER_TYPE */ - 478, /* GL_FLOAT_VEC2 */ - 480, /* GL_FLOAT_VEC3 */ - 482, /* GL_FLOAT_VEC4 */ - 655, /* GL_INT_VEC2 */ - 657, /* GL_INT_VEC3 */ - 659, /* GL_INT_VEC4 */ - 92, /* GL_BOOL */ - 94, /* GL_BOOL_VEC2 */ - 96, /* GL_BOOL_VEC3 */ - 98, /* GL_BOOL_VEC4 */ - 472, /* GL_FLOAT_MAT2 */ - 474, /* GL_FLOAT_MAT3 */ - 476, /* GL_FLOAT_MAT4 */ - 1358, /* GL_SAMPLER_1D */ - 1360, /* GL_SAMPLER_2D */ - 1362, /* GL_SAMPLER_3D */ - 1363, /* GL_SAMPLER_CUBE */ - 1359, /* GL_SAMPLER_1D_SHADOW */ - 1361, /* GL_SAMPLER_2D_SHADOW */ - 577, /* GL_GL_FLOAT_MAT2x3 */ - 578, /* GL_GL_FLOAT_MAT2x4 */ - 579, /* GL_GL_FLOAT_MAT3x2 */ - 580, /* GL_GL_FLOAT_MAT3x4 */ - 581, /* GL_GL_FLOAT_MAT4x2 */ - 582, /* GL_GL_FLOAT_MAT4x3 */ - 333, /* GL_DELETE_STATUS */ - 242, /* GL_COMPILE_STATUS */ - 709, /* GL_LINK_STATUS */ - 1745, /* GL_VALIDATE_STATUS */ - 640, /* GL_INFO_LOG_LENGTH */ + 933, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1361, /* GL_SAMPLES_PASSED */ + 525, /* GL_FRAGMENT_SHADER */ + 1798, /* GL_VERTEX_SHADER */ + 1221, /* GL_PROGRAM_OBJECT_ARB */ + 1393, /* GL_SHADER_OBJECT_ARB */ + 857, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 916, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 910, /* GL_MAX_VARYING_FLOATS */ + 914, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 842, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1024, /* GL_OBJECT_TYPE_ARB */ + 1395, /* GL_SHADER_TYPE */ + 490, /* GL_FLOAT_VEC2 */ + 492, /* GL_FLOAT_VEC3 */ + 494, /* GL_FLOAT_VEC4 */ + 643, /* GL_INT_VEC2 */ + 645, /* GL_INT_VEC3 */ + 647, /* GL_INT_VEC4 */ + 93, /* GL_BOOL */ + 95, /* GL_BOOL_VEC2 */ + 97, /* GL_BOOL_VEC3 */ + 99, /* GL_BOOL_VEC4 */ + 478, /* GL_FLOAT_MAT2 */ + 482, /* GL_FLOAT_MAT3 */ + 486, /* GL_FLOAT_MAT4 */ + 1352, /* GL_SAMPLER_1D */ + 1354, /* GL_SAMPLER_2D */ + 1356, /* GL_SAMPLER_3D */ + 1357, /* GL_SAMPLER_CUBE */ + 1353, /* GL_SAMPLER_1D_SHADOW */ + 1355, /* GL_SAMPLER_2D_SHADOW */ + 480, /* GL_FLOAT_MAT2x3 */ + 481, /* GL_FLOAT_MAT2x4 */ + 484, /* GL_FLOAT_MAT3x2 */ + 485, /* GL_FLOAT_MAT3x4 */ + 488, /* GL_FLOAT_MAT4x2 */ + 489, /* GL_FLOAT_MAT4x3 */ + 339, /* GL_DELETE_STATUS */ + 243, /* GL_COMPILE_STATUS */ + 697, /* GL_LINK_STATUS */ + 1747, /* GL_VALIDATE_STATUS */ + 628, /* GL_INFO_LOG_LENGTH */ 55, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1400, /* GL_SHADER_SOURCE_LENGTH */ + 1394, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 515, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1403, /* GL_SHADING_LANGUAGE_VERSION */ - 311, /* GL_CURRENT_PROGRAM */ - 1085, /* GL_PALETTE4_RGB8_OES */ - 1087, /* GL_PALETTE4_RGBA8_OES */ - 1083, /* GL_PALETTE4_R5_G6_B5_OES */ - 1086, /* GL_PALETTE4_RGBA4_OES */ - 1084, /* GL_PALETTE4_RGB5_A1_OES */ - 1090, /* GL_PALETTE8_RGB8_OES */ - 1092, /* GL_PALETTE8_RGBA8_OES */ - 1088, /* GL_PALETTE8_R5_G6_B5_OES */ - 1091, /* GL_PALETTE8_RGBA4_OES */ - 1089, /* GL_PALETTE8_RGB5_A1_OES */ - 622, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 621, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1730, /* GL_UNSIGNED_NORMALIZED */ - 1576, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1249, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1578, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1252, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1584, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1586, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 591, /* GL_GL_SRGB */ - 592, /* GL_GL_SRGB8 */ - 594, /* GL_GL_SRGB_ALPHA */ - 593, /* GL_GL_SRGB8_ALPHA8 */ - 590, /* GL_GL_SLUMINANCE_ALPHA */ - 589, /* GL_GL_SLUMINANCE8_ALPHA8 */ - 587, /* GL_GL_SLUMINANCE */ - 588, /* GL_GL_SLUMINANCE8 */ - 574, /* GL_GL_COMPRESSED_SRGB */ - 575, /* GL_GL_COMPRESSED_SRGB_ALPHA */ - 572, /* GL_GL_COMPRESSED_SLUMINANCE */ - 573, /* GL_GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1146, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 717, /* GL_LOWER_LEFT */ - 1742, /* GL_UPPER_LEFT */ - 1470, /* GL_STENCIL_BACK_REF */ - 1471, /* GL_STENCIL_BACK_VALUE_MASK */ - 1472, /* GL_STENCIL_BACK_WRITEMASK */ - 429, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1294, /* GL_RENDERBUFFER_BINDING_EXT */ - 1275, /* GL_READ_FRAMEBUFFER */ - 428, /* GL_DRAW_FRAMEBUFFER */ - 1276, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 1304, /* GL_RENDERBUFFER_SAMPLES */ - 525, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - 523, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - 534, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - 530, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - 532, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - 537, /* GL_FRAMEBUFFER_COMPLETE */ - 541, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - 547, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - 545, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 543, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 546, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 544, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 550, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 553, /* GL_FRAMEBUFFER_UNSUPPORTED */ - 551, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 851, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - 151, /* GL_COLOR_ATTACHMENT0 */ - 153, /* GL_COLOR_ATTACHMENT1 */ - 167, /* GL_COLOR_ATTACHMENT2 */ - 169, /* GL_COLOR_ATTACHMENT3 */ - 171, /* GL_COLOR_ATTACHMENT4 */ - 173, /* GL_COLOR_ATTACHMENT5 */ - 175, /* GL_COLOR_ATTACHMENT6 */ - 177, /* GL_COLOR_ATTACHMENT7 */ - 179, /* GL_COLOR_ATTACHMENT8 */ - 181, /* GL_COLOR_ATTACHMENT9 */ - 154, /* GL_COLOR_ATTACHMENT10 */ - 156, /* GL_COLOR_ATTACHMENT11 */ - 158, /* GL_COLOR_ATTACHMENT12 */ - 160, /* GL_COLOR_ATTACHMENT13 */ - 162, /* GL_COLOR_ATTACHMENT14 */ - 164, /* GL_COLOR_ATTACHMENT15 */ - 336, /* GL_DEPTH_ATTACHMENT */ - 1460, /* GL_STENCIL_ATTACHMENT */ - 516, /* GL_FRAMEBUFFER */ - 1292, /* GL_RENDERBUFFER */ - 1306, /* GL_RENDERBUFFER_WIDTH */ - 1299, /* GL_RENDERBUFFER_HEIGHT */ - 1301, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1483, /* GL_STENCIL_INDEX_EXT */ - 1480, /* GL_STENCIL_INDEX1_EXT */ - 1481, /* GL_STENCIL_INDEX4_EXT */ - 1482, /* GL_STENCIL_INDEX8_EXT */ - 1479, /* GL_STENCIL_INDEX16_EXT */ - 1303, /* GL_RENDERBUFFER_RED_SIZE */ - 1298, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1295, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1293, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1296, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1305, /* GL_RENDERBUFFER_STENCIL_SIZE */ - 549, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 907, /* GL_MAX_SAMPLES */ - 455, /* GL_EVAL_BIT */ - 1273, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 711, /* GL_LIST_BIT */ - 1592, /* GL_TEXTURE_BIT */ - 1382, /* GL_SCISSOR_BIT */ + 527, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1397, /* GL_SHADING_LANGUAGE_VERSION */ + 316, /* GL_CURRENT_PROGRAM */ + 1073, /* GL_PALETTE4_RGB8_OES */ + 1075, /* GL_PALETTE4_RGBA8_OES */ + 1071, /* GL_PALETTE4_R5_G6_B5_OES */ + 1074, /* GL_PALETTE4_RGBA4_OES */ + 1072, /* GL_PALETTE4_RGB5_A1_OES */ + 1078, /* GL_PALETTE8_RGB8_OES */ + 1080, /* GL_PALETTE8_RGBA8_OES */ + 1076, /* GL_PALETTE8_R5_G6_B5_OES */ + 1079, /* GL_PALETTE8_RGBA4_OES */ + 1077, /* GL_PALETTE8_RGB5_A1_OES */ + 610, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 609, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1732, /* GL_UNSIGNED_NORMALIZED */ + 1578, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1241, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1580, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1244, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1586, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1588, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1449, /* GL_SRGB */ + 1450, /* GL_SRGB8 */ + 1452, /* GL_SRGB_ALPHA */ + 1451, /* GL_SRGB8_ALPHA8 */ + 1409, /* GL_SLUMINANCE_ALPHA */ + 1408, /* GL_SLUMINANCE8_ALPHA8 */ + 1406, /* GL_SLUMINANCE */ + 1407, /* GL_SLUMINANCE8 */ + 264, /* GL_COMPRESSED_SRGB */ + 265, /* GL_COMPRESSED_SRGB_ALPHA */ + 262, /* GL_COMPRESSED_SLUMINANCE */ + 263, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ + 1138, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 705, /* GL_LOWER_LEFT */ + 1744, /* GL_UPPER_LEFT */ + 1472, /* GL_STENCIL_BACK_REF */ + 1473, /* GL_STENCIL_BACK_VALUE_MASK */ + 1474, /* GL_STENCIL_BACK_WRITEMASK */ + 435, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + 1286, /* GL_RENDERBUFFER_BINDING_EXT */ + 1267, /* GL_READ_FRAMEBUFFER */ + 434, /* GL_DRAW_FRAMEBUFFER */ + 1268, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 1296, /* GL_RENDERBUFFER_SAMPLES */ + 537, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 535, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 546, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 542, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 544, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 549, /* GL_FRAMEBUFFER_COMPLETE */ + 553, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 559, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 557, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 555, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 558, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 556, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 562, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 565, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 563, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 839, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 152, /* GL_COLOR_ATTACHMENT0 */ + 154, /* GL_COLOR_ATTACHMENT1 */ + 168, /* GL_COLOR_ATTACHMENT2 */ + 170, /* GL_COLOR_ATTACHMENT3 */ + 172, /* GL_COLOR_ATTACHMENT4 */ + 174, /* GL_COLOR_ATTACHMENT5 */ + 176, /* GL_COLOR_ATTACHMENT6 */ + 178, /* GL_COLOR_ATTACHMENT7 */ + 180, /* GL_COLOR_ATTACHMENT8 */ + 182, /* GL_COLOR_ATTACHMENT9 */ + 155, /* GL_COLOR_ATTACHMENT10 */ + 157, /* GL_COLOR_ATTACHMENT11 */ + 159, /* GL_COLOR_ATTACHMENT12 */ + 161, /* GL_COLOR_ATTACHMENT13 */ + 163, /* GL_COLOR_ATTACHMENT14 */ + 165, /* GL_COLOR_ATTACHMENT15 */ + 342, /* GL_DEPTH_ATTACHMENT */ + 1462, /* GL_STENCIL_ATTACHMENT */ + 528, /* GL_FRAMEBUFFER */ + 1284, /* GL_RENDERBUFFER */ + 1298, /* GL_RENDERBUFFER_WIDTH */ + 1291, /* GL_RENDERBUFFER_HEIGHT */ + 1293, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1485, /* GL_STENCIL_INDEX_EXT */ + 1482, /* GL_STENCIL_INDEX1_EXT */ + 1483, /* GL_STENCIL_INDEX4_EXT */ + 1484, /* GL_STENCIL_INDEX8_EXT */ + 1481, /* GL_STENCIL_INDEX16_EXT */ + 1295, /* GL_RENDERBUFFER_RED_SIZE */ + 1290, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1287, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1285, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1288, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1297, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 561, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 895, /* GL_MAX_SAMPLES */ + 1345, /* GL_RGBA_SNORM */ + 1341, /* GL_RGBA8_SNORM */ + 1402, /* GL_SIGNED_NORMALIZED */ + 461, /* GL_EVAL_BIT */ + 1265, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 699, /* GL_LIST_BIT */ + 1594, /* GL_TEXTURE_BIT */ + 1376, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 992, /* GL_MULTISAMPLE_BIT */ + 980, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2d2bf51784..147d923e64 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -150,6 +150,7 @@ static const struct { { OFF, "GL_MESA_packed_depth_stencil", F(MESA_packed_depth_stencil) }, { OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) }, { OFF, "GL_MESA_texture_array", F(MESA_texture_array) }, + { OFF, "GL_MESA_texture_signed_rgba", F(MESA_texture_signed_rgba) }, { 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) }, diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 72b880e28e..03f42704a7 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -363,7 +363,7 @@ struct tnl_program { }; -static const struct ureg undef = { +static const struct ureg undef = { PROGRAM_UNDEFINED, 0, 0, @@ -398,7 +398,7 @@ static struct ureg negate( struct ureg reg ) { reg.negate ^= 1; return reg; -} +} static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) @@ -407,7 +407,6 @@ static struct ureg swizzle( struct ureg reg, int x, int y, int z, int w ) GET_SWZ(reg.swz, y), GET_SWZ(reg.swz, z), GET_SWZ(reg.swz, w)); - return reg; } @@ -898,8 +897,7 @@ static void build_hpos( struct tnl_program *p ) static GLuint material_attrib( GLuint side, GLuint property ) { - return ((property - STATE_AMBIENT) * 2 + - side); + return (property - STATE_AMBIENT) * 2 + side; } @@ -960,7 +958,7 @@ static struct ureg get_scenecolor( struct tnl_program *p, GLuint side ) struct ureg material_ambient = get_material(p, side, STATE_AMBIENT); struct ureg material_diffuse = get_material(p, side, STATE_DIFFUSE); struct ureg tmp = make_temp(p, material_diffuse); - emit_op3(p, OPCODE_MAD, tmp, WRITEMASK_XYZ, lm_ambient, + emit_op3(p, OPCODE_MAD, tmp, WRITEMASK_XYZ, lm_ambient, material_ambient, material_emission); return tmp; } @@ -978,7 +976,7 @@ static struct ureg get_lightprod( struct tnl_program *p, GLuint light, register_param3(p, STATE_LIGHT, light, property); struct ureg material_value = get_material(p, side, property); struct ureg tmp = get_temp(p); - emit_op2(p, OPCODE_MUL, tmp, 0, light_value, material_value); + emit_op2(p, OPCODE_MUL, tmp, 0, light_value, material_value); return tmp; } else @@ -1015,7 +1013,6 @@ static struct ureg calculate_light_attenuation( struct tnl_program *p, /* Calculate distance attenuation: */ if (p->state->unit[i].light_attenuated) { - /* 1/d,d,d,1/d */ emit_op1(p, OPCODE_RCP, dist, WRITEMASK_YZ, dist); /* 1,d,d*d,1/d */ @@ -1028,7 +1025,8 @@ static struct ureg calculate_light_attenuation( struct tnl_program *p, emit_op1(p, OPCODE_RCP, dist, 0, dist); /* spot-atten * dist-atten */ emit_op2(p, OPCODE_MUL, att, 0, dist, att); - } else { + } + else { /* dist-atten */ emit_op1(p, OPCODE_RCP, att, 0, dist); } @@ -1082,10 +1080,10 @@ static void build_lighting( struct tnl_program *p ) /* * NOTE: - * dot.x = dot(normal, VPpli) - * dot.y = dot(normal, halfAngle) - * dot.z = back.shininess - * dot.w = front.shininess + * dots.x = dot(normal, VPpli) + * dots.y = dot(normal, halfAngle) + * dots.z = back.shininess + * dots.w = front.shininess */ for (i = 0; i < MAX_LIGHTS; i++) @@ -1097,7 +1095,7 @@ static void build_lighting( struct tnl_program *p ) { if (!p->state->material_shininess_is_zero) { struct ureg shininess = get_material(p, 0, STATE_SHININESS); - emit_op1(p, OPCODE_MOV, dots, WRITEMASK_W, swizzle1(shininess,X)); + emit_op1(p, OPCODE_MOV, dots, WRITEMASK_W, swizzle1(shininess,X)); release_temp(p, shininess); } @@ -1106,11 +1104,13 @@ static void build_lighting( struct tnl_program *p ) _col1 = make_temp(p, get_identity_param(p)); else _col1 = _col0; - } if (twoside) { if (!p->state->material_shininess_is_zero) { + /* Note that we negate the back-face specular exponent here. + * The negation will be un-done later in the back-face code below. + */ struct ureg shininess = get_material(p, 1, STATE_SHININESS); emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z, negate(swizzle1(shininess,X))); @@ -1171,12 +1171,13 @@ static void build_lighting( struct tnl_program *p ) half = get_temp(p); emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat); emit_normalize_vec3(p, half, half); - } else { + } + else { half = register_param3(p, STATE_INTERNAL, STATE_LIGHT_HALF_VECTOR, i); } } - } + } else { struct ureg Ppli = register_param3(p, STATE_INTERNAL, STATE_LIGHT_POSITION, i); @@ -1255,7 +1256,8 @@ static void build_lighting( struct tnl_program *p ) res0 = _col0; res1 = register_output( p, VERT_RESULT_COL0 ); } - } else { + } + else { mask0 = 0; mask1 = 0; res0 = _col0; @@ -1267,12 +1269,12 @@ static void build_lighting( struct tnl_program *p ) emit_op1(p, OPCODE_LIT, lit, 0, dots); emit_op2(p, OPCODE_MUL, lit, 0, lit, att); emit_op3(p, OPCODE_MAD, _col0, 0, swizzle1(lit,X), ambient, _col0); - } + } else if (!p->state->material_shininess_is_zero) { /* there's a non-zero specular term */ emit_op1(p, OPCODE_LIT, lit, 0, dots); emit_op2(p, OPCODE_ADD, _col0, 0, ambient, _col0); - } + } else { /* no attenutation, no specular */ emit_degenerate_lit(p, lit, dots); @@ -1309,13 +1311,19 @@ static void build_lighting( struct tnl_program *p ) res0 = _bfc0; res1 = register_output( p, VERT_RESULT_BFC0 ); } - } else { + } + else { res0 = _bfc0; res1 = _bfc1; mask0 = 0; mask1 = 0; } + /* For the back face we need to negate the X and Y component + * dot products. dots.Z has the negated back-face specular + * exponent. We swizzle that into the W position. This + * negation makes the back-face specular term positive again. + */ dots = negate(swizzle(dots,X,Y,W,Z)); if (!is_undef(att)) { @@ -1325,8 +1333,8 @@ static void build_lighting( struct tnl_program *p ) } else if (!p->state->material_shininess_is_zero) { emit_op1(p, OPCODE_LIT, lit, 0, dots); - emit_op2(p, OPCODE_ADD, _bfc0, 0, ambient, _bfc0); - } + emit_op2(p, OPCODE_ADD, _bfc0, 0, ambient, _bfc0); /**/ + } else { emit_degenerate_lit(p, lit, dots); emit_op2(p, OPCODE_ADD, _bfc0, 0, ambient, _bfc0); @@ -1334,8 +1342,10 @@ static void build_lighting( struct tnl_program *p ) emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0); emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1); - /* restore negate flag for next lighting */ - dots = negate(dots); + /* restore dots to its original state for subsequent lights + * by negating and swizzling again. + */ + dots = negate(swizzle(dots,X,Y,W,Z)); release_temp(p, ambient); release_temp(p, diffuse); @@ -1578,7 +1588,7 @@ static void build_texture_transform( struct tnl_program *p ) } release_temps(p); - } + } else { emit_passthrough(p, VERT_ATTRIB_TEX0+i, VERT_RESULT_TEX0+i); } @@ -1647,7 +1657,8 @@ static void build_array_pointsize( struct tnl_program *p ) static void build_tnl_program( struct tnl_program *p ) -{ /* Emit the program, starting with modelviewproject: +{ + /* Emit the program, starting with modelviewproject: */ build_hpos(p); diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index fa3149d56d..ddae456fa1 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1677,7 +1677,6 @@ _mesa_apply_stencil_transfer_ops(const GLcontext *ctx, GLuint n, * Used to pack an array [][4] of RGBA float colors as specified * by the dstFormat, dstType and dstPacking. Used by glReadPixels, * glGetConvolutionFilter(), etc. - * Incoming colors will be clamped to [0,1] if needed. * Note: the rgba values will be modified by this function when any pixel * transfer ops are enabled. */ @@ -1691,19 +1690,12 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], GLfloat luminance[MAX_WIDTH]; const GLint comps = _mesa_components_in_format(dstFormat); GLuint i; - /* clamping only applies to colors, not the dudv values, but still need - it if converting to unsigned values (which doesn't make much sense) */ - if (dstFormat == GL_DUDV_ATI || dstFormat == GL_DU8DV8_ATI) { - switch (dstType) { - case GL_UNSIGNED_BYTE: - case GL_UNSIGNED_SHORT: - case GL_UNSIGNED_INT: - transferOps |= IMAGE_CLAMP_BIT; - break; - /* actually might want clamp to [-1,1] otherwise but shouldn't matter? */ - } - } - else if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { + + /* XXX + * This test should probably go away. Have the caller set/clear the + * IMAGE_CLAMP_BIT as needed. + */ + if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { /* need to clamp to [0, 1] */ transferOps |= IMAGE_CLAMP_BIT; } @@ -4554,6 +4546,17 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, } return; } + if (srcType == GL_UNSIGNED_INT_24_8 + && dstType == GL_UNSIGNED_INT + && depthMax == 0xffffff) { + const GLuint *src = (const GLuint *) source; + GLuint *dst = (GLuint *) dest; + GLuint i; + for (i = 0; i < n; i++) { + dst[i] = src[i] >> 8; + } + return; + } /* XXX may want to add additional cases here someday */ } diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 20b8342064..2ac93a5237 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -979,6 +979,35 @@ _mesa_vsprintf( char *str, const char *fmt, va_list args ) /** \name Diagnostics */ /*@{*/ +static void +output_if_debug(const char *prefixString, const char *outputString) +{ + static int debug = -1; + + /* Check the MESA_DEBUG environment variable if it hasn't + * been checked yet. We only have to check it once... + */ + if (debug == -1) { + char *env = _mesa_getenv("MESA_DEBUG"); + + /* In a debug build, we print warning messages *unless* + * MESA_DEBUG is 0. In a non-debug build, we don't + * print warning messages *unless* MESA_DEBUG is + * set *to any value*. + */ +#ifdef DEBUG + debug = (env != NULL && _mesa_atoi(env) == 0) ? 0 : 1; +#else + debug = (env != NULL) ? 1 : 0; +#endif + } + + /* Now only print the string if we're required to do so. */ + if (debug) { + fprintf(stderr, "%s: %s\n", prefixString, outputString); + } +} + /** * Report a warning (a recoverable error condition) to stderr if * either DEBUG is defined or the MESA_DEBUG env var is set. @@ -989,21 +1018,14 @@ _mesa_vsprintf( char *str, const char *fmt, va_list args ) void _mesa_warning( GLcontext *ctx, const char *fmtString, ... ) { - GLboolean debug; char str[MAXSTRING]; va_list args; (void) ctx; va_start( args, fmtString ); (void) vsnprintf( str, MAXSTRING, fmtString, args ); va_end( args ); -#ifdef DEBUG - debug = GL_TRUE; /* always print warning */ -#else - debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE; -#endif - if (debug) { - fprintf(stderr, "Mesa warning: %s\n", str); - } + + output_if_debug("Mesa warning", str); } /** @@ -1123,7 +1145,7 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - fprintf(stderr, "Mesa: %s", s); + output_if_debug("Mesa", s); #endif /* DEBUG */ (void) ctx; (void) fmtString; diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index a15c1f0be0..ac604fd12c 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -110,10 +110,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params) break; case GL_SPOT_DIRECTION: /* NOTE: Direction already transformed by inverse ModelView! */ - if (TEST_EQ_3V(light->EyeDirection, params)) + if (TEST_EQ_3V(light->SpotDirection, params)) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); - COPY_3V(light->EyeDirection, params); + COPY_3V(light->SpotDirection, params); break; case GL_SPOT_EXPONENT: ASSERT(params[0] >= 0.0); @@ -209,7 +209,6 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) _math_matrix_analyse(ctx->ModelviewMatrixStack.Top); } TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m); - NORMALIZE_3FV(temp); params = temp; break; case GL_SPOT_EXPONENT: @@ -326,7 +325,7 @@ _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) COPY_4V( params, ctx->Light.Light[l].EyePosition ); break; case GL_SPOT_DIRECTION: - COPY_3V( params, ctx->Light.Light[l].EyeDirection ); + COPY_3V( params, ctx->Light.Light[l].SpotDirection ); break; case GL_SPOT_EXPONENT: params[0] = ctx->Light.Light[l].SpotExponent; @@ -388,9 +387,9 @@ _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) params[3] = (GLint) ctx->Light.Light[l].EyePosition[3]; break; case GL_SPOT_DIRECTION: - params[0] = (GLint) ctx->Light.Light[l].EyeDirection[0]; - params[1] = (GLint) ctx->Light.Light[l].EyeDirection[1]; - params[2] = (GLint) ctx->Light.Light[l].EyeDirection[2]; + params[0] = (GLint) ctx->Light.Light[l].SpotDirection[0]; + params[1] = (GLint) ctx->Light.Light[l].SpotDirection[1]; + params[2] = (GLint) ctx->Light.Light[l].SpotDirection[2]; break; case GL_SPOT_EXPONENT: params[0] = (GLint) ctx->Light.Light[l].SpotExponent; @@ -1137,20 +1136,26 @@ compute_light_positions( GLcontext *ctx ) } if (light->_Flags & LIGHT_SPOT) { + /* Note: we normalize the spot direction now */ + if (ctx->_NeedEyeCoords) { - COPY_3V( light->_NormDirection, light->EyeDirection ); + COPY_3V( light->_NormSpotDirection, light->SpotDirection ); + NORMALIZE_3FV( light->_NormSpotDirection ); } else { - TRANSFORM_NORMAL( light->_NormDirection, - light->EyeDirection, + GLfloat spotDir[3]; + COPY_3V(spotDir, light->SpotDirection); + NORMALIZE_3FV(spotDir); + TRANSFORM_NORMAL( light->_NormSpotDirection, + spotDir, ctx->ModelviewMatrixStack.Top->m); } - NORMALIZE_3FV( light->_NormDirection ); + NORMALIZE_3FV( light->_NormSpotDirection ); if (!(light->_Flags & LIGHT_POSITIONAL)) { GLfloat PV_dot_dir = - DOT3(light->_VP_inf_norm, - light->_NormDirection); + light->_NormSpotDirection); if (PV_dot_dir > light->_CosCutoff) { double x = PV_dot_dir * (EXP_TABLE_SIZE-1); @@ -1274,7 +1279,7 @@ init_light( struct gl_light *l, GLuint n ) ASSIGN_4V( l->Specular, 0.0, 0.0, 0.0, 1.0 ); } ASSIGN_4V( l->EyePosition, 0.0, 0.0, 1.0, 0.0 ); - ASSIGN_3V( l->EyeDirection, 0.0, 0.0, -1.0 ); + ASSIGN_3V( l->SpotDirection, 0.0, 0.0, -1.0 ); l->SpotExponent = 0.0; _mesa_invalidate_spot_exp_table( l ); l->SpotCutoff = 180.0; diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index bfd740870e..01d59dd42d 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -54,12 +54,20 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; #define FLOAT_TO_BYTE(X) ( (((GLint) (255.0F * (X))) - 1) / 2 ) +/** Convert GLbyte in [-128,127] to GLfloat in [-1.0,1.0], texture/fb data */ +#define BYTE_TO_FLOAT_TEX(B) ((B) == -128 ? -1.0 : (B) * (1.0F/127.0F)) + +/** Convert GLfloat in [-1.0,1.0] to GLbyte in [-128,127], texture/fb data */ +#define FLOAT_TO_BYTE_TEX(X) ( (GLint) (127.0F * (X)) ) + + /** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */ #define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F)) /** Convert GLfloat in [0.0,1.0] to GLushort in [0, 65535] */ #define FLOAT_TO_USHORT(X) ((GLuint) ((X) * 65535.0)) + /** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0] */ #define SHORT_TO_FLOAT(S) ((2.0F * (S) + 1.0F) * (1.0F/65535.0F)) @@ -67,6 +75,13 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; #define FLOAT_TO_SHORT(X) ( (((GLint) (65535.0F * (X))) - 1) / 2 ) +/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0], texture/fb data */ +#define SHORT_TO_FLOAT_TEX(S) ((S) == -32768 ? -1.0 : (S) * (1.0F/32767.0F)) + +/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767], texture/fb data */ +#define FLOAT_TO_SHORT_TEX(X) ( (GLint) (32767.0F * (X)) ) + + /** Convert GLuint in [0,4294967295] to GLfloat in [0.0,1.0] */ #define UINT_TO_FLOAT(U) ((GLfloat) (U) * (1.0F / 4294967295.0F)) @@ -85,6 +100,13 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; #define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) ) +/** Convert GLint in [-2147483648,2147483647] to GLfloat in [-1.0,1.0], texture/fb data */ +#define INT_TO_FLOAT_TEX(I) ((I) == -2147483648 ? -1.0 : (I) * (1.0F/2147483647.0)) + +/** Convert GLfloat in [-1.0,1.0] to GLint in [-2147483648,2147483647], texture/fb data */ +#define FLOAT_TO_INT_TEX(X) ( (GLint) (2147483647.0F * (X)) ) + + #define BYTE_TO_UBYTE(b) ((GLubyte) ((b) < 0 ? 0 : (GLubyte) (b))) #define SHORT_TO_UBYTE(s) ((GLubyte) ((s) < 0 ? 0 : (GLubyte) ((s) >> 7))) #define USHORT_TO_UBYTE(s) ((GLubyte) ((s) >> 8)) diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index aebf48134f..7388276c45 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -161,7 +161,8 @@ _mesa_MatrixMode( GLenum mode ) break; case GL_TEXTURE: if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glMatrixMode(texcoord unit)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glMatrixMode(invalid unit %d)", + ctx->Texture.CurrentUnit); return; } ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 4a79430c34..bc8658beff 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -86,6 +86,21 @@ bytes_per_pixel(GLenum datatype, GLuint comps) rowD[j][e], rowD[k][e]); \ } while(0) +#define FILTER_SUM_3D_SIGNED(Aj, Ak, Bj, Bk, Cj, Ck, Dj, Dk) \ + (Aj + Ak \ + + Bj + Bk \ + + Cj + Ck \ + + Dj + Dk \ + + 4) / 8 + +#define FILTER_3D_SIGNED(e) \ + do { \ + dst[i][e] = FILTER_SUM_3D_SIGNED(rowA[j][e], rowA[k][e], \ + rowB[j][e], rowB[k][e], \ + rowC[j][e], rowC[k][e], \ + rowD[j][e], rowD[k][e]); \ + } while(0) + #define FILTER_F_3D(e) \ do { \ dst[i][e] = (rowA[j][e] + rowA[k][e] \ @@ -180,6 +195,53 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, } } + else if (datatype == GL_BYTE && comps == 4) { + GLuint i, j, k; + const GLbyte(*rowA)[4] = (const GLbyte(*)[4]) srcRowA; + const GLbyte(*rowB)[4] = (const GLbyte(*)[4]) srcRowB; + GLbyte(*dst)[4] = (GLbyte(*)[4]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; + dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4; + dst[i][3] = (rowA[j][3] + rowA[k][3] + rowB[j][3] + rowB[k][3]) / 4; + } + } + else if (datatype == GL_BYTE && comps == 3) { + GLuint i, j, k; + const GLbyte(*rowA)[3] = (const GLbyte(*)[3]) srcRowA; + const GLbyte(*rowB)[3] = (const GLbyte(*)[3]) srcRowB; + GLbyte(*dst)[3] = (GLbyte(*)[3]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; + dst[i][2] = (rowA[j][2] + rowA[k][2] + rowB[j][2] + rowB[k][2]) / 4; + } + } + else if (datatype == GL_BYTE && comps == 2) { + GLuint i, j, k; + const GLbyte(*rowA)[2] = (const GLbyte(*)[2]) srcRowA; + const GLbyte(*rowB)[2] = (const GLbyte(*)[2]) srcRowB; + GLbyte(*dst)[2] = (GLbyte(*)[2]) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) / 4; + dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) / 4; + } + } + else if (datatype == GL_BYTE && comps == 1) { + GLuint i, j, k; + const GLbyte *rowA = (const GLbyte *) srcRowA; + const GLbyte *rowB = (const GLbyte *) srcRowB; + GLbyte *dst = (GLbyte *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + dst[i] = (rowA[j] + rowA[k] + rowB[j] + rowB[k]) / 4; + } + } + else if (datatype == GL_UNSIGNED_SHORT && comps == 4) { GLuint i, j, k; const GLushort(*rowA)[4] = (const GLushort(*)[4]) srcRowA; @@ -470,17 +532,6 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, dst[i] = (blue << 5) | (green << 2) | red; } } - else if (datatype == GL_BYTE && comps == 2) { - GLuint i, j, k; - const GLbyte(*rowA)[2] = (const GLbyte(*)[2]) srcRowA; - const GLbyte(*rowB)[2] = (const GLbyte(*)[2]) srcRowB; - GLbyte(*dst)[2] = (GLbyte(*)[2]) dstRow; - for (i = j = 0, k = k0; i < (GLuint) dstWidth; - i++, j += colStride, k += colStride) { - dst[i][0] = (rowA[j][0] + rowA[k][0] + rowB[j][0] + rowB[k][0]) >> 2; - dst[i][1] = (rowA[j][1] + rowA[k][1] + rowB[j][1] + rowB[k][1]) >> 2; - } - } else { _mesa_problem(NULL, "bad format in do_row()"); } @@ -555,6 +606,44 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth, FILTER_3D(0); } } + if ((datatype == GL_BYTE) && (comps == 4)) { + DECLARE_ROW_POINTERS(GLbyte, 4); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D_SIGNED(0); + FILTER_3D_SIGNED(1); + FILTER_3D_SIGNED(2); + FILTER_3D_SIGNED(3); + } + } + else if ((datatype == GL_BYTE) && (comps == 3)) { + DECLARE_ROW_POINTERS(GLbyte, 3); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D_SIGNED(0); + FILTER_3D_SIGNED(1); + FILTER_3D_SIGNED(2); + } + } + else if ((datatype == GL_BYTE) && (comps == 2)) { + DECLARE_ROW_POINTERS(GLbyte, 2); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D_SIGNED(0); + FILTER_3D_SIGNED(1); + } + } + else if ((datatype == GL_BYTE) && (comps == 1)) { + DECLARE_ROW_POINTERS(GLbyte, 1); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + FILTER_3D_SIGNED(0); + } + } else if ((datatype == GL_UNSIGNED_SHORT) && (comps == 4)) { DECLARE_ROW_POINTERS(GLushort, 4); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5293009454..3f31590000 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -460,7 +460,7 @@ struct gl_light GLfloat Diffuse[4]; /**< diffuse color */ GLfloat Specular[4]; /**< specular color */ GLfloat EyePosition[4]; /**< position in eye coordinates */ - GLfloat EyeDirection[4]; /**< spotlight dir in eye coordinates */ + GLfloat SpotDirection[4]; /**< spotlight direction in eye coordinates */ GLfloat SpotExponent; GLfloat SpotCutoff; /**< in degrees */ GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */ @@ -479,7 +479,7 @@ struct gl_light GLfloat _Position[4]; /**< position in eye/obj coordinates */ GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */ GLfloat _h_inf_norm[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */ - GLfloat _NormDirection[4]; /**< normalized spotlight direction */ + GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */ GLfloat _VP_inf_spot_attenuation; GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */ @@ -1296,7 +1296,6 @@ struct gl_texture_object GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ GLfloat Priority; /**< in [0,1] */ GLfloat BorderColor[4]; /**< unclamped */ - GLchan _BorderChan[4]; /**< clamped, as GLchan */ GLenum WrapS; /**< S-axis texture image wrap mode */ GLenum WrapT; /**< T-axis texture image wrap mode */ GLenum WrapR; /**< R-axis texture image wrap mode */ @@ -1338,18 +1337,23 @@ struct gl_texture_object }; +/** Up to four combiner sources are possible with GL_NV_texture_env_combine4 */ +#define MAX_COMBINER_TERMS 4 + + /** * Texture combine environment state. - * Up to four combiner sources are possible with GL_NV_texture_env_combine4. */ struct gl_tex_env_combine_state { GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - GLenum SourceRGB[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum SourceA[4]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ - GLenum OperandRGB[4]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ - GLenum OperandA[4]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ + /** Source terms: GL_PRIMARY_COLOR, GL_TEXTURE, etc */ + GLenum SourceRGB[MAX_COMBINER_TERMS]; + GLenum SourceA[MAX_COMBINER_TERMS]; + /** Source operands: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, etc */ + GLenum OperandRGB[MAX_COMBINER_TERMS]; + GLenum OperandA[MAX_COMBINER_TERMS]; GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ GLuint ScaleShiftA; /**< 0, 1 or 2 */ GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */ @@ -1974,6 +1978,7 @@ struct gl_shader GLboolean DeletePending; GLboolean CompileStatus; GLboolean Main; /**< shader defines main() */ + GLboolean UnresolvedRefs; const GLchar *Source; /**< Source code string */ struct gl_program *Program; /**< Post-compile assembly code */ GLchar *InfoLog; @@ -2503,6 +2508,7 @@ struct gl_extensions GLboolean MESA_resize_buffers; GLboolean MESA_ycbcr_texture; GLboolean MESA_texture_array; + GLboolean MESA_texture_signed_rgba; GLboolean NV_blend_square; GLboolean NV_fragment_program; GLboolean NV_light_max_exponent; diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index dfdd297b6e..2326776ecb 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -170,6 +170,9 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, return; } + if (width == 0 || height == 0) + return; /* nothing to do */ + if (ctx->Pack.BufferObj->Name) { if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1, format, type, pixels)) { diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index fa45e466b7..193ac8970c 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -159,9 +159,11 @@ delete_program_cb(GLuint id, void *data, void *userData) { struct gl_program *prog = (struct gl_program *) data; GLcontext *ctx = (GLcontext *) userData; - ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */ - prog->RefCount = 0; /* now going away */ - ctx->Driver.DeleteProgram(ctx, prog); + if(prog != &_mesa_DummyProgram) { + ASSERT(prog->RefCount == 1); /* should only be referenced by hash table */ + prog->RefCount = 0; /* now going away */ + ctx->Driver.DeleteProgram(ctx, prog); + } } diff --git a/src/mesa/main/sources b/src/mesa/main/sources index 4e58702c74..5d9d99040e 100644 --- a/src/mesa/main/sources +++ b/src/mesa/main/sources @@ -63,6 +63,7 @@ texenv.c \ texenvprogram.c \ texformat.c \ texgen.c \ +texgetimage.c \ teximage.c \ texobj.c \ texparam.c \ diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index c2960fc820..4d511f2f7e 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -184,7 +184,7 @@ set_combiner_source(GLcontext *ctx, struct gl_texture_unit *texUnit, GLenum pname, GLenum param) { - GLuint src; + GLuint term; GLboolean alpha, legal; if (!ctx->Extensions.EXT_texture_env_combine && @@ -194,24 +194,24 @@ set_combiner_source(GLcontext *ctx, } /* - * Translate pname to (src, alpha). + * Translate pname to (term, alpha). */ switch (pname) { case GL_SOURCE0_RGB: - src = 0; + term = 0; alpha = GL_FALSE; break; case GL_SOURCE1_RGB: - src = 1; + term = 1; alpha = GL_FALSE; break; case GL_SOURCE2_RGB: - src = 2; + term = 2; alpha = GL_FALSE; break; case GL_SOURCE3_RGB_NV: if (ctx->Extensions.NV_texture_env_combine4) { - src = 3; + term = 3; alpha = GL_FALSE; } else { @@ -220,20 +220,20 @@ set_combiner_source(GLcontext *ctx, } break; case GL_SOURCE0_ALPHA: - src = 0; + term = 0; alpha = GL_TRUE; break; case GL_SOURCE1_ALPHA: - src = 1; + term = 1; alpha = GL_TRUE; break; case GL_SOURCE2_ALPHA: - src = 2; + term = 2; alpha = GL_TRUE; break; case GL_SOURCE3_ALPHA_NV: if (ctx->Extensions.NV_texture_env_combine4) { - src = 3; + term = 3; alpha = GL_TRUE; } else { @@ -246,7 +246,7 @@ set_combiner_source(GLcontext *ctx, return; } - assert(src < 4); + assert(term < MAX_COMBINER_TERMS); /* * Error-check param (the source term) @@ -288,9 +288,9 @@ set_combiner_source(GLcontext *ctx, FLUSH_VERTICES(ctx, _NEW_TEXTURE); if (alpha) - texUnit->Combine.SourceA[src] = param; + texUnit->Combine.SourceA[term] = param; else - texUnit->Combine.SourceRGB[src] = param; + texUnit->Combine.SourceRGB[term] = param; } @@ -300,7 +300,7 @@ set_combiner_operand(GLcontext *ctx, struct gl_texture_unit *texUnit, GLenum pname, GLenum param) { - GLuint op; + GLuint term; GLboolean alpha, legal; if (!ctx->Extensions.EXT_texture_env_combine && @@ -311,16 +311,16 @@ set_combiner_operand(GLcontext *ctx, switch (pname) { case GL_OPERAND0_RGB: - op = 0; + term = 0; alpha = GL_FALSE; break; case GL_OPERAND1_RGB: - op = 1; + term = 1; alpha = GL_FALSE; break; case GL_OPERAND2_RGB: if (ctx->Extensions.ARB_texture_env_combine) { - op = 2; + term = 2; alpha = GL_FALSE; } else { @@ -330,7 +330,7 @@ set_combiner_operand(GLcontext *ctx, break; case GL_OPERAND3_RGB_NV: if (ctx->Extensions.NV_texture_env_combine4) { - op = 3; + term = 3; alpha = GL_FALSE; } else { @@ -339,16 +339,16 @@ set_combiner_operand(GLcontext *ctx, } break; case GL_OPERAND0_ALPHA: - op = 0; + term = 0; alpha = GL_TRUE; break; case GL_OPERAND1_ALPHA: - op = 1; + term = 1; alpha = GL_TRUE; break; case GL_OPERAND2_ALPHA: if (ctx->Extensions.ARB_texture_env_combine) { - op = 2; + term = 2; alpha = GL_TRUE; } else { @@ -358,7 +358,7 @@ set_combiner_operand(GLcontext *ctx, break; case GL_OPERAND3_ALPHA_NV: if (ctx->Extensions.NV_texture_env_combine4) { - op = 3; + term = 3; alpha = GL_TRUE; } else { @@ -371,7 +371,7 @@ set_combiner_operand(GLcontext *ctx, return; } - assert(op < 4); + assert(term < MAX_COMBINER_TERMS); /* * Error-check param (the source operand) @@ -397,9 +397,9 @@ set_combiner_operand(GLcontext *ctx, FLUSH_VERTICES(ctx, _NEW_TEXTURE); if (alpha) - texUnit->Combine.OperandA[op] = param; + texUnit->Combine.OperandA[term] = param; else - texUnit->Combine.OperandRGB[op] = param; + texUnit->Combine.OperandRGB[term] = param; } diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 3fbd119b34..4a124bf27e 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -39,9 +39,6 @@ #include "texenvprogram.h" -#define MAX_TERMS 4 - - /* * Note on texture units: * @@ -95,11 +92,11 @@ struct state_key { GLuint NumArgsRGB:3; GLuint ModeRGB:5; - struct mode_opt OptRGB[MAX_TERMS]; + struct mode_opt OptRGB[MAX_COMBINER_TERMS]; GLuint NumArgsA:3; GLuint ModeA:5; - struct mode_opt OptA[MAX_TERMS]; + struct mode_opt OptA[MAX_COMBINER_TERMS]; } unit[8]; }; @@ -389,7 +386,7 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB; key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA; - for (j = 0; j < MAX_TERMS; j++) { + for (j = 0; j < MAX_COMBINER_TERMS; j++) { key->unit[i].OptRGB[j].Operand = translate_operand(texUnit->_CurrentCombine->OperandRGB[j]); key->unit[i].OptA[j].Operand = @@ -972,11 +969,11 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, GLuint mode, const struct mode_opt *opt) { - struct ureg src[MAX_TERMS]; + struct ureg src[MAX_COMBINER_TERMS]; struct ureg tmp, half; GLuint i; - assert(nr <= MAX_TERMS); + assert(nr <= MAX_COMBINER_TERMS); tmp = undef; /* silence warning (bug 5318) */ diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index c372b49398..c709004784 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -154,9 +154,9 @@ const struct gl_texture_format _mesa_texformat_rgba = { 0, /* StencilBits */ 4 * sizeof(GLchan), /* TexelBytes */ _mesa_texstore_rgba, /* StoreTexImageFunc */ - fetch_texel_1d_rgba, /* FetchTexel1D */ - fetch_texel_2d_rgba, /* FetchTexel2D */ - fetch_texel_3d_rgba, /* FetchTexel3D */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ fetch_texel_1d_f_rgba, /* FetchTexel1Df */ fetch_texel_2d_f_rgba, /* FetchTexel2Df */ fetch_texel_3d_f_rgba, /* FetchTexel3Df */ @@ -178,9 +178,9 @@ const struct gl_texture_format _mesa_texformat_rgb = { 0, /* StencilBits */ 3 * sizeof(GLchan), /* TexelBytes */ _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_rgb, /* FetchTexel1D */ - fetch_texel_2d_rgb, /* FetchTexel2D */ - fetch_texel_3d_rgb, /* FetchTexel3D */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ fetch_texel_1d_f_rgb, /* FetchTexel1Df */ fetch_texel_2d_f_rgb, /* FetchTexel2Df */ fetch_texel_3d_f_rgb, /* FetchTexel3Df */ @@ -202,12 +202,12 @@ const struct gl_texture_format _mesa_texformat_alpha = { 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_alpha, /* FetchTexel1D */ - fetch_texel_2d_alpha, /* FetchTexel2D */ - fetch_texel_3d_alpha, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_alpha, /* FetchTexel1Df */ + fetch_texel_2d_f_alpha, /* FetchTexel2Df */ + fetch_texel_3d_f_alpha, /* FetchTexel3Df */ store_texel_alpha /* StoreTexel */ }; @@ -226,12 +226,12 @@ const struct gl_texture_format _mesa_texformat_luminance = { 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_luminance, /* FetchTexel1D */ - fetch_texel_2d_luminance, /* FetchTexel2D */ - fetch_texel_3d_luminance, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_luminance, /* FetchTexel1Df */ + fetch_texel_2d_f_luminance, /* FetchTexel2Df */ + fetch_texel_3d_f_luminance, /* FetchTexel3Df */ store_texel_luminance /* StoreTexel */ }; @@ -250,12 +250,12 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = { 0, /* StencilBits */ 2 * sizeof(GLchan), /* TexelBytes */ _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_luminance_alpha, /* FetchTexel1D */ - fetch_texel_2d_luminance_alpha, /* FetchTexel2D */ - fetch_texel_3d_luminance_alpha, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_luminance_alpha, /* FetchTexel1Df */ + fetch_texel_2d_f_luminance_alpha, /* FetchTexel2Df */ + fetch_texel_3d_f_luminance_alpha, /* FetchTexel3Df */ store_texel_luminance_alpha /* StoreTexel */ }; @@ -274,12 +274,12 @@ const struct gl_texture_format _mesa_texformat_intensity = { 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_intensity, /* FetchTexel1D */ - fetch_texel_2d_intensity, /* FetchTexel2D */ - fetch_texel_3d_intensity, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_intensity, /* FetchTexel1Df */ + fetch_texel_2d_f_intensity, /* FetchTexel2Df */ + fetch_texel_3d_f_intensity, /* FetchTexel3Df */ store_texel_intensity /* StoreTexel */ }; @@ -382,6 +382,7 @@ const struct gl_texture_format _mesa_texformat_sl8 = { store_texel_sl8 /* StoreTexel */ }; +/* Note: this format name looks like a misnomer, make it sal8? */ const struct gl_texture_format _mesa_texformat_sla8 = { MESA_FORMAT_SLA8, /* MesaFormat */ GL_LUMINANCE_ALPHA, /* BaseFormat */ @@ -699,9 +700,7 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { const struct gl_texture_format _mesa_texformat_dudv8 = { MESA_FORMAT_DUDV8, /* MesaFormat */ GL_DUDV_ATI, /* BaseFormat */ - /* FIXME: spec doesn't say since that parameter didn't exist then, - but this should be something like SIGNED_NORMALIZED */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ + GL_SIGNED_NORMALIZED, /* DataType */ /* maybe should add dudvBits field, but spec seems to be lacking the ability to query with GetTexLevelParameter anyway */ 0, /* RedBits */ @@ -724,6 +723,54 @@ const struct gl_texture_format _mesa_texformat_dudv8 = { NULL /* StoreTexel */ }; +const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { + MESA_FORMAT_SIGNED_RGBA8888, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_SIGNED_NORMALIZED, /* DataType */ + 8, /* RedBits */ + 8, /* GreenBits */ + 8, /* BlueBits */ + 8, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 4, /* TexelBytes */ + _mesa_texstore_signed_rgba8888, /* StoreTexImageFunc */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_signed_rgba8888, /* FetchTexel1Df */ + fetch_texel_2d_signed_rgba8888, /* FetchTexel2Df */ + fetch_texel_3d_signed_rgba8888, /* FetchTexel3Df */ + store_texel_signed_rgba8888 /* StoreTexel */ +}; + +const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { + MESA_FORMAT_SIGNED_RGBA8888_REV, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + GL_SIGNED_NORMALIZED, /* DataType */ + 8, /* RedBits */ + 8, /* GreenBits */ + 8, /* BlueBits */ + 8, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* StencilBits */ + 4, /* TexelBytes */ + _mesa_texstore_signed_rgba8888, /* StoreTexImageFunc */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_signed_rgba8888_rev, /* FetchTexel1Df */ + fetch_texel_2d_signed_rgba8888_rev, /* FetchTexel2Df */ + fetch_texel_3d_signed_rgba8888_rev, /* FetchTexel3Df */ + store_texel_signed_rgba8888_rev /* StoreTexel */ +}; + /*@}*/ @@ -746,12 +793,12 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = { 0, /* StencilBits */ 4, /* TexelBytes */ _mesa_texstore_rgba8888, /* StoreTexImageFunc */ - fetch_texel_1d_rgba8888, /* FetchTexel1D */ - fetch_texel_2d_rgba8888, /* FetchTexel2D */ - fetch_texel_3d_rgba8888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgba8888, /* FetchTexel1Df */ + fetch_texel_2d_f_rgba8888, /* FetchTexel2Df */ + fetch_texel_3d_f_rgba8888, /* FetchTexel3Df */ store_texel_rgba8888 /* StoreTexel */ }; @@ -770,12 +817,12 @@ const struct gl_texture_format _mesa_texformat_rgba8888_rev = { 0, /* StencilBits */ 4, /* TexelBytes */ _mesa_texstore_rgba8888, /* StoreTexImageFunc */ - fetch_texel_1d_rgba8888_rev, /* FetchTexel1D */ - fetch_texel_2d_rgba8888_rev, /* FetchTexel2D */ - fetch_texel_3d_rgba8888_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgba8888_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_rgba8888_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_rgba8888_rev, /* FetchTexel3Df */ store_texel_rgba8888_rev /* StoreTexel */ }; @@ -794,12 +841,12 @@ const struct gl_texture_format _mesa_texformat_argb8888 = { 0, /* StencilBits */ 4, /* TexelBytes */ _mesa_texstore_argb8888, /* StoreTexImageFunc */ - fetch_texel_1d_argb8888, /* FetchTexel1D */ - fetch_texel_2d_argb8888, /* FetchTexel2D */ - fetch_texel_3d_argb8888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_argb8888, /* FetchTexel1Df */ + fetch_texel_2d_f_argb8888, /* FetchTexel2Df */ + fetch_texel_3d_f_argb8888, /* FetchTexel3Df */ store_texel_argb8888 /* StoreTexel */ }; @@ -818,12 +865,12 @@ const struct gl_texture_format _mesa_texformat_argb8888_rev = { 0, /* StencilBits */ 4, /* TexelBytes */ _mesa_texstore_argb8888, /* StoreTexImageFunc */ - fetch_texel_1d_argb8888_rev, /* FetchTexel1D */ - fetch_texel_2d_argb8888_rev, /* FetchTexel2D */ - fetch_texel_3d_argb8888_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_argb8888_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_argb8888_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_argb8888_rev, /* FetchTexel3Df */ store_texel_argb8888_rev /* StoreTexel */ }; @@ -842,12 +889,12 @@ const struct gl_texture_format _mesa_texformat_rgb888 = { 0, /* StencilBits */ 3, /* TexelBytes */ _mesa_texstore_rgb888, /* StoreTexImageFunc */ - fetch_texel_1d_rgb888, /* FetchTexel1D */ - fetch_texel_2d_rgb888, /* FetchTexel2D */ - fetch_texel_3d_rgb888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgb888, /* FetchTexel1Df */ + fetch_texel_2d_f_rgb888, /* FetchTexel2Df */ + fetch_texel_3d_f_rgb888, /* FetchTexel3Df */ store_texel_rgb888 /* StoreTexel */ }; @@ -866,12 +913,12 @@ const struct gl_texture_format _mesa_texformat_bgr888 = { 0, /* StencilBits */ 3, /* TexelBytes */ _mesa_texstore_bgr888, /* StoreTexImageFunc */ - fetch_texel_1d_bgr888, /* FetchTexel1D */ - fetch_texel_2d_bgr888, /* FetchTexel2D */ - fetch_texel_3d_bgr888, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_bgr888, /* FetchTexel1Df */ + fetch_texel_2d_f_bgr888, /* FetchTexel2Df */ + fetch_texel_3d_f_bgr888, /* FetchTexel3Df */ store_texel_bgr888 /* StoreTexel */ }; @@ -890,12 +937,12 @@ const struct gl_texture_format _mesa_texformat_rgb565 = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_rgb565, /* StoreTexImageFunc */ - fetch_texel_1d_rgb565, /* FetchTexel1D */ - fetch_texel_2d_rgb565, /* FetchTexel2D */ - fetch_texel_3d_rgb565, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgb565, /* FetchTexel1Df */ + fetch_texel_2d_f_rgb565, /* FetchTexel2Df */ + fetch_texel_3d_f_rgb565, /* FetchTexel3Df */ store_texel_rgb565 /* StoreTexel */ }; @@ -914,12 +961,12 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_rgb565, /* StoreTexImageFunc */ - fetch_texel_1d_rgb565_rev, /* FetchTexel1D */ - fetch_texel_2d_rgb565_rev, /* FetchTexel2D */ - fetch_texel_3d_rgb565_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgb565_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_rgb565_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_rgb565_rev, /* FetchTexel3Df */ store_texel_rgb565_rev /* StoreTexel */ }; @@ -938,12 +985,12 @@ const struct gl_texture_format _mesa_texformat_rgba4444 = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_rgba4444, /* StoreTexImageFunc */ - fetch_texel_1d_rgba4444, /* FetchTexel1D */ - fetch_texel_2d_rgba4444, /* FetchTexel2D */ - fetch_texel_3d_rgba4444, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgba4444, /* FetchTexel1Df */ + fetch_texel_2d_f_rgba4444, /* FetchTexel2Df */ + fetch_texel_3d_f_rgba4444, /* FetchTexel3Df */ store_texel_rgba4444 /* StoreTexel */ }; @@ -962,12 +1009,12 @@ const struct gl_texture_format _mesa_texformat_argb4444 = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_argb4444, /* StoreTexImageFunc */ - fetch_texel_1d_argb4444, /* FetchTexel1D */ - fetch_texel_2d_argb4444, /* FetchTexel2D */ - fetch_texel_3d_argb4444, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_argb4444, /* FetchTexel1Df */ + fetch_texel_2d_f_argb4444, /* FetchTexel2Df */ + fetch_texel_3d_f_argb4444, /* FetchTexel3Df */ store_texel_argb4444 /* StoreTexel */ }; @@ -986,12 +1033,12 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_argb4444, /* StoreTexImageFunc */ - fetch_texel_1d_argb4444_rev, /* FetchTexel1D */ - fetch_texel_2d_argb4444_rev, /* FetchTexel2D */ - fetch_texel_3d_argb4444_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_argb4444_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_argb4444_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_argb4444_rev, /* FetchTexel3Df */ store_texel_argb4444_rev /* StoreTexel */ }; @@ -1010,12 +1057,12 @@ const struct gl_texture_format _mesa_texformat_rgba5551 = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_rgba5551, /* StoreTexImageFunc */ - fetch_texel_1d_rgba5551, /* FetchTexel1D */ - fetch_texel_2d_rgba5551, /* FetchTexel2D */ - fetch_texel_3d_rgba5551, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgba5551, /* FetchTexel1Df */ + fetch_texel_2d_f_rgba5551, /* FetchTexel2Df */ + fetch_texel_3d_f_rgba5551, /* FetchTexel3Df */ store_texel_rgba5551 /* StoreTexel */ }; @@ -1034,12 +1081,12 @@ const struct gl_texture_format _mesa_texformat_argb1555 = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_argb1555, /* StoreTexImageFunc */ - fetch_texel_1d_argb1555, /* FetchTexel1D */ - fetch_texel_2d_argb1555, /* FetchTexel2D */ - fetch_texel_3d_argb1555, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_argb1555, /* FetchTexel1Df */ + fetch_texel_2d_f_argb1555, /* FetchTexel2Df */ + fetch_texel_3d_f_argb1555, /* FetchTexel3Df */ store_texel_argb1555 /* StoreTexel */ }; @@ -1058,12 +1105,12 @@ const struct gl_texture_format _mesa_texformat_argb1555_rev = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_argb1555, /* StoreTexImageFunc */ - fetch_texel_1d_argb1555_rev, /* FetchTexel1D */ - fetch_texel_2d_argb1555_rev, /* FetchTexel2D */ - fetch_texel_3d_argb1555_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_argb1555_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_argb1555_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_argb1555_rev, /* FetchTexel3Df */ store_texel_argb1555_rev /* StoreTexel */ }; @@ -1082,12 +1129,12 @@ const struct gl_texture_format _mesa_texformat_al88 = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_al88, /* StoreTexImageFunc */ - fetch_texel_1d_al88, /* FetchTexel1D */ - fetch_texel_2d_al88, /* FetchTexel2D */ - fetch_texel_3d_al88, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_al88, /* FetchTexel1Df */ + fetch_texel_2d_f_al88, /* FetchTexel2Df */ + fetch_texel_3d_f_al88, /* FetchTexel3Df */ store_texel_al88 /* StoreTexel */ }; @@ -1106,12 +1153,12 @@ const struct gl_texture_format _mesa_texformat_al88_rev = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_al88, /* StoreTexImageFunc */ - fetch_texel_1d_al88_rev, /* FetchTexel1D */ - fetch_texel_2d_al88_rev, /* FetchTexel2D */ - fetch_texel_3d_al88_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_al88_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_al88_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_al88_rev, /* FetchTexel3Df */ store_texel_al88_rev /* StoreTexel */ }; @@ -1130,12 +1177,12 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { 0, /* StencilBits */ 1, /* TexelBytes */ _mesa_texstore_rgb332, /* StoreTexImageFunc */ - fetch_texel_1d_rgb332, /* FetchTexel1D */ - fetch_texel_2d_rgb332, /* FetchTexel2D */ - fetch_texel_3d_rgb332, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_rgb332, /* FetchTexel1Df */ + fetch_texel_2d_f_rgb332, /* FetchTexel2Df */ + fetch_texel_3d_f_rgb332, /* FetchTexel3Df */ store_texel_rgb332 /* StoreTexel */ }; @@ -1154,12 +1201,12 @@ const struct gl_texture_format _mesa_texformat_a8 = { 0, /* StencilBits */ 1, /* TexelBytes */ _mesa_texstore_a8, /* StoreTexImageFunc */ - fetch_texel_1d_a8, /* FetchTexel1D */ - fetch_texel_2d_a8, /* FetchTexel2D */ - fetch_texel_3d_a8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_a8, /* FetchTexel1Df */ + fetch_texel_2d_f_a8, /* FetchTexel2Df */ + fetch_texel_3d_f_a8, /* FetchTexel3Df */ store_texel_a8 /* StoreTexel */ }; @@ -1178,12 +1225,12 @@ const struct gl_texture_format _mesa_texformat_l8 = { 0, /* StencilBits */ 1, /* TexelBytes */ _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_l8, /* FetchTexel1D */ - fetch_texel_2d_l8, /* FetchTexel2D */ - fetch_texel_3d_l8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_l8, /* FetchTexel1Df */ + fetch_texel_2d_f_l8, /* FetchTexel2Df */ + fetch_texel_3d_f_l8, /* FetchTexel3Df */ store_texel_l8 /* StoreTexel */ }; @@ -1202,12 +1249,12 @@ const struct gl_texture_format _mesa_texformat_i8 = { 0, /* StencilBits */ 1, /* TexelBytes */ _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ - fetch_texel_1d_i8, /* FetchTexel1D */ - fetch_texel_2d_i8, /* FetchTexel2D */ - fetch_texel_3d_i8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_i8, /* FetchTexel1Df */ + fetch_texel_2d_f_i8, /* FetchTexel2Df */ + fetch_texel_3d_f_i8, /* FetchTexel3Df */ store_texel_i8 /* StoreTexel */ }; @@ -1226,12 +1273,12 @@ const struct gl_texture_format _mesa_texformat_ci8 = { 0, /* StencilBits */ 1, /* TexelBytes */ _mesa_texstore_ci8, /* StoreTexImageFunc */ - fetch_texel_1d_ci8, /* FetchTexel1D */ - fetch_texel_2d_ci8, /* FetchTexel2D */ - fetch_texel_3d_ci8, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_ci8, /* FetchTexel1Df */ + fetch_texel_2d_f_ci8, /* FetchTexel2Df */ + fetch_texel_3d_f_ci8, /* FetchTexel3Df */ store_texel_ci8 /* StoreTexel */ }; @@ -1250,12 +1297,12 @@ const struct gl_texture_format _mesa_texformat_ycbcr = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_ycbcr, /* StoreTexImageFunc */ - fetch_texel_1d_ycbcr, /* FetchTexel1D */ - fetch_texel_2d_ycbcr, /* FetchTexel2D */ - fetch_texel_3d_ycbcr, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_ycbcr, /* FetchTexel1Df */ + fetch_texel_2d_f_ycbcr, /* FetchTexel2Df */ + fetch_texel_3d_f_ycbcr, /* FetchTexel3Df */ store_texel_ycbcr /* StoreTexel */ }; @@ -1274,12 +1321,12 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { 0, /* StencilBits */ 2, /* TexelBytes */ _mesa_texstore_ycbcr, /* StoreTexImageFunc */ - fetch_texel_1d_ycbcr_rev, /* FetchTexel1D */ - fetch_texel_2d_ycbcr_rev, /* FetchTexel2D */ - fetch_texel_3d_ycbcr_rev, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel2D */ + NULL, /* FetchTexel3D */ + fetch_texel_1d_f_ycbcr_rev, /* FetchTexel1Df */ + fetch_texel_2d_f_ycbcr_rev, /* FetchTexel2Df */ + fetch_texel_3d_f_ycbcr_rev, /* FetchTexel3Df */ store_texel_ycbcr_rev /* StoreTexel */ }; @@ -1671,6 +1718,17 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, } } + if (ctx->Extensions.MESA_texture_signed_rgba) { + switch (internalFormat) { + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return &_mesa_texformat_signed_rgba8888; + default: + ; /* fallthrough */ + } + } + + #if FEATURE_EXT_texture_sRGB if (ctx->Extensions.EXT_texture_sRGB) { switch (internalFormat) { @@ -1820,6 +1878,12 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format, *comps = 2; return; + case MESA_FORMAT_SIGNED_RGBA8888: + case MESA_FORMAT_SIGNED_RGBA8888_REV: + *datatype = GL_BYTE; + *comps = 4; + return; + #if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB8: *datatype = GL_UNSIGNED_BYTE; diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 7fa70ad4fe..5aa1d756cb 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -168,7 +168,9 @@ enum _format { * \name Signed fixed point texture formats. */ /*@{*/ - MESA_FORMAT_DUDV8 + MESA_FORMAT_DUDV8, + MESA_FORMAT_SIGNED_RGBA8888, + MESA_FORMAT_SIGNED_RGBA8888_REV /*@}*/ }; @@ -219,6 +221,8 @@ extern const struct gl_texture_format _mesa_texformat_intensity_float16; /** Signed fixed point texture formats */ /*@{*/ extern const struct gl_texture_format _mesa_texformat_dudv8; +extern const struct gl_texture_format _mesa_texformat_signed_rgba8888; +extern const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev; /*@}*/ /** \name Assorted hardware-friendly formats */ diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 0f6a172ef0..f3b2fb9c9c 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -72,14 +72,6 @@ /* MESA_FORMAT_RGBA **********************************************************/ -/* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLchans */ -static void FETCH(rgba)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - COPY_CHAN4( texel, src ); -} - /* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLfloats */ static void FETCH(f_rgba)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) @@ -107,17 +99,6 @@ static void store_texel_rgba(struct gl_texture_image *texImage, /* MESA_FORMAT_RGB ***********************************************************/ -/* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLchans */ -static void FETCH(rgb)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = CHAN_MAX; -} - /* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLfloats */ static void FETCH(f_rgb)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) @@ -144,14 +125,14 @@ static void store_texel_rgb(struct gl_texture_image *texImage, /* MESA_FORMAT_ALPHA *********************************************************/ /* Fetch texel from 1D, 2D or 3D ALPHA texture, returning 4 GLchans */ -static void FETCH(alpha)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_alpha)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = 0; - texel[ACOMP] = src[0]; + texel[BCOMP] = 0.0F; + texel[ACOMP] = CHAN_TO_FLOAT(src[0]); } #if DIM == 3 @@ -167,14 +148,14 @@ static void store_texel_alpha(struct gl_texture_image *texImage, /* MESA_FORMAT_LUMINANCE *****************************************************/ /* Fetch texel from 1D, 2D or 3D LUMIN texture, returning 4 GLchans */ -static void FETCH(luminance)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_luminance)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = CHAN_MAX; + texel[BCOMP] = CHAN_TO_FLOAT(src[0]); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -190,14 +171,14 @@ static void store_texel_luminance(struct gl_texture_image *texImage, /* MESA_FORMAT_LUMINANCE_ALPHA ***********************************************/ /* Fetch texel from 1D, 2D or 3D L_A texture, returning 4 GLchans */ -static void FETCH(luminance_alpha)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_luminance_alpha)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[0]; - texel[BCOMP] = src[0]; - texel[ACOMP] = src[1]; + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = CHAN_TO_FLOAT(src[0]); + texel[ACOMP] = CHAN_TO_FLOAT(src[1]); } #if DIM == 3 @@ -214,14 +195,14 @@ static void store_texel_luminance_alpha(struct gl_texture_image *texImage, /* MESA_FORMAT_INTENSITY *****************************************************/ /* Fetch texel from 1D, 2D or 3D INT. texture, returning 4 GLchans */ -static void FETCH(intensity)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_intensity)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[0]; - texel[BCOMP] = src[0]; - texel[ACOMP] = src[0]; + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = CHAN_TO_FLOAT(src[0]); } #if DIM == 3 @@ -606,17 +587,19 @@ static void store_texel_intensity_f16(struct gl_texture_image *texImage, /* MESA_FORMAT_RGBA8888 ******************************************************/ -/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLchans */ -static void FETCH(rgba8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */ +static void FETCH(f_rgba8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s >> 24) ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); } + + #if DIM == 3 static void store_texel_rgba8888(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) @@ -631,14 +614,14 @@ static void store_texel_rgba8888(struct gl_texture_image *texImage, /* MESA_FORMAT_RGBA888_REV ***************************************************/ /* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ -static void FETCH(rgba8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgba8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( (s >> 24) ); + texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); } #if DIM == 3 @@ -655,14 +638,14 @@ static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, /* MESA_FORMAT_ARGB8888 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ -static void FETCH(argb8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_argb8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( (s >> 24) ); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); } #if DIM == 3 @@ -678,15 +661,15 @@ static void store_texel_argb8888(struct gl_texture_image *texImage, /* MESA_FORMAT_ARGB8888_REV **************************************************/ -/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLchans */ -static void FETCH(argb8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */ +static void FETCH(f_argb8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); - texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_CHAN( (s >> 24) ); - texel[ACOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); } #if DIM == 3 @@ -703,14 +686,14 @@ static void store_texel_argb8888_rev(struct gl_texture_image *texImage, /* MESA_FORMAT_RGB888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ -static void FETCH(rgb888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgb888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_CHAN( src[2] ); - texel[GCOMP] = UBYTE_TO_CHAN( src[1] ); - texel[BCOMP] = UBYTE_TO_CHAN( src[0] ); - texel[ACOMP] = CHAN_MAX; + texel[RCOMP] = UBYTE_TO_FLOAT( src[2] ); + texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); + texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -729,14 +712,14 @@ static void store_texel_rgb888(struct gl_texture_image *texImage, /* MESA_FORMAT_BGR888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ -static void FETCH(bgr888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_bgr888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_CHAN( src[0] ); - texel[GCOMP] = UBYTE_TO_CHAN( src[1] ); - texel[BCOMP] = UBYTE_TO_CHAN( src[2] ); - texel[ACOMP] = CHAN_MAX; + texel[RCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); + texel[BCOMP] = UBYTE_TO_FLOAT( src[2] ); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -758,15 +741,15 @@ static void store_texel_bgr888(struct gl_texture_image *texImage, /* MESA_FORMAT_RGB565 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ -static void FETCH(rgb565)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = CHAN_MAX; + texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 5 ) & 0x3f) * (1.0F / 63.0F); + texel[BCOMP] = ((s ) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -783,15 +766,15 @@ static void store_texel_rgb565(struct gl_texture_image *texImage, /* MESA_FORMAT_RGB565_REV ****************************************************/ /* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ -static void FETCH(rgb565_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = CHAN_MAX; + texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); + texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); + texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -807,15 +790,15 @@ static void store_texel_rgb565_rev(struct gl_texture_image *texImage, /* MESA_FORMAT_RGBA4444 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(rgba4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgba4444)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); + texel[RCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s ) & 0xf) * (1.0F / 15.0F); } #if DIM == 3 @@ -832,15 +815,15 @@ static void store_texel_rgba4444(struct gl_texture_image *texImage, /* MESA_FORMAT_ARGB4444 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(argb4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); + texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); } #if DIM == 3 @@ -857,14 +840,14 @@ static void store_texel_argb4444(struct gl_texture_image *texImage, /* MESA_FORMAT_ARGB4444_REV **************************************************/ /* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ -static void FETCH(argb4444_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_argb4444_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) | ((s << 4) & 0xf0) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) | ((s >> 4) & 0xf0) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) | ((s ) & 0xf0) ); + texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); } #if DIM == 3 @@ -880,15 +863,15 @@ static void store_texel_argb4444_rev(struct gl_texture_image *texImage, /* MESA_FORMAT_RGBA5551 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(rgba5551)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgba5551)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xf8) | ((s >> 8) & 0x7) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 2) & 0xf8) | ((s >> 3) & 0x7) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s) & 0x01) ? 255 : 0); + texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 6) & 0x1f) * (1.0F / 31.0F); + texel[BCOMP] = ((s >> 1) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = ((s ) & 0x01) * 1.0F; } #if DIM == 3 @@ -904,15 +887,15 @@ static void store_texel_rgba5551(struct gl_texture_image *texImage, /* MESA_FORMAT_ARGB1555 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(argb1555)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 15) & 0x01) * 255 ); + texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); + texel[BCOMP] = ((s >> 0) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F; } #if DIM == 3 @@ -929,15 +912,15 @@ static void store_texel_argb1555(struct gl_texture_image *texImage, /* MESA_FORMAT_ARGB1555_REV **************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ -static void FETCH(argb1555_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ - texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); - texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); - texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 15) & 0x01) * 255 ); + texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); + texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); + texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); + texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 ); } #if DIM == 3 @@ -954,14 +937,14 @@ static void store_texel_argb1555_rev(struct gl_texture_image *texImage, /* MESA_FORMAT_AL88 **********************************************************/ /* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ -static void FETCH(al88)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_al88)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_CHAN( s & 0xff ); - texel[ACOMP] = UBYTE_TO_CHAN( s >> 8 ); + texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); } #if DIM == 3 @@ -978,14 +961,14 @@ static void store_texel_al88(struct gl_texture_image *texImage, /* MESA_FORMAT_AL88_REV ******************************************************/ /* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ -static void FETCH(al88_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_CHAN( s >> 8 ); - texel[ACOMP] = UBYTE_TO_CHAN( s & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); + texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); } #if DIM == 3 @@ -1002,17 +985,15 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage, /* MESA_FORMAT_RGB332 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ -static void FETCH(rgb332)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { - static const GLubyte lut2to8[4] = {0, 85, 170, 255}; - static const GLubyte lut3to8[8] = {0, 36, 73, 109, 146, 182, 219, 255}; const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); const GLubyte s = *src; - texel[RCOMP] = UBYTE_TO_CHAN( lut3to8[(s >> 5) & 0x7] ); - texel[GCOMP] = UBYTE_TO_CHAN( lut3to8[(s >> 2) & 0x7] ); - texel[BCOMP] = UBYTE_TO_CHAN( lut2to8[(s ) & 0x3] ); - texel[ACOMP] = CHAN_MAX; + texel[RCOMP] = ((s >> 5) & 0x7) * (1.0F / 7.0F); + texel[GCOMP] = ((s >> 2) & 0x7) * (1.0F / 7.0F); + texel[BCOMP] = ((s ) & 0x3) * (1.0F / 3.0F); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -1029,14 +1010,14 @@ static void store_texel_rgb332(struct gl_texture_image *texImage, /* MESA_FORMAT_A8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ -static void FETCH(a8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_a8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = 0; - texel[ACOMP] = UBYTE_TO_CHAN( src[0] ); + texel[BCOMP] = 0.0F; + texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); } #if DIM == 3 @@ -1053,14 +1034,14 @@ static void store_texel_a8(struct gl_texture_image *texImage, /* MESA_FORMAT_L8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ -static void FETCH(l8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_l8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_CHAN( src[0] ); - texel[ACOMP] = CHAN_MAX; + texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -1077,14 +1058,14 @@ static void store_texel_l8(struct gl_texture_image *texImage, /* MESA_FORMAT_I8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ -static void FETCH(i8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_i8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = - texel[ACOMP] = UBYTE_TO_CHAN( src[0] ); + texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); } #if DIM == 3 @@ -1103,12 +1084,11 @@ static void store_texel_i8(struct gl_texture_image *texImage, /* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a * color table, and return 4 GLchans. */ -static void FETCH(ci8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +static void FETCH(f_ci8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); const struct gl_color_table *palette; - GLubyte texelUB[4]; GLuint index; GET_CURRENT_CONTEXT(ctx); @@ -1125,61 +1105,48 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, index = (*src) & (palette->Size - 1); { - const GLubyte *table = palette->TableUB; + const GLfloat *table = palette->TableF; switch (palette->_BaseFormat) { case GL_ALPHA: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = 0; - texelUB[ACOMP] = table[index]; - break;; + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = table[index]; + break; case GL_LUMINANCE: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = table[index]; - texelUB[ACOMP] = 255; + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = table[index]; + texel[ACOMP] = 1.0F; break; case GL_INTENSITY: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = - texelUB[ACOMP] = table[index]; - break;; + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = table[index]; + break; case GL_LUMINANCE_ALPHA: - texelUB[RCOMP] = - texelUB[GCOMP] = - texelUB[BCOMP] = table[index * 2 + 0]; - texelUB[ACOMP] = table[index * 2 + 1]; - break;; + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = table[index * 2 + 0]; + texel[ACOMP] = table[index * 2 + 1]; + break; case GL_RGB: - texelUB[RCOMP] = table[index * 3 + 0]; - texelUB[GCOMP] = table[index * 3 + 1]; - texelUB[BCOMP] = table[index * 3 + 2]; - texelUB[ACOMP] = 255; - break;; + texel[RCOMP] = table[index * 3 + 0]; + texel[GCOMP] = table[index * 3 + 1]; + texel[BCOMP] = table[index * 3 + 2]; + texel[ACOMP] = 1.0F; + break; case GL_RGBA: - texelUB[RCOMP] = table[index * 4 + 0]; - texelUB[GCOMP] = table[index * 4 + 1]; - texelUB[BCOMP] = table[index * 4 + 2]; - texelUB[ACOMP] = table[index * 4 + 3]; - break;; + texel[RCOMP] = table[index * 4 + 0]; + texel[GCOMP] = table[index * 4 + 1]; + texel[BCOMP] = table[index * 4 + 2]; + texel[ACOMP] = table[index * 4 + 3]; + break; default: _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); return; } -#if CHAN_TYPE == GL_UNSIGNED_BYTE - COPY_4UBV(texel, texelUB); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - texel[0] = UBYTE_TO_USHORT(texelUB[0]); - texel[1] = UBYTE_TO_USHORT(texelUB[1]); - texel[2] = UBYTE_TO_USHORT(texelUB[2]); - texel[3] = UBYTE_TO_USHORT(texelUB[3]); -#else - texel[0] = UBYTE_TO_FLOAT(texelUB[0]); - texel[1] = UBYTE_TO_FLOAT(texelUB[1]); - texel[2] = UBYTE_TO_FLOAT(texelUB[2]); - texel[3] = UBYTE_TO_FLOAT(texelUB[3]); -#endif } } @@ -1197,14 +1164,15 @@ static void store_texel_ci8(struct gl_texture_image *texImage, #if FEATURE_EXT_texture_sRGB /* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ +/* Note: component order is same as for MESA_FORMAT_RGB888 */ static void FETCH(srgb8)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = nonlinear_to_linear(src[0]); + texel[RCOMP] = nonlinear_to_linear(src[2]); texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[2]); - texel[ACOMP] = CHAN_MAX; + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -1213,9 +1181,9 @@ static void store_texel_srgb8(struct gl_texture_image *texImage, { const GLubyte *rgba = (const GLubyte *) texel; GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; /* no conversion */ + dst[0] = rgba[BCOMP]; /* no conversion */ dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; + dst[2] = rgba[RCOMP]; } #endif @@ -1321,14 +1289,57 @@ static void FETCH(dudv8)(const struct gl_texture_image *texImage, texel[ACOMP] = 0; } +/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/ + +static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLbyte *rgba = (const GLbyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +static void FETCH(signed_rgba8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + /* MESA_FORMAT_YCBCR *********************************************************/ -/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLchans */ -/* We convert YCbCr to RGB here */ -/* XXX this may break if GLchan != GLubyte */ -static void FETCH(ycbcr)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats. + * We convert YCbCr to RGB here. + */ +static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ const GLushort *src1 = src0 + 1; /* odd */ @@ -1336,23 +1347,17 @@ static void FETCH(ycbcr)( const struct gl_texture_image *texImage, const GLubyte cb = *src0 & 0xff; /* chroma U */ const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ const GLubyte cr = *src1 & 0xff; /* chroma V */ - GLint r, g, b; - if (i & 1) { - /* odd pixel: use y1,cr,cb */ - r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128)); - } - else { - /* even pixel: use y0,cr,cb */ - r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128)); - } - texel[RCOMP] = CLAMP(r, 0, CHAN_MAX); - texel[GCOMP] = CLAMP(g, 0, CHAN_MAX); - texel[BCOMP] = CLAMP(b, 0, CHAN_MAX); - texel[ACOMP] = CHAN_MAX; + const GLfloat y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164 * (y - 16) + 1.596 * (cr - 128); + GLfloat g = 1.164 * (y - 16) - 0.813 * (cr - 128) - 0.391 * (cb - 128); + GLfloat b = 1.164 * (y - 16) + 2.018 * (cb - 128); + r *= (1.0 / 255.0F); + g *= (1.0 / 255.0F); + b *= (1.0 / 255.0F); + texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); + texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); + texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); + texel[ACOMP] = 1.0F; } #if DIM == 3 @@ -1371,11 +1376,11 @@ static void store_texel_ycbcr(struct gl_texture_image *texImage, /* MESA_FORMAT_YCBCR_REV *****************************************************/ -/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLchans */ -/* We convert YCbCr to RGB here */ -/* XXX this may break if GLchan != GLubyte */ -static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLfloats. + * We convert YCbCr to RGB here. + */ +static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ const GLushort *src1 = src0 + 1; /* odd */ @@ -1383,23 +1388,17 @@ static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage, const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ const GLubyte y1 = *src1 & 0xff; /* luminance */ const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ - GLint r, g, b; - if (i & 1) { - /* odd pixel: use y1,cr,cb */ - r = (GLint) (1.164 * (y1-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y1-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y1-16) + 2.018 * (cb-128)); - } - else { - /* even pixel: use y0,cr,cb */ - r = (GLint) (1.164 * (y0-16) + 1.596 * (cr-128)); - g = (GLint) (1.164 * (y0-16) - 0.813 * (cr-128) - 0.391 * (cb-128)); - b = (GLint) (1.164 * (y0-16) + 2.018 * (cb-128)); - } - texel[RCOMP] = CLAMP(r, 0, CHAN_MAX); - texel[GCOMP] = CLAMP(g, 0, CHAN_MAX); - texel[BCOMP] = CLAMP(b, 0, CHAN_MAX); - texel[ACOMP] = CHAN_MAX; + const GLfloat y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164 * (y - 16) + 1.596 * (cr - 128); + GLfloat g = 1.164 * (y - 16) - 0.813 * (cr - 128) - 0.391 * (cb - 128); + GLfloat b = 1.164 * (y - 16) + 2.018 * (cb - 128); + r *= (1.0 / 255.0F); + g *= (1.0 / 255.0F); + b *= (1.0 / 255.0F); + texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); + texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); + texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); + texel[ACOMP] = 1.0F; } #if DIM == 3 diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c new file mode 100644 index 0000000000..70a25080cb --- /dev/null +++ b/src/mesa/main/texgetimage.c @@ -0,0 +1,356 @@ +/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2009 VMware, Inc. + * + * 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. + */ + + +/** + * Code for glGetTexImage() and glGetCompressedTexImage(). + */ + + +#include "glheader.h" +#include "context.h" +#include "image.h" +#include "texcompress.h" +#include "texformat.h" +#include "texgetimage.h" + + + +#if FEATURE_EXT_texture_sRGB + +/** + * Test if given texture image is an sRGB format. + */ +static GLboolean +is_srgb_teximage(const struct gl_texture_image *texImage) +{ + switch (texImage->TexFormat->MesaFormat) { + case MESA_FORMAT_SRGB8: + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + case MESA_FORMAT_SL8: + case MESA_FORMAT_SLA8: + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +/** + * Convert a float value from linear space to a + * non-linear sRGB value in [0, 255]. + * Not terribly efficient. + */ +static INLINE GLfloat +linear_to_nonlinear(GLfloat cl) +{ + /* can't have values outside [0, 1] */ + GLfloat cs; + if (cl < 0.0031308) { + cs = 12.92 * cl; + } + else { + cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055; + } + return cs; +} + +#endif /* FEATURE_EXT_texture_sRGB */ + + +/** + * Can the given type represent negative values? + */ +static INLINE GLboolean +type_with_negative_values(GLenum type) +{ + switch (type) { + case GL_BYTE: + case GL_SHORT: + case GL_INT: + case GL_FLOAT: + case GL_HALF_FLOAT_ARB: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +/** + * This is the software fallback for Driver.GetTexImage(). + * All error checking will have been done before this routine is called. + */ +void +_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid *pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; + + if (ctx->Pack.BufferObj->Name) { + /* Packing texture image into a PBO. + * Map the (potentially) VRAM-based buffer into our process space so + * we can write into it with the code below. + * A hardware driver might use a sophisticated blit to move the + * texture data to the PBO if the PBO is in VRAM along with the texture. + */ + GLubyte *buf = (GLubyte *) + ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); + if (!buf) { + /* buffer is already mapped - that's an error */ + _mesa_error(ctx, GL_INVALID_OPERATION,"glGetTexImage(PBO is mapped)"); + return; + } + /* <pixels> was an offset into the PBO. + * Now make it a real, client-side pointer inside the mapped region. + */ + pixels = ADD_POINTERS(buf, pixels); + } + else if (!pixels) { + /* not an error */ + return; + } + + { + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + GLint img, row; + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + /* compute destination address in client memory */ + GLvoid *dest = _mesa_image_address( dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + assert(dest); + + if (format == GL_COLOR_INDEX) { + GLuint indexRow[MAX_WIDTH]; + GLint col; + /* Can't use FetchTexel here because that returns RGBA */ + if (texImage->TexFormat->IndexBits == 8) { + const GLubyte *src = (const GLubyte *) texImage->Data; + src += width * (img * texImage->Height + row); + for (col = 0; col < width; col++) { + indexRow[col] = src[col]; + } + } + else if (texImage->TexFormat->IndexBits == 16) { + const GLushort *src = (const GLushort *) texImage->Data; + src += width * (img * texImage->Height + row); + for (col = 0; col < width; col++) { + indexRow[col] = src[col]; + } + } + else { + _mesa_problem(ctx, + "Color index problem in _mesa_GetTexImage"); + } + _mesa_pack_index_span(ctx, width, type, dest, + indexRow, &ctx->Pack, + 0 /* no image transfer */); + } + else if (format == GL_DEPTH_COMPONENT) { + GLfloat depthRow[MAX_WIDTH]; + GLint col; + for (col = 0; col < width; col++) { + (*texImage->FetchTexelf)(texImage, col, row, img, + depthRow + col); + } + _mesa_pack_depth_span(ctx, width, dest, type, + depthRow, &ctx->Pack); + } + else if (format == GL_DEPTH_STENCIL_EXT) { + /* XXX Note: we're bypassing texImage->FetchTexel()! */ + const GLuint *src = (const GLuint *) texImage->Data; + src += width * row + width * height * img; + _mesa_memcpy(dest, src, width * sizeof(GLuint)); + if (ctx->Pack.SwapBytes) { + _mesa_swap4((GLuint *) dest, width); + } + } + else if (format == GL_YCBCR_MESA) { + /* No pixel transfer */ + const GLint rowstride = texImage->RowStride; + MEMCPY(dest, + (const GLushort *) texImage->Data + row * rowstride, + width * sizeof(GLushort)); + /* check for byte swapping */ + if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR + && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || + (texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV + && type == GL_UNSIGNED_SHORT_8_8_MESA)) { + if (!ctx->Pack.SwapBytes) + _mesa_swap2((GLushort *) dest, width); + } + else if (ctx->Pack.SwapBytes) { + _mesa_swap2((GLushort *) dest, width); + } + } +#if FEATURE_EXT_texture_sRGB + else if (is_srgb_teximage(texImage)) { + /* special case this since need to backconvert values */ + /* convert row to RGBA format */ + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + GLbitfield transferOps = 0x0; + + for (col = 0; col < width; col++) { + (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); + if (texImage->_BaseFormat == GL_LUMINANCE) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_RGB || + texImage->_BaseFormat == GL_RGBA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); + rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps); + } +#endif /* FEATURE_EXT_texture_sRGB */ + else { + /* general case: convert row to RGBA format */ + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + GLbitfield transferOps = 0x0; + + /* clamp does not apply to GetTexImage (final conversion)? + * Looks like we need clamp though when going from format + * containing negative values to unsigned format. + */ + if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) + transferOps |= IMAGE_CLAMP_BIT; + else if (!type_with_negative_values(type) && + (texImage->TexFormat->DataType == GL_FLOAT || + texImage->TexFormat->DataType == GL_SIGNED_NORMALIZED)) + transferOps |= IMAGE_CLAMP_BIT; + + for (col = 0; col < width; col++) { + (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); + if (texImage->_BaseFormat == GL_ALPHA) { + rgba[col][RCOMP] = 0.0; + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_LUMINANCE) { + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + rgba[col][ACOMP] = 1.0; + } + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_INTENSITY) { + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + rgba[col][ACOMP] = 1.0; + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps); + } /* format */ + } /* row */ + } /* img */ + } + + if (ctx->Pack.BufferObj->Name) { + ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + ctx->Pack.BufferObj); + } +} + + + +/** + * This is the software fallback for Driver.GetCompressedTexImage(). + * All error checking will have been done before this routine is called. + */ +void +_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, + GLvoid *img, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + GLuint size; + + if (ctx->Pack.BufferObj->Name) { + /* pack texture image into a PBO */ + GLubyte *buf; + if ((const GLubyte *) img + texImage->CompressedSize > + (const GLubyte *) ctx->Pack.BufferObj->Size) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImage(invalid PBO access)"); + return; + } + buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + GL_WRITE_ONLY_ARB, + ctx->Pack.BufferObj); + if (!buf) { + /* buffer is already mapped - that's an error */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImage(PBO is mapped)"); + return; + } + img = ADD_POINTERS(buf, img); + } + else if (!img) { + /* not an error */ + return; + } + + /* don't use texImage->CompressedSize since that may be padded out */ + size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, + texImage->Depth, + texImage->TexFormat->MesaFormat); + + /* just memcpy, no pixelstore or pixel transfer */ + _mesa_memcpy(img, texImage->Data, size); + + if (ctx->Pack.BufferObj->Name) { + ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + ctx->Pack.BufferObj); + } +} diff --git a/src/mesa/main/texgetimage.h b/src/mesa/main/texgetimage.h new file mode 100644 index 0000000000..01f486e8f0 --- /dev/null +++ b/src/mesa/main/texgetimage.h @@ -0,0 +1,46 @@ +/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef TEXGETIMAGE_H +#define TEXGETIMAGE_H + + +extern void +_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid *pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + + +extern void +_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, + GLvoid *img, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage); + + + +#endif /* TEXGETIMAGE_H */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 4f297738df..8c03c36c75 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -349,6 +349,15 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat ) } } + if (ctx->Extensions.MESA_texture_signed_rgba) { + switch (internalFormat) { + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return GL_RGBA; + default: + ; /* fallthrough */ + } + } if (ctx->Extensions.EXT_packed_depth_stencil) { switch (internalFormat) { @@ -502,6 +511,10 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: #endif /* FEATURE_EXT_texture_sRGB */ return GL_TRUE; + /* signed texture formats */ + case GL_RGBA_SNORM: + case GL_RGBA8_SNORM: + return GL_TRUE; case GL_YCBCR_MESA: /* not considered to be RGB */ /* fall-through */ default: diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 50f867e1c1..515a35cdfc 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -179,8 +179,11 @@ flush(GLcontext *ctx, struct gl_texture_object *texObj) } -/** Set an integer-valued texture parameter */ -static void +/** + * Set an integer-valued texture parameter + * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise + */ +static GLboolean set_tex_parameteri(GLcontext *ctx, struct gl_texture_object *texObj, GLenum pname, const GLint *params) @@ -188,13 +191,13 @@ set_tex_parameteri(GLcontext *ctx, switch (pname) { case GL_TEXTURE_MIN_FILTER: if (texObj->MinFilter == params[0]) - return; + return GL_FALSE; switch (params[0]) { case GL_NEAREST: case GL_LINEAR: flush(ctx, texObj); texObj->MinFilter = params[0]; - return; + return GL_TRUE; case GL_NEAREST_MIPMAP_NEAREST: case GL_LINEAR_MIPMAP_NEAREST: case GL_NEAREST_MIPMAP_LINEAR: @@ -202,90 +205,95 @@ set_tex_parameteri(GLcontext *ctx, if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) { flush(ctx, texObj); texObj->MinFilter = params[0]; - return; + return GL_TRUE; } /* fall-through */ default: _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); } - return; + return GL_FALSE; case GL_TEXTURE_MAG_FILTER: if (texObj->MagFilter == params[0]) - return; + return GL_FALSE; switch (params[0]) { case GL_NEAREST: case GL_LINEAR: flush(ctx, texObj); texObj->MagFilter = params[0]; - return; + return GL_TRUE; default: _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); } - return; + return GL_FALSE; case GL_TEXTURE_WRAP_S: if (texObj->WrapS == params[0]) - return; + return GL_FALSE; if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { flush(ctx, texObj); texObj->WrapS = params[0]; + return GL_TRUE; } - return; + return GL_FALSE; case GL_TEXTURE_WRAP_T: if (texObj->WrapT == params[0]) - return; + return GL_FALSE; if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { flush(ctx, texObj); texObj->WrapT = params[0]; + return GL_TRUE; } - return; + return GL_FALSE; case GL_TEXTURE_WRAP_R: if (texObj->WrapR == params[0]) - return; + return GL_FALSE; if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) { flush(ctx, texObj); texObj->WrapR = params[0]; + return GL_TRUE; } - return; + return GL_FALSE; case GL_TEXTURE_BASE_LEVEL: if (texObj->BaseLevel == params[0]) - return; + return GL_FALSE; if (params[0] < 0 || (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) { _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)"); - return; + return GL_FALSE; } flush(ctx, texObj); texObj->BaseLevel = params[0]; - return; + return GL_TRUE; case GL_TEXTURE_MAX_LEVEL: if (texObj->MaxLevel == params[0]) - return; + return GL_FALSE; if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)"); - return; + return GL_FALSE; } flush(ctx, texObj); texObj->MaxLevel = params[0]; - return; + return GL_TRUE; case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { if (texObj->GenerateMipmap != params[0]) { flush(ctx, texObj); texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE; + return GL_TRUE; } + return GL_FALSE; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)"); } - return; + return GL_FALSE; case GL_TEXTURE_COMPARE_MODE_ARB: if (ctx->Extensions.ARB_shadow && @@ -294,24 +302,26 @@ set_tex_parameteri(GLcontext *ctx, if (texObj->CompareMode != params[0]) { flush(ctx, texObj); texObj->CompareMode = params[0]; + return GL_TRUE; } + return GL_FALSE; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)"); } - return; + return GL_FALSE; case GL_TEXTURE_COMPARE_FUNC_ARB: if (ctx->Extensions.ARB_shadow) { if (texObj->CompareFunc == params[0]) - return; + return GL_FALSE; switch (params[0]) { case GL_LEQUAL: case GL_GEQUAL: flush(ctx, texObj); texObj->CompareFunc = params[0]; - return; + return GL_TRUE; case GL_EQUAL: case GL_NOTEQUAL: case GL_LESS: @@ -321,7 +331,7 @@ set_tex_parameteri(GLcontext *ctx, if (ctx->Extensions.EXT_shadow_funcs) { flush(ctx, texObj); texObj->CompareFunc = params[0]; - return; + return GL_TRUE; } /* fall-through */ default: @@ -332,7 +342,7 @@ set_tex_parameteri(GLcontext *ctx, else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)"); } - return; + return GL_FALSE; case GL_DEPTH_TEXTURE_MODE_ARB: if (ctx->Extensions.ARB_depth_texture && @@ -342,13 +352,14 @@ set_tex_parameteri(GLcontext *ctx, if (texObj->DepthMode != params[0]) { flush(ctx, texObj); texObj->DepthMode = params[0]; + return GL_TRUE; } } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)"); } - return; + return GL_FALSE; #ifdef FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: @@ -356,7 +367,7 @@ set_tex_parameteri(GLcontext *ctx, texObj->CropRect[1] = params[1]; texObj->CropRect[2] = params[2]; texObj->CropRect[3] = params[3]; - return; + return GL_TRUE; #endif case GL_TEXTURE_SWIZZLE_R_EXT: @@ -369,18 +380,18 @@ set_tex_parameteri(GLcontext *ctx, if (swz < 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(swizzle 0x%x)", params[0]); - return; + return GL_FALSE; } ASSERT(comp < 4); if (swz >= 0) { flush(ctx, texObj); texObj->Swizzle[comp] = params[0]; set_swizzle_component(&texObj->_Swizzle, comp, swz); - return; + return GL_TRUE; } } _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); - return; + return GL_FALSE; case GL_TEXTURE_SWIZZLE_RGBA_EXT: if (ctx->Extensions.EXT_texture_swizzle) { @@ -395,22 +406,26 @@ set_tex_parameteri(GLcontext *ctx, else { _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(swizzle 0x%x)", params[comp]); - return; + return GL_FALSE; } } - return; + return GL_TRUE; } _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); - return; + return GL_FALSE; default: _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); } + return GL_FALSE; } -/** Set a float-valued texture parameter */ -static void +/** + * Set a float-valued texture parameter + * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise + */ +static GLboolean set_tex_parameterf(GLcontext *ctx, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params) @@ -418,54 +433,56 @@ set_tex_parameterf(GLcontext *ctx, switch (pname) { case GL_TEXTURE_MIN_LOD: if (texObj->MinLod == params[0]) - return; + return GL_FALSE; flush(ctx, texObj); texObj->MinLod = params[0]; - return; + return GL_TRUE; case GL_TEXTURE_MAX_LOD: if (texObj->MaxLod == params[0]) - return; + return GL_FALSE; flush(ctx, texObj); texObj->MaxLod = params[0]; - return; + return GL_TRUE; case GL_TEXTURE_PRIORITY: flush(ctx, texObj); texObj->Priority = CLAMP(params[0], 0.0F, 1.0F); - return; + return GL_TRUE; case GL_TEXTURE_MAX_ANISOTROPY_EXT: if (ctx->Extensions.EXT_texture_filter_anisotropic) { if (texObj->MaxAnisotropy == params[0]) - return; + return GL_FALSE; if (params[0] < 1.0) { _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); - return; + return GL_FALSE; } flush(ctx, texObj); /* clamp to max, that's what NVIDIA does */ texObj->MaxAnisotropy = MIN2(params[0], ctx->Const.MaxTextureMaxAnisotropy); + return GL_TRUE; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)"); } - return; + return GL_FALSE; case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: if (ctx->Extensions.ARB_shadow_ambient) { if (texObj->CompareFailValue != params[0]) { flush(ctx, texObj); texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); + return GL_TRUE; } } else { _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)"); } - return; + return GL_FALSE; case GL_TEXTURE_LOD_BIAS: /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */ @@ -473,7 +490,9 @@ set_tex_parameterf(GLcontext *ctx, if (texObj->LodBias != params[0]) { flush(ctx, texObj); texObj->LodBias = params[0]; + return GL_TRUE; } + return GL_FALSE; } break; @@ -483,21 +502,19 @@ set_tex_parameterf(GLcontext *ctx, texObj->BorderColor[GCOMP] = params[1]; texObj->BorderColor[BCOMP] = params[2]; texObj->BorderColor[ACOMP] = params[3]; - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); - return; + return GL_TRUE; default: _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname); } + return GL_FALSE; } void GLAPIENTRY _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) { + GLboolean need_update; struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -521,15 +538,15 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) { /* convert float param to int */ GLint p = (GLint) param; - set_tex_parameteri(ctx, texObj, pname, &p); + need_update = set_tex_parameteri(ctx, texObj, pname, &p); } - return; + break; default: /* this will generate an error if pname is illegal */ - set_tex_parameterf(ctx, texObj, pname, ¶m); + need_update = set_tex_parameterf(ctx, texObj, pname, ¶m); } - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + if (ctx->Driver.TexParameter && need_update) { ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m); } } @@ -538,6 +555,7 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) void GLAPIENTRY _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) { + GLboolean need_update; struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -561,7 +579,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) { /* convert float param to int */ GLint p = (GLint) params[0]; - set_tex_parameteri(ctx, texObj, pname, &p); + need_update = set_tex_parameteri(ctx, texObj, pname, &p); } break; @@ -574,17 +592,17 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) iparams[1] = (GLint) params[1]; iparams[2] = (GLint) params[2]; iparams[3] = (GLint) params[3]; - set_tex_parameteri(ctx, target, iparams); + need_update = set_tex_parameteri(ctx, target, iparams); } break; #endif default: /* this will generate an error if pname is illegal */ - set_tex_parameterf(ctx, texObj, pname, params); + need_update = set_tex_parameterf(ctx, texObj, pname, params); } - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + if (ctx->Driver.TexParameter && need_update) { ctx->Driver.TexParameter(ctx, target, texObj, pname, params); } } @@ -593,6 +611,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) void GLAPIENTRY _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) { + GLboolean need_update; struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -611,15 +630,15 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) { GLfloat fparam = (GLfloat) param; /* convert int param to float */ - set_tex_parameterf(ctx, texObj, pname, &fparam); + need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); } break; default: /* this will generate an error if pname is illegal */ - set_tex_parameteri(ctx, texObj, pname, ¶m); + need_update = set_tex_parameteri(ctx, texObj, pname, ¶m); } - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + if (ctx->Driver.TexParameter && need_update) { GLfloat fparam = (GLfloat) param; ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam); } @@ -629,6 +648,7 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) void GLAPIENTRY _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) { + GLboolean need_update; struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -646,7 +666,7 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) fparams[1] = INT_TO_FLOAT(params[1]); fparams[2] = INT_TO_FLOAT(params[2]); fparams[3] = INT_TO_FLOAT(params[3]); - set_tex_parameterf(ctx, texObj, pname, fparams); + need_update = set_tex_parameterf(ctx, texObj, pname, fparams); } break; case GL_TEXTURE_MIN_LOD: @@ -658,15 +678,15 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) { /* convert int param to float */ GLfloat fparam = (GLfloat) params[0]; - set_tex_parameterf(ctx, texObj, pname, &fparam); + need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); } break; default: /* this will generate an error if pname is illegal */ - set_tex_parameteri(ctx, texObj, pname, params); + need_update = set_tex_parameteri(ctx, texObj, pname, params); } - if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) { + if (ctx->Driver.TexParameter && need_update) { GLfloat fparams[4]; fparams[0] = INT_TO_FLOAT(params[0]); if (pname == GL_TEXTURE_BORDER_COLOR || diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index cc3c6958c7..f3739f950b 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.3 + * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (c) 2008 VMware, Inc. + * Copyright (c) 2008-2009 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -798,6 +798,7 @@ static const GLubyte * type_mapping( GLenum srcType ) { switch (srcType) { + case GL_BYTE: case GL_UNSIGNED_BYTE: return map_identity; case GL_UNSIGNED_INT_8_8_8_8: @@ -819,6 +820,7 @@ byteswap_mapping( GLboolean swapBytes, return map_identity; switch (srcType) { + case GL_BYTE: case GL_UNSIGNED_BYTE: return map_identity; case GL_UNSIGNED_INT_8_8_8_8: @@ -2561,6 +2563,124 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) return GL_TRUE; } +/** + * Store a texture in MESA_FORMAT_SIGNED_RGBA8888 or MESA_FORMAT_SIGNED_RGBA8888_REV + */ +GLboolean +_mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) +{ + const GLboolean littleEndian = _mesa_little_endian(); + + ASSERT(dstFormat == &_mesa_texformat_signed_rgba8888 || + dstFormat == &_mesa_texformat_signed_rgba8888_rev); + ASSERT(dstFormat->TexelBytes == 4); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == &_mesa_texformat_signed_rgba8888 && + baseInternalFormat == GL_RGBA && + ((srcFormat == GL_RGBA && srcType == GL_BYTE && !littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && littleEndian))) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == &_mesa_texformat_signed_rgba8888_rev && + baseInternalFormat == GL_RGBA && + ((srcFormat == GL_RGBA && srcType == GL_BYTE && littleEndian) || + (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && !littleEndian))) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else if (!ctx->_ImageTransferState && + (srcType == GL_BYTE) && + can_swizzle(baseInternalFormat) && + can_swizzle(srcFormat)) { + + GLubyte dstmap[4]; + + /* dstmap - how to swizzle from RGBA to dst format: + */ + if ((littleEndian && dstFormat == &_mesa_texformat_signed_rgba8888) || + (!littleEndian && dstFormat == &_mesa_texformat_signed_rgba8888_rev)) { + dstmap[3] = 0; + dstmap[2] = 1; + dstmap[1] = 2; + dstmap[0] = 3; + } + else { + dstmap[3] = 3; + dstmap[2] = 2; + dstmap[1] = 1; + dstmap[0] = 0; + } + + _mesa_swizzle_ubyte_image(ctx, dims, + srcFormat, + srcType, + baseInternalFormat, + dstmap, 4, + dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcAddr, + srcPacking); + } + else { + /* general path */ + const GLfloat *tempImage = make_temp_float_image(ctx, dims, + baseInternalFormat, + dstFormat->BaseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLfloat *srcRow = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstYoffset * dstRowStride + + dstXoffset * dstFormat->TexelBytes; + for (row = 0; row < srcHeight; row++) { + GLuint *dstUI = (GLuint *) dstRow; + if (dstFormat == &_mesa_texformat_signed_rgba8888) { + for (col = 0; col < srcWidth; col++) { + dstUI[col] = PACK_COLOR_8888( FLOAT_TO_BYTE_TEX(srcRow[RCOMP]), + FLOAT_TO_BYTE_TEX(srcRow[GCOMP]), + FLOAT_TO_BYTE_TEX(srcRow[BCOMP]), + FLOAT_TO_BYTE_TEX(srcRow[ACOMP]) ); + srcRow += 4; + } + } + else { + for (col = 0; col < srcWidth; col++) { + dstUI[col] = PACK_COLOR_8888_REV( FLOAT_TO_BYTE_TEX(srcRow[RCOMP]), + FLOAT_TO_BYTE_TEX(srcRow[GCOMP]), + FLOAT_TO_BYTE_TEX(srcRow[BCOMP]), + FLOAT_TO_BYTE_TEX(srcRow[ACOMP]) ); + srcRow += 4; + } + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} /** * Store a combined depth/stencil texture image. @@ -3770,298 +3890,3 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, (void) texObj; (void) texImage; } - - - - -#if FEATURE_EXT_texture_sRGB - -/** - * Test if given texture image is an sRGB format. - */ -static GLboolean -is_srgb_teximage(const struct gl_texture_image *texImage) -{ - switch (texImage->TexFormat->MesaFormat) { - case MESA_FORMAT_SRGB8: - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: - case MESA_FORMAT_SL8: - case MESA_FORMAT_SLA8: - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Convert a float value from linear space to a - * non-linear sRGB value in [0, 255]. - * Not terribly efficient. - */ -static INLINE GLfloat -linear_to_nonlinear(GLfloat cl) -{ - /* can't have values outside [0, 1] */ - GLfloat cs; - if (cl < 0.0031308) { - cs = 12.92 * cl; - } - else { - cs = 1.055 * _mesa_pow(cl, 0.41666) - 0.055; - } - return cs; -} - -#endif /* FEATURE_EXT_texture_sRGB */ - -/** - * This is the software fallback for Driver.GetTexImage(). - * All error checking will have been done before this routine is called. - */ -void -_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; - - if (ctx->Pack.BufferObj->Name) { - /* Packing texture image into a PBO. - * Map the (potentially) VRAM-based buffer into our process space so - * we can write into it with the code below. - * A hardware driver might use a sophisticated blit to move the - * texture data to the PBO if the PBO is in VRAM along with the texture. - */ - GLubyte *buf = (GLubyte *) - ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION,"glGetTexImage(PBO is mapped)"); - return; - } - /* <pixels> was an offset into the PBO. - * Now make it a real, client-side pointer inside the mapped region. - */ - pixels = ADD_POINTERS(buf, pixels); - } - else if (!pixels) { - /* not an error */ - return; - } - - { - const GLint width = texImage->Width; - const GLint height = texImage->Height; - const GLint depth = texImage->Depth; - GLint img, row; - for (img = 0; img < depth; img++) { - for (row = 0; row < height; row++) { - /* compute destination address in client memory */ - GLvoid *dest = _mesa_image_address( dimensions, &ctx->Pack, pixels, - width, height, format, type, - img, row, 0); - assert(dest); - - if (format == GL_COLOR_INDEX) { - GLuint indexRow[MAX_WIDTH]; - GLint col; - /* Can't use FetchTexel here because that returns RGBA */ - if (texImage->TexFormat->IndexBits == 8) { - const GLubyte *src = (const GLubyte *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else if (texImage->TexFormat->IndexBits == 16) { - const GLushort *src = (const GLushort *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else { - _mesa_problem(ctx, - "Color index problem in _mesa_GetTexImage"); - } - _mesa_pack_index_span(ctx, width, type, dest, - indexRow, &ctx->Pack, - 0 /* no image transfer */); - } - else if (format == GL_DEPTH_COMPONENT) { - GLfloat depthRow[MAX_WIDTH]; - GLint col; - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, - depthRow + col); - } - _mesa_pack_depth_span(ctx, width, dest, type, - depthRow, &ctx->Pack); - } - else if (format == GL_DEPTH_STENCIL_EXT) { - /* XXX Note: we're bypassing texImage->FetchTexel()! */ - const GLuint *src = (const GLuint *) texImage->Data; - src += width * row + width * height * img; - _mesa_memcpy(dest, src, width * sizeof(GLuint)); - if (ctx->Pack.SwapBytes) { - _mesa_swap4((GLuint *) dest, width); - } - } - else if (format == GL_YCBCR_MESA) { - /* No pixel transfer */ - const GLint rowstride = texImage->RowStride; - MEMCPY(dest, - (const GLushort *) texImage->Data + row * rowstride, - width * sizeof(GLushort)); - /* check for byte swapping */ - if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR - && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || - (texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV - && type == GL_UNSIGNED_SHORT_8_8_MESA)) { - if (!ctx->Pack.SwapBytes) - _mesa_swap2((GLushort *) dest, width); - } - else if (ctx->Pack.SwapBytes) { - _mesa_swap2((GLushort *) dest, width); - } - } -#if FEATURE_EXT_texture_sRGB - else if (is_srgb_teximage(texImage)) { - /* special case this since need to backconvert values */ - /* convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->TexFormat->BaseFormat == GL_RGB || - texImage->TexFormat->BaseFormat == GL_RGBA) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); - rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps /*image xfer ops*/); - } -#endif /* FEATURE_EXT_texture_sRGB */ - else { - /* general case: convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - - if (type == GL_FLOAT && texImage->TexFormat->BaseFormat != GL_DUDV_ATI && - ((ctx->Color.ClampReadColor == GL_TRUE) || - (ctx->Color.ClampReadColor == GL_FIXED_ONLY_ARB && - texImage->TexFormat->DataType != GL_FLOAT))) - transferOps |= IMAGE_CLAMP_BIT; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->TexFormat->BaseFormat == GL_ALPHA) { - rgba[col][RCOMP] = 0.0; - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->TexFormat->BaseFormat == GL_INTENSITY) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps /*image xfer ops*/); - } /* format */ - } /* row */ - } /* img */ - } - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} - - - -/** - * This is the software fallback for Driver.GetCompressedTexImage(). - * All error checking will have been done before this routine is called. - */ -void -_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, - GLvoid *img, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLuint size; - - if (ctx->Pack.BufferObj->Name) { - /* pack texture image into a PBO */ - GLubyte *buf; - if ((const GLubyte *) img + texImage->CompressedSize > - (const GLubyte *) ctx->Pack.BufferObj->Size) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); - if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(PBO is mapped)"); - return; - } - img = ADD_POINTERS(buf, img); - } - else if (!img) { - /* not an error */ - return; - } - - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat->MesaFormat); - - /* just memcpy, no pixelstore or pixel transfer */ - _mesa_memcpy(img, texImage->Data, size); - - if (ctx->Pack.BufferObj->Name) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - ctx->Pack.BufferObj); - } -} diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index c9e639be4e..313f2d6a59 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -79,6 +79,7 @@ extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS); #endif extern GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS); +extern GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS); extern GLchan * _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, @@ -209,19 +210,6 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, struct gl_texture_image *texImage); -extern void -_mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - - -extern void -_mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, - GLvoid *img, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); - extern const GLvoid * _mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth, diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 58cae88b08..da6956efed 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1379,11 +1379,10 @@ _math_matrix_analyse( GLmatrix *mat ) if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) { matrix_invert( mat ); + mat->flags &= ~MAT_DIRTY_INVERSE; } - mat->flags &= ~(MAT_DIRTY_FLAGS| - MAT_DIRTY_TYPE| - MAT_DIRTY_INVERSE); + mat->flags &= ~(MAT_DIRTY_FLAGS | MAT_DIRTY_TYPE); } /*@}*/ diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index a4d0fc3efc..35253daa2e 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1840,7 +1840,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, if (param_var->param_binding_begin == ~0U) param_var->param_binding_begin = idx; param_var->param_binding_length++; - Program->Base.NumParameters++; } } else { @@ -1849,7 +1848,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, if (param_var->param_binding_begin == ~0U) param_var->param_binding_begin = idx; param_var->param_binding_length++; - Program->Base.NumParameters++; } break; @@ -1860,7 +1858,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, if (param_var->param_binding_begin == ~0U) param_var->param_binding_begin = idx; param_var->param_binding_length++; - Program->Base.NumParameters++; /* Check if there is more: 0 -> we're done, else its an integer */ if (**inst) { @@ -1896,7 +1893,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, idx = _mesa_add_state_reference(Program->Base.Parameters, state_tokens); param_var->param_binding_length++; - Program->Base.NumParameters++; } } else { @@ -1918,7 +1914,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, * instruction register type appropriately. */ param_var->param_binding_length++; - Program->Base.NumParameters++; break; default: @@ -1927,12 +1922,14 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, return 1; } + Program->Base.NumParameters = Program->Base.Parameters->NumParameters; + /* Make sure we haven't blown past our parameter limits */ if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (Program->Base.NumParameters >= + (Program->Base.NumParameters > ctx->Const.VertexProgram.MaxLocalParams)) || ((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - && (Program->Base.NumParameters >= + && (Program->Base.NumParameters > ctx->Const.FragmentProgram.MaxLocalParams))) { program_error(ctx, Program->Position, "Too many parameter variables"); return 1; diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index a60cda674b..bdac1d4f8a 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -836,7 +836,7 @@ _mesa_execute_program(GLcontext * ctx, * result.z = result.x * APPX(result.y) * We do what the ARB extension says. */ - q[2] = (GLfloat) pow(2.0, t[0]); + q[2] = (GLfloat) _mesa_pow(2.0, t[0]); } q[1] = t[0] - floor_t0; q[3] = 1.0F; @@ -949,7 +949,7 @@ _mesa_execute_program(GLcontext * ctx, if (a[1] == 0.0 && a[3] == 0.0) result[2] = 1.0; else - result[2] = EXPF(a[3] * LOGF(a[1])); + result[2] = (GLfloat) _mesa_pow(a[1], a[3]); } else { result[2] = 0.0; @@ -1540,8 +1540,8 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_TXB: /* GL_ARB_fragment_program only */ /* Texel lookup with LOD bias */ { - const struct gl_texture_unit *texUnit - = &ctx->Texture.Unit[inst->TexSrcUnit]; + const GLuint unit = machine->Samplers[inst->TexSrcUnit]; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; GLfloat texcoord[4], color[4], lodBias; fetch_vector4(&inst->SrcReg[0], machine, texcoord); diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 6a21152c60..ca7565c091 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -291,7 +291,9 @@ _mesa_is_tex_instruction(gl_inst_opcode opcode) const char * _mesa_opcode_string(gl_inst_opcode opcode) { - ASSERT(opcode < MAX_OPCODE); - return InstInfo[opcode].Name; + if (opcode < MAX_OPCODE) + return InstInfo[opcode].Name; + else + return "OP?"; } diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 458a69f70b..5f35dbf128 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -803,11 +803,11 @@ _mesa_optimize_program(GLcontext *ctx, struct gl_program *program) if (1) _mesa_remove_dead_code(program); - if (0) /* not test much yet */ + if (0) /* not tested much yet */ _mesa_remove_extra_moves(program); - if (1) + if (0) _mesa_consolidate_registers(program); - else /*NEW*/ + else _mesa_reallocate_registers(program); } diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 66edae9001..e9ed3985ee 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -178,15 +178,20 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, const char *name, const GLfloat values[4], GLuint size) { -#if 0 /* disable this for now -- we need to save the name! */ + /* first check if this is a duplicate constant */ GLint pos; - GLuint swizzle; - ASSERT(size == 4); /* XXX future feature */ - /* check if we already have this constant */ - if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) { - return pos; + for (pos = 0; pos < paramList->NumParameters; pos++) { + const GLfloat *pvals = paramList->ParameterValues[pos]; + if (pvals[0] == values[0] && + pvals[1] == values[1] && + pvals[2] == values[2] && + pvals[3] == values[3] && + _mesa_strcmp(paramList->Parameters[pos].Name, name) == 0) { + /* Same name and value is already in the param list - reuse it */ + return pos; + } } -#endif + /* not found, add new parameter */ return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name, size, GL_NONE, values, NULL, 0x0); } diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index aeb7cf6de2..37a3f1fc8c 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -112,7 +112,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[3] = ctx->Light.Light[ln].SpotExponent; return; case STATE_SPOT_DIRECTION: - COPY_3V(value, ctx->Light.Light[ln].EyeDirection); + COPY_3V(value, ctx->Light.Light[ln].SpotDirection); value[3] = ctx->Light.Light[ln]._CosCutoff; return; case STATE_SPOT_CUTOFF: @@ -359,10 +359,10 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], switch (state[1]) { case STATE_ENV: COPY_4V(value, ctx->FragmentProgram.Parameters[idx]); - break; + return; case STATE_LOCAL: COPY_4V(value, ctx->FragmentProgram.Current->Base.LocalParams[idx]); - break; + return; default: _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()"); return; @@ -378,10 +378,10 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], switch (state[1]) { case STATE_ENV: COPY_4V(value, ctx->VertexProgram.Parameters[idx]); - break; + return; case STATE_LOCAL: COPY_4V(value, ctx->VertexProgram.Current->Base.LocalParams[idx]); - break; + return; default: _mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()"); return; @@ -395,11 +395,12 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], case STATE_INTERNAL: switch (state[1]) { - case STATE_CURRENT_ATTRIB: { - const GLuint idx = (GLuint) state[2]; - COPY_4V(value, ctx->Current.Attrib[idx]); + case STATE_CURRENT_ATTRIB: + { + const GLuint idx = (GLuint) state[2]; + COPY_4V(value, ctx->Current.Attrib[idx]); + } return; - } case STATE_NORMAL_SCALE: ASSIGN_4V(value, @@ -408,19 +409,25 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], ctx->_ModelViewInvScale, 1); return; + case STATE_TEXRECT_SCALE: + /* Value = { 1/texWidth, 1/texHeight, 0, 1 }. + * Used to convert unnormalized texcoords to normalized texcoords. + */ { const int unit = (int) state[2]; const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; if (texObj) { struct gl_texture_image *texImage = texObj->Image[0][0]; - ASSIGN_4V(value, (GLfloat) (1.0 / texImage->Width), - (GLfloat)(1.0 / texImage->Height), + ASSIGN_4V(value, + (GLfloat) (1.0 / texImage->Width), + (GLfloat) (1.0 / texImage->Height), 0.0f, 1.0f); } } return; + case STATE_FOG_PARAMS_OPTIMIZED: /* for simpler per-vertex/pixel fog calcs. POW (for EXP/EXP2 fog) * might be more expensive than EX2 on some hw, plus it needs @@ -437,62 +444,69 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[3] = (GLfloat)(ctx->Fog.Density * ONE_DIV_SQRT_LN2); return; - case STATE_LIGHT_SPOT_DIR_NORMALIZED: { - /* here, state[2] is the light number */ - /* pre-normalize spot dir */ - const GLuint ln = (GLuint) state[2]; - COPY_3V(value, ctx->Light.Light[ln]._NormDirection); - value[3] = ctx->Light.Light[ln]._CosCutoff; + case STATE_LIGHT_SPOT_DIR_NORMALIZED: + { + /* here, state[2] is the light number */ + /* pre-normalize spot dir */ + const GLuint ln = (GLuint) state[2]; + COPY_3V(value, ctx->Light.Light[ln]._NormSpotDirection); + value[3] = ctx->Light.Light[ln]._CosCutoff; + } return; - } - case STATE_LIGHT_POSITION: { - const GLuint ln = (GLuint) state[2]; - COPY_4V(value, ctx->Light.Light[ln]._Position); + case STATE_LIGHT_POSITION: + { + const GLuint ln = (GLuint) state[2]; + COPY_4V(value, ctx->Light.Light[ln]._Position); + } return; - } - case STATE_LIGHT_POSITION_NORMALIZED: { - const GLuint ln = (GLuint) state[2]; - COPY_4V(value, ctx->Light.Light[ln]._Position); - NORMALIZE_3FV( value ); + case STATE_LIGHT_POSITION_NORMALIZED: + { + const GLuint ln = (GLuint) state[2]; + COPY_4V(value, ctx->Light.Light[ln]._Position); + NORMALIZE_3FV( value ); + } return; - } - case STATE_LIGHT_HALF_VECTOR: { - const GLuint ln = (GLuint) state[2]; - GLfloat p[3]; - /* Compute infinite half angle vector: - * halfVector = normalize(normalize(lightPos) + (0, 0, 1)) - * light.EyePosition.w should be 0 for infinite lights. - */ - COPY_3V(p, ctx->Light.Light[ln]._Position); - NORMALIZE_3FV(p); - ADD_3V(value, p, ctx->_EyeZDir); - NORMALIZE_3FV(value); - value[3] = 1.0; + case STATE_LIGHT_HALF_VECTOR: + { + const GLuint ln = (GLuint) state[2]; + GLfloat p[3]; + /* Compute infinite half angle vector: + * halfVector = normalize(normalize(lightPos) + (0, 0, 1)) + * light.EyePosition.w should be 0 for infinite lights. + */ + COPY_3V(p, ctx->Light.Light[ln]._Position); + NORMALIZE_3FV(p); + ADD_3V(value, p, ctx->_EyeZDir); + NORMALIZE_3FV(value); + value[3] = 1.0; + } return; - } - case STATE_PT_SCALE: value[0] = ctx->Pixel.RedScale; value[1] = ctx->Pixel.GreenScale; value[2] = ctx->Pixel.BlueScale; value[3] = ctx->Pixel.AlphaScale; - break; + return; + case STATE_PT_BIAS: value[0] = ctx->Pixel.RedBias; value[1] = ctx->Pixel.GreenBias; value[2] = ctx->Pixel.BlueBias; value[3] = ctx->Pixel.AlphaBias; - break; + return; + case STATE_PCM_SCALE: COPY_4V(value, ctx->Pixel.PostColorMatrixScale); - break; + return; + case STATE_PCM_BIAS: COPY_4V(value, ctx->Pixel.PostColorMatrixBias); - break; + return; + case STATE_SHADOW_AMBIENT: { const int unit = (int) state[2]; @@ -506,6 +520,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], } } return; + case STATE_FB_SIZE: value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1); value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1); @@ -522,7 +537,8 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[2] = 0.0; value[3] = 0.0; } - break; + return; + case STATE_ROT_MATRIX_1: { const int unit = (int) state[2]; @@ -532,14 +548,14 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], value[2] = 0.0; value[3] = 0.0; } - break; + return; - /* XXX: make sure new tokens added here are also handled in the - * _mesa_program_state_flags() switch, below. - */ + /* XXX: make sure new tokens added here are also handled in the + * _mesa_program_state_flags() switch, below. + */ default: - /* unknown state indexes are silently ignored - * should be handled by the driver. + /* Unknown state indexes are silently ignored here. + * Drivers may do something special. */ return; } @@ -760,28 +776,28 @@ append_token(char *dst, gl_state_index k) append(dst, ".spot.cutoff"); break; case STATE_TEXGEN_EYE_S: - append(dst, "eye.s"); + append(dst, ".eye.s"); break; case STATE_TEXGEN_EYE_T: - append(dst, "eye.t"); + append(dst, ".eye.t"); break; case STATE_TEXGEN_EYE_R: - append(dst, "eye.r"); + append(dst, ".eye.r"); break; case STATE_TEXGEN_EYE_Q: - append(dst, "eye.q"); + append(dst, ".eye.q"); break; case STATE_TEXGEN_OBJECT_S: - append(dst, "object.s"); + append(dst, ".object.s"); break; case STATE_TEXGEN_OBJECT_T: - append(dst, "object.t"); + append(dst, ".object.t"); break; case STATE_TEXGEN_OBJECT_R: - append(dst, "object.r"); + append(dst, ".object.r"); break; case STATE_TEXGEN_OBJECT_Q: - append(dst, "object.q"); + append(dst, ".object.q"); break; case STATE_TEXENV_COLOR: append(dst, "texenv"); diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 9858a0f7fd..83e76b77db 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -457,28 +457,36 @@ emit_statevars(const char *name, int array_len, tokens[0] = STATE_TEXENV_COLOR; } else if (strcmp(name, "gl_EyePlaneS") == 0) { - tokens[0] = STATE_TEXGEN_EYE_S; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_S; } else if (strcmp(name, "gl_EyePlaneT") == 0) { - tokens[0] = STATE_TEXGEN_EYE_T; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_T; } else if (strcmp(name, "gl_EyePlaneR") == 0) { - tokens[0] = STATE_TEXGEN_EYE_R; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_R; } else if (strcmp(name, "gl_EyePlaneQ") == 0) { - tokens[0] = STATE_TEXGEN_EYE_Q; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_EYE_Q; } else if (strcmp(name, "gl_ObjectPlaneS") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_S; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_S; } else if (strcmp(name, "gl_ObjectPlaneT") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_T; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_T; } else if (strcmp(name, "gl_ObjectPlaneR") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_R; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_R; } else if (strcmp(name, "gl_ObjectPlaneQ") == 0) { - tokens[0] = STATE_TEXGEN_OBJECT_Q; + tokens[0] = STATE_TEXGEN; + tokens[2] = STATE_TEXGEN_OBJECT_Q; } else { return -1; /* invalid array name */ diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index a7cfc45e6f..6d693c9027 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2199,12 +2199,13 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, name); return NULL; } + if (!fun->body) { - slang_info_log_error(A->log, - "Function '%s' prototyped but not defined. " - "Separate compilation units not supported.", - name); - return NULL; + /* The function body may be in another compilation unit. + * We'll try concatenating the shaders and recompile at link time. + */ + A->UnresolvedRefs = GL_TRUE; + return new_node1(IR_NOP, NULL); } /* type checking to be sure function's return type matches 'dest' type */ @@ -4648,6 +4649,14 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) printf("************* End codegen function ************\n\n"); #endif + if (A->UnresolvedRefs) { + /* Can't codegen at this time. + * At link time we'll concatenate all the vertex shaders and/or all + * the fragment shaders and try recompiling. + */ + return GL_TRUE; + } + /* Emit program instructions */ success = _slang_emit_code(n, A->vartable, A->program, A->pragmas, GL_TRUE, A->log); _slang_free_ir_tree(n); diff --git a/src/mesa/shader/slang/slang_codegen.h b/src/mesa/shader/slang/slang_codegen.h index e812c1f7ea..d80013ad34 100644 --- a/src/mesa/shader/slang/slang_codegen.h +++ b/src/mesa/shader/slang/slang_codegen.h @@ -43,6 +43,7 @@ typedef struct slang_assemble_ctx_ struct slang_ir_node_ *CurLoop; struct slang_function_ *CurFunction; GLuint UnrollLoop; + GLboolean UnresolvedRefs; } slang_assemble_ctx; diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index fb7128841c..ba2fc4f85c 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2435,6 +2435,8 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, _slang_codegen_function(&A, mainFunc); shader->Main = GL_TRUE; /* this shader defines main() */ + + shader->UnresolvedRefs = A.UnresolvedRefs; } _slang_pop_var_table(o.vartable); @@ -2799,7 +2801,8 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = success; if (success) { - if (shader->Pragmas.Optimize) { + if (shader->Pragmas.Optimize && + (ctx->Shader.Flags & GLSL_NO_OPT) == 0) { _mesa_optimize_program(ctx, shader->Program); } } diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 1b1edb4460..8493c490fb 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -62,6 +62,8 @@ typedef struct GLuint MaxInstructions; /**< size of prog->Instructions[] buffer */ + GLboolean UnresolvedFunctions; + /* code-gen options */ GLboolean EmitHighLevelInstructions; GLboolean EmitCondCodes; @@ -872,6 +874,7 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[1]); if (n->Children[0]->Store->Size != n->Children[1]->Store->Size) { + /* XXX this error should have been caught in slang_codegen.c */ slang_info_log_error(emitInfo->log, "invalid operands to == or !="); n->Store = NULL; return NULL; @@ -1356,7 +1359,8 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) inst = emit(emitInfo, n->Children[1]); if (!n->Children[1]->Store || n->Children[1]->Store->Index < 0) { - if (!emitInfo->log->text) { + if (!emitInfo->log->text && !emitInfo->UnresolvedFunctions) { + /* XXX this error should have been caught in slang_codegen.c */ slang_info_log_error(emitInfo->log, "invalid assignment"); } return NULL; @@ -2155,6 +2159,7 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) if (index < 0) { /* error */ char s[100]; + /* XXX isn't this really an out of memory/resources error? */ _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'", (char *) n->Var->a_name); slang_info_log_error(emitInfo->log, s); diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index f98434892b..1fdf4db054 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -534,6 +534,111 @@ _slang_update_inputs_outputs(struct gl_program *prog) } + + + +/** + * Return a new shader whose source code is the concatenation of + * all the shader sources of the given type. + */ +static struct gl_shader * +concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) +{ + struct gl_shader *newShader; + const struct gl_shader *firstShader = NULL; + GLuint shaderLengths[100]; + GLchar *source; + GLuint totalLen = 0, len = 0; + GLuint i; + + /* compute total size of new shader source code */ + for (i = 0; i < shProg->NumShaders; i++) { + const struct gl_shader *shader = shProg->Shaders[i]; + if (shader->Type == shaderType) { + shaderLengths[i] = _mesa_strlen(shader->Source); + totalLen += shaderLengths[i]; + if (!firstShader) + firstShader = shader; + } + } + + if (totalLen == 0) + return NULL; + + source = (GLchar *) _mesa_malloc(totalLen + 1); + if (!source) + return NULL; + + /* concatenate shaders */ + for (i = 0; i < shProg->NumShaders; i++) { + const struct gl_shader *shader = shProg->Shaders[i]; + if (shader->Type == shaderType) { + _mesa_memcpy(source + len, shader->Source, shaderLengths[i]); + len += shaderLengths[i]; + } + } + source[len] = '\0'; + /* + _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); + */ + + newShader = CALLOC_STRUCT(gl_shader); + newShader->Type = shaderType; + newShader->Source = source; + newShader->Pragmas = firstShader->Pragmas; + + return newShader; +} + + +/** + * Search the shader program's list of shaders to find the one that + * defines main(). + * This will involve shader concatenation and recompilation if needed. + */ +static struct gl_shader * +get_main_shader(GLcontext *ctx, + struct gl_shader_program *shProg, GLenum type) +{ + struct gl_shader *shader = NULL; + GLuint i; + + /* + * Look for a shader that defines main() and has no unresolved references. + */ + for (i = 0; i < shProg->NumShaders; i++) { + shader = shProg->Shaders[i]; + if (shader->Type == type && + shader->Main && + !shader->UnresolvedRefs) { + /* All set! */ + return shader; + } + } + + /* + * There must have been unresolved references during the original + * compilation. Try concatenating all the shaders of the given type + * and recompile that. + */ + shader = concat_shaders(shProg, type); + + if (shader) { + _slang_compile(ctx, shader); + + /* Finally, check if recompiling failed */ + if (!shader->CompileStatus || + !shader->Main || + shader->UnresolvedRefs) { + link_error(shProg, "Unresolved symbols"); + return NULL; + } + } + + return shader; +} + + /** * Shader linker. Currently: * @@ -550,13 +655,16 @@ _slang_link(GLcontext *ctx, GLhandleARB programObj, struct gl_shader_program *shProg) { - const struct gl_vertex_program *vertProg; - const struct gl_fragment_program *fragProg; + const struct gl_vertex_program *vertProg = NULL; + const struct gl_fragment_program *fragProg = NULL; GLuint numSamplers = 0; GLuint i; _mesa_clear_shader_program_data(ctx, shProg); + /* Initialize LinkStatus to "success". Will be cleared if error. */ + shProg->LinkStatus = GL_TRUE; + /* check that all programs compiled successfully */ for (i = 0; i < shProg->NumShaders; i++) { if (!shProg->Shaders[i]->CompileStatus) { @@ -568,24 +676,19 @@ _slang_link(GLcontext *ctx, shProg->Uniforms = _mesa_new_uniform_list(); shProg->Varying = _mesa_new_parameter_list(); - /** - * Find attached vertex, fragment shaders defining main() + /* + * Find the vertex and fragment shaders which define main() */ - vertProg = NULL; - fragProg = NULL; - for (i = 0; i < shProg->NumShaders; i++) { - struct gl_shader *shader = shProg->Shaders[i]; - if (shader->Type == GL_VERTEX_SHADER) { - if (shader->Main) - vertProg = vertex_program(shader->Program); - } - else if (shader->Type == GL_FRAGMENT_SHADER) { - if (shader->Main) - fragProg = fragment_program(shader->Program); - } - else { - _mesa_problem(ctx, "unexpected shader target in slang_link()"); - } + { + struct gl_shader *vertShader, *fragShader; + vertShader = get_main_shader(ctx, shProg, GL_VERTEX_SHADER); + fragShader = get_main_shader(ctx, shProg, GL_FRAGMENT_SHADER); + if (vertShader) + vertProg = vertex_program(vertShader->Program); + if (fragShader) + fragProg = fragment_program(fragShader->Program); + if (!shProg->LinkStatus) + return; } #if FEATURE_es2_glsl diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 1ef43f58c0..4a48bc8b8e 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -790,6 +790,7 @@ _slang_typeof_operation(slang_operation * op, return GL_FALSE; } ti->can_be_referenced = _ti.can_be_referenced; + ti->array_len = field->array_len; } else { GLuint rows; diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 6913d9f40f..78ca60f3ca 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -68,6 +68,7 @@ MAIN_SOURCES = \ main/texenvprogram.c \ main/texformat.c \ main/texgen.c \ + main/texgetimage.c \ main/teximage.c \ main/texobj.c \ main/texparam.c \ diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index d7b904354f..50ce82811c 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -48,7 +48,7 @@ * Convert GLenum texcoord wrap tokens to pipe tokens. */ static GLuint -gl_wrap_to_sp(GLenum wrap) +gl_wrap_xlate(GLenum wrap) { switch (wrap) { case GL_REPEAT: @@ -118,6 +118,37 @@ gl_filter_to_img_filter(GLenum filter) } +static void +xlate_border_color(const GLfloat *colorIn, GLenum baseFormat, GLfloat *colorOut) +{ + switch (baseFormat) { + case GL_RGB: + colorOut[0] = colorIn[0]; + colorOut[1] = colorIn[1]; + colorOut[2] = colorIn[2]; + colorOut[3] = 1.0F; + break; + case GL_ALPHA: + colorOut[0] = colorOut[1] = colorOut[2] = 0.0; + colorOut[3] = colorIn[3]; + break; + case GL_LUMINANCE: + colorOut[0] = colorOut[1] = colorOut[2] = colorIn[0]; + colorOut[3] = 1.0; + break; + case GL_LUMINANCE_ALPHA: + colorOut[0] = colorOut[1] = colorOut[2] = colorIn[0]; + colorOut[3] = colorIn[3]; + break; + case GL_INTENSITY: + colorOut[0] = colorOut[1] = colorOut[2] = colorOut[3] = colorIn[0]; + break; + default: + COPY_4V(colorOut, colorIn); + } +} + + static void update_samplers(struct st_context *st) { @@ -137,6 +168,7 @@ update_samplers(struct st_context *st) if (samplersUsed & (1 << su)) { struct gl_texture_object *texobj; + struct gl_texture_image *teximg; GLuint texUnit; if (fprog->Base.SamplersUsed & (1 << su)) @@ -149,9 +181,11 @@ update_samplers(struct st_context *st) texobj = st_get_default_texture(st); } - sampler->wrap_s = gl_wrap_to_sp(texobj->WrapS); - sampler->wrap_t = gl_wrap_to_sp(texobj->WrapT); - sampler->wrap_r = gl_wrap_to_sp(texobj->WrapR); + teximg = texobj->Image[0][texobj->BaseLevel]; + + sampler->wrap_s = gl_wrap_xlate(texobj->WrapS); + sampler->wrap_t = gl_wrap_xlate(texobj->WrapT); + sampler->wrap_r = gl_wrap_xlate(texobj->WrapR); sampler->min_img_filter = gl_filter_to_img_filter(texobj->MinFilter); sampler->min_mip_filter = gl_filter_to_mip_filter(texobj->MinFilter); @@ -174,10 +208,9 @@ update_samplers(struct st_context *st) assert(sampler->min_lod <= sampler->max_lod); } - sampler->border_color[0] = texobj->BorderColor[RCOMP]; - sampler->border_color[1] = texobj->BorderColor[GCOMP]; - sampler->border_color[2] = texobj->BorderColor[BCOMP]; - sampler->border_color[3] = texobj->BorderColor[ACOMP]; + xlate_border_color(texobj->BorderColor, + teximg ? teximg->TexFormat->BaseFormat : GL_RGBA, + sampler->border_color); sampler->max_anisotropy = texobj->MaxAnisotropy; if (sampler->max_anisotropy > 1.0) { diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index dd9ba2881f..5bdc6a1330 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -2,6 +2,7 @@ * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. + * Copyright 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -29,6 +30,7 @@ * Authors: * Keith Whitwell <keith@tungstengraphics.com> * Brian Paul + * Michel Dänzer */ #include "main/glheader.h" @@ -291,11 +293,6 @@ clear_with_quad(GLcontext *ctx, static INLINE GLboolean check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) { - const struct st_renderbuffer *strb = st_renderbuffer(rb); - - if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED) - return FALSE; - if (ctx->Scissor.Enabled) return TRUE; @@ -312,14 +309,10 @@ check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) static INLINE GLboolean check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) { - const struct st_renderbuffer *strb = st_renderbuffer(rb); const GLuint stencilMax = (1 << rb->StencilBits) - 1; GLboolean maskStencil = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax; - if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED) - return FALSE; - if (ctx->Scissor.Enabled) return TRUE; @@ -339,14 +332,10 @@ check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) const struct st_renderbuffer *strb = st_renderbuffer(rb); const GLboolean isDS = is_depth_stencil_format(strb->surface->format); - if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED) - return FALSE; - if (ctx->Scissor.Enabled) return TRUE; if (isDS && - strb->surface->status == PIPE_SURFACE_STATUS_DEFINED && ctx->DrawBuffer->Visual.stencilBits > 0) return TRUE; @@ -366,9 +355,6 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) const GLboolean maskStencil = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax; - if (strb->surface->status == PIPE_SURFACE_STATUS_UNDEFINED) - return FALSE; - if (maskStencil) return TRUE; @@ -381,7 +367,6 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) * current state. */ if (isDS && - strb->surface->status == PIPE_SURFACE_STATUS_DEFINED && ctx->DrawBuffer->Visual.depthBits > 0) return TRUE; @@ -390,111 +375,6 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) -static void -clear_color_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - struct st_renderbuffer *strb = st_renderbuffer(rb); - - if (!strb->surface) - return; - - if (check_clear_color_with_quad( ctx, rb )) { - /* masking or scissoring */ - clear_with_quad(ctx, GL_TRUE, GL_FALSE, GL_FALSE); - } - else { - /* clear whole buffer w/out masking */ - uint clearValue; - /* NOTE: we always pass the clear color as PIPE_FORMAT_A8R8G8B8_UNORM - * at this time! - */ - util_pack_color(ctx->Color.ClearColor, PIPE_FORMAT_A8R8G8B8_UNORM, &clearValue); - ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue); - } -} - - -static void -clear_depth_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - struct st_renderbuffer *strb = st_renderbuffer(rb); - - if (!strb->surface) - return; - - if (check_clear_depth_with_quad(ctx, rb)) { - /* scissoring or we have a combined depth/stencil buffer */ - clear_with_quad(ctx, GL_FALSE, GL_TRUE, GL_FALSE); - } - else { - /* simple clear of whole buffer */ - uint clearValue = util_pack_z(strb->surface->format, ctx->Depth.Clear); - ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue); - } -} - - -static void -clear_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - struct st_renderbuffer *strb = st_renderbuffer(rb); - - if (!strb->surface) - return; - - if (check_clear_stencil_with_quad(ctx, rb)) { - /* masking or scissoring or combined depth/stencil buffer */ - clear_with_quad(ctx, GL_FALSE, GL_FALSE, GL_TRUE); - } - else { - /* simple clear of whole buffer */ - GLuint clearValue = ctx->Stencil.Clear; - - switch (strb->surface->format) { - case PIPE_FORMAT_S8Z24_UNORM: - clearValue <<= 24; - break; - default: - ; /* no-op, stencil value is in least significant bits */ - } - - ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue); - } -} - - -static void -clear_depth_stencil_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - struct st_renderbuffer *strb = st_renderbuffer(rb); - - if (!strb->surface) - return; - - if (check_clear_depth_stencil_with_quad(ctx, rb)) { - /* masking or scissoring */ - clear_with_quad(ctx, GL_FALSE, GL_TRUE, GL_TRUE); - } - else { - /* clear whole buffer w/out masking */ - GLuint clearValue = util_pack_z(strb->surface->format, ctx->Depth.Clear); - - switch (strb->surface->format) { - case PIPE_FORMAT_S8Z24_UNORM: - clearValue |= ctx->Stencil.Clear << 24; - break; - case PIPE_FORMAT_Z24S8_UNORM: - clearValue |= ctx->Stencil.Clear; - break; - default: - assert(0); - } - - ctx->st->pipe->clear(ctx->st->pipe, strb->surface, clearValue); - } -} - - void st_flush_clear( struct st_context *st ) { /* Release vertex buffer to avoid synchronous rendering if we were @@ -520,51 +400,89 @@ static void st_clear(GLcontext *ctx, GLbitfield mask) = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; struct gl_renderbuffer *stencilRb = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; - GLbitfield cmask = mask & BUFFER_BITS_COLOR; + GLbitfield quad_buffers = 0; + GLbitfield clear_buffers = 0; + GLuint i; - /* This makes sure the softpipe has the latest scissor, etc values */ + /* This makes sure the pipe has the latest scissor, etc values */ st_validate_state( st ); - /* - * XXX TO-DO: - * If we're going to use clear_with_quad() for any reason, use it to - * clear as many other buffers as possible. - * As it is now, we sometimes call clear_with_quad() three times to clear - * color/depth/stencil individually... - */ + if (mask & BUFFER_BITS_COLOR) { + for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { + GLuint b = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; - if (cmask) { - GLuint b; - for (b = 0; cmask; b++) { - if (cmask & (1 << b)) { + if (mask & (1 << b)) { struct gl_renderbuffer *rb = ctx->DrawBuffer->Attachment[b].Renderbuffer; + struct st_renderbuffer *strb; + assert(rb); - clear_color_buffer(ctx, rb); - cmask &= ~(1 << b); /* turn off bit */ + + strb = st_renderbuffer(rb); + + if (!strb->surface) + continue; + + if (check_clear_color_with_quad( ctx, rb )) + quad_buffers |= PIPE_CLEAR_COLOR; + else + clear_buffers |= PIPE_CLEAR_COLOR; } - assert(b < BUFFER_COUNT); } } - if (mask & BUFFER_BIT_ACCUM) { - st_clear_accum_buffer(ctx, - ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer); - } - if ((mask & BUFFER_BITS_DS) == BUFFER_BITS_DS && depthRb == stencilRb) { /* clearing combined depth + stencil */ - clear_depth_stencil_buffer(ctx, depthRb); + struct st_renderbuffer *strb = st_renderbuffer(depthRb); + + if (strb->surface) { + if (check_clear_depth_stencil_with_quad(ctx, depthRb)) + quad_buffers |= PIPE_CLEAR_DEPTHSTENCIL; + else + clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL; + } } else { /* separate depth/stencil clears */ if (mask & BUFFER_BIT_DEPTH) { - clear_depth_buffer(ctx, depthRb); + struct st_renderbuffer *strb = st_renderbuffer(depthRb); + + if (strb->surface) { + if (check_clear_depth_with_quad(ctx, depthRb)) + quad_buffers |= PIPE_CLEAR_DEPTHSTENCIL; + else + clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL; + } } if (mask & BUFFER_BIT_STENCIL) { - clear_stencil_buffer(ctx, stencilRb); + struct st_renderbuffer *strb = st_renderbuffer(stencilRb); + + if (strb->surface) { + if (check_clear_stencil_with_quad(ctx, stencilRb)) + quad_buffers |= PIPE_CLEAR_DEPTHSTENCIL; + else + clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL; + } } } + + /* + * If we're going to use clear_with_quad() for any reason, use it for + * everything possible. + */ + if (quad_buffers) { + quad_buffers |= clear_buffers; + clear_with_quad(ctx, + quad_buffers & PIPE_CLEAR_COLOR, + mask & BUFFER_BIT_DEPTH, + mask & BUFFER_BIT_STENCIL); + } else if (clear_buffers) + ctx->st->pipe->clear(ctx->st->pipe, clear_buffers, ctx->Color.ClearColor, + ctx->Depth.Clear, ctx->Stencil.Clear); + + if (mask & BUFFER_BIT_ACCUM) + st_clear_accum_buffer(ctx, + ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer); } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 821ea67ce4..ebb1d1142a 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -309,6 +309,8 @@ _mesa_base_format(GLenum format) switch (format) { case GL_DEPTH_COMPONENT: return GL_DEPTH_COMPONENT; + case GL_DEPTH_STENCIL: + return GL_DEPTH_STENCIL; case GL_STENCIL_INDEX: return GL_STENCIL_INDEX; default: @@ -617,7 +619,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, static void draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, GLenum type, + GLsizei width, GLsizei height, GLenum format, GLenum type, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) { @@ -634,12 +636,20 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, strb = st_renderbuffer(ctx->DrawBuffer-> Attachment[BUFFER_STENCIL].Renderbuffer); + + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { + y = ctx->DrawBuffer->Height - y - height; + } + pt = screen->get_tex_transfer(screen, strb->texture, 0, 0, 0, PIPE_TRANSFER_WRITE, x, y, width, height); stmap = screen->transfer_map(screen, pt); + pixels = _mesa_map_drawpix_pbo(ctx, unpack, pixels); + assert(pixels); + /* if width > MAX_WIDTH, have to process image in chunks */ skipPixels = 0; while (skipPixels < width) { @@ -647,42 +657,74 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); GLint row; for (row = 0; row < height; row++) { - GLint spanY = row; - GLubyte values[MAX_WIDTH]; + GLubyte sValues[MAX_WIDTH]; + GLuint zValues[MAX_WIDTH]; GLenum destType = GL_UNSIGNED_BYTE; const GLvoid *source = _mesa_image_address2d(unpack, pixels, width, height, - GL_COLOR_INDEX, type, + format, type, row, skipPixels); - _mesa_unpack_stencil_span(ctx, spanWidth, destType, values, + _mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues, type, source, unpack, ctx->_ImageTransferState); + + if (format == GL_DEPTH_STENCIL) { + _mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues, + (1 << 24) - 1, type, source, unpack); + } + if (zoom) { - /* - _swrast_write_zoomed_stencil_span(ctx, 0, 0, spanWidth, - spanX, spanY, values); - */ + _mesa_problem(ctx, "Gallium glDrawPixels(GL_STENCIL) with " + "zoom not complete"); } - else { + + { + GLint spanY; + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - spanY = height - spanY - 1; + spanY = height - row - 1; + } + else { + spanY = row; } + /* now pack the stencil (and Z) values in the dest format */ switch (pt->format) { case PIPE_FORMAT_S8_UNORM: { ubyte *dest = stmap + spanY * pt->stride + spanX; - memcpy(dest, values, spanWidth); + memcpy(dest, sValues, spanWidth); } break; case PIPE_FORMAT_S8Z24_UNORM: - { + if (format == GL_DEPTH_STENCIL) { uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); GLint k; for (k = 0; k < spanWidth; k++) { - uint p = dest[k]; - p = (p & 0xffffff) | (values[k] << 24); - dest[k] = p; + dest[k] = zValues[k] | (sValues[k] << 24); + } + } + else { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + for (k = 0; k < spanWidth; k++) { + dest[k] = (dest[k] & 0xffffff) | (sValues[k] << 24); + } + } + break; + case PIPE_FORMAT_Z24S8_UNORM: + if (format == GL_DEPTH_STENCIL) { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + for (k = 0; k < spanWidth; k++) { + dest[k] = zValues[k] | (sValues[k] << 24); + } + } + else { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + for (k = 0; k < spanWidth; k++) { + dest[k] = (dest[k] & 0xffffff00) | (sValues[k] & 0xff); } } break; @@ -694,6 +736,8 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, skipPixels += spanWidth; } + _mesa_unmap_drawpix_pbo(ctx, unpack); + /* unmap the stencil buffer */ screen->transfer_unmap(screen, pt); screen->tex_transfer_destroy(pt); @@ -715,8 +759,10 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLuint bufferFormat; const GLfloat *color; - if (format == GL_STENCIL_INDEX) { - draw_stencil_pixels(ctx, x, y, width, height, type, unpack, pixels); + if (format == GL_STENCIL_INDEX || + format == GL_DEPTH_STENCIL) { + draw_stencil_pixels(ctx, x, y, width, height, format, type, + unpack, pixels); return; } @@ -731,11 +777,6 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, stvp = st_make_passthrough_vertex_shader(ctx->st, GL_TRUE); color = ctx->Current.RasterColor; } - else if (format == GL_STENCIL_INDEX) { - ps = st->state.framebuffer.zsbuf; - /* XXX special case - can't use texture map */ - color = NULL; - } else { ps = st->state.framebuffer.cbufs[0]; stfp = combined_drawpix_fragment_program(ctx); @@ -781,7 +822,8 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } /* this will do stencil pixel transfer ops */ - st_read_stencil_pixels(ctx, srcx, srcy, width, height, GL_UNSIGNED_BYTE, + st_read_stencil_pixels(ctx, srcx, srcy, width, height, + GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &ctx->DefaultPacking, buffer); ptDraw = screen->get_tex_transfer(screen, rbDraw->texture, 0, 0, 0, @@ -821,6 +863,16 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } break; + case PIPE_FORMAT_Z24S8_UNORM: + { + uint *dst4 = (uint *) dst; + int j; + for (j = 0; j < width; j++) { + *dst4 = (*dst4 & 0xffffff00) | (src[j] & 0xff); + dst4++; + } + } + break; case PIPE_FORMAT_S8_UNORM: memcpy(dst, src, width); break; diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 2a4beccd90..9ce5f3fe84 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -56,7 +56,8 @@ */ void st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, GLenum type, + GLsizei width, GLsizei height, + GLenum format, GLenum type, const struct gl_pixelstore_attrib *packing, GLvoid *pixels) { @@ -68,7 +69,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, GLint j; if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - y = ctx->DrawBuffer->Height - y - 1; + y = ctx->DrawBuffer->Height - y - height; } /* Create a read transfer from the renderbuffer's texture */ @@ -84,7 +85,8 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, /* process image row by row */ for (j = 0; j < height; j++) { GLvoid *dest; - GLstencil values[MAX_WIDTH]; + GLstencil sValues[MAX_WIDTH]; + GLfloat zValues[MAX_WIDTH]; GLint srcY; if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { @@ -94,29 +96,47 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, srcY = j; } - /* get stencil values */ + /* get stencil (and Z) values */ switch (pt->format) { case PIPE_FORMAT_S8_UNORM: { const ubyte *src = stmap + srcY * pt->stride; - memcpy(values, src, width); + memcpy(sValues, src, width); } break; case PIPE_FORMAT_S8Z24_UNORM: - { + if (format == GL_DEPTH_STENCIL) { const uint *src = (uint *) (stmap + srcY * pt->stride); + const GLfloat scale = 1.0 / (0xffffff); GLint k; for (k = 0; k < width; k++) { - values[k] = src[k] >> 24; + sValues[k] = src[k] >> 24; + zValues[k] = (src[k] & 0xffffff) * scale; + } + } + else { + const uint *src = (uint *) (stmap + srcY * pt->stride); + GLint k; + for (k = 0; k < width; k++) { + sValues[k] = src[k] >> 24; } } break; case PIPE_FORMAT_Z24S8_UNORM: - { + if (format == GL_DEPTH_STENCIL) { + const uint *src = (uint *) (stmap + srcY * pt->stride); + const GLfloat scale = 1.0 / (0xffffff); + GLint k; + for (k = 0; k < width; k++) { + sValues[k] = src[k] & 0xff; + zValues[k] = (src[k] >> 8) * scale; + } + } + else { const uint *src = (uint *) (stmap + srcY * pt->stride); GLint k; for (k = 0; k < width; k++) { - values[k] = src[k] & 0xff; + sValues[k] = src[k] & 0xff; } } break; @@ -126,12 +146,16 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, /* store */ dest = _mesa_image_address2d(packing, pixels, width, height, - GL_STENCIL_INDEX, type, j, 0); - - _mesa_pack_stencil_span(ctx, width, type, dest, values, packing); + format, type, j, 0); + if (format == GL_DEPTH_STENCIL) { + _mesa_pack_depth_stencil_span(ctx, width, dest, + zValues, sValues, packing); + } + else { + _mesa_pack_stencil_span(ctx, width, type, dest, sValues, packing); + } } - /* unmap the stencil buffer */ screen->transfer_unmap(screen, pt); screen->tex_transfer_destroy(pt); @@ -329,8 +353,10 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, /* make sure rendering has completed */ st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL); - if (format == GL_STENCIL_INDEX) { - st_read_stencil_pixels(ctx, x, y, width, height, type, pack, dest); + if (format == GL_STENCIL_INDEX || + format == GL_DEPTH_STENCIL) { + st_read_stencil_pixels(ctx, x, y, width, height, + format, type, pack, dest); return; } else if (format == GL_DEPTH_COMPONENT) { @@ -420,6 +446,33 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } } + else if (trans->format == PIPE_FORMAT_Z24S8_UNORM || + trans->format == PIPE_FORMAT_Z24X8_UNORM) { + if (format == GL_DEPTH_COMPONENT) { + for (i = 0; i < height; i++) { + GLuint ztemp[MAX_WIDTH]; + GLfloat zfloat[MAX_WIDTH]; + const double scale = 1.0 / ((1 << 24) - 1); + pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0); + y += yStep; + for (j = 0; j < width; j++) { + zfloat[j] = (float) (scale * ((ztemp[j] >> 8) & 0xffffff)); + } + _mesa_pack_depth_span(ctx, width, dst, type, + zfloat, &clippedPacking); + dst += dstStride; + } + } + else { + /* untested, but simple: */ + assert(format == GL_DEPTH_STENCIL_EXT); + for (i = 0; i < height; i++) { + pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0); + y += yStep; + dst += dstStride; + } + } + } else if (trans->format == PIPE_FORMAT_Z16_UNORM) { for (i = 0; i < height; i++) { GLushort ztemp[MAX_WIDTH]; diff --git a/src/mesa/state_tracker/st_cb_readpixels.h b/src/mesa/state_tracker/st_cb_readpixels.h index 9e151be51f..c90ef02906 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.h +++ b/src/mesa/state_tracker/st_cb_readpixels.h @@ -34,7 +34,8 @@ st_get_color_read_renderbuffer(GLcontext *ctx); extern void st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, GLenum type, + GLsizei width, GLsizei height, + GLenum format, GLenum type, const struct gl_pixelstore_attrib *packing, GLvoid *pixels); diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c index 2036ccafbf..bb931f17c4 100644 --- a/src/mesa/state_tracker/st_cb_strings.c +++ b/src/mesa/state_tracker/st_cb_strings.c @@ -39,7 +39,7 @@ #include "st_context.h" #include "st_cb_strings.h" -#define ST_VERSION_STRING "0.2" +#define ST_VERSION_STRING "0.3" static const GLubyte * st_get_string(GLcontext * ctx, GLenum name) @@ -50,18 +50,7 @@ st_get_string(GLcontext * ctx, GLenum name) switch (name) { case GL_VENDOR: { const char *vendor = screen->get_vendor( screen ); - const char *tungsten = "Tungsten Graphics, Inc."; - - /* Tungsten Graphics, Inc. developed the state_tracker module - * (and much of Mesa), but the driver itself may come from elsewhere. - * The additional string allows "and XyzCorp" to reflect this. - */ - if (vendor && strcmp(vendor, tungsten) != 0) - util_snprintf(st->vendor, sizeof(st->vendor), - "%s and %s", tungsten, vendor); - else - util_snprintf(st->vendor, sizeof(st->vendor), "%s", tungsten); - + util_snprintf(st->vendor, sizeof(st->vendor), "%s", vendor); return (GLubyte *) st->vendor; } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 311d812ccf..8013e69e8e 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -37,6 +37,7 @@ #include "main/pixel.h" #include "main/texcompress.h" #include "main/texformat.h" +#include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/texstore.h" @@ -946,7 +947,8 @@ fallback_copy_texsubimage(GLcontext *ctx, texDest = st_texture_image_map(ctx->st, stImage, 0, PIPE_TRANSFER_WRITE, destX, destY, width, height); - if (baseFormat == GL_DEPTH_COMPONENT) { + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH24_STENCIL8) { const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F); GLint row, yStep; @@ -1056,7 +1058,8 @@ st_copy_texsubimage(GLcontext *ctx, st_finish(ctx->st); /* determine if copying depth or color data */ - if (texBaseFormat == GL_DEPTH_COMPONENT) { + if (texBaseFormat == GL_DEPTH_COMPONENT || + texBaseFormat == GL_DEPTH24_STENCIL8) { strb = st_renderbuffer(fb->_DepthBuffer); } else if (texBaseFormat == GL_DEPTH_STENCIL_EXT) { @@ -1471,9 +1474,19 @@ st_get_default_texture(struct st_context *st) GLubyte pixels[16][16][4]; struct gl_texture_object *texObj; struct gl_texture_image *texImg; + GLuint i, j; - /* init image to gray */ - memset(pixels, 127, sizeof(pixels)); + /* The ARB_fragment_program spec says (0,0,0,1) should be returned + * when attempting to sample incomplete textures. + */ + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + pixels[i][j][0] = 0; + pixels[i][j][1] = 0; + pixels[i][j][2] = 0; + pixels[i][j][3] = 255; + } + } texObj = st->ctx->Driver.NewTextureObject(st->ctx, 0, target); diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 06fec20eee..daaad65cca 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -293,32 +293,6 @@ st_notify_swapbuffers(struct st_framebuffer *stfb) } -/** - * Quick hack - allows the winsys to inform the driver that surface - * states are now undefined after a glXSwapBuffers or similar. - */ -void -st_notify_swapbuffers_complete(struct st_framebuffer *stfb) -{ - GET_CURRENT_CONTEXT(ctx); - - if (ctx && ctx->DrawBuffer == &stfb->Base) { - struct st_renderbuffer *strb; - - /* Mark back color buffers as undefined */ - strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_LEFT]. - Renderbuffer); - if (strb && strb->surface) - strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED; - - strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_RIGHT]. - Renderbuffer); - if (strb && strb->surface) - strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED; - } -} - - void *st_framebuffer_private( struct st_framebuffer *stfb ) { return stfb->Private; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index f825204915..6348e83d8a 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -427,11 +427,13 @@ st_translate_fragment_program(struct st_context *st, interpMode[slot] = TGSI_INTERPOLATE_LINEAR; break; case FRAG_ATTRIB_FOGC: - if (stfp->Base.UsesPointCoord) + if (stfp->Base.UsesPointCoord) { stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - else + stfp->input_semantic_index[slot] = num_generic++; + } else { stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG; - stfp->input_semantic_index[slot] = 0; + stfp->input_semantic_index[slot] = 0; + } interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; break; case FRAG_ATTRIB_TEX0: diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 414218bb58..030314372f 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -100,7 +100,6 @@ void st_flush( struct st_context *st, uint pipeFlushFlags, void st_finish( struct st_context *st ); void st_notify_swapbuffers(struct st_framebuffer *stfb); -void st_notify_swapbuffers_complete(struct st_framebuffer *stfb); int st_set_teximage(struct pipe_texture *pt, int target); diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 6f274d6d69..3f90ad502c 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -107,7 +107,7 @@ st_texture_create(struct st_context *st, newtex = screen->texture_create(screen, &pt); - assert(!newtex || p_atomic_read(&newtex->reference.count) == 1); + assert(!newtex || pipe_is_referenced(&newtex->reference)); return newtex; } diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index 840b7e27cc..28c2f580f6 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -99,12 +99,6 @@ st_get_stobj_texture(struct st_texture_object *stObj) return stObj ? stObj->pt : NULL; } -static INLINE GLboolean pf_is_depth_stencil( enum pipe_format format ) -{ - return (pf_get_component_bits( format, PIPE_FORMAT_COMP_Z ) + - pf_get_component_bits( format, PIPE_FORMAT_COMP_S )) != 0; -} - extern struct pipe_texture * st_texture_create(struct st_context *st, diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c index 458fe18163..5fefae6c42 100644 --- a/src/mesa/swrast/s_atifragshader.c +++ b/src/mesa/swrast/s_atifragshader.c @@ -47,17 +47,12 @@ static void fetch_texel(GLcontext * ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4]) { - GLchan rgba[4]; SWcontext *swrast = SWRAST_CONTEXT(ctx); /* XXX use a float-valued TextureSample routine here!!! */ swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, 1, (const GLfloat(*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + &lambda, (GLfloat (*)[4]) color); } static void diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 4dbccbb2d5..a7eaf76a0a 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -172,19 +172,29 @@ _swrast_update_fog_hint( GLcontext *ctx ) /** - * Update the swrast->_AnyTextureCombine flag. + * Update the swrast->_TextureCombinePrimary flag. */ static void _swrast_update_texture_env( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint i; - swrast->_AnyTextureCombine = GL_FALSE; + + swrast->_TextureCombinePrimary = GL_FALSE; + for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - if (ctx->Texture.Unit[i].EnvMode == GL_COMBINE_EXT || - ctx->Texture.Unit[i].EnvMode == GL_COMBINE4_NV) { - swrast->_AnyTextureCombine = GL_TRUE; - return; + const struct gl_tex_env_combine_state *combine = + ctx->Texture.Unit[i]._CurrentCombine; + GLuint term; + for (term = 0; term < combine->_NumArgsRGB; term++) { + if (combine->SourceRGB[term] == GL_PRIMARY_COLOR) { + swrast->_TextureCombinePrimary = GL_TRUE; + return; + } + if (combine->SourceA[term] == GL_PRIMARY_COLOR) { + swrast->_TextureCombinePrimary = GL_TRUE; + return; + } } } } @@ -265,6 +275,24 @@ _swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState) } +/** + * See if we can do early diffuse+specular (primary+secondary) color + * add per vertex instead of per-fragment. + */ +static void +_swrast_update_specular_vertex_add(GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLboolean separateSpecular = ctx->Fog.ColorSumEnabled || + (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR); + + swrast->SpecularVertexAdd = (separateSpecular + && ctx->Texture._EnabledUnits == 0x0 + && !ctx->FragmentProgram._Current + && !ctx->ATIFragmentShader._Enabled); +} + #define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \ _NEW_TEXTURE | \ @@ -326,9 +354,7 @@ _swrast_validate_triangle( GLcontext *ctx, swrast->choose_triangle( ctx ); ASSERT(swrast->Triangle); - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { + if (swrast->SpecularVertexAdd) { /* separate specular color, but no texture */ swrast->SpecTriangle = swrast->Triangle; swrast->Triangle = _swrast_add_spec_terms_triangle; @@ -350,9 +376,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) swrast->choose_line( ctx ); ASSERT(swrast->Line); - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { + if (swrast->SpecularVertexAdd) { swrast->SpecLine = swrast->Line; swrast->Line = _swrast_add_spec_terms_line; } @@ -372,9 +396,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) _swrast_validate_derived( ctx ); swrast->choose_point( ctx ); - if (ctx->Texture._EnabledUnits == 0 - && NEED_SECONDARY_COLOR(ctx) - && !ctx->FragmentProgram._Current) { + if (swrast->SpecularVertexAdd) { swrast->SpecPoint = swrast->Point; swrast->Point = _swrast_add_spec_terms_point; } @@ -656,6 +678,12 @@ _swrast_validate_derived( GLcontext *ctx ) _NEW_TEXTURE)) _swrast_update_active_attribs(ctx); + if (swrast->NewState & (_NEW_FOG | + _NEW_PROGRAM | + _NEW_LIGHT | + _NEW_TEXTURE)) + _swrast_update_specular_vertex_add(ctx); + swrast->NewState = 0; swrast->StateChanges = 0; swrast->InvalidateState = _swrast_invalidate_state; @@ -820,8 +848,8 @@ _swrast_CreateContext( GLcontext *ctx ) swrast->PointSpan.facing = 0; swrast->PointSpan.array = swrast->SpanArrays; - swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureImageUnits * - MAX_WIDTH * 4 * sizeof(GLchan)); + swrast->TexelBuffer = (GLfloat *) MALLOC(ctx->Const.MaxTextureImageUnits * + MAX_WIDTH * 4 * sizeof(GLfloat)); if (!swrast->TexelBuffer) { FREE(swrast->SpanArrays); FREE(swrast); diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 6e8d080704..9059f9b5ec 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -52,7 +52,7 @@ typedef void (*texture_sample_func)(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]); + const GLfloat lambda[], GLfloat rgba[][4]); typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[], @@ -131,7 +131,7 @@ typedef struct GLfloat _BackfaceSign; /** +1 or -1 */ GLfloat _BackfaceCullSign; /** +1, 0, or -1 */ GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ - GLboolean _AnyTextureCombine; + GLboolean _TextureCombinePrimary; GLboolean _FogEnabled; GLboolean _DeferredTexture; GLenum _FogMode; /* either GL_FOG_MODE or fragment program's fog mode */ @@ -157,6 +157,7 @@ typedef struct GLbitfield NewState; GLuint StateChanges; GLenum Primitive; /* current primitive being drawn (ala glBegin) */ + GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */ void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state ); @@ -221,7 +222,7 @@ typedef struct /** Buffer for saving the sampled texture colors. * Needed for GL_ARB_texture_env_crossbar implementation. */ - GLchan *TexelBuffer; + GLfloat *TexelBuffer; validate_texture_image_func ValidateTextureImage; diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index ae1dea16a0..b71fb9eae9 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -37,20 +37,17 @@ * and return results in 'colorOut'. */ static INLINE void -swizzle_texel(const GLchan texel[4], GLfloat colorOut[4], GLuint swizzle) +swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle) { if (swizzle == SWIZZLE_NOOP) { - colorOut[0] = CHAN_TO_FLOAT(texel[0]); - colorOut[1] = CHAN_TO_FLOAT(texel[1]); - colorOut[2] = CHAN_TO_FLOAT(texel[2]); - colorOut[3] = CHAN_TO_FLOAT(texel[3]); + COPY_4V(colorOut, texel); } else { GLfloat vector[6]; - vector[SWIZZLE_X] = CHAN_TO_FLOAT(texel[0]); - vector[SWIZZLE_Y] = CHAN_TO_FLOAT(texel[1]); - vector[SWIZZLE_Z] = CHAN_TO_FLOAT(texel[2]); - vector[SWIZZLE_W] = CHAN_TO_FLOAT(texel[3]); + vector[SWIZZLE_X] = texel[0]; + vector[SWIZZLE_Y] = texel[1]; + vector[SWIZZLE_Z] = texel[2]; + vector[SWIZZLE_W] = texel[3]; vector[SWIZZLE_ZERO] = 0.0F; vector[SWIZZLE_ONE] = 1.0F; colorOut[0] = vector[GET_SWZ(swizzle, 0)]; @@ -73,11 +70,10 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, if (texObj) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan rgba[4]; + GLfloat rgba[4]; lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); - /* XXX use a float-valued TextureSample routine here!!! */ swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, &lambda, &rgba); @@ -108,7 +104,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], const GLfloat texW = (GLfloat) texImg->WidthScale; const GLfloat texH = (GLfloat) texImg->HeightScale; GLfloat lambda; - GLchan rgba[4]; + GLfloat rgba[4]; lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ @@ -119,7 +115,6 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); - /* XXX use a float-valued TextureSample routine here!!! */ swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, &lambda, &rgba); diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 61ff4d0b84..0a3ad97a71 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -570,6 +570,9 @@ void _swrast_choose_point(GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLfloat size = CLAMP(ctx->Point.Size, + ctx->Point.MinSize, + ctx->Point.MaxSize); if (ctx->RenderMode == GL_RENDER) { if (ctx->Point.PointSprite) { @@ -578,7 +581,7 @@ _swrast_choose_point(GLcontext *ctx) else if (ctx->Point.SmoothFlag) { swrast->Point = smooth_point; } - else if (ctx->Point.Size > 1.0 || + else if (size > 1.0 || ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) { swrast->Point = large_point; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 15a783b236..cfff82b051 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1377,12 +1377,14 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) ASSERT(span->arrayMask & SPAN_RGBA); - if (!shader) { - /* Add base and specular colors */ - if (ctx->Fog.ColorSumEnabled || - (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { - add_specular(ctx, span); + if (span->primitive == GL_BITMAP || !swrast->SpecularVertexAdd) { + /* Add primary and specular (diffuse + specular) colors */ + if (!shader) { + if (ctx->Fog.ColorSumEnabled || + (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { + add_specular(ctx, span); + } } } @@ -1403,11 +1405,17 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) } /* - * Write to renderbuffers + * Write to renderbuffers. + * Depending on glDrawBuffer() state and the which color outputs are + * written by the fragment shader, we may either replicate one color to + * all renderbuffers or write a different color to each renderbuffer. + * multiFragOutputs=TRUE for the later case. */ { const GLuint numBuffers = fb->_NumColorDrawBuffers; - const GLboolean multiFragOutputs = numBuffers > 1; + const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; + const GLboolean multiFragOutputs = + (fp && fp->Base.OutputsWritten >= (1 << FRAG_RESULT_DATA0)); GLuint buf; for (buf = 0; buf < numBuffers; buf++) { diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index aa28311672..fae7280efb 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -29,7 +29,6 @@ #include "main/colormac.h" #include "main/image.h" #include "main/imports.h" -#include "main/macros.h" #include "main/pixel.h" #include "shader/prog_instruction.h" @@ -37,109 +36,128 @@ #include "s_texcombine.h" -#define PROD(A,B) ( (GLuint)(A) * ((GLuint)(B)+1) ) -#define S_PROD(A,B) ( (GLint)(A) * ((GLint)(B)+1) ) -#if CHAN_BITS == 32 -typedef GLfloat ChanTemp; -#else -typedef GLuint ChanTemp; -#endif +/** + * Pointer to array of float[4] + * This type makes the code below more concise and avoids a lot of casting. + */ +typedef float (*float4_array)[4]; + + +/** + * Return array of texels for given unit. + */ +static INLINE float4_array +get_texel_array(SWcontext *swrast, GLuint unit) +{ + return (float4_array) + (swrast->TexelBuffer + unit * MAX_WIDTH * 4 * sizeof(GLfloat)); +} + /** - * Do texture application for GL_ARB/EXT_texture_env_combine. - * This function also supports GL_{EXT,ARB}_texture_env_dot3 and - * GL_ATI_texture_env_combine3. Since "classic" texture environments are - * implemented using GL_ARB_texture_env_combine-like state, this same function - * is used for classic texture environment application as well. + * Do texture application for: + * GL_EXT_texture_env_combine + * GL_ARB_texture_env_combine + * GL_EXT_texture_env_dot3 + * GL_ARB_texture_env_dot3 + * GL_ATI_texture_env_combine3 + * GL_NV_texture_env_combine4 + * conventional GL texture env modes * * \param ctx rendering context - * \param textureUnit the texture unit to apply + * \param unit the texture combiner unit * \param n number of fragments to process (span width) * \param primary_rgba incoming fragment color array * \param texelBuffer pointer to texel colors for all texture units * - * \param rgba incoming colors, which get modified here + * \param rgba incoming/result fragment colors */ static void -texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, - CONST GLchan (*primary_rgba)[4], - CONST GLchan *texelBuffer, - GLchan (*rgba)[4] ) +texture_combine( GLcontext *ctx, GLuint unit, GLuint n, + const float4_array primary_rgba, + const GLfloat *texelBuffer, + GLchan (*rgbaChan)[4] ) { + SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_texture_unit *textureUnit = &(ctx->Texture.Unit[unit]); - const GLchan (*argRGB [4])[4]; - const GLchan (*argA [4])[4]; - const GLint RGBshift = textureUnit->_CurrentCombine->ScaleShiftRGB; - const GLuint Ashift = textureUnit->_CurrentCombine->ScaleShiftA; -#if CHAN_TYPE == GL_FLOAT - const GLchan RGBmult = (GLfloat) (1 << RGBshift); - const GLchan Amult = (GLfloat) (1 << Ashift); -#else - const GLint half = (CHAN_MAX + 1) / 2; -#endif - static const GLchan one[4] = { CHAN_MAX, CHAN_MAX, CHAN_MAX, CHAN_MAX }; - static const GLchan zero[4] = { 0, 0, 0, 0 }; - const GLuint numColorArgs = textureUnit->_CurrentCombine->_NumArgsRGB; - const GLuint numAlphaArgs = textureUnit->_CurrentCombine->_NumArgsA; - GLchan ccolor[4][MAX_WIDTH][4]; - GLuint i, j; - - ASSERT(ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine); - ASSERT(CONST_SWRAST_CONTEXT(ctx)->_AnyTextureCombine); + const struct gl_tex_env_combine_state *combine = textureUnit->_CurrentCombine; + float4_array argRGB[MAX_COMBINER_TERMS]; + float4_array argA[MAX_COMBINER_TERMS]; + const GLfloat scaleRGB = (GLfloat) (1 << combine->ScaleShiftRGB); + const GLfloat scaleA = (GLfloat) (1 << combine->ScaleShiftA); + const GLuint numArgsRGB = combine->_NumArgsRGB; + const GLuint numArgsA = combine->_NumArgsA; + GLfloat ccolor[MAX_COMBINER_TERMS][MAX_WIDTH][4]; /* temp color buffers */ + GLfloat rgba[MAX_WIDTH][4]; + GLuint i, term; + + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]); + rgba[i][GCOMP] = CHAN_TO_FLOAT(rgbaChan[i][GCOMP]); + rgba[i][BCOMP] = CHAN_TO_FLOAT(rgbaChan[i][BCOMP]); + rgba[i][ACOMP] = CHAN_TO_FLOAT(rgbaChan[i][ACOMP]); + } /* printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n", - textureUnit->_CurrentCombine->ModeRGB, - textureUnit->_CurrentCombine->ModeA, - textureUnit->_CurrentCombine->SourceRGB[0], - textureUnit->_CurrentCombine->SourceA[0], - textureUnit->_CurrentCombine->SourceRGB[1], - textureUnit->_CurrentCombine->SourceA[1]); + combine->ModeRGB, + combine->ModeA, + combine->SourceRGB[0], + combine->SourceA[0], + combine->SourceRGB[1], + combine->SourceA[1]); */ /* * Do operand setup for up to 4 operands. Loop over the terms. */ - for (j = 0; j < numColorArgs; j++) { - const GLenum srcRGB = textureUnit->_CurrentCombine->SourceRGB[j]; + for (term = 0; term < numArgsRGB; term++) { + const GLenum srcRGB = combine->SourceRGB[term]; + const GLenum operandRGB = combine->OperandRGB[term]; switch (srcRGB) { case GL_TEXTURE: - argRGB[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); + argRGB[term] = get_texel_array(swrast, unit); break; case GL_PRIMARY_COLOR: - argRGB[j] = primary_rgba; + argRGB[term] = primary_rgba; break; case GL_PREVIOUS: - argRGB[j] = (const GLchan (*)[4]) rgba; + argRGB[term] = rgba; break; case GL_CONSTANT: { - GLchan (*c)[4] = ccolor[j]; - GLchan red, green, blue, alpha; - UNCLAMPED_FLOAT_TO_CHAN(red, textureUnit->EnvColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(green, textureUnit->EnvColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(blue, textureUnit->EnvColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); + float4_array c = ccolor[term]; + GLfloat red = textureUnit->EnvColor[0]; + GLfloat green = textureUnit->EnvColor[1]; + GLfloat blue = textureUnit->EnvColor[2]; + GLfloat alpha = textureUnit->EnvColor[3]; for (i = 0; i < n; i++) { - c[i][RCOMP] = red; - c[i][GCOMP] = green; - c[i][BCOMP] = blue; - c[i][ACOMP] = alpha; + ASSIGN_4V(c[i], red, green, blue, alpha); } - argRGB[j] = (const GLchan (*)[4]) ccolor[j]; + argRGB[term] = ccolor[term]; } break; /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. */ case GL_ZERO: - argRGB[j] = & zero; + { + float4_array c = ccolor[term]; + for (i = 0; i < n; i++) { + ASSIGN_4V(c[i], 0.0F, 0.0F, 0.0F, 0.0F); + } + argRGB[term] = ccolor[term]; + } break; case GL_ONE: - argRGB[j] = & one; + { + float4_array c = ccolor[term]; + for (i = 0; i < n; i++) { + ASSIGN_4V(c[i], 1.0F, 1.0F, 1.0F, 1.0F); + } + argRGB[term] = ccolor[term]; + } break; default: /* ARB_texture_env_crossbar source */ @@ -148,76 +166,88 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) return; - argRGB[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); + argRGB[term] = get_texel_array(swrast, srcUnit); } } - if (textureUnit->_CurrentCombine->OperandRGB[j] != GL_SRC_COLOR) { - const GLchan (*src)[4] = argRGB[j]; - GLchan (*dst)[4] = ccolor[j]; + if (operandRGB != GL_SRC_COLOR) { + float4_array src = argRGB[term]; + float4_array dst = ccolor[term]; - /* point to new arg[j] storage */ - argRGB[j] = (const GLchan (*)[4]) ccolor[j]; + /* point to new arg[term] storage */ + argRGB[term] = ccolor[term]; - if (textureUnit->_CurrentCombine->OperandRGB[j] == GL_ONE_MINUS_SRC_COLOR) { + switch (operandRGB) { + case GL_ONE_MINUS_SRC_COLOR: for (i = 0; i < n; i++) { - dst[i][RCOMP] = CHAN_MAX - src[i][RCOMP]; - dst[i][GCOMP] = CHAN_MAX - src[i][GCOMP]; - dst[i][BCOMP] = CHAN_MAX - src[i][BCOMP]; + dst[i][RCOMP] = 1.0F - src[i][RCOMP]; + dst[i][GCOMP] = 1.0F - src[i][GCOMP]; + dst[i][BCOMP] = 1.0F - src[i][BCOMP]; } - } - else if (textureUnit->_CurrentCombine->OperandRGB[j] == GL_SRC_ALPHA) { + break; + case GL_SRC_ALPHA: for (i = 0; i < n; i++) { - dst[i][RCOMP] = src[i][ACOMP]; - dst[i][GCOMP] = src[i][ACOMP]; + dst[i][RCOMP] = + dst[i][GCOMP] = dst[i][BCOMP] = src[i][ACOMP]; } - } - else { - ASSERT(textureUnit->_CurrentCombine->OperandRGB[j] ==GL_ONE_MINUS_SRC_ALPHA); + break; + case GL_ONE_MINUS_SRC_ALPHA: for (i = 0; i < n; i++) { - dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP]; - dst[i][GCOMP] = CHAN_MAX - src[i][ACOMP]; - dst[i][BCOMP] = CHAN_MAX - src[i][ACOMP]; + dst[i][RCOMP] = + dst[i][GCOMP] = + dst[i][BCOMP] = 1.0F - src[i][ACOMP]; } + break; + default: + _mesa_problem(ctx, "Bad operandRGB"); } } } /* - * Set up the argA[i] pointers + * Set up the argA[term] pointers */ - for (j = 0; j < numAlphaArgs; j++) { - const GLenum srcA = textureUnit->_CurrentCombine->SourceA[j]; + for (term = 0; term < numArgsA; term++) { + const GLenum srcA = combine->SourceA[term]; + const GLenum operandA = combine->OperandA[term]; switch (srcA) { case GL_TEXTURE: - argA[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); + argA[term] = get_texel_array(swrast, unit); break; case GL_PRIMARY_COLOR: - argA[j] = primary_rgba; + argA[term] = primary_rgba; break; case GL_PREVIOUS: - argA[j] = (const GLchan (*)[4]) rgba; + argA[term] = rgba; break; case GL_CONSTANT: { - GLchan alpha, (*c)[4] = ccolor[j]; - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); + float4_array c = ccolor[term]; + GLfloat alpha = textureUnit->EnvColor[3]; for (i = 0; i < n; i++) c[i][ACOMP] = alpha; - argA[j] = (const GLchan (*)[4]) ccolor[j]; + argA[term] = ccolor[term]; } break; /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. */ case GL_ZERO: - argA[j] = & zero; + { + float4_array c = ccolor[term]; + for (i = 0; i < n; i++) + c[i][ACOMP] = 0.0F; + argA[term] = ccolor[term]; + } break; case GL_ONE: - argA[j] = & one; + { + float4_array c = ccolor[term]; + for (i = 0; i < n; i++) + c[i][ACOMP] = 1.0F; + argA[term] = ccolor[term]; + } break; default: /* ARB_texture_env_crossbar source */ @@ -226,598 +256,258 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) return; - argA[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); + argA[term] = get_texel_array(swrast, srcUnit); } } - if (textureUnit->_CurrentCombine->OperandA[j] == GL_ONE_MINUS_SRC_ALPHA) { - const GLchan (*src)[4] = argA[j]; - GLchan (*dst)[4] = ccolor[j]; - argA[j] = (const GLchan (*)[4]) ccolor[j]; + if (operandA == GL_ONE_MINUS_SRC_ALPHA) { + float4_array src = argA[term]; + float4_array dst = ccolor[term]; + argA[term] = ccolor[term]; for (i = 0; i < n; i++) { - dst[i][ACOMP] = CHAN_MAX - src[i][ACOMP]; + dst[i][ACOMP] = 1.0F - src[i][ACOMP]; } } } - /* - * Do the texture combine. - */ - switch (textureUnit->_CurrentCombine->ModeRGB) { + /* RGB channel combine */ + { + float4_array arg0 = argRGB[0]; + float4_array arg1 = argRGB[1]; + float4_array arg2 = argRGB[2]; + float4_array arg3 = argRGB[3]; + + switch (combine->ModeRGB) { case GL_REPLACE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - if (RGBshift) { - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = arg0[i][RCOMP] * RGBmult; - rgba[i][GCOMP] = arg0[i][GCOMP] * RGBmult; - rgba[i][BCOMP] = arg0[i][BCOMP] * RGBmult; -#else - GLuint r = (GLuint) arg0[i][RCOMP] << RGBshift; - GLuint g = (GLuint) arg0[i][GCOMP] << RGBshift; - GLuint b = (GLuint) arg0[i][BCOMP] << RGBshift; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); -#endif - } - } - else { - for (i = 0; i < n; i++) { - rgba[i][RCOMP] = arg0[i][RCOMP]; - rgba[i][GCOMP] = arg0[i][GCOMP]; - rgba[i][BCOMP] = arg0[i][BCOMP]; - } - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = arg0[i][RCOMP] * scaleRGB; + rgba[i][GCOMP] = arg0[i][GCOMP] * scaleRGB; + rgba[i][BCOMP] = arg0[i][BCOMP] * scaleRGB; } break; case GL_MODULATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * RGBmult; - rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * RGBmult; - rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * RGBmult; -#else - GLuint r = PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift; - GLuint g = PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift; - GLuint b = PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = arg0[i][RCOMP] * arg1[i][RCOMP] * scaleRGB; + rgba[i][GCOMP] = arg0[i][GCOMP] * arg1[i][GCOMP] * scaleRGB; + rgba[i][BCOMP] = arg0[i][BCOMP] * arg1[i][BCOMP] * scaleRGB; } break; case GL_ADD: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] + - arg2[i][RCOMP] * arg3[i][RCOMP]) * RGBmult; + arg2[i][RCOMP] * arg3[i][RCOMP]) * scaleRGB; rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] + - arg2[i][GCOMP] * arg3[i][GCOMP]) * RGBmult; + arg2[i][GCOMP] * arg3[i][GCOMP]) * scaleRGB; rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] + - arg2[i][BCOMP] * arg3[i][BCOMP]) * RGBmult; -#else - const GLint shift = CHAN_BITS - RGBshift; - GLint r = (PROD(arg0[i][RCOMP], arg1[i][RCOMP]) >> shift) + - (PROD(arg2[i][RCOMP], arg3[i][RCOMP]) >> shift); - GLint g = (PROD(arg0[i][GCOMP], arg1[i][GCOMP]) >> shift) + - (PROD(arg2[i][GCOMP], arg3[i][GCOMP]) >> shift); - GLint b = (PROD(arg0[i][BCOMP], arg1[i][BCOMP]) >> shift) + - (PROD(arg2[i][BCOMP], arg3[i][BCOMP]) >> shift); - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif + arg2[i][BCOMP] * arg3[i][BCOMP]) * scaleRGB; } } else { /* 2-term addition */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * RGBmult; -#else - GLint r = ((GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP]) << RGBshift; - GLint g = ((GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP]) << RGBshift; - GLint b = ((GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP]) << RGBshift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif + rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP]) * scaleRGB; + rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP]) * scaleRGB; + rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP]) * scaleRGB; } } break; case GL_ADD_SIGNED: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) - 0.5 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argRGB[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] * - arg2[i][RCOMP] + arg3[i][RCOMP] - 0.5) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] * - arg2[i][GCOMP] + arg3[i][GCOMP] - 0.5) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] * - arg2[i][BCOMP] + arg3[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (((PROD(arg0[i][RCOMP], arg1[i][RCOMP]) + - PROD(arg2[i][RCOMP], arg3[i][RCOMP])) >> CHAN_BITS) - half) - << RGBshift; - GLint g = (((PROD(arg0[i][GCOMP], arg1[i][GCOMP]) + - PROD(arg2[i][GCOMP], arg3[i][GCOMP])) >> CHAN_BITS) - half) - << RGBshift; - GLint b = (((PROD(arg0[i][BCOMP], arg1[i][BCOMP]) + - PROD(arg2[i][BCOMP], arg3[i][BCOMP])) >> CHAN_BITS) - half) - << RGBshift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif + rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] + + arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5) * scaleRGB; + rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] + + arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5) * scaleRGB; + rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] + + arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5) * scaleRGB; } } else { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (GLint) arg0[i][RCOMP] + (GLint) arg1[i][RCOMP] - half; - GLint g = (GLint) arg0[i][GCOMP] + (GLint) arg1[i][GCOMP] - half; - GLint b = (GLint) arg0[i][BCOMP] + (GLint) arg1[i][BCOMP] - half; - r = (r < 0) ? 0 : r << RGBshift; - g = (g < 0) ? 0 : g << RGBshift; - b = (b < 0) ? 0 : b << RGBshift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif + rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] - 0.5) * scaleRGB; + rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] - 0.5) * scaleRGB; + rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] - 0.5) * scaleRGB; } } break; case GL_INTERPOLATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] + - arg1[i][RCOMP] * (CHAN_MAXF - arg2[i][RCOMP])) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] + - arg1[i][GCOMP] * (CHAN_MAXF - arg2[i][GCOMP])) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] + - arg1[i][BCOMP] * (CHAN_MAXF - arg2[i][BCOMP])) * RGBmult; -#else - GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + PROD(arg1[i][RCOMP], CHAN_MAX - arg2[i][RCOMP])) - >> shift; - GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + PROD(arg1[i][GCOMP], CHAN_MAX - arg2[i][GCOMP])) - >> shift; - GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + PROD(arg1[i][BCOMP], CHAN_MAX - arg2[i][BCOMP])) - >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = (arg0[i][RCOMP] * arg2[i][RCOMP] + + arg1[i][RCOMP] * (1.0F - arg2[i][RCOMP])) * scaleRGB; + rgba[i][GCOMP] = (arg0[i][GCOMP] * arg2[i][GCOMP] + + arg1[i][GCOMP] * (1.0F - arg2[i][GCOMP])) * scaleRGB; + rgba[i][BCOMP] = (arg0[i][BCOMP] * arg2[i][BCOMP] + + arg1[i][BCOMP] * (1.0F - arg2[i][BCOMP])) * scaleRGB; } break; case GL_SUBTRACT: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * RGBmult; -#else - GLint r = ((GLint) arg0[i][RCOMP] - (GLint) arg1[i][RCOMP]) << RGBshift; - GLint g = ((GLint) arg0[i][GCOMP] - (GLint) arg1[i][GCOMP]) << RGBshift; - GLint b = ((GLint) arg0[i][BCOMP] - (GLint) arg1[i][BCOMP]) << RGBshift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = (arg0[i][RCOMP] - arg1[i][RCOMP]) * scaleRGB; + rgba[i][GCOMP] = (arg0[i][GCOMP] - arg1[i][GCOMP]) * scaleRGB; + rgba[i][BCOMP] = (arg0[i][BCOMP] - arg1[i][BCOMP]) * scaleRGB; } break; case GL_DOT3_RGB_EXT: case GL_DOT3_RGBA_EXT: - { - /* Do not scale the result by 1 2 or 4 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + - (arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) + - (arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F)) - * 4.0F; - dot = CLAMP(dot, 0.0F, CHAN_MAXF); -#else - GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half, - (GLint)arg1[i][RCOMP] - half) + - S_PROD((GLint)arg0[i][GCOMP] - half, - (GLint)arg1[i][GCOMP] - half) + - S_PROD((GLint)arg0[i][BCOMP] - half, - (GLint)arg1[i][BCOMP] - half)) >> 6; - dot = CLAMP(dot, 0, CHAN_MAX); -#endif - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot; - } + /* Do not scale the result by 1 2 or 4 */ + for (i = 0; i < n; i++) { + GLfloat dot = ((arg0[i][RCOMP] - 0.5F) * (arg1[i][RCOMP] - 0.5F) + + (arg0[i][GCOMP] - 0.5F) * (arg1[i][GCOMP] - 0.5F) + + (arg0[i][BCOMP] - 0.5F) * (arg1[i][BCOMP] - 0.5F)) + * 4.0F; + dot = CLAMP(dot, 0.0F, 1.0F); + rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = dot; } break; case GL_DOT3_RGB: case GL_DOT3_RGBA: - { - /* DO scale the result by 1 2 or 4 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) + - (arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) + - (arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F)) - * 4.0F * RGBmult; - dot = CLAMP(dot, 0.0, CHAN_MAXF); -#else - GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half, - (GLint)arg1[i][RCOMP] - half) + - S_PROD((GLint)arg0[i][GCOMP] - half, - (GLint)arg1[i][GCOMP] - half) + - S_PROD((GLint)arg0[i][BCOMP] - half, - (GLint)arg1[i][BCOMP] - half)) >> 6; - dot <<= RGBshift; - dot = CLAMP(dot, 0, CHAN_MAX); -#endif - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot; - } + /* DO scale the result by 1 2 or 4 */ + for (i = 0; i < n; i++) { + GLfloat dot = ((arg0[i][RCOMP] - 0.5F) * (arg1[i][RCOMP] - 0.5F) + + (arg0[i][GCOMP] - 0.5F) * (arg1[i][GCOMP] - 0.5F) + + (arg0[i][BCOMP] - 0.5F) * (arg1[i][BCOMP] - 0.5F)) + * 4.0F * scaleRGB; + dot = CLAMP(dot, 0.0, 1.0F); + rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = dot; } break; case GL_MODULATE_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP]) * RGBmult; -#else - GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + ((GLuint) arg1[i][RCOMP] << CHAN_BITS)) >> shift; - GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + ((GLuint) arg1[i][GCOMP] << CHAN_BITS)) >> shift; - GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + ((GLuint) arg1[i][BCOMP] << CHAN_BITS)) >> shift; - rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + + arg1[i][RCOMP]) * scaleRGB; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + + arg1[i][GCOMP]) * scaleRGB; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + + arg1[i][BCOMP]) * scaleRGB; } break; case GL_MODULATE_SIGNED_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP] - 0.5) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP] - 0.5) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP] - 0.5) * RGBmult; -#else - GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - + (((GLint) arg1[i][RCOMP] - half) << CHAN_BITS)) - >> shift; - GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - + (((GLint) arg1[i][GCOMP] - half) << CHAN_BITS)) - >> shift; - GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - + (((GLint) arg1[i][BCOMP] - half) << CHAN_BITS)) - >> shift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + + arg1[i][RCOMP] - 0.5) * scaleRGB; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + + arg1[i][GCOMP] - 0.5) * scaleRGB; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + + arg1[i][BCOMP] - 0.5) * scaleRGB; } break; case GL_MODULATE_SUBTRACT_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - RGBshift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - arg1[i][RCOMP]) * RGBmult; - rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - arg1[i][GCOMP]) * RGBmult; - rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - arg1[i][BCOMP]) * RGBmult; -#else - GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) - - ((GLint) arg1[i][RCOMP] << CHAN_BITS)) - >> shift; - GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) - - ((GLint) arg1[i][GCOMP] << CHAN_BITS)) - >> shift; - GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) - - ((GLint) arg1[i][BCOMP] << CHAN_BITS)) - >> shift; - rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); - rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); - rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - + arg1[i][RCOMP]) * scaleRGB; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - + arg1[i][GCOMP]) * scaleRGB; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - + arg1[i][BCOMP]) * scaleRGB; } break; case GL_BUMP_ENVMAP_ATI: - { - /* this produces a fixed rgba color, and the coord calc is done elsewhere */ - for (i = 0; i < n; i++) { + /* this produces a fixed rgba color, and the coord calc is done elsewhere */ + for (i = 0; i < n; i++) { /* rgba result is 0,0,0,1 */ #if CHAN_TYPE == GL_FLOAT - rgba[i][RCOMP] = 0.0; - rgba[i][GCOMP] = 0.0; - rgba[i][BCOMP] = 0.0; - rgba[i][ACOMP] = 1.0; + rgba[i][RCOMP] = 0.0; + rgba[i][GCOMP] = 0.0; + rgba[i][BCOMP] = 0.0; + rgba[i][ACOMP] = 1.0; #else - rgba[i][RCOMP] = 0; - rgba[i][GCOMP] = 0; - rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = CHAN_MAX; + rgba[i][RCOMP] = 0; + rgba[i][GCOMP] = 0; + rgba[i][BCOMP] = 0; + rgba[i][ACOMP] = CHAN_MAX; #endif - } } return; /* no alpha processing */ default: _mesa_problem(ctx, "invalid combine mode"); + } } - switch (textureUnit->_CurrentCombine->ModeA) { + /* Alpha channel combine */ + { + float4_array arg0 = argA[0]; + float4_array arg1 = argA[1]; + float4_array arg2 = argA[2]; + float4_array arg3 = argA[3]; + + switch (combine->ModeA) { case GL_REPLACE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - if (Ashift) { - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - GLchan a = arg0[i][ACOMP] * Amult; -#else - GLuint a = (GLuint) arg0[i][ACOMP] << Ashift; -#endif - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); - } - } - else { - for (i = 0; i < n; i++) { - rgba[i][ACOMP] = arg0[i][ACOMP]; - } - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = arg0[i][ACOMP] * scaleA; } break; case GL_MODULATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * Amult; -#else - GLuint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift); - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = arg0[i][ACOMP] * arg1[i][ACOMP] * scaleA; } break; case GL_ADD: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + - arg2[i][ACOMP] * arg3[i][ACOMP]) * Amult; -#else - const GLint shift = CHAN_BITS - Ashift; - GLint a = (PROD(arg0[i][ACOMP], arg1[i][ACOMP]) >> shift) + - (PROD(arg2[i][ACOMP], arg3[i][ACOMP]) >> shift); - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif + arg2[i][ACOMP] * arg3[i][ACOMP]) * scaleA; } } else { /* two-term add */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * Amult; -#else - GLint a = ((GLint) arg0[i][ACOMP] + arg1[i][ACOMP]) << Ashift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif + rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP]) * scaleA; } } break; case GL_ADD_SIGNED: if (textureUnit->EnvMode == GL_COMBINE4_NV) { /* (a * b) + (c * d) - 0.5 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; - const GLchan (*arg3)[4] = (const GLchan (*)[4]) argA[3]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT rgba[i][ACOMP] = (arg0[i][ACOMP] * arg1[i][ACOMP] + arg2[i][ACOMP] * arg3[i][ACOMP] - - 0.5) * Amult; -#else - GLint a = (((PROD(arg0[i][ACOMP], arg1[i][ACOMP]) + - PROD(arg2[i][ACOMP], arg3[i][ACOMP])) >> CHAN_BITS) - half) - << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif + 0.5) * scaleA; } } else { /* a + b - 0.5 */ - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * Amult; -#else - GLint a = (GLint) arg0[i][ACOMP] + (GLint) arg1[i][ACOMP] -half; - a = (a < 0) ? 0 : a << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif + rgba[i][ACOMP] = (arg0[i][ACOMP] + arg1[i][ACOMP] - 0.5F) * scaleA; } } break; case GL_INTERPOLATE: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i=0; i<n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] * arg2[i][ACOMP] + - arg1[i][ACOMP] * (CHAN_MAXF - arg2[i][ACOMP])) - * Amult; -#else - GLuint a = (PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + PROD(arg1[i][ACOMP], CHAN_MAX - arg2[i][ACOMP])) - >> shift; - rgba[i][ACOMP] = (GLchan) MIN2(a, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = (arg0[i][ACOMP] * arg2[i][ACOMP] + + arg1[i][ACOMP] * (1.0F - arg2[i][ACOMP])) + * scaleA; } break; case GL_SUBTRACT: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * Amult; -#else - GLint a = ((GLint) arg0[i][ACOMP] - (GLint) arg1[i][ACOMP]) << Ashift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = (arg0[i][ACOMP] - arg1[i][ACOMP]) * scaleA; } break; case GL_MODULATE_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP]) * Amult; -#else - GLint a = (PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + ((GLuint) arg1[i][ACOMP] << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + + arg1[i][ACOMP]) * scaleA; } break; case GL_MODULATE_SIGNED_ADD_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP] - 0.5F) * Amult; -#else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - + (((GLint) arg1[i][ACOMP] - half) << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + + arg1[i][ACOMP] - 0.5F) * scaleA; } break; case GL_MODULATE_SUBTRACT_ATI: - { - const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; - const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; - const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; -#if CHAN_TYPE != GL_FLOAT - const GLint shift = CHAN_BITS - Ashift; -#endif - for (i = 0; i < n; i++) { -#if CHAN_TYPE == GL_FLOAT - rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) - arg1[i][ACOMP]) * Amult; -#else - GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) - - ((GLint) arg1[i][ACOMP] << CHAN_BITS)) - >> shift; - rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); -#endif - } + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + - arg1[i][ACOMP]) * scaleA; } break; default: _mesa_problem(ctx, "invalid combine mode"); + } } /* Fix the alpha component for GL_DOT3_RGBA_EXT/ARB combining. @@ -825,14 +515,20 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, * were written such that the GL_COMBINE_ALPHA value could be set to * GL_DOT3. */ - if (textureUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA_EXT || - textureUnit->_CurrentCombine->ModeRGB == GL_DOT3_RGBA) { + if (combine->ModeRGB == GL_DOT3_RGBA_EXT || + combine->ModeRGB == GL_DOT3_RGBA) { for (i = 0; i < n; i++) { rgba[i][ACOMP] = rgba[i][RCOMP]; } } + + for (i = 0; i < n; i++) { + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][RCOMP], rgba[i][RCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][GCOMP], rgba[i][GCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][BCOMP], rgba[i][BCOMP]); + UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][ACOMP], rgba[i][ACOMP]); + } } -#undef PROD /** @@ -840,17 +536,17 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, * See GL_EXT_texture_swizzle. */ static void -swizzle_texels(GLuint swizzle, GLuint count, GLchan (*texels)[4]) +swizzle_texels(GLuint swizzle, GLuint count, float4_array texels) { const GLuint swzR = GET_SWZ(swizzle, 0); const GLuint swzG = GET_SWZ(swizzle, 1); const GLuint swzB = GET_SWZ(swizzle, 2); const GLuint swzA = GET_SWZ(swizzle, 3); - GLchan vector[6]; + GLfloat vector[6]; GLuint i; vector[SWIZZLE_ZERO] = 0; - vector[SWIZZLE_ONE] = CHAN_MAX; + vector[SWIZZLE_ONE] = 1.0F; for (i = 0; i < count; i++) { vector[SWIZZLE_X] = texels[i][0]; @@ -866,394 +562,45 @@ swizzle_texels(GLuint swizzle, GLuint count, GLchan (*texels)[4]) /** - * Apply a conventional OpenGL texture env mode (REPLACE, ADD, BLEND, - * MODULATE, or DECAL) to an array of fragments. - * Input: textureUnit - pointer to texture unit to apply - * format - base internal texture format - * n - number of fragments - * primary_rgba - primary colors (may alias rgba for single texture) - * texels - array of texel colors - * InOut: rgba - incoming fragment colors modified by texel colors - * according to the texture environment mode. - */ -static void -texture_apply( const GLcontext *ctx, - const struct gl_texture_unit *texUnit, - GLuint n, - CONST GLchan primary_rgba[][4], CONST GLchan texel[][4], - GLchan rgba[][4] ) -{ - GLint baseLevel; - GLuint i; - GLchan Rc, Gc, Bc, Ac; - GLenum format; - (void) primary_rgba; - - ASSERT(texUnit); - ASSERT(texUnit->_Current); - - baseLevel = texUnit->_Current->BaseLevel; - ASSERT(texUnit->_Current->Image[0][baseLevel]); - - format = texUnit->_Current->Image[0][baseLevel]->_BaseFormat; - - if (format == GL_COLOR_INDEX || format == GL_YCBCR_MESA) { - format = GL_RGBA; /* a bit of a hack */ - } - else if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - format = texUnit->_Current->DepthMode; - } - - switch (texUnit->EnvMode) { - case GL_REPLACE: - switch (format) { - case GL_ALPHA: - for (i=0;i<n;i++) { - /* Cv = Cf */ - /* Av = At */ - rgba[i][ACOMP] = texel[i][ACOMP]; - } - break; - case GL_LUMINANCE: - for (i=0;i<n;i++) { - /* Cv = Lt */ - GLchan Lt = texel[i][RCOMP]; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = Lt; - /* Av = Af */ - } - break; - case GL_LUMINANCE_ALPHA: - for (i=0;i<n;i++) { - GLchan Lt = texel[i][RCOMP]; - /* Cv = Lt */ - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = Lt; - /* Av = At */ - rgba[i][ACOMP] = texel[i][ACOMP]; - } - break; - case GL_INTENSITY: - for (i=0;i<n;i++) { - /* Cv = It */ - GLchan It = texel[i][RCOMP]; - rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = It; - /* Av = It */ - rgba[i][ACOMP] = It; - } - break; - case GL_RGB: - for (i=0;i<n;i++) { - /* Cv = Ct */ - rgba[i][RCOMP] = texel[i][RCOMP]; - rgba[i][GCOMP] = texel[i][GCOMP]; - rgba[i][BCOMP] = texel[i][BCOMP]; - /* Av = Af */ - } - break; - case GL_RGBA: - for (i=0;i<n;i++) { - /* Cv = Ct */ - rgba[i][RCOMP] = texel[i][RCOMP]; - rgba[i][GCOMP] = texel[i][GCOMP]; - rgba[i][BCOMP] = texel[i][BCOMP]; - /* Av = At */ - rgba[i][ACOMP] = texel[i][ACOMP]; - } - break; - default: - _mesa_problem(ctx, "Bad format (GL_REPLACE) in texture_apply"); - return; - } - break; - - case GL_MODULATE: - switch (format) { - case GL_ALPHA: - for (i=0;i<n;i++) { - /* Cv = Cf */ - /* Av = AfAt */ - rgba[i][ACOMP] = CHAN_PRODUCT( rgba[i][ACOMP], texel[i][ACOMP] ); - } - break; - case GL_LUMINANCE: - for (i=0;i<n;i++) { - /* Cv = LtCf */ - GLchan Lt = texel[i][RCOMP]; - rgba[i][RCOMP] = CHAN_PRODUCT( rgba[i][RCOMP], Lt ); - rgba[i][GCOMP] = CHAN_PRODUCT( rgba[i][GCOMP], Lt ); - rgba[i][BCOMP] = CHAN_PRODUCT( rgba[i][BCOMP], Lt ); - /* Av = Af */ - } - break; - case GL_LUMINANCE_ALPHA: - for (i=0;i<n;i++) { - /* Cv = CfLt */ - GLchan Lt = texel[i][RCOMP]; - rgba[i][RCOMP] = CHAN_PRODUCT( rgba[i][RCOMP], Lt ); - rgba[i][GCOMP] = CHAN_PRODUCT( rgba[i][GCOMP], Lt ); - rgba[i][BCOMP] = CHAN_PRODUCT( rgba[i][BCOMP], Lt ); - /* Av = AfAt */ - rgba[i][ACOMP] = CHAN_PRODUCT( rgba[i][ACOMP], texel[i][ACOMP] ); - } - break; - case GL_INTENSITY: - for (i=0;i<n;i++) { - /* Cv = CfIt */ - GLchan It = texel[i][RCOMP]; - rgba[i][RCOMP] = CHAN_PRODUCT( rgba[i][RCOMP], It ); - rgba[i][GCOMP] = CHAN_PRODUCT( rgba[i][GCOMP], It ); - rgba[i][BCOMP] = CHAN_PRODUCT( rgba[i][BCOMP], It ); - /* Av = AfIt */ - rgba[i][ACOMP] = CHAN_PRODUCT( rgba[i][ACOMP], It ); - } - break; - case GL_RGB: - for (i=0;i<n;i++) { - /* Cv = CfCt */ - rgba[i][RCOMP] = CHAN_PRODUCT( rgba[i][RCOMP], texel[i][RCOMP] ); - rgba[i][GCOMP] = CHAN_PRODUCT( rgba[i][GCOMP], texel[i][GCOMP] ); - rgba[i][BCOMP] = CHAN_PRODUCT( rgba[i][BCOMP], texel[i][BCOMP] ); - /* Av = Af */ - } - break; - case GL_RGBA: - for (i=0;i<n;i++) { - /* Cv = CfCt */ - rgba[i][RCOMP] = CHAN_PRODUCT( rgba[i][RCOMP], texel[i][RCOMP] ); - rgba[i][GCOMP] = CHAN_PRODUCT( rgba[i][GCOMP], texel[i][GCOMP] ); - rgba[i][BCOMP] = CHAN_PRODUCT( rgba[i][BCOMP], texel[i][BCOMP] ); - /* Av = AfAt */ - rgba[i][ACOMP] = CHAN_PRODUCT( rgba[i][ACOMP], texel[i][ACOMP] ); - } - break; - default: - _mesa_problem(ctx, "Bad format (GL_MODULATE) in texture_apply"); - return; - } - break; - - case GL_DECAL: - switch (format) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - /* undefined */ - break; - case GL_RGB: - for (i=0;i<n;i++) { - /* Cv = Ct */ - rgba[i][RCOMP] = texel[i][RCOMP]; - rgba[i][GCOMP] = texel[i][GCOMP]; - rgba[i][BCOMP] = texel[i][BCOMP]; - /* Av = Af */ - } - break; - case GL_RGBA: - for (i=0;i<n;i++) { - /* Cv = Cf(1-At) + CtAt */ - GLchan t = texel[i][ACOMP], s = CHAN_MAX - t; - rgba[i][RCOMP] = CHAN_PRODUCT(rgba[i][RCOMP], s) + CHAN_PRODUCT(texel[i][RCOMP],t); - rgba[i][GCOMP] = CHAN_PRODUCT(rgba[i][GCOMP], s) + CHAN_PRODUCT(texel[i][GCOMP],t); - rgba[i][BCOMP] = CHAN_PRODUCT(rgba[i][BCOMP], s) + CHAN_PRODUCT(texel[i][BCOMP],t); - /* Av = Af */ - } - break; - default: - _mesa_problem(ctx, "Bad format (GL_DECAL) in texture_apply"); - return; - } - break; - - case GL_BLEND: - UNCLAMPED_FLOAT_TO_CHAN(Rc, texUnit->EnvColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(Gc, texUnit->EnvColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(Bc, texUnit->EnvColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(Ac, texUnit->EnvColor[3]); - switch (format) { - case GL_ALPHA: - for (i=0;i<n;i++) { - /* Cv = Cf */ - /* Av = AfAt */ - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP], texel[i][ACOMP]); - } - break; - case GL_LUMINANCE: - for (i=0;i<n;i++) { - /* Cv = Cf(1-Lt) + CcLt */ - GLchan Lt = texel[i][RCOMP], s = CHAN_MAX - Lt; - rgba[i][RCOMP] = CHAN_PRODUCT(rgba[i][RCOMP], s) + CHAN_PRODUCT(Rc, Lt); - rgba[i][GCOMP] = CHAN_PRODUCT(rgba[i][GCOMP], s) + CHAN_PRODUCT(Gc, Lt); - rgba[i][BCOMP] = CHAN_PRODUCT(rgba[i][BCOMP], s) + CHAN_PRODUCT(Bc, Lt); - /* Av = Af */ - } - break; - case GL_LUMINANCE_ALPHA: - for (i=0;i<n;i++) { - /* Cv = Cf(1-Lt) + CcLt */ - GLchan Lt = texel[i][RCOMP], s = CHAN_MAX - Lt; - rgba[i][RCOMP] = CHAN_PRODUCT(rgba[i][RCOMP], s) + CHAN_PRODUCT(Rc, Lt); - rgba[i][GCOMP] = CHAN_PRODUCT(rgba[i][GCOMP], s) + CHAN_PRODUCT(Gc, Lt); - rgba[i][BCOMP] = CHAN_PRODUCT(rgba[i][BCOMP], s) + CHAN_PRODUCT(Bc, Lt); - /* Av = AfAt */ - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP],texel[i][ACOMP]); - } - break; - case GL_INTENSITY: - for (i=0;i<n;i++) { - /* Cv = Cf(1-It) + CcIt */ - GLchan It = texel[i][RCOMP], s = CHAN_MAX - It; - rgba[i][RCOMP] = CHAN_PRODUCT(rgba[i][RCOMP], s) + CHAN_PRODUCT(Rc, It); - rgba[i][GCOMP] = CHAN_PRODUCT(rgba[i][GCOMP], s) + CHAN_PRODUCT(Gc, It); - rgba[i][BCOMP] = CHAN_PRODUCT(rgba[i][BCOMP], s) + CHAN_PRODUCT(Bc, It); - /* Av = Af(1-It) + Ac*It */ - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP], s) + CHAN_PRODUCT(Ac, It); - } - break; - case GL_RGB: - for (i=0;i<n;i++) { - /* Cv = Cf(1-Ct) + CcCt */ - rgba[i][RCOMP] = CHAN_PRODUCT(rgba[i][RCOMP], (CHAN_MAX-texel[i][RCOMP])) + CHAN_PRODUCT(Rc,texel[i][RCOMP]); - rgba[i][GCOMP] = CHAN_PRODUCT(rgba[i][GCOMP], (CHAN_MAX-texel[i][GCOMP])) + CHAN_PRODUCT(Gc,texel[i][GCOMP]); - rgba[i][BCOMP] = CHAN_PRODUCT(rgba[i][BCOMP], (CHAN_MAX-texel[i][BCOMP])) + CHAN_PRODUCT(Bc,texel[i][BCOMP]); - /* Av = Af */ - } - break; - case GL_RGBA: - for (i=0;i<n;i++) { - /* Cv = Cf(1-Ct) + CcCt */ - rgba[i][RCOMP] = CHAN_PRODUCT(rgba[i][RCOMP], (CHAN_MAX-texel[i][RCOMP])) + CHAN_PRODUCT(Rc,texel[i][RCOMP]); - rgba[i][GCOMP] = CHAN_PRODUCT(rgba[i][GCOMP], (CHAN_MAX-texel[i][GCOMP])) + CHAN_PRODUCT(Gc,texel[i][GCOMP]); - rgba[i][BCOMP] = CHAN_PRODUCT(rgba[i][BCOMP], (CHAN_MAX-texel[i][BCOMP])) + CHAN_PRODUCT(Bc,texel[i][BCOMP]); - /* Av = AfAt */ - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP],texel[i][ACOMP]); - } - break; - default: - _mesa_problem(ctx, "Bad format (GL_BLEND) in texture_apply"); - return; - } - break; - - /* XXX don't clamp results if GLchan is float??? */ - - case GL_ADD: /* GL_EXT_texture_add_env */ - switch (format) { - case GL_ALPHA: - for (i=0;i<n;i++) { - /* Rv = Rf */ - /* Gv = Gf */ - /* Bv = Bf */ - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP], texel[i][ACOMP]); - } - break; - case GL_LUMINANCE: - for (i=0;i<n;i++) { - ChanTemp Lt = texel[i][RCOMP]; - ChanTemp r = rgba[i][RCOMP] + Lt; - ChanTemp g = rgba[i][GCOMP] + Lt; - ChanTemp b = rgba[i][BCOMP] + Lt; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); - /* Av = Af */ - } - break; - case GL_LUMINANCE_ALPHA: - for (i=0;i<n;i++) { - ChanTemp Lt = texel[i][RCOMP]; - ChanTemp r = rgba[i][RCOMP] + Lt; - ChanTemp g = rgba[i][GCOMP] + Lt; - ChanTemp b = rgba[i][BCOMP] + Lt; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP], texel[i][ACOMP]); - } - break; - case GL_INTENSITY: - for (i=0;i<n;i++) { - GLchan It = texel[i][RCOMP]; - ChanTemp r = rgba[i][RCOMP] + It; - ChanTemp g = rgba[i][GCOMP] + It; - ChanTemp b = rgba[i][BCOMP] + It; - ChanTemp a = rgba[i][ACOMP] + It; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); - rgba[i][ACOMP] = MIN2(a, CHAN_MAX); - } - break; - case GL_RGB: - for (i=0;i<n;i++) { - ChanTemp r = rgba[i][RCOMP] + texel[i][RCOMP]; - ChanTemp g = rgba[i][GCOMP] + texel[i][GCOMP]; - ChanTemp b = rgba[i][BCOMP] + texel[i][BCOMP]; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); - /* Av = Af */ - } - break; - case GL_RGBA: - for (i=0;i<n;i++) { - ChanTemp r = rgba[i][RCOMP] + texel[i][RCOMP]; - ChanTemp g = rgba[i][GCOMP] + texel[i][GCOMP]; - ChanTemp b = rgba[i][BCOMP] + texel[i][BCOMP]; - rgba[i][RCOMP] = MIN2(r, CHAN_MAX); - rgba[i][GCOMP] = MIN2(g, CHAN_MAX); - rgba[i][BCOMP] = MIN2(b, CHAN_MAX); - rgba[i][ACOMP] = CHAN_PRODUCT(rgba[i][ACOMP], texel[i][ACOMP]); - } - break; - default: - _mesa_problem(ctx, "Bad format (GL_ADD) in texture_apply"); - return; - } - break; - - default: - _mesa_problem(ctx, "Bad env mode in texture_apply"); - return; - } -} - - - -/** * Apply texture mapping to a span of fragments. */ void _swrast_texture_span( GLcontext *ctx, SWspan *span ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLchan primary_rgba[MAX_WIDTH][4]; + GLfloat primary_rgba[MAX_WIDTH][4]; GLuint unit; - ASSERT(span->end < MAX_WIDTH); + ASSERT(span->end <= MAX_WIDTH); /* * Save copy of the incoming fragment colors (the GL_PRIMARY_COLOR) */ - if (swrast->_AnyTextureCombine) - MEMCPY(primary_rgba, span->array->rgba, 4 * span->end * sizeof(GLchan)); + if (swrast->_TextureCombinePrimary) { + GLuint i; + for (i = 0; i < span->end; i++) { + primary_rgba[i][RCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][RCOMP]); + primary_rgba[i][GCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][GCOMP]); + primary_rgba[i][BCOMP] = CHAN_TO_FLOAT(span->array->rgba[i][BCOMP]); + primary_rgba[i][ACOMP] = CHAN_TO_FLOAT(span->array->rgba[i][ACOMP]); + } + } /* First must sample all bump maps */ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { - if (ctx->Texture.Unit[unit]._ReallyEnabled && - ctx->Texture.Unit[unit]._CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) { - const GLfloat (*texcoords)[4] - = (const GLfloat (*)[4]) + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + + if (texUnit->_ReallyEnabled && + texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) { + const GLfloat (*texcoords)[4] = (const GLfloat (*)[4]) span->array->attribs[FRAG_ATTRIB_TEX0 + unit]; - GLfloat (*targetcoords)[4] - = (GLfloat (*)[4]) + float4_array targetcoords = span->array->attribs[FRAG_ATTRIB_TEX0 + ctx->Texture.Unit[unit].BumpTarget - GL_TEXTURE0]; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const struct gl_texture_object *curObj = texUnit->_Current; GLfloat *lambda = span->array->lambda[unit]; - GLchan (*texels)[4] = (GLchan (*)[4]) - (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLchan))); + float4_array texels = get_texel_array(swrast, unit); GLuint i; GLfloat rotMatrix00 = ctx->Texture.Unit[unit].RotMatrix[0]; GLfloat rotMatrix01 = ctx->Texture.Unit[unit].RotMatrix[1]; @@ -1293,19 +640,10 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) not sure this can work correctly even ignoring the problem that channel is unsigned */ for (i = 0; i < span->end; i++) { -#if CHAN_TYPE == GL_FLOAT targetcoords[i][0] += (texels[i][0] * rotMatrix00 + texels[i][1] * rotMatrix01) / targetcoords[i][3]; targetcoords[i][1] += (texels[i][0] * rotMatrix10 + texels[i][1] * rotMatrix11) / targetcoords[i][3]; -#else - targetcoords[i][0] += (CHAN_TO_FLOAT(texels[i][1]) * rotMatrix00 + - CHAN_TO_FLOAT(texels[i][1]) * rotMatrix01) / - targetcoords[i][3]; - targetcoords[i][1] += (CHAN_TO_FLOAT(texels[i][0]) * rotMatrix10 + - CHAN_TO_FLOAT(texels[i][1]) * rotMatrix11) / - targetcoords[i][3]; -#endif } } } @@ -1315,16 +653,14 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) * accomodate GL_ARB_texture_env_crossbar. */ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { - if (ctx->Texture.Unit[unit]._ReallyEnabled && - ctx->Texture.Unit[unit]._CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) { - const GLfloat (*texcoords)[4] - = (const GLfloat (*)[4]) + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + if (texUnit->_ReallyEnabled && + texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) { + const GLfloat (*texcoords)[4] = (const GLfloat (*)[4]) span->array->attribs[FRAG_ATTRIB_TEX0 + unit]; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const struct gl_texture_object *curObj = texUnit->_Current; GLfloat *lambda = span->array->lambda[unit]; - GLchan (*texels)[4] = (GLchan (*)[4]) - (swrast->TexelBuffer + unit * (span->end * 4 * sizeof(GLchan))); + float4_array texels = get_texel_array(swrast, unit); /* adjust texture lod (lambda) */ if (span->arrayMask & SPAN_LAMBDA) { @@ -1357,13 +693,7 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) /* GL_SGI_texture_color_table */ if (texUnit->ColorTableEnabled) { -#if CHAN_TYPE == GL_UNSIGNED_BYTE - _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - _mesa_lookup_rgba_ubyte(&texUnit->ColorTable, span->end, texels); -#else _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels); -#endif } /* GL_EXT_texture_swizzle */ @@ -1373,31 +703,16 @@ _swrast_texture_span( GLcontext *ctx, SWspan *span ) } } - /* * OK, now apply the texture (aka texture combine/blend). * We modify the span->color.rgba values. */ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { if (ctx->Texture.Unit[unit]._ReallyEnabled) { - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - if (texUnit->_CurrentCombine != &texUnit->_EnvMode ) { - texture_combine( ctx, unit, span->end, - (CONST GLchan (*)[4]) primary_rgba, - swrast->TexelBuffer, - span->array->rgba ); - } - else { - /* conventional texture blend */ - const GLchan (*texels)[4] = (const GLchan (*)[4]) - (swrast->TexelBuffer + unit * - (span->end * 4 * sizeof(GLchan))); - - - texture_apply( ctx, texUnit, span->end, - (CONST GLchan (*)[4]) primary_rgba, texels, - span->array->rgba ); - } + texture_combine( ctx, unit, span->end, + primary_rgba, + swrast->TexelBuffer, + span->array->rgba ); } } } diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 19317c393a..a483023a50 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -43,18 +43,11 @@ #define FRAC(f) ((f) - IFLOOR(f)) -/** - * Constants for integer linear interpolation. - */ -#define ILERP_SCALE 65536.0F -#define ILERP_SHIFT 16 - /** - * Linear interpolation macros + * Linear interpolation macro */ #define LERP(T, A, B) ( (A) + (T) * ((B) - (A)) ) -#define ILERP(IT, A, B) ( (A) + (((IT) * ((B) - (A))) >> ILERP_SHIFT) ) /** @@ -76,21 +69,6 @@ lerp_2d(GLfloat a, GLfloat b, /** - * Do 2D/biliner interpolation of integer values. - * \sa lerp_2d - */ -static INLINE GLint -ilerp_2d(GLint ia, GLint ib, - GLint v00, GLint v10, GLint v01, GLint v11) -{ - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint temp0 = ILERP(ia, v00, v10); - const GLint temp1 = ILERP(ia, v01, v11); - return ILERP(ib, temp0, temp1); -} - - -/** * Do 3D/trilinear interpolation of float values. * \sa lerp_2d */ @@ -110,50 +88,15 @@ lerp_3d(GLfloat a, GLfloat b, GLfloat c, /** - * Do 3D/trilinear interpolation of integer values. - * \sa lerp_2d - */ -static INLINE GLint -ilerp_3d(GLint ia, GLint ib, GLint ic, - GLint v000, GLint v100, GLint v010, GLint v110, - GLint v001, GLint v101, GLint v011, GLint v111) -{ - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint temp00 = ILERP(ia, v000, v100); - const GLint temp10 = ILERP(ia, v010, v110); - const GLint temp01 = ILERP(ia, v001, v101); - const GLint temp11 = ILERP(ia, v011, v111); - const GLint temp0 = ILERP(ib, temp00, temp10); - const GLint temp1 = ILERP(ib, temp01, temp11); - return ILERP(ic, temp0, temp1); -} - - -/** * Do linear interpolation of colors. */ static INLINE void -lerp_rgba(GLchan result[4], GLfloat t, const GLchan a[4], const GLchan b[4]) +lerp_rgba(GLfloat result[4], GLfloat t, const GLfloat a[4], const GLfloat b[4]) { -#if CHAN_TYPE == GL_FLOAT result[0] = LERP(t, a[0], b[0]); result[1] = LERP(t, a[1], b[1]); result[2] = LERP(t, a[2], b[2]); result[3] = LERP(t, a[3], b[3]); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - result[0] = (GLchan) (LERP(t, a[0], b[0]) + 0.5); - result[1] = (GLchan) (LERP(t, a[1], b[1]) + 0.5); - result[2] = (GLchan) (LERP(t, a[2], b[2]) + 0.5); - result[3] = (GLchan) (LERP(t, a[3], b[3]) + 0.5); -#else - /* fixed point interpolants in [0, ILERP_SCALE] */ - const GLint it = IROUND_POS(t * ILERP_SCALE); - ASSERT(CHAN_TYPE == GL_UNSIGNED_BYTE); - result[0] = ILERP(it, a[0], b[0]); - result[1] = ILERP(it, a[1], b[1]); - result[2] = ILERP(it, a[2], b[2]); - result[3] = ILERP(it, a[3], b[3]); -#endif } @@ -161,29 +104,14 @@ lerp_rgba(GLchan result[4], GLfloat t, const GLchan a[4], const GLchan b[4]) * Do bilinear interpolation of colors. */ static INLINE void -lerp_rgba_2d(GLchan result[4], GLfloat a, GLfloat b, - const GLchan t00[4], const GLchan t10[4], - const GLchan t01[4], const GLchan t11[4]) +lerp_rgba_2d(GLfloat result[4], GLfloat a, GLfloat b, + const GLfloat t00[4], const GLfloat t10[4], + const GLfloat t01[4], const GLfloat t11[4]) { -#if CHAN_TYPE == GL_FLOAT result[0] = lerp_2d(a, b, t00[0], t10[0], t01[0], t11[0]); result[1] = lerp_2d(a, b, t00[1], t10[1], t01[1], t11[1]); result[2] = lerp_2d(a, b, t00[2], t10[2], t01[2], t11[2]); result[3] = lerp_2d(a, b, t00[3], t10[3], t01[3], t11[3]); -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - result[0] = (GLchan) (lerp_2d(a, b, t00[0], t10[0], t01[0], t11[0]) + 0.5); - result[1] = (GLchan) (lerp_2d(a, b, t00[1], t10[1], t01[1], t11[1]) + 0.5); - result[2] = (GLchan) (lerp_2d(a, b, t00[2], t10[2], t01[2], t11[2]) + 0.5); - result[3] = (GLchan) (lerp_2d(a, b, t00[3], t10[3], t01[3], t11[3]) + 0.5); -#else - const GLint ia = IROUND_POS(a * ILERP_SCALE); - const GLint ib = IROUND_POS(b * ILERP_SCALE); - ASSERT(CHAN_TYPE == GL_UNSIGNED_BYTE); - result[0] = ilerp_2d(ia, ib, t00[0], t10[0], t01[0], t11[0]); - result[1] = ilerp_2d(ia, ib, t00[1], t10[1], t01[1], t11[1]); - result[2] = ilerp_2d(ia, ib, t00[2], t10[2], t01[2], t11[2]); - result[3] = ilerp_2d(ia, ib, t00[3], t10[3], t01[3], t11[3]); -#endif } @@ -191,34 +119,18 @@ lerp_rgba_2d(GLchan result[4], GLfloat a, GLfloat b, * Do trilinear interpolation of colors. */ static INLINE void -lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c, - const GLchan t000[4], const GLchan t100[4], - const GLchan t010[4], const GLchan t110[4], - const GLchan t001[4], const GLchan t101[4], - const GLchan t011[4], const GLchan t111[4]) +lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c, + const GLfloat t000[4], const GLfloat t100[4], + const GLfloat t010[4], const GLfloat t110[4], + const GLfloat t001[4], const GLfloat t101[4], + const GLfloat t011[4], const GLfloat t111[4]) { GLuint k; /* compiler should unroll these short loops */ -#if CHAN_TYPE == GL_FLOAT for (k = 0; k < 4; k++) { result[k] = lerp_3d(a, b, c, t000[k], t100[k], t010[k], t110[k], t001[k], t101[k], t011[k], t111[k]); } -#elif CHAN_TYPE == GL_UNSIGNED_SHORT - for (k = 0; k < 4; k++) { - result[k] = (GLchan)(lerp_3d(a, b, c, - t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]) + 0.5F); - } -#else - GLint ia = IROUND_POS(a * ILERP_SCALE); - GLint ib = IROUND_POS(b * ILERP_SCALE); - GLint ic = IROUND_POS(c * ILERP_SCALE); - for (k = 0; k < 4; k++) { - result[k] = ilerp_3d(ia, ib, ic, t000[k], t100[k], t010[k], t110[k], - t001[k], t101[k], t011[k], t111[k]); - } -#endif } @@ -502,6 +414,168 @@ linear_repeat_texel_location(GLuint size, GLfloat s, /** + * Do clamp/wrap for a texture rectangle coord, GL_NEAREST filter mode. + */ +static INLINE GLint +clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max) +{ + switch (wrapMode) { + case GL_CLAMP: + return IFLOOR( CLAMP(coord, 0.0F, max - 1) ); + case GL_CLAMP_TO_EDGE: + return IFLOOR( CLAMP(coord, 0.5F, max - 0.5F) ); + case GL_CLAMP_TO_BORDER: + return IFLOOR( CLAMP(coord, -0.5F, max + 0.5F) ); + default: + _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_nearest"); + return 0; + } +} + + +/** + * As above, but GL_LINEAR filtering. + */ +static INLINE void +clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, + GLint *i0out, GLint *i1out, GLfloat *weight) +{ + GLfloat fcol; + GLint i0, i1; + switch (wrapMode) { + case GL_CLAMP: + /* Not exactly what the spec says, but it matches NVIDIA output */ + fcol = CLAMP(coord - 0.5F, 0.0, max-1); + i0 = IFLOOR(fcol); + i1 = i0 + 1; + break; + case GL_CLAMP_TO_EDGE: + fcol = CLAMP(coord, 0.5F, max - 0.5F); + fcol -= 0.5F; + i0 = IFLOOR(fcol); + i1 = i0 + 1; + if (i1 > max - 1) + i1 = max - 1; + break; + case GL_CLAMP_TO_BORDER: + fcol = CLAMP(coord, -0.5F, max + 0.5F); + fcol -= 0.5F; + i0 = IFLOOR(fcol); + i1 = i0 + 1; + default: + _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_linear"); + i0 = i1 = 0; + fcol = 0.0F; + } + *i0out = i0; + *i1out = i1; + *weight = FRAC(fcol); +} + + +/** + * Compute nearest integer texcoords for given texobj and coordinate. + */ +static INLINE void +nearest_texcoord(const struct gl_texture_object *texObj, + const GLfloat texcoord[4], + GLint *i, GLint *j, GLint *k) +{ + const GLint baseLevel = texObj->BaseLevel; + const struct gl_texture_image *img = texObj->Image[0][baseLevel]; + const GLint width = img->Width; + const GLint height = img->Height; + const GLint depth = img->Depth; + + switch (texObj->Target) { + case GL_TEXTURE_RECTANGLE_ARB: + *i = clamp_rect_coord_nearest(texObj->WrapS, texcoord[0], width); + *j = clamp_rect_coord_nearest(texObj->WrapT, texcoord[1], height); + *k = 0; + break; + case GL_TEXTURE_1D: + *i = nearest_texel_location(texObj->WrapS, img, width, texcoord[0]); + *j = 0; + *k = 0; + break; + case GL_TEXTURE_2D: + *i = nearest_texel_location(texObj->WrapS, img, width, texcoord[0]); + *j = nearest_texel_location(texObj->WrapT, img, height, texcoord[1]); + *k = 0; + break; + case GL_TEXTURE_1D_ARRAY_EXT: + *i = nearest_texel_location(texObj->WrapS, img, width, texcoord[0]); + *j = clamp_rect_coord_nearest(texObj->WrapT, texcoord[1], height); + *k = 0; + break; + case GL_TEXTURE_2D_ARRAY_EXT: + *i = nearest_texel_location(texObj->WrapS, img, width, texcoord[0]); + *j = nearest_texel_location(texObj->WrapT, img, height, texcoord[1]); + *k = clamp_rect_coord_nearest(texObj->WrapR, texcoord[2], depth); + break; + default: + *i = *j = *k = 0; + } +} + + +/** + * Compute linear integer texcoords for given texobj and coordinate. + */ +static INLINE void +linear_texcoord(const struct gl_texture_object *texObj, + const GLfloat texcoord[4], + GLint *i0, GLint *i1, GLint *j0, GLint *j1, GLint *slice, + GLfloat *wi, GLfloat *wj) +{ + const GLint baseLevel = texObj->BaseLevel; + const struct gl_texture_image *img = texObj->Image[0][baseLevel]; + const GLint width = img->Width; + const GLint height = img->Height; + const GLint depth = img->Depth; + + switch (texObj->Target) { + case GL_TEXTURE_RECTANGLE_ARB: + clamp_rect_coord_linear(texObj->WrapS, texcoord[0], + width, i0, i1, wi); + clamp_rect_coord_linear(texObj->WrapT, texcoord[1], + height, j0, j1, wj); + *slice = 0; + break; + + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + linear_texel_locations(texObj->WrapS, img, width, + texcoord[0], i0, i1, wi); + linear_texel_locations(texObj->WrapT, img, height, + texcoord[1], j0, j1, wj); + *slice = 0; + break; + + case GL_TEXTURE_1D_ARRAY_EXT: + linear_texel_locations(texObj->WrapS, img, width, + texcoord[0], i0, i1, wi); + *j0 = clamp_rect_coord_nearest(texObj->WrapT, texcoord[1], height); + *j1 = *j0; + *slice = 0; + break; + + case GL_TEXTURE_2D_ARRAY_EXT: + linear_texel_locations(texObj->WrapS, img, width, + texcoord[0], i0, i1, wi); + linear_texel_locations(texObj->WrapT, img, height, + texcoord[1], j0, j1, wj); + *slice = clamp_rect_coord_nearest(texObj->WrapR, texcoord[2], depth); + break; + + default: + *slice = 0; + } +} + + + +/** * For linear interpolation between mipmap levels N and N+1, this function * computes N. */ @@ -660,6 +734,44 @@ compute_min_mag_ranges(const struct gl_texture_object *tObj, } +/** + * When we sample the border color, it must be interpreted according to + * the base texture format. Ex: if the texture base format it GL_ALPHA, + * we return (0,0,0,BorderAlpha). + */ +static INLINE void +get_border_color(const struct gl_texture_object *tObj, + const struct gl_texture_image *img, + GLfloat rgba[4]) +{ + switch (img->TexFormat->BaseFormat) { + case GL_RGB: + rgba[0] = tObj->BorderColor[0]; + rgba[1] = tObj->BorderColor[1]; + rgba[2] = tObj->BorderColor[2]; + rgba[3] = 1.0F; + break; + case GL_ALPHA: + rgba[0] = rgba[1] = rgba[2] = 0.0; + rgba[3] = tObj->BorderColor[3]; + break; + case GL_LUMINANCE: + rgba[0] = rgba[1] = rgba[2] = tObj->BorderColor[0]; + rgba[3] = 1.0; + break; + case GL_LUMINANCE_ALPHA: + rgba[0] = rgba[1] = rgba[2] = tObj->BorderColor[0]; + rgba[3] = tObj->BorderColor[3]; + break; + case GL_INTENSITY: + rgba[0] = rgba[1] = rgba[2] = rgba[3] = tObj->BorderColor[0]; + break; + default: + COPY_4V(rgba, tObj->BorderColor); + } +} + + /**********************************************************************/ /* 1-D Texture Sampling Functions */ /**********************************************************************/ @@ -671,7 +783,7 @@ static INLINE void sample_1d_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, - const GLfloat texcoord[4], GLchan rgba[4]) + const GLfloat texcoord[4], GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ GLint i; @@ -680,10 +792,10 @@ sample_1d_nearest(GLcontext *ctx, i += img->Border; if (i < 0 || i >= (GLint) img->Width) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + get_border_color(tObj, img, rgba); } else { - img->FetchTexelc(img, i, 0, 0, rgba); + img->FetchTexelf(img, i, 0, 0, rgba); } } @@ -695,13 +807,13 @@ static INLINE void sample_1d_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, - const GLfloat texcoord[4], GLchan rgba[4]) + const GLfloat texcoord[4], GLfloat rgba[4]) { const GLint width = img->Width2; GLint i0, i1; GLbitfield useBorderColor = 0x0; GLfloat a; - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); @@ -716,16 +828,16 @@ sample_1d_linear(GLcontext *ctx, /* fetch texel colors */ if (useBorderColor & I0BIT) { - COPY_CHAN4(t0, tObj->_BorderChan); + get_border_color(tObj, img, t0); } else { - img->FetchTexelc(img, i0, 0, 0, t0); + img->FetchTexelf(img, i0, 0, 0, t0); } if (useBorderColor & I1BIT) { - COPY_CHAN4(t1, tObj->_BorderChan); + get_border_color(tObj, img, t1); } else { - img->FetchTexelc(img, i1, 0, 0, t1); + img->FetchTexelf(img, i1, 0, 0, t1); } lerp_rgba(rgba, a, t0, t1); @@ -736,7 +848,7 @@ static void sample_1d_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -751,7 +863,7 @@ static void sample_1d_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -766,7 +878,7 @@ static void sample_1d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -777,7 +889,7 @@ sample_1d_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; const GLfloat f = FRAC(lambda[i]); sample_1d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -791,7 +903,7 @@ static void sample_1d_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -802,7 +914,7 @@ sample_1d_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; const GLfloat f = FRAC(lambda[i]); sample_1d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -817,7 +929,7 @@ static void sample_nearest_1d( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4] ) + GLfloat rgba[][4] ) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -833,7 +945,7 @@ static void sample_linear_1d( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4] ) + GLfloat rgba[][4] ) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -849,7 +961,7 @@ static void sample_lambda_1d( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4] ) + const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -929,7 +1041,7 @@ sample_2d_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[]) + GLfloat rgba[]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ @@ -945,10 +1057,10 @@ sample_2d_nearest(GLcontext *ctx, if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + get_border_color(tObj, img, rgba); } else { - img->FetchTexelc(img, i, j, 0, rgba); + img->FetchTexelf(img, i, j, 0, rgba); } } @@ -962,14 +1074,14 @@ sample_2d_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[]) + GLfloat rgba[]) { const GLint width = img->Width2; const GLint height = img->Height2; GLint i0, j0, i1, j1; GLbitfield useBorderColor = 0x0; GLfloat a, b; - GLchan t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ + GLfloat t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); @@ -989,28 +1101,28 @@ sample_2d_linear(GLcontext *ctx, /* fetch four texel colors */ if (useBorderColor & (I0BIT | J0BIT)) { - COPY_CHAN4(t00, tObj->_BorderChan); + get_border_color(tObj, img, t00); } else { - img->FetchTexelc(img, i0, j0, 0, t00); + img->FetchTexelf(img, i0, j0, 0, t00); } if (useBorderColor & (I1BIT | J0BIT)) { - COPY_CHAN4(t10, tObj->_BorderChan); + get_border_color(tObj, img, t10); } else { - img->FetchTexelc(img, i1, j0, 0, t10); + img->FetchTexelf(img, i1, j0, 0, t10); } if (useBorderColor & (I0BIT | J1BIT)) { - COPY_CHAN4(t01, tObj->_BorderChan); + get_border_color(tObj, img, t01); } else { - img->FetchTexelc(img, i0, j1, 0, t01); + img->FetchTexelf(img, i0, j1, 0, t01); } if (useBorderColor & (I1BIT | J1BIT)) { - COPY_CHAN4(t11, tObj->_BorderChan); + get_border_color(tObj, img, t11); } else { - img->FetchTexelc(img, i1, j1, 0, t11); + img->FetchTexelf(img, i1, j1, 0, t11); } lerp_rgba_2d(rgba, a, b, t00, t10, t01, t11); @@ -1026,13 +1138,13 @@ sample_2d_linear_repeat(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[]) + GLfloat rgba[]) { const GLint width = img->Width2; const GLint height = img->Height2; GLint i0, j0, i1, j1; GLfloat wi, wj; - GLchan t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ + GLfloat t00[4], t10[4], t01[4], t11[4]; /* sampled texel colors */ (void) ctx; @@ -1045,10 +1157,10 @@ sample_2d_linear_repeat(GLcontext *ctx, linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi); linear_repeat_texel_location(height, texcoord[1], &j0, &j1, &wj); - img->FetchTexelc(img, i0, j0, 0, t00); - img->FetchTexelc(img, i1, j0, 0, t10); - img->FetchTexelc(img, i0, j1, 0, t01); - img->FetchTexelc(img, i1, j1, 0, t11); + img->FetchTexelf(img, i0, j0, 0, t00); + img->FetchTexelf(img, i1, j0, 0, t10); + img->FetchTexelf(img, i0, j1, 0, t01); + img->FetchTexelf(img, i1, j1, 0, t11); lerp_rgba_2d(rgba, wi, wj, t00, t10, t01, t11); } @@ -1058,7 +1170,7 @@ static void sample_2d_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { @@ -1072,7 +1184,7 @@ static void sample_2d_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1087,7 +1199,7 @@ static void sample_2d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1098,7 +1210,7 @@ sample_2d_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_2d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1112,7 +1224,7 @@ static void sample_2d_linear_mipmap_linear( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4] ) + const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint i; ASSERT(lambda != NULL); @@ -1123,7 +1235,7 @@ sample_2d_linear_mipmap_linear( GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_2d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1137,7 +1249,7 @@ static void sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1150,7 +1262,7 @@ sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); @@ -1167,7 +1279,7 @@ static void sample_nearest_2d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1183,7 +1295,7 @@ static void sample_linear_2d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1279,7 +1391,7 @@ opt_sample_rgba_2d(GLcontext *ctx, const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ - COPY_CHAN4(rgba[i], texel); + COPY_4V(rgba[i], texel); } } @@ -1289,7 +1401,7 @@ static void sample_lambda_2d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel]; GLuint minStart, minEnd; /* texels with minification */ @@ -1312,6 +1424,7 @@ sample_lambda_2d(GLcontext *ctx, case GL_NEAREST: if (repeatNoBorderPOT) { switch (tImg->TexFormat->MesaFormat) { +#if 0 case MESA_FORMAT_RGB: opt_sample_rgb_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); @@ -1320,6 +1433,7 @@ sample_lambda_2d(GLcontext *ctx, opt_sample_rgba_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; +#endif default: sample_nearest_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart ); @@ -1369,6 +1483,7 @@ sample_lambda_2d(GLcontext *ctx, case GL_NEAREST: if (repeatNoBorderPOT) { switch (tImg->TexFormat->MesaFormat) { +#if 0 case MESA_FORMAT_RGB: opt_sample_rgb_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); @@ -1377,6 +1492,7 @@ sample_lambda_2d(GLcontext *ctx, opt_sample_rgba_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; +#endif default: sample_nearest_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart ); @@ -1411,7 +1527,7 @@ sample_3d_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ @@ -1427,10 +1543,10 @@ sample_3d_nearest(GLcontext *ctx, j < 0 || j >= (GLint) img->Height || k < 0 || k >= (GLint) img->Depth) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + get_border_color(tObj, img, rgba); } else { - img->FetchTexelc(img, i, j, k, rgba); + img->FetchTexelf(img, i, j, k, rgba); } } @@ -1443,7 +1559,7 @@ sample_3d_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; const GLint height = img->Height2; @@ -1451,8 +1567,8 @@ sample_3d_linear(GLcontext *ctx, GLint i0, j0, k0, i1, j1, k1; GLbitfield useBorderColor = 0x0; GLfloat a, b, c; - GLchan t000[4], t010[4], t001[4], t011[4]; - GLchan t100[4], t110[4], t101[4], t111[4]; + GLfloat t000[4], t010[4], t001[4], t011[4]; + GLfloat t100[4], t110[4], t101[4], t111[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); @@ -1478,53 +1594,53 @@ sample_3d_linear(GLcontext *ctx, /* Fetch texels */ if (useBorderColor & (I0BIT | J0BIT | K0BIT)) { - COPY_CHAN4(t000, tObj->_BorderChan); + get_border_color(tObj, img, t000); } else { - img->FetchTexelc(img, i0, j0, k0, t000); + img->FetchTexelf(img, i0, j0, k0, t000); } if (useBorderColor & (I1BIT | J0BIT | K0BIT)) { - COPY_CHAN4(t100, tObj->_BorderChan); + get_border_color(tObj, img, t100); } else { - img->FetchTexelc(img, i1, j0, k0, t100); + img->FetchTexelf(img, i1, j0, k0, t100); } if (useBorderColor & (I0BIT | J1BIT | K0BIT)) { - COPY_CHAN4(t010, tObj->_BorderChan); + get_border_color(tObj, img, t010); } else { - img->FetchTexelc(img, i0, j1, k0, t010); + img->FetchTexelf(img, i0, j1, k0, t010); } if (useBorderColor & (I1BIT | J1BIT | K0BIT)) { - COPY_CHAN4(t110, tObj->_BorderChan); + get_border_color(tObj, img, t110); } else { - img->FetchTexelc(img, i1, j1, k0, t110); + img->FetchTexelf(img, i1, j1, k0, t110); } if (useBorderColor & (I0BIT | J0BIT | K1BIT)) { - COPY_CHAN4(t001, tObj->_BorderChan); + get_border_color(tObj, img, t001); } else { - img->FetchTexelc(img, i0, j0, k1, t001); + img->FetchTexelf(img, i0, j0, k1, t001); } if (useBorderColor & (I1BIT | J0BIT | K1BIT)) { - COPY_CHAN4(t101, tObj->_BorderChan); + get_border_color(tObj, img, t101); } else { - img->FetchTexelc(img, i1, j0, k1, t101); + img->FetchTexelf(img, i1, j0, k1, t101); } if (useBorderColor & (I0BIT | J1BIT | K1BIT)) { - COPY_CHAN4(t011, tObj->_BorderChan); + get_border_color(tObj, img, t011); } else { - img->FetchTexelc(img, i0, j1, k1, t011); + img->FetchTexelf(img, i0, j1, k1, t011); } if (useBorderColor & (I1BIT | J1BIT | K1BIT)) { - COPY_CHAN4(t111, tObj->_BorderChan); + get_border_color(tObj, img, t111); } else { - img->FetchTexelc(img, i1, j1, k1, t111); + img->FetchTexelf(img, i1, j1, k1, t111); } /* trilinear interpolation of samples */ @@ -1536,7 +1652,7 @@ static void sample_3d_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4] ) + const GLfloat lambda[], GLfloat rgba[][4] ) { GLuint i; for (i = 0; i < n; i++) { @@ -1550,7 +1666,7 @@ static void sample_3d_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1565,7 +1681,7 @@ static void sample_3d_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1576,7 +1692,7 @@ sample_3d_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_3d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_3d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1590,7 +1706,7 @@ static void sample_3d_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1601,7 +1717,7 @@ sample_3d_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_3d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_3d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -1616,7 +1732,7 @@ static void sample_nearest_3d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1632,7 +1748,7 @@ static void sample_linear_3d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -1648,7 +1764,7 @@ static void sample_lambda_3d(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -1799,7 +1915,7 @@ static void sample_nearest_cube(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; (void) lambda; @@ -1817,7 +1933,7 @@ static void sample_linear_cube(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; (void) lambda; @@ -1835,7 +1951,7 @@ static void sample_cube_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1864,7 +1980,7 @@ static void sample_cube_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1883,7 +1999,7 @@ static void sample_cube_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1898,7 +2014,7 @@ sample_cube_nearest_mipmap_linear(GLcontext *ctx, newCoord, rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_nearest(ctx, tObj, images[level ], newCoord, t0); sample_2d_nearest(ctx, tObj, images[level+1], newCoord, t1); @@ -1912,7 +2028,7 @@ static void sample_cube_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -1927,7 +2043,7 @@ sample_cube_linear_mipmap_linear(GLcontext *ctx, newCoord, rgba[i]); } else { - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; const GLfloat f = FRAC(lambda[i]); sample_2d_linear(ctx, tObj, images[level ], newCoord, t0); sample_2d_linear(ctx, tObj, images[level+1], newCoord, t1); @@ -1942,7 +2058,7 @@ static void sample_lambda_cube(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -2012,71 +2128,11 @@ sample_lambda_cube(GLcontext *ctx, /**********************************************************************/ -/** - * Do clamp/wrap for a texture rectangle coord, GL_NEAREST filter mode. - */ -static INLINE GLint -clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max) -{ - switch (wrapMode) { - case GL_CLAMP: - return IFLOOR( CLAMP(coord, 0.0F, max - 1) ); - case GL_CLAMP_TO_EDGE: - return IFLOOR( CLAMP(coord, 0.5F, max - 0.5F) ); - case GL_CLAMP_TO_BORDER: - return IFLOOR( CLAMP(coord, -0.5F, max + 0.5F) ); - default: - _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_nearest"); - return 0; - } -} - - -/** - * As above, but GL_LINEAR filtering. - */ -static INLINE void -clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, - GLint *i0out, GLint *i1out, GLfloat *weight) -{ - GLfloat fcol; - GLint i0, i1; - switch (wrapMode) { - case GL_CLAMP: - /* Not exactly what the spec says, but it matches NVIDIA output */ - fcol = CLAMP(coord - 0.5F, 0.0, max-1); - i0 = IFLOOR(fcol); - i1 = i0 + 1; - break; - case GL_CLAMP_TO_EDGE: - fcol = CLAMP(coord, 0.5F, max - 0.5F); - fcol -= 0.5F; - i0 = IFLOOR(fcol); - i1 = i0 + 1; - if (i1 > max - 1) - i1 = max - 1; - break; - case GL_CLAMP_TO_BORDER: - fcol = CLAMP(coord, -0.5F, max + 0.5F); - fcol -= 0.5F; - i0 = IFLOOR(fcol); - i1 = i0 + 1; - default: - _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_linear"); - i0 = i1 = 0; - fcol = 0.0F; - } - *i0out = i0; - *i1out = i1; - *weight = FRAC(fcol); -} - - static void sample_nearest_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { const struct gl_texture_image *img = tObj->Image[0][0]; const GLint width = img->Width; @@ -2099,9 +2155,9 @@ sample_nearest_rect(GLcontext *ctx, col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); if (col < 0 || col >= width || row < 0 || row >= height) - COPY_CHAN4(rgba[i], tObj->_BorderChan); + get_border_color(tObj, img, rgba[i]); else - img->FetchTexelc(img, col, row, 0, rgba[i]); + img->FetchTexelf(img, col, row, 0, rgba[i]); } } @@ -2110,7 +2166,7 @@ static void sample_linear_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { const struct gl_texture_image *img = tObj->Image[0][0]; const GLint width = img->Width; @@ -2130,7 +2186,7 @@ sample_linear_rect(GLcontext *ctx, for (i = 0; i < n; i++) { GLint i0, j0, i1, j1; - GLchan t00[4], t01[4], t10[4], t11[4]; + GLfloat t00[4], t01[4], t10[4], t11[4]; GLfloat a, b; GLbitfield useBorderColor = 0x0; @@ -2147,24 +2203,24 @@ sample_linear_rect(GLcontext *ctx, /* get four texel samples */ if (useBorderColor & (I0BIT | J0BIT)) - COPY_CHAN4(t00, tObj->_BorderChan); + get_border_color(tObj, img, t00); else - img->FetchTexelc(img, i0, j0, 0, t00); + img->FetchTexelf(img, i0, j0, 0, t00); if (useBorderColor & (I1BIT | J0BIT)) - COPY_CHAN4(t10, tObj->_BorderChan); + get_border_color(tObj, img, t10); else - img->FetchTexelc(img, i1, j0, 0, t10); + img->FetchTexelf(img, i1, j0, 0, t10); if (useBorderColor & (I0BIT | J1BIT)) - COPY_CHAN4(t01, tObj->_BorderChan); + get_border_color(tObj, img, t01); else - img->FetchTexelc(img, i0, j1, 0, t01); + img->FetchTexelf(img, i0, j1, 0, t01); if (useBorderColor & (I1BIT | J1BIT)) - COPY_CHAN4(t11, tObj->_BorderChan); + get_border_color(tObj, img, t11); else - img->FetchTexelc(img, i1, j1, 0, t11); + img->FetchTexelf(img, i1, j1, 0, t11); lerp_rgba_2d(rgba[i], a, b, t00, t10, t01, t11); } @@ -2176,7 +2232,7 @@ static void sample_lambda_rect(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd, magStart, magEnd; @@ -2222,7 +2278,7 @@ sample_2d_array_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ @@ -2239,10 +2295,10 @@ sample_2d_array_nearest(GLcontext *ctx, j < 0 || j >= (GLint) img->Height || array < 0 || array >= (GLint) img->Depth) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + get_border_color(tObj, img, rgba); } else { - img->FetchTexelc(img, i, j, array, rgba); + img->FetchTexelf(img, i, j, array, rgba); } } @@ -2255,7 +2311,7 @@ sample_2d_array_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; const GLint height = img->Height2; @@ -2264,14 +2320,14 @@ sample_2d_array_linear(GLcontext *ctx, GLint array; GLbitfield useBorderColor = 0x0; GLfloat a, b; - GLchan t00[4], t01[4], t10[4], t11[4]; + GLfloat t00[4], t01[4], t10[4], t11[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); if (array < 0 || array >= depth) { - COPY_CHAN4(rgba, tObj->_BorderChan); + COPY_4V(rgba, tObj->BorderColor); } else { if (img->Border) { @@ -2290,28 +2346,28 @@ sample_2d_array_linear(GLcontext *ctx, /* Fetch texels */ if (useBorderColor & (I0BIT | J0BIT)) { - COPY_CHAN4(t00, tObj->_BorderChan); + get_border_color(tObj, img, t00); } else { - img->FetchTexelc(img, i0, j0, array, t00); + img->FetchTexelf(img, i0, j0, array, t00); } if (useBorderColor & (I1BIT | J0BIT)) { - COPY_CHAN4(t10, tObj->_BorderChan); + get_border_color(tObj, img, t10); } else { - img->FetchTexelc(img, i1, j0, array, t10); + img->FetchTexelf(img, i1, j0, array, t10); } if (useBorderColor & (I0BIT | J1BIT)) { - COPY_CHAN4(t01, tObj->_BorderChan); + get_border_color(tObj, img, t01); } else { - img->FetchTexelc(img, i0, j1, array, t01); + img->FetchTexelf(img, i0, j1, array, t01); } if (useBorderColor & (I1BIT | J1BIT)) { - COPY_CHAN4(t11, tObj->_BorderChan); + get_border_color(tObj, img, t11); } else { - img->FetchTexelc(img, i1, j1, array, t11); + img->FetchTexelf(img, i1, j1, array, t11); } /* trilinear interpolation of samples */ @@ -2324,7 +2380,7 @@ static void sample_2d_array_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { @@ -2339,7 +2395,7 @@ static void sample_2d_array_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2355,7 +2411,7 @@ static void sample_2d_array_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2366,7 +2422,7 @@ sample_2d_array_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); @@ -2382,7 +2438,7 @@ static void sample_2d_array_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2393,7 +2449,7 @@ sample_2d_array_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_2d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); @@ -2410,7 +2466,7 @@ static void sample_nearest_2d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2427,7 +2483,7 @@ static void sample_linear_2d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2443,7 +2499,7 @@ static void sample_lambda_2d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -2532,7 +2588,7 @@ sample_1d_array_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; /* without border, power of two */ const GLint height = img->Height; @@ -2546,10 +2602,10 @@ sample_1d_array_nearest(GLcontext *ctx, if (i < 0 || i >= (GLint) img->Width || array < 0 || array >= (GLint) img->Height) { /* Need this test for GL_CLAMP_TO_BORDER mode */ - COPY_CHAN4(rgba, tObj->_BorderChan); + get_border_color(tObj, img, rgba); } else { - img->FetchTexelc(img, i, array, 0, rgba); + img->FetchTexelf(img, i, array, 0, rgba); } } @@ -2562,7 +2618,7 @@ sample_1d_array_linear(GLcontext *ctx, const struct gl_texture_object *tObj, const struct gl_texture_image *img, const GLfloat texcoord[4], - GLchan rgba[4]) + GLfloat rgba[4]) { const GLint width = img->Width2; const GLint height = img->Height; @@ -2570,7 +2626,7 @@ sample_1d_array_linear(GLcontext *ctx, GLint array; GLbitfield useBorderColor = 0x0; GLfloat a; - GLchan t0[4], t1[4]; + GLfloat t0[4], t1[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); @@ -2589,16 +2645,16 @@ sample_1d_array_linear(GLcontext *ctx, /* Fetch texels */ if (useBorderColor & (I0BIT | K0BIT)) { - COPY_CHAN4(t0, tObj->_BorderChan); + get_border_color(tObj, img, t0); } else { - img->FetchTexelc(img, i0, array, 0, t0); + img->FetchTexelf(img, i0, array, 0, t0); } if (useBorderColor & (I1BIT | K0BIT)) { - COPY_CHAN4(t1, tObj->_BorderChan); + get_border_color(tObj, img, t1); } else { - img->FetchTexelc(img, i1, array, 0, t1); + img->FetchTexelf(img, i1, array, 0, t1); } /* bilinear interpolation of samples */ @@ -2610,7 +2666,7 @@ static void sample_1d_array_nearest_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; for (i = 0; i < n; i++) { @@ -2625,7 +2681,7 @@ static void sample_1d_array_linear_mipmap_nearest(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2641,7 +2697,7 @@ static void sample_1d_array_nearest_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2652,7 +2708,7 @@ sample_1d_array_nearest_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_array_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -2666,7 +2722,7 @@ static void sample_1d_array_linear_mipmap_linear(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoord[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; ASSERT(lambda != NULL); @@ -2677,7 +2733,7 @@ sample_1d_array_linear_mipmap_linear(GLcontext *ctx, texcoord[i], rgba[i]); } else { - GLchan t0[4], t1[4]; /* texels */ + GLfloat t0[4], t1[4]; /* texels */ const GLfloat f = FRAC(lambda[i]); sample_1d_array_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0); sample_1d_array_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1); @@ -2692,7 +2748,7 @@ static void sample_nearest_1d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2708,7 +2764,7 @@ static void sample_linear_1d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], - const GLfloat lambda[], GLchan rgba[][4]) + const GLfloat lambda[], GLfloat rgba[][4]) { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; @@ -2724,7 +2780,7 @@ static void sample_lambda_1d_array(GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint minStart, minEnd; /* texels with minification */ GLuint magStart, magEnd; /* texels with magnification */ @@ -2796,13 +2852,109 @@ sample_lambda_1d_array(GLcontext *ctx, /** + * Compare texcoord against depth sample. Return 1.0 or the ambient value. + */ +static INLINE GLfloat +shadow_compare(GLenum function, GLfloat coord, GLfloat depthSample, + GLfloat ambient) +{ + switch (function) { + case GL_LEQUAL: + return (coord <= depthSample) ? 1.0F : ambient; + case GL_GEQUAL: + return (coord >= depthSample) ? 1.0F : ambient; + case GL_LESS: + return (coord < depthSample) ? 1.0F : ambient; + case GL_GREATER: + return (coord > depthSample) ? 1.0F : ambient; + case GL_EQUAL: + return (coord == depthSample) ? 1.0F : ambient; + case GL_NOTEQUAL: + return (coord != depthSample) ? 1.0F : ambient; + case GL_ALWAYS: + return 1.0F; + case GL_NEVER: + return ambient; + case GL_NONE: + return depthSample; + default: + _mesa_problem(NULL, "Bad compare func in shadow_compare"); + return ambient; + } +} + + +/** + * Compare texcoord against four depth samples. + */ +static INLINE GLfloat +shadow_compare4(GLenum function, GLfloat coord, + GLfloat depth00, GLfloat depth01, + GLfloat depth10, GLfloat depth11, + GLfloat ambient, GLfloat wi, GLfloat wj) +{ + const GLfloat d = (1.0F - (GLfloat) ambient) * 0.25F; + GLfloat luminance = 1.0F; + + switch (function) { + case GL_LEQUAL: + if (depth00 <= coord) luminance -= d; + if (depth01 <= coord) luminance -= d; + if (depth10 <= coord) luminance -= d; + if (depth11 <= coord) luminance -= d; + return luminance; + case GL_GEQUAL: + if (depth00 >= coord) luminance -= d; + if (depth01 >= coord) luminance -= d; + if (depth10 >= coord) luminance -= d; + if (depth11 >= coord) luminance -= d; + return luminance; + case GL_LESS: + if (depth00 < coord) luminance -= d; + if (depth01 < coord) luminance -= d; + if (depth10 < coord) luminance -= d; + if (depth11 < coord) luminance -= d; + return luminance; + case GL_GREATER: + if (depth00 > coord) luminance -= d; + if (depth01 > coord) luminance -= d; + if (depth10 > coord) luminance -= d; + if (depth11 > coord) luminance -= d; + return luminance; + case GL_EQUAL: + if (depth00 == coord) luminance -= d; + if (depth01 == coord) luminance -= d; + if (depth10 == coord) luminance -= d; + if (depth11 == coord) luminance -= d; + return luminance; + case GL_NOTEQUAL: + if (depth00 != coord) luminance -= d; + if (depth01 != coord) luminance -= d; + if (depth10 != coord) luminance -= d; + if (depth11 != coord) luminance -= d; + return luminance; + case GL_ALWAYS: + return 0.0; + case GL_NEVER: + return ambient; + case GL_NONE: + /* ordinary bilinear filtering */ + return lerp_2d(wi, wj, depth00, depth10, depth01, depth11); + default: + _mesa_problem(NULL, "Bad compare func in sample_depth_texture"); + return 0.0F; + } +} + + +/** * Sample a shadow/depth texture. */ static void sample_depth_texture( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan texel[][4] ) + GLfloat texel[][4] ) { const GLint baseLevel = tObj->BaseLevel; const struct gl_texture_image *img = tObj->Image[0][baseLevel]; @@ -2811,9 +2963,9 @@ sample_depth_texture( GLcontext *ctx, const GLint depth = img->Depth; const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT) ? 3 : 2; - GLchan ambient; + GLfloat ambient; GLenum function; - GLchan result; + GLfloat result; (void) lambda; @@ -2826,7 +2978,7 @@ sample_depth_texture( GLcontext *ctx, tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || tObj->Target == GL_TEXTURE_2D_ARRAY_EXT); - UNCLAMPED_FLOAT_TO_CHAN(ambient, tObj->CompareFailValue); + ambient = tObj->CompareFailValue; /* XXXX if tObj->MinFilter != tObj->MagFilter, we're ignoring lambda */ @@ -2839,45 +2991,7 @@ sample_depth_texture( GLcontext *ctx, GLfloat depthSample; GLint col, row, slice; - switch (tObj->Target) { - case GL_TEXTURE_RECTANGLE_ARB: - col = clamp_rect_coord_nearest(tObj->WrapS, texcoords[i][0], width); - row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - slice = 0; - break; - - case GL_TEXTURE_1D: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = 0; - slice = 0; - break; - - case GL_TEXTURE_2D: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = nearest_texel_location(tObj->WrapT, img, height, - texcoords[i][1]); - slice = 0; - break; - - case GL_TEXTURE_1D_ARRAY_EXT: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - slice = 0; - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - col = nearest_texel_location(tObj->WrapS, img, width, - texcoords[i][0]); - row = nearest_texel_location(tObj->WrapT, img, height, - texcoords[i][1]); - slice = clamp_rect_coord_nearest(tObj->WrapR, texcoords[i][2], depth); - break; - default: - col = row = slice = 0; - } + nearest_texcoord(tObj, texcoords[i], &col, &row, &slice); if (col >= 0 && row >= 0 && col < width && row < height && slice >= 0 && slice < depth) { @@ -2887,57 +3001,18 @@ sample_depth_texture( GLcontext *ctx, depthSample = tObj->BorderColor[0]; } - switch (function) { - case GL_LEQUAL: - result = (texcoords[i][compare_coord] <= depthSample) ? CHAN_MAX : ambient; - break; - case GL_GEQUAL: - result = (texcoords[i][compare_coord] >= depthSample) ? CHAN_MAX : ambient; - break; - case GL_LESS: - result = (texcoords[i][compare_coord] < depthSample) ? CHAN_MAX : ambient; - break; - case GL_GREATER: - result = (texcoords[i][compare_coord] > depthSample) ? CHAN_MAX : ambient; - break; - case GL_EQUAL: - result = (texcoords[i][compare_coord] == depthSample) ? CHAN_MAX : ambient; - break; - case GL_NOTEQUAL: - result = (texcoords[i][compare_coord] != depthSample) ? CHAN_MAX : ambient; - break; - case GL_ALWAYS: - result = CHAN_MAX; - break; - case GL_NEVER: - result = ambient; - break; - case GL_NONE: - CLAMPED_FLOAT_TO_CHAN(result, depthSample); - break; - default: - _mesa_problem(ctx, "Bad compare func in sample_depth_texture"); - return; - } + result = shadow_compare(function, texcoords[i][compare_coord], + depthSample, ambient); switch (tObj->DepthMode) { case GL_LUMINANCE: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = CHAN_MAX; + ASSIGN_4V(texel[i], result, result, result, 1.0F); break; case GL_INTENSITY: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = result; + ASSIGN_4V(texel[i], result, result, result, result); break; case GL_ALPHA: - texel[i][RCOMP] = 0; - texel[i][GCOMP] = 0; - texel[i][BCOMP] = 0; - texel[i][ACOMP] = result; + ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result); break; default: _mesa_problem(ctx, "Bad depth texture mode"); @@ -2951,45 +3026,11 @@ sample_depth_texture( GLcontext *ctx, GLfloat depth00, depth01, depth10, depth11; GLint i0, i1, j0, j1; GLint slice; - GLfloat a, b; + GLfloat wi, wj; GLuint useBorderTexel; - switch (tObj->Target) { - case GL_TEXTURE_RECTANGLE_ARB: - clamp_rect_coord_linear(tObj->WrapS, texcoords[i][0], - width, &i0, &i1, &a); - clamp_rect_coord_linear(tObj->WrapT, texcoords[i][1], - height, &j0, &j1, &b); - slice = 0; - break; - - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - linear_texel_locations(tObj->WrapS, img, width, - texcoords[i][0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, - texcoords[i][1], &j0, &j1, &b); - slice = 0; - break; - - case GL_TEXTURE_1D_ARRAY_EXT: - linear_texel_locations(tObj->WrapS, img, width, - texcoords[i][0], &i0, &i1, &a); - j0 = clamp_rect_coord_nearest(tObj->WrapT, texcoords[i][1], height); - j1 = j0; - slice = 0; - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - linear_texel_locations(tObj->WrapS, img, width, - texcoords[i][0], &i0, &i1, &a); - linear_texel_locations(tObj->WrapT, img, height, - texcoords[i][1], &j0, &j1, &b); - slice = clamp_rect_coord_nearest(tObj->WrapR, texcoords[i][2], depth); - break; - default: - slice = 0; - } + linear_texcoord(tObj, texcoords[i], &i0, &i1, &j0, &j1, &slice, + &wi, &wj); useBorderTexel = 0; if (img->Border) { @@ -3048,111 +3089,24 @@ sample_depth_texture( GLcontext *ctx, } } - if (0) { - /* compute a single weighted depth sample and do one comparison */ - const GLfloat depthSample - = lerp_2d(a, b, depth00, depth10, depth01, depth11); - if ((depthSample <= texcoords[i][compare_coord] && function == GL_LEQUAL) || - (depthSample >= texcoords[i][compare_coord] && function == GL_GEQUAL)) { - result = ambient; - } - else { - result = CHAN_MAX; - } - } - else { - /* Do four depth/R comparisons and compute a weighted result. - * If this touches on somebody's I.P., I'll remove this code - * upon request. - */ - const GLfloat d = (CHAN_MAXF - (GLfloat) ambient) * 0.25F; - GLfloat luminance = CHAN_MAXF; - - switch (function) { - case GL_LEQUAL: - if (depth00 <= texcoords[i][compare_coord]) luminance -= d; - if (depth01 <= texcoords[i][compare_coord]) luminance -= d; - if (depth10 <= texcoords[i][compare_coord]) luminance -= d; - if (depth11 <= texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_GEQUAL: - if (depth00 >= texcoords[i][compare_coord]) luminance -= d; - if (depth01 >= texcoords[i][compare_coord]) luminance -= d; - if (depth10 >= texcoords[i][compare_coord]) luminance -= d; - if (depth11 >= texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_LESS: - if (depth00 < texcoords[i][compare_coord]) luminance -= d; - if (depth01 < texcoords[i][compare_coord]) luminance -= d; - if (depth10 < texcoords[i][compare_coord]) luminance -= d; - if (depth11 < texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_GREATER: - if (depth00 > texcoords[i][compare_coord]) luminance -= d; - if (depth01 > texcoords[i][compare_coord]) luminance -= d; - if (depth10 > texcoords[i][compare_coord]) luminance -= d; - if (depth11 > texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_EQUAL: - if (depth00 == texcoords[i][compare_coord]) luminance -= d; - if (depth01 == texcoords[i][compare_coord]) luminance -= d; - if (depth10 == texcoords[i][compare_coord]) luminance -= d; - if (depth11 == texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_NOTEQUAL: - if (depth00 != texcoords[i][compare_coord]) luminance -= d; - if (depth01 != texcoords[i][compare_coord]) luminance -= d; - if (depth10 != texcoords[i][compare_coord]) luminance -= d; - if (depth11 != texcoords[i][compare_coord]) luminance -= d; - result = (GLchan) luminance; - break; - case GL_ALWAYS: - result = 0; - break; - case GL_NEVER: - result = CHAN_MAX; - break; - case GL_NONE: - /* ordinary bilinear filtering */ - { - const GLfloat depthSample - = lerp_2d(a, b, depth00, depth10, depth01, depth11); - CLAMPED_FLOAT_TO_CHAN(result, depthSample); - } - break; - default: - _mesa_problem(ctx, "Bad compare func in sample_depth_texture"); - return; - } - } + result = shadow_compare4(function, texcoords[i][compare_coord], + depth00, depth01, depth10, depth11, + ambient, wi, wj); switch (tObj->DepthMode) { case GL_LUMINANCE: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = CHAN_MAX; + ASSIGN_4V(texel[i], result, result, result, 1.0F); break; case GL_INTENSITY: - texel[i][RCOMP] = result; - texel[i][GCOMP] = result; - texel[i][BCOMP] = result; - texel[i][ACOMP] = result; + ASSIGN_4V(texel[i], result, result, result, result); break; case GL_ALPHA: - texel[i][RCOMP] = 0; - texel[i][GCOMP] = 0; - texel[i][BCOMP] = 0; - texel[i][ACOMP] = result; + ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result); break; default: _mesa_problem(ctx, "Bad depth texture mode"); } + } /* for */ } /* if filter */ } @@ -3168,7 +3122,7 @@ static void null_sample_func( GLcontext *ctx, const struct gl_texture_object *tObj, GLuint n, const GLfloat texcoords[][4], const GLfloat lambda[], - GLchan rgba[][4]) + GLfloat rgba[][4]) { GLuint i; (void) ctx; @@ -3225,6 +3179,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, } else { /* check for a few optimized cases */ +#if 0 const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; ASSERT(t->MinFilter == GL_NEAREST); if (t->WrapS == GL_REPEAT && @@ -3241,6 +3196,10 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, img->TexFormat->MesaFormat == MESA_FORMAT_RGBA) { return &opt_sample_rgba_2d; } +#else + if (0) + ; +#endif else { return &sample_nearest_2d; } diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c index 04fb1d8f8c..f1fdddf0f5 100644 --- a/src/mesa/tnl/t_rasterpos.c +++ b/src/mesa/tnl/t_rasterpos.c @@ -167,7 +167,7 @@ shade_rastpos(GLcontext *ctx, light->QuadraticAttenuation)); if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); + GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection); if (PV_dot_dir<light->_CosCutoff) { continue; diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index a78f27761f..124ca3c74f 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -141,7 +141,7 @@ static void TAG(light_rgba_spec)( GLcontext *ctx, /* spotlight attenuation */ if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); + GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection); if (PV_dot_dir<light->_CosCutoff) { continue; /* this light makes no contribution */ @@ -325,7 +325,7 @@ static void TAG(light_rgba)( GLcontext *ctx, /* spotlight attenuation */ if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); + GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection); if (PV_dot_dir<light->_CosCutoff) { continue; /* this light makes no contribution */ @@ -721,7 +721,7 @@ static void TAG(light_ci)( GLcontext *ctx, /* spotlight attenuation */ if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormDirection); + GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection); if (PV_dot_dir < light->_CosCutoff) { continue; /* this light makes no contribution */ } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index f99401ca6d..1795f62c32 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -176,17 +176,12 @@ static void vp_fetch_texel(GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4]) { - GLchan rgba[4]; SWcontext *swrast = SWRAST_CONTEXT(ctx); /* XXX use a float-valued TextureSample routine here!!! */ swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, 1, (const GLfloat (*)[4]) texcoord, - &lambda, &rgba); - color[0] = CHAN_TO_FLOAT(rgba[0]); - color[1] = CHAN_TO_FLOAT(rgba[1]); - color[2] = CHAN_TO_FLOAT(rgba[2]); - color[3] = CHAN_TO_FLOAT(rgba[3]); + &lambda, (GLfloat (*)[4]) color); } diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index 8c690b4f88..d56b701aa8 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -197,7 +197,7 @@ int main( int argc, char **argv ) OFFSET( "LIGHT_DIFFUSE ", struct gl_light, Diffuse ); OFFSET( "LIGHT_SPECULAR ", struct gl_light, Specular ); OFFSET( "LIGHT_EYE_POSITION ", struct gl_light, EyePosition ); - OFFSET( "LIGHT_EYE_DIRECTION ", struct gl_light, EyeDirection ); + OFFSET( "LIGHT_SPOT_DIRECTION ", struct gl_light, SpotDirection ); OFFSET( "LIGHT_SPOT_EXPONENT ", struct gl_light, SpotExponent ); OFFSET( "LIGHT_SPOT_CUTOFF ", struct gl_light, SpotCutoff ); OFFSET( "LIGHT_COS_CUTOFF ", struct gl_light, _CosCutoff ); @@ -211,7 +211,7 @@ int main( int argc, char **argv ) OFFSET( "LIGHT_POSITION ", struct gl_light, _Position ); OFFSET( "LIGHT_VP_INF_NORM ", struct gl_light, _VP_inf_norm ); OFFSET( "LIGHT_H_INF_NORM ", struct gl_light, _h_inf_norm ); - OFFSET( "LIGHT_NORM_DIRECTION ", struct gl_light, _NormDirection ); + OFFSET( "LIGHT_NORM_DIRECTION ", struct gl_light, _NormSpotDirection ); OFFSET( "LIGHT_VP_INF_SPOT_ATTEN ", struct gl_light, _VP_inf_spot_attenuation ); printf( "\n" ); OFFSET( "LIGHT_SPOT_EXP_TABLE ", struct gl_light, _SpotExpTable ); |