Jan Sikorski : d3d11: Don't grab wined3d lock for reference incrementing functions.

Alexandre Julliard julliard at winehq.org
Fri Oct 15 15:40:05 CDT 2021


Module: wine
Branch: master
Commit: 02195f3ccf41e561694026a3bb73a07c650c83c4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=02195f3ccf41e561694026a3bb73a07c650c83c4

Author: Jan Sikorski <jsikorski at codeweavers.com>
Date:   Fri Oct 15 14:26:00 2021 +0200

d3d11: Don't grab wined3d lock for reference incrementing functions.

Except wined3d_texture_incref().

Signed-off-by: Jan Sikorski <jsikorski at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/async.c       |  2 --
 dlls/d3d11/buffer.c      |  2 --
 dlls/d3d11/inputlayout.c |  2 --
 dlls/d3d11/shader.c      | 12 ------------
 dlls/d3d11/state.c       |  8 --------
 dlls/d3d11/view.c        |  8 --------
 6 files changed, 34 deletions(-)

diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c
index fd83871220d..4476d56404f 100644
--- a/dlls/d3d11/async.c
+++ b/dlls/d3d11/async.c
@@ -72,9 +72,7 @@ static ULONG STDMETHODCALLTYPE d3d11_query_AddRef(ID3D11Query *iface)
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(query->device);
-        wined3d_mutex_lock();
         wined3d_query_incref(query->wined3d_query);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index 09d495c3f61..180641caef5 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -69,9 +69,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface)
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(buffer->device);
-        wined3d_mutex_lock();
         wined3d_buffer_incref(buffer->wined3d_buffer);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
diff --git a/dlls/d3d11/inputlayout.c b/dlls/d3d11/inputlayout.c
index 6b59dd994b3..34d273b31c8 100644
--- a/dlls/d3d11/inputlayout.c
+++ b/dlls/d3d11/inputlayout.c
@@ -138,9 +138,7 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_AddRef(ID3D11InputLayout *ifac
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(layout->device);
-        wined3d_mutex_lock();
         wined3d_vertex_declaration_incref(layout->wined3d_decl);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index 0d19b74ff0b..e474ae692d5 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -69,9 +69,7 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef(ID3D11VertexShader *if
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(shader->device);
-        wined3d_mutex_lock();
         wined3d_shader_incref(shader->wined3d_shader);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -365,9 +363,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface)
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(shader->device);
-        wined3d_mutex_lock();
         wined3d_shader_incref(shader->wined3d_shader);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -558,9 +554,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *if
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(shader->device);
-        wined3d_mutex_lock();
         wined3d_shader_incref(shader->wined3d_shader);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -761,9 +755,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(shader->device);
-        wined3d_mutex_lock();
         wined3d_shader_incref(shader->wined3d_shader);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -1265,9 +1257,7 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef(ID3D11PixelShader *ifac
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(shader->device);
-        wined3d_mutex_lock();
         wined3d_shader_incref(shader->wined3d_shader);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -1560,9 +1550,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef(ID3D11ComputeShader *
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(shader->device);
-        wined3d_mutex_lock();
         wined3d_shader_incref(shader->wined3d_shader);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index d31ea16bbe8..8fa94a12a66 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -64,9 +64,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_AddRef(ID3D11BlendState *iface)
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(state->device);
-        wined3d_mutex_lock();
         wined3d_blend_state_incref(state->wined3d_state);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -496,9 +494,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStenci
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(state->device);
-        wined3d_mutex_lock();
         wined3d_depth_stencil_state_incref(state->wined3d_state);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -896,9 +892,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_AddRef(ID3D11RasterizerSta
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(state->device);
-        wined3d_mutex_lock();
         wined3d_rasterizer_state_incref(state->wined3d_state);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -1284,9 +1278,7 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *if
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(state->device);
-        wined3d_mutex_lock();
         wined3d_sampler_incref(state->wined3d_sampler);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c
index 734c9619e5b..1679729e15c 100644
--- a/dlls/d3d11/view.c
+++ b/dlls/d3d11/view.c
@@ -963,9 +963,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_AddRef(ID3D11DepthStencil
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(view->device);
-        wined3d_mutex_lock();
         wined3d_rendertarget_view_incref(view->wined3d_view);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -1407,9 +1405,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_AddRef(ID3D11RenderTarget
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(view->device);
-        wined3d_mutex_lock();
         wined3d_rendertarget_view_incref(view->wined3d_view);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -1855,9 +1851,7 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_AddRef(ID3D11ShaderRes
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(view->device);
-        wined3d_mutex_lock();
         wined3d_shader_resource_view_incref(view->wined3d_view);
-        wined3d_mutex_unlock();
     }
 
     return refcount;
@@ -2340,9 +2334,7 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_AddRef(ID3D11Unordere
     if (refcount == 1)
     {
         ID3D11Device2_AddRef(view->device);
-        wined3d_mutex_lock();
         wined3d_unordered_access_view_incref(view->wined3d_view);
-        wined3d_mutex_unlock();
     }
 
     return refcount;




More information about the wine-cvs mailing list