From 4e89934c223fd43aab2679042c7c808c8200aa68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 8 Sep 2014 14:53:57 +0200
Subject: wined3d: Don't sync on redundant discard calls.

---
 dlls/wined3d/buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index d743f0a..1081247 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1055,7 +1055,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
             wined3d_resource_allocate_sysmem(&buffer->resource);
             wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory);
         }
-        else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)))
+        else if(!(flags & (WINED3D_MAP_NOOVERWRITE | WINED3D_MAP_READONLY)) && !buffer->ignore_discard)
         {
             wined3d_resource_wait_fence(&buffer->resource);
             /* Writing to the (otherwise worker thread controlled)
-- 
2.1.3

