[PATCH 3/8] d3d11: Implement d3d11_depthstencil_view_GetDevice().
Józef Kucia
jkucia at codeweavers.com
Mon Sep 7 18:12:43 CDT 2015
---
dlls/d3d11/d3d11_private.h | 2 +-
dlls/d3d11/view.c | 16 ++++++++++------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index c737273..5549c9c 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -160,7 +160,7 @@ struct d3d_depthstencil_view
struct wined3d_rendertarget_view *wined3d_view;
D3D10_DEPTH_STENCIL_VIEW_DESC desc;
ID3D10Resource *resource;
- ID3D10Device1 *device;
+ ID3D11Device *device;
};
HRESULT d3d_depthstencil_view_init(struct d3d_depthstencil_view *view, struct d3d_device *device,
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c
index 2d9e5d8..331808b 100644
--- a/dlls/d3d11/view.c
+++ b/dlls/d3d11/view.c
@@ -418,7 +418,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci
wined3d_mutex_lock();
wined3d_rendertarget_view_decref(view->wined3d_view);
ID3D10Resource_Release(view->resource);
- ID3D10Device1_Release(view->device);
+ ID3D11Device_Release(view->device);
wined3d_private_store_cleanup(&view->private_store);
wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, view);
@@ -430,7 +430,12 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci
static void STDMETHODCALLTYPE d3d11_depthstencil_view_GetDevice(ID3D11DepthStencilView *iface,
ID3D11Device **device)
{
- FIXME("iface %p, device %p stub!\n", iface, device);
+ struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface);
+
+ TRACE("iface %p, device %p.\n", iface, device);
+
+ *device = view->device;
+ ID3D11Device_AddRef(*device);
}
static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_view_GetPrivateData(ID3D11DepthStencilView *iface,
@@ -537,8 +542,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetDevice(ID3D10DepthStenc
TRACE("iface %p, device %p.\n", iface, device);
- *device = (ID3D10Device *)view->device;
- ID3D10Device_AddRef(*device);
+ ID3D11Device_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
}
static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_GetPrivateData(ID3D10DepthStencilView *iface,
@@ -709,8 +713,8 @@ HRESULT d3d_depthstencil_view_init(struct d3d_depthstencil_view *view, struct d3
wined3d_mutex_unlock();
view->resource = resource;
ID3D10Resource_AddRef(resource);
- view->device = &device->ID3D10Device1_iface;
- ID3D10Device1_AddRef(view->device);
+ view->device = &device->ID3D11Device_iface;
+ ID3D11Device_AddRef(view->device);
return S_OK;
}
--
2.4.6
More information about the wine-patches
mailing list