[9/16] WineD3D: Move WINED3DRS_STENCILWRITEMASK to the state table
Stefan Dösinger
stefan at codeweavers.com
Fri Dec 8 11:41:05 CST 2006
-------------- next part --------------
From 071278fdfc91c01c2ecd4a314240f184126132f7 Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Fri, 8 Dec 2006 16:59:11 +0100
Subject: [PATCH] WineD3D: Move WINED3DRS_STENCILWRITEMASK to the state table
---
dlls/wined3d/device.c | 9 +--------
dlls/wined3d/state.c | 7 ++++++-
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9df255c..c7d516a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3372,15 +3372,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl
case WINED3DRS_CCW_STENCILZFAIL :
case WINED3DRS_CCW_STENCILPASS :
case WINED3DRS_EDGEANTIALIAS :
- StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
- break;
-
case WINED3DRS_STENCILWRITEMASK :
- {
- glStencilMask(Value);
- TRACE("glStencilMask(%u)\n", Value);
- checkGLcall("glStencilMask");
- }
+ StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_FOGENABLE :
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 2e1bf60..535c93f 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -627,6 +627,11 @@ state_stencil(DWORD state, IWineD3DState
}
}
+static void state_stencilwrite(DWORD state, IWineD3DStateBlockImpl *stateblock) {
+ glStencilMask(stateblock->renderState[WINED3DRS_STENCILWRITEMASK]);
+ checkGLcall("glStencilMask");
+}
+
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
@@ -689,7 +694,7 @@ const struct StateEntry StateTable[] =
{ /* 56, WINED3DRS_STENCILFUNC */ STATE_RENDER(WINED3DRS_STENCILENABLE), state_stencil },
{ /* 57, WINED3DRS_STENCILREF */ STATE_RENDER(WINED3DRS_STENCILENABLE), state_stencil },
{ /* 58, WINED3DRS_STENCILMASK */ STATE_RENDER(WINED3DRS_STENCILENABLE), state_stencil },
- { /* 59, WINED3DRS_STENCILWRITEMASK */ STATE_RENDER(WINED3DRS_STENCILWRITEMASK), state_unknown },
+ { /* 59, WINED3DRS_STENCILWRITEMASK */ STATE_RENDER(WINED3DRS_STENCILWRITEMASK), state_stencilwrite },
{ /* 60, WINED3DRS_TEXTUREFACTOR */ STATE_RENDER(WINED3DRS_TEXTUREFACTOR), state_texfactor },
/* A BIG hole. If wanted, 'fixed' states like the vertex type or the bound shaders can be put here */
{ /* 61, Undefined */ 0, state_undefined },
--
1.4.2.4
More information about the wine-patches
mailing list