based on the GL attribute groups.
Introduced constants describing the circumstances under which some
key derived values can change:
_SWRAST_NEW_RASTERMASK -- ctx->RasterMask
_SWRAST_NEW_TRIANGLE -- The software rasterizer's triangle
function
_DD_NEW_FEEDBACK -- the 'DD_FEEDBACK' bit in ctx->TriangleCaps
These are helpful in deciding whether you need to recalculate state if your
recalculation involves reference to a derived value.
fxMesa->glCtx->Const.MaxTextureLevels=9;
fxMesa->glCtx->Const.MaxTextureSize=256;
fxMesa->glCtx->Const.MaxTextureUnits=fxMesa->emulateTwoTMUs ? 2 : 1;
- fxMesa->new_state = NEW_ALL;
+ fxMesa->new_state = _NEW_ALL;
fxDDSetupInit();
fxDDCvaInit();
gl_extensions_disable(ctx, "GL_EXT_blend_color");
gl_extensions_disable(ctx, "GL_EXT_fog_coord");
- gl_extensions_add(ctx, DEFAULT_ON, "3DFX_set_global_palette", 0);
+ gl_extensions_add(ctx, GL_TRUE, "3DFX_set_global_palette", 0);
if (!fxMesa->haveTwoTMUs)
gl_extensions_disable(ctx, "GL_EXT_texture_env_add");
}
-
-#define INTERESTED (~(NEW_MODELVIEW|NEW_PROJECTION|NEW_PROJECTION|NEW_TEXTURE_MATRIX|NEW_USER_CLIP|NEW_CLIENT_STATE|NEW_TEXTURE_ENABLE))
-
static void fxDDUpdateDDPointers(GLcontext *ctx)
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
if (MESA_VERBOSE&(VERBOSE_DRIVER|VERBOSE_STATE))
fprintf(stderr,"fxmesa: fxDDUpdateDDPointers(...)\n");
- if (new_state & (NEW_RASTER_OPS|NEW_TEXTURING))
+ if (new_state & _FX_NEW_FALLBACK)
fxMesa->is_in_hardware = fxIsInHardware(ctx);
if (fxMesa->is_in_hardware) {
if (fxMesa->new_state)
fxSetupFXUnits(ctx);
- if(new_state & INTERESTED) {
+ if (new_state & _FX_NEW_RENDERSTATE) {
fxDDChooseRenderState( ctx );
+
fxMesa->RenderVBTables=fxDDChooseRenderVBTables(ctx);
fxMesa->RenderVBClippedTab=fxMesa->RenderVBTables[0];
fxMesa->RenderVBCulledTab=fxMesa->RenderVBTables[1];
fxMesa->RenderVBRawTab=fxMesa->RenderVBTables[2];
-
- ctx->Driver.RasterSetup=fxDDChooseSetupFunction(ctx);
}
-
+
+ if (new_state & _FX_NEW_SETUP_FUNCTION)
+ ctx->Driver.RasterSetup=fxDDChooseSetupFunction(ctx);
+
+
ctx->Driver.PointsFunc=fxMesa->PointsFunc;
ctx->Driver.LineFunc=fxMesa->LineFunc;
ctx->Driver.TriangleFunc=fxMesa->TriangleFunc;
fprintf(stderr,"fxmesa: fxSetupDDPointers()\n");
}
+ ctx->Driver.UpdateStateNotify = (_FX_NEW_SETUP_FUNCTION|
+ _FX_NEW_RENDERSTATE|
+ _FX_NEW_FALLBACK|
+ _SWRAST_NEW_TRIANGLE|
+ _SWRAST_NEW_LINE|
+ _SWRAST_NEW_POINT);
+
ctx->Driver.UpdateState=fxDDUpdateDDPointers;
ctx->Driver.WriteDepthSpan=fxDDWriteDepthSpan;
FREE(ti);
tObj->DriverData = NULL;
- ctx->NewState |= NEW_TEXTURING;
+/* Pushed into core: Set _NEW_TEXTURE whenever a bound texture is
+ * deleted (changes bound texture id).
+ */
+/* ctx->NewState |= _NEW_TEXTURE; */
}
#endif
+
+
+/* Covers the state referenced by IsInHardware:
+ */
+#define _FX_NEW_FALLBACK (_NEW_TEXTURE| \
+ _NEW_HINT| \
+ _NEW_STENCIL| \
+ _NEW_BUFFERS| \
+ _NEW_COLOR| \
+ _NEW_LIGHT)
+
+/* Covers the state referenced by fxDDChooseRenderState and
+ * fxDDChoseRenderVBTables.
+ */
+#define _FX_NEW_RENDERSTATE (_NEW_RENDERMODE | \
+ _DD_NEW_FLATSHADE | \
+ _DD_NEW_TRI_LIGHT_TWOSIDE| \
+ _DD_NEW_MULTIDRAW | \
+ _NEW_POINT | \
+ _NEW_LINE | \
+ _NEW_POLYGON)
+
+/* Covers the state referenced by fxDDChooseSetupFunction.
+ */
+#define _FX_NEW_SETUP_FUNCTION (_NEW_LIGHT| \
+ _NEW_FOG| \
+ _NEW_TEXTURE| \
+ _NEW_COLOR) \
+
+
/* These lookup table are used to extract RGB values in [0,255] from
* 16-bit pixel values.
*/
-/* $Id: xm_api.c,v 1.3 2000/10/30 08:39:38 joukj Exp $ */
+/* $Id: xm_api.c,v 1.4 2000/10/30 13:32:03 keithw Exp $ */
/*
* Mesa 3-D graphics library
c->gl_ctx->Driver.UpdateState = xmesa_update_state;
+ /* These flags cover all the tests made in UpdateState, plus what
+ * the software rasterizer needs to choose line,point and triangle
+ * functions.
+ */
+ c->gl_ctx->Driver.UpdateStateNotify = (_NEW_POINT|
+ _NEW_TEXTURE|
+ _NEW_LINE|
+ _NEW_LIGHT|
+ _NEW_DEPTH|
+ _NEW_POLYGON|
+ _NEW_TEXTURE|
+ _SWRAST_NEW_RASTERMASK|
+ _SWRAST_NEW_TRIANGLE|
+ _SWRAST_NEW_LINE|
+ _SWRAST_NEW_POINT);
+
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
c->driContextPriv = driContextPriv;
#endif
-/* $Id: xm_tri.c,v 1.4 2000/09/28 22:44:32 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.5 2000/10/30 13:32:03 keithw Exp $ */
/*
* Mesa 3-D graphics library
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer, Y); \
GLint len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
XDITHER_SETUP(yy); \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, len = RIGHT-LEFT; \
LOOKUP_SETUP; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
DEPTH_TYPE z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, Y)); \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
FLAT_DITHER_ROW_SETUP(yy); \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++,xx++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
+ (void) fffog; \
for (i=0;i<len;i++) { \
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
-/* $Id: accum.c,v 1.29 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: accum.c,v 1.30 2000/10/30 13:31:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Accum.ClearColor[1] = CLAMP( green, -1.0, 1.0 );
ctx->Accum.ClearColor[2] = CLAMP( blue, -1.0, 1.0 );
ctx->Accum.ClearColor[3] = CLAMP( alpha, -1.0, 1.0 );
+ ctx->NewState |= _NEW_ACCUM;
}
-/* $Id: attrib.c,v 1.30 2000/10/29 18:12:14 brianp Exp $ */
+/* $Id: attrib.c,v 1.31 2000/10/30 13:31:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
switch (attr->kind) {
case GL_ACCUM_BUFFER_BIT:
MEMCPY( &ctx->Accum, attr->data, sizeof(struct gl_accum_attrib) );
+ ctx->NewState |= _NEW_ACCUM;
break;
case GL_COLOR_BUFFER_BIT:
{
GLenum oldLogicOp = ctx->Color.LogicOp;
MEMCPY( &ctx->Color, attr->data,
sizeof(struct gl_colorbuffer_attrib) );
+ ctx->NewState |= _NEW_COLOR;
if (ctx->Color.DrawBuffer != oldDrawBuffer) {
_mesa_DrawBuffer( ctx->Color.DrawBuffer);
}
GLfloat oldDepthClear = ctx->Depth.Clear;
MEMCPY( &ctx->Depth, attr->data,
sizeof(struct gl_depthbuffer_attrib) );
+ ctx->NewState |= _NEW_DEPTH;
if (ctx->Depth.Test != oldDepthTest && ctx->Driver.Enable)
(*ctx->Driver.Enable)( ctx, GL_DEPTH_TEST, ctx->Depth.Test);
if (ctx->Depth.Func != oldDepthFunc && ctx->Driver.DepthFunc)
const struct gl_enable_attrib *enable;
enable = (const struct gl_enable_attrib *) attr->data;
pop_enable_group(ctx, enable);
+ ctx->NewState |= _NEW_ALL;
}
break;
case GL_EVAL_BIT:
MEMCPY( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) );
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_FOG_BIT:
{
GLboolean anyChange = (GLboolean) (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
MEMCPY( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) );
+ ctx->NewState |= _NEW_FOG;
if (anyChange && ctx->Driver.Fogfv) {
const GLfloat mode = (GLfloat) ctx->Fog.Mode;
const GLfloat density = ctx->Fog.Density;
break;
case GL_HINT_BIT:
MEMCPY( &ctx->Hint, attr->data, sizeof(struct gl_hint_attrib) );
+ ctx->NewState |= _NEW_HINT;
if (ctx->Driver.Hint) {
(*ctx->Driver.Hint)( ctx, GL_PERSPECTIVE_CORRECTION_HINT,
ctx->Hint.PerspectiveCorrection );
break;
case GL_LIGHTING_BIT:
MEMCPY( &ctx->Light, attr->data, sizeof(struct gl_light_attrib) );
+ ctx->NewState |= _NEW_LIGHT;
if (ctx->Driver.Enable) {
GLuint i;
for (i = 0; i < MAX_LIGHTS; i++) {
break;
case GL_LINE_BIT:
MEMCPY( &ctx->Line, attr->data, sizeof(struct gl_line_attrib) );
+ ctx->NewState |= _NEW_LINE;
if (ctx->Driver.Enable) {
(*ctx->Driver.Enable)( ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag );
(*ctx->Driver.Enable)( ctx, GL_LINE_STIPPLE, ctx->Line.StippleFlag );
break;
case GL_PIXEL_MODE_BIT:
MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) );
+ ctx->NewState |= _NEW_PIXEL;
break;
case GL_POINT_BIT:
MEMCPY( &ctx->Point, attr->data, sizeof(struct gl_point_attrib) );
+ ctx->NewState |= _NEW_POINT;
if (ctx->Driver.Enable)
(*ctx->Driver.Enable)( ctx, GL_POINT_SMOOTH, ctx->Point.SmoothFlag );
break;
GLenum oldBackMode = ctx->Polygon.BackMode;
MEMCPY( &ctx->Polygon, attr->data,
sizeof(struct gl_polygon_attrib) );
+ ctx->NewState |= _NEW_POLYGON;
if ((ctx->Polygon.FrontMode != oldFrontMode ||
ctx->Polygon.BackMode != oldBackMode) &&
ctx->Driver.PolygonMode) {
break;
case GL_POLYGON_STIPPLE_BIT:
MEMCPY( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) );
+ ctx->NewState |= _NEW_POLYGONSTIPPLE;
if (ctx->Driver.PolygonStipple)
ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data );
break;
case GL_SCISSOR_BIT:
MEMCPY( &ctx->Scissor, attr->data,
sizeof(struct gl_scissor_attrib) );
+ ctx->NewState |= _NEW_SCISSOR;
if (ctx->Driver.Enable)
(*ctx->Driver.Enable)( ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled );
if (ctx->Driver.Scissor)
case GL_STENCIL_BUFFER_BIT:
MEMCPY( &ctx->Stencil, attr->data,
sizeof(struct gl_stencil_attrib) );
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.StencilFunc)
(*ctx->Driver.StencilFunc)( ctx, ctx->Stencil.Function,
ctx->Stencil.Ref, ctx->Stencil.ValueMask);
case GL_TRANSFORM_BIT:
MEMCPY( &ctx->Transform, attr->data,
sizeof(struct gl_transform_attrib) );
+ ctx->NewState |= _NEW_TRANSFORM;
if (ctx->Driver.Enable) {
(*ctx->Driver.Enable)( ctx, GL_NORMALIZE, ctx->Transform.Normalize );
(*ctx->Driver.Enable)( ctx, GL_RESCALE_NORMAL_EXT, ctx->Transform.RescaleNormals );
}
MEMCPY( &ctx->Texture, attr->data,
sizeof(struct gl_texture_attrib) );
+ ctx->NewState |= _NEW_TEXTURE;
/* restore state of the currently bound texture objects */
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
copy_texobj_state( ctx->Texture.Unit[u].CurrentD[1],
{
struct gl_viewport_attrib *v =
(struct gl_viewport_attrib *)attr->data;
-
+
+ ctx->NewState |= _NEW_VIEWPORT;
_mesa_Viewport( v->X, v->Y, v->Width, v->Height );
_mesa_DepthRange( v->Near, v->Far );
break;
attr = next;
}
- ctx->NewState = NEW_ALL;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
}
attr = next;
}
- ctx->NewState = NEW_ALL;
+ ctx->NewState = _NEW_ARRAY;
}
-/* $Id: blend.c,v 1.21 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: blend.c,v 1.22 2000/10/30 13:31:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
switch (sfactor) {
case GL_SRC_COLOR:
case GL_ONE_MINUS_SRC_COLOR:
- if (!ctx->Extensions.HaveBlendSquare) {
+ if (!ctx->Extensions.NV_blend_square) {
gl_error( ctx, GL_INVALID_ENUM, "glBlendFunc(sfactor)" );
return;
}
switch (dfactor) {
case GL_DST_COLOR:
case GL_ONE_MINUS_DST_COLOR:
- if (!ctx->Extensions.HaveBlendSquare) {
+ if (!ctx->Extensions.NV_blend_square) {
gl_error( ctx, GL_INVALID_ENUM, "glBlendFunc(dfactor)" );
return;
}
}
ctx->Color.BlendFunc = NULL;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
switch (sfactorRGB) {
case GL_SRC_COLOR:
case GL_ONE_MINUS_SRC_COLOR:
- if (!ctx->Extensions.HaveBlendSquare) {
+ if (!ctx->Extensions.NV_blend_square) {
gl_error(ctx, GL_INVALID_ENUM, "glBlendFuncSeparate(sfactorRGB)");
return;
}
switch (dfactorRGB) {
case GL_DST_COLOR:
case GL_ONE_MINUS_DST_COLOR:
- if (!ctx->Extensions.HaveBlendSquare) {
+ if (!ctx->Extensions.NV_blend_square) {
gl_error(ctx, GL_INVALID_ENUM, "glBlendFuncSeparate(dfactorRGB)");
return;
}
switch (sfactorA) {
case GL_SRC_COLOR:
case GL_ONE_MINUS_SRC_COLOR:
- if (!ctx->Extensions.HaveBlendSquare) {
+ if (!ctx->Extensions.NV_blend_square) {
gl_error(ctx, GL_INVALID_ENUM, "glBlendFuncSeparate(sfactorA)");
return;
}
switch (dfactorA) {
case GL_DST_COLOR:
case GL_ONE_MINUS_DST_COLOR:
- if (!ctx->Extensions.HaveBlendSquare) {
+ if (!ctx->Extensions.NV_blend_square) {
gl_error(ctx, GL_INVALID_ENUM, "glBlendFuncSeparate(dfactorA)");
return;
}
}
ctx->Color.BlendFunc = NULL;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
if (ctx->Driver.BlendFuncSeparate) {
(*ctx->Driver.BlendFuncSeparate)( ctx, sfactorRGB, dfactorRGB,
case GL_MIN_EXT:
case GL_MAX_EXT:
case GL_FUNC_ADD_EXT:
- if (ctx->Extensions.HaveBlendMinmax) {
+ if (ctx->Extensions.EXT_blend_minmax) {
ctx->Color.BlendEquation = mode;
}
else {
break;
case GL_FUNC_SUBTRACT_EXT:
case GL_FUNC_REVERSE_SUBTRACT_EXT:
- if (ctx->Extensions.HaveBlendSubtract) {
+ if (ctx->Extensions.EXT_blend_subtract) {
ctx->Color.BlendEquation = mode;
}
else {
}
ctx->Color.BlendFunc = NULL;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
if (ctx->Driver.BlendEquation)
ctx->Driver.BlendEquation( ctx, mode );
ctx->Color.BlendColor[1] = CLAMP( green, 0.0F, 1.0F );
ctx->Color.BlendColor[2] = CLAMP( blue, 0.0F, 1.0F );
ctx->Color.BlendColor[3] = CLAMP( alpha, 0.0F, 1.0F );
+ ctx->NewState |= _NEW_COLOR;
}
#ifdef USE_MMX_ASM
-/* $Id: buffers.c,v 1.15 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: buffers.c,v 1.16 2000/10/30 13:31:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearIndex");
ctx->Color.ClearIndex = (GLuint) c;
+ ctx->NewState |= _NEW_COLOR;
+
if (!ctx->Visual.RGBAflag) {
/* it's OK to call glClearIndex in RGBA mode but it should be a NOP */
(*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex );
ctx->Color.ClearColor[1] = CLAMP( green, 0.0F, 1.0F );
ctx->Color.ClearColor[2] = CLAMP( blue, 0.0F, 1.0F );
ctx->Color.ClearColor[3] = CLAMP( alpha, 0.0F, 1.0F );
+ ctx->NewState |= _NEW_COLOR;
if (ctx->Visual.RGBAflag) {
GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
}
ctx->Color.DrawBuffer = mode;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
}
ctx->Pixel.ReadBuffer = mode;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_PIXEL;
}
ctx->DrawBuffer->Height == (GLint) buf_height)
return;
- ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */
+ ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
/* save buffer size */
ctx->DrawBuffer->Width = buf_width;
-/* $Id: clip.c,v 1.11 2000/10/28 20:41:13 brianp Exp $ */
+/* $Id: clip.c,v 1.12 2000/10/30 13:31:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Transform.ClipEnabled[p]) {
- ctx->NewState |= NEW_USER_CLIP;
-
if (ctx->ProjectionMatrix.flags & MAT_DIRTY_ALL_OVER) {
gl_matrix_analyze( &ctx->ProjectionMatrix );
}
ctx->Transform.EyeUserPlane[p],
ctx->ProjectionMatrix.inv );
}
+
+ ctx->NewState |= _NEW_TRANSFORM;
}
-/* $Id: colortab.c,v 1.23 2000/10/29 18:12:14 brianp Exp $ */
+/* $Id: colortab.c,v 1.24 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
}
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
}
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
gl_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)");
return;
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
-/* $Id: context.c,v 1.98 2000/10/29 19:02:23 brianp Exp $ */
+/* $Id: context.c,v 1.99 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
gl_matrix_alloc_inv( &ctx->ProjectionMatrix );
gl_matrix_ctr( &ctx->ModelProjectMatrix );
- gl_matrix_ctr( &ctx->ModelProjectWinMatrix );
- ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
ctx->ProjectionStackDepth = 0;
ctx->NearFarStack[0][0] = 1.0; /* These values seem weird by make */
_mesa_init_colortable(&ctx->ProxyPostColorMatrixColorTable);
/* Miscellaneous */
- ctx->NewState = NEW_ALL;
+ ctx->NewState = _NEW_ALL;
ctx->RenderMode = GL_RENDER;
ctx->StippleCounter = 0;
ctx->NeedNormals = GL_FALSE;
if (mask & GL_VIEWPORT_BIT) {
MEMCPY( &dst->Viewport, &src->Viewport, sizeof(struct gl_viewport_attrib) );
}
+ /* XXX FIXME: Call callbacks?
+ */
+ dst->NewState = _NEW_ALL;
}
/* TODO: check if newCtx and buffer's visual match??? */
newCtx->DrawBuffer = drawBuffer;
newCtx->ReadBuffer = readBuffer;
- newCtx->NewState = NEW_ALL; /* just to be safe */
+ newCtx->NewState |= _NEW_BUFFERS;
gl_update_state( newCtx );
}
-/* $Id: convolve.c,v 1.7 2000/10/28 20:41:13 brianp Exp $ */
+/* $Id: convolve.c,v 1.8 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Convolution1D.Filter[i * 4 + 3] = a;
}
}
+
+ ctx->NewState |= _NEW_IMAGING;
}
ctx->Convolution2D.Filter[i * 4 + 3] = a;
}
}
+
+ ctx->NewState |= _NEW_IMAGING;
}
gl_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf(pname)");
return;
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
gl_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv(pname)");
return;
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
gl_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri(pname)");
return;
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
gl_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv(pname)");
return;
}
+
+ ctx->NewState |= _NEW_PIXEL;
}
ctx->Unpack.SkipImages = 0;
ctx->Unpack.SwapBytes = GL_FALSE;
ctx->Unpack.LsbFirst = GL_FALSE;
+ ctx->NewState |= _NEW_PACKUNPACK;
_mesa_ConvolutionFilter2D(target, internalFormat, width, height,
GL_RGBA, GL_UNSIGNED_BYTE, rgba);
ctx->Unpack = packSave; /* restore pixel packing params */
+ ctx->NewState |= _NEW_PACKUNPACK;
}
ctx->Separable2D.Filter[i * 4 + 3 + colStart] = a;
}
}
+
+ ctx->NewState |= _NEW_IMAGING;
}
-/* $Id: dd.h,v 1.35 2000/10/29 18:12:14 brianp Exp $ */
+/* $Id: dd.h,v 1.36 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
* NULL can be returned.
*/
+ GLuint UpdateStateNotify;
+ /*
+ * Tell mesa exactly when to call UpdateState. This is a bitwise
+ * or of the _NEW_* flags defined in types.h.
+ */
+
void (*UpdateState)( GLcontext *ctx );
/*
* UpdateState() is called whenver Mesa thinks the device driver should
-/* $Id: depth.c,v 1.20 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: depth.c,v 1.21 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Depth.Clear = (GLfloat) CLAMP( depth, 0.0, 1.0 );
if (ctx->Driver.ClearDepth)
(*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear );
+ ctx->NewState |= _NEW_DEPTH;
}
case GL_ALWAYS:
if (ctx->Depth.Func != func) {
ctx->Depth.Func = func;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_DEPTH;
ctx->TriangleCaps &= ~DD_Z_NEVER;
if (ctx->Driver.DepthFunc) {
(*ctx->Driver.DepthFunc)( ctx, func );
case GL_NEVER:
if (ctx->Depth.Func != func) {
ctx->Depth.Func = func;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_DEPTH;
ctx->TriangleCaps |= DD_Z_NEVER;
if (ctx->Driver.DepthFunc) {
(*ctx->Driver.DepthFunc)( ctx, func );
*/
if (ctx->Depth.Mask != flag) {
ctx->Depth.Mask = flag;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_DEPTH;
if (ctx->Driver.DepthMask) {
(*ctx->Driver.DepthMask)( ctx, flag );
}
if (!ctx->DrawBuffer->DepthBuffer) {
/* out of memory */
ctx->Depth.Test = GL_FALSE;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_DEPTH;
gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate depth buffer" );
}
}
-/* $Id: enable.c,v 1.28 2000/10/29 19:02:23 brianp Exp $ */
+/* $Id: enable.c,v 1.29 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
case GL_ALPHA_TEST:
if (ctx->Color.AlphaEnabled!=state) {
ctx->Color.AlphaEnabled = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
break;
case GL_AUTO_NORMAL:
ctx->Eval.AutoNormal = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_BLEND:
if (ctx->Color.BlendEnabled!=state) {
else {
ctx->Color.ColorLogicOpEnabled = GL_FALSE;
}
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
break;
case GL_CLIP_PLANE0:
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
- if (cap >= GL_CLIP_PLANE0 &&
- cap <= GL_CLIP_PLANE5 &&
- ctx->Transform.ClipEnabled[cap-GL_CLIP_PLANE0] != state)
+ if (ctx->Transform.ClipEnabled[cap-GL_CLIP_PLANE0] != state)
{
GLuint p = cap-GL_CLIP_PLANE0;
ctx->Transform.ClipEnabled[p] = state;
- ctx->NewState |= NEW_USER_CLIP;
+ ctx->NewState |= _NEW_TRANSFORM;
if (state) {
ctx->Enabled |= ENABLE_USERCLIP;
case GL_COLOR_MATERIAL:
if (ctx->Light.ColorMaterialEnabled!=state) {
ctx->Light.ColorMaterialEnabled = state;
- ctx->NewState |= NEW_LIGHTING;
+ ctx->NewState |= _NEW_LIGHT;
if (state)
gl_update_color_material( ctx, ctx->Current.Color );
}
if (ctx->Polygon.CullFlag!=state) {
ctx->Polygon.CullFlag = state;
ctx->TriangleCaps ^= DD_TRI_CULL;
- ctx->NewState |= NEW_POLYGON;
+ ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_DEPTH_TEST:
}
if (ctx->Depth.Test!=state) {
ctx->Depth.Test = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_DEPTH;
}
break;
case GL_DITHER:
}
if (ctx->Color.DitherFlag!=state) {
ctx->Color.DitherFlag = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
break;
case GL_FOG:
if (ctx->Fog.Enabled!=state) {
ctx->Fog.Enabled = state;
ctx->Enabled ^= ENABLE_FOG;
- ctx->NewState |= NEW_FOG|NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_FOG;
}
break;
case GL_HISTOGRAM:
- if (ctx->Extensions.HaveHistogram) {
+ if (ctx->Extensions.EXT_histogram) {
ctx->Pixel.HistogramEnabled = state;
+ ctx->NewState |= _NEW_PIXEL;
}
else {
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
ctx->Enabled &= ~ENABLE_LIGHT;
}
- ctx->NewState |= NEW_LIGHTING;
+ ctx->NewState |= _NEW_LIGHT;
}
break;
case GL_LIGHTING:
ctx->Enabled &= ~ENABLE_LIGHT;
if (state)
ctx->Enabled |= ENABLE_LIGHT;
- ctx->NewState |= NEW_LIGHTING;
+ ctx->NewState |= _NEW_LIGHT;
}
break;
case GL_LINE_SMOOTH:
if (ctx->Line.SmoothFlag!=state) {
ctx->Line.SmoothFlag = state;
ctx->TriangleCaps ^= DD_LINE_SMOOTH;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_LINE;
}
break;
case GL_LINE_STIPPLE:
if (ctx->Line.StippleFlag!=state) {
ctx->Line.StippleFlag = state;
ctx->TriangleCaps ^= DD_LINE_STIPPLE;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_LINE;
}
break;
case GL_INDEX_LOGIC_OP:
if (ctx->Color.IndexLogicOpEnabled!=state) {
ctx->Color.IndexLogicOpEnabled = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
break;
case GL_COLOR_LOGIC_OP:
if (ctx->Color.ColorLogicOpEnabled!=state) {
ctx->Color.ColorLogicOpEnabled = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
break;
case GL_MAP1_COLOR_4:
ctx->Eval.Map1Color4 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_INDEX:
ctx->Eval.Map1Index = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_NORMAL:
ctx->Eval.Map1Normal = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_TEXTURE_COORD_1:
ctx->Eval.Map1TextureCoord1 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_TEXTURE_COORD_2:
ctx->Eval.Map1TextureCoord2 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_TEXTURE_COORD_3:
ctx->Eval.Map1TextureCoord3 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_TEXTURE_COORD_4:
ctx->Eval.Map1TextureCoord4 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_VERTEX_3:
ctx->Eval.Map1Vertex3 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP1_VERTEX_4:
ctx->Eval.Map1Vertex4 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_COLOR_4:
ctx->Eval.Map2Color4 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_INDEX:
ctx->Eval.Map2Index = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_NORMAL:
ctx->Eval.Map2Normal = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_TEXTURE_COORD_1:
ctx->Eval.Map2TextureCoord1 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_TEXTURE_COORD_2:
ctx->Eval.Map2TextureCoord2 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_TEXTURE_COORD_3:
ctx->Eval.Map2TextureCoord3 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_TEXTURE_COORD_4:
ctx->Eval.Map2TextureCoord4 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_VERTEX_3:
ctx->Eval.Map2Vertex3 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MAP2_VERTEX_4:
ctx->Eval.Map2Vertex4 = state;
+ ctx->NewState |= _NEW_EVAL;
break;
case GL_MINMAX:
ctx->Pixel.MinMaxEnabled = state;
+ ctx->NewState |= _NEW_PIXEL;
break;
case GL_NORMALIZE:
if (ctx->Transform.Normalize != state) {
ctx->Transform.Normalize = state;
- ctx->NewState |= NEW_NORMAL_TRANSFORM|NEW_LIGHTING;
+ ctx->NewState |= _NEW_TRANSFORM;
ctx->Enabled ^= ENABLE_NORMALIZE;
}
break;
if (ctx->Point.SmoothFlag!=state) {
ctx->Point.SmoothFlag = state;
ctx->TriangleCaps ^= DD_POINT_SMOOTH;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_POINT;
}
break;
case GL_POLYGON_SMOOTH:
if (ctx->Polygon.SmoothFlag!=state) {
ctx->Polygon.SmoothFlag = state;
ctx->TriangleCaps ^= DD_TRI_SMOOTH;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_POLYGON_STIPPLE:
if (ctx->Polygon.StippleFlag!=state) {
ctx->Polygon.StippleFlag = state;
ctx->TriangleCaps ^= DD_TRI_STIPPLE;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_POLYGON_OFFSET_POINT:
if (ctx->Polygon.OffsetPoint!=state) {
ctx->Polygon.OffsetPoint = state;
- ctx->NewState |= NEW_POLYGON;
+ ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_POLYGON_OFFSET_LINE:
if (ctx->Polygon.OffsetLine!=state) {
ctx->Polygon.OffsetLine = state;
- ctx->NewState |= NEW_POLYGON;
+ ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_POLYGON_OFFSET_FILL:
/*case GL_POLYGON_OFFSET_EXT:*/
if (ctx->Polygon.OffsetFill!=state) {
ctx->Polygon.OffsetFill = state;
- ctx->NewState |= NEW_POLYGON;
+ ctx->NewState |= _NEW_POLYGON;
}
break;
case GL_RESCALE_NORMAL_EXT:
if (ctx->Transform.RescaleNormals != state) {
ctx->Transform.RescaleNormals = state;
- ctx->NewState |= NEW_NORMAL_TRANSFORM|NEW_LIGHTING;
+ ctx->NewState |= _NEW_TRANSFORM;
ctx->Enabled ^= ENABLE_RESCALE;
}
break;
case GL_SCISSOR_TEST:
if (ctx->Scissor.Enabled!=state) {
ctx->Scissor.Enabled = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_SCISSOR;
}
break;
case GL_SHARED_TEXTURE_PALETTE_EXT:
ctx->Texture.SharedPalette = state;
+ ctx->NewState |= _NEW_TEXTURE;
break;
case GL_STENCIL_TEST:
if (state && ctx->Visual.StencilBits==0) {
}
if (ctx->Stencil.Enabled!=state) {
ctx->Stencil.Enabled = state;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_STENCIL;
ctx->TriangleCaps ^= DD_STENCIL;
}
break;
if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- ctx->NewState |= NEW_TEXTURE_ENABLE;
+ ctx->NewState |= _NEW_TEXTURE;
if (state) {
texUnit->Enabled |= TEXTURE0_1D;
}
if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- ctx->NewState |= NEW_TEXTURE_ENABLE;
+ ctx->NewState |= _NEW_TEXTURE;
if (state) {
texUnit->Enabled |= TEXTURE0_2D;
}
if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- ctx->NewState |= NEW_TEXTURE_ENABLE;
+ ctx->NewState |= _NEW_TEXTURE;
if (state) {
texUnit->Enabled |= TEXTURE0_3D;
}
texUnit->TexGenEnabled |= Q_BIT;
else
texUnit->TexGenEnabled &= ~Q_BIT;
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
break;
case GL_TEXTURE_GEN_R:
texUnit->TexGenEnabled |= R_BIT;
else
texUnit->TexGenEnabled &= ~R_BIT;
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
break;
case GL_TEXTURE_GEN_S:
texUnit->TexGenEnabled |= S_BIT;
else
texUnit->TexGenEnabled &= ~S_BIT;
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
break;
case GL_TEXTURE_GEN_T:
texUnit->TexGenEnabled |= T_BIT;
else
texUnit->TexGenEnabled &= ~T_BIT;
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
break;
*/
case GL_VERTEX_ARRAY:
ctx->Array.Vertex.Enabled = state;
- break;
+ ctx->NewState |= _NEW_ARRAY;
+ break;
case GL_NORMAL_ARRAY:
ctx->Array.Normal.Enabled = state;
+ ctx->NewState |= _NEW_ARRAY;
break;
case GL_COLOR_ARRAY:
ctx->Array.Color.Enabled = state;
+ ctx->NewState |= _NEW_ARRAY;
break;
case GL_INDEX_ARRAY:
ctx->Array.Index.Enabled = state;
+ ctx->NewState |= _NEW_ARRAY;
break;
case GL_TEXTURE_COORD_ARRAY:
ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled = state;
+ ctx->NewState |= _NEW_ARRAY;
break;
case GL_EDGE_FLAG_ARRAY:
ctx->Array.EdgeFlag.Enabled = state;
+ ctx->NewState |= _NEW_ARRAY;
break;
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
ctx->Depth.OcclusionTest = state;
+ ctx->NewState |= _NEW_DEPTH;
if (state)
ctx->OcclusionResult = ctx->OcclusionResultSaved;
else
ctx->OcclusionResultSaved = ctx->OcclusionResult;
- ctx->NewState |= NEW_RASTER_OPS;
}
else {
gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
case GL_PIXEL_TEXTURE_SGIS:
/* XXX check for extension */
ctx->Pixel.PixelTextureEnabled = state;
+ ctx->NewState |= _NEW_PIXEL;
break;
/* GL_SGIX_pixel_texture */
case GL_PIXEL_TEX_GEN_SGIX:
/* XXX check for extension */
ctx->Pixel.PixelTextureEnabled = state;
+ ctx->NewState |= _NEW_PIXEL;
break;
/* GL_SGI_color_table */
/* XXX check for extension */
ctx->Pixel.ColorTableEnabled = state;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
break;
case GL_POST_CONVOLUTION_COLOR_TABLE_SGI:
ctx->Pixel.PostConvolutionColorTableEnabled = state;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
break;
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
ctx->Pixel.PostColorMatrixColorTableEnabled = state;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
break;
/* GL_EXT_convolution */
/* XXX check for extension */
ctx->Pixel.Convolution1DEnabled = state;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
break;
case GL_CONVOLUTION_2D:
ctx->Pixel.Convolution2DEnabled = state;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
break;
case GL_SEPARABLE_2D:
ctx->Pixel.Separable2DEnabled = state;
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
break;
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
if (ctx->Visual.RGBAflag) {
const GLuint curr = ctx->Texture.CurrentUnit;
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr];
- ctx->NewState |= NEW_TEXTURE_ENABLE;
+ ctx->NewState |= _NEW_TEXTURE;
if (state) {
texUnit->Enabled |= TEXTURE0_CUBE;
}
SET_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
else if (ctx->Light.Model.ColorControl == GL_SINGLE_COLOR)
CLEAR_BITS(ctx->TriangleCaps, DD_SEPERATE_SPECULAR);
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_FOG;
break;
default:
case GL_FOG:
return ctx->Fog.Enabled;
case GL_HISTOGRAM:
- if (ctx->Extensions.HaveHistogram) {
+ if (ctx->Extensions.EXT_histogram) {
return ctx->Pixel.HistogramEnabled;
}
else {
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
return ctx->Depth.OcclusionTest;
}
else {
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
return (texUnit->Enabled & TEXTURE0_CUBE) ? GL_TRUE : GL_FALSE;
}
gl_error( ctx, GL_INVALID_ENUM, "glEnable/DisableClientState" );
}
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
-/* $Id: eval.c,v 1.13 2000/10/29 18:12:15 brianp Exp $ */
+/* $Id: eval.c,v 1.14 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
default:
gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" );
}
+
+ ctx->NewState |= _NEW_EVAL;
}
default:
gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" );
}
+
+ ctx->NewState |= _NEW_EVAL;
}
ctx->Eval.MapGrid1u1 = u1;
ctx->Eval.MapGrid1u2 = u2;
ctx->Eval.MapGrid1du = (u2 - u1) / (GLfloat) un;
+
+ ctx->NewState |= _NEW_EVAL;
}
ctx->Eval.MapGrid2v1 = v1;
ctx->Eval.MapGrid2v2 = v2;
ctx->Eval.MapGrid2dv = (v2 - v1) / (GLfloat) vn;
+
+ ctx->NewState |= _NEW_EVAL;
}
-
/* KW: If are compiling, we don't know whether eval will produce a
* vertex when it is run in the future. If this is pure immediate
* mode, eval is a noop if neither vertex map is enabled.
-
void
_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
{
-/* $Id: extensions.c,v 1.38 2000/10/27 18:31:22 brianp Exp $ */
+/* $Id: extensions.c,v 1.39 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
struct extension {
struct extension *next, *prev;
GLint enabled;
+ GLboolean *flag; /* optional flag stored elsewhere */
char name[MAX_EXT_NAMELEN+1];
void (*notify)( GLcontext *, GLboolean );
};
-
-
-static struct { int enabled; const char *name; } default_extensions[] = {
- { DEFAULT_ON, "GL_ARB_imaging" },
- { DEFAULT_ON, "GL_ARB_multitexture" },
- { DEFAULT_OFF, "GL_ARB_texture_compression" },
- { DEFAULT_OFF, "GL_ARB_texture_cube_map" },
- { DEFAULT_ON, "GL_ARB_texture_env_add" },
- { ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" },
- { ALWAYS_ENABLED, "GL_EXT_abgr" },
- { DEFAULT_OFF, "GL_EXT_bgra" },
- { DEFAULT_ON, "GL_EXT_blend_color" },
- { DEFAULT_ON, "GL_EXT_blend_func_separate" },
- { DEFAULT_ON, "GL_EXT_blend_logic_op" },
- { DEFAULT_ON, "GL_EXT_blend_minmax" },
- { DEFAULT_ON, "GL_EXT_blend_subtract" },
- { DEFAULT_ON, "GL_EXT_clip_volume_hint" },
- { DEFAULT_OFF, "GL_EXT_cull_vertex" },
- { DEFAULT_ON, "GL_EXT_convolution" },
- { DEFAULT_ON, "GL_EXT_compiled_vertex_array" },
- { DEFAULT_ON, "GL_EXT_fog_coord" },
- { DEFAULT_ON, "GL_EXT_histogram" },
- { DEFAULT_ON, "GL_EXT_packed_pixels" },
- { DEFAULT_ON, "GL_EXT_paletted_texture" },
- { DEFAULT_ON, "GL_EXT_point_parameters" },
- { ALWAYS_ENABLED, "GL_EXT_polygon_offset" },
- { ALWAYS_ENABLED, "GL_EXT_rescale_normal" },
- { DEFAULT_ON, "GL_EXT_secondary_color" },
- { DEFAULT_ON, "GL_EXT_shared_texture_palette" },
- { DEFAULT_ON, "GL_EXT_stencil_wrap" },
- { DEFAULT_ON, "GL_EXT_texture3D" },
- { DEFAULT_OFF, "GL_EXT_texture_compression_s3tc" },
- { DEFAULT_ON, "GL_EXT_texture_env_add" },
- { DEFAULT_OFF, "GL_EXT_texture_env_combine" },
- { ALWAYS_ENABLED, "GL_EXT_texture_object" },
- { DEFAULT_ON, "GL_EXT_texture_lod_bias" },
- { ALWAYS_ENABLED, "GL_EXT_vertex_array" },
- { DEFAULT_OFF, "GL_EXT_vertex_array_set" },
- { DEFAULT_OFF, "GL_HP_occlusion_test" },
- { DEFAULT_ON, "GL_INGR_blend_func_separate" },
- { ALWAYS_ENABLED, "GL_MESA_window_pos" },
- { ALWAYS_ENABLED, "GL_MESA_resize_buffers" },
- { DEFAULT_OFF, "GL_NV_blend_square" },
- { ALWAYS_ENABLED, "GL_NV_texgen_reflection" },
- { DEFAULT_ON, "GL_PGI_misc_hints" },
- { DEFAULT_ON, "GL_SGI_color_matrix" },
- { DEFAULT_ON, "GL_SGI_color_table" },
- { DEFAULT_ON, "GL_SGIS_pixel_texture" },
- { DEFAULT_ON, "GL_SGIS_texture_edge_clamp" },
- { DEFAULT_ON, "GL_SGIX_pixel_texture" },
- { DEFAULT_OFF, "GL_3DFX_texture_compression_FXT1" }
+#define F(x) (int)&(((struct gl_extensions *)0)->x)
+#define ON GL_TRUE
+#define OFF GL_FALSE
+
+static struct {
+ GLboolean enabled;
+ const char *name;
+ int flag_offset;
+} default_extensions[] = {
+ { ON, "GL_ARB_imaging", F(ARB_imaging) },
+ { ON, "GL_ARB_multitexture", F(ARB_multitexture) },
+ { OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) },
+ { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) },
+ { ON, "GL_ARB_texture_env_add", F(ARB_texture_env_add) },
+ { ON, "GL_ARB_tranpose_matrix", 0 },
+ { ON, "GL_EXT_abgr", 0 },
+ { OFF, "GL_EXT_bgra", 0 },
+ { ON, "GL_EXT_blend_color", F(EXT_blend_color) },
+ { ON, "GL_EXT_blend_func_separate", F(EXT_blend_func_separate) },
+ { ON, "GL_EXT_blend_logic_op", F(EXT_blend_logic_op) },
+ { ON, "GL_EXT_blend_minmax", F(EXT_blend_minmax) },
+ { ON, "GL_EXT_blend_subtract", F(EXT_blend_subtract) },
+ { ON, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) },
+ { OFF, "GL_EXT_cull_vertex", 0 },
+ { ON, "GL_EXT_convolution", F(EXT_convolution) },
+ { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) },
+ { ON, "GL_EXT_fog_coord", F(EXT_fog_coord) },
+ { ON, "GL_EXT_histogram", F(EXT_histogram) },
+ { ON, "GL_EXT_packed_pixels", F(EXT_packed_pixels) },
+ { ON, "GL_EXT_paletted_texture", F(EXT_paletted_texture) },
+ { ON, "GL_EXT_point_parameters", F(EXT_point_parameters) },
+ { ON, "GL_EXT_polygon_offset", F(EXT_polygon_offset) },
+ { ON, "GL_EXT_rescale_normal", F(EXT_rescale_normal) },
+ { ON, "GL_EXT_secondary_color", F(EXT_secondary_color) },
+ { ON, "GL_EXT_shared_texture_palette", F(EXT_shared_texture_palette) },
+ { ON, "GL_EXT_stencil_wrap", F(EXT_stencil_wrap) },
+ { ON, "GL_EXT_texture3D", F(EXT_texture3D) },
+ { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) },
+ { ON, "GL_EXT_texture_env_add", F(EXT_texture_env_add) },
+ { OFF, "GL_EXT_texture_env_combine", F(EXT_texture_env_combine) },
+ { ON, "GL_EXT_texture_object", F(EXT_texture_object) },
+ { ON, "GL_EXT_texture_lod_bias", F(EXT_texture_lod_bias) },
+ { ON, "GL_EXT_vertex_array", 0 },
+ { OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) },
+ { OFF, "GL_HP_occlusion_test", F(HP_occlusion_test) },
+ { ON, "GL_INGR_blend_func_separate", F(INGR_blend_func_separate) },
+ { ON, "GL_MESA_window_pos", F(MESA_window_pos) },
+ { ON, "GL_MESA_resize_buffers", F(MESA_resize_buffers) },
+ { OFF, "GL_NV_blend_square", F(NV_blend_square) },
+ { ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
+ { ON, "GL_PGI_misc_hints", F(PGI_misc_hints) },
+ { ON, "GL_SGI_color_matrix", F(SGI_color_matrix) },
+ { ON, "GL_SGI_color_table", F(SGI_color_table) },
+ { ON, "GL_SGIS_pixel_texture", F(SGIS_pixel_texture) },
+ { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) },
+ { ON, "GL_SGIX_pixel_texture", F(SGIX_pixel_texture) },
+ { OFF, "GL_3DFX_texture_compression_FXT1", F(_3DFX_texture_compression_FXT1) }
};
-/*
- * Update the boolean convenience flags in the Extensions struct.
- */
-static void
-update_extension_flags( GLcontext *ctx )
-{
- /* Update flags */
- ctx->Extensions.HaveBlendMinmax = gl_extension_is_enabled(ctx, "GL_EXT_blend_minmax") || gl_extension_is_enabled(ctx, "GL_ARB_imaging");
- ctx->Extensions.HaveBlendSquare = gl_extension_is_enabled(ctx, "GL_NV_blend_square");
- ctx->Extensions.HaveBlendSubtract = gl_extension_is_enabled(ctx, "GL_EXT_blend_subtract") || gl_extension_is_enabled(ctx, "GL_ARB_imaging");
- ctx->Extensions.HaveHistogram = gl_extension_is_enabled(ctx, "GL_EXT_histogram") || gl_extension_is_enabled(ctx, "GL_ARB_imaging");
- ctx->Extensions.HaveHpOcclusionTest = gl_extension_is_enabled(ctx, "GL_HP_occlusion_test");
- ctx->Extensions.HaveStencilWrap = gl_extension_is_enabled(ctx, "GL_EXT_stencil_wrap");
- ctx->Extensions.HaveTextureEnvAdd = gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add") || gl_extension_is_enabled(ctx, "GL_ARB_texture_env_add");
- ctx->Extensions.HaveTextureEnvCombine = gl_extension_is_enabled(ctx, "GL_EXT_texture_env_combine");
- ctx->Extensions.HaveTextureCubeMap = gl_extension_is_enabled(ctx, "GL_ARB_texture_cube_map");
- ctx->Extensions.HaveTextureCompression = gl_extension_is_enabled(ctx, "GL_ARB_texture_compression");
- ctx->Extensions.HaveTextureCompressionFXT1 = gl_extension_is_enabled(ctx, "GL_3DFX_texture_compression_FXT1");
- ctx->Extensions.HaveTextureCompressionS3TC = gl_extension_is_enabled(ctx, "GL_EXT_texture_compression_s3tc");
- ctx->Extensions.HaveTextureLodBias = gl_extension_is_enabled(ctx, "GL_EXT_texture_lod_bias");
-}
int gl_extensions_add( GLcontext *ctx,
- int state,
+ GLboolean enabled,
const char *name,
- void (*notify)(void) )
+ GLboolean *flag_ptr )
{
- (void) notify;
-
if (ctx->Extensions.ext_string == 0)
{
struct extension *t = MALLOC_STRUCT(extension);
- t->enabled = state;
+ t->enabled = enabled;
strncpy(t->name, name, MAX_EXT_NAMELEN);
t->name[MAX_EXT_NAMELEN] = 0;
- t->notify = (void (*)(GLcontext *, GLboolean)) notify;
+ t->flag = flag_ptr;
insert_at_tail( ctx->Extensions.ext_list, t );
return 0;
}
if (i == ctx->Extensions.ext_list)
return 1;
- if (!(i->enabled & ALWAYS_ENABLED)) {
- if (i->notify) i->notify( ctx, state );
- i->enabled = state;
- }
-
- update_extension_flags(ctx);
-
+ if (i->flag) *(i->flag) = state;
+ i->enabled = state;
return 0;
}
void gl_extensions_ctr( GLcontext *ctx )
{
GLuint i;
+ GLboolean *base = (GLboolean *)&ctx->Extensions;
ctx->Extensions.ext_string = 0;
ctx->Extensions.ext_list = MALLOC_STRUCT(extension);
make_empty_list( ctx->Extensions.ext_list );
for (i = 0 ; i < Elements(default_extensions) ; i++) {
+ GLboolean *ptr = 0;
+
+ if (default_extensions[i].flag_offset)
+ ptr = base + default_extensions[i].flag_offset;
+
gl_extensions_add( ctx,
default_extensions[i].enabled,
default_extensions[i].name,
- 0 );
+ ptr);
}
- update_extension_flags(ctx);
}
-/* $Id: extensions.h,v 1.8 2000/03/07 18:24:14 brianp Exp $ */
+/* $Id: extensions.h,v 1.9 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "types.h"
-#define DEFAULT_OFF 0x0
-#define DEFAULT_ON 0x1
-#define ALWAYS_ENABLED 0x2
/* Return 0 on success.
*/
-extern int gl_extensions_add( GLcontext *ctx, int state,
- const char *name, void (*notify)( void ) );
+extern int gl_extensions_add( GLcontext *ctx, GLboolean enabled,
+ const char *name, GLboolean *flag_ptr );
extern int gl_extensions_enable( GLcontext *ctx, const char *name );
extern int gl_extensions_disable( GLcontext *ctx, const char *name );
-/* $Id: feedback.c,v 1.13 2000/10/28 20:41:14 brianp Exp $ */
+/* $Id: feedback.c,v 1.14 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Feedback.BufferSize = size;
ctx->Feedback.Buffer = buffer;
ctx->Feedback.Count = 0;
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
}
ctx->Select.HitFlag = GL_FALSE;
ctx->Select.HitMinZ = 1.0;
ctx->Select.HitMaxZ = 0.0;
+
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
}
ctx->Select.HitFlag = GL_FALSE;
ctx->Select.HitMinZ = 1.0;
ctx->Select.HitMaxZ = 0.0;
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
}
else {
ctx->Select.NameStack[MAX_NAME_STACK_DEPTH-1] = name;
}
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
}
else {
gl_error( ctx, GL_STACK_OVERFLOW, "glPushName" );
}
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
}
else {
gl_error( ctx, GL_STACK_UNDERFLOW, "glPopName" );
}
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
}
ctx->Select.BufferCount = 0;
ctx->Select.Hits = 0;
ctx->Select.NameStackDepth = 0;
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
break;
case GL_FEEDBACK:
if (ctx->Feedback.Count > ctx->Feedback.BufferSize) {
result = ctx->Feedback.Count;
}
ctx->Feedback.Count = 0;
+ ctx->NewState |= _NEW_FEEDBACK_SELECT;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glRenderMode" );
}
ctx->RenderMode = mode;
- ctx->NewState |= NEW_ALL;
+ ctx->NewState |= _NEW_RENDERMODE;
return result;
}
-/* $Id: fog.c,v 1.25 2000/10/28 20:41:14 brianp Exp $ */
+/* $Id: fog.c,v 1.26 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
(*ctx->Driver.Fogfv)( ctx, pname, params );
}
- ctx->NewState |= NEW_FOG;
+ ctx->NewState |= _NEW_FOG;
}
-/* $Id: get.c,v 1.38 2000/10/29 19:02:23 brianp Exp $ */
+/* $Id: get.c,v 1.39 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
break;
case GL_HISTOGRAM:
- if (ctx->Extensions.HaveHistogram) {
+ if (ctx->Extensions.EXT_histogram) {
*params = ctx->Pixel.HistogramEnabled;
}
else {
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
else
gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
return;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = INT_TO_BOOL(textureUnit->CurrentCubeMap->Name);
else
gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
return;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = INT_TO_BOOL(ctx->Const.MaxCubeTextureSize);
else
gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = INT_TO_BOOL(ctx->Hint.TextureCompression);
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = INT_TO_BOOL(ctx->Const.NumCompressedTextureFormats);
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
GLuint i;
for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
params[i] = INT_TO_BOOL(ctx->Const.CompressedTextureFormats[i]);
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
*params = ctx->Depth.OcclusionTest;
}
else {
}
return;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
if (ctx->Depth.OcclusionTest)
*params = ctx->OcclusionResult;
else
*params = (GLdouble) ctx->Pixel.GreenScale;
break;
case GL_HISTOGRAM:
- if (ctx->Extensions.HaveHistogram) {
+ if (ctx->Extensions.EXT_histogram) {
*params = (GLdouble) ctx->Pixel.HistogramEnabled;
}
else {
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLdouble) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
else
gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
return;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLdouble) textureUnit->CurrentCubeMap->Name;
else
gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
return;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLdouble) ctx->Const.MaxCubeTextureSize;
else
gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLdouble) ctx->Hint.TextureCompression;
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLdouble) ctx->Const.NumCompressedTextureFormats;
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
GLuint i;
for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
params[i] = (GLdouble) ctx->Const.CompressedTextureFormats[i];
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
*params = (GLdouble) ctx->Depth.OcclusionTest;
}
else {
}
return;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
if (ctx->Depth.OcclusionTest)
*params = (GLdouble) ctx->OcclusionResult;
else
*params = (GLfloat) ctx->Pixel.GreenScale;
break;
case GL_HISTOGRAM:
- if (ctx->Extensions.HaveHistogram) {
+ if (ctx->Extensions.EXT_histogram) {
*params = (GLfloat) ctx->Pixel.HistogramEnabled;
}
else {
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLfloat) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
else
gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
return;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLfloat) textureUnit->CurrentCubeMap->Name;
else
gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
return;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLfloat) ctx->Const.MaxCubeTextureSize;
else
gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLfloat) ctx->Hint.TextureCompression;
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLfloat) ctx->Const.NumCompressedTextureFormats;
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
GLuint i;
for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
params[i] = (GLfloat) ctx->Const.CompressedTextureFormats[i];
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
*params = (GLfloat) ctx->Depth.OcclusionTest;
}
else {
}
return;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
if (ctx->Depth.OcclusionTest)
*params = (GLfloat) ctx->OcclusionResult;
else
*params = (GLint) ctx->Pixel.GreenScale;
break;
case GL_HISTOGRAM:
- if (ctx->Extensions.HaveHistogram) {
+ if (ctx->Extensions.EXT_histogram) {
*params = (GLint) ctx->Pixel.HistogramEnabled;
}
else {
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = (GLint) _mesa_IsEnabled(GL_TEXTURE_CUBE_MAP_ARB);
else
gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
return;
case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = textureUnit->CurrentCubeMap->Name;
else
gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
return;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
*params = ctx->Const.MaxCubeTextureSize;
else
gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLint) ctx->Hint.TextureCompression;
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLint) ctx->Const.NumCompressedTextureFormats;
}
else
gl_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
break;
case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
GLuint i;
for (i = 0; i < ctx->Const.NumCompressedTextureFormats; i++)
params[i] = (GLint) ctx->Const.CompressedTextureFormats[i];
/* GL_HP_occlusion_test */
case GL_OCCLUSION_TEST_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
*params = (GLint) ctx->Depth.OcclusionTest;
}
else {
}
return;
case GL_OCCLUSION_TEST_RESULT_HP:
- if (ctx->Extensions.HaveHpOcclusionTest) {
+ if (ctx->Extensions.HP_occlusion_test) {
if (ctx->Depth.OcclusionTest)
*params = (GLint) ctx->OcclusionResult;
else
-/* $Id: hint.c,v 1.4 2000/05/23 20:10:50 brianp Exp $ */
+/* $Id: hint.c,v 1.5 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSION_HINT_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
ctx->Hint.TextureCompression = mode;
}
else {
return GL_FALSE;
}
- ctx->NewState |= NEW_ALL; /* just to be safe */
+ ctx->NewState |= _NEW_HINT;
if (ctx->Driver.Hint) {
(*ctx->Driver.Hint)( ctx, target, mode );
-/* $Id: light.c,v 1.21 2000/10/29 19:02:23 brianp Exp $ */
+/* $Id: light.c,v 1.22 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
SET_BITS(ctx->TriangleCaps, DD_FLATSHADE);
else
CLEAR_BITS(ctx->TriangleCaps, DD_FLATSHADE);
- ctx->NewState |= NEW_RASTER_OPS;
+
+ ctx->NewState |= _NEW_LIGHT;
+
if (ctx->Driver.ShadeModel)
(*ctx->Driver.ShadeModel)( ctx, mode );
}
if (ctx->Driver.Lightfv)
ctx->Driver.Lightfv( ctx, light, pname, params, nParams );
- ctx->NewState |= NEW_LIGHTING;
+ ctx->NewState |= _NEW_LIGHT;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glLightModel(param)" );
}
- ctx->NewState |= NEW_RASTER_OPS;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glLightModel" );
if (ctx->Driver.LightModelfv)
ctx->Driver.LightModelfv( ctx, pname, params );
- ctx->NewState |= NEW_LIGHTING;
+ ctx->NewState |= _NEW_LIGHT;
}
if (ctx->Light.ColorMaterialEnabled)
gl_update_color_material( ctx, ctx->Current.Color );
+
+ ctx->NewState |= _NEW_LIGHT;
}
-#if 0
-static void
-gl_reinit_light_attrib( GLcontext *ctx, struct gl_light_attrib *l )
-{
- GLuint i;
-
- if (ctx->ShineTable[0]->shininess != l->Material[0].Shininess) {
- gl_compute_shine_table( ctx, 0, l->Material[0].Shininess );
- gl_compute_shine_table( ctx, 2, l->Material[0].Shininess * .5 );
- }
-
- if (ctx->ShineTable[1]->shininess != l->Material[1].Shininess) {
- gl_compute_shine_table( ctx, 1, l->Material[1].Shininess );
- gl_compute_shine_table( ctx, 3, l->Material[1].Shininess * .5 );
- }
-
- make_empty_list( &l->EnabledList );
- for (i = 0 ; i < MAX_LIGHTS ; i++) {
- if (l->Light[i].Enabled)
- insert_at_tail( &l->EnabledList, &l->Light[i] );
- }
-}
-#endif
-
/*
* Examine current lighting parameters to determine if the optimized lighting
void
gl_update_normal_transform( GLcontext *ctx )
{
- GLuint new_flag = 0;
- normal_func *last = ctx->NormalTransform;
-
ctx->vb_rescale_factor = 1.0;
if (ctx->NeedEyeCoords) {
MAT_FLAG_GENERAL_3D |
MAT_FLAG_PERSPECTIVE))
transform = NORM_TRANSFORM;
-
- new_flag = ctx->NewState & NEW_MODELVIEW;
ctx->vb_rescale_factor = ctx->rescale_factor;
if (ctx->Transform.Normalize) {
ctx->NormalTransform = 0;
}
}
-
- if (last != ctx->NormalTransform || new_flag)
- ctx->NewState |= NEW_NORMAL_TRANSFORM;
}
-/* $Id: lines.c,v 1.18 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: lines.c,v 1.19 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Line.Width = width;
ctx->TriangleCaps &= ~DD_LINE_WIDTH;
if (width != 1.0) ctx->TriangleCaps |= DD_LINE_WIDTH;
- ctx->NewState |= NEW_RASTER_OPS;
+
+ ctx->NewState |= _NEW_LINE;
+
if (ctx->Driver.LineWidth)
(*ctx->Driver.LineWidth)(ctx, width);
}
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple");
ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
ctx->Line.StipplePattern = pattern;
- ctx->NewState |= NEW_RASTER_OPS;
+
+ ctx->NewState |= _NEW_LINE;
if (ctx->Driver.LineStipple)
ctx->Driver.LineStipple( ctx, factor, pattern );
/*
* Determine which line drawing function to use given the current
* rendering context.
+ *
+ * Please update the summary flag _SWRAST_NEW_LINE if you add or remove
+ * tests to this code.
*/
void gl_set_line_function( GLcontext *ctx )
{
}
else if (ctx->Texture.ReallyEnabled) {
if (ctx->Texture.MultiTextureEnabled
- || ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
+ || ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR
+ || ctx->Fog.ColorSumEnabled) {
/* multi-texture and/or separate specular color */
if (ctx->Light.ShadeModel==GL_SMOOTH)
ctx->Driver.LineFunc = smooth_multitextured_line;
-/* $Id: matrix.c,v 1.22 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: matrix.c,v 1.23 2000/10/30 13:32:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
{
fprintf(stderr, "Matrix type: %s, flags: %x\n", types[m->type], m->flags);
print_matrix_floats(m->m);
-#if 1
fprintf(stderr, "Inverse: \n");
if (m->inv) {
GLfloat prod[16];
else {
fprintf(stderr, " - not available\n");
}
-#endif
}
/* Multiply two matrices known to occupy only the top three rows,
* such as typical modelling matrices, and ortho matrices.
- *
- * KW: 3*9 = 27 muls
*/
static void matmul34( GLfloat *product, const GLfloat *a, const GLfloat *b )
{
static GLboolean matrix_invert( GLmatrix *mat )
{
if (inv_mat_tab[mat->type](mat)) {
-#if 0
- GLmatrix m; m.inv = 0; m.type = 0; m.flags = 0;
- matmul4( m.m, mat->m, mat->inv );
- printf("inverted matrix of type %s:\n", types[mat->type]);
- gl_print_matrix( mat );
- gl_print_matrix( &m );
-#endif
return GL_TRUE;
} else {
MEMCPY( mat->inv, Identity, sizeof(Identity) );
}
-/*
- * Multiply a matrix by an array of floats with known properties.
- */
-#if 000
-static void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *m )
-{
- mat->flags |= (m->flags |
- MAT_DIRTY_TYPE |
- MAT_DIRTY_INVERSE |
- MAT_DIRTY_DEPENDENTS);
-
- if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D))
- matmul34( mat->m, mat->m, m->m );
- else
- matmul4( mat->m, mat->m, m->m );
-}
-#endif
-
-
static void matrix_copy( GLmatrix *to, const GLmatrix *from )
{
MEMCPY( to->m, from->m, sizeof(Identity) );
}
}
-#if 0
-void gl_matrix_set_identity( GLmatrix *m )
-{
- MEMCPY( m->m, Identity, sizeof(Identity) );
- m->type = MATRIX_IDENTITY;
- m->flags = MAT_DIRTY_DEPENDENTS;
-}
-#endif
void gl_matrix_alloc_inv( GLmatrix *m )
{
switch (ctx->Transform.MatrixMode) { \
case GL_MODELVIEW: \
mat = &ctx->ModelView; \
- flags |= NEW_MODELVIEW; \
+ flags |= _NEW_MODELVIEW; \
break; \
case GL_PROJECTION: \
mat = &ctx->ProjectionMatrix; \
- flags |= NEW_PROJECTION; \
+ flags |= _NEW_PROJECTION; \
break; \
case GL_TEXTURE: \
mat = &ctx->TextureMatrix[ctx->Texture.CurrentTransformUnit]; \
- flags |= NEW_TEXTURE_MATRIX; \
+ flags |= _NEW_TEXTURE_MATRIX; \
break; \
case GL_COLOR: \
mat = &ctx->ColorMatrix; \
- flags |= NEW_COLOR_MATRIX; \
+ flags |= _NEW_COLOR_MATRIX; \
break; \
default: \
gl_problem(ctx, where); \
}
matrix_copy( &ctx->ModelView,
&ctx->ModelViewStack[--ctx->ModelViewStackDepth] );
- ctx->NewState |= NEW_MODELVIEW;
+ ctx->NewState |= _NEW_MODELVIEW;
break;
case GL_PROJECTION:
if (ctx->ProjectionStackDepth==0) {
matrix_copy( &ctx->ProjectionMatrix,
&ctx->ProjectionStack[--ctx->ProjectionStackDepth] );
- ctx->NewState |= NEW_PROJECTION;
+ ctx->NewState |= _NEW_PROJECTION;
/* Device driver near/far values */
{
}
matrix_copy(&ctx->TextureMatrix[t],
&ctx->TextureStack[t][--ctx->TextureStackDepth[t]]);
+ ctx->NewState |= _NEW_TEXTURE_MATRIX;
}
break;
case GL_COLOR:
}
matrix_copy(&ctx->ColorMatrix,
&ctx->ColorStack[--ctx->ColorStackDepth]);
+ ctx->NewState |= _NEW_COLOR_MATRIX;
break;
default:
gl_problem(ctx, "Bad matrix mode in gl_PopMatrix");
ctx->Viewport.WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
ctx->Viewport.WindowMap.type = MATRIX_3D_NO_ROT;
-
- ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
- ctx->NewState |= NEW_VIEWPORT;
+ ctx->NewState |= _NEW_VIEWPORT;
/* Check if window/buffer has been resized and if so, reallocate the
* ancillary buffers.
ctx->Viewport.Far = f;
ctx->Viewport.WindowMap.m[MAT_SZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0);
ctx->Viewport.WindowMap.m[MAT_TZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0 + n);
-
- ctx->ModelProjectWinMatrixUptodate = GL_FALSE;
+ ctx->NewState |= _NEW_VIEWPORT;
if (ctx->Driver.DepthRange) {
(*ctx->Driver.DepthRange)( ctx, nearval, farval );
-/* $Id: pixel.c,v 1.16 2000/10/29 18:12:15 brianp Exp $ */
+/* $Id: pixel.c,v 1.17 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Pixel.ZoomX = xfactor;
ctx->Pixel.ZoomY = yfactor;
+ ctx->NewState |= _NEW_PIXEL;
}
default:
gl_error( ctx, GL_INVALID_ENUM, "glPixelStore" );
}
+
+ ctx->NewState |= _NEW_PACKUNPACK;
}
default:
gl_error( ctx, GL_INVALID_ENUM, "glPixelMapfv(map)" );
}
+ ctx->NewState |= _NEW_PIXEL;
}
/* signal to recompute the bitmask */
ctx->ImageTransferState = UPDATE_IMAGE_TRANSFER_STATE;
+ ctx->NewState |= _NEW_PIXEL;
}
-/* $Id: points.c,v 1.17 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: points.c,v 1.18 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->TriangleCaps &= ~DD_POINT_SIZE;
if (size != 1.0)
ctx->TriangleCaps |= DD_POINT_SIZE;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_POINT;
}
}
if (tmp != ctx->Point.Attenuated) {
ctx->Enabled ^= ENABLE_POINT_ATTEN;
ctx->TriangleCaps ^= DD_POINT_ATTEN;
- ctx->NewState |= NEW_RASTER_OPS;
}
}
break;
return;
}
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_POINT;
}
-/* $Id: polygon.c,v 1.13 2000/10/21 00:02:47 brianp Exp $ */
+/* $Id: polygon.c,v 1.14 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
}
ctx->Polygon.CullFaceMode = mode;
- ctx->NewState |= NEW_POLYGON;
+ ctx->NewState |= _NEW_POLYGON;
if (ctx->Driver.CullFace)
ctx->Driver.CullFace( ctx, mode );
ctx->Polygon.FrontFace = mode;
ctx->Polygon.FrontBit = (GLboolean) (mode == GL_CW);
- ctx->NewState |= NEW_POLYGON;
+ ctx->NewState |= _NEW_POLYGON;
if (ctx->Driver.FrontFace)
ctx->Driver.FrontFace( ctx, mode );
ctx->TriangleCaps |= DD_TRI_UNFILLED;
}
- ctx->NewState |= (NEW_POLYGON | NEW_RASTER_OPS);
+ ctx->NewState |= _NEW_POLYGON;
if (ctx->Driver.PolygonMode) {
(*ctx->Driver.PolygonMode)( ctx, face, mode );
_mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
- if (ctx->Polygon.StippleFlag) {
- ctx->NewState |= NEW_RASTER_OPS;
- }
+ ctx->NewState |= _NEW_POLYGONSTIPPLE;
if (ctx->Driver.PolygonStipple)
ctx->Driver.PolygonStipple( ctx, (const GLubyte *) ctx->PolygonStipple );
ctx->Polygon.OffsetFactor = factor;
ctx->Polygon.OffsetUnits = units;
ctx->Polygon.OffsetMRD = units * ctx->Visual.MRD;
+ ctx->NewState |= _NEW_POLYGON;
}
-/* $Id: state.c,v 1.36 2000/10/29 18:12:15 brianp Exp $ */
+/* $Id: state.c,v 1.37 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
void gl_print_state( const char *msg, GLuint state )
{
fprintf(stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg,
state,
- (state & NEW_LIGHTING) ? "lighting, " : "",
- (state & NEW_RASTER_OPS) ? "raster-ops, " : "",
- (state & NEW_TEXTURING) ? "texturing, " : "",
- (state & NEW_POLYGON) ? "polygon, " : "",
- (state & NEW_MODELVIEW) ? "modelview, " : "",
- (state & NEW_PROJECTION) ? "projection, " : "",
- (state & NEW_TEXTURE_MATRIX) ? "texture-matrix, " : "",
- (state & NEW_USER_CLIP) ? "user-clip, " : "",
- (state & NEW_TEXTURE_ENV) ? "texture-env, " : "",
- (state & NEW_CLIENT_STATE) ? "client-state, " : "",
- (state & NEW_FOG) ? "fog, " : "",
- (state & NEW_NORMAL_TRANSFORM) ? "normal-transform, " : "",
- (state & NEW_VIEWPORT) ? "viewport, " : "",
- (state & NEW_TEXTURE_ENABLE) ? "texture-enable, " : "");
+ (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
+ (state & _NEW_PROJECTION) ? "ctx->Projection, " : "",
+ (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
+ (state & _NEW_COLOR_MATRIX) ? "ctx->ColorMatrix, " : "",
+ (state & _NEW_ACCUM) ? "ctx->Accum, " : "",
+ (state & _NEW_COLOR) ? "ctx->Color, " : "",
+ (state & _NEW_DEPTH) ? "ctx->Depth, " : "",
+ (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "",
+ (state & _NEW_FOG) ? "ctx->Fog, " : "",
+ (state & _NEW_HINT) ? "ctx->Hint, " : "",
+ (state & _NEW_IMAGING) ? "ctx->Histogram/MinMax/Convolve/Seperable, ": "",
+ (state & _NEW_LIGHT) ? "ctx->Light, " : "",
+ (state & _NEW_LINE) ? "ctx->Line, " : "",
+ (state & _NEW_FEEDBACK_SELECT) ? "ctx->Feedback/Select, " : "",
+ (state & _NEW_PIXEL) ? "ctx->Pixel, " : "",
+ (state & _NEW_POINT) ? "ctx->Point, " : "",
+ (state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
+ (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
+ (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
+ (state & _NEW_TEXTURE) ? "ctx->Texture, " : "",
+ (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "",
+ (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "",
+ (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "",
+ (state & _NEW_ARRAY) ? "ctx->Array, " : "",
+ (state & _NEW_COLORTABLE) ? "ctx->{*}ColorTable, " : "",
+ (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "",
+ (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : "");
}
if (MESA_VERBOSE & VERBOSE_STATE)
gl_print_state("", ctx->NewState);
- if (ctx->NewState & NEW_CLIENT_STATE)
+ if (ctx->NewState & _NEW_ARRAY)
gl_update_client_state( ctx );
- if ((ctx->NewState & NEW_TEXTURE_ENABLE) &&
- (ctx->Enabled & ENABLE_TEX_ANY) != ctx->Texture.ReallyEnabled)
- ctx->NewState |= NEW_TEXTURING | NEW_RASTER_OPS;
-
- if (ctx->NewState & NEW_TEXTURE_ENV) {
- if (ctx->Texture.Unit[0].EnvMode == ctx->Texture.Unit[0].LastEnvMode &&
- ctx->Texture.Unit[1].EnvMode == ctx->Texture.Unit[1].LastEnvMode
-#if MAX_TEXTURE_UNITS > 2
- && ctx->Texture.Unit[2].EnvMode == ctx->Texture.Unit[2].LastEnvMode
-#endif
- ) {
- ctx->NewState &= ~NEW_TEXTURE_ENV;
- }
- ctx->Texture.Unit[0].LastEnvMode = ctx->Texture.Unit[0].EnvMode;
- ctx->Texture.Unit[1].LastEnvMode = ctx->Texture.Unit[1].EnvMode;
-#if MAX_TEXTURE_UNITS > 2
- ctx->Texture.Unit[2].LastEnvMode = ctx->Texture.Unit[2].EnvMode;
-#endif
- }
-
- if (ctx->NewState & NEW_TEXTURE_MATRIX) {
+ if (ctx->NewState & _NEW_TEXTURE_MATRIX) {
ctx->Enabled &= ~(ENABLE_TEXMAT0 | ENABLE_TEXMAT1 | ENABLE_TEXMAT2);
for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
}
}
- if (ctx->NewState & (NEW_TEXTURING | NEW_TEXTURE_ENABLE)) {
+ if (ctx->NewState & _NEW_TEXTURE) {
ctx->Texture.MultiTextureEnabled = GL_FALSE;
ctx->Texture.NeedNormals = GL_FALSE;
gl_update_dirty_texobjs(ctx);
}
- if (ctx->NewState & NEW_RASTER_OPS) {
+ if (ctx->NewState & _SWRAST_NEW_RASTERMASK)
update_rasterflags(ctx);
-
+
+ if (ctx->NewState & (_NEW_BUFFERS|_NEW_SCISSOR)) {
/* update scissor region */
ctx->DrawBuffer->Xmin = 0;
ctx->DrawBuffer->Ymin = 0;
}
}
- if (ctx->NewState & NEW_LIGHTING) {
+ if (ctx->NewState & _NEW_LIGHT) {
ctx->TriangleCaps &= ~(DD_TRI_LIGHT_TWOSIDE|DD_LIGHTING_CULL);
if (ctx->Light.Enabled) {
if (ctx->Light.Model.TwoSide)
}
}
- if (ctx->NewState & (NEW_POLYGON | NEW_LIGHTING)) {
+ if (ctx->NewState & (_NEW_POLYGON | _NEW_LIGHT)) {
ctx->TriangleCaps &= ~DD_TRI_CULL_FRONT_BACK;
- if (ctx->NewState & NEW_POLYGON) {
+ if (ctx->NewState & _NEW_POLYGON) {
/* Setup CullBits bitmask */
if (ctx->Polygon.CullFlag) {
ctx->backface_sign = 1;
}
}
- if (ctx->NewState & ~(NEW_CLIENT_STATE | NEW_USER_CLIP | NEW_POLYGON))
+ if (ctx->NewState & (_NEW_LIGHT|
+ _NEW_TEXTURE|
+ _NEW_FOG|
+ _NEW_POLYGON))
gl_update_clipmask(ctx);
- if (ctx->NewState & (NEW_LIGHTING|
- NEW_RASTER_OPS|
- NEW_TEXTURING|
- NEW_TEXTURE_ENABLE|
- NEW_TEXTURE_ENV|
- NEW_POLYGON|
- NEW_USER_CLIP))
+ if (ctx->NewState & ctx->Driver.UpdateStateNotify)
{
ctx->IndirectTriangles = ctx->TriangleCaps & ~ctx->Driver.TriangleCaps;
ctx->IndirectTriangles |= DD_SW_RASTERIZE;
/* Should only be calc'd when !need_eye_coords and not culling.
*/
- if (ctx->NewState & (NEW_MODELVIEW|NEW_PROJECTION)) {
- if (ctx->NewState & NEW_MODELVIEW) {
+ if (ctx->NewState & (_NEW_MODELVIEW|_NEW_PROJECTION)) {
+ if (ctx->NewState & _NEW_MODELVIEW) {
gl_matrix_analyze( &ctx->ModelView );
ctx->ProjectionMatrix.flags &= ~MAT_DIRTY_DEPENDENTS;
}
- if (ctx->NewState & NEW_PROJECTION) {
+ if (ctx->NewState & _NEW_PROJECTION) {
gl_matrix_analyze( &ctx->ProjectionMatrix );
ctx->ProjectionMatrix.flags &= ~MAT_DIRTY_DEPENDENTS;
}
gl_calculate_model_project_matrix( ctx );
- ctx->ModelProjectWinMatrixUptodate = 0;
}
- if (ctx->NewState & NEW_COLOR_MATRIX) {
+ if (ctx->NewState & _NEW_COLOR_MATRIX) {
gl_matrix_analyze( &ctx->ColorMatrix );
}
*/
if ((ctx->Enabled & (ENABLE_POINT_ATTEN | ENABLE_LIGHT | ENABLE_FOG |
ENABLE_TEXGEN0 | ENABLE_TEXGEN1 | ENABLE_TEXGEN2)) &&
- (ctx->NewState & (NEW_LIGHTING |
- NEW_FOG |
- NEW_MODELVIEW |
- NEW_PROJECTION |
- NEW_TEXTURING |
- NEW_RASTER_OPS |
- NEW_USER_CLIP)))
+ (ctx->NewState & (_NEW_LIGHT |
+ _NEW_TEXTURE |
+ _NEW_FOG |
+ _NEW_TRANSFORM |
+ _NEW_MODELVIEW |
+ _NEW_PROJECTION |
+ _NEW_POINT |
+ _NEW_RENDERMODE |
+ _NEW_TRANSFORM)))
{
GLboolean oldcoord, oldnorm;
oldnorm = ctx->NeedEyeNormals;
ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals);
- ctx->NeedEyeCoords = ((ctx->Fog.Enabled && ctx->Hint.Fog != GL_NICEST) ||
- ctx->Point.Attenuated);
+ ctx->NeedEyeCoords = (ctx->Fog.Enabled || ctx->Point.Attenuated);
ctx->NeedEyeNormals = GL_FALSE;
if (ctx->Light.Enabled) {
if (ctx->Light.Enabled) {
gl_update_lighting_function(ctx);
- if ( (ctx->NewState & NEW_LIGHTING) ||
- ((ctx->NewState & (NEW_MODELVIEW| NEW_PROJECTION)) &&
+ if ( (ctx->NewState & _NEW_LIGHT) ||
+ ((ctx->NewState & (_NEW_MODELVIEW|_NEW_PROJECTION)) &&
!ctx->NeedEyeCoords) ||
oldcoord != ctx->NeedEyeCoords ||
oldnorm != ctx->NeedEyeNormals) {
-/* $Id: stencil.c,v 1.20 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: stencil.c,v 1.21 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearStencil");
ctx->Stencil.Clear = (GLstencil) s;
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.ClearStencil) {
(*ctx->Driver.ClearStencil)( ctx, s );
maxref = (1 << STENCIL_BITS) - 1;
ctx->Stencil.Ref = (GLstencil) CLAMP( ref, 0, maxref );
ctx->Stencil.ValueMask = (GLstencil) mask;
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.StencilFunc) {
(*ctx->Driver.StencilFunc)( ctx, func, ctx->Stencil.Ref, mask );
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilMask");
ctx->Stencil.WriteMask = (GLstencil) mask;
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.StencilMask) {
(*ctx->Driver.StencilMask)( ctx, mask );
break;
case GL_INCR_WRAP_EXT:
case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.HaveStencilWrap) {
+ if (ctx->Extensions.EXT_stencil_wrap) {
ctx->Stencil.FailFunc = fail;
break;
}
break;
case GL_INCR_WRAP_EXT:
case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.HaveStencilWrap) {
+ if (ctx->Extensions.EXT_stencil_wrap) {
ctx->Stencil.ZFailFunc = zfail;
break;
}
break;
case GL_INCR_WRAP_EXT:
case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.HaveStencilWrap) {
+ if (ctx->Extensions.EXT_stencil_wrap) {
ctx->Stencil.ZPassFunc = zpass;
break;
}
return;
}
+ ctx->NewState |= _NEW_STENCIL;
+
if (ctx->Driver.StencilOp) {
(*ctx->Driver.StencilOp)(ctx, fail, zfail, zpass);
}
-/* $Id: teximage.c,v 1.55 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: teximage.c,v 1.56 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- return ctx->Extensions.HaveTextureCubeMap
+ return ctx->Extensions.ARB_texture_cube_map
? texUnit->CurrentCubeMap : NULL;
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- return ctx->Extensions.HaveTextureCubeMap
+ return ctx->Extensions.ARB_texture_cube_map
? ctx->Texture.ProxyCubeMap : NULL;
default:
gl_problem(NULL, "bad target in _mesa_select_tex_object()");
case GL_PROXY_TEXTURE_3D:
return ctx->Texture.Proxy3D->Image[level];
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return texUnit->CurrentCubeMap->Image[level];
else
return NULL;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return texUnit->CurrentCubeMap->NegX[level];
else
return NULL;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return texUnit->CurrentCubeMap->PosY[level];
else
return NULL;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return texUnit->CurrentCubeMap->NegY[level];
else
return NULL;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return texUnit->CurrentCubeMap->PosZ[level];
else
return NULL;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return texUnit->CurrentCubeMap->NegZ[level];
else
return NULL;
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap)
+ if (ctx->Extensions.ARB_texture_cube_map)
return ctx->Texture.ProxyCubeMap->Image[level];
else
return NULL;
else if (dimensions == 2) {
isProxy = (GLboolean) (target == GL_PROXY_TEXTURE_2D);
if (target != GL_TEXTURE_2D && !isProxy &&
- !(ctx->Extensions.HaveTextureCubeMap &&
+ !(ctx->Extensions.ARB_texture_cube_map &&
target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
gl_error( ctx, GL_INVALID_ENUM, "glTexImage2D(target)" );
}
}
else if (dimensions == 2) {
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
if ((target < GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB ||
target > GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) &&
target != GL_TEXTURE_2D) {
}
}
else if (dimensions == 2) {
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
if ((target < GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB ||
target > GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) &&
target != GL_TEXTURE_2D) {
}
}
else if (dimensions == 2) {
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
if ((target < GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB ||
target > GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB) &&
target != GL_TEXTURE_2D) {
char message[100];
GLint internalFormat = ifmt;
- if (ctx->Extensions.HaveTextureCompression
+ if (ctx->Extensions.ARB_texture_compression
&& ctx->Driver.SpecificCompressedTexFormat) {
/*
* First, ask the driver for the specific format.
*/
switch (internalFormat) {
case GL_COMPRESSED_ALPHA_ARB:
- if (ctx && !ctx->Extensions.HaveTextureCompression) {
+ if (ctx && !ctx->Extensions.ARB_texture_compression) {
sprintf(message, "glTexImage%dD(internalFormat)", numDimensions);
gl_error(ctx, GL_INVALID_VALUE, message);
return -1;
internalFormat = GL_ALPHA;
break;
case GL_COMPRESSED_LUMINANCE_ARB:
- if (ctx && !ctx->Extensions.HaveTextureCompression) {
+ if (ctx && !ctx->Extensions.ARB_texture_compression) {
sprintf(message, "glTexImage%dD(internalFormat)", numDimensions);
gl_error(ctx, GL_INVALID_VALUE, message);
return -1;
internalFormat = GL_LUMINANCE;
break;
case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
- if (ctx && !ctx->Extensions.HaveTextureCompression) {
+ if (ctx && !ctx->Extensions.ARB_texture_compression) {
sprintf(message, "glTexImage%dD(internalFormat)", numDimensions);
gl_error(ctx, GL_INVALID_VALUE, message);
return -1;
internalFormat = GL_LUMINANCE_ALPHA;
break;
case GL_COMPRESSED_INTENSITY_ARB:
- if (ctx && !ctx->Extensions.HaveTextureCompression) {
+ if (ctx && !ctx->Extensions.ARB_texture_compression) {
sprintf(message, "glTexImage%dD(internalFormat)", numDimensions);
gl_error(ctx, GL_INVALID_VALUE, message);
return -1;
internalFormat = GL_INTENSITY;
break;
case GL_COMPRESSED_RGB_ARB:
- if (ctx && !ctx->Extensions.HaveTextureCompression) {
+ if (ctx && !ctx->Extensions.ARB_texture_compression) {
sprintf(message, "glTexImage%dD(internalFormat)", numDimensions);
gl_error(ctx, GL_INVALID_VALUE, message);
return -1;
internalFormat = GL_RGB;
break;
case GL_COMPRESSED_RGBA_ARB:
- if (ctx && !ctx->Extensions.HaveTextureCompression) {
+ if (ctx && !ctx->Extensions.ARB_texture_compression) {
sprintf(message, "glTexImage%dD(internalFormat)", numDimensions);
gl_error(ctx, GL_INVALID_VALUE, message);
return -1;
/* state update */
gl_put_texobj_on_dirty_list( ctx, texObj );
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
adjust_texture_size_for_convolution(ctx, 2, &postConvWidth,&postConvHeight);
if (target==GL_TEXTURE_2D ||
- (ctx->Extensions.HaveTextureCubeMap &&
+ (ctx->Extensions.ARB_texture_cube_map &&
target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
struct gl_texture_unit *texUnit;
/* state update */
gl_put_texobj_on_dirty_list( ctx, texObj );
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_2D) {
/* Proxy texture: check for errors and update proxy state */
/* state update */
gl_put_texobj_on_dirty_list( ctx, texObj );
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
/* state update */
gl_put_texobj_on_dirty_list( ctx, texObj );
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_1D) {
/* Proxy texture: check for errors and update proxy state */
}
if (target==GL_TEXTURE_2D ||
- (ctx->Extensions.HaveTextureCubeMap &&
+ (ctx->Extensions.ARB_texture_cube_map &&
target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
struct gl_texture_unit *texUnit;
/* state update */
gl_put_texobj_on_dirty_list( ctx, texObj );
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_2D) {
/* Proxy texture: check for errors and update proxy state */
/* state update */
gl_put_texobj_on_dirty_list( ctx, texObj );
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
else if (target == GL_PROXY_TEXTURE_3D) {
/* Proxy texture: check for errors and update proxy state */
-/* $Id: texobj.c,v 1.30 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: texobj.c,v 1.31 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Shared->DefaultD[d]->RefCount++;
t->RefCount--;
ASSERT( t->RefCount >= 0 );
+ ctx->NewState |= _NEW_TEXTURE;
}
}
}
oldTexObj = texUnit->CurrentD[3];
break;
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
dim = 6;
oldTexObj = texUnit->CurrentCubeMap;
break;
*/
texUnit->Current = texUnit->CurrentD[texUnit->CurrentDimension];
- /* Check if we may have to use a new triangle rasterizer */
- if ((ctx->IndirectTriangles & DD_SW_RASTERIZE) &&
- ( oldTexObj->WrapS != newTexObj->WrapS
- || oldTexObj->WrapT != newTexObj->WrapT
- || oldTexObj->WrapR != newTexObj->WrapR
- || oldTexObj->MinFilter != newTexObj->MinFilter
- || oldTexObj->MagFilter != newTexObj->MagFilter
- || (oldTexObj->Image[0] && newTexObj->Image[0] &&
- (oldTexObj->Image[0]->Format!=newTexObj->Image[0]->Format))))
- {
- ctx->NewState |= (NEW_RASTER_OPS | NEW_TEXTURING);
- }
-
- if (oldTexObj->Complete != newTexObj->Complete)
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
/* Pass BindTexture call to device driver */
- if (ctx->Driver.BindTexture) {
+ if (ctx->Driver.BindTexture)
(*ctx->Driver.BindTexture)( ctx, target, newTexObj );
- /* Make sure the Driver.UpdateState() function gets called! */
- ctx->NewState |= NEW_TEXTURING;
- }
if (oldTexObj->Name > 0) {
/* never delete default (id=0) texture objects */
}
}
}
+
+ ctx->NewState |= _NEW_TEXTURE;
}
-/* $Id: texstate.c,v 1.18 2000/10/28 20:41:14 brianp Exp $ */
+/* $Id: texstate.c,v 1.19 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
case GL_ADD:
case GL_COMBINE_EXT:
if (mode == GL_ADD &&
- !ctx->Extensions.HaveTextureEnvAdd) {
+ !ctx->Extensions.EXT_texture_env_add) {
gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)");
return;
}
if (mode == GL_COMBINE_EXT &&
- !ctx->Extensions.HaveTextureEnvCombine) {
+ !ctx->Extensions.EXT_texture_env_combine) {
gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)");
return;
}
if (texUnit->EnvMode == mode)
return; /* no change */
texUnit->EnvMode = mode;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_VALUE, "glTexEnv(param)" );
texUnit->EnvColor[3] = CLAMP( param[3], 0.0F, 1.0F );
break;
case GL_COMBINE_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
GLenum mode = (GLenum) (GLint) *param;
switch (mode) {
case GL_REPLACE:
if (texUnit->CombineModeRGB == mode)
return; /* no change */
texUnit->CombineModeRGB = mode;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
}
break;
case GL_COMBINE_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
GLenum mode = (GLenum) (GLint) *param;
switch (mode) {
case GL_REPLACE:
if (texUnit->CombineModeA == mode)
return; /* no change */
texUnit->CombineModeA = mode;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
case GL_SOURCE0_RGB_EXT:
case GL_SOURCE1_RGB_EXT:
case GL_SOURCE2_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
GLenum source = (GLenum) (GLint) *param;
GLuint s = pname - GL_SOURCE0_RGB_EXT;
switch (source) {
if (texUnit->CombineSourceRGB[s] == source)
return; /* no change */
texUnit->CombineSourceRGB[s] = source;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
case GL_SOURCE0_ALPHA_EXT:
case GL_SOURCE1_ALPHA_EXT:
case GL_SOURCE2_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
GLenum source = (GLenum) (GLint) *param;
GLuint s = pname - GL_SOURCE0_ALPHA_EXT;
switch (source) {
case GL_PREVIOUS_EXT:
if (texUnit->CombineSourceA[s] == source) return;
texUnit->CombineSourceA[s] = source;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
break;
case GL_OPERAND0_RGB_EXT:
case GL_OPERAND1_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
GLenum operand = (GLenum) (GLint) *param;
GLuint s = pname - GL_OPERAND0_RGB_EXT;
switch (operand) {
case GL_SRC_ALPHA:
case GL_ONE_MINUS_SRC_ALPHA:
texUnit->CombineOperandRGB[s] = operand;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
break;
case GL_OPERAND0_ALPHA_EXT:
case GL_OPERAND1_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
GLenum operand = (GLenum) (GLint) *param;
switch (operand) {
case GL_SRC_ALPHA:
case GL_ONE_MINUS_SRC_ALPHA:
texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT]
= operand;
- ctx->NewState |= NEW_TEXTURE_ENV;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
}
break;
case GL_OPERAND2_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
if ((GLenum) (GLint) *param == GL_SRC_ALPHA) {
texUnit->CombineOperandRGB[2] = (GLenum) (GLint) *param;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
}
break;
case GL_OPERAND2_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
if ((GLenum) (GLint) *param == GL_SRC_ALPHA) {
texUnit->CombineOperandA[2] = (GLenum) (GLint) *param;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
}
break;
case GL_RGB_SCALE_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
if (*param == 1.0) {
texUnit->CombineScaleShiftRGB = 0;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else if (*param == 2.0) {
texUnit->CombineScaleShiftRGB = 1;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else if (*param == 4.0) {
texUnit->CombineScaleShiftRGB = 2;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexEnv(param)" );
}
break;
case GL_ALPHA_SCALE:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
if (*param == 1.0) {
texUnit->CombineScaleShiftA = 0;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else if (*param == 2.0) {
texUnit->CombineScaleShiftA = 1;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else if (*param == 4.0) {
texUnit->CombineScaleShiftA = 2;
- ctx->NewState |= NEW_TEXTURE_ENV;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexEnv(param)" );
}
}
else if (target==GL_TEXTURE_FILTER_CONTROL_EXT) {
- if (!ctx->Extensions.HaveTextureLodBias) {
+ if (!ctx->Extensions.EXT_texture_lod_bias) {
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
return;
}
(*ctx->Driver.TexEnv)( ctx, target, pname, param );
}
+ ctx->NewState |= _NEW_TEXTURE;
}
COPY_4FV( params, texUnit->EnvColor );
break;
case GL_RGB_SCALE_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
if (texUnit->CombineScaleShiftRGB == 0)
*params = 1.0;
else if (texUnit->CombineScaleShiftRGB == 1)
}
break;
case GL_ALPHA_SCALE:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
if (texUnit->CombineScaleShiftA == 0)
*params = 1.0;
else if (texUnit->CombineScaleShiftA == 1)
params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] );
break;
case GL_COMBINE_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineModeRGB;
}
else {
}
break;
case GL_COMBINE_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineModeA;
}
else {
}
break;
case GL_SOURCE0_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceRGB[0];
}
else {
}
break;
case GL_SOURCE1_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceRGB[1];
}
else {
}
break;
case GL_SOURCE2_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceRGB[2];
}
else {
}
break;
case GL_SOURCE0_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceA[0];
}
else {
}
break;
case GL_SOURCE1_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceA[1];
}
else {
}
break;
case GL_SOURCE2_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineSourceA[2];
}
else {
}
break;
case GL_OPERAND0_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandRGB[0];
}
else {
}
break;
case GL_OPERAND1_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandRGB[1];
}
else {
}
break;
case GL_OPERAND2_RGB_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandRGB[2];
}
else {
}
break;
case GL_OPERAND0_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandA[0];
}
else {
}
break;
case GL_OPERAND1_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandA[1];
}
else {
}
break;
case GL_OPERAND2_ALPHA_EXT:
- if (ctx->Extensions.HaveTextureEnvCombine) {
+ if (ctx->Extensions.EXT_texture_env_combine) {
*params = (GLint) texUnit->CombineOperandA[2];
}
else {
texObj = texUnit->CurrentD[3];
break;
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->Extensions.HaveTextureCubeMap) {
+ if (ctx->Extensions.ARB_texture_cube_map) {
texObj = texUnit->CurrentCubeMap;
break;
}
|| eparam==GL_NEAREST_MIPMAP_LINEAR
|| eparam==GL_LINEAR_MIPMAP_LINEAR) {
texObj->MinFilter = eparam;
- ctx->NewState |= NEW_TEXTURING;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
if (eparam==GL_NEAREST || eparam==GL_LINEAR) {
texObj->MagFilter = eparam;
- ctx->NewState |= NEW_TEXTURING;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
if (eparam==GL_CLAMP || eparam==GL_REPEAT || eparam==GL_CLAMP_TO_EDGE) {
texObj->WrapS = eparam;
- ctx->NewState |= NEW_TEXTURING;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
if (eparam==GL_CLAMP || eparam==GL_REPEAT || eparam==GL_CLAMP_TO_EDGE) {
texObj->WrapT = eparam;
- ctx->NewState |= NEW_TEXTURING;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
if (eparam==GL_CLAMP || eparam==GL_REPEAT || eparam==GL_CLAMP_TO_EDGE) {
texObj->WrapR = eparam;
- ctx->NewState |= NEW_TEXTURING;
}
else {
gl_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
break;
case GL_TEXTURE_MIN_LOD:
texObj->MinLod = params[0];
- ctx->NewState |= NEW_TEXTURING;
break;
case GL_TEXTURE_MAX_LOD:
texObj->MaxLod = params[0];
- ctx->NewState |= NEW_TEXTURING;
break;
case GL_TEXTURE_BASE_LEVEL:
if (params[0] < 0.0) {
return;
}
texObj->BaseLevel = (GLint) params[0];
- ctx->NewState |= NEW_TEXTURING;
break;
case GL_TEXTURE_MAX_LEVEL:
if (params[0] < 0.0) {
return;
}
texObj->MaxLevel = (GLint) params[0];
- ctx->NewState |= NEW_TEXTURING;
break;
case GL_TEXTURE_PRIORITY:
/* (keithh@netcomuk.co.uk) */
return;
}
+ ctx->NewState |= _NEW_TEXTURE;
gl_put_texobj_on_dirty_list( ctx, texObj );
if (ctx->Driver.TexParameter) {
return 3;
case GL_TEXTURE_CUBE_MAP_ARB:
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
- return ctx->Extensions.HaveTextureCubeMap ? 2 : 0;
+ return ctx->Extensions.ARB_texture_cube_map ? 2 : 0;
default:
gl_problem(ctx, "bad target in _mesa_tex_target_dimensions()");
return 0;
/* GL_ARB_texture_compression */
case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
if (img->IsCompressed && !isProxy)
*params = img->CompressedSize;
else
}
return;
case GL_TEXTURE_COMPRESSED_ARB:
- if (ctx->Extensions.HaveTextureCompression) {
+ if (ctx->Extensions.ARB_texture_compression) {
*params = (GLint) img->IsCompressed;
}
else {
return;
}
- ctx->NewState |= NEW_TEXTURING;
+ ctx->NewState |= _NEW_TEXTURE;
}
if (ctx->Driver.ActiveTexture) {
(*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit );
}
+ ctx->NewState |= _NEW_TEXTURE;
}
else {
gl_error(ctx, GL_INVALID_OPERATION, "glActiveTextureARB(target)");
if (target >= GL_TEXTURE0_ARB && target < GL_TEXTURE0_ARB + maxUnits) {
GLint texUnit = target - GL_TEXTURE0_ARB;
ctx->Array.ActiveTexture = texUnit;
+ ctx->NewState |= _NEW_ARRAY;
}
else {
gl_error(ctx, GL_INVALID_OPERATION, "glActiveTextureARB(target)");
/*
- * This is called by gl_update_state() if the NEW_TEXTURING bit in
+ * This is called by gl_update_state() if the _NEW_TEXTURE bit in
* ctx->NewState is set.
*/
void gl_update_dirty_texobjs( GLcontext *ctx )
-/* $Id: varray.c,v 1.26 2000/10/27 16:44:41 keithw Exp $ */
+/* $Id: varray.c,v 1.27 2000/10/30 13:32:02 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->Array.VertexFunc = gl_trans_4f_tab[size][TYPE_IDX(type)];
ctx->Array.VertexEltFunc = gl_trans_elt_4f_tab[size][TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_OBJ_ANY;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.NormalFunc = gl_trans_3f_tab[TYPE_IDX(type)];
ctx->Array.NormalEltFunc = gl_trans_elt_3f_tab[TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_NORM;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.ColorFunc = gl_trans_4ub_tab[size][TYPE_IDX(type)];
ctx->Array.ColorEltFunc = gl_trans_elt_4ub_tab[size][TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_RGBA;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.FogCoordFunc = gl_trans_1f_tab[TYPE_IDX(type)];
ctx->Array.FogCoordEltFunc = gl_trans_elt_1f_tab[TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_FOG_COORD;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.IndexFunc = gl_trans_1ui_tab[TYPE_IDX(type)];
ctx->Array.IndexEltFunc = gl_trans_elt_1ui_tab[TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_INDEX;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.SecondaryColorFunc = gl_trans_4ub_tab[size][TYPE_IDX(type)];
ctx->Array.SecondaryColorEltFunc = gl_trans_elt_4ub_tab[size][TYPE_IDX(type)];
ctx->Array.NewArrayState |= VERT_SPEC_RGB;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
ctx->Array.TexCoordFunc[texUnit] = gl_trans_4f_tab[size][TYPE_IDX(type)];
ctx->Array.TexCoordEltFunc[texUnit] = gl_trans_elt_4f_tab[size][TYPE_IDX(type)];
ctx->Array.NewArrayState |= PIPE_TEX(texUnit);
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}
}
ctx->Array.EdgeFlagEltFunc = gl_trans_elt_1ub_tab[TYPE_IDX(GL_UNSIGNED_BYTE)];
ctx->Array.NewArrayState |= VERT_EDGE;
- ctx->NewState |= NEW_CLIENT_STATE;
+ ctx->NewState |= _NEW_ARRAY;
}