Module: wine
Branch: master
Commit: 98650e841e90bcc1f694fc1ad58ff45ff1dbeedf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=98650e841e90bcc1f694fc1ad…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Mon Aug 1 21:35:45 2011 +0200
wined3d: Go to the fallbacks if D3D is not initialized in surface_blt().
Even though this is the "OpenGL" surface implementation, this can still happen
in e.g. ddraw if no swapchain is created yet. That's something we should fix,
but not today.
---
dlls/wined3d/surface.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 6167bde..c13beb0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1304,6 +1304,12 @@ static HRESULT surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_
goto fallback;
}
+ if (!device->d3d_initialized)
+ {
+ WARN("D3D not initialized, using fallback.\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);
Module: wine
Branch: master
Commit: 7539cc8faab96a2612cea43ab9e444e10db015ca
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7539cc8faab96a2612cea43ab…
Author: Henri Verbeet <hverbeet(a)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)))