diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index dd7d8f5c5c..391207b612 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -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; diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 3ee13ae062..13bd9a6a5f 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -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); diff --git a/dlls/d3d10core/state.c b/dlls/d3d10core/state.c index 099227390b..a34df328bd 100644 --- a/dlls/d3d10core/state.c +++ b/dlls/d3d10core/state.c @@ -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; }