ddraw: Keep track of interface attached by AddAttachedSurface and detach correct interface when parent is released. (try 3)
saulius2 at ar.fi.lt
Thu Oct 13 03:12:48 CDT 2011
* On Tue, 11 Oct 2011, Octavian Voicu wrote:
> try 3:
> - fix test failure by moving error check from *_DeleteAttachedSurface to
> ddraw_surface_delete_attached_surface, after another check (thanks Henri).
> try 2:
> - use IUnknown_Release(attached_iface) instead of manual dispatch,
> as suggested by Henri;
> - change type of attached_iface from void* to IUnknown* to reflect
> fact that it's a pointer to an interface;
> - add test to show that attaching a surface only attaches a specific
> interface and return error if DeleteAttachedSurface is called with
> another interface than the attached one (instead of detaching the
> surface anyway).
> Fixes a bug that causes a stencil buffer leak in the game The Longest Journey.
> Problem can be seen in the console output log attached to bug #11819.
> This patch doesn't fix the original bug, but now game exits cleanly.
> The root of the problem is that when releasing a surface, its attached
> surfaces are detached using IDirectDraw7_DeleteAttachedSurface, regardless
> of what interface was originally attached.
I am troubled by seeing (via test.winehq.org) your ddraw:refcount tests to
account only results for "VMware SVGA 3D" adapter/driver (and only those
with 3D acceleration disabled), I guess.
But if this driver is 3D-enabled or just present real physical adapter
(with no 3d acceleration) then ddraw:refcount contains 6 static failures
refcount.c:214: Test failed: AddAttachedSurface returned 8876000a
refcount.c:235: Test failed: AddAttachedSurface returned 8876000a
refcount.c:237: Test failed: Got refcount 1, expected 2
refcount.c:262: Test failed: AddAttachedSurface returned 8876000a
refcount.c:275: Test failed: AddAttachedSurface returned 8876000a
refcount.c:277: Test failed: Got refcount 1, expected 2
refcount: 112 tests executed (0 marked as todo, 6 failures), 0 skipped
This relation can be easily tracked by looking at d3d9:visual or (if they
aren't present) at opengl32:opgenl tests.
Eg. failures occuring here:
* Intel(R) 82865G Graphics Controller
* NVIDIA GeForce FX 5200
* ATI Radeon HD 4800 Series
(telling it has no IDirect3D support for DDraw)
* VMware SVGA II
* VMware SVGA 3D
(telling it has not IDirect3D support for DDraw)
All other cases succeed. AFAICS all of them represent the only driver
(with 3D support turned off):
* VMware SVGA 3D
visual.c:194: Driver string: "vm3dum.dll"
visual.c:195: Description string: "VMware SVGA 3D (Microsoft Corporation - WDDM)"
visual.c:197: Device name string: "\\.\DISPLAY1"
visual.c:199: Driver version 184.108.40.206
visual.c:12627: Tests skipped: Creating the device failed
visual: 5 tests executed (0 marked as todo, 0 failures), 1 skipped.
with following results:
refcount: 121 tests executed (0 marked as todo, 0 failures), 0 skipped.
IMHO, it would be nice to conform to real world configuration.
Wish you best luck with fixing your tests:)
More information about the wine-devel