Stefan Dösinger : wined3d: Keep the selected stencil setup face set to GL_FRONT.

Alexandre Julliard julliard at winehq.org
Thu Sep 20 10:30:07 CDT 2007


Module: wine
Branch: master
Commit: 05cef43308e72c6a507c9a6cc5b491c58e1760d0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=05cef43308e72c6a507c9a6cc5b491c58e1760d0

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Sep 14 12:07:48 2007 +0200

wined3d: Keep the selected stencil setup face set to GL_FRONT.

---

 dlls/wined3d/state.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 77b728e..fbd95ed 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -692,8 +692,14 @@ state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *c
         glEnable(GL_STENCIL_TEST);
         checkGLcall("glEnable GL_STENCIL_TEST");
 
-        renderstate_stencil_twosided(stateblock, GL_FRONT, func, ref, mask, stencilFail, depthFail, stencilPass);
+        /* Apply back first, then front. This function calls glActiveStencilFaceEXT,
+         * which has an effect on the code below too. If we apply the front face
+         * afterwards, we are sure that the active stencil face is set to front,
+         * and other stencil functions which do not use two sided stencil do not have
+         * to set it back
+         */
         renderstate_stencil_twosided(stateblock, GL_BACK, func_ccw, ref, mask, stencilFail_ccw, depthFail_ccw, stencilPass_ccw);
+        renderstate_stencil_twosided(stateblock, GL_FRONT, func, ref, mask, stencilFail, depthFail, stencilPass);
     } else if(onesided_enable) {
         if(GL_SUPPORT(EXT_STENCIL_TWO_SIDE)) {
             glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);




More information about the wine-cvs mailing list