Commit b5a91d12 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10: Also store the depth/stencil state in the stateblock.

parent e2b7354a
...@@ -55,6 +55,7 @@ struct d3d10_stateblock ...@@ -55,6 +55,7 @@ struct d3d10_stateblock
ID3D10RenderTargetView *rtvs[D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT]; ID3D10RenderTargetView *rtvs[D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT];
ID3D10DepthStencilView *dsv; ID3D10DepthStencilView *dsv;
ID3D10DepthStencilState *dss; ID3D10DepthStencilState *dss;
UINT stencil_ref;
ID3D10BlendState *bs; ID3D10BlendState *bs;
float blend_factor[4]; float blend_factor[4];
UINT sample_mask; UINT sample_mask;
...@@ -198,6 +199,11 @@ static void stateblock_cleanup(struct d3d10_stateblock *stateblock) ...@@ -198,6 +199,11 @@ static void stateblock_cleanup(struct d3d10_stateblock *stateblock)
ID3D10DepthStencilView_Release(stateblock->dsv); ID3D10DepthStencilView_Release(stateblock->dsv);
stateblock->dsv = NULL; stateblock->dsv = NULL;
} }
if (stateblock->dss)
{
ID3D10DepthStencilState_Release(stateblock->dss);
stateblock->dss = NULL;
}
if (stateblock->bs) if (stateblock->bs)
{ {
ID3D10BlendState_Release(stateblock->bs); ID3D10BlendState_Release(stateblock->bs);
...@@ -355,6 +361,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Capture(ID3D10StateBlock *ifac ...@@ -355,6 +361,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Capture(ID3D10StateBlock *ifac
if (stateblock->mask.OMRenderTargets) if (stateblock->mask.OMRenderTargets)
ID3D10Device_OMGetRenderTargets(stateblock->device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT, ID3D10Device_OMGetRenderTargets(stateblock->device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT,
stateblock->rtvs, &stateblock->dsv); stateblock->rtvs, &stateblock->dsv);
if (stateblock->mask.OMDepthStencilState)
ID3D10Device_OMGetDepthStencilState(stateblock->device, &stateblock->dss, &stateblock->stencil_ref);
if (stateblock->mask.OMBlendState) if (stateblock->mask.OMBlendState)
ID3D10Device_OMGetBlendState(stateblock->device, &stateblock->bs, ID3D10Device_OMGetBlendState(stateblock->device, &stateblock->bs,
stateblock->blend_factor, &stateblock->sample_mask); stateblock->blend_factor, &stateblock->sample_mask);
...@@ -454,6 +462,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Apply(ID3D10StateBlock *iface) ...@@ -454,6 +462,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Apply(ID3D10StateBlock *iface)
if (stateblock->mask.OMRenderTargets) if (stateblock->mask.OMRenderTargets)
ID3D10Device_OMSetRenderTargets(stateblock->device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT, ID3D10Device_OMSetRenderTargets(stateblock->device, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT,
stateblock->rtvs, stateblock->dsv); stateblock->rtvs, stateblock->dsv);
if (stateblock->mask.OMDepthStencilState)
ID3D10Device_OMSetDepthStencilState(stateblock->device, stateblock->dss, stateblock->stencil_ref);
if (stateblock->mask.OMBlendState) if (stateblock->mask.OMBlendState)
ID3D10Device_OMSetBlendState(stateblock->device, stateblock->bs, ID3D10Device_OMSetBlendState(stateblock->device, stateblock->bs,
stateblock->blend_factor, stateblock->sample_mask); stateblock->blend_factor, stateblock->sample_mask);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment