[PATCH 2/4] d3drm/tests: Add test for IDirect3DRM*::CreateDeviceFromSurface (try 2).

Stefan Dösinger stefandoesinger at gmail.com
Thu Jun 11 11:19:35 CDT 2015


> Am 11.06.2015 um 13:51 schrieb Aaryaman Vasishta <jem456.vasishta at gmail.com>:
> 
> +    hr = IDirect3DDevice2_GetRenderTarget(d3ddevice2, &surface);
> +    ok(hr == DD_OK, "Cannot get surface to the render target (hr = %x)\n", hr);
> +    if (FAILED(hr))
> +        goto cleanup;
> +
> +    /* Check properties of primary and depth surfaces */
> +    memset(&desc, 0, sizeof(desc));
> +    desc.dwSize = sizeof(desc);
> +    hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc);
> +    ok(hr == DD_OK, "Cannot get surface desc structure (hr = %x)\n", hr);
> +    if (FAILED(hr))
> +        goto cleanup;
Checking the surface desc isn't really relevant here. The interesting check is if the render target returned by GetRenderTarget is the surface you passed to CreateDeviceFromSurface.

Please add a test that shows that an error is returned if the surface was created without 3DDEVICE.

> 
> +    hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
> +    ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x)\n", hr);
> +    if (FAILED(hr))
> +        goto cleanup;
What happens if you attach a depth surface yourself before calling CreateDeviceFromSurface? Does d3drm replace it?

> +    hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void**)&surface7);
> +    ok(hr == DD_OK, "Cannot get IDirectDrawSurface7 interface (hr = %x)\n", hr);
> +
> +    IDirectDrawSurface_Release(ds);
> +    IDirectDrawSurface_Release(surface);
> +    IDirectDrawSurface7_Release(surface7);
The QueryInterface call here is redundant.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20150611/ccffaef2/attachment.sig>


More information about the wine-devel mailing list