Henri Verbeet hverbeet@codeweavers.com writes:
From f8dd196de73ca81019b01f3fdae56b47985e63b6 Mon Sep 17 00:00:00 2001 From: Henri Verbeet hverbeet@codeweavers.com Date: Fri, 5 Jun 2009 10:10:48 +0200 Subject: wined3d: Use FBOs for offscreen rendering by default.
It doesn't work here:
../../../tools/runtest -q -P wine -M d3d9.dll -T ../../.. -p d3d9_test.exe.so visual.c && touch visual.ok visual.c:7572: Tests skipped: Card has unconditional pow2 support, skipping conditional NP2 tests visual.c:9686: Test failed: Input 0x00000000: Got color 0x00000000 for pixel 1/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0x00000000: Got color 0x00000000 for pixel 2/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0xff000000: Got color 0x00000000 for pixel 1/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0xff000000: Got color 0x00000000 for pixel 2/1, expected 0x004bff1c, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0x00ff0000: Got color 0x00000000 for pixel 1/1, expected 0x00b30000, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0x00ff0000: Got color 0x00ffffff for pixel 2/1, expected 0x00b30000, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0x0000ff00: Got color 0x00000000 for pixel 1/1, expected 0x004bff1c, format D3DFMT_UYVY [...many more...] make: *** [visual.ok] Error 72
Alexandre Julliard wrote:
It doesn't work here:
../../../tools/runtest -q -P wine -M d3d9.dll -T ../../.. -p d3d9_test.exe.so visual.c && touch visual.ok visual.c:7572: Tests skipped: Card has unconditional pow2 support, skipping conditional NP2 tests visual.c:9686: Test failed: Input 0x00000000: Got color 0x00000000 for pixel 1/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0x00000000: Got color 0x00000000 for pixel 2/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0xff000000: Got color 0x00000000 for pixel 1/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0xff000000: Got color 0x00000000 for pixel 2/1, expected 0x004bff1c, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0x00ff0000: Got color 0x00000000 for pixel 1/1, expected 0x00b30000, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0x00ff0000: Got color 0x00ffffff for pixel 2/1, expected 0x00b30000, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0x0000ff00: Got color 0x00000000 for pixel 1/1, expected 0x004bff1c, format D3DFMT_UYVY [...many more...] make: *** [visual.ok] Error 72
Does the attached patch make it any better?
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index dff1ae2..2f5554f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -523,10 +523,15 @@ void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect) } }
-static inline BOOL surface_can_stretch_rect(IWineD3DSurfaceImpl *surface) +static inline BOOL surface_can_stretch_rect(IWineD3DSurfaceImpl *src, IWineD3DSurfaceImpl *dst) { - return (surface->resource.format_desc->Flags & WINED3DFMT_FLAG_FBO_ATTACHABLE) - || (surface->resource.usage & WINED3DUSAGE_RENDERTARGET); + return ((src->resource.format_desc->Flags & WINED3DFMT_FLAG_FBO_ATTACHABLE) + || (src->resource.usage & WINED3DUSAGE_RENDERTARGET)) + && ((dst->resource.format_desc->Flags & WINED3DFMT_FLAG_FBO_ATTACHABLE) + || (dst->resource.usage & WINED3DUSAGE_RENDERTARGET)) + && (src->resource.format_desc->format == dst->resource.format_desc->format + || (is_identity_fixup(src->resource.format_desc->color_fixup) + && is_identity_fixup(dst->resource.format_desc->color_fixup))); }
static ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) @@ -3415,7 +3420,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const * backends. */ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && GL_SUPPORT(EXT_FRAMEBUFFER_BLIT) - && surface_can_stretch_rect(Src) && surface_can_stretch_rect(This)) + && surface_can_stretch_rect(Src, This)) { stretch_rect_fbo((IWineD3DDevice *)myDevice, SrcSurface, &srect, (IWineD3DSurface *)This, &rect, Filter, upsideDown); @@ -3480,7 +3485,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && GL_SUPPORT(EXT_FRAMEBUFFER_BLIT) && !(Flags & (WINEDDBLT_KEYSRC | WINEDDBLT_KEYSRCOVERRIDE)) - && surface_can_stretch_rect(Src) && surface_can_stretch_rect(This)) + && surface_can_stretch_rect(Src, This)) { TRACE("Using stretch_rect_fbo\n"); /* The source is always a texture, but never the currently active render target, and the texture
Henri Verbeet hverbeet@codeweavers.com writes:
Alexandre Julliard wrote:
It doesn't work here:
../../../tools/runtest -q -P wine -M d3d9.dll -T ../../.. -p d3d9_test.exe.so visual.c && touch visual.ok visual.c:7572: Tests skipped: Card has unconditional pow2 support, skipping conditional NP2 tests visual.c:9686: Test failed: Input 0x00000000: Got color 0x00000000 for pixel 1/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0x00000000: Got color 0x00000000 for pixel 2/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0xff000000: Got color 0x00000000 for pixel 1/1, expected 0x00008700, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0xff000000: Got color 0x00000000 for pixel 2/1, expected 0x004bff1c, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0x00ff0000: Got color 0x00000000 for pixel 1/1, expected 0x00b30000, format D3DFMT_UYVY visual.c:9690: Test failed: Input 0x00ff0000: Got color 0x00ffffff for pixel 2/1, expected 0x00b30000, format D3DFMT_UYVY visual.c:9686: Test failed: Input 0x0000ff00: Got color 0x00000000 for pixel 1/1, expected 0x004bff1c, format D3DFMT_UYVY [...many more...] make: *** [visual.ok] Error 72
Does the attached patch make it any better?
Yes, that fixes it.