From 7d971714259b5bb89113e4eb4e1325cc4c89213a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 31 Aug 2016 11:27:52 +0200 Subject: [PATCH] wined3d: Use resource mapping functions in process_vertices_strided(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/device.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c2a8c552655..3f163a65f63 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2885,6 +2885,8 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO DWORD DestFVF) { struct wined3d_matrix mat, proj_mat, view_mat, world_mat; + struct wined3d_map_desc map_desc; + struct wined3d_box box = {0}; struct wined3d_viewport vp; UINT vertex_size; unsigned int i; @@ -2925,11 +2927,14 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO doClip = FALSE; vertex_size = get_flexible_vertex_size(DestFVF); - if (FAILED(hr = wined3d_buffer_map(dest, dwDestIndex * vertex_size, dwCount * vertex_size, &dest_ptr, 0))) + box.left = dwDestIndex * vertex_size; + box.right = box.left + dwCount * vertex_size; + if (FAILED(hr = wined3d_resource_map(&dest->resource, 0, &map_desc, &box, 0))) { WARN("Failed to map buffer, hr %#x.\n", hr); return hr; } + dest_ptr = map_desc.data; wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); @@ -3139,7 +3144,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO } } - wined3d_buffer_unmap(dest); + wined3d_resource_unmap(&dest->resource, 0); return WINED3D_OK; }