d3d9: Use wined3d_resource_map() in d3d9_vertexbuffer_Lock().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-08-30 11:48:19 +02:00 committed by Alexandre Julliard
parent 438dae524d
commit a0400a686c
1 changed files with 7 additions and 1 deletions

View File

@ -183,14 +183,20 @@ static HRESULT WINAPI d3d9_vertexbuffer_Lock(IDirect3DVertexBuffer9 *iface, UINT
void **data, DWORD flags)
{
struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface);
struct wined3d_map_desc wined3d_map_desc;
struct wined3d_box wined3d_box = {0};
HRESULT hr;
TRACE("iface %p, offset %u, size %u, data %p, flags %#x.\n",
iface, offset, size, data, flags);
wined3d_box.left = offset;
wined3d_box.right = offset + size;
wined3d_mutex_lock();
hr = wined3d_buffer_map(buffer->wined3d_buffer, offset, size, (BYTE **)data, flags);
hr = wined3d_resource_map(wined3d_buffer_get_resource(buffer->wined3d_buffer),
0, &wined3d_map_desc, &wined3d_box, flags);
wined3d_mutex_unlock();
*data = wined3d_map_desc.data;
return hr;
}