Henri Verbeet : wined3d: Avoid using the CPU blitter for clearing converted surfaces that aren' t current on the CPU.
Module: wine Branch: master Commit: 990be0ba5010def7e9a1f0b5312df6a77c7b6cda URL: http://source.winehq.org/git/wine.git/?a=commit;h=990be0ba5010def7e9a1f0b531... Author: Henri Verbeet <hverbeet(a)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(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)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,
participants (1)
-
Alexandre Julliard