Commit a5ffdff2 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

wined3d: Invalidate _SYSMEM location when mapping opengl buffer.

parent 8863da8f
......@@ -13256,14 +13256,14 @@ static void test_vertex_buffer_read_write(void)
hr = IDirect3DVertexBuffer9_Lock(buffer, 0, sizeof(tri), (void **)&data, 0);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
for (i = 0; i < 3; ++i)
todo_wine ok(data[i] == 3.0f, "Got unexpected value %.8e, i %u.\n", data[i], i);
ok(data[i] == 3.0f, "Got unexpected value %.8e, i %u.\n", data[i], i);
hr = IDirect3DVertexBuffer9_Unlock(buffer);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DVertexBuffer9_Lock(buffer, 0, sizeof(tri), (void **)&data, D3DLOCK_NOOVERWRITE);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
for (i = 0; i < 3; ++i)
todo_wine ok(data[i] == 3.0f, "Got unexpected value %.8e, i %u.\n", data[i], i);
ok(data[i] == 3.0f, "Got unexpected value %.8e, i %u.\n", data[i], i);
hr = IDirect3DVertexBuffer9_Unlock(buffer);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
......
......@@ -1057,7 +1057,10 @@ static HRESULT wined3d_buffer_gl_map(struct wined3d_buffer_gl *buffer_gl,
wined3d_buffer_load_location(&buffer_gl->b, context, WINED3D_LOCATION_BUFFER);
if (flags & WINED3D_MAP_WRITE)
{
wined3d_buffer_invalidate_location(&buffer_gl->b, WINED3D_LOCATION_SYSMEM);
buffer_invalidate_bo_range(&buffer_gl->b, dirty_offset, dirty_size);
}
if ((flags & WINED3D_MAP_DISCARD) && buffer_gl->b.resource.heap_memory)
wined3d_buffer_evict_sysmem(&buffer_gl->b);
......
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