diff options
author | Brian Paul <[email protected]> | 2009-02-19 14:36:58 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2009-03-13 17:38:36 -0700 |
commit | 66eea4e1045476b6e6602470bd813a7ee37aada7 (patch) | |
tree | f775321a8ef674b61677c10098ccbcffc779e722 /src/mesa/main/stencil.c | |
parent | e428cf3afd464b1b823ba63ff815635ad282d2ae (diff) |
mesa: fix/update/restore comments related to two-sided stencil (cherry picked from commit a304cc6cca2ee21c3b25041abf882ef0616e5244)
Diffstat (limited to 'src/mesa/main/stencil.c')
-rw-r--r-- | src/mesa/main/stencil.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 6d6bbb2286b..e4a255d0a7e 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -27,6 +27,23 @@ * \file stencil.c * Stencil operations. * + * Note: There's some conflict between GL_EXT_stencil_two_side and + * OpenGL 2.0's two-sided stencil feature. + * + * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the + * front OR back face state (as set by glActiveStencilFaceEXT) is set. + * + * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the + * front AND back state. + * + * Also, note that GL_ATI_separate_stencil is different as well: + * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs. + * glStencilFuncSeparate(GLenum face, GLenum func, ...). + * + * This problem is solved by keeping three sets of stencil state: + * state[0] = GL_FRONT state. + * state[1] = OpenGL 2.0 / GL_ATI_separate_stencil GL_BACK state. + * state[2] = GL_EXT_stencil_two_side GL_BACK state. */ @@ -542,7 +559,7 @@ _mesa_init_stencil(GLcontext *ctx) { ctx->Stencil.Enabled = GL_FALSE; ctx->Stencil.TestTwoSide = GL_FALSE; - ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 1 = GL_BACK */ + ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 2 = GL_BACK */ ctx->Stencil.Function[0] = GL_ALWAYS; ctx->Stencil.Function[1] = GL_ALWAYS; ctx->Stencil.Function[2] = GL_ALWAYS; |