Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/d3d9/tests/device.c | 4 ++-- dlls/wined3d/buffer.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 5658d10958..056c39b8bd 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -13243,14 +13243,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);
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index fb19060d10..501e5d5e42 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1063,7 +1063,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);