X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fstencil.c;h=604167ae2d7ff325990ba224649f566dbda49bf9;hb=11929895332213363628d632f7f9f6d79b5124d1;hp=612ad38dcc1472ea2862b008fffed0e919ad56df;hpb=c2408838c83719cb133332c7adac71ef50503259;p=mesa.git diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 612ad38dcc1..604167ae2d7 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -48,7 +48,7 @@ #include "glheader.h" -#include "imports.h" + #include "context.h" #include "macros.h" #include "stencil.h" @@ -157,7 +157,8 @@ _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLui ctx->Stencil.Ref[0] == ref && ctx->Stencil.Ref[1] == ref) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.Function[0] = frontfunc; ctx->Stencil.Function[1] = backfunc; ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; @@ -194,7 +195,8 @@ stencil_func(struct gl_context *ctx, GLenum func, GLint ref, GLuint mask) ctx->Stencil.ValueMask[face] == mask && ctx->Stencil.Ref[face] == ref) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.Function[face] = func; ctx->Stencil.Ref[face] = ref; ctx->Stencil.ValueMask[face] = mask; @@ -215,7 +217,8 @@ stencil_func(struct gl_context *ctx, GLenum func, GLint ref, GLuint mask) ctx->Stencil.Ref[0] == ref && ctx->Stencil.Ref[1] == ref) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; 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; @@ -279,7 +282,8 @@ _mesa_StencilMask( GLuint mask ) */ if (ctx->Stencil.WriteMask[face] == mask) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.WriteMask[face] = mask; /* Only propagate the change to the driver if EXT_stencil_two_side @@ -294,7 +298,8 @@ _mesa_StencilMask( GLuint mask ) if (ctx->Stencil.WriteMask[0] == mask && ctx->Stencil.WriteMask[1] == mask) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask; if (ctx->Driver.StencilMaskSeparate) { ctx->Driver.StencilMaskSeparate(ctx, @@ -313,9 +318,9 @@ _mesa_StencilMask( GLuint mask ) * \param zfail action to take when stencil test passes, but depth test fails. * \param zpass action to take when stencil test passes and the depth test * passes (or depth testing is not enabled). - * + * * \sa glStencilOp(). - * + * * Verifies the parameters and updates the respective fields in * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies * the driver via the dd_function_table::StencilOp callback. @@ -331,7 +336,8 @@ stencil_op(struct gl_context *ctx, GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZPassFunc[face] == zpass && ctx->Stencil.FailFunc[face] == fail) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.ZFailFunc[face] = zfail; ctx->Stencil.ZPassFunc[face] = zpass; ctx->Stencil.FailFunc[face] = fail; @@ -352,7 +358,8 @@ stencil_op(struct gl_context *ctx, GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.FailFunc[0] == fail && ctx->Stencil.FailFunc[1] == fail) return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; 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; @@ -435,7 +442,8 @@ stencil_op_separate(struct gl_context *ctx, GLenum face, GLenum sfail, if (ctx->Stencil.ZFailFunc[0] != zfail || ctx->Stencil.ZPassFunc[0] != zpass || ctx->Stencil.FailFunc[0] != sfail){ - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.ZFailFunc[0] = zfail; ctx->Stencil.ZPassFunc[0] = zpass; ctx->Stencil.FailFunc[0] = sfail; @@ -448,7 +456,8 @@ stencil_op_separate(struct gl_context *ctx, GLenum face, GLenum sfail, if (ctx->Stencil.ZFailFunc[1] != zfail || ctx->Stencil.ZPassFunc[1] != zpass || ctx->Stencil.FailFunc[1] != sfail) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; ctx->Stencil.ZFailFunc[1] = zfail; ctx->Stencil.ZPassFunc[1] = zpass; ctx->Stencil.FailFunc[1] = sfail; @@ -507,7 +516,8 @@ static void stencil_func_separate(struct gl_context *ctx, GLenum face, GLenum func, GLint ref, GLuint mask) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; if (face != GL_BACK) { /* set front */ @@ -564,7 +574,8 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) static void stencil_mask_separate(struct gl_context *ctx, GLenum face, GLuint mask) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewStencil ? 0 : _NEW_STENCIL); + ctx->NewDriverState |= ctx->DriverFlags.NewStencil; if (face != GL_BACK) { ctx->Stencil.WriteMask[0] = mask;