wined3d: Use the CPU blitter for clearing textures that are current in the map binding.

In order to avoid bouncing them between the CPU and GPU. This fixes a
regression instroduced by commit 381cd03eb3.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-04-19 23:40:49 +02:00 committed by Alexandre Julliard
parent db3a723887
commit b7140a212d
1 changed files with 20 additions and 0 deletions

View File

@ -2538,6 +2538,22 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info,
}
}
static BOOL ffp_blitter_use_cpu_clear(struct wined3d_rendertarget_view *view)
{
struct wined3d_resource *resource;
struct wined3d_texture *texture;
resource = view->resource;
if (resource->type == WINED3D_RTYPE_BUFFER)
return FALSE;
texture = texture_from_resource(resource);
if (!(texture->flags & WINED3D_TEXTURE_PIN_SYSMEM))
return FALSE;
return texture->sub_resources[view->sub_resource_idx].locations & resource->map_binding;
}
static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device,
unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects,
const RECT *draw_rect, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
@ -2558,6 +2574,10 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
if (resource->pool == WINED3D_POOL_SYSTEM_MEM)
goto next;
if (!(flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
&& ffp_blitter_use_cpu_clear(view))
goto next;
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{
if (!((view->format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE)