Module: wine Branch: master Commit: 0610d1eec9a287e22831a40427e6a9a38f3f745f URL: http://source.winehq.org/git/wine.git/?a=commit;h=0610d1eec9a287e22831a40427...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Jun 12 17:03:50 2012 +0200
wined3d: Invalidate the entire buffer on maps with WINED3DLOCK_DISCARD.
---
dlls/wined3d/buffer.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index f11edf4..4735595 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1011,7 +1011,20 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN flags = buffer_sanitize_flags(buffer, flags); if (!(flags & WINED3DLOCK_READONLY)) { - if (!buffer_add_dirty_area(buffer, offset, size)) return E_OUTOFMEMORY; + if (flags & WINED3DLOCK_DISCARD) + { + /* DISCARD invalidates the entire buffer, regardless of the + * specified offset and size. Some applications also depend on the + * entire buffer being uploaded in that case. Two such + * applications are Port Royale and Darkstar One. */ + if (!buffer_add_dirty_area(buffer, 0, 0)) + return E_OUTOFMEMORY; + } + else + { + if (!buffer_add_dirty_area(buffer, offset, size)) + return E_OUTOFMEMORY; + } }
count = ++buffer->resource.map_count;