From 154f612cd9b503d2de61c708a15a41be4a65385f Mon Sep 17 00:00:00 2001 From: Jan Sikorski Date: Fri, 15 Oct 2021 14:26:23 +0200 Subject: [PATCH] d3d8: Don't grab wined3d lock for wined3d_resource_map/unmap(). Signed-off-by: Jan Sikorski Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d8/buffer.c | 8 -------- dlls/d3d8/surface.c | 2 -- dlls/d3d8/volume.c | 4 ---- 3 files changed, 14 deletions(-) diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index 9eb98bfc2f2..6ab21512472 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -198,11 +198,9 @@ static HRESULT WINAPI d3d8_vertexbuffer_Lock(IDirect3DVertexBuffer8 *iface, UINT wined3d_box.left = offset; wined3d_box.right = offset + size; - wined3d_mutex_lock(); wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc, &wined3d_box, wined3dmapflags_from_d3dmapflags(flags, buffer->usage)); - wined3d_mutex_unlock(); *data = wined3d_map_desc.data; return hr; @@ -214,9 +212,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_Unlock(IDirect3DVertexBuffer8 *iface) TRACE("iface %p.\n", iface); - wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock(); return D3D_OK; } @@ -529,11 +525,9 @@ static HRESULT WINAPI d3d8_indexbuffer_Lock(IDirect3DIndexBuffer8 *iface, UINT o wined3d_box.left = offset; wined3d_box.right = offset + size; - wined3d_mutex_lock(); wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc, &wined3d_box, wined3dmapflags_from_d3dmapflags(flags, buffer->usage)); - wined3d_mutex_unlock(); *data = wined3d_map_desc.data; return hr; @@ -545,9 +539,7 @@ static HRESULT WINAPI d3d8_indexbuffer_Unlock(IDirect3DIndexBuffer8 *iface) TRACE("iface %p.\n", iface); - wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock(); return D3D_OK; } diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index c3d28efba20..5fd8cf4d44b 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -269,9 +269,7 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface) TRACE("iface %p.\n", iface); - wined3d_mutex_lock(); hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); - wined3d_mutex_unlock(); if (hr == WINEDDERR_NOTLOCKED) { diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c index 9dc68e850d4..6d0d6f7cb22 100644 --- a/dlls/d3d8/volume.c +++ b/dlls/d3d8/volume.c @@ -144,12 +144,10 @@ static HRESULT WINAPI d3d8_volume_LockBox(IDirect3DVolume8 *iface, TRACE("iface %p, locked_box %p, box %p, flags %#x.\n", iface, locked_box, box, flags); - wined3d_mutex_lock(); if (FAILED(hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, &map_desc, (const struct wined3d_box *)box, wined3dmapflags_from_d3dmapflags(flags, 0)))) map_desc.data = NULL; - wined3d_mutex_unlock(); locked_box->RowPitch = map_desc.row_pitch; locked_box->SlicePitch = map_desc.slice_pitch; @@ -167,9 +165,7 @@ static HRESULT WINAPI d3d8_volume_UnlockBox(IDirect3DVolume8 *iface) TRACE("iface %p.\n", iface); - wined3d_mutex_lock(); hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); - wined3d_mutex_unlock(); if (hr == WINEDDERR_NOTLOCKED) return D3DERR_INVALIDCALL;