Henri Verbeet : d3d10core: Implement d3d10_depthstencil_state_GetDesc().
Alexandre Julliard
julliard at winehq.org
Fri Dec 14 14:09:59 CST 2012
Module: wine
Branch: master
Commit: d1582890207f5cf520b58cae8d697220c128a809
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d1582890207f5cf520b58cae8d697220c128a809
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu Dec 13 22:08:58 2012 +0100
d3d10core: Implement d3d10_depthstencil_state_GetDesc().
---
dlls/d3d10core/d3d10core_private.h | 5 ++++-
dlls/d3d10core/device.c | 6 ++++--
dlls/d3d10core/state.c | 9 +++++++--
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h
index dd7d8f5..391207b 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 3ee13ae..13bd9a6 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 0992273..a34df32 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;
}
More information about the wine-cvs
mailing list