d3d10core: Implement d3d10_depthstencil_state_GetDesc().

This commit is contained in:
Henri Verbeet 2012-12-13 22:08:58 +01:00 committed by Alexandre Julliard
parent ecdddd6067
commit d158289020
3 changed files with 15 additions and 5 deletions

View File

@ -231,9 +231,12 @@ struct d3d10_depthstencil_state
{
ID3D10DepthStencilState ID3D10DepthStencilState_iface;
LONG refcount;
D3D10_DEPTH_STENCIL_DESC desc;
};
HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state) DECLSPEC_HIDDEN;
HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state,
const D3D10_DEPTH_STENCIL_DESC *desc) DECLSPEC_HIDDEN;
struct d3d10_depthstencil_state *unsafe_impl_from_ID3D10DepthStencilState(
ID3D10DepthStencilState *iface) DECLSPEC_HIDDEN;

View File

@ -1435,6 +1435,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Devi
TRACE("iface %p, desc %p, depth_stencil_state %p.\n", iface, desc, depth_stencil_state);
if (!desc)
return E_INVALIDARG;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
@ -1442,8 +1445,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Devi
return E_OUTOFMEMORY;
}
hr = d3d10_depthstencil_state_init(object);
if (FAILED(hr))
if (FAILED(hr = d3d10_depthstencil_state_init(object, desc)))
{
WARN("Failed to initialize depthstencil state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);

View File

@ -253,7 +253,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateDataInterfac
static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDesc(ID3D10DepthStencilState *iface,
D3D10_DEPTH_STENCIL_DESC *desc)
{
FIXME("iface %p, desc %p stub!\n", iface, desc);
struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
*desc = state->desc;
}
static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
@ -271,10 +275,11 @@ static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
d3d10_depthstencil_state_GetDesc,
};
HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state)
HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state, const D3D10_DEPTH_STENCIL_DESC *desc)
{
state->ID3D10DepthStencilState_iface.lpVtbl = &d3d10_depthstencil_state_vtbl;
state->refcount = 1;
state->desc = *desc;
return S_OK;
}