From 990be0ba5010def7e9a1f0b5312df6a77c7b6cda Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 17 Jul 2017 14:01:41 +0200 Subject: [PATCH] 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 Signed-off-by: Alexandre Julliard --- 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 58a43888459..c143256c8ba 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,