[PATCH 6/7] wined3d: Avoid using the CPU blitter for clearing converted surfaces that aren't current on the CPU.
Henri Verbeet
hverbeet at codeweavers.com
Mon Jul 17 07:01:41 CDT 2017
Since that would imply reading them back, with associated format conversion.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
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,
--
2.1.4
More information about the wine-patches
mailing list