[PATCH 3/5] d3d10core: Implement d3d10_blend_state_GetDesc().
Henri Verbeet
hverbeet at codeweavers.com
Wed Dec 12 16:10:41 CST 2012
---
dlls/d3d10core/d3d10core_private.h | 4 +++-
dlls/d3d10core/device.c | 6 ++++--
dlls/d3d10core/state.c | 9 +++++++--
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h
index b32825e..8164e2f 100644
--- a/dlls/d3d10core/d3d10core_private.h
+++ b/dlls/d3d10core/d3d10core_private.h
@@ -216,9 +216,11 @@ struct d3d10_blend_state
{
ID3D10BlendState ID3D10BlendState_iface;
LONG refcount;
+
+ D3D10_BLEND_DESC desc;
};
-HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state) DECLSPEC_HIDDEN;
+HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, const D3D10_BLEND_DESC *desc) DECLSPEC_HIDDEN;
struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) DECLSPEC_HIDDEN;
/* ID3D10DepthStencilState */
diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c
index 29f1648..1025b42 100644
--- a/dlls/d3d10core/device.c
+++ b/dlls/d3d10core/device.c
@@ -1390,6 +1390,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device *ifa
TRACE("iface %p, desc %p, blend_state %p.\n", iface, desc, blend_state);
+ if (!desc)
+ return E_INVALIDARG;
+
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
@@ -1397,8 +1400,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device *ifa
return E_OUTOFMEMORY;
}
- hr = d3d10_blend_state_init(object);
- if (FAILED(hr))
+ if (FAILED(hr = d3d10_blend_state_init(object, desc)))
{
WARN("Failed to initialize blend state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
diff --git a/dlls/d3d10core/state.c b/dlls/d3d10core/state.c
index 387d561..4092acc 100644
--- a/dlls/d3d10core/state.c
+++ b/dlls/d3d10core/state.c
@@ -114,7 +114,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D1
static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState *iface,
D3D10_BLEND_DESC *desc)
{
- FIXME("iface %p, desc %p stub!\n", iface, desc);
+ struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface);
+
+ TRACE("iface %p, desc %p.\n", iface, desc);
+
+ *desc = state->desc;
}
static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl =
@@ -132,10 +136,11 @@ static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl =
d3d10_blend_state_GetDesc,
};
-HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state)
+HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, const D3D10_BLEND_DESC *desc)
{
state->ID3D10BlendState_iface.lpVtbl = &d3d10_blend_state_vtbl;
state->refcount = 1;
+ state->desc = *desc;
return S_OK;
}
--
1.7.8.6
More information about the wine-patches
mailing list