Commit b7140a21 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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 381cd03e. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent db3a7238
...@@ -2538,6 +2538,22 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, ...@@ -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, 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, 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) 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 ...@@ -2558,6 +2574,10 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
if (resource->pool == WINED3D_POOL_SYSTEM_MEM) if (resource->pool == WINED3D_POOL_SYSTEM_MEM)
goto next; 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 (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
{ {
if (!((view->format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE) if (!((view->format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment