d3d11: Implement d3d11_buffer_GetDevice().

This commit is contained in:
Józef Kucia 2015-09-03 00:06:55 +02:00 committed by Alexandre Julliard
parent c05e8d1460
commit ba9d80bacd
2 changed files with 12 additions and 9 deletions

View File

@ -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;
}

View File

@ -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,