[PATCH 06/35] d3d11: Don't grab wined3d lock for reference decrementing functions.

Jan Sikorski jsikorski at codeweavers.com
Fri Oct 15 07:26:02 CDT 2021


Except wined3d_texture_decref().

Signed-off-by: Jan Sikorski <jsikorski at codeweavers.com>
---
 dlls/d3d11/async.c       |  4 ----
 dlls/d3d11/buffer.c      |  2 --
 dlls/d3d11/device.c      |  4 ----
 dlls/d3d11/inputlayout.c |  4 ----
 dlls/d3d11/shader.c      | 21 ---------------------
 dlls/d3d11/state.c       | 14 --------------
 dlls/d3d11/view.c        | 16 ----------------
 7 files changed, 65 deletions(-)

diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c
index 4476d56404f..74ba62b3d04 100644
--- a/dlls/d3d11/async.c
+++ b/dlls/d3d11/async.c
@@ -88,11 +88,7 @@ static ULONG STDMETHODCALLTYPE d3d11_query_Release(ID3D11Query *iface)
     if (!refcount)
     {
         ID3D11Device2 *device = query->device;
-
-        wined3d_mutex_lock();
         wined3d_query_decref(query->wined3d_query);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index 180641caef5..ab8471d6f52 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -86,9 +86,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface)
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 764fbece076..f306f9ebc7a 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -375,9 +375,7 @@ static ULONG STDMETHODCALLTYPE d3d11_command_list_Release(ID3D11CommandList *ifa
 
     if (!refcount)
     {
-        wined3d_mutex_lock();
         wined3d_command_list_decref(list->wined3d_list);
-        wined3d_mutex_unlock();
         wined3d_private_store_cleanup(&list->private_store);
         ID3D11Device2_Release(list->device);
         heap_free(list);
@@ -4541,9 +4539,7 @@ static ULONG STDMETHODCALLTYPE d3d_device_inner_Release(IUnknown *iface)
         d3d11_device_context_cleanup(&device->immediate_context);
         if (device->wined3d_device)
         {
-            wined3d_mutex_lock();
             wined3d_device_decref(device->wined3d_device);
-            wined3d_mutex_unlock();
         }
         wine_rb_destroy(&device->sampler_states, NULL, NULL);
         wine_rb_destroy(&device->rasterizer_states, NULL, NULL);
diff --git a/dlls/d3d11/inputlayout.c b/dlls/d3d11/inputlayout.c
index 34d273b31c8..520fa0ba7b3 100644
--- a/dlls/d3d11/inputlayout.c
+++ b/dlls/d3d11/inputlayout.c
@@ -154,11 +154,7 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *ifa
     if (!refcount)
     {
         ID3D11Device2 *device = layout->device;
-
-        wined3d_mutex_lock();
         wined3d_vertex_declaration_decref(layout->wined3d_decl);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index e474ae692d5..eec164a876c 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -86,9 +86,7 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release(ID3D11VertexShader *i
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
@@ -379,11 +377,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface
     if (!refcount)
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
@@ -570,11 +564,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *i
     if (!refcount)
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
@@ -771,11 +761,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade
     if (!refcount)
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
@@ -1273,10 +1259,7 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release(ID3D11PixelShader *ifa
     if (!refcount)
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
@@ -1566,11 +1549,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader
     if (!refcount)
     {
         ID3D11Device2 *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. */
         ID3D11Device2_Release(device);
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index 8fa94a12a66..810217c93b4 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -80,11 +80,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState *iface
     if (!refcount)
     {
         ID3D11Device2 *device = state->device;
-
-        wined3d_mutex_lock();
         wined3d_blend_state_decref(state->wined3d_state);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
@@ -511,9 +507,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStenc
     {
         ID3D11Device2 *device = state->device;
 
-        wined3d_mutex_lock();
         wined3d_depth_stencil_state_decref(state->wined3d_state);
-        wined3d_mutex_unlock();
         ID3D11Device2_Release(device);
     }
 
@@ -908,11 +902,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerSt
     if (!refcount)
     {
         ID3D11Device2 *device = state->device;
-
-        wined3d_mutex_lock();
         wined3d_rasterizer_state_decref(state->wined3d_state);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
@@ -1294,11 +1284,7 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *i
     if (!refcount)
     {
         ID3D11Device2 *device = state->device;
-
-        wined3d_mutex_lock();
         wined3d_sampler_decref(state->wined3d_sampler);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c
index 1679729e15c..89c541fa9ed 100644
--- a/dlls/d3d11/view.c
+++ b/dlls/d3d11/view.c
@@ -979,11 +979,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci
     if (!refcount)
     {
         ID3D11Device2 *device = view->device;
-
-        wined3d_mutex_lock();
         wined3d_rendertarget_view_decref(view->wined3d_view);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
@@ -1421,11 +1417,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
     if (!refcount)
     {
         ID3D11Device2 *device = view->device;
-
-        wined3d_mutex_lock();
         wined3d_rendertarget_view_decref(view->wined3d_view);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
@@ -1867,11 +1859,7 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_Release(ID3D11ShaderRe
     if (!refcount)
     {
         ID3D11Device2 *device = view->device;
-
-        wined3d_mutex_lock();
         wined3d_shader_resource_view_decref(view->wined3d_view);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
@@ -2350,11 +2338,7 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_Release(ID3D11Unorder
     if (!refcount)
     {
         ID3D11Device2 *device = view->device;
-
-        wined3d_mutex_lock();
         wined3d_unordered_access_view_decref(view->wined3d_view);
-        wined3d_mutex_unlock();
-
         ID3D11Device2_Release(device);
     }
 
-- 
2.30.2




More information about the wine-devel mailing list