mesa: add ctx->Stencil._Enabled field
Only true if stenciling is enabled, and there's a stencil buffer.
This commit is contained in:
@@ -1012,6 +1012,7 @@ struct gl_stencil_attrib
|
|||||||
GLboolean Enabled; /**< Enabled flag */
|
GLboolean Enabled; /**< Enabled flag */
|
||||||
GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */
|
GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */
|
||||||
GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */
|
GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */
|
||||||
|
GLboolean _Enabled; /**< Enabled and stencil buffer present */
|
||||||
GLboolean _TestTwoSide;
|
GLboolean _TestTwoSide;
|
||||||
GLubyte _BackFace; /**< Current back stencil state (1 or 2) */
|
GLubyte _BackFace; /**< Current back stencil state (1 or 2) */
|
||||||
GLenum Function[3]; /**< Stencil function */
|
GLenum Function[3]; /**< Stencil function */
|
||||||
|
@@ -490,7 +490,7 @@ _mesa_update_state_locked( GLcontext *ctx )
|
|||||||
if (new_state & _NEW_LIGHT)
|
if (new_state & _NEW_LIGHT)
|
||||||
_mesa_update_lighting( ctx );
|
_mesa_update_lighting( ctx );
|
||||||
|
|
||||||
if (new_state & _NEW_STENCIL)
|
if (new_state & (_NEW_STENCIL | _NEW_BUFFERS))
|
||||||
_mesa_update_stencil( ctx );
|
_mesa_update_stencil( ctx );
|
||||||
|
|
||||||
#if FEATURE_pixel_transfer
|
#if FEATURE_pixel_transfer
|
||||||
|
@@ -536,7 +536,11 @@ _mesa_update_stencil(GLcontext *ctx)
|
|||||||
{
|
{
|
||||||
const GLint face = ctx->Stencil._BackFace;
|
const GLint face = ctx->Stencil._BackFace;
|
||||||
|
|
||||||
ctx->Stencil._TestTwoSide =
|
ctx->Stencil._Enabled = (ctx->Stencil.Enabled &&
|
||||||
|
ctx->DrawBuffer->Visual.stencilBits > 0);
|
||||||
|
|
||||||
|
ctx->Stencil._TestTwoSide =
|
||||||
|
ctx->Stencil._Enabled &&
|
||||||
(ctx->Stencil.Function[0] != ctx->Stencil.Function[face] ||
|
(ctx->Stencil.Function[0] != ctx->Stencil.Function[face] ||
|
||||||
ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] ||
|
ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] ||
|
||||||
ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] ||
|
ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] ||
|
||||||
|
Reference in New Issue
Block a user