wined3d: Go straight to the fallbacks for complex blits in surface_blt().

At the moment this is only marginally useful, since it just avoids silly
things like color keyed depth fills that are probably invalid anyway. However,
the idea is to gradually move normal color fill and blit handling out of
IWineD3DSurfaceImpl_BltOverride() and surface_cpu_blt(), and eventually make
those functions go away completely.
This commit is contained in:
Henri Verbeet 2011-08-01 21:35:44 +02:00 committed by Alexandre Julliard
parent 4bdd4ef45b
commit 7539cc8faa
1 changed files with 13 additions and 0 deletions

View File

@ -1287,12 +1287,23 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
{
struct wined3d_device *device = dst_surface->resource.device;
DWORD src_ds_flags, dst_ds_flags;
static const DWORD simple_blit = WINEDDBLT_ASYNC
| WINEDDBLT_COLORFILL
| WINEDDBLT_WAIT
| WINEDDBLT_DEPTHFILL
| WINEDDBLT_DONOTWAIT;
TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
flags, fx, debug_d3dtexturefiltertype(filter));
TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage));
if (flags & ~simple_blit)
{
WARN("Using fallback for complex blit (%#x).\n", flags);
goto fallback;
}
dst_ds_flags = dst_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
if (src_surface)
src_ds_flags = src_surface->resource.format->flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
@ -1359,6 +1370,8 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
}
}
fallback:
/* Special cases for render targets. */
if ((dst_surface->resource.usage & WINED3DUSAGE_RENDERTARGET)
|| (src_surface && (src_surface->resource.usage & WINED3DUSAGE_RENDERTARGET)))