Commit 154f612c authored by Jan Sikorski's avatar Jan Sikorski Committed by Alexandre Julliard

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

parent 6d8cc776
......@@ -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;
}
......
......@@ -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)
{
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment