From c12627562b32b36bab095fee59b96a8785e2fa4a Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 2 Aug 2011 21:42:16 +0200 Subject: [PATCH] wined3d: Go to the fallbacks for cross-swapchain blits. --- dlls/wined3d/surface.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d9060ff06e5..267da66fbee 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1285,6 +1285,7 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, WINED3DTEXTUREFILTERTYPE filter) { + const struct wined3d_swapchain *src_swapchain, *dst_swapchain; struct wined3d_device *device = dst_surface->resource.device; DWORD src_ds_flags, dst_ds_flags; static const DWORD simple_blit = WINEDDBLT_ASYNC @@ -1310,6 +1311,27 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_ goto fallback; } + if (src_surface && src_surface->container.type == WINED3D_CONTAINER_SWAPCHAIN) + src_swapchain = src_surface->container.u.swapchain; + else + src_swapchain = NULL; + + if (dst_surface->container.type == WINED3D_CONTAINER_SWAPCHAIN) + dst_swapchain = dst_surface->container.u.swapchain; + else + dst_swapchain = NULL; + + /* This isn't strictly needed. FBO blits for example could deal with + * cross-swapchain blits by first downloading the source to a texture + * before switching to the destination context. We just have this here to + * not have to deal with the issue, since cross-swapchain blits should be + * rare. */ + if (src_swapchain && dst_swapchain && src_swapchain != dst_swapchain) + { + FIXME("Using fallback for cross-swapchain blit.\n"); + 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);