[PATCH 4/5] wined3d: Go to the fallbacks for cross-swapchain blits.
Henri Verbeet
hverbeet at codeweavers.com
Tue Aug 2 14:42:16 CDT 2011
---
dlls/wined3d/surface.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index d9060ff..267da66 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);
--
1.7.3.4
More information about the wine-patches
mailing list