Henri Verbeet : wined3d: Avoid using the CPU blitter for clearing converted surfaces that aren' t current on the CPU.

Alexandre Julliard julliard at winehq.org
Mon Jul 17 15:37:19 CDT 2017


Module: wine
Branch: master
Commit: 990be0ba5010def7e9a1f0b5312df6a77c7b6cda
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=990be0ba5010def7e9a1f0b5312df6a77c7b6cda

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Jul 17 14:01:41 2017 +0200

wined3d: Avoid using the CPU blitter for clearing converted surfaces that aren't current on the CPU.

Since that would imply reading them back, with associated format conversion.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/surface.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 58a4388..c143256 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2551,17 +2551,14 @@ static BOOL ffp_blitter_use_cpu_clear(struct wined3d_rendertarget_view *view)
     struct wined3d_texture *texture;
 
     resource = view->resource;
-    if (resource->pool == WINED3D_POOL_SYSTEM_MEM)
-        return TRUE;
-
     if (resource->type == WINED3D_RTYPE_BUFFER)
-        return FALSE;
+        return resource->pool == WINED3D_POOL_SYSTEM_MEM;
 
     texture = texture_from_resource(resource);
-    if (!(texture->flags & WINED3D_TEXTURE_PIN_SYSMEM))
-        return FALSE;
+    if (texture->sub_resources[view->sub_resource_idx].locations & resource->map_binding)
+        return resource->pool == WINED3D_POOL_SYSTEM_MEM || (texture->flags & WINED3D_TEXTURE_PIN_SYSMEM);
 
-    return texture->sub_resources[view->sub_resource_idx].locations & resource->map_binding;
+    return resource->pool == WINED3D_POOL_SYSTEM_MEM && !(texture->flags & WINED3D_TEXTURE_CONVERTED);
 }
 
 static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device,




More information about the wine-cvs mailing list