d3d11: Implement d3d11_rendertarget_view_GetDevice().

This commit is contained in:
Józef Kucia 2015-09-09 01:35:46 +02:00 committed by Alexandre Julliard
parent 9a0d564683
commit 2b211cab69
2 changed files with 11 additions and 7 deletions

View File

@ -181,7 +181,7 @@ struct d3d_rendertarget_view
struct wined3d_rendertarget_view *wined3d_view; struct wined3d_rendertarget_view *wined3d_view;
D3D11_RENDER_TARGET_VIEW_DESC desc; D3D11_RENDER_TARGET_VIEW_DESC desc;
ID3D11Resource *resource; ID3D11Resource *resource;
ID3D10Device1 *device; ID3D11Device *device;
}; };
HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource, HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource,

View File

@ -827,7 +827,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_rendertarget_view_decref(view->wined3d_view); wined3d_rendertarget_view_decref(view->wined3d_view);
ID3D11Resource_Release(view->resource); ID3D11Resource_Release(view->resource);
ID3D10Device1_Release(view->device); ID3D11Device_Release(view->device);
wined3d_private_store_cleanup(&view->private_store); wined3d_private_store_cleanup(&view->private_store);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, view); HeapFree(GetProcessHeap(), 0, view);
@ -839,7 +839,12 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
static void STDMETHODCALLTYPE d3d11_rendertarget_view_GetDevice(ID3D11RenderTargetView *iface, static void STDMETHODCALLTYPE d3d11_rendertarget_view_GetDevice(ID3D11RenderTargetView *iface,
ID3D11Device **device) ID3D11Device **device)
{ {
FIXME("iface %p, device %p stub!\n", iface, device); struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface);
TRACE("iface %p, device %p.\n", iface, device);
*device = view->device;
ID3D11Device_AddRef(*device);
} }
static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_GetPrivateData(ID3D11RenderTargetView *iface, static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_GetPrivateData(ID3D11RenderTargetView *iface,
@ -955,8 +960,7 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetDevice(ID3D10RenderTarg
TRACE("iface %p, device %p.\n", iface, device); TRACE("iface %p, device %p.\n", iface, device);
*device = (ID3D10Device *)view->device; ID3D11Device_QueryInterface(view->device, &IID_ID3D10Device, (void **)device);
ID3D10Device_AddRef(*device);
} }
static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_GetPrivateData(ID3D10RenderTargetView *iface, static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_GetPrivateData(ID3D10RenderTargetView *iface,
@ -1137,8 +1141,8 @@ static HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, st
wined3d_mutex_unlock(); wined3d_mutex_unlock();
view->resource = resource; view->resource = resource;
ID3D11Resource_AddRef(resource); ID3D11Resource_AddRef(resource);
view->device = &device->ID3D10Device1_iface; view->device = &device->ID3D11Device_iface;
ID3D10Device1_AddRef(view->device); ID3D11Device_AddRef(view->device);
return S_OK; return S_OK;
} }