Re: [PATCH 2/3] d3drm/tests: Add test for IDirect3DRM*::CreateDeviceFromSurface (try 4).
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, One I don't like here is the hardcoded DDSCAPS_SYSTEMEMORY for the Z buffer. You need it on Windows because of the RGB device and Wine doesn't check, so it kinda works. But I recommend to do something like this: BOOL use_sysmem_zbuffer; ... hr = IDirect3DRM2_CreateDeviceFromSurface(d3drm2, &driver, ddraw, surface, &device2); hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3ddevice2); hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &d3drm_surface); hr = IDirectDrawSurface_GetAttachedSurface(d3drm_surface, &caps, &ds); hr = IDirectDrawSurface_GetSurfaceDesc(ds, &desc); use_sysmem_zbuffer = desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY; ... /* Release everything */ /* Create new sysmem surface */ when creating the new Z buffer set DDSCAPS_SYSTEMMEMORY only if use_sysmem_zbuffer is true. Another thing to test: After destroying the d3drm device is the Z buffer removed from the surface when (a) d3drm created it and (b) you created it? Cheers, Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVicXHAAoJEN0/YqbEcdMw73gP/3wLEdptNIWr2IFNXJHoSZ15 2g3annULMUw++NvXuBXY1RJdUiR0UQxbGyRNJtFzl8KN66lbl2DOY9/ePkgahIbB 0XKedAtS8F5zoLwRHrbZ/VGSI5Kv8ClHSi0F+jZ5Og9TvwqYKC40vNaBC2WXlSHL KSmOzilln0xDFPecaqyIwbLNO7y1DBnQ7sncLgGCuyxrWM8lK0vmXcAxubS5JyJJ Hd0chD6+EpjxisVWZUVNLFV1HEN9zyL6VDSYcJnNNp9ufGKh6wAoFcywx1vyQTsX tiicEYlW90rvhM2dIZ/m6EcJsR/n6E4iMlj2S4yq9Kc4jySMaC0bYa0B4vPQbbaj YUcQ10qmuH/saROVPjjwjT5O1xISVZ2OOlk3PQYbwVSa1afOMU0ZZu5xNYmkRJ71 21r9cBqePMtIzWixxq+5DiYIRaSDelODlGD8P+LdfYu51DZK3oi1GK0vwX46wHmX M6S6i583uj//ZaZAVG/iCkZ9IPrnkqUnWe8WVGqy1KKJ/e/goq8eQhK9bUHz0GCM BCaklF368VarJWQ0S2ggtdZ006cnc+aqOlfJTRA4UoSfQGU6ACne/blCeJBIGMwv 4mwtvNQvZIvoO6sUW+kmU7T6vCsyxVGfVq96csPbqNvSlidLl8H8IN7f8DK65feW w4s6zvEsdURxeHfcOUNL =bY5s -----END PGP SIGNATURE-----
On Wed, Jun 24, 2015 at 2:17 AM, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
One I don't like here is the hardcoded DDSCAPS_SYSTEMEMORY for the Z buffer. You need it on Windows because of the RGB device and Wine doesn't check, so it kinda works. But I recommend to do something like this:
I had actually tested for DDSCAPS_SYSTEMMEMORY without writing a test for it but you're right. It should be there.
Another thing to test: After destroying the d3drm device is the Z buffer removed from the surface when (a) d3drm created it and (b) you created it?
There are probably two ways to do this. One is use EnumAttachedSurfaces and increment a counter if a surface is attached (similar to ddraw tests) then check if the counter == 1 (meaning z surface is attached) just after releasing the device for both cases (whether we attached the z surface or let d3drm attach one for us). The other way could be simply calling GetAttachedSurface with DDSCAPS_ZBUFFER as a caps parameter.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2015-06-24 um 00:27 schrieb Aaryaman Vasishta:
I had actually tested for DDSCAPS_SYSTEMMEMORY without writing a test for it but you're right. It should be there. Don't write an ok() line for it. It is a quirk of the RGB device that we don't duplicate and that we don't care about. What I mean is: Don't set it unconditionally. Follow the behavior of the d3drm created surface .
The other way could be simply calling GetAttachedSurface with DDSCAPS_ZBUFFER as a caps parameter. Go for this way, just in the way you handle finding the Z buffer already .
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVimVsAAoJEN0/YqbEcdMwlNwP/3JYxZuaVlPknoHtlfUos8GF ZIHXJe4Pqz7GZwG+N/8lriyOS6GPbOaFDDQQOaY7/Yce/0Dv3cyDh8T0cnQEHaO4 XeGL6onP1f4FSvqCW89/sJng/dkDpnolorGrVNSGarJ0uFLugieeQ9pxHzZk8FDP 1aepJhWPYylS5fARBKyGGNJLAxY9FDEx7gWOjGLoHpnpEGvIXMSpCpXbIpuUuzn0 34fgd0LFNEw/+wwUlKolLiYqSLvjiznuo4TEDPj7K2D8XzIvyUfvXrggc2Vao3OF B6WzVSdCFKtqMriUX+KXP338JXZEVaO3lHzBffi6ahXEipWo3/Gy41/z/T/brNzC cP6yBcXnKgBVYN+rBa2NDyCnzHr+vhQhwWOtjHTDdbYQw/UTEUEOc1dCj77pcm3c 3psAeQ/CJvOtA9P3j+SnYU6YaTbItqevIK5UXfgbIikzU4G3dYJSPfbphITBDXEs ZQfp2c4y16KR6TcUJrKCcA+siZRfa8kesuf1GnIaTmx/MGcKbo3nBxl+GNJh0Ake FB/M1QSEmo9S+iTBQJVRtEJuSeV8IcCX1cByUg2lxwVSqHObQktQn3wBg9POnlAF xjEt3w58Mn9NKzZc7Tsiilwtb2mxeR/iIKqCzx401YsDJ++tezEyNMw+WKZ9hQvr 8wbhYqQWh+cFouqFI1cN =mU8h -----END PGP SIGNATURE-----
participants (2)
-
Aaryaman Vasishta -
Stefan Dösinger