=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11: Implement ID3D10BlendState1 interface.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 20 11:28:30 CDT 2015


Module: wine
Branch: master
Commit: 0912adee670dc8846897af99e61b4a4918974bcc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0912adee670dc8846897af99e61b4a4918974bcc

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Oct 20 01:46:42 2015 +0200

d3d11: Implement ID3D10BlendState1 interface.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/d3d11_private.h |  4 ++--
 dlls/d3d11/device.c        |  2 +-
 dlls/d3d11/state.c         | 47 ++++++++++++++++++++++++++++------------------
 3 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index 39236ab..b8df609 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -279,11 +279,11 @@ struct d3d_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *i
 HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d_shader_signature *s) DECLSPEC_HIDDEN;
 void shader_free_signature(struct wined3d_shader_signature *s) DECLSPEC_HIDDEN;
 
-/* ID3D11BlendState, ID3D10BlendState */
+/* ID3D11BlendState, ID3D10BlendState1 */
 struct d3d_blend_state
 {
     ID3D11BlendState ID3D11BlendState_iface;
-    ID3D10BlendState ID3D10BlendState_iface;
+    ID3D10BlendState1 ID3D10BlendState1_iface;
     LONG refcount;
 
     struct wined3d_private_store private_store;
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index c471810..e0f5f4d 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3042,7 +3042,7 @@ static void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device1 *iface,
     TRACE("iface %p, blend_state %p, blend_factor %p, sample_mask %p.\n",
             iface, blend_state, blend_factor, sample_mask);
 
-    if ((*blend_state = device->blend_state ? &device->blend_state->ID3D10BlendState_iface : NULL))
+    if ((*blend_state = device->blend_state ? (ID3D10BlendState *)&device->blend_state->ID3D10BlendState1_iface : NULL))
         ID3D10BlendState_AddRef(*blend_state);
     wined3d_mutex_lock();
     memcpy(blend_factor, device->blend_factor, 4 * sizeof(*blend_factor));
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index 2151389..502ed9a 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -47,11 +47,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_blend_state_QueryInterface(ID3D11BlendSta
         return S_OK;
     }
 
-    if (IsEqualGUID(riid, &IID_ID3D10BlendState)
+    if (IsEqualGUID(riid, &IID_ID3D10BlendState1)
+            || IsEqualGUID(riid, &IID_ID3D10BlendState)
             || IsEqualGUID(riid, &IID_ID3D10DeviceChild))
     {
-        ID3D10BlendState_AddRef(&state->ID3D10BlendState_iface);
-        *object = &state->ID3D10BlendState_iface;
+        ID3D10BlendState1_AddRef(&state->ID3D10BlendState1_iface);
+        *object = &state->ID3D10BlendState1_iface;
         return S_OK;
     }
 
@@ -159,14 +160,14 @@ static const struct ID3D11BlendStateVtbl d3d11_blend_state_vtbl =
 
 /* ID3D10BlendState methods */
 
-static inline struct d3d_blend_state *impl_from_ID3D10BlendState(ID3D10BlendState *iface)
+static inline struct d3d_blend_state *impl_from_ID3D10BlendState(ID3D10BlendState1 *iface)
 {
-    return CONTAINING_RECORD(iface, struct d3d_blend_state, ID3D10BlendState_iface);
+    return CONTAINING_RECORD(iface, struct d3d_blend_state, ID3D10BlendState1_iface);
 }
 
 /* IUnknown methods */
 
-static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendState *iface,
+static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendState1 *iface,
         REFIID riid, void **object)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
@@ -176,7 +177,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendSta
     return d3d11_blend_state_QueryInterface(&state->ID3D11BlendState_iface, riid, object);
 }
 
-static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState *iface)
+static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState1 *iface)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
 
@@ -185,7 +186,7 @@ static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState *iface)
     return d3d11_blend_state_AddRef(&state->ID3D11BlendState_iface);
 }
 
-static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface)
+static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState1 *iface)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
 
@@ -196,7 +197,7 @@ static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface
 
 /* ID3D10DeviceChild methods */
 
-static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState *iface, ID3D10Device **device)
+static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState1 *iface, ID3D10Device **device)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
 
@@ -205,7 +206,7 @@ static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState *ifac
     ID3D11Device_QueryInterface(state->device, &IID_ID3D10Device, (void **)device);
 }
 
-static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState *iface,
+static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState1 *iface,
         REFGUID guid, UINT *data_size, void *data)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
@@ -216,7 +217,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendSta
     return d3d_get_private_data(&state->private_store, guid, data_size, data);
 }
 
-static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendState *iface,
+static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendState1 *iface,
         REFGUID guid, UINT data_size, const void *data)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
@@ -227,7 +228,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendSta
     return d3d_set_private_data(&state->private_store, guid, data_size, data);
 }
 
-static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState *iface,
+static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState1 *iface,
         REFGUID guid, const IUnknown *data)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
@@ -239,8 +240,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D1
 
 /* ID3D10BlendState methods */
 
-static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState *iface,
-        D3D10_BLEND_DESC *desc)
+static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState1 *iface, D3D10_BLEND_DESC *desc)
 {
     struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
     const D3D11_BLEND_DESC *d3d11_desc = &state->desc;
@@ -262,7 +262,16 @@ static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState *iface,
     }
 }
 
-static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl =
+static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc1(ID3D10BlendState1 *iface, D3D10_BLEND_DESC1 *desc)
+{
+    struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
+
+    TRACE("iface %p, desc %p.\n", iface, desc);
+
+    memcpy(desc, &state->desc, sizeof(*desc));
+}
+
+static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl =
 {
     /* IUnknown methods */
     d3d10_blend_state_QueryInterface,
@@ -275,13 +284,15 @@ static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl =
     d3d10_blend_state_SetPrivateDataInterface,
     /* ID3D10BlendState methods */
     d3d10_blend_state_GetDesc,
+    /* ID3D10BlendState1 methods */
+    d3d10_blend_state_GetDesc1,
 };
 
 HRESULT d3d_blend_state_init(struct d3d_blend_state *state, struct d3d_device *device,
         const D3D11_BLEND_DESC *desc)
 {
     state->ID3D11BlendState_iface.lpVtbl = &d3d11_blend_state_vtbl;
-    state->ID3D10BlendState_iface.lpVtbl = &d3d10_blend_state_vtbl;
+    state->ID3D10BlendState1_iface.lpVtbl = &d3d10_blend_state_vtbl;
     state->refcount = 1;
     wined3d_mutex_lock();
     wined3d_private_store_init(&state->private_store);
@@ -306,9 +317,9 @@ struct d3d_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *ifac
 {
     if (!iface)
         return NULL;
-    assert(iface->lpVtbl == &d3d10_blend_state_vtbl);
+    assert(iface->lpVtbl == (ID3D10BlendStateVtbl *)&d3d10_blend_state_vtbl);
 
-    return impl_from_ID3D10BlendState(iface);
+    return impl_from_ID3D10BlendState((ID3D10BlendState1 *)iface);
 }
 
 /* ID3D11DepthStencilState methods */




More information about the wine-cvs mailing list