d3d9: 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:
parent
98e2fd376a
commit
c9b5e2a7c1
|
@ -199,11 +199,9 @@ static HRESULT WINAPI d3d9_vertexbuffer_Lock(IDirect3DVertexBuffer9 *iface, UINT
|
|||
|
||||
wined3d_box_set(&wined3d_box, offset, 0, offset + size, 1, 0, 1);
|
||||
|
||||
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;
|
||||
|
@ -215,9 +213,7 @@ static HRESULT WINAPI d3d9_vertexbuffer_Unlock(IDirect3DVertexBuffer9 *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;
|
||||
}
|
||||
|
@ -535,11 +531,9 @@ static HRESULT WINAPI d3d9_indexbuffer_Lock(IDirect3DIndexBuffer9 *iface,
|
|||
|
||||
wined3d_box_set(&wined3d_box, offset, 0, offset + size, 1, 0, 1);
|
||||
|
||||
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;
|
||||
|
@ -551,9 +545,7 @@ static HRESULT WINAPI d3d9_indexbuffer_Unlock(IDirect3DIndexBuffer9 *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;
|
||||
}
|
||||
|
|
|
@ -246,10 +246,8 @@ static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface,
|
|||
if (rect)
|
||||
wined3d_box_set(&box, rect->left, rect->top, rect->right, rect->bottom, 0, 1);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx,
|
||||
&map_desc, rect ? &box : NULL, wined3dmapflags_from_d3dmapflags(flags, 0));
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
|
|
|
@ -144,12 +144,10 @@ static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *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 d3d9_volume_UnlockBox(IDirect3DVolume9 *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;
|
||||
|
|
Loading…
Reference in New Issue