=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11: Implement d3d11_buffer_GetDevice ().

Alexandre Julliard julliard at wine.codeweavers.com
Thu Sep 3 07:34:28 CDT 2015


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Sep  3 00:06:55 2015 +0200

d3d11: Implement d3d11_buffer_GetDevice().

---

 dlls/d3d11/buffer.c        | 19 +++++++++++--------
 dlls/d3d11/d3d11_private.h |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index 6fec784..d2e3156 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -71,7 +71,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface)
 
     if (refcount == 1)
     {
-        ID3D10Device1_AddRef(buffer->device);
+        ID3D11Device_AddRef(buffer->device);
         wined3d_mutex_lock();
         wined3d_buffer_incref(buffer->wined3d_buffer);
         wined3d_mutex_unlock();
@@ -89,14 +89,14 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
 
     if (!refcount)
     {
-        ID3D10Device1 *device = buffer->device;
+        ID3D11Device *device = buffer->device;
 
         wined3d_mutex_lock();
         wined3d_buffer_decref(buffer->wined3d_buffer);
         wined3d_mutex_unlock();
         /* Release the device last, it may cause the wined3d device to be
          * destroyed. */
-        ID3D10Device1_Release(device);
+        ID3D11Device_Release(device);
     }
 
     return refcount;
@@ -104,7 +104,11 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
 
 static void STDMETHODCALLTYPE d3d11_buffer_GetDevice(ID3D11Buffer *iface, ID3D11Device **device)
 {
-    FIXME("iface %p, device %p stub!\n", iface, device);
+    struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface);
+
+    TRACE("iface %p, device %p.\n", iface, device);
+
+    *device = buffer->device;
 }
 
 static HRESULT STDMETHODCALLTYPE d3d11_buffer_GetPrivateData(ID3D11Buffer *iface,
@@ -225,8 +229,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10
 
     TRACE("iface %p, device %p.\n", iface, device);
 
-    *device = (ID3D10Device *)buffer->device;
-    ID3D10Device_AddRef(*device);
+    ID3D11Device_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device);
 }
 
 static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface,
@@ -389,8 +392,8 @@ HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device,
     }
     wined3d_mutex_unlock();
 
-    buffer->device = &device->ID3D10Device1_iface;
-    ID3D10Device1_AddRef(buffer->device);
+    buffer->device = &device->ID3D11Device_iface;
+    ID3D11Device_AddRef(buffer->device);
 
     return S_OK;
 }
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index 12e4df2..2f56a5a 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -142,7 +142,7 @@ struct d3d_buffer
 
     struct wined3d_private_store private_store;
     struct wined3d_buffer *wined3d_buffer;
-    ID3D10Device1 *device;
+    ID3D11Device *device;
 };
 
 HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device,




More information about the wine-cvs mailing list