Commit 2058505c authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Handle unmappable buffers in wined3d_device_process_vertices() gracefully.

parent bdccebca
......@@ -3340,7 +3340,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
struct wined3d_resource *resource;
struct wined3d_box box = {0};
struct wined3d_shader *vs;
unsigned int i;
unsigned int i, j;
HRESULT hr;
WORD map;
......@@ -3375,7 +3375,20 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
box.left = src_start_idx * e->stride;
box.right = box.left + vertex_count * e->stride;
if (FAILED(wined3d_resource_map(resource, 0, &map_desc, &box, WINED3D_MAP_READ)))
{
ERR("Failed to map resource.\n");
for (j = 0, map = stream_info.use_map; map && j < i; map >>= 1, ++j)
{
if (!(map & 1))
continue;
e = &stream_info.elements[j];
resource = &state->streams[e->stream_idx].buffer->resource;
if (FAILED(wined3d_resource_unmap(resource, 0)))
ERR("Failed to unmap resource.\n");
}
return WINED3DERR_INVALIDCALL;
}
e->data.buffer_object = 0;
e->data.addr += (ULONG_PTR)map_desc.data;
}
......
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