summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/common/driverfuncs.c6
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_state.c24
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_state.c4
-rw-r--r--src/mesa/drivers/dri/i830/i830_state.c19
-rw-r--r--src/mesa/drivers/dri/i915/i830_state.c19
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c19
-rw-r--r--src/mesa/drivers/dri/i915/intel_context.c27
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_state.c4
-rw-r--r--src/mesa/drivers/dri/mga/mgastate.c19
-rw-r--r--src/mesa/drivers/dri/r128/r128_state.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c19
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c16
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_state.c18
-rw-r--r--src/mesa/drivers/dri/s3v/s3v_state.c4
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c25
-rw-r--r--src/mesa/drivers/dri/sis/sis_stencil.c14
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_state.c19
-rw-r--r--src/mesa/drivers/glide/fxdd.c6
-rw-r--r--src/mesa/drivers/glide/fxdrv.h6
-rw-r--r--src/mesa/drivers/glide/fxsetup.c8
-rw-r--r--src/mesa/main/attrib.c17
-rw-r--r--src/mesa/main/dd.h10
-rw-r--r--src/mesa/main/stencil.c39
23 files changed, 185 insertions, 161 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index db4ff2ad3d..105d023635 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -162,11 +162,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->RenderMode = NULL;
driver->Scissor = NULL;
driver->ShadeModel = NULL;
- driver->StencilFunc = NULL;
- driver->StencilMask = NULL;
- driver->StencilOp = NULL;
+ driver->StencilFuncSeparate = NULL;
driver->StencilOpSeparate = NULL;
- driver->ActiveStencilFace = NULL;
+ driver->StencilMaskSeparate = NULL;
driver->TexGen = NULL;
driver->TexEnv = NULL;
driver->TexParameter = NULL;
diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c
index 95ff820e10..85c2fb5e8b 100644
--- a/src/mesa/drivers/dri/ffb/ffb_state.c
+++ b/src/mesa/drivers/dri/ffb/ffb_state.c
@@ -266,7 +266,9 @@ static void ffbDDDepthMask(GLcontext *ctx, GLboolean flag)
}
}
-static void ffbDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
+static void
+ffbDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int stencil, stencilctl, consty;
@@ -310,7 +312,8 @@ static void ffbDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref, GLuint mask
}
}
-static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
+static void
+ffbDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
@@ -321,7 +324,9 @@ static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
}
}
-static void ffbDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass)
+static void
+ffbDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int stencilctl;
@@ -860,12 +865,13 @@ static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
tmp = fmesa->fbc & ~FFB_FBC_YE_MASK;
if (state) {
- ffbDDStencilFunc(ctx,
+ ffbDDStencilFuncSeparate(ctx, GL_FRONT,
ctx->Stencil.Function[0],
ctx->Stencil.Ref[0],
ctx->Stencil.ValueMask[0]);
- ffbDDStencilMask(ctx, ctx->Stencil.WriteMask[0]);
- ffbDDStencilOp(ctx,
+ ffbDDStencilMaskSeparate(ctx, GL_FRONT,
+ ctx->Stencil.WriteMask[0]);
+ ffbDDStencilOpSeparate(ctx, GL_FRONT,
ctx->Stencil.FailFunc[0],
ctx->Stencil.ZFailFunc[0],
ctx->Stencil.ZPassFunc[0]);
@@ -1084,9 +1090,9 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.DepthRange = ffbDDDepthRange;
if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) {
- ctx->Driver.StencilFunc = ffbDDStencilFunc;
- ctx->Driver.StencilMask = ffbDDStencilMask;
- ctx->Driver.StencilOp = ffbDDStencilOp;
+ ctx->Driver.StencilFuncSeparate = ffbDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = ffbDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = ffbDDStencilOpSeparate;
}
ctx->Driver.DrawBuffer = ffbDDDrawBuffer;
diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c
index 194313dc97..3edf009c78 100644
--- a/src/mesa/drivers/dri/gamma/gamma_state.c
+++ b/src/mesa/drivers/dri/gamma/gamma_state.c
@@ -1722,9 +1722,5 @@ void gammaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.PolygonStipple = gammaDDPolygonStipple;
ctx->Driver.Scissor = gammaDDScissor;
ctx->Driver.ShadeModel = gammaDDShadeModel;
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
ctx->Driver.Viewport = gammaDDViewport;
}
diff --git a/src/mesa/drivers/dri/i830/i830_state.c b/src/mesa/drivers/dri/i830/i830_state.c
index 28ec947241..13e2559662 100644
--- a/src/mesa/drivers/dri/i830/i830_state.c
+++ b/src/mesa/drivers/dri/i830/i830_state.c
@@ -81,8 +81,9 @@ static __inline__ GLuint i830PackColor(GLuint format,
}
}
-static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
+static void
+i830StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
+ GLuint mask)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
int test = 0;
@@ -134,7 +135,8 @@ static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
STENCIL_TEST_FUNC(test));
}
-static void i830StencilMask(GLcontext *ctx, GLuint mask)
+static void
+i830StencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
@@ -149,8 +151,9 @@ static void i830StencilMask(GLcontext *ctx, GLuint mask)
STENCIL_WRITE_MASK(mask));
}
-static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
+static void
+i830StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
+ GLenum zpass)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
int fop, dfop, dpop;
@@ -1681,9 +1684,9 @@ void i830DDInitStateFuncs(GLcontext *ctx)
ctx->Driver.Viewport = i830Viewport;
ctx->Driver.LightModelfv = i830LightModelfv;
- ctx->Driver.StencilFunc = i830StencilFunc;
- ctx->Driver.StencilMask = i830StencilMask;
- ctx->Driver.StencilOp = i830StencilOp;
+ ctx->Driver.StencilFuncSeparate = i830StencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = i830StencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = i830StencilOpSeparate;
/* Pixel path fallbacks.
*/
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
index e3f632348b..605f400c06 100644
--- a/src/mesa/drivers/dri/i915/i830_state.c
+++ b/src/mesa/drivers/dri/i915/i830_state.c
@@ -40,8 +40,9 @@
#include "i830_context.h"
#include "i830_reg.h"
-static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
+static void
+i830StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
+ GLuint mask)
{
i830ContextPtr i830 = I830_CONTEXT(ctx);
int test = intel_translate_compare_func(func);
@@ -65,7 +66,8 @@ static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
STENCIL_TEST_FUNC(test));
}
-static void i830StencilMask(GLcontext *ctx, GLuint mask)
+static void
+i830StencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
i830ContextPtr i830 = I830_CONTEXT(ctx);
@@ -80,8 +82,9 @@ static void i830StencilMask(GLcontext *ctx, GLuint mask)
STENCIL_WRITE_MASK(mask));
}
-static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
+static void
+i830StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
+ GLenum zpass)
{
i830ContextPtr i830 = I830_CONTEXT(ctx);
int fop, dfop, dpop;
@@ -1060,9 +1063,9 @@ void i830InitStateFuncs( struct dd_function_table *functions )
functions->PolygonStipple = i830PolygonStipple;
functions->Scissor = i830Scissor;
functions->ShadeModel = i830ShadeModel;
- functions->StencilFunc = i830StencilFunc;
- functions->StencilMask = i830StencilMask;
- functions->StencilOp = i830StencilOp;
+ functions->StencilFuncSeparate = i830StencilFuncSeparate;
+ functions->StencilMaskSeparate = i830StencilMaskSeparate;
+ functions->StencilOpSeparate = i830StencilOpSeparate;
}
void i830InitState( i830ContextPtr i830 )
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 9ba47d92e4..0627f102da 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -44,8 +44,9 @@
-static void i915StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
+static void
+i915StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
+ GLuint mask)
{
i915ContextPtr i915 = I915_CONTEXT(ctx);
int test = intel_translate_compare_func( func );
@@ -69,7 +70,8 @@ static void i915StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
(test << S5_STENCIL_TEST_FUNC_SHIFT));
}
-static void i915StencilMask(GLcontext *ctx, GLuint mask)
+static void
+i915StencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
i915ContextPtr i915 = I915_CONTEXT(ctx);
@@ -85,8 +87,9 @@ static void i915StencilMask(GLcontext *ctx, GLuint mask)
}
-static void i915StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
+static void
+i915StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
+ GLenum zpass)
{
i915ContextPtr i915 = I915_CONTEXT(ctx);
int fop = intel_translate_stencil_op(fail);
@@ -928,9 +931,9 @@ void i915InitStateFunctions( struct dd_function_table *functions )
functions->PolygonStipple = i915PolygonStipple;
functions->Scissor = i915Scissor;
functions->ShadeModel = i915ShadeModel;
- functions->StencilFunc = i915StencilFunc;
- functions->StencilMask = i915StencilMask;
- functions->StencilOp = i915StencilOp;
+ functions->StencilFuncSeparate = i915StencilFuncSeparate;
+ functions->StencilMaskSeparate = i915StencilMaskSeparate;
+ functions->StencilOpSeparate = i915StencilOpSeparate;
}
diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index bdf02c766e..d39e45d0b3 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -697,15 +697,24 @@ void intelInitState( GLcontext *ctx )
ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y,
ctx->Scissor.Width, ctx->Scissor.Height );
ctx->Driver.ShadeModel( ctx, ctx->Light.ShadeModel );
- ctx->Driver.StencilFunc( ctx,
- ctx->Stencil.Function[0],
- ctx->Stencil.Ref[0],
- ctx->Stencil.ValueMask[0] );
- ctx->Driver.StencilMask( ctx, ctx->Stencil.WriteMask[0] );
- ctx->Driver.StencilOp( ctx,
- ctx->Stencil.FailFunc[0],
- ctx->Stencil.ZFailFunc[0],
- ctx->Stencil.ZPassFunc[0]);
+ ctx->Driver.StencilFuncSeparate( ctx, GL_FRONT,
+ ctx->Stencil.Function[0],
+ ctx->Stencil.Ref[0],
+ ctx->Stencil.ValueMask[0] );
+ ctx->Driver.StencilFuncSeparate( ctx, GL_BACK,
+ ctx->Stencil.Function[1],
+ ctx->Stencil.Ref[1],
+ ctx->Stencil.ValueMask[1] );
+ ctx->Driver.StencilMaskSeparate( ctx, GL_FRONT, ctx->Stencil.WriteMask[0] );
+ ctx->Driver.StencilMaskSeparate( ctx, GL_BACK, ctx->Stencil.WriteMask[1] );
+ ctx->Driver.StencilOpSeparate( ctx, GL_FRONT,
+ ctx->Stencil.FailFunc[0],
+ ctx->Stencil.ZFailFunc[0],
+ ctx->Stencil.ZPassFunc[0]);
+ ctx->Driver.StencilOpSeparate( ctx, GL_BACK,
+ ctx->Stencil.FailFunc[1],
+ ctx->Stencil.ZFailFunc[1],
+ ctx->Stencil.ZPassFunc[1]);
ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] );
diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c
index 1eb4b6e73c..14d387ab90 100644
--- a/src/mesa/drivers/dri/mach64/mach64_state.c
+++ b/src/mesa/drivers/dri/mach64/mach64_state.c
@@ -1186,10 +1186,6 @@ void mach64DDInitStateFuncs( GLcontext *ctx )
ctx->Driver.RenderMode = mach64DDRenderMode;
ctx->Driver.Scissor = mach64DDScissor;
ctx->Driver.ShadeModel = mach64DDShadeModel;
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
ctx->Driver.DepthRange = mach64DepthRange;
ctx->Driver.Viewport = mach64Viewport;
diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c
index 7ba3cdb776..139a4e2abd 100644
--- a/src/mesa/drivers/dri/mga/mgastate.c
+++ b/src/mesa/drivers/dri/mga/mgastate.c
@@ -513,8 +513,9 @@ static void mgaDDLightModelfv(GLcontext *ctx, GLenum pname,
*/
-static void mgaDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
+static void
+mgaDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
+ GLuint mask)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
GLuint stencil;
@@ -557,7 +558,8 @@ static void mgaDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
mmesa->hw.stencilctl |= stencilctl;
}
-static void mgaDDStencilMask(GLcontext *ctx, GLuint mask)
+static void
+mgaDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
@@ -566,8 +568,9 @@ static void mgaDDStencilMask(GLcontext *ctx, GLuint mask)
mmesa->hw.stencil |= MGA_FIELD( S_swtmsk, mask );
}
-static void mgaDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
+static void
+mgaDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
+ GLenum zpass)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
GLuint stencilctl;
@@ -1210,9 +1213,9 @@ void mgaDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.PolygonStipple = mgaDDPolygonStipple;
- ctx->Driver.StencilFunc = mgaDDStencilFunc;
- ctx->Driver.StencilMask = mgaDDStencilMask;
- ctx->Driver.StencilOp = mgaDDStencilOp;
+ ctx->Driver.StencilFuncSeparate = mgaDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = mgaDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = mgaDDStencilOpSeparate;
ctx->Driver.DepthRange = mgaDepthRange;
ctx->Driver.Viewport = mgaViewport;
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c
index a1cb6aafeb..11f0d309e4 100644
--- a/src/mesa/drivers/dri/r128/r128_state.c
+++ b/src/mesa/drivers/dri/r128/r128_state.c
@@ -1226,10 +1226,6 @@ void r128DDInitStateFuncs( GLcontext *ctx )
ctx->Driver.RenderMode = r128DDRenderMode;
ctx->Driver.Scissor = r128DDScissor;
ctx->Driver.ShadeModel = r128DDShadeModel;
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
ctx->Driver.DepthRange = r128DepthRange;
ctx->Driver.Viewport = r128Viewport;
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 968783607d..e31337b5b6 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -1435,8 +1435,9 @@ static void r200UpdateClipPlanes( GLcontext *ctx )
* Stencil
*/
-static void r200StencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask )
+static void
+r200StencilFuncSeparate( GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint refmask = ((ctx->Stencil.Ref[0] << R200_STENCIL_REF_SHIFT) |
@@ -1479,7 +1480,8 @@ static void r200StencilFunc( GLcontext *ctx, GLenum func,
rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= refmask;
}
-static void r200StencilMask( GLcontext *ctx, GLuint mask )
+static void
+r200StencilMaskSeparate( GLcontext *ctx, GLenum face, GLuint mask )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
@@ -1489,8 +1491,9 @@ static void r200StencilMask( GLcontext *ctx, GLuint mask )
(ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT);
}
-static void r200StencilOp( GLcontext *ctx, GLenum fail,
- GLenum zfail, GLenum zpass )
+static void
+r200StencilOpSeparate( GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
@@ -2427,9 +2430,9 @@ void r200InitStateFuncs( struct dd_function_table *functions )
functions->RenderMode = r200RenderMode;
functions->Scissor = r200Scissor;
functions->ShadeModel = r200ShadeModel;
- functions->StencilFunc = r200StencilFunc;
- functions->StencilMask = r200StencilMask;
- functions->StencilOp = r200StencilOp;
+ functions->StencilFuncSeparate = r200StencilFuncSeparate;
+ functions->StencilMaskSeparate = r200StencilMaskSeparate;
+ functions->StencilOpSeparate = r200StencilOpSeparate;
functions->Viewport = r200Viewport;
/* Swrast hooks for imaging extensions:
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index b6a03a2274..03319f74f8 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -756,8 +756,8 @@ static void r300ShadeModel(GLcontext * ctx, GLenum mode)
}
}
-static void r300StencilFunc(GLcontext * ctx, GLenum func,
- GLint ref, GLuint mask)
+static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face,
+ GLenum func, GLint ref, GLuint mask)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
GLuint refmask = ((ctx->Stencil.Ref[0] << R300_RB3D_ZS2_STENCIL_REF_SHIFT) |
@@ -781,7 +781,7 @@ static void r300StencilFunc(GLcontext * ctx, GLenum func,
rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= refmask;
}
-static void r300StencilMask(GLcontext * ctx, GLuint mask)
+static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
@@ -791,8 +791,8 @@ static void r300StencilMask(GLcontext * ctx, GLuint mask)
}
-static void r300StencilOp(GLcontext * ctx, GLenum fail,
- GLenum zfail, GLenum zpass)
+static void r300StencilOpSeparate(GLcontext * ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
@@ -2303,9 +2303,9 @@ void r300InitStateFuncs(struct dd_function_table* functions)
/* Stencil related */
functions->ClearStencil = r300ClearStencil;
- functions->StencilFunc = r300StencilFunc;
- functions->StencilMask = r300StencilMask;
- functions->StencilOp = r300StencilOp;
+ functions->StencilFuncSeparate = r300StencilFuncSeparate;
+ functions->StencilMaskSeparate = r300StencilMaskSeparate;
+ functions->StencilOpSeparate = r300StencilOpSeparate;
/* Viewport related */
functions->Viewport = r300Viewport;
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
index 0503fff68c..ca8bf65ba9 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -1273,8 +1273,9 @@ static void radeonUpdateClipPlanes( GLcontext *ctx )
* Stencil
*/
-static void radeonStencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask )
+static void
+radeonStencilFuncSeparate( GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint refmask = ((ctx->Stencil.Ref[0] << RADEON_STENCIL_REF_SHIFT) |
@@ -1317,7 +1318,8 @@ static void radeonStencilFunc( GLcontext *ctx, GLenum func,
rmesa->hw.msk.cmd[MSK_RB3D_STENCILREFMASK] |= refmask;
}
-static void radeonStencilMask( GLcontext *ctx, GLuint mask )
+static void
+radeonStencilMaskSeparate( GLcontext *ctx, GLenum face, GLuint mask )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@@ -1327,8 +1329,8 @@ static void radeonStencilMask( GLcontext *ctx, GLuint mask )
(ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT);
}
-static void radeonStencilOp( GLcontext *ctx, GLenum fail,
- GLenum zfail, GLenum zpass )
+static void radeonStencilOpSeparate( GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@@ -2312,9 +2314,9 @@ void radeonInitStateFuncs( GLcontext *ctx )
ctx->Driver.RenderMode = radeonRenderMode;
ctx->Driver.Scissor = radeonScissor;
ctx->Driver.ShadeModel = radeonShadeModel;
- ctx->Driver.StencilFunc = radeonStencilFunc;
- ctx->Driver.StencilMask = radeonStencilMask;
- ctx->Driver.StencilOp = radeonStencilOp;
+ ctx->Driver.StencilFuncSeparate = radeonStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = radeonStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = radeonStencilOpSeparate;
ctx->Driver.Viewport = radeonViewport;
TNL_CONTEXT(ctx)->Driver.NotifyMaterialChange = radeonUpdateMaterial;
diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c
index 84aaf4c5b1..e692f20e8a 100644
--- a/src/mesa/drivers/dri/s3v/s3v_state.c
+++ b/src/mesa/drivers/dri/s3v/s3v_state.c
@@ -880,9 +880,5 @@ void s3vInitStateFuncs( GLcontext *ctx )
ctx->Driver.PolygonStipple = NULL; /* s3vDDPolygonStipple; */
ctx->Driver.Scissor = s3vDDScissor; /* ScissorLR / ScissorTB */
ctx->Driver.ShadeModel = NULL; /* s3vDDShadeModel; */
- ctx->Driver.ClearStencil = NULL;
- ctx->Driver.StencilFunc = NULL;
- ctx->Driver.StencilMask = NULL;
- ctx->Driver.StencilOp = NULL;
ctx->Driver.Viewport = NULL; /* s3vDDViewport; */
}
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c
index 4affe8799b..c3c04d587e 100644
--- a/src/mesa/drivers/dri/savage/savagestate.c
+++ b/src/mesa/drivers/dri/savage/savagestate.c
@@ -992,8 +992,9 @@ static void savageDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
}
-static void savageDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
- GLuint mask)
+static void
+savageDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask)
{
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
unsigned a=0;
@@ -1024,7 +1025,8 @@ static void savageDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
imesa->dirty |= SAVAGE_UPLOAD_GLOBAL;
}
-static void savageDDStencilMask(GLcontext *ctx, GLuint mask)
+static void
+savageDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
@@ -1052,8 +1054,9 @@ static unsigned get_stencil_op_value( GLenum op )
return STENCIL_Keep;
}
-static void savageDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
- GLenum zpass)
+static void
+savageDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass)
{
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
const u_int32_t stencilCtrl = imesa->regs.s4.stencilCtrl.ui;
@@ -1732,9 +1735,9 @@ void savageDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.ColorMask = savageDDColorMask_s4;
ctx->Driver.ShadeModel = savageDDShadeModel_s4;
ctx->Driver.LightModelfv = savageDDLightModelfv_s4;
- ctx->Driver.StencilFunc = savageDDStencilFunc;
- ctx->Driver.StencilMask = savageDDStencilMask;
- ctx->Driver.StencilOp = savageDDStencilOp;
+ ctx->Driver.StencilFuncSeparate = savageDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = savageDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = savageDDStencilOpSeparate;
} else {
ctx->Driver.Enable = savageDDEnable_s3d;
ctx->Driver.AlphaFunc = savageDDAlphaFunc_s3d;
@@ -1744,9 +1747,9 @@ void savageDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.ColorMask = savageDDColorMask_s3d;
ctx->Driver.ShadeModel = savageDDShadeModel_s3d;
ctx->Driver.LightModelfv = savageDDLightModelfv_s3d;
- ctx->Driver.StencilFunc = 0;
- ctx->Driver.StencilMask = 0;
- ctx->Driver.StencilOp = 0;
+ ctx->Driver.StencilFuncSeparate = NULL;
+ ctx->Driver.StencilMaskSeparate = NULL;
+ ctx->Driver.StencilOpSeparate = NULL;
}
/* Swrast hooks for imaging extensions:
diff --git a/src/mesa/drivers/dri/sis/sis_stencil.c b/src/mesa/drivers/dri/sis/sis_stencil.c
index a31d49ca27..d36f5f5909 100644
--- a/src/mesa/drivers/dri/sis/sis_stencil.c
+++ b/src/mesa/drivers/dri/sis/sis_stencil.c
@@ -37,7 +37,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sis_stencil.h"
static void
-sisDDStencilFunc( GLcontext * ctx, GLenum func, GLint ref, GLuint mask )
+sisDDStencilFuncSeparate( GLcontext * ctx, GLenum face,
+ GLenum func, GLint ref, GLuint mask )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
__GLSiSHardware *prev = &smesa->prev;
@@ -84,7 +85,7 @@ sisDDStencilFunc( GLcontext * ctx, GLenum func, GLint ref, GLuint mask )
}
static void
-sisDDStencilMask( GLcontext * ctx, GLuint mask )
+sisDDStencilMaskSeparate( GLcontext * ctx, GLenum face, GLuint mask )
{
if (!ctx->Visual.stencilBits)
return;
@@ -94,7 +95,8 @@ sisDDStencilMask( GLcontext * ctx, GLuint mask )
}
static void
-sisDDStencilOp( GLcontext * ctx, GLenum fail, GLenum zfail, GLenum zpass )
+sisDDStencilOpSeparate( GLcontext * ctx, GLenum face, GLenum fail,
+ GLenum zfail, GLenum zpass )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
__GLSiSHardware *prev = &smesa->prev;
@@ -179,7 +181,7 @@ sisDDStencilOp( GLcontext * ctx, GLenum fail, GLenum zfail, GLenum zpass )
void
sisDDInitStencilFuncs( GLcontext *ctx )
{
- ctx->Driver.StencilFunc = sisDDStencilFunc;
- ctx->Driver.StencilMask = sisDDStencilMask;
- ctx->Driver.StencilOp = sisDDStencilOp;
+ ctx->Driver.StencilFuncSeparate = sisDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = sisDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = sisDDStencilOpSeparate;
}
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c
index 73dad6e086..28d2f13ea8 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_state.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c
@@ -476,8 +476,9 @@ static void tdfxUpdateStencil( GLcontext *ctx )
}
-static void tdfxDDStencilFunc( GLcontext *ctx, GLenum func,
- GLint ref, GLuint mask )
+static void
+tdfxDDStencilFuncSeparate( GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
@@ -485,7 +486,8 @@ static void tdfxDDStencilFunc( GLcontext *ctx, GLenum func,
fxMesa->new_state |= TDFX_NEW_STENCIL;
}
-static void tdfxDDStencilMask( GLcontext *ctx, GLuint mask )
+static void
+tdfxDDStencilMaskSeparate( GLcontext *ctx, GLenum face, GLuint mask )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
@@ -493,8 +495,9 @@ static void tdfxDDStencilMask( GLcontext *ctx, GLuint mask )
fxMesa->new_state |= TDFX_NEW_STENCIL;
}
-static void tdfxDDStencilOp( GLcontext *ctx, GLenum sfail,
- GLenum zfail, GLenum zpass )
+static void
+tdfxDDStencilOpSeparate( GLcontext *ctx, GLenum face, GLenum sfail,
+ GLenum zfail, GLenum zpass )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
@@ -1428,9 +1431,9 @@ void tdfxDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.ShadeModel = tdfxDDShadeModel;
if ( fxMesa->haveHwStencil ) {
- ctx->Driver.StencilFunc = tdfxDDStencilFunc;
- ctx->Driver.StencilMask = tdfxDDStencilMask;
- ctx->Driver.StencilOp = tdfxDDStencilOp;
+ ctx->Driver.StencilFuncSeparate = tdfxDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = tdfxDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = tdfxDDStencilOpSeparate;
}
ctx->Driver.Viewport = tdfxDDViewport;
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 4e9df208bf..1614a7a43a 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -2170,9 +2170,9 @@ fxSetupDDPointers(GLcontext * ctx)
ctx->Driver.ShadeModel = fxDDShadeModel;
ctx->Driver.Enable = fxDDEnable;
if (fxMesa->haveHwStencil) {
- ctx->Driver.StencilFunc = fxDDStencilFunc;
- ctx->Driver.StencilMask = fxDDStencilMask;
- ctx->Driver.StencilOp = fxDDStencilOp;
+ ctx->Driver.StencilFuncSeparate = fxDDStencilFuncSeparate;
+ ctx->Driver.StencilMaskSeparate = fxDDStencilMaskSeparate;
+ ctx->Driver.StencilOpSeparate = fxDDStencilOpSeparate;
}
fxSetupDDSpanPointers(ctx);
diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h
index ca3bdc99b5..240428c06d 100644
--- a/src/mesa/drivers/glide/fxdrv.h
+++ b/src/mesa/drivers/glide/fxdrv.h
@@ -642,9 +642,9 @@ extern void fxDDBlendFuncSeparate(GLcontext *, GLenum, GLenum, GLenum, GLenum);
extern void fxDDBlendEquationSeparate(GLcontext *, GLenum, GLenum);
extern void fxDDDepthMask(GLcontext *, GLboolean);
extern void fxDDDepthFunc(GLcontext *, GLenum);
-extern void fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask);
-extern void fxDDStencilMask (GLcontext *ctx, GLuint mask);
-extern void fxDDStencilOp (GLcontext *ctx, GLenum sfail, GLenum zfail, GLenum zpass);
+extern void fxDDStencilFuncSeparate (GLcontext *ctx, GLenum face, GLenum func, GLint ref, GLuint mask);
+extern void fxDDStencilMaskSeparate (GLcontext *ctx, GLenum face, GLuint mask);
+extern void fxDDStencilOpSeparate (GLcontext *ctx, GLenum face, GLenum sfail, GLenum zfail, GLenum zpass);
extern void fxDDInitExtensions(GLcontext * ctx);
diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c
index 360a42f7e8..240e5e0b59 100644
--- a/src/mesa/drivers/glide/fxsetup.c
+++ b/src/mesa/drivers/glide/fxsetup.c
@@ -1681,7 +1681,8 @@ static GrStencil_t convertGLStencilOp( GLenum op )
}
void
-fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
+fxDDStencilFuncSeparate (GLcontext *ctx, GLenum face, GLenum func,
+ GLint ref, GLuint mask)
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
tfxUnitsState *us = &fxMesa->unitsState;
@@ -1705,7 +1706,7 @@ fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
}
void
-fxDDStencilMask (GLcontext *ctx, GLuint mask)
+fxDDStencilMaskSeparate (GLcontext *ctx, GLenum face, GLuint mask)
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
tfxUnitsState *us = &fxMesa->unitsState;
@@ -1721,7 +1722,8 @@ fxDDStencilMask (GLcontext *ctx, GLuint mask)
}
void
-fxDDStencilOp (GLcontext *ctx, GLenum sfail, GLenum zfail, GLenum zpass)
+fxDDStencilOpSeparate (GLcontext *ctx, GLenum face, GLenum sfail,
+ GLenum zfail, GLenum zpass)
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
tfxUnitsState *us = &fxMesa->unitsState;
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index a9786db27a..b98d40c65a 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1081,14 +1081,17 @@ _mesa_PopAttrib(void)
? GL_BACK : GL_FRONT);
}
/* front state */
- _mesa_StencilFunc(stencil->Function[0], stencil->Ref[0],
- stencil->ValueMask[0]);
- _mesa_StencilMask(stencil->WriteMask[0]);
- _mesa_StencilOp(stencil->FailFunc[0],
- stencil->ZFailFunc[0],
- stencil->ZPassFunc[0]);
+ _mesa_StencilFuncSeparate(GL_FRONT,
+ stencil->Function[0],
+ stencil->Ref[0],
+ stencil->ValueMask[0]);
+ _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]);
+ _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0],
+ stencil->ZFailFunc[0],
+ stencil->ZPassFunc[0]);
/* back state */
- _mesa_StencilFuncSeparate(GL_BACK, stencil->Function[1],
+ _mesa_StencilFuncSeparate(GL_BACK,
+ stencil->Function[1],
stencil->Ref[1],
stencil->ValueMask[1]);
_mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]);
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 0b4903629c..55bb66cb01 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -5,7 +5,7 @@
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
@@ -687,14 +687,6 @@ struct dd_function_table {
void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
/** Select flat or smooth shading */
void (*ShadeModel)(GLcontext *ctx, GLenum mode);
- /** Set function and reference value for stencil testing */
- void (*StencilFunc)(GLcontext *ctx, GLenum func, GLint ref, GLuint mask);
- /** Control the writing of individual bits in the stencil planes */
- void (*StencilMask)(GLcontext *ctx, GLuint mask);
- /** Set stencil test actions */
- void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass);
- /** Set active stencil face (GL_EXT_stencil_two_side) */
- void (*ActiveStencilFace)(GLcontext *ctx, GLuint face);
/** OpenGL 2.0 two-sided StencilFunc */
void (*StencilFuncSeparate)(GLcontext *ctx, GLenum face, GLenum func,
GLint ref, GLuint mask);
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index 1adfac2dbc..f03d94eb8f 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -127,6 +127,10 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
ctx->Stencil.Function[face] = func;
ctx->Stencil.Ref[face] = ref;
ctx->Stencil.ValueMask[face] = mask;
+ if (ctx->Driver.StencilFuncSeparate) {
+ ctx->Driver.StencilFuncSeparate(ctx, face ? GL_BACK : GL_FRONT,
+ func, ref, mask);
+ }
}
else {
/* set both front and back state */
@@ -141,10 +145,10 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func;
ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref;
ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask;
- }
-
- if (ctx->Driver.StencilFunc) {
- ctx->Driver.StencilFunc( ctx, func, ref, mask );
+ if (ctx->Driver.StencilFuncSeparate) {
+ ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT_AND_BACK,
+ func, ref, mask);
+ }
}
}
@@ -173,6 +177,9 @@ _mesa_StencilMask( GLuint mask )
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.WriteMask[face] = mask;
+ if (ctx->Driver.StencilMaskSeparate) {
+ ctx->Driver.StencilMaskSeparate(ctx, face ? GL_BACK : GL_FRONT, mask);
+ }
}
else {
/* set both front and back state */
@@ -181,10 +188,9 @@ _mesa_StencilMask( GLuint mask )
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask;
- }
-
- if (ctx->Driver.StencilMask) {
- ctx->Driver.StencilMask( ctx, mask );
+ if (ctx->Driver.StencilMaskSeparate) {
+ ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT_AND_BACK, mask);
+ }
}
}
@@ -275,6 +281,10 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
ctx->Stencil.ZFailFunc[face] = zfail;
ctx->Stencil.ZPassFunc[face] = zpass;
ctx->Stencil.FailFunc[face] = fail;
+ if (ctx->Driver.StencilOpSeparate) {
+ ctx->Driver.StencilOpSeparate(ctx, face ? GL_BACK : GL_FRONT,
+ fail, zfail, zpass);
+ }
}
else {
/* set both front and back state */
@@ -289,10 +299,10 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail;
ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass;
ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail;
- }
-
- if (ctx->Driver.StencilOp) {
- ctx->Driver.StencilOp(ctx, fail, zfail, zpass);
+ if (ctx->Driver.StencilOpSeparate) {
+ ctx->Driver.StencilOpSeparate(ctx, GL_FRONT_AND_BACK,
+ fail, zfail, zpass);
+ }
}
}
@@ -317,11 +327,6 @@ _mesa_ActiveStencilFaceEXT(GLenum face)
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)");
- return;
- }
-
- if (ctx->Driver.ActiveStencilFace) {
- ctx->Driver.ActiveStencilFace(ctx, (GLuint) ctx->Stencil.ActiveFace);
}
}
#endif