[PATCH 1/5] d3d10: Also store the depth/stencil state in the stateblock.
Henri Verbeet
hverbeet at codeweavers.com
Thu Sep 18 03:56:25 CDT 2014
---
dlls/d3d10/stateblock.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dlls/d3d10/stateblock.c b/dlls/d3d10/stateblock.c
index 73d4b1b..72466a1 100644
--- a/dlls/d3d10/stateblock.c
+++ b/dlls/d3d10/stateblock.c
@@ -55,6 +55,7 @@ struct d3d10_stateblock
ID3D10RenderTargetView *rtvs[D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT];
ID3D10DepthStencilView *dsv;
ID3D10DepthStencilState *dss;
+ UINT stencil_ref;
ID3D10BlendState *bs;
float blend_factor[4];
UINT sample_mask;
@@ -198,6 +199,11 @@ static void stateblock_cleanup(struct d3d10_stateblock *stateblock)
ID3D10DepthStencilView_Release(stateblock->dsv);
stateblock->dsv = NULL;
}
+ if (stateblock->dss)
+ {
+ ID3D10DepthStencilState_Release(stateblock->dss);
+ stateblock->dss = NULL;
+ }
if (stateblock->bs)
{
ID3D10BlendState_Release(stateblock->bs);
@@ -355,6 +361,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Capture(ID3D10StateBlock *ifac
if (stateblock->mask.OMRenderTargets)
ID3D10Device_OMGetRenderTargets(stateblock->device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT,
stateblock->rtvs, &stateblock->dsv);
+ if (stateblock->mask.OMDepthStencilState)
+ ID3D10Device_OMGetDepthStencilState(stateblock->device, &stateblock->dss, &stateblock->stencil_ref);
if (stateblock->mask.OMBlendState)
ID3D10Device_OMGetBlendState(stateblock->device, &stateblock->bs,
stateblock->blend_factor, &stateblock->sample_mask);
@@ -454,6 +462,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Apply(ID3D10StateBlock *iface)
if (stateblock->mask.OMRenderTargets)
ID3D10Device_OMSetRenderTargets(stateblock->device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT,
stateblock->rtvs, stateblock->dsv);
+ if (stateblock->mask.OMDepthStencilState)
+ ID3D10Device_OMSetDepthStencilState(stateblock->device, stateblock->dss, stateblock->stencil_ref);
if (stateblock->mask.OMBlendState)
ID3D10Device_OMSetBlendState(stateblock->device, stateblock->bs,
stateblock->blend_factor, stateblock->sample_mask);
--
1.7.10.4
More information about the wine-patches
mailing list