Commit ba9d80ba authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11: Implement d3d11_buffer_GetDevice().

parent c05e8d14
...@@ -71,7 +71,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface) ...@@ -71,7 +71,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface)
if (refcount == 1) if (refcount == 1)
{ {
ID3D10Device1_AddRef(buffer->device); ID3D11Device_AddRef(buffer->device);
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_buffer_incref(buffer->wined3d_buffer); wined3d_buffer_incref(buffer->wined3d_buffer);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
...@@ -89,14 +89,14 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface) ...@@ -89,14 +89,14 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
if (!refcount) if (!refcount)
{ {
ID3D10Device1 *device = buffer->device; ID3D11Device *device = buffer->device;
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_buffer_decref(buffer->wined3d_buffer);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
/* Release the device last, it may cause the wined3d device to be /* Release the device last, it may cause the wined3d device to be
* destroyed. */ * destroyed. */
ID3D10Device1_Release(device); ID3D11Device_Release(device);
} }
return refcount; return refcount;
...@@ -104,7 +104,11 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface) ...@@ -104,7 +104,11 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
static void STDMETHODCALLTYPE d3d11_buffer_GetDevice(ID3D11Buffer *iface, ID3D11Device **device) 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, static HRESULT STDMETHODCALLTYPE d3d11_buffer_GetPrivateData(ID3D11Buffer *iface,
...@@ -225,8 +229,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10 ...@@ -225,8 +229,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10
TRACE("iface %p, device %p.\n", iface, device); TRACE("iface %p, device %p.\n", iface, device);
*device = (ID3D10Device *)buffer->device; ID3D11Device_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device);
ID3D10Device_AddRef(*device);
} }
static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface, static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface,
...@@ -389,8 +392,8 @@ HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device, ...@@ -389,8 +392,8 @@ HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device,
} }
wined3d_mutex_unlock(); wined3d_mutex_unlock();
buffer->device = &device->ID3D10Device1_iface; buffer->device = &device->ID3D11Device_iface;
ID3D10Device1_AddRef(buffer->device); ID3D11Device_AddRef(buffer->device);
return S_OK; return S_OK;
} }
...@@ -142,7 +142,7 @@ struct d3d_buffer ...@@ -142,7 +142,7 @@ struct d3d_buffer
struct wined3d_private_store private_store; struct wined3d_private_store private_store;
struct wined3d_buffer *wined3d_buffer; struct wined3d_buffer *wined3d_buffer;
ID3D10Device1 *device; ID3D11Device *device;
}; };
HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device, HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment