Re: [PATCH 4/4] d3drm: Implement IDirect3DRMDevice*::Add/DeleteDestroyCallback. (v2)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Am 2016-07-10 um 21:49 schrieb Aaryaman Vasishta:
I believe the "obj == ctxt->obj" tests in destroy_callback and destroy_callback1 should cover this. See test_destroy_callback. If I understand it correctly not quite, because you're only ever calling AddDestroyCallback via IDirect3DRMObject, never via IDirect3DRMSomethingElse.
(Re-CCed wine-devel) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXgsLBAAoJEN0/YqbEcdMwlsUP/2AIUfNl//T23Ik/gnL5FHVd 4axt1f/F5l1Hb5C3049Eh/se5SfF8jM6YYJte62al60f8nf0ERCW8S9JCzRueV2+ Q4ETvXbxhffKh9Ceb8W83ijxkwGf3GplypnXK7OQnqFUg88AR4YTGIL4I5pTPZVq Bw/MKgOfnDAHn+QsRDnzaQTtZcJPDNx+mrf26S/x15Wdi+PQjdVWb3uPbtgfkHN4 TWVwAgTQwPcnJQDaQ2wmWlEG+uxvxqpCF5BFCf1JwRV6oMdYYCQeHH+nvBrnPjEN /7Upv092RGbazucxMr6OWc9GJaCy4K9pfer8U2Ahdb47eAsF9UTO4AoW718GnIfU CJPvh8kMxukMw81U3U5Dr61v9cxd2xywz8ZMWMfKScrN4b6W7/hiE19B3+0w/XHi JHDf0NlPG8RDS+LR3N67X7dkaVqtEkRNCyVfAKdOozlz2EIlzs6lHmYNSxd17GO1 foIPVad9Ovo7nNQhB6FK+0zMZCKAz7be6ai9orlCk4ThhBhVwlaQXX16LBxgrYBi cU/3emOonGzto6sqzDrXyTNEqQTzvFMXnqitH/ITgvKuey0GBLHVSeOAHdECbrN3 bdGYdYPuXnxdksTey/zGORo4u0plUxS3gXiAGM0Ch0oCb6E9uzWMqKJpH6rIoR22 yAuKU7HOboWb3rlcAs0i =s5bk -----END PGP SIGNATURE-----
On Mon, Jul 11, 2016 at 3:18 AM, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Am 2016-07-10 um 21:49 schrieb Aaryaman Vasishta:
I believe the "obj == ctxt->obj" tests in destroy_callback and destroy_callback1 should cover this. See test_destroy_callback. If I understand it correctly not quite, because you're only ever calling AddDestroyCallback via IDirect3DRMObject, never via IDirect3DRMSomethingElse.
(Re-CCed wine-devel)
My bad, I may have clicked on "Reply" instead of "Reply to All" on gmail again.. Anyways, the vtable qi tests tests written so far show that querying IDirect3DRMObject from a particular interface will return version 1 of that interface. So technically it all comes down to calling IDirect3DRM<Interface_name>::AddDestroyCallback(&object->version1_vtable, ...);. In our implementation of this method (see d3drm_main.c), we have passed version 1 of the relevant interface while calling the destroy callbacks within d3drm_object_destroy. The tests seem to agree with that implementation so far. Do correct me if I have misunderstood something here, though. Cheers, Aaryaman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Am 2016-07-10 um 23:14 schrieb Aaryaman Vasishta:
Anyways, the vtable qi tests tests written so far show that querying IDirect3DRMObject from a particular interface will return version 1 of that interface. So technically it all comes down to calling IDirect3DRM<Interface_name>::AddDestroyCallback(&object->version1_vtable, ...);. In our implementation of this method (see d3drm_main.c), we have passed version 1 of the relevant interface while calling the destroy callbacks within d3drm_object_destroy. The tests seem to agree with that implementation so far. Well, but you can call AddDestroyCallback on the version 3 interface too:
IDirect3DRMDevice *dev1; IDirect3DRMDevice3 *dev3; dev1 = create_device(); dev3 = dev1->qi(IID_IDirect3DRMDevice3); dev1->AddDestroyCallback(...); dev3->AddDestroyCallback(...); The current code will always pass dev1 to the callback. It may be correct, it may be wrong. But yeah, we won't accidentally pass an IDirect3DRMFrame interface to the callback if AddDestroyCallback was called on a device. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXgz5NAAoJEN0/YqbEcdMw7RAP/1am78HbnuobIjjjBJYz+pCb lOPqKNZP2+dRIbJzTpd9Jgwz8Vonishwn9B+ZF6X71neWOHFG7xGFsGFq8OvuNBO c+jSOdrd/jkHLf61pllRBOk7QykoLCFIoaIbj843xeTeseabND7bwZwXVBKt34Gb hce0wquaITIntu5UPcLVnr3ak0meaADaXETRjiFamVnAPPmmyr3WyAYenVOT9P8c 1J8UneOEzBPXUtdsc8V4S0qQfpOEo9W8t1uh0M9FndAUNZyF9k7f6TzlEkA4e6C2 JzG5TfsIKg6LWgnX+WmGZ4ByZVfzdA/x0kWu7t0Gp9Wbb28rPMWs4yF2IU5uAw1q lHWIutHmmDCC7sxdyOOYp28ej1pxO3g23INynyUB3GTwAGyX2v/F+5a7Ge19IP1d 8A93T1id4ZZLzhF13oWHqFPhLLa1uoeAg0bpiXrC9SodK3x6YKrdBK/n/fyrHY3j 8fSrYBQwCt0ojV4Y7mqEZpG7M3+2asis26BdpaHGemcAlqEOThQOiIJiuvw/loWZ wkBGrzz5nkL6wTZHioPGCBkLm1vgD5H1N+wyYWDXQ2Adm+fgp7xP+VMMZ+66obCk CQgork1bnSkBsMWvafaGHim3+pbJdMXK1dbE3RjjdwC5bz2UsT2AxqH4ldJXEjxe gf+UMdoIzcyXS68E+Bpb =vqhG -----END PGP SIGNATURE-----
On Mon, Jul 11, 2016 at 12:05 PM, Stefan Dösinger <stefandoesinger(a)gmail.com
wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Am 2016-07-10 um 23:14 schrieb Aaryaman Vasishta:
Anyways, the vtable qi tests tests written so far show that querying IDirect3DRMObject from a particular interface will return version 1 of that interface. So technically it all comes down to calling IDirect3DRM<Interface_name>::AddDestroyCallback(&object->version1_vtable, ...);. In our implementation of this method (see d3drm_main.c), we have passed version 1 of the relevant interface while calling the destroy callbacks within d3drm_object_destroy. The tests seem to agree with that implementation so far. Well, but you can call AddDestroyCallback on the version 3 interface too:
IDirect3DRMDevice *dev1; IDirect3DRMDevice3 *dev3;
dev1 = create_device(); dev3 = dev1->qi(IID_IDirect3DRMDevice3);
dev1->AddDestroyCallback(...); dev3->AddDestroyCallback(...);
The current code will always pass dev1 to the callback. It may be correct, it may be wrong.
This is where the obj == ctxt->obj test comes in. obj is the interface passed to the callback, and ctxt->obj is the one we pass into the context, which is our interface QI'd to IDirect3DRMObject. Now if we consider this test + the vtable QI tests, we can (in)directly prove that the interface passed to the destroy callback is always the version 1 of that interface. The tests would have failed on wine if e.g. I passed version 2 or 3 interface into the destroy callback. I agree that there are no direct tests confirming this though, but hopefully the two tests combined should be enough to confirm this.
Cheers, Aaryaman
participants (2)
-
Aaryaman Vasishta -
Stefan Dösinger