Module: wine Branch: master Commit: e69c28a0f70bfea72efb701833b86fafda1123be URL: http://source.winehq.org/git/wine.git/?a=commit;h=e69c28a0f70bfea72efb701833...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Oct 4 13:53:25 2012 +0200
d3d10core: Implement d3d10_device_OMSetBlendState().
---
dlls/d3d10core/d3d10core_private.h | 4 ++++ dlls/d3d10core/device.c | 8 +++++++- dlls/d3d10core/state.c | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index 2dcd89a..4297adf 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -217,6 +217,7 @@ struct d3d10_blend_state };
HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state) DECLSPEC_HIDDEN; +struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) DECLSPEC_HIDDEN;
/* ID3D10DepthStencilState */ struct d3d10_depthstencil_state @@ -269,6 +270,9 @@ struct d3d10_device struct wined3d_device_parent device_parent; struct wined3d_device *wined3d_device;
+ struct d3d10_blend_state *blend_state; + float blend_factor[4]; + UINT sample_mask; struct d3d10_depthstencil_state *depth_stencil_state; UINT stencil_ref; struct d3d10_rasterizer_state *rasterizer_state; diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index ae3b865..95b337a 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -318,8 +318,14 @@ static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device *ifac static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device *iface, ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask) { - FIXME("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x stub!\n", + struct d3d10_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x.\n", iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask); + + device->blend_state = unsafe_impl_from_ID3D10BlendState(blend_state); + memcpy(device->blend_factor, blend_factor, 4 * sizeof(*blend_factor)); + device->sample_mask = sample_mask; }
static void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device *iface, diff --git a/dlls/d3d10core/state.c b/dlls/d3d10core/state.c index 1d927ce..9e64ea6 100644 --- a/dlls/d3d10core/state.c +++ b/dlls/d3d10core/state.c @@ -140,6 +140,15 @@ HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state) return S_OK; }
+struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d10_blend_state_vtbl); + + return impl_from_ID3D10BlendState(iface); +} + static inline struct d3d10_depthstencil_state *impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface) { return CONTAINING_RECORD(iface, struct d3d10_depthstencil_state, ID3D10DepthStencilState_iface);