From 5903d5d7db4ffbfb87d1b9616d13ea05d19dd171 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 27 Sep 2013 16:57:01 +0200
Subject: wined3d: Fence blit operations.

---
 dlls/wined3d/cs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index a4b996e..5603a37 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1709,6 +1709,10 @@ static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
             op->src_surface, &op->src_rect,
             op->flags, &op->fx, op->filter);
 
+    wined3d_resource_dec_fence(&op->dst_surface->container->resource);
+    if (op->src_surface && op->src_surface != op->dst_surface)
+        wined3d_resource_dec_fence(&op->src_surface->container->resource);
+
     return sizeof(*op);
 }
 
@@ -1730,6 +1734,10 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
     if (fx)
         op->fx = *fx;
 
+    wined3d_resource_inc_fence(&dst_surface->container->resource);
+    if (src_surface && src_surface != dst_surface)
+        wined3d_resource_inc_fence(&src_surface->container->resource);
+
     cs->ops->submit(cs, sizeof(*op));
 }
 
-- 
2.1.3

