[PATCH 2/5] d3d10: Handle depth stencil state in d3d10_effect_object_apply().
Henri Verbeet
hverbeet at codeweavers.com
Thu Oct 4 16:42:15 CDT 2012
---
dlls/d3d10/d3d10_private.h | 1 +
dlls/d3d10/effect.c | 21 ++++++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h
index 314faf8..fc9cb41 100644
--- a/dlls/d3d10/d3d10_private.h
+++ b/dlls/d3d10/d3d10_private.h
@@ -75,6 +75,7 @@ struct d3d10_effect_object
union
{
ID3D10RasterizerState *rs;
+ ID3D10DepthStencilState *ds;
ID3D10VertexShader *vs;
ID3D10PixelShader *ps;
ID3D10GeometryShader *gs;
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
index 662bfce..4b26562 100644
--- a/dlls/d3d10/effect.c
+++ b/dlls/d3d10/effect.c
@@ -1347,6 +1347,14 @@ static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr
break;
}
+ case D3D10_EOT_DEPTH_STENCIL_STATE:
+ {
+ ID3D10EffectDepthStencilVariable *dv = variable->lpVtbl->AsDepthStencil(variable);
+ if (FAILED(hr = dv->lpVtbl->GetDepthStencilState(dv, variable_idx, &o->object.ds)))
+ return hr;
+ break;
+ }
+
case D3D10_EOT_VERTEXSHADER:
{
ID3D10EffectShaderVariable *sv = variable->lpVtbl->AsShader(variable);
@@ -1377,7 +1385,6 @@ static HRESULT parse_fx10_object(struct d3d10_effect_object *o, const char **ptr
break;
}
- case D3D10_EOT_DEPTH_STENCIL_STATE:
case D3D10_EOT_BLEND_STATE:
case D3D10_EOT_STENCIL_REF:
case D3D10_EOT_BLEND_FACTOR:
@@ -2170,6 +2177,10 @@ static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
ID3D10Device_RSSetState(device, o->object.rs);
return S_OK;
+ case D3D10_EOT_DEPTH_STENCIL_STATE:
+ ID3D10Device_OMSetDepthStencilState(device, o->object.ds, o->pass->stencil_ref);
+ return S_OK;
+
case D3D10_EOT_VERTEXSHADER:
ID3D10Device_VSSetShader(device, o->object.vs);
return S_OK;
@@ -2182,6 +2193,9 @@ static HRESULT d3d10_effect_object_apply(struct d3d10_effect_object *o)
ID3D10Device_GSSetShader(device, o->object.gs);
return S_OK;
+ case D3D10_EOT_STENCIL_REF:
+ return S_OK;
+
default:
FIXME("Unhandled effect object type %#x.\n", o->type);
return E_FAIL;
@@ -2274,6 +2288,11 @@ static void d3d10_effect_object_destroy(struct d3d10_effect_object *o)
ID3D10RasterizerState_Release(o->object.rs);
break;
+ case D3D10_EOT_DEPTH_STENCIL_STATE:
+ if (o->object.ds)
+ ID3D10DepthStencilState_Release(o->object.ds);
+ break;
+
case D3D10_EOT_VERTEXSHADER:
if (o->object.vs)
ID3D10VertexShader_Release(o->object.vs);
--
1.7.8.6
More information about the wine-patches
mailing list