[PATCH 1/5] d3d10core: Implement d3d10_device_RSSetState().
Henri Verbeet
hverbeet at codeweavers.com
Mon Oct 1 15:48:09 CDT 2012
---
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 f88355b..4f98c93 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 00a34a9..d43ee4b 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 edb2030..3b5c45f 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);
--
1.7.8.6
More information about the wine-patches
mailing list