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

Alexandre Julliard julliard at winehq.org
Tue Aug 2 14:18:24 CDT 2011


Module: wine
Branch: master
Commit: 7539cc8faab96a2612cea43ab9e444e10db015ca
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7539cc8faab96a2612cea43ab9e444e10db015ca

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Aug  1 21:35:44 2011 +0200

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.

---

 dlls/wined3d/surface.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index beafa3a..6167bde 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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)))




More information about the wine-cvs mailing list