d3d8: Don't grab wined3d lock for wined3d_resource_map/unmap().

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jan Sikorski 2021-10-15 14:26:23 +02:00 committed by Alexandre Julliard
parent 6d8cc776f5
commit 154f612cd9
3 changed files with 0 additions and 14 deletions

View file

@ -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;
}

View file

@ -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)
{

View file

@ -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;