[PATCH 2/6] wined3d: Just mark the stencil write mask dirty in IWineD3DDeviceImpl_ClearSurface().

Henri Verbeet hverbeet at codeweavers.com
Thu Mar 25 03:32:36 CDT 2010


---
 dlls/wined3d/device.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b25c4ec..fab9e65 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4397,10 +4397,11 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
             glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
             IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_TWOSIDEDSTENCILMODE));
         }
+        glStencilMask(~0U);
+        IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_STENCILWRITEMASK));
         glClearStencil(Stencil);
         checkGLcall("glClearStencil");
         glMask = glMask | GL_STENCIL_BUFFER_BIT;
-        glStencilMask(0xFFFFFFFF);
     }
 
     if (Flags & WINED3DCLEAR_ZBUFFER) {
@@ -4484,10 +4485,6 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
         }
     }
 
-    /* Restore the old values (why..?) */
-    if (Flags & WINED3DCLEAR_STENCIL) {
-        glStencilMask(This->stateBlock->renderState[WINED3DRS_STENCILWRITEMASK]);
-    }
     if (Flags & WINED3DCLEAR_TARGET) {
         DWORD mask = This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE];
         glColorMask(mask & WINED3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE,
-- 
1.6.4.4




More information about the wine-patches mailing list