Module: wine Branch: master Commit: e348fefa2e97dfa84ebf4292f44f18a08e027544 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e348fefa2e97dfa84ebf4292f4...
Author: Józef Kucia jkucia@codeweavers.com Date: Fri Oct 2 01:31:50 2015 +0200
d3d11: Implement {d3d10, d3d11}_geometry_shader_GetDevice().
Signed-off-by: Józef Kucia jkucia@codeweavers.com
---
dlls/d3d11/d3d11_private.h | 1 + dlls/d3d11/shader.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 8ff4847..4abf6f5 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -249,6 +249,7 @@ struct d3d_geometry_shader
struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; + ID3D11Device *device; };
HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index aa3ac5e..27083de 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -495,9 +495,15 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade
if (!refcount) { + ID3D11Device *device = shader->device; + wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); wined3d_mutex_unlock(); + + /* Release the device last, it may cause the wined3d device to be + * destroyed. */ + ID3D11Device_Release(device); }
return refcount; @@ -506,7 +512,12 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade static void STDMETHODCALLTYPE d3d11_geometry_shader_GetDevice(ID3D11GeometryShader *iface, ID3D11Device **device) { - FIXME("iface %p, device %p stub!\n", iface, device); + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = shader->device; + ID3D11Device_AddRef(*device); }
static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_GetPrivateData(ID3D11GeometryShader *iface, @@ -593,7 +604,11 @@ static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release(ID3D10GeometryShade
static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice(ID3D10GeometryShader *iface, ID3D10Device **device) { - FIXME("iface %p, device %p stub!\n", iface, device); + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + ID3D11Device_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); }
static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData(ID3D10GeometryShader *iface, @@ -697,6 +712,9 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader, stru } wined3d_mutex_unlock();
+ shader->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(shader->device); + return S_OK; }