diff options
author | Keith Whitwell <[email protected]> | 2000-10-30 13:31:59 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2000-10-30 13:31:59 +0000 |
commit | a96308c37db0bc0086a017d318bc3504aa5f0b1a (patch) | |
tree | 0010de3aa19901acf13b57e57e7ba465abffa95e /src/mesa/main/blend.c | |
parent | a4575499679d9d91055a35c7673b81872ec127cb (diff) |
Replace the flags Mesa was using for ctx->NewState with a new set
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.
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r-- | src/mesa/main/blend.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index b1ab7c5f288..65f890d10fa 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,4 @@ -/* $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 @@ -55,7 +55,7 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) 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; } @@ -83,7 +83,7 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) 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; } @@ -112,7 +112,7 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) } ctx->Color.BlendFunc = NULL; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_COLOR; } @@ -134,7 +134,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, 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; } @@ -162,7 +162,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, 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; } @@ -189,7 +189,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, 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; } @@ -217,7 +217,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, 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; } @@ -242,7 +242,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, } ctx->Color.BlendFunc = NULL; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_COLOR; if (ctx->Driver.BlendFuncSeparate) { (*ctx->Driver.BlendFuncSeparate)( ctx, sfactorRGB, dfactorRGB, @@ -267,7 +267,7 @@ _mesa_BlendEquation( GLenum mode ) 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 { @@ -279,7 +279,7 @@ _mesa_BlendEquation( GLenum mode ) 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 { @@ -303,7 +303,7 @@ _mesa_BlendEquation( GLenum mode ) } ctx->Color.BlendFunc = NULL; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_COLOR; if (ctx->Driver.BlendEquation) ctx->Driver.BlendEquation( ctx, mode ); @@ -319,6 +319,7 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) 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 |