mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 23:00:36 +00:00
wined3d: Invalidate _SYSMEM location when mapping opengl buffer.
Signed-off-by: Paul Gofman <gofmanp@gmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8863da8f3c
commit
a5ffdff2ed
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue