summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/SConscript1
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_tex.c4
-rw-r--r--src/mesa/drivers/dri/i810/i810tex.c4
-rw-r--r--src/mesa/drivers/dri/i810/i810tex.h1
-rw-r--r--src/mesa/drivers/dri/i915/i830_texstate.c8
-rw-r--r--src/mesa/drivers/dri/i915/i915_texstate.c15
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c10
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c49
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_copy.c5
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.c4
-rw-r--r--src/mesa/drivers/dri/mga/mgatex.c4
-rw-r--r--src/mesa/drivers/dri/r128/r128_tex.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_tex.c4
-rw-r--r--src/mesa/drivers/dri/r300/compiler/memory_pool.c4
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_code.c3
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_compiler.c11
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c30
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.c4
-rw-r--r--src/mesa/drivers/dri/r600/r600_context.c2
-rw-r--r--src/mesa/drivers/dri/r600/r600_tex.c4
-rw-r--r--src/mesa/drivers/dri/r600/r600_texstate.c40
-rw-r--r--src/mesa/drivers/dri/r600/r700_assembler.c40
-rw-r--r--src/mesa/drivers/dri/r600/r700_assembler.h2
-rw-r--r--src/mesa/drivers/dri/r600/r700_chip.c5
-rw-r--r--src/mesa/drivers/dri/r600/r700_fragprog.c22
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_tex.c4
-rw-r--r--src/mesa/drivers/dri/savage/savagetex.c4
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.c2
-rw-r--r--src/mesa/drivers/dri/sis/sis_texstate.c8
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c16
-rw-r--r--src/mesa/glapi/ARB_sync.xml4
-rw-r--r--src/mesa/main/attrib.c49
-rw-r--r--src/mesa/main/dispatch.c4
-rw-r--r--src/mesa/main/enums.c465
-rw-r--r--src/mesa/main/image.c6
-rw-r--r--src/mesa/main/mtypes.h6
-rw-r--r--src/mesa/main/texobj.c8
-rw-r--r--src/mesa/main/texparam.c188
-rw-r--r--src/mesa/main/texparam.h12
-rw-r--r--src/mesa/shader/program_parse.y4
-rw-r--r--src/mesa/shader/slang/slang_codegen.c7
-rw-r--r--src/mesa/sources.mak1
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c2
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c49
-rw-r--r--src/mesa/state_tracker/st_cb_condrender.c95
-rw-r--r--src/mesa/state_tracker/st_cb_condrender.h35
-rw-r--r--src/mesa/state_tracker/st_cb_queryobj.c17
-rw-r--r--src/mesa/state_tracker/st_cb_queryobj.h21
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c2
-rw-r--r--src/mesa/state_tracker/st_context.c2
-rw-r--r--src/mesa/state_tracker/st_extensions.c4
-rw-r--r--src/mesa/swrast/s_texfilter.c38
-rw-r--r--src/mesa/x86/gen_matypes.c14
53 files changed, 882 insertions, 465 deletions
diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 7035bdc634..9c933adcf7 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -162,6 +162,7 @@ if env['platform'] != 'winddk':
'state_tracker/st_cb_blit.c',
'state_tracker/st_cb_bufferobjects.c',
'state_tracker/st_cb_clear.c',
+ 'state_tracker/st_cb_condrender.c',
'state_tracker/st_cb_flush.c',
'state_tracker/st_cb_drawpixels.c',
'state_tracker/st_cb_fbo.c',
diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c
index 0dad250e4d..694e5eba5b 100644
--- a/src/mesa/drivers/dri/gamma/gamma_tex.c
+++ b/src/mesa/drivers/dri/gamma/gamma_tex.c
@@ -145,7 +145,7 @@ static void gammaTexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- gammaSetTexBorderColor( gmesa, t, tObj->BorderColor );
+ gammaSetTexBorderColor( gmesa, t, tObj->BorderColor.f );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -349,7 +349,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->BorderColor );
+ gammaSetTexBorderColor( gmesa, t, tObj->BorderColor.f );
}
}
diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c
index 2f6978f5aa..e764644a6c 100644
--- a/src/mesa/drivers/dri/i810/i810tex.c
+++ b/src/mesa/drivers/dri/i810/i810tex.c
@@ -210,7 +210,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->BorderColor );
+ i810SetTexBorderColor( t, texObj->BorderColor.f );
}
return t;
@@ -251,7 +251,7 @@ static void i810TexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- i810SetTexBorderColor( t, tObj->BorderColor );
+ i810SetTexBorderColor( t, tObj->BorderColor.f );
break;
case GL_TEXTURE_BASE_LEVEL:
diff --git a/src/mesa/drivers/dri/i810/i810tex.h b/src/mesa/drivers/dri/i810/i810tex.h
index d980927030..28958dcb4b 100644
--- a/src/mesa/drivers/dri/i810/i810tex.h
+++ b/src/mesa/drivers/dri/i810/i810tex.h
@@ -29,7 +29,6 @@
#include "main/mtypes.h"
#include "main/mm.h"
-#include "i810context.h"
#include "i810_3d_reg.h"
#include "texmem.h"
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index 27c5aa1e08..7525f9f2e0 100644
--- a/src/mesa/drivers/dri/i915/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915/i830_texstate.c
@@ -304,10 +304,10 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
}
/* 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]);
+ CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->BorderColor.f[0]);
+ CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->BorderColor.f[1]);
+ CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor.f[2]);
+ CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor.f[3]);
state[I830_TEXREG_TM0S4] = PACK_COLOR_8888(border[3],
border[0],
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 221bf03332..3ee4c8653a 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -197,10 +197,11 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
state[I915_TEXREG_MS3] |= MS3_TILE_WALK;
}
- /* We get one field with fraction bits to cover the maximum addressable (smallest
- * resolution) LOD. Use it to cover both MAX_LEVEL and MAX_LOD.
+ /* We get one field with fraction bits for the maximum addressable
+ * (lowest resolution) LOD. Use it to cover both MAX_LEVEL and
+ * MAX_LOD.
*/
- maxlod = MIN2(tObj->MaxLod, tObj->MaxLevel - tObj->BaseLevel);
+ maxlod = MIN2(tObj->MaxLod, tObj->_MaxLevel - tObj->BaseLevel);
state[I915_TEXREG_MS4] =
((((pitch / 4) - 1) << MS4_PITCH_SHIFT) |
MS4_CUBE_FACE_ENA_MASK |
@@ -347,10 +348,10 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
}
/* 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]);
+ CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->BorderColor.f[0]);
+ CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->BorderColor.f[1]);
+ CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor.f[2]);
+ CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor.f[3]);
if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) {
/* GL specs that border color for depth textures is taken from the
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 aa2e519588..ad267a4e6a 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -262,10 +262,10 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
dri_bo_unreference(brw->wm.sdc_bo[unit]);
if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) {
float bordercolor[4] = {
- texObj->BorderColor[0],
- texObj->BorderColor[0],
- texObj->BorderColor[0],
- texObj->BorderColor[0]
+ texObj->BorderColor.f[0],
+ texObj->BorderColor.f[0],
+ texObj->BorderColor.f[0],
+ texObj->BorderColor.f[0]
};
/* GL specs that border color for depth textures is taken from the
* R channel, while the hardware uses A. Spam R into all the
@@ -274,7 +274,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
brw->wm.sdc_bo[unit] = upload_default_color(brw, bordercolor);
} else {
brw->wm.sdc_bo[unit] = upload_default_color(brw,
- texObj->BorderColor);
+ texObj->BorderColor.f);
}
key->sampler_count = unit + 1;
}
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 7aca3aac8e..9db434c596 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -522,7 +522,8 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
GLubyte color_mask[4];
GLboolean color_blend;
uint32_t tiling;
- uint32_t draw_offset;
+ uint32_t draw_x;
+ uint32_t draw_y;
} key;
memset(&key, 0, sizeof(key));
@@ -564,7 +565,8 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
}
key.pitch = region->pitch;
key.cpp = region->cpp;
- key.draw_offset = region->draw_offset; /* cur 3d or cube face offset */
+ key.draw_x = region->draw_x;
+ key.draw_y = region->draw_y;
} else {
key.surface_type = BRW_SURFACE_NULL;
key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
@@ -572,7 +574,8 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
key.width = 1;
key.height = 1;
key.cpp = 4;
- key.draw_offset = 0;
+ key.draw_x = 0;
+ key.draw_y = 0;
}
/* _NEW_COLOR */
memcpy(key.color_mask, ctx->Color.ColorMask[0],
@@ -602,26 +605,32 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
surf.ss0.surface_format = key.surface_format;
surf.ss0.surface_type = key.surface_type;
if (key.tiling == I915_TILING_NONE) {
- surf.ss1.base_addr = key.draw_offset;
+ surf.ss1.base_addr = (key.draw_x + key.draw_y * key.pitch) * key.cpp;
} else {
- uint32_t tile_offset = key.draw_offset % 4096;
-
- surf.ss1.base_addr = key.draw_offset - tile_offset;
-
- if (brw->has_surface_tile_offset) {
- if (key.tiling == I915_TILING_X) {
- /* Note that the low bits of these fields are missing, so
- * there's the possibility of getting in trouble.
- */
- surf.ss5.x_offset = (tile_offset % 512) / key.cpp / 4;
- surf.ss5.y_offset = tile_offset / 512 / 2;
- } else {
- surf.ss5.x_offset = (tile_offset % 128) / key.cpp / 4;
- surf.ss5.y_offset = tile_offset / 128 / 2;
- }
+ uint32_t tile_base, tile_x, tile_y;
+ uint32_t pitch = key.pitch * key.cpp;
+
+ if (key.tiling == I915_TILING_X) {
+ tile_x = key.draw_x % (512 / key.cpp);
+ tile_y = key.draw_y % 8;
+ tile_base = ((key.draw_y / 8) * (8 * pitch));
+ tile_base += (key.draw_x - tile_x) / (512 / key.cpp) * 4096;
} else {
- assert(tile_offset == 0);
+ /* Y */
+ tile_x = key.draw_x % (128 / key.cpp);
+ tile_y = key.draw_y % 32;
+ tile_base = ((key.draw_y / 32) * (32 * pitch));
+ tile_base += (key.draw_x - tile_x) / (128 / key.cpp) * 4096;
}
+ assert(BRW_IS_G4X(brw) || (tile_x == 0 && tile_y == 0));
+ assert(tile_x % 4 == 0);
+ assert(tile_y % 2 == 0);
+ /* Note that the low bits of these fields are missing, so
+ * there's the possibility of getting in trouble.
+ */
+ surf.ss1.base_addr = tile_base;
+ surf.ss5.x_offset = tile_x / 4;
+ surf.ss5.y_offset = tile_y / 2;
}
if (region_bo != NULL)
surf.ss1.base_addr += region_bo->offset; /* reloc */
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index e1d0b12752..d8e71093c4 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -158,13 +158,14 @@ do_copy_texsubimage(struct intel_context *intel,
intelImage->mt->cpp,
src_pitch,
src->buffer,
- src->draw_offset,
+ 0,
src->tiling,
intelImage->mt->pitch,
dst_bo,
0,
intelImage->mt->region->tiling,
- x, y, image_x + dstx, image_y + dsty,
+ src->draw_x + x, src->draw_y + y,
+ image_x + dstx, image_y + dsty,
width, height,
GL_COPY)) {
return GL_FALSE;
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c
index 72917ee13b..6627d3c38a 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.c
@@ -130,7 +130,7 @@ mach64AllocTexObj( struct gl_texture_object *texObj )
mach64SetTexWrap( t, texObj->WrapS, texObj->WrapT );
mach64SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- mach64SetTexBorderColor( t, texObj->BorderColor );
+ mach64SetTexBorderColor( t, texObj->BorderColor.f );
return t;
}
@@ -470,7 +470,7 @@ static void mach64DDTexParameter( GLcontext *ctx, GLenum target,
case GL_TEXTURE_BORDER_COLOR:
if ( t->base.bound ) FLUSH_BATCH( mmesa );
- mach64SetTexBorderColor( t, tObj->BorderColor );
+ mach64SetTexBorderColor( t, tObj->BorderColor.f );
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 9163371b33..62a9317cd4 100644
--- a/src/mesa/drivers/dri/mga/mgatex.c
+++ b/src/mesa/drivers/dri/mga/mgatex.c
@@ -332,7 +332,7 @@ mgaAllocTexObj( struct gl_texture_object *tObj )
mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT );
mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
- mgaSetTexBorderColor( t, tObj->BorderColor );
+ mgaSetTexBorderColor( t, tObj->BorderColor.f );
}
return( t );
@@ -461,7 +461,7 @@ mgaTexParameter( GLcontext *ctx, GLenum target,
case GL_TEXTURE_BORDER_COLOR:
FLUSH_BATCH(mmesa);
- mgaSetTexBorderColor(t, tObj->BorderColor);
+ mgaSetTexBorderColor(t, tObj->BorderColor.f);
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 0a1207fb89..f1be7cc1c4 100644
--- a/src/mesa/drivers/dri/r128/r128_tex.c
+++ b/src/mesa/drivers/dri/r128/r128_tex.c
@@ -169,7 +169,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj )
r128SetTexWrap( t, texObj->WrapS, texObj->WrapT );
r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter );
- r128SetTexBorderColor( t, texObj->BorderColor );
+ r128SetTexBorderColor( t, texObj->BorderColor.f );
}
return t;
@@ -535,7 +535,7 @@ static void r128TexParameter( GLcontext *ctx, GLenum target,
case GL_TEXTURE_BORDER_COLOR:
if ( t->base.bound ) FLUSH_BATCH( rmesa );
- r128SetTexBorderColor( t, tObj->BorderColor );
+ r128SetTexBorderColor( t, tObj->BorderColor.f );
break;
case GL_TEXTURE_BASE_LEVEL:
diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c
index a417721553..5b87ba6ccd 100644
--- a/src/mesa/drivers/dri/r200/r200_tex.c
+++ b/src/mesa/drivers/dri/r200/r200_tex.c
@@ -378,7 +378,7 @@ static void r200TexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- r200SetTexBorderColor( t, texObj->BorderColor );
+ r200SetTexBorderColor( t, texObj->BorderColor.f );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -470,7 +470,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.BorderColor);
+ r200SetTexBorderColor(t, t->base.BorderColor.f);
return &t->base;
}
diff --git a/src/mesa/drivers/dri/r300/compiler/memory_pool.c b/src/mesa/drivers/dri/r300/compiler/memory_pool.c
index 37aa2b6579..76c7c60d8f 100644
--- a/src/mesa/drivers/dri/r300/compiler/memory_pool.c
+++ b/src/mesa/drivers/dri/r300/compiler/memory_pool.c
@@ -71,12 +71,14 @@ static void refill_pool(struct memory_pool * pool)
void * memory_pool_malloc(struct memory_pool * pool, unsigned int bytes)
{
if (bytes < POOL_LARGE_ALLOC) {
+ void * ptr;
+
if (pool->head + bytes > pool->end)
refill_pool(pool);
assert(pool->head + bytes <= pool->end);
- void * ptr = pool->head;
+ ptr = pool->head;
pool->head += bytes;
pool->head = (unsigned char*)(((unsigned long)pool->head + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1));
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.c b/src/mesa/drivers/dri/r300/compiler/radeon_code.c
index 1a3d8bb641..853b2becd1 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_code.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.c
@@ -143,7 +143,8 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da
for(index = 0; index < c->Count; ++index) {
if (c->Constants[index].Type == RC_CONSTANT_IMMEDIATE) {
- for(unsigned comp = 0; comp < c->Constants[index].Size; ++comp) {
+ unsigned comp;
+ for(comp = 0; comp < c->Constants[index].Size; ++comp) {
if (c->Constants[index].u.Immediate[comp] == data) {
*swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp);
return index;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
index c0e7a7f7a0..41ea23ee32 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
@@ -232,12 +232,16 @@ void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_ou
void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsigned new_input)
{
unsigned tempregi = rc_find_free_temporary(c);
+ struct rc_instruction * inst_rcp;
+ struct rc_instruction * inst_mul;
+ struct rc_instruction * inst_mad;
+ struct rc_instruction * inst;
c->Program.InputsRead &= ~(1 << wpos);
c->Program.InputsRead |= 1 << new_input;
/* perspective divide */
- struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, &c->Program.Instructions);
+ inst_rcp = rc_insert_new_instruction(c, &c->Program.Instructions);
inst_rcp->U.I.Opcode = RC_OPCODE_RCP;
inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY;
@@ -248,7 +252,7 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig
inst_rcp->U.I.SrcReg[0].Index = new_input;
inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW;
- struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst_rcp);
+ inst_mul = rc_insert_new_instruction(c, inst_rcp);
inst_mul->U.I.Opcode = RC_OPCODE_MUL;
inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY;
@@ -263,7 +267,7 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig
inst_mul->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW;
/* viewport transformation */
- struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_mul);
+ inst_mad = rc_insert_new_instruction(c, inst_mul);
inst_mad->U.I.Opcode = RC_OPCODE_MAD;
inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY;
@@ -282,7 +286,6 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig
inst_mad->U.I.SrcReg[2].Index = inst_mad->U.I.SrcReg[1].Index;
inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO);
- struct rc_instruction * inst;
for (inst = inst_mad->Next; inst != &c->Program.Instructions; inst = inst->Next) {
const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode);
unsigned i;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
index ced66af1eb..b5c08aea49 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c
@@ -267,9 +267,9 @@ static void transform_LIT(struct radeon_compiler* c,
temp = inst->U.I.DstReg.Index;
srctemp = srcreg(RC_FILE_TEMPORARY, temp);
- // tmp.x = max(0.0, Src.x);
- // tmp.y = max(0.0, Src.y);
- // tmp.w = clamp(Src.z, -128+eps, 128-eps);
+ /* tmp.x = max(0.0, Src.x); */
+ /* tmp.y = max(0.0, Src.y); */
+ /* tmp.w = clamp(Src.z, -128+eps, 128-eps); */
emit2(c, inst->Prev, RC_OPCODE_MAX, 0,
dstregtmpmask(temp, RC_MASK_XYW),
inst->U.I.SrcReg[0],
@@ -280,7 +280,7 @@ static void transform_LIT(struct radeon_compiler* c,
swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W),
negate(srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle)));
- // tmp.w = Pow(tmp.y, tmp.w)
+ /* tmp.w = Pow(tmp.y, tmp.w) */
emit1(c, inst->Prev, RC_OPCODE_LG2, 0,
dstregtmpmask(temp, RC_MASK_W),
swizzle(srctemp, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y));
@@ -292,14 +292,14 @@ static void transform_LIT(struct radeon_compiler* c,
dstregtmpmask(temp, RC_MASK_W),
swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W));
- // tmp.z = (tmp.x > 0) ? tmp.w : 0.0
+ /* tmp.z = (tmp.x > 0) ? tmp.w : 0.0 */
emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode,
dstregtmpmask(temp, RC_MASK_Z),
negate(swizzle(srctemp, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)),
swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W),
builtin_zero);
- // tmp.x, tmp.y, tmp.w = 1.0, tmp.x, 1.0
+ /* tmp.x, tmp.y, tmp.w = 1.0, tmp.x, 1.0 */
emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode,
dstregtmpmask(temp, RC_MASK_XYW),
swizzle(srctemp, RC_SWIZZLE_ONE, RC_SWIZZLE_X, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE));
@@ -533,16 +533,16 @@ static void sincos_constants(struct radeon_compiler* c, unsigned int *constants)
{
static const float SinCosConsts[2][4] = {
{
- 1.273239545, // 4/PI
- -0.405284735, // -4/(PI*PI)
- 3.141592654, // PI
- 0.2225 // weight
+ 1.273239545, /* 4/PI */
+ -0.405284735, /* -4/(PI*PI) */
+ 3.141592654, /* PI */
+ 0.2225 /* weight */
},
{
0.75,
0.5,
- 0.159154943, // 1/(2*PI)
- 6.283185307 // 2*PI
+ 0.159154943, /* 1/(2*PI) */
+ 6.283185307 /* 2*PI */
}
};
int i;
@@ -602,9 +602,9 @@ int radeonTransformTrigSimple(struct radeon_compiler* c,
sincos_constants(c, constants);
if (inst->U.I.Opcode == RC_OPCODE_COS) {
- // MAD tmp.x, src, 1/(2*PI), 0.75
- // FRC tmp.x, tmp.x
- // MAD tmp.z, tmp.x, 2*PI, -PI
+ /* MAD tmp.x, src, 1/(2*PI), 0.75 */
+ /* FRC tmp.x, tmp.x */
+ /* MAD tmp.z, tmp.x, 2*PI, -PI */
emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W),
swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X),
swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z),
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index ac3d5b1bec..963f648cb1 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -215,7 +215,7 @@ static void r300TexParameter(GLcontext * ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- r300SetTexBorderColor(t, texObj->BorderColor);
+ r300SetTexBorderColor(t, texObj->BorderColor.f);
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -307,7 +307,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.BorderColor);
+ r300SetTexBorderColor(t, t->base.BorderColor.f);
return &t->base;
}
diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c
index 0d8b5b45ac..cb549497f5 100644
--- a/src/mesa/drivers/dri/r600/r600_context.c
+++ b/src/mesa/drivers/dri/r600/r600_context.c
@@ -99,6 +99,7 @@ static const struct dri_extension card_extensions[] = {
{"GL_ARB_depth_clamp", NULL},
{"GL_ARB_depth_texture", NULL},
{"GL_ARB_fragment_program", NULL},
+ {"GL_ARB_fragment_program_shadow", NULL},
{"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
{"GL_ARB_multitexture", NULL},
{"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
@@ -163,6 +164,7 @@ static const struct dri_extension gl_20_extension[] = {
#else
{"GL_VERSION_2_0", GL_VERSION_2_0_functions },
#endif /* R600_ENABLE_GLSL_TEST */
+ {NULL, NULL}
};
static const struct tnl_pipeline_stage *r600_pipeline[] = {
diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c
index 9d83a64e22..f745fe3e8a 100644
--- a/src/mesa/drivers/dri/r600/r600_tex.c
+++ b/src/mesa/drivers/dri/r600/r600_tex.c
@@ -305,7 +305,7 @@ static void r600TexParameter(GLcontext * ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- r600SetTexBorderColor(t, texObj->BorderColor);
+ r600SetTexBorderColor(t, texObj->BorderColor.f);
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -391,7 +391,7 @@ static struct gl_texture_object *r600NewTextureObject(GLcontext * ctx,
r600SetTexDefaultState(t);
r600UpdateTexWrap(t);
r600SetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy);
- r600SetTexBorderColor(t, t->base.BorderColor);
+ r600SetTexBorderColor(t, t->base.BorderColor.f);
return &t->base;
}
diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c
index 2a4a6e6ee1..ae252c995b 100644
--- a/src/mesa/drivers/dri/r600/r600_texstate.c
+++ b/src/mesa/drivers/dri/r600/r600_texstate.c
@@ -91,7 +91,7 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED,
FORMAT_COMP_Y_shift, FORMAT_COMP_Y_mask);
SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED,
- FORMAT_COMP_X_shift, FORMAT_COMP_Z_mask);
+ FORMAT_COMP_Z_shift, FORMAT_COMP_Z_mask);
SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED,
FORMAT_COMP_W_shift, FORMAT_COMP_W_mask);
@@ -626,6 +626,31 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
return GL_TRUE;
}
+static GLuint r600_translate_shadow_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return SQ_TEX_DEPTH_COMPARE_NEVER;
+ case GL_LESS:
+ return SQ_TEX_DEPTH_COMPARE_LESS;
+ case GL_LEQUAL:
+ return SQ_TEX_DEPTH_COMPARE_LESSEQUAL;
+ case GL_GREATER:
+ return SQ_TEX_DEPTH_COMPARE_GREATER;
+ case GL_GEQUAL:
+ return SQ_TEX_DEPTH_COMPARE_GREATEREQUAL;
+ case GL_NOTEQUAL:
+ return SQ_TEX_DEPTH_COMPARE_NOTEQUAL;
+ case GL_EQUAL:
+ return SQ_TEX_DEPTH_COMPARE_EQUAL;
+ case GL_ALWAYS:
+ return SQ_TEX_DEPTH_COMPARE_ALWAYS;
+ default:
+ WARN_ONCE("Unknown shadow compare function! %d", func);
+ return 0;
+ }
+}
+
void r600SetDepthTexMode(struct gl_texture_object *tObj)
{
radeonTexObjPtr t;
@@ -706,11 +731,22 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex
SETfield(t->SQ_TEX_RESOURCE1, firstImage->Height - 1,
TEX_HEIGHT_shift, TEX_HEIGHT_mask);
+ t->SQ_TEX_RESOURCE2 = get_base_teximage_offset(t) / 256;
+
if ((t->maxLod - t->minLod) > 0) {
- t->SQ_TEX_RESOURCE3 = t->mt->levels[t->minLod].size / 256;
+ t->SQ_TEX_RESOURCE3 = radeon_miptree_image_offset(t->mt, 0, t->minLod + 1) / 256;
SETfield(t->SQ_TEX_RESOURCE4, 0, BASE_LEVEL_shift, BASE_LEVEL_mask);
SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask);
}
+ if(texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB)
+ {
+ SETfield(t->SQ_TEX_SAMPLER0, r600_translate_shadow_func(texObj->CompareFunc), DEPTH_COMPARE_FUNCTION_shift, DEPTH_COMPARE_FUNCTION_mask);
+ }
+ else
+ {
+ CLEARfield(t->SQ_TEX_SAMPLER0, DEPTH_COMPARE_FUNCTION_mask);
+ }
+
}
/**
diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c
index 1ff89e18ea..0ff16b4ddd 100644
--- a/src/mesa/drivers/dri/r600/r700_assembler.c
+++ b/src/mesa/drivers/dri/r600/r700_assembler.c
@@ -4397,7 +4397,10 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm)
pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L;
break;
default:
- pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE;
+ if(pAsm->pILInst[pAsm->uiCurInst].TexShadow == 1)
+ pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_C;
+ else
+ pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE;
}
pAsm->is_tex = GL_TRUE;
@@ -4443,11 +4446,46 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm)
pAsm->S[0].src.swizzlew = SQ_SEL_Y;
}
+ if(pAsm->pILInst[pAsm->uiCurInst].TexShadow == 1)
+ {
+ /* compare value goes to w chan ? */
+ pAsm->S[0].src.swizzlew = SQ_SEL_Z;
+ }
+
if ( GL_FALSE == next_ins(pAsm) )
{
return GL_FALSE;
}
+ /* add ARB shadow ambient but clamp to 0..1 */
+ if(pAsm->pILInst[pAsm->uiCurInst].TexShadow == 1)
+ {
+ /* ADD_SAT dst, dst, ambient[texunit] */
+ pAsm->D.dst.opcode = SQ_OP2_INST_ADD;
+
+ if( GL_FALSE == assemble_dst(pAsm) )
+ {
+ return GL_FALSE;
+ }
+ pAsm->D2.dst2.SaturateMode = 1;
+
+ pAsm->S[0].src.rtype = pAsm->D.dst.rtype;
+ pAsm->S[0].src.reg = pAsm->D.dst.reg;
+ noswizzle_PVSSRC(&(pAsm->S[0].src));
+ noneg_PVSSRC(&(pAsm->S[0].src));
+
+ pAsm->S[1].src.rtype = SRC_REG_CONSTANT;
+ pAsm->S[1].src.reg = pAsm->shadow_regs[pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit];
+ noswizzle_PVSSRC(&(pAsm->S[1].src));
+ noneg_PVSSRC(&(pAsm->S[1].src));
+
+ if( GL_FALSE == next_ins(pAsm) )
+ {
+ return GL_FALSE;
+ }
+
+ }
+
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h
index 86342b814f..56baf5b0d9 100644
--- a/src/mesa/drivers/dri/r600/r700_assembler.h
+++ b/src/mesa/drivers/dri/r600/r700_assembler.h
@@ -487,6 +487,8 @@ typedef struct r700_AssemblerBase
GLuint unVetTexBits;
+ GLuint shadow_regs[R700_MAX_TEXTURE_UNITS];
+
} r700_AssemblerBase;
//Internal use
diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c
index c124e02184..3bc2d2ba02 100644
--- a/src/mesa/drivers/dri/r600/r700_chip.c
+++ b/src/mesa/drivers/dri/r600/r700_chip.c
@@ -57,14 +57,11 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom)
for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) {
if (ctx->Texture.Unit[i]._ReallyEnabled) {
radeonTexObj *t = r700->textures[i];
- uint32_t offset;
if (t) {
if (!t->image_override) {
bo = t->mt->bo;
- offset = get_base_teximage_offset(t);
} else {
bo = t->bo;
- offset = 0;
}
if (bo) {
@@ -93,7 +90,7 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom)
R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE6);
R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE2,
bo,
- offset,
+ r700->textures[i]->SQ_TEX_RESOURCE2,
RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0);
R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE3,
bo,
diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c
index ce2d9fdf79..84d51e6606 100644
--- a/src/mesa/drivers/dri/r600/r700_fragprog.c
+++ b/src/mesa/drivers/dri/r600/r700_fragprog.c
@@ -362,8 +362,11 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp,
{
GLuint number_of_colors_exported;
GLboolean z_enabled = GL_FALSE;
- GLuint unBit;
+ GLuint unBit, shadow_unit;
int i;
+ struct prog_instruction *inst;
+ gl_state_index shadow_ambient[STATE_LENGTH]
+ = { STATE_INTERNAL, STATE_SHADOW_AMBIENT, 0, 0, 0};
//Init_Program
Init_r700_AssemblerBase( SPT_FP, &(fp->r700AsmCode), &(fp->r700Shader) );
@@ -373,6 +376,23 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp,
insert_wpos_code(ctx, mesa_fp);
}
+ /* add/map consts for ARB_shadow_ambient */
+ if(mesa_fp->Base.ShadowSamplers)
+ {
+ inst = mesa_fp->Base.Instructions;
+ for (i = 0; i < mesa_fp->Base.NumInstructions; i++)
+ {
+ if(inst->TexShadow == 1)
+ {
+ shadow_unit = inst->TexSrcUnit;
+ shadow_ambient[2] = shadow_unit;
+ fp->r700AsmCode.shadow_regs[shadow_unit] =
+ _mesa_add_state_reference(mesa_fp->Base.Parameters, shadow_ambient);
+ }
+ inst++;
+ }
+ }
+
Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx);
if( GL_FALSE == Find_Instruction_Dependencies_fp(fp, mesa_fp) )
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c
index 749ab75f20..14163f13af 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex.c
@@ -341,7 +341,7 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- radeonSetTexBorderColor( t, texObj->BorderColor );
+ radeonSetTexBorderColor( t, texObj->BorderColor.f );
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -428,7 +428,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.BorderColor );
+ radeonSetTexBorderColor( t, t->base.BorderColor.f );
return &t->base;
}
diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c
index 6c97bb6c70..97598f599e 100644
--- a/src/mesa/drivers/dri/savage/savagetex.c
+++ b/src/mesa/drivers/dri/savage/savagetex.c
@@ -507,7 +507,7 @@ savageAllocTexObj( struct gl_texture_object *texObj )
savageSetTexWrapping(t,texObj->WrapS,texObj->WrapT);
savageSetTexFilter(t,texObj->MinFilter,texObj->MagFilter);
- savageSetTexBorderColor(t,texObj->BorderColor);
+ savageSetTexBorderColor(t,texObj->BorderColor.f);
}
return t;
@@ -2044,7 +2044,7 @@ static void savageTexParameter( GLcontext *ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- savageSetTexBorderColor(t,tObj->BorderColor);
+ savageSetTexBorderColor(t,tObj->BorderColor.f);
break;
default:
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c
index 1f88e9ccdd..0944f4d8b4 100644
--- a/src/mesa/drivers/dri/sis/sis_context.c
+++ b/src/mesa/drivers/dri/sis/sis_context.c
@@ -83,6 +83,7 @@ static struct dri_extension card_extensions[] =
{ NULL, NULL }
};
+#if 0
static struct dri_extension card_extensions_6326[] =
{
/*{ "GL_ARB_texture_border_clamp", NULL },*/
@@ -90,6 +91,7 @@ static struct dri_extension card_extensions_6326[] =
/*{ "GL_MESA_ycbcr_texture", NULL },*/
{ NULL, NULL }
};
+#endif
static const struct dri_debug_control debug_control[] =
{
diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c
index a507173b21..4c22a10cf7 100644
--- a/src/mesa/drivers/dri/sis/sis_texstate.c
+++ b/src/mesa/drivers/dri/sis/sis_texstate.c
@@ -457,10 +457,10 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj,
{
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]);
+ CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor.f[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor.f[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor.f[2]);
+ CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor.f[3]);
current->texture[hw_unit].hwTextureBorderColor =
PACK_COLOR_8888(c[3], c[0], c[1], c[2]);
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c
index 5a8d927de1..e6e5526d34 100644
--- a/src/mesa/drivers/dri/unichrome/via_state.c
+++ b/src/mesa/drivers/dri/unichrome/via_state.c
@@ -891,10 +891,10 @@ static GLboolean viaChooseTextureState(GLcontext *ctx)
if (texObj->Image[0][texObj->BaseLevel]->Border > 0) {
vmesa->regHTXnTB[0] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
vmesa->regHTXnTBC[0] =
- PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor[0]),
- FLOAT_TO_UBYTE(texObj->BorderColor[1]),
- FLOAT_TO_UBYTE(texObj->BorderColor[2]));
- vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->BorderColor[3]);
+ PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]),
+ FLOAT_TO_UBYTE(texObj->BorderColor.f[1]),
+ FLOAT_TO_UBYTE(texObj->BorderColor.f[2]));
+ vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->BorderColor.f[3]);
}
if (texUnit0->LodBias != 0.0f) {
@@ -924,10 +924,10 @@ static GLboolean viaChooseTextureState(GLcontext *ctx)
if (texObj->Image[0][texObj->BaseLevel]->Border > 0) {
vmesa->regHTXnTB[1] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
vmesa->regHTXnTBC[1] =
- PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor[0]),
- FLOAT_TO_UBYTE(texObj->BorderColor[1]),
- FLOAT_TO_UBYTE(texObj->BorderColor[2]));
- vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->BorderColor[3]);
+ PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]),
+ FLOAT_TO_UBYTE(texObj->BorderColor.f[1]),
+ FLOAT_TO_UBYTE(texObj->BorderColor.f[2]));
+ vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->BorderColor.f[3]);
}
diff --git a/src/mesa/glapi/ARB_sync.xml b/src/mesa/glapi/ARB_sync.xml
index 37f474980c..4e4eebac32 100644
--- a/src/mesa/glapi/ARB_sync.xml
+++ b/src/mesa/glapi/ARB_sync.xml
@@ -33,8 +33,10 @@
<enum name="WAIT_FAILED" value="0x911D"/>
<enum name="SYNC_FLUSH_COMMANDS_BIT" value="0x00000001"/>
- <enum name="TIMEOUT_IGNORED" value="0xFFFFFFFFFFFFFFFF"/>
+ <!-- Not really an enum:
+ <enum name="TIMEOUT_IGNORED" value="0xFFFFFFFFFFFFFFFF"/>
+ -->
<function name="FenceSync" offset="assign">
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index f5b77e82a9..0641b98b3b 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -835,7 +835,7 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate)
_mesa_BindTexture(target, obj->Name);
- _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, obj->BorderColor);
+ _mesa_TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, obj->BorderColor.f);
_mesa_TexParameterf(target, GL_TEXTURE_PRIORITY, obj->Priority);
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, obj->WrapS);
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, obj->WrapT);
@@ -1077,22 +1077,39 @@ _mesa_PopAttrib(void)
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
for (i = 0; i < ctx->Const.MaxLights; i++) {
- const struct gl_light *l = &light->Light[i];
+ const struct gl_light *l = &light->Light[i];
_mesa_set_enable(ctx, GL_LIGHT0 + i, l->Enabled);
- _mesa_light(ctx, i, GL_AMBIENT, l->Ambient);
- _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->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,
- &l->ConstantAttenuation);
- _mesa_light(ctx, i, GL_LINEAR_ATTENUATION,
- &l->LinearAttenuation);
- _mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION,
- &l->QuadraticAttenuation);
- }
+ _mesa_light(ctx, i, GL_AMBIENT, l->Ambient);
+ _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->SpotDirection);
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->SpotExponent;
+ _mesa_light(ctx, i, GL_SPOT_EXPONENT, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->SpotCutoff;
+ _mesa_light(ctx, i, GL_SPOT_CUTOFF, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->ConstantAttenuation;
+ _mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->LinearAttenuation;
+ _mesa_light(ctx, i, GL_LINEAR_ATTENUATION, p);
+ }
+ {
+ GLfloat p[4] = { 0 };
+ p[0] = l->QuadraticAttenuation;
+ _mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, p);
+ }
+ }
/* light model */
_mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT,
light->Model.Ambient);
diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c
index 97d213e8e1..eb0d1ff8a7 100644
--- a/src/mesa/main/dispatch.c
+++ b/src/mesa/main/dispatch.c
@@ -37,8 +37,6 @@
* \author Brian Paul <brian@precisioninsight.com>
*/
-#ifndef GLX_USE_APPLEGL
-
#include "main/glheader.h"
#include "main/compiler.h"
#include "glapi/glapi.h"
@@ -92,5 +90,3 @@
#include "glapi/glapitemp.h"
#endif /* USE_X86_ASM */
-
-#endif /* !GLX_USE_APPLEGL */
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index 85197afcb3..2273138d23 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -1791,7 +1791,6 @@ LONGSTRING static const char enum_string_table[] =
"GL_TEXTURE_WRAP_S\0"
"GL_TEXTURE_WRAP_T\0"
"GL_TIMEOUT_EXPIRED\0"
- "GL_TIMEOUT_IGNORED\0"
"GL_TIME_ELAPSED_EXT\0"
"GL_TRACK_MATRIX_NV\0"
"GL_TRACK_MATRIX_TRANSFORM_NV\0"
@@ -1923,7 +1922,7 @@ LONGSTRING static const char enum_string_table[] =
"GL_ZOOM_Y\0"
;
-static const enum_elt all_enums[1885] =
+static const enum_elt all_enums[1884] =
{
{ 0, 0x00000600 }, /* GL_2D */
{ 6, 0x00001407 }, /* GL_2_BYTES */
@@ -3680,147 +3679,146 @@ static const enum_elt all_enums[1885] =
{ 37780, 0x00002802 }, /* GL_TEXTURE_WRAP_S */
{ 37798, 0x00002803 }, /* GL_TEXTURE_WRAP_T */
{ 37816, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */
- { 37835, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */
- { 37854, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
- { 37874, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
- { 37893, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- { 37922, 0x00001000 }, /* GL_TRANSFORM_BIT */
- { 37939, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
- { 37965, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
- { 37995, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
- { 38027, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- { 38057, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
- { 38091, 0x0000862C }, /* GL_TRANSPOSE_NV */
- { 38107, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- { 38138, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
- { 38173, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- { 38201, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
- { 38233, 0x00000004 }, /* GL_TRIANGLES */
- { 38246, 0x00000006 }, /* GL_TRIANGLE_FAN */
- { 38262, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
- { 38283, 0x00000005 }, /* GL_TRIANGLE_STRIP */
- { 38301, 0x00000001 }, /* GL_TRUE */
- { 38309, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
- { 38329, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
- { 38352, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
- { 38372, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
- { 38393, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
- { 38415, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
- { 38437, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
- { 38457, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
- { 38478, 0x00009118 }, /* GL_UNSIGNALED */
- { 38492, 0x00001401 }, /* GL_UNSIGNED_BYTE */
- { 38509, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- { 38536, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
- { 38559, 0x00001405 }, /* GL_UNSIGNED_INT */
- { 38575, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
- { 38602, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
- { 38623, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
- { 38648, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
- { 38672, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
- { 38703, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
- { 38727, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- { 38755, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
- { 38778, 0x00001403 }, /* GL_UNSIGNED_SHORT */
- { 38796, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- { 38826, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- { 38852, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- { 38882, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- { 38908, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
- { 38932, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- { 38960, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- { 38988, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
- { 39015, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
- { 39047, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
- { 39078, 0x00008CA2 }, /* GL_UPPER_LEFT */
- { 39092, 0x00002A20 }, /* GL_V2F */
- { 39099, 0x00002A21 }, /* GL_V3F */
- { 39106, 0x00008B83 }, /* GL_VALIDATE_STATUS */
- { 39125, 0x00001F00 }, /* GL_VENDOR */
- { 39135, 0x00001F02 }, /* GL_VERSION */
- { 39146, 0x00008074 }, /* GL_VERTEX_ARRAY */
- { 39162, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
- { 39186, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
- { 39216, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
- { 39247, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
- { 39282, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
- { 39306, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
- { 39327, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
- { 39350, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
- { 39371, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- { 39398, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- { 39426, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- { 39454, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- { 39482, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- { 39510, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- { 39538, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
- { 39566, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- { 39593, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- { 39620, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- { 39647, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- { 39674, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- { 39701, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- { 39728, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- { 39755, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- { 39782, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- { 39809, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
- { 39847, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
- { 39889, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- { 39920, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
- { 39955, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
- { 39989, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
- { 40027, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
- { 40058, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
- { 40093, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- { 40121, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
- { 40153, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- { 40183, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
- { 40217, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
- { 40245, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
- { 40277, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
- { 40297, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
- { 40319, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
- { 40348, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
- { 40369, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- { 40398, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
- { 40431, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
- { 40463, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
- { 40490, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
- { 40521, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
- { 40551, 0x00008B31 }, /* GL_VERTEX_SHADER */
- { 40568, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
- { 40589, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
- { 40616, 0x00000BA2 }, /* GL_VIEWPORT */
- { 40628, 0x00000800 }, /* GL_VIEWPORT_BIT */
- { 40644, 0x0000911D }, /* GL_WAIT_FAILED */
- { 40659, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
- { 40679, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- { 40710, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
- { 40745, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- { 40773, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- { 40798, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- { 40825, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- { 40850, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
- { 40874, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
- { 40893, 0x000088B9 }, /* GL_WRITE_ONLY */
- { 40907, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
- { 40925, 0x00001506 }, /* GL_XOR */
- { 40932, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
- { 40951, 0x00008757 }, /* GL_YCBCR_MESA */
- { 40965, 0x00000000 }, /* GL_ZERO */
- { 40973, 0x00000D16 }, /* GL_ZOOM_X */
- { 40983, 0x00000D17 }, /* GL_ZOOM_Y */
+ { 37835, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */
+ { 37855, 0x00008648 }, /* GL_TRACK_MATRIX_NV */
+ { 37874, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ { 37903, 0x00001000 }, /* GL_TRANSFORM_BIT */
+ { 37920, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */
+ { 37946, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */
+ { 37976, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ { 38008, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ { 38038, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */
+ { 38072, 0x0000862C }, /* GL_TRANSPOSE_NV */
+ { 38088, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ { 38119, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */
+ { 38154, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ { 38182, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */
+ { 38214, 0x00000004 }, /* GL_TRIANGLES */
+ { 38227, 0x00000006 }, /* GL_TRIANGLE_FAN */
+ { 38243, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */
+ { 38264, 0x00000005 }, /* GL_TRIANGLE_STRIP */
+ { 38282, 0x00000001 }, /* GL_TRUE */
+ { 38290, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */
+ { 38310, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */
+ { 38333, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */
+ { 38353, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */
+ { 38374, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */
+ { 38396, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */
+ { 38418, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */
+ { 38438, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */
+ { 38459, 0x00009118 }, /* GL_UNSIGNALED */
+ { 38473, 0x00001401 }, /* GL_UNSIGNED_BYTE */
+ { 38490, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ { 38517, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */
+ { 38540, 0x00001405 }, /* GL_UNSIGNED_INT */
+ { 38556, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */
+ { 38583, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */
+ { 38604, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */
+ { 38629, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */
+ { 38653, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ { 38684, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */
+ { 38708, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ { 38736, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */
+ { 38759, 0x00001403 }, /* GL_UNSIGNED_SHORT */
+ { 38777, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ { 38807, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ { 38833, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ { 38863, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ { 38889, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */
+ { 38913, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ { 38941, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ { 38969, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */
+ { 38996, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ { 39028, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */
+ { 39059, 0x00008CA2 }, /* GL_UPPER_LEFT */
+ { 39073, 0x00002A20 }, /* GL_V2F */
+ { 39080, 0x00002A21 }, /* GL_V3F */
+ { 39087, 0x00008B83 }, /* GL_VALIDATE_STATUS */
+ { 39106, 0x00001F00 }, /* GL_VENDOR */
+ { 39116, 0x00001F02 }, /* GL_VERSION */
+ { 39127, 0x00008074 }, /* GL_VERTEX_ARRAY */
+ { 39143, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */
+ { 39167, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */
+ { 39197, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ { 39228, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */
+ { 39263, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */
+ { 39287, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */
+ { 39308, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */
+ { 39331, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */
+ { 39352, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ { 39379, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ { 39407, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ { 39435, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ { 39463, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ { 39491, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ { 39519, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ { 39547, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ { 39574, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ { 39601, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ { 39628, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ { 39655, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ { 39682, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ { 39709, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ { 39736, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ { 39763, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ { 39790, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ { 39828, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */
+ { 39870, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ { 39901, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */
+ { 39936, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ { 39970, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */
+ { 40008, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ { 40039, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */
+ { 40074, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ { 40102, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */
+ { 40134, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ { 40164, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */
+ { 40198, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ { 40226, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */
+ { 40258, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */
+ { 40278, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */
+ { 40300, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ { 40329, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */
+ { 40350, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ { 40379, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */
+ { 40412, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ { 40444, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ { 40471, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */
+ { 40502, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ { 40532, 0x00008B31 }, /* GL_VERTEX_SHADER */
+ { 40549, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */
+ { 40570, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */
+ { 40597, 0x00000BA2 }, /* GL_VIEWPORT */
+ { 40609, 0x00000800 }, /* GL_VIEWPORT_BIT */
+ { 40625, 0x0000911D }, /* GL_WAIT_FAILED */
+ { 40640, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */
+ { 40660, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ { 40691, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */
+ { 40726, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ { 40754, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ { 40779, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ { 40806, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ { 40831, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */
+ { 40855, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */
+ { 40874, 0x000088B9 }, /* GL_WRITE_ONLY */
+ { 40888, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */
+ { 40906, 0x00001506 }, /* GL_XOR */
+ { 40913, 0x000085B9 }, /* GL_YCBCR_422_APPLE */
+ { 40932, 0x00008757 }, /* GL_YCBCR_MESA */
+ { 40946, 0x00000000 }, /* GL_ZERO */
+ { 40954, 0x00000D16 }, /* GL_ZOOM_X */
+ { 40964, 0x00000D17 }, /* GL_ZOOM_Y */
};
-static const unsigned reduced_enums[1351] =
+static const unsigned reduced_enums[1350] =
{
479, /* GL_FALSE */
701, /* GL_LINES */
703, /* GL_LINE_LOOP */
710, /* GL_LINE_STRIP */
- 1770, /* GL_TRIANGLES */
- 1773, /* GL_TRIANGLE_STRIP */
- 1771, /* GL_TRIANGLE_FAN */
+ 1769, /* GL_TRIANGLES */
+ 1772, /* GL_TRIANGLE_STRIP */
+ 1770, /* GL_TRIANGLE_FAN */
1285, /* GL_QUADS */
1289, /* GL_QUAD_STRIP */
1171, /* GL_POLYGON */
@@ -3954,7 +3952,7 @@ static const unsigned reduced_enums[1351] =
1537, /* GL_STENCIL_WRITEMASK */
853, /* GL_MATRIX_MODE */
1025, /* GL_NORMALIZE */
- 1865, /* GL_VIEWPORT */
+ 1864, /* GL_VIEWPORT */
999, /* GL_MODELVIEW_STACK_DEPTH */
1263, /* GL_PROJECTION_STACK_DEPTH */
1744, /* GL_TEXTURE_STACK_DEPTH */
@@ -4016,12 +4014,12 @@ static const unsigned reduced_enums[1351] =
1117, /* GL_PIXEL_MAP_G_TO_G_SIZE */
1115, /* GL_PIXEL_MAP_B_TO_B_SIZE */
1113, /* GL_PIXEL_MAP_A_TO_A_SIZE */
- 1782, /* GL_UNPACK_SWAP_BYTES */
- 1777, /* GL_UNPACK_LSB_FIRST */
- 1778, /* GL_UNPACK_ROW_LENGTH */
- 1781, /* GL_UNPACK_SKIP_ROWS */
- 1780, /* GL_UNPACK_SKIP_PIXELS */
- 1775, /* GL_UNPACK_ALIGNMENT */
+ 1781, /* GL_UNPACK_SWAP_BYTES */
+ 1776, /* GL_UNPACK_LSB_FIRST */
+ 1777, /* GL_UNPACK_ROW_LENGTH */
+ 1780, /* GL_UNPACK_SKIP_ROWS */
+ 1779, /* GL_UNPACK_SKIP_PIXELS */
+ 1774, /* GL_UNPACK_ALIGNMENT */
1099, /* GL_PACK_SWAP_BYTES */
1094, /* GL_PACK_LSB_FIRST */
1095, /* GL_PACK_ROW_LENGTH */
@@ -4034,8 +4032,8 @@ static const unsigned reduced_enums[1351] =
641, /* GL_INDEX_OFFSET */
1317, /* GL_RED_SCALE */
1315, /* GL_RED_BIAS */
- 1883, /* GL_ZOOM_X */
- 1884, /* GL_ZOOM_Y */
+ 1882, /* GL_ZOOM_X */
+ 1883, /* GL_ZOOM_Y */
603, /* GL_GREEN_SCALE */
601, /* GL_GREEN_BIAS */
93, /* GL_BLUE_SCALE */
@@ -4120,11 +4118,11 @@ static const unsigned reduced_enums[1351] =
244, /* GL_COMPILE */
245, /* GL_COMPILE_AND_EXECUTE */
120, /* GL_BYTE */
- 1784, /* GL_UNSIGNED_BYTE */
+ 1783, /* GL_UNSIGNED_BYTE */
1441, /* GL_SHORT */
- 1796, /* GL_UNSIGNED_SHORT */
+ 1795, /* GL_UNSIGNED_SHORT */
645, /* GL_INT */
- 1787, /* GL_UNSIGNED_INT */
+ 1786, /* GL_UNSIGNED_INT */
489, /* GL_FLOAT */
1, /* GL_2_BYTES */
5, /* GL_3_BYTES */
@@ -4136,7 +4134,7 @@ static const unsigned reduced_enums[1351] =
299, /* GL_COPY */
51, /* GL_AND_INVERTED */
1023, /* GL_NOOP */
- 1879, /* GL_XOR */
+ 1878, /* GL_XOR */
1086, /* GL_OR */
1024, /* GL_NOR */
470, /* GL_EQUIV */
@@ -4180,9 +4178,9 @@ static const unsigned reduced_enums[1351] =
1343, /* GL_REPLACE */
627, /* GL_INCR */
342, /* GL_DECR */
- 1811, /* GL_VENDOR */
+ 1810, /* GL_VENDOR */
1340, /* GL_RENDERER */
- 1812, /* GL_VERSION */
+ 1811, /* GL_VERSION */
474, /* GL_EXTENSIONS */
1391, /* GL_S */
1557, /* GL_T */
@@ -4215,8 +4213,8 @@ static const unsigned reduced_enums[1351] =
1178, /* GL_POLYGON_OFFSET_POINT */
1177, /* GL_POLYGON_OFFSET_LINE */
1301, /* GL_R3_G3_B2 */
- 1808, /* GL_V2F */
- 1809, /* GL_V3F */
+ 1807, /* GL_V2F */
+ 1808, /* GL_V3F */
123, /* GL_C4UB_V2F */
124, /* GL_C4UB_V3F */
121, /* GL_C3F_V3F */
@@ -4289,11 +4287,11 @@ static const unsigned reduced_enums[1351] =
951, /* GL_MINMAX_FORMAT */
953, /* GL_MINMAX_SINK */
1565, /* GL_TABLE_TOO_LARGE_EXT */
- 1786, /* GL_UNSIGNED_BYTE_3_3_2 */
- 1798, /* GL_UNSIGNED_SHORT_4_4_4_4 */
- 1800, /* GL_UNSIGNED_SHORT_5_5_5_1 */
- 1793, /* GL_UNSIGNED_INT_8_8_8_8 */
- 1788, /* GL_UNSIGNED_INT_10_10_10_2 */
+ 1785, /* GL_UNSIGNED_BYTE_3_3_2 */
+ 1797, /* GL_UNSIGNED_SHORT_4_4_4_4 */
+ 1799, /* GL_UNSIGNED_SHORT_5_5_5_1 */
+ 1792, /* GL_UNSIGNED_INT_8_8_8_8 */
+ 1787, /* GL_UNSIGNED_INT_10_10_10_2 */
1176, /* GL_POLYGON_OFFSET_FILL */
1175, /* GL_POLYGON_OFFSET_FACTOR */
1174, /* GL_POLYGON_OFFSET_BIAS */
@@ -4348,22 +4346,22 @@ static const unsigned reduced_enums[1351] =
1643, /* GL_TEXTURE_BINDING_3D */
1096, /* GL_PACK_SKIP_IMAGES */
1092, /* GL_PACK_IMAGE_HEIGHT */
- 1779, /* GL_UNPACK_SKIP_IMAGES */
- 1776, /* GL_UNPACK_IMAGE_HEIGHT */
+ 1778, /* GL_UNPACK_SKIP_IMAGES */
+ 1775, /* GL_UNPACK_IMAGE_HEIGHT */
1635, /* GL_TEXTURE_3D */
1277, /* GL_PROXY_TEXTURE_3D */
1698, /* GL_TEXTURE_DEPTH */
1751, /* GL_TEXTURE_WRAP_R */
856, /* GL_MAX_3D_TEXTURE_SIZE */
- 1813, /* GL_VERTEX_ARRAY */
+ 1812, /* GL_VERTEX_ARRAY */
1026, /* GL_NORMAL_ARRAY */
148, /* GL_COLOR_ARRAY */
631, /* GL_INDEX_ARRAY */
1676, /* GL_TEXTURE_COORD_ARRAY */
459, /* GL_EDGE_FLAG_ARRAY */
- 1819, /* GL_VERTEX_ARRAY_SIZE */
- 1821, /* GL_VERTEX_ARRAY_TYPE */
- 1820, /* GL_VERTEX_ARRAY_STRIDE */
+ 1818, /* GL_VERTEX_ARRAY_SIZE */
+ 1820, /* GL_VERTEX_ARRAY_TYPE */
+ 1819, /* GL_VERTEX_ARRAY_STRIDE */
1031, /* GL_NORMAL_ARRAY_TYPE */
1030, /* GL_NORMAL_ARRAY_STRIDE */
152, /* GL_COLOR_ARRAY_SIZE */
@@ -4375,7 +4373,7 @@ static const unsigned reduced_enums[1351] =
1682, /* GL_TEXTURE_COORD_ARRAY_TYPE */
1681, /* GL_TEXTURE_COORD_ARRAY_STRIDE */
463, /* GL_EDGE_FLAG_ARRAY_STRIDE */
- 1818, /* GL_VERTEX_ARRAY_POINTER */
+ 1817, /* GL_VERTEX_ARRAY_POINTER */
1029, /* GL_NORMAL_ARRAY_POINTER */
151, /* GL_COLOR_ARRAY_POINTER */
634, /* GL_INDEX_ARRAY_POINTER */
@@ -4475,7 +4473,7 @@ static const unsigned reduced_enums[1351] =
306, /* GL_CULL_VERTEX_EXT */
308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */
307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */
- 1876, /* GL_WRAP_BORDER_SUN */
+ 1875, /* GL_WRAP_BORDER_SUN */
1660, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */
690, /* GL_LIGHT_MODEL_COLOR_CONTROL */
1444, /* GL_SINGLE_COLOR */
@@ -4493,13 +4491,13 @@ static const unsigned reduced_enums[1351] =
580, /* GL_FRAMEBUFFER_UNDEFINED */
373, /* GL_DEPTH_STENCIL_ATTACHMENT */
630, /* GL_INDEX */
- 1785, /* GL_UNSIGNED_BYTE_2_3_3_REV */
- 1801, /* GL_UNSIGNED_SHORT_5_6_5 */
- 1802, /* GL_UNSIGNED_SHORT_5_6_5_REV */
- 1799, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
- 1797, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
- 1794, /* GL_UNSIGNED_INT_8_8_8_8_REV */
- 1792, /* GL_UNSIGNED_INT_2_10_10_10_REV */
+ 1784, /* GL_UNSIGNED_BYTE_2_3_3_REV */
+ 1800, /* GL_UNSIGNED_SHORT_5_6_5 */
+ 1801, /* GL_UNSIGNED_SHORT_5_6_5_REV */
+ 1798, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */
+ 1796, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */
+ 1793, /* GL_UNSIGNED_INT_8_8_8_8_REV */
+ 1791, /* GL_UNSIGNED_INT_2_10_10_10_REV */
1730, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */
1731, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */
1729, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */
@@ -4570,10 +4568,10 @@ static const unsigned reduced_enums[1351] =
18, /* GL_ACTIVE_TEXTURE */
133, /* GL_CLIENT_ACTIVE_TEXTURE */
934, /* GL_MAX_TEXTURE_UNITS */
- 1763, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
- 1766, /* GL_TRANSPOSE_PROJECTION_MATRIX */
- 1768, /* GL_TRANSPOSE_TEXTURE_MATRIX */
- 1760, /* GL_TRANSPOSE_COLOR_MATRIX */
+ 1762, /* GL_TRANSPOSE_MODELVIEW_MATRIX */
+ 1765, /* GL_TRANSPOSE_PROJECTION_MATRIX */
+ 1767, /* GL_TRANSPOSE_TEXTURE_MATRIX */
+ 1759, /* GL_TRANSPOSE_COLOR_MATRIX */
1549, /* GL_SUBTRACT */
919, /* GL_MAX_RENDERBUFFER_SIZE */
247, /* GL_COMPRESSED_ALPHA */
@@ -4588,7 +4586,7 @@ static const unsigned reduced_enums[1351] =
1281, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */
917, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */
372, /* GL_DEPTH_STENCIL */
- 1789, /* GL_UNSIGNED_INT_24_8 */
+ 1788, /* GL_UNSIGNED_INT_24_8 */
930, /* GL_MAX_TEXTURE_LOD_BIAS */
1728, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */
931, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */
@@ -4641,32 +4639,32 @@ static const unsigned reduced_enums[1351] =
1072, /* GL_OPERAND1_ALPHA */
1078, /* GL_OPERAND2_ALPHA */
1084, /* GL_OPERAND3_ALPHA_NV */
- 1814, /* GL_VERTEX_ARRAY_BINDING */
+ 1813, /* GL_VERTEX_ARRAY_BINDING */
1737, /* GL_TEXTURE_RANGE_LENGTH_APPLE */
1738, /* GL_TEXTURE_RANGE_POINTER_APPLE */
- 1880, /* GL_YCBCR_422_APPLE */
- 1803, /* GL_UNSIGNED_SHORT_8_8_APPLE */
- 1805, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
+ 1879, /* GL_YCBCR_422_APPLE */
+ 1802, /* GL_UNSIGNED_SHORT_8_8_APPLE */
+ 1804, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */
1747, /* GL_TEXTURE_STORAGE_HINT_APPLE */
1540, /* GL_STORAGE_PRIVATE_APPLE */
1539, /* GL_STORAGE_CACHED_APPLE */
1541, /* GL_STORAGE_SHARED_APPLE */
1446, /* GL_SLICE_ACCUM_SUN */
1288, /* GL_QUAD_MESH_SUN */
- 1772, /* GL_TRIANGLE_MESH_SUN */
- 1853, /* GL_VERTEX_PROGRAM_ARB */
- 1864, /* GL_VERTEX_STATE_PROGRAM_NV */
- 1840, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
- 1846, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
- 1848, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
- 1850, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
+ 1771, /* GL_TRIANGLE_MESH_SUN */
+ 1852, /* GL_VERTEX_PROGRAM_ARB */
+ 1863, /* GL_VERTEX_STATE_PROGRAM_NV */
+ 1839, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */
+ 1845, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */
+ 1847, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */
+ 1849, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */
334, /* GL_CURRENT_VERTEX_ATTRIB */
1240, /* GL_PROGRAM_LENGTH_ARB */
1254, /* GL_PROGRAM_STRING_ARB */
998, /* GL_MODELVIEW_PROJECTION_NV */
623, /* GL_IDENTITY_NV */
670, /* GL_INVERSE_NV */
- 1765, /* GL_TRANSPOSE_NV */
+ 1764, /* GL_TRANSPOSE_NV */
671, /* GL_INVERSE_TRANSPOSE_NV */
903, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */
902, /* GL_MAX_PROGRAM_MATRICES_ARB */
@@ -4680,33 +4678,33 @@ static const unsigned reduced_enums[1351] =
845, /* GL_MATRIX7_NV */
318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */
315, /* GL_CURRENT_MATRIX_ARB */
- 1856, /* GL_VERTEX_PROGRAM_POINT_SIZE */
- 1859, /* GL_VERTEX_PROGRAM_TWO_SIDE */
+ 1855, /* GL_VERTEX_PROGRAM_POINT_SIZE */
+ 1858, /* GL_VERTEX_PROGRAM_TWO_SIDE */
1252, /* GL_PROGRAM_PARAMETER_NV */
- 1844, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
+ 1843, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */
1256, /* GL_PROGRAM_TARGET_NV */
1253, /* GL_PROGRAM_RESIDENT_NV */
- 1757, /* GL_TRACK_MATRIX_NV */
- 1758, /* GL_TRACK_MATRIX_TRANSFORM_NV */
- 1854, /* GL_VERTEX_PROGRAM_BINDING_NV */
+ 1756, /* GL_TRACK_MATRIX_NV */
+ 1757, /* GL_TRACK_MATRIX_TRANSFORM_NV */
+ 1853, /* GL_VERTEX_PROGRAM_BINDING_NV */
1234, /* GL_PROGRAM_ERROR_POSITION_ARB */
356, /* GL_DEPTH_CLAMP */
- 1822, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
- 1829, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
- 1830, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
- 1831, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
- 1832, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
- 1833, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
- 1834, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
- 1835, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
- 1836, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
- 1837, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
- 1823, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
- 1824, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
- 1825, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
- 1826, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
- 1827, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
- 1828, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
+ 1821, /* GL_VERTEX_ATTRIB_ARRAY0_NV */
+ 1828, /* GL_VERTEX_ATTRIB_ARRAY1_NV */
+ 1829, /* GL_VERTEX_ATTRIB_ARRAY2_NV */
+ 1830, /* GL_VERTEX_ATTRIB_ARRAY3_NV */
+ 1831, /* GL_VERTEX_ATTRIB_ARRAY4_NV */
+ 1832, /* GL_VERTEX_ATTRIB_ARRAY5_NV */
+ 1833, /* GL_VERTEX_ATTRIB_ARRAY6_NV */
+ 1834, /* GL_VERTEX_ATTRIB_ARRAY7_NV */
+ 1835, /* GL_VERTEX_ATTRIB_ARRAY8_NV */
+ 1836, /* GL_VERTEX_ATTRIB_ARRAY9_NV */
+ 1822, /* GL_VERTEX_ATTRIB_ARRAY10_NV */
+ 1823, /* GL_VERTEX_ATTRIB_ARRAY11_NV */
+ 1824, /* GL_VERTEX_ATTRIB_ARRAY12_NV */
+ 1825, /* GL_VERTEX_ATTRIB_ARRAY13_NV */
+ 1826, /* GL_VERTEX_ATTRIB_ARRAY14_NV */
+ 1827, /* GL_VERTEX_ATTRIB_ARRAY15_NV */
757, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */
764, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */
765, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */
@@ -4745,14 +4743,14 @@ static const unsigned reduced_enums[1351] =
269, /* GL_COMPRESSED_TEXTURE_FORMATS */
946, /* GL_MAX_VERTEX_UNITS_ARB */
22, /* GL_ACTIVE_VERTEX_UNITS_ARB */
- 1875, /* GL_WEIGHT_SUM_UNITY_ARB */
- 1852, /* GL_VERTEX_BLEND_ARB */
+ 1874, /* GL_WEIGHT_SUM_UNITY_ARB */
+ 1851, /* GL_VERTEX_BLEND_ARB */
336, /* GL_CURRENT_WEIGHT_ARB */
- 1874, /* GL_WEIGHT_ARRAY_TYPE_ARB */
- 1873, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
- 1872, /* GL_WEIGHT_ARRAY_SIZE_ARB */
- 1871, /* GL_WEIGHT_ARRAY_POINTER_ARB */
- 1868, /* GL_WEIGHT_ARRAY_ARB */
+ 1873, /* GL_WEIGHT_ARRAY_TYPE_ARB */
+ 1872, /* GL_WEIGHT_ARRAY_STRIDE_ARB */
+ 1871, /* GL_WEIGHT_ARRAY_SIZE_ARB */
+ 1870, /* GL_WEIGHT_ARRAY_POINTER_ARB */
+ 1867, /* GL_WEIGHT_ARRAY_ARB */
386, /* GL_DOT3_RGB */
387, /* GL_DOT3_RGBA */
263, /* GL_COMPRESSED_RGB_FXT1_3DFX */
@@ -4797,7 +4795,7 @@ static const unsigned reduced_enums[1351] =
1001, /* GL_MODULATE_ADD_ATI */
1002, /* GL_MODULATE_SIGNED_ADD_ATI */
1003, /* GL_MODULATE_SUBTRACT_ATI */
- 1881, /* GL_YCBCR_MESA */
+ 1880, /* GL_YCBCR_MESA */
1093, /* GL_PACK_INVERT_MESA */
339, /* GL_DEBUG_OBJECT_MESA */
340, /* GL_DEBUG_PRINT_MESA */
@@ -4870,7 +4868,7 @@ static const unsigned reduced_enums[1351] =
1295, /* GL_QUERY_RESULT */
1297, /* GL_QUERY_RESULT_AVAILABLE */
940, /* GL_MAX_VERTEX_ATTRIBS */
- 1842, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
+ 1841, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */
377, /* GL_DEPTH_STENCIL_TO_RGBA_NV */
376, /* GL_DEPTH_STENCIL_TO_BGRA_NV */
926, /* GL_MAX_TEXTURE_COORDS */
@@ -4885,7 +4883,7 @@ static const unsigned reduced_enums[1351] =
464, /* GL_ELEMENT_ARRAY_BUFFER */
54, /* GL_ARRAY_BUFFER_BINDING */
465, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */
- 1816, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
+ 1815, /* GL_VERTEX_ARRAY_BUFFER_BINDING */
1027, /* GL_NORMAL_ARRAY_BUFFER_BINDING */
149, /* GL_COLOR_ARRAY_BUFFER_BINDING */
632, /* GL_INDEX_ARRAY_BUFFER_BINDING */
@@ -4893,8 +4891,8 @@ static const unsigned reduced_enums[1351] =
460, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */
1420, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */
514, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */
- 1869, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
- 1838, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
+ 1868, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */
+ 1837, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */
1239, /* GL_PROGRAM_INSTRUCTIONS_ARB */
898, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */
1245, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */
@@ -4918,14 +4916,14 @@ static const unsigned reduced_enums[1351] =
899, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */
895, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */
1260, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */
- 1762, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
+ 1761, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */
1308, /* GL_READ_ONLY */
- 1877, /* GL_WRITE_ONLY */
+ 1876, /* GL_WRITE_ONLY */
1310, /* GL_READ_WRITE */
102, /* GL_BUFFER_ACCESS */
105, /* GL_BUFFER_MAPPED */
107, /* GL_BUFFER_MAP_POINTER */
- 1756, /* GL_TIME_ELAPSED_EXT */
+ 1755, /* GL_TIME_ELAPSED_EXT */
808, /* GL_MATRIX0_ARB */
820, /* GL_MATRIX1_ARB */
832, /* GL_MATRIX2_ARB */
@@ -4986,7 +4984,7 @@ static const unsigned reduced_enums[1351] =
109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */
104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */
537, /* GL_FRAGMENT_SHADER */
- 1862, /* GL_VERTEX_SHADER */
+ 1861, /* GL_VERTEX_SHADER */
1250, /* GL_PROGRAM_OBJECT_ARB */
1433, /* GL_SHADER_OBJECT_ARB */
882, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */
@@ -5024,7 +5022,7 @@ static const unsigned reduced_enums[1351] =
345, /* GL_DELETE_STATUS */
246, /* GL_COMPILE_STATUS */
715, /* GL_LINK_STATUS */
- 1810, /* GL_VALIDATE_STATUS */
+ 1809, /* GL_VALIDATE_STATUS */
644, /* GL_INFO_LOG_LENGTH */
56, /* GL_ATTACHED_SHADERS */
20, /* GL_ACTIVE_UNIFORMS */
@@ -5047,7 +5045,7 @@ static const unsigned reduced_enums[1351] =
1106, /* GL_PALETTE8_RGB5_A1_OES */
626, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */
625, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */
- 1795, /* GL_UNSIGNED_NORMALIZED */
+ 1794, /* GL_UNSIGNED_NORMALIZED */
1632, /* GL_TEXTURE_1D_ARRAY_EXT */
1272, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */
1634, /* GL_TEXTURE_2D_ARRAY_EXT */
@@ -5068,7 +5066,7 @@ static const unsigned reduced_enums[1351] =
266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */
1167, /* GL_POINT_SPRITE_COORD_ORIGIN */
723, /* GL_LOWER_LEFT */
- 1807, /* GL_UPPER_LEFT */
+ 1806, /* GL_UPPER_LEFT */
1513, /* GL_STENCIL_BACK_REF */
1514, /* GL_STENCIL_BACK_VALUE_MASK */
1515, /* GL_STENCIL_BACK_WRITEMASK */
@@ -5150,12 +5148,12 @@ static const unsigned reduced_enums[1351] =
1553, /* GL_SYNC_FLAGS */
1552, /* GL_SYNC_FENCE */
1555, /* GL_SYNC_GPU_COMMANDS_COMPLETE */
- 1783, /* GL_UNSIGNALED */
+ 1782, /* GL_UNSIGNALED */
1442, /* GL_SIGNALED */
46, /* GL_ALREADY_SIGNALED */
1754, /* GL_TIMEOUT_EXPIRED */
270, /* GL_CONDITION_SATISFIED */
- 1867, /* GL_WAIT_FAILED */
+ 1866, /* GL_WAIT_FAILED */
471, /* GL_EVAL_BIT */
1302, /* GL_RASTER_POSITION_UNCLIPPED_IBM */
717, /* GL_LIST_BIT */
@@ -5164,7 +5162,6 @@ static const unsigned reduced_enums[1351] =
29, /* GL_ALL_ATTRIB_BITS */
1008, /* GL_MULTISAMPLE_BIT */
30, /* GL_ALL_CLIENT_ATTRIB_BITS */
- 1755, /* GL_TIMEOUT_IGNORED */
};
typedef int (*cfunc)(const void *, const void *);
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 139e56a96b..fc278bb8af 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -33,6 +33,7 @@
#include "glheader.h"
#include "colormac.h"
#include "context.h"
+#include "enums.h"
#include "image.h"
#include "imports.h"
#include "macros.h"
@@ -3228,6 +3229,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
srcFormat == GL_RGBA ||
srcFormat == GL_BGRA ||
srcFormat == GL_ABGR_EXT ||
+ srcFormat == GL_DU8DV8_ATI ||
srcFormat == GL_DUDV_ATI);
ASSERT(srcType == GL_UNSIGNED_BYTE ||
@@ -3343,6 +3345,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
aComp = 0;
stride = 4;
break;
+ case GL_DU8DV8_ATI:
case GL_DUDV_ATI:
redIndex = 0;
greenIndex = 1;
@@ -3351,7 +3354,8 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
stride = 2;
break;
default:
- _mesa_problem(NULL, "bad srcFormat in extract float data");
+ _mesa_problem(NULL, "bad srcFormat %s in extract float data",
+ _mesa_lookup_enum_by_nr(srcFormat));
return;
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a7f70a1875..01ad246504 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1217,7 +1217,11 @@ struct gl_texture_object
GLuint Name; /**< the user-visible texture object ID */
GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
GLfloat Priority; /**< in [0,1] */
- GLfloat BorderColor[4]; /**< unclamped */
+ union {
+ GLfloat f[4];
+ GLuint ui[4];
+ GLint i[4];
+ } BorderColor; /**< Interpreted according to texture format */
GLenum WrapS; /**< S-axis texture image wrap mode */
GLenum WrapT; /**< T-axis texture image wrap mode */
GLenum WrapR; /**< R-axis texture image wrap mode */
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 09fe7b85ba..7f0a246025 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -228,10 +228,10 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
dest->Target = src->Target;
dest->Name = src->Name;
dest->Priority = src->Priority;
- dest->BorderColor[0] = src->BorderColor[0];
- dest->BorderColor[1] = src->BorderColor[1];
- dest->BorderColor[2] = src->BorderColor[2];
- dest->BorderColor[3] = src->BorderColor[3];
+ dest->BorderColor.f[0] = src->BorderColor.f[0];
+ dest->BorderColor.f[1] = src->BorderColor.f[1];
+ dest->BorderColor.f[2] = src->BorderColor.f[2];
+ dest->BorderColor.f[3] = src->BorderColor.f[3];
dest->WrapS = src->WrapS;
dest->WrapT = src->WrapT;
dest->WrapR = src->WrapR;
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index db4c7a5eda..d917e21e74 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -78,17 +78,19 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap)
/**
* Get current texture object for given target.
- * Return NULL if any error.
+ * Return NULL if any error (and record the error).
* Note that this is different from _mesa_select_tex_object() in that proxy
* targets are not accepted.
+ * Only the glGetTexLevelParameter() functions accept proxy targets.
*/
static struct gl_texture_object *
-get_texobj(GLcontext *ctx, GLenum target)
+get_texobj(GLcontext *ctx, GLenum target, GLboolean get)
{
struct gl_texture_unit *texUnit;
if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(current unit)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "gl%sTexParameter(current unit)", get ? "Get" : "");
return NULL;
}
@@ -125,7 +127,8 @@ get_texobj(GLcontext *ctx, GLenum target)
;
}
- _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(target)");
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "gl%sTexParameter(target)", get ? "Get" : "");
return NULL;
}
@@ -508,10 +511,10 @@ set_tex_parameterf(GLcontext *ctx,
case GL_TEXTURE_BORDER_COLOR:
flush(ctx, texObj);
- texObj->BorderColor[RCOMP] = params[0];
- texObj->BorderColor[GCOMP] = params[1];
- texObj->BorderColor[BCOMP] = params[2];
- texObj->BorderColor[ACOMP] = params[3];
+ texObj->BorderColor.f[RCOMP] = params[0];
+ texObj->BorderColor.f[GCOMP] = params[1];
+ texObj->BorderColor.f[BCOMP] = params[2];
+ texObj->BorderColor.f[ACOMP] = params[3];
return GL_TRUE;
default:
@@ -529,7 +532,7 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- texObj = get_texobj(ctx, target);
+ texObj = get_texobj(ctx, target, GL_FALSE);
if (!texObj)
return;
@@ -577,7 +580,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- texObj = get_texobj(ctx, target);
+ texObj = get_texobj(ctx, target, GL_FALSE);
if (!texObj)
return;
@@ -635,7 +638,7 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- texObj = get_texobj(ctx, target);
+ texObj = get_texobj(ctx, target, GL_FALSE);
if (!texObj)
return;
@@ -679,7 +682,7 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- texObj = get_texobj(ctx, target);
+ texObj = get_texobj(ctx, target, GL_FALSE);
if (!texObj)
return;
@@ -728,6 +731,68 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
}
+/**
+ * Set tex parameter to integer value(s). Primarily intended to set
+ * integer-valued texture border color (for integer-valued textures).
+ * New in GL 3.0.
+ */
+void GLAPIENTRY
+_mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ /* set the integer-valued border color */
+ COPY_4V(texObj->BorderColor.i, params);
+ break;
+ default:
+ _mesa_TexParameteriv(target, pname, params);
+ break;
+ }
+ /* XXX no driver hook for TexParameterIiv() yet */
+}
+
+
+/**
+ * Set tex parameter to unsigned integer value(s). Primarily intended to set
+ * uint-valued texture border color (for integer-valued textures).
+ * New in GL 3.0
+ */
+void GLAPIENTRY
+_mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_FALSE);
+ if (!texObj)
+ return;
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ /* set the unsigned integer-valued border color */
+ COPY_4V(texObj->BorderColor.ui, params);
+ break;
+ default:
+ _mesa_TexParameteriv(target, pname, (const GLint *) params);
+ break;
+ }
+ /* XXX no driver hook for TexParameterIuiv() yet */
+}
+
+
+
+
void GLAPIENTRY
_mesa_GetTexLevelParameterfv( GLenum target, GLint level,
GLenum pname, GLfloat *params )
@@ -978,25 +1043,14 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
void GLAPIENTRY
_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
{
- struct gl_texture_unit *texUnit;
struct gl_texture_object *obj;
GLboolean error = GL_FALSE;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexParameterfv(current unit)");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- obj = _mesa_select_tex_object(ctx, texUnit, target);
- if (!obj) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameterfv(target)");
+ obj = get_texobj(ctx, target, GL_TRUE);
+ if (!obj)
return;
- }
_mesa_lock_texture(ctx, obj);
switch (pname) {
@@ -1016,10 +1070,10 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
*params = ENUM_TO_FLOAT(obj->WrapR);
break;
case GL_TEXTURE_BORDER_COLOR:
- params[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F);
- params[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F);
- params[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F);
- params[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F);
+ params[0] = CLAMP(obj->BorderColor.f[0], 0.0F, 1.0F);
+ params[1] = CLAMP(obj->BorderColor.f[1], 0.0F, 1.0F);
+ params[2] = CLAMP(obj->BorderColor.f[2], 0.0F, 1.0F);
+ params[3] = CLAMP(obj->BorderColor.f[3], 0.0F, 1.0F);
break;
case GL_TEXTURE_RESIDENT:
{
@@ -1145,26 +1199,16 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
void GLAPIENTRY
_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
{
- struct gl_texture_unit *texUnit;
struct gl_texture_object *obj;
GLboolean error = GL_FALSE;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureImageUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glGetTexParameteriv(current unit)");
- return;
- }
-
- texUnit = _mesa_get_current_tex_unit(ctx);
-
- obj = _mesa_select_tex_object(ctx, texUnit, target);
- if (!obj) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexParameteriv(target)");
- return;
- }
+ obj = get_texobj(ctx, target, GL_TRUE);
+ if (!obj)
+ return;
+ _mesa_lock_texture(ctx, obj);
switch (pname) {
case GL_TEXTURE_MAG_FILTER:
*params = (GLint) obj->MagFilter;
@@ -1184,10 +1228,10 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
case GL_TEXTURE_BORDER_COLOR:
{
GLfloat b[4];
- b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F);
- b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F);
- b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F);
- b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F);
+ b[0] = CLAMP(obj->BorderColor.f[0], 0.0F, 1.0F);
+ b[1] = CLAMP(obj->BorderColor.f[1], 0.0F, 1.0F);
+ b[2] = CLAMP(obj->BorderColor.f[2], 0.0F, 1.0F);
+ b[3] = CLAMP(obj->BorderColor.f[3], 0.0F, 1.0F);
params[0] = FLOAT_TO_INT(b[0]);
params[1] = FLOAT_TO_INT(b[1]);
params[2] = FLOAT_TO_INT(b[2]);
@@ -1315,3 +1359,53 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
_mesa_unlock_texture(ctx, obj);
}
+
+
+/** New in GL 3.0 */
+void GLAPIENTRY
+_mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_TRUE);
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ COPY_4V(params, texObj->BorderColor.i);
+ break;
+ default:
+ _mesa_GetTexParameteriv(target, pname, params);
+ }
+}
+
+
+/** New in GL 3.0 */
+void GLAPIENTRY
+_mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params)
+{
+ struct gl_texture_object *texObj;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ texObj = get_texobj(ctx, target, GL_TRUE);
+
+ switch (pname) {
+ case GL_TEXTURE_BORDER_COLOR:
+ COPY_4V(params, texObj->BorderColor.i);
+ break;
+ default:
+ {
+ GLint ip[4];
+ _mesa_GetTexParameteriv(target, pname, ip);
+ params[0] = ip[0];
+ if (pname == GL_TEXTURE_SWIZZLE_RGBA_EXT ||
+ pname == GL_TEXTURE_CROP_RECT_OES) {
+ params[1] = ip[1];
+ params[2] = ip[2];
+ params[3] = ip[3];
+ }
+ }
+ }
+}
diff --git a/src/mesa/main/texparam.h b/src/mesa/main/texparam.h
index 454b96350e..19b4116c0b 100644
--- a/src/mesa/main/texparam.h
+++ b/src/mesa/main/texparam.h
@@ -44,6 +44,11 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params );
extern void GLAPIENTRY
_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params );
+extern void GLAPIENTRY
+_mesa_GetTexParameterIiv(GLenum target, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params);
extern void GLAPIENTRY
@@ -60,4 +65,11 @@ extern void GLAPIENTRY
_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params );
+extern void GLAPIENTRY
+_mesa_TexParameterIiv(GLenum target, GLenum pname, const GLint *params);
+
+extern void GLAPIENTRY
+_mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params);
+
+
#endif /* TEXPARAM_H */
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y
index 3f1a350c24..b40b216d65 100644
--- a/src/mesa/shader/program_parse.y
+++ b/src/mesa/shader/program_parse.y
@@ -2297,7 +2297,9 @@ set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index)
const GLint maxIndex = 1 << INST_INDEX_BITS;
const GLint minIndex = 0;
ASSERT(index >= minIndex);
+ (void) minIndex;
ASSERT(index <= maxIndex);
+ (void) maxIndex;
ASSERT(file == PROGRAM_TEMPORARY ||
file == PROGRAM_ADDRESS ||
file == PROGRAM_OUTPUT);
@@ -2338,7 +2340,9 @@ set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
const GLint minIndex = -(1 << INST_INDEX_BITS);
ASSERT(file < PROGRAM_FILE_MAX);
ASSERT(index >= minIndex);
+ (void) minIndex;
ASSERT(index <= maxIndex);
+ (void) maxIndex;
memset(r, 0, sizeof(*r));
r->Base.File = file;
r->Base.Index = index;
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b62cfc36af..372a9acdd0 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -4249,14 +4249,15 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
if (oper->children[0].type == SLANG_OPER_IDENTIFIER) {
/* Check that var is writeable */
+ const char *varName = (char *) oper->children[0].a_id;
slang_variable *var
= _slang_variable_locate(oper->children[0].locals,
oper->children[0].a_id, GL_TRUE);
if (!var) {
- slang_info_log_error(A->log, "undefined variable '%s'",
- (char *) oper->children[0].a_id);
+ slang_info_log_error(A->log, "undefined variable '%s'", varName);
return NULL;
}
+
if (var->type.qualifier == SLANG_QUAL_CONST ||
var->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
var->type.qualifier == SLANG_QUAL_UNIFORM ||
@@ -4264,7 +4265,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
A->program->Target == GL_FRAGMENT_PROGRAM_ARB)) {
slang_info_log_error(A->log,
"illegal assignment to read-only variable '%s'",
- (char *) oper->children[0].a_id);
+ varName);
return NULL;
}
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index ba56df5418..bd1fe9bc4b 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -191,6 +191,7 @@ STATETRACKER_SOURCES = \
state_tracker/st_cb_blit.c \
state_tracker/st_cb_bufferobjects.c \
state_tracker/st_cb_clear.c \
+ state_tracker/st_cb_condrender.c \
state_tracker/st_cb_flush.c \
state_tracker/st_cb_drawpixels.c \
state_tracker/st_cb_fbo.c \
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index d6e3a3e561..e1d6fa9eca 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -208,7 +208,7 @@ update_samplers(struct st_context *st)
assert(sampler->min_lod <= sampler->max_lod);
}
- xlate_border_color(texobj->BorderColor,
+ xlate_border_color(texobj->BorderColor.f,
teximg ? teximg->_BaseFormat : GL_RGBA,
sampler->border_color);
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 494a3a99c8..0102d8a6f7 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -103,6 +103,17 @@ st_bufferobj_subdata(GLcontext *ctx,
ASSERT(size >= 0);
ASSERT(offset + size <= obj->Size);
+ if (!size)
+ return;
+
+ /*
+ * According to ARB_vertex_buffer_object specification, if data is null,
+ * then the contents of the buffer object's data store is undefined. We just
+ * ignore, and leave it unchanged.
+ */
+ if (!data)
+ return;
+
st_cond_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer,
offset, size, data);
}
@@ -125,6 +136,9 @@ st_bufferobj_get_subdata(GLcontext *ctx,
ASSERT(size >= 0);
ASSERT(offset + size <= obj->Size);
+ if (!size)
+ return;
+
st_cond_flush_pipe_buffer_read(st_context(ctx), st_obj->buffer,
offset, size, data);
}
@@ -223,6 +237,13 @@ st_bufferobj_map(GLcontext *ctx, GLenum target, GLenum access,
/**
+ * Dummy data whose's pointer is used for zero length ranges.
+ */
+static long
+st_bufferobj_zero_length_range = 0;
+
+
+/**
* Called via glMapBufferRange().
*/
static void *
@@ -257,14 +278,26 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
assert(offset < obj->Size);
assert(offset + length <= obj->Size);
- obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags);
+ /*
+ * We go out of way here to hide the degenerate yet valid case of zero
+ * length range from the pipe driver.
+ */
+ if (!length) {
+ obj->Pointer = &st_bufferobj_zero_length_range;
+ }
+ else {
+ obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags);
+ if (obj->Pointer) {
+ obj->Pointer = (ubyte *) obj->Pointer + offset;
+ }
+ }
+
if (obj->Pointer) {
- obj->Pointer = (ubyte *) obj->Pointer + offset;
obj->Offset = offset;
obj->Length = length;
obj->AccessFlags = access;
}
-
+
return obj->Pointer;
}
@@ -282,6 +315,9 @@ st_bufferobj_flush_mapped_range(GLcontext *ctx, GLenum target,
assert(length >= 0);
assert(offset + length <= obj->Length);
+ if (!length)
+ return;
+
pipe_buffer_flush_mapped_range(pipe->screen, st_obj->buffer,
obj->Offset + offset, length);
}
@@ -296,7 +332,9 @@ st_bufferobj_unmap(GLcontext *ctx, GLenum target, struct gl_buffer_object *obj)
struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_buffer_object *st_obj = st_buffer_object(obj);
- pipe_buffer_unmap(pipe->screen, st_obj->buffer);
+ if(obj->Length)
+ pipe_buffer_unmap(pipe->screen, st_obj->buffer);
+
obj->Pointer = NULL;
obj->Offset = 0;
obj->Length = 0;
@@ -319,6 +357,9 @@ st_copy_buffer_subdata(GLcontext *ctx,
struct st_buffer_object *dstObj = st_buffer_object(dst);
ubyte *srcPtr, *dstPtr;
+ if(!size)
+ return;
+
/* buffer should not already be mapped */
assert(!src->Pointer);
assert(!dst->Pointer);
diff --git a/src/mesa/state_tracker/st_cb_condrender.c b/src/mesa/state_tracker/st_cb_condrender.c
new file mode 100644
index 0000000000..780b40c206
--- /dev/null
+++ b/src/mesa/state_tracker/st_cb_condrender.c
@@ -0,0 +1,95 @@
+/**************************************************************************
+ *
+ * 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
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+/**
+ * glBegin/EndCondtionalRender functions
+ *
+ * \author Brian Paul
+ */
+
+
+#include "main/imports.h"
+#include "main/context.h"
+
+#include "pipe/p_context.h"
+#include "pipe/p_defines.h"
+#include "st_context.h"
+#include "st_cb_queryobj.h"
+#include "st_cb_condrender.h"
+
+
+/**
+ * Called via ctx->Driver.BeginConditionalRender()
+ */
+static void
+st_BeginConditionalRender(GLcontext *ctx, struct gl_query_object *q,
+ GLenum mode)
+{
+ struct st_query_object *stq = st_query_object(q);
+ struct pipe_context *pipe = ctx->st->pipe;
+ uint m;
+
+ switch (mode) {
+ case GL_QUERY_WAIT:
+ m = PIPE_RENDER_COND_WAIT;
+ break;
+ case GL_QUERY_NO_WAIT:
+ m = PIPE_RENDER_COND_NO_WAIT;
+ break;
+ case GL_QUERY_BY_REGION_WAIT:
+ m = PIPE_RENDER_COND_BY_REGION_WAIT;
+ break;
+ case GL_QUERY_BY_REGION_NO_WAIT:
+ m = PIPE_RENDER_COND_BY_REGION_NO_WAIT;
+ break;
+ default:
+ assert(0 && "bad mode in st_BeginConditionalRender");
+ }
+
+ pipe->render_condition(pipe, stq->pq, m);
+}
+
+
+/**
+ * Called via ctx->Driver.BeginConditionalRender()
+ */
+static void
+st_EndConditionalRender(GLcontext *ctx, struct gl_query_object *q)
+{
+ struct pipe_context *pipe = ctx->st->pipe;
+ (void) q;
+ pipe->render_condition(pipe, NULL, 0);
+}
+
+
+
+void st_init_cond_render_functions(struct dd_function_table *functions)
+{
+ functions->BeginConditionalRender = st_BeginConditionalRender;
+ functions->EndConditionalRender = st_EndConditionalRender;
+}
diff --git a/src/mesa/state_tracker/st_cb_condrender.h b/src/mesa/state_tracker/st_cb_condrender.h
new file mode 100644
index 0000000000..891f1cbcd8
--- /dev/null
+++ b/src/mesa/state_tracker/st_cb_condrender.h
@@ -0,0 +1,35 @@
+/**************************************************************************
+ *
+ * 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
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef ST_CB_CONDRENDER_H
+#define ST_CB_CONDRENDER_H
+
+
+extern void st_init_cond_render_functions(struct dd_function_table *functions);
+
+
+#endif
diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
index dcf4c38eb6..10629e9225 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -44,23 +44,6 @@
#include "st_public.h"
-struct st_query_object
-{
- struct gl_query_object base;
- struct pipe_query *pq;
-};
-
-
-/**
- * Cast wrapper
- */
-static struct st_query_object *
-st_query_object(struct gl_query_object *q)
-{
- return (struct st_query_object *) q;
-}
-
-
static struct gl_query_object *
st_NewQueryObject(GLcontext *ctx, GLuint id)
{
diff --git a/src/mesa/state_tracker/st_cb_queryobj.h b/src/mesa/state_tracker/st_cb_queryobj.h
index 9220a212b6..fa256b7182 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.h
+++ b/src/mesa/state_tracker/st_cb_queryobj.h
@@ -29,6 +29,27 @@
#define ST_CB_QUERYOBJ_H
+/**
+ * Subclass of gl_query_object
+ */
+struct st_query_object
+{
+ struct gl_query_object base;
+ struct pipe_query *pq;
+};
+
+
+/**
+ * Cast wrapper
+ */
+static INLINE struct st_query_object *
+st_query_object(struct gl_query_object *q)
+{
+ return (struct st_query_object *) q;
+}
+
+
+
extern void
st_init_query_functions(struct dd_function_table *functions);
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 6e1ecb1c50..0cec23f2b3 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1090,7 +1090,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
done:
_mesa_unmap_teximage_pbo(ctx, packing);
- if (stImage->pt) {
+ if (stImage->pt && texImage->Data) {
st_texture_image_unmap(ctx->st, stImage);
texImage->Data = NULL;
}
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index d18a25ab51..e4f18c842c 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -43,6 +43,7 @@
#include "st_cb_blit.h"
#include "st_cb_bufferobjects.h"
#include "st_cb_clear.h"
+#include "st_cb_condrender.h"
#if FEATURE_drawpix
#include "st_cb_drawpixels.h"
#include "st_cb_rasterpos.h"
@@ -337,6 +338,7 @@ void st_init_driver_functions(struct dd_function_table *functions)
#if FEATURE_queryobj
st_init_query_functions(functions);
#endif
+ st_init_cond_render_functions(functions);
st_init_readpixels_functions(functions);
st_init_texture_functions(functions);
st_init_flush_functions(functions);
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index ef3cbc53ee..35e08749df 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -306,4 +306,8 @@ void st_init_extensions(struct st_context *st)
/* we support always support GL_EXT_framebuffer_blit */
ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
}
+
+ if (st->pipe->render_condition) {
+ ctx->Extensions.NV_conditional_render = GL_TRUE;
+ }
}
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 0bb988e3ef..76b65cc755 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -747,28 +747,28 @@ get_border_color(const struct gl_texture_object *tObj,
{
switch (img->_BaseFormat) {
case GL_RGB:
- rgba[0] = tObj->BorderColor[0];
- rgba[1] = tObj->BorderColor[1];
- rgba[2] = tObj->BorderColor[2];
+ rgba[0] = tObj->BorderColor.f[0];
+ rgba[1] = tObj->BorderColor.f[1];
+ rgba[2] = tObj->BorderColor.f[2];
rgba[3] = 1.0F;
break;
case GL_ALPHA:
rgba[0] = rgba[1] = rgba[2] = 0.0;
- rgba[3] = tObj->BorderColor[3];
+ rgba[3] = tObj->BorderColor.f[3];
break;
case GL_LUMINANCE:
- rgba[0] = rgba[1] = rgba[2] = tObj->BorderColor[0];
+ rgba[0] = rgba[1] = rgba[2] = tObj->BorderColor.f[0];
rgba[3] = 1.0;
break;
case GL_LUMINANCE_ALPHA:
- rgba[0] = rgba[1] = rgba[2] = tObj->BorderColor[0];
- rgba[3] = tObj->BorderColor[3];
+ rgba[0] = rgba[1] = rgba[2] = tObj->BorderColor.f[0];
+ rgba[3] = tObj->BorderColor.f[3];
break;
case GL_INTENSITY:
- rgba[0] = rgba[1] = rgba[2] = rgba[3] = tObj->BorderColor[0];
+ rgba[0] = rgba[1] = rgba[2] = rgba[3] = tObj->BorderColor.f[0];
break;
default:
- COPY_4V(rgba, tObj->BorderColor);
+ COPY_4V(rgba, tObj->BorderColor.f);
}
}
@@ -2331,7 +2331,7 @@ sample_2d_array_linear(GLcontext *ctx,
array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth);
if (array < 0 || array >= depth) {
- COPY_4V(rgba, tObj->BorderColor);
+ COPY_4V(rgba, tObj->BorderColor.f);
}
else {
if (img->Border) {
@@ -3002,7 +3002,7 @@ sample_depth_texture( GLcontext *ctx,
img->FetchTexelf(img, col, row, slice, &depthSample);
}
else {
- depthSample = tObj->BorderColor[0];
+ depthSample = tObj->BorderColor.f[0];
}
result = shadow_compare(function, texcoords[i][compare_coord],
@@ -3053,21 +3053,21 @@ sample_depth_texture( GLcontext *ctx,
}
if (slice < 0 || slice >= (GLint) depth) {
- depth00 = tObj->BorderColor[0];
- depth01 = tObj->BorderColor[0];
- depth10 = tObj->BorderColor[0];
- depth11 = tObj->BorderColor[0];
+ depth00 = tObj->BorderColor.f[0];
+ depth01 = tObj->BorderColor.f[0];
+ depth10 = tObj->BorderColor.f[0];
+ depth11 = tObj->BorderColor.f[0];
}
else {
/* get four depth samples from the texture */
if (useBorderTexel & (I0BIT | J0BIT)) {
- depth00 = tObj->BorderColor[0];
+ depth00 = tObj->BorderColor.f[0];
}
else {
img->FetchTexelf(img, i0, j0, slice, &depth00);
}
if (useBorderTexel & (I1BIT | J0BIT)) {
- depth10 = tObj->BorderColor[0];
+ depth10 = tObj->BorderColor.f[0];
}
else {
img->FetchTexelf(img, i1, j0, slice, &depth10);
@@ -3075,13 +3075,13 @@ sample_depth_texture( GLcontext *ctx,
if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) {
if (useBorderTexel & (I0BIT | J1BIT)) {
- depth01 = tObj->BorderColor[0];
+ depth01 = tObj->BorderColor.f[0];
}
else {
img->FetchTexelf(img, i0, j1, slice, &depth01);
}
if (useBorderTexel & (I1BIT | J1BIT)) {
- depth11 = tObj->BorderColor[0];
+ depth11 = tObj->BorderColor.f[0];
}
else {
img->FetchTexelf(img, i1, j1, slice, &depth11);
diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c
index 0d7e0f1f98..14cfa910aa 100644
--- a/src/mesa/x86/gen_matypes.c
+++ b/src/mesa/x86/gen_matypes.c
@@ -61,21 +61,11 @@ do { \
printf( "\n" ); \
} while (0)
-#if defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64)
#define OFFSET( s, t, m ) \
- printf( "#define %s\t%ld\n", s, offsetof( t, m ) );
-#else
-#define OFFSET( s, t, m ) \
- printf( "#define %s\t%d\n", s, offsetof( t, m ) );
-#endif
+ printf( "#define %s\t%lu\n", s, (unsigned long) offsetof( t, m ) );
-#if defined(__BEOS__) || defined(__HAIKU__) || defined(_LP64)
-#define SIZEOF( s, t ) \
- printf( "#define %s\t%ld\n", s, sizeof(t) );
-#else
#define SIZEOF( s, t ) \
- printf( "#define %s\t%d\n", s, sizeof(t) );
-#endif
+ printf( "#define %s\t%lu\n", s, (unsigned long) sizeof(t) );
#define DEFINE( s, d ) \
printf( "#define %s\t0x%x\n", s, d );