Replace ctx->Driver.StencilOp/Func/Mask() functions with
ctx->Driver.Stencil*Separate() functions.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -81,7 +81,8 @@ static __inline__ GLuint i830PackColor(GLuint format,
|
||||
}
|
||||
}
|
||||
|
||||
static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
|
||||
static void
|
||||
i830StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
|
||||
GLuint mask)
|
||||
{
|
||||
i830ContextPtr imesa = I830_CONTEXT(ctx);
|
||||
@@ -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,7 +151,8 @@ static void i830StencilMask(GLcontext *ctx, GLuint mask)
|
||||
STENCIL_WRITE_MASK(mask));
|
||||
}
|
||||
|
||||
static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
|
||||
static void
|
||||
i830StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
|
||||
GLenum zpass)
|
||||
{
|
||||
i830ContextPtr imesa = I830_CONTEXT(ctx);
|
||||
@@ -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.
|
||||
*/
|
||||
|
@@ -40,7 +40,8 @@
|
||||
#include "i830_context.h"
|
||||
#include "i830_reg.h"
|
||||
|
||||
static void i830StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
|
||||
static void
|
||||
i830StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
|
||||
GLuint mask)
|
||||
{
|
||||
i830ContextPtr i830 = I830_CONTEXT(ctx);
|
||||
@@ -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,7 +82,8 @@ static void i830StencilMask(GLcontext *ctx, GLuint mask)
|
||||
STENCIL_WRITE_MASK(mask));
|
||||
}
|
||||
|
||||
static void i830StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
|
||||
static void
|
||||
i830StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
|
||||
GLenum zpass)
|
||||
{
|
||||
i830ContextPtr i830 = I830_CONTEXT(ctx);
|
||||
@@ -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 )
|
||||
|
@@ -44,7 +44,8 @@
|
||||
|
||||
|
||||
|
||||
static void i915StencilFunc(GLcontext *ctx, GLenum func, GLint ref,
|
||||
static void
|
||||
i915StencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
|
||||
GLuint mask)
|
||||
{
|
||||
i915ContextPtr i915 = I915_CONTEXT(ctx);
|
||||
@@ -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,7 +87,8 @@ static void i915StencilMask(GLcontext *ctx, GLuint mask)
|
||||
}
|
||||
|
||||
|
||||
static void i915StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
|
||||
static void
|
||||
i915StencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
|
||||
GLenum zpass)
|
||||
{
|
||||
i915ContextPtr i915 = I915_CONTEXT(ctx);
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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->Driver.StencilFuncSeparate( ctx, GL_FRONT,
|
||||
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->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] );
|
||||
|
@@ -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;
|
||||
|
@@ -513,7 +513,8 @@ static void mgaDDLightModelfv(GLcontext *ctx, GLenum pname,
|
||||
*/
|
||||
|
||||
|
||||
static void mgaDDStencilFunc(GLcontext *ctx, GLenum func, GLint ref,
|
||||
static void
|
||||
mgaDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, GLint ref,
|
||||
GLuint mask)
|
||||
{
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
|
||||
@@ -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,7 +568,8 @@ static void mgaDDStencilMask(GLcontext *ctx, GLuint mask)
|
||||
mmesa->hw.stencil |= MGA_FIELD( S_swtmsk, mask );
|
||||
}
|
||||
|
||||
static void mgaDDStencilOp(GLcontext *ctx, GLenum fail, GLenum zfail,
|
||||
static void
|
||||
mgaDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, GLenum zfail,
|
||||
GLenum zpass)
|
||||
{
|
||||
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
|
||||
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -1435,7 +1435,8 @@ static void r200UpdateClipPlanes( GLcontext *ctx )
|
||||
* Stencil
|
||||
*/
|
||||
|
||||
static void r200StencilFunc( GLcontext *ctx, GLenum func,
|
||||
static void
|
||||
r200StencilFuncSeparate( GLcontext *ctx, GLenum face, GLenum func,
|
||||
GLint ref, GLuint mask )
|
||||
{
|
||||
r200ContextPtr rmesa = R200_CONTEXT(ctx);
|
||||
@@ -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,7 +1491,8 @@ static void r200StencilMask( GLcontext *ctx, GLuint mask )
|
||||
(ctx->Stencil.WriteMask[0] << R200_STENCIL_WRITEMASK_SHIFT);
|
||||
}
|
||||
|
||||
static void r200StencilOp( GLcontext *ctx, GLenum fail,
|
||||
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:
|
||||
|
@@ -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,7 +791,7 @@ static void r300StencilMask(GLcontext * ctx, GLuint mask)
|
||||
}
|
||||
|
||||
|
||||
static void r300StencilOp(GLcontext * ctx, GLenum fail,
|
||||
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;
|
||||
|
@@ -1273,7 +1273,8 @@ static void radeonUpdateClipPlanes( GLcontext *ctx )
|
||||
* Stencil
|
||||
*/
|
||||
|
||||
static void radeonStencilFunc( GLcontext *ctx, GLenum func,
|
||||
static void
|
||||
radeonStencilFuncSeparate( GLcontext *ctx, GLenum face, GLenum func,
|
||||
GLint ref, GLuint mask )
|
||||
{
|
||||
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
|
||||
@@ -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,7 +1329,7 @@ static void radeonStencilMask( GLcontext *ctx, GLuint mask )
|
||||
(ctx->Stencil.WriteMask[0] << RADEON_STENCIL_WRITEMASK_SHIFT);
|
||||
}
|
||||
|
||||
static void radeonStencilOp( GLcontext *ctx, GLenum fail,
|
||||
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;
|
||||
|
@@ -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; */
|
||||
}
|
||||
|
@@ -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:
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -476,7 +476,8 @@ static void tdfxUpdateStencil( GLcontext *ctx )
|
||||
}
|
||||
|
||||
|
||||
static void tdfxDDStencilFunc( GLcontext *ctx, GLenum func,
|
||||
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,7 +495,8 @@ static void tdfxDDStencilMask( GLcontext *ctx, GLuint mask )
|
||||
fxMesa->new_state |= TDFX_NEW_STENCIL;
|
||||
}
|
||||
|
||||
static void tdfxDDStencilOp( GLcontext *ctx, GLenum sfail,
|
||||
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;
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -1081,14 +1081,17 @@ _mesa_PopAttrib(void)
|
||||
? GL_BACK : GL_FRONT);
|
||||
}
|
||||
/* front state */
|
||||
_mesa_StencilFunc(stencil->Function[0], stencil->Ref[0],
|
||||
_mesa_StencilFuncSeparate(GL_FRONT,
|
||||
stencil->Function[0],
|
||||
stencil->Ref[0],
|
||||
stencil->ValueMask[0]);
|
||||
_mesa_StencilMask(stencil->WriteMask[0]);
|
||||
_mesa_StencilOp(stencil->FailFunc[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]);
|
||||
|
@@ -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);
|
||||
|
@@ -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.StencilFuncSeparate) {
|
||||
ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT_AND_BACK,
|
||||
func, ref, mask);
|
||||
}
|
||||
|
||||
if (ctx->Driver.StencilFunc) {
|
||||
ctx->Driver.StencilFunc( ctx, 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.StencilMaskSeparate) {
|
||||
ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT_AND_BACK, mask);
|
||||
}
|
||||
|
||||
if (ctx->Driver.StencilMask) {
|
||||
ctx->Driver.StencilMask( ctx, 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.StencilOpSeparate) {
|
||||
ctx->Driver.StencilOpSeparate(ctx, GL_FRONT_AND_BACK,
|
||||
fail, zfail, zpass);
|
||||
}
|
||||
|
||||
if (ctx->Driver.StencilOp) {
|
||||
ctx->Driver.StencilOp(ctx, 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
|
||||
|
Reference in New Issue
Block a user