d3d11: Fix refcounting for shaders.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-04-26 13:19:57 +02:00 committed by Alexandre Julliard
parent df5576f3cd
commit 51d58f9962
1 changed files with 32 additions and 0 deletions

View File

@ -635,6 +635,14 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface)
TRACE("%p increasing refcount to %u.\n", shader, refcount); TRACE("%p increasing refcount to %u.\n", shader, refcount);
if (refcount == 1)
{
ID3D11Device_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
}
return refcount; return refcount;
} }
@ -831,6 +839,14 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *if
TRACE("%p increasing refcount to %u.\n", shader, refcount); TRACE("%p increasing refcount to %u.\n", shader, refcount);
if (refcount == 1)
{
ID3D11Device_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
}
return refcount; return refcount;
} }
@ -1037,6 +1053,14 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader
TRACE("%p increasing refcount to %u.\n", shader, refcount); TRACE("%p increasing refcount to %u.\n", shader, refcount);
if (refcount == 1)
{
ID3D11Device_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
}
return refcount; return refcount;
} }
@ -1890,6 +1914,14 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef(ID3D11ComputeShader *
TRACE("%p increasing refcount to %u.\n", shader, refcount); TRACE("%p increasing refcount to %u.\n", shader, refcount);
if (refcount == 1)
{
ID3D11Device_AddRef(shader->device);
wined3d_mutex_lock();
wined3d_shader_incref(shader->wined3d_shader);
wined3d_mutex_unlock();
}
return refcount; return refcount;
} }