[PATCH 1/3] wined3d: Reject cross-device blits.

Józef Kucia jkucia at codeweavers.com
Thu Aug 9 06:26:42 CDT 2018

DirectDraw tests show that cross-device blits are supposed to work for
limited cases between system memory surfaces. However, cross-device
blits are unsafe in wined3d, especially with CSMT enabled.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45382
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>

FWIW, the games affected by this bug shouldn't use cross-device blits at
all. Cross-device blits happen between a surface created by our
amstream implementation, and the bug doesn't occur with native amstream.

 dlls/wined3d/texture.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c316906a9576..634992714d02 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -3097,6 +3097,12 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned
+    if (dst_texture->resource.device != src_texture->resource.device)
+    {
+        FIXME("Rejecting cross-device blit.\n");
+        return E_NOTIMPL;
+    }
     wined3d_cs_emit_blt_sub_resource(dst_texture->resource.device->cs, &dst_texture->resource, dst_sub_resource_idx,
             &dst_box, &src_texture->resource, src_sub_resource_idx, &src_box, flags, fx, filter);

More information about the wine-devel mailing list