ddraw: Keep track of interface attached by AddAttachedSurface and detach correct interface when parent is released. (try 3)

Saulius Krasuckas saulius2 at ar.fi.lt
Thu Oct 13 03:12:48 CDT 2011


Hello, Octavian.

* 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 
such as:

  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
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_af-xpsp3/d3d9:visual.html
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_af-xpsp3/ddraw:refcount.html

* NVIDIA GeForce FX 5200
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_s2-enterprise-VAS/d3d9:visual.html
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_s2-enterprise-VAS/ddraw:refcount.html

http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_s2-sp2-VAS/d3d9:visual.html
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_s2-sp2-VAS/ddraw:refcount.html

* ATI Radeon HD 4800 Series
  (telling it has no IDirect3D[7] support for DDraw)
http://test.winehq.org/data/a843acef5567bc30901612ce5013da543259b21b/win7_win7-x64/d3d9:visual.html
http://test.winehq.org/data/a843acef5567bc30901612ce5013da543259b21b/win7_win7-x64/ddraw:refcount.html

* VMware SVGA II
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg-win2000-uplast/d3d9:visual.html
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg-win2000-uplast/ddraw:refcount.html

http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg-win2000-4sp/opengl32:opengl.html
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg-win2000-4sp/ddraw:refcount.html

* VMware SVGA 3D
  (telling it has not IDirect3D[7] support for DDraw)
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_fg-win7u64fr-t64/d3d9:visual.html
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_fg-win7u64fr-t64/ddraw:refcount.html


All other cases succeed.  AFAICS all of them represent the only driver 
(with 3D support turned off):

* VMware SVGA 3D
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_wtb-w7pro/d3d9:visual.html

  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 7.14.1.40
  visual.c:12627: Tests skipped: Creating the device failed
  visual: 5 tests executed (0 marked as todo, 0 failures), 1 skipped.

with following results:
http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_wtb-w7pro/ddraw:refcount.html

  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:)

S.



More information about the wine-devel mailing list