From fbcce6787af79c7a6e11b45a7403a90a8519522b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 1 Oct 2012 22:48:09 +0200 Subject: [PATCH] d3d10core: Implement d3d10_device_RSSetState(). --- dlls/d3d10core/d3d10core_private.h | 35 +++++++++++++++++------------- dlls/d3d10core/device.c | 6 ++++- dlls/d3d10core/state.c | 9 ++++++++ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index f88355ba30a..4f98c9301c9 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -44,6 +44,8 @@ #define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N') #define TAG_SHDR MAKE_TAG('S', 'H', 'D', 'R') +struct d3d10_device; + struct d3d10_shader_info { const DWORD *shader_code; @@ -68,21 +70,6 @@ void skip_dword_unknown(const char **ptr, unsigned int count) DECLSPEC_HIDDEN; HRESULT parse_dxbc(const char *data, SIZE_T data_size, HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN; -/* IDirect3D10Device */ -struct d3d10_device -{ - IUnknown IUnknown_inner; - ID3D10Device ID3D10Device_iface; - IWineDXGIDeviceParent IWineDXGIDeviceParent_iface; - IUnknown *outer_unk; - LONG refcount; - - struct wined3d_device_parent device_parent; - struct wined3d_device *wined3d_device; -}; - -void d3d10_device_init(struct d3d10_device *device, void *outer_unknown) DECLSPEC_HIDDEN; - /* ID3D10Texture2D */ struct d3d10_texture2d { @@ -248,6 +235,7 @@ struct d3d10_rasterizer_state }; HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state) DECLSPEC_HIDDEN; +struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN; /* ID3D10SamplerState */ struct d3d10_sampler_state @@ -267,6 +255,23 @@ struct d3d10_query HRESULT d3d10_query_init(struct d3d10_query *query) DECLSPEC_HIDDEN; +/* IDirect3D10Device */ +struct d3d10_device +{ + IUnknown IUnknown_inner; + ID3D10Device ID3D10Device_iface; + IWineDXGIDeviceParent IWineDXGIDeviceParent_iface; + IUnknown *outer_unk; + LONG refcount; + + struct wined3d_device_parent device_parent; + struct wined3d_device *wined3d_device; + + struct d3d10_rasterizer_state *rasterizer_state; +}; + +void d3d10_device_init(struct d3d10_device *device, void *outer_unknown) DECLSPEC_HIDDEN; + /* Layered device */ enum dxgi_device_layer_id { diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 00a34a99e2a..d43ee4b90d8 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -342,7 +342,11 @@ static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device *iface) static void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device *iface, ID3D10RasterizerState *rasterizer_state) { - FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state); + struct d3d10_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); + + device->rasterizer_state = unsafe_impl_from_ID3D10RasterizerState(rasterizer_state); } static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device *iface, diff --git a/dlls/d3d10core/state.c b/dlls/d3d10core/state.c index edb20307007..3b5c45f858d 100644 --- a/dlls/d3d10core/state.c +++ b/dlls/d3d10core/state.c @@ -372,6 +372,15 @@ HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state) return S_OK; } +struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d10_rasterizer_state_vtbl); + + return impl_from_ID3D10RasterizerState(iface); +} + static inline struct d3d10_sampler_state *impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) { return CONTAINING_RECORD(iface, struct d3d10_sampler_state, ID3D10SamplerState_iface);