ctx->Driver.Stencil*Separate() functions.
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;
}
}
-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;
}
}
-static void ffbDDStencilMask(GLcontext *ctx, GLuint mask)
+static void
+ffbDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
}
}
-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;
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]);
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;
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;
}
}
}
-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;
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);
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;
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.
*/
#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);
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);
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;
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 )
-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 );
(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);
}
-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);
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;
}
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] );
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;
*/
-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;
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);
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;
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;
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;
* 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) |
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);
(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);
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:
}
}
-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) |
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);
}
-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);
/* 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;
* 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) |
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);
(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);
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;
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; */
}
}
-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;
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);
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;
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;
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:
#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;
}
static void
-sisDDStencilMask( GLcontext * ctx, GLuint mask )
+sisDDStencilMaskSeparate( GLcontext * ctx, GLenum face, GLuint mask )
{
if (!ctx->Visual.stencilBits)
return;
}
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;
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;
}
}
-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);
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);
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);
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;
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);
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);
}
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;
}
void
-fxDDStencilMask (GLcontext *ctx, GLuint mask)
+fxDDStencilMaskSeparate (GLcontext *ctx, GLenum face, GLuint mask)
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
tfxUnitsState *us = &fxMesa->unitsState;
}
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;
? 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]);
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
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);
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 */
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);
+ }
}
}
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 */
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);
+ }
}
}
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 */
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);
+ }
}
}
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)");
- return;
- }
-
- if (ctx->Driver.ActiveStencilFace) {
- ctx->Driver.ActiveStencilFace(ctx, (GLuint) ctx->Stencil.ActiveFace);
}
}
#endif