Hi, Can you try to create a d3d device with this surface? In the first d3d version this works by querying the d3d device ID from the surface. Patch 4 looks OK. Thank you for your persistence with the patches by the way! Cheers, Stefan Am 18.08.2010 um 22:01 schrieb Oldřich Jedlička:
--- dlls/ddraw/tests/d3d.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 53ef04b..a83b0d5 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -3536,6 +3536,87 @@ static void FindDevice(void) "Expected IDirect3D1::FindDevice to return D3D_OK, got 0x%08x\n", hr); }
+static void BackBuffer3DCreateSurfaceTest(void) +{ + DDSURFACEDESC ddsd; + DDSURFACEDESC created_ddsd; + DDSURFACEDESC2 ddsd2; + IDirectDrawSurface *surf; + IDirectDrawSurface4 *surf4; + IDirectDrawSurface7 *surf7; + HRESULT hr; + IDirectDraw2 *dd2; + IDirectDraw4 *dd4; + IDirectDraw7 *dd7; + DDCAPS ddcaps; + + const DWORD caps = DDSCAPS_BACKBUFFER | DDSCAPS_3DDEVICE; + const DWORD expected_caps = DDSCAPS_BACKBUFFER | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM; + + memset(&ddcaps, 0, sizeof(ddcaps)); + ddcaps.dwSize = sizeof(DDCAPS); + hr = IDirectDraw_GetCaps(DirectDraw1, &ddcaps, NULL); + if (!(ddcaps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + skip("DDraw reported no VIDEOMEMORY cap. Broken video driver? Skipping surface caps tests.\n"); + return ; + } + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 64; + ddsd.dwHeight = 64; + ddsd.ddsCaps.dwCaps = caps; + memset(&ddsd2, 0, sizeof(ddsd2)); + ddsd2.dwSize = sizeof(ddsd2); + ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd2.dwWidth = 64; + ddsd2.dwHeight = 64; + ddsd2.ddsCaps.dwCaps = caps; + memset(&created_ddsd, 0, sizeof(created_ddsd)); + created_ddsd.dwSize = sizeof(DDSURFACEDESC); + + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &surf, NULL); + todo_wine ok(SUCCEEDED(hr), "IDirectDraw_CreateSurface failed: 0x%08x\n", hr); + if (surf != NULL) + { + hr = IDirectDrawSurface_GetSurfaceDesc(surf, &created_ddsd); + ok(SUCCEEDED(hr), "IDirectDraw_GetSurfaceDesc failed: 0x%08x\n", hr); + todo_wine ok(created_ddsd.ddsCaps.dwCaps == expected_caps, + "GetSurfaceDesc returned caps %x, expected %x\n", created_ddsd.ddsCaps.dwCaps, + expected_caps); + IDirectDrawSurface_Release(surf); + } + + hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirectDraw2, (void **) &dd2); + ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + + hr = IDirectDraw2_CreateSurface(dd2, &ddsd, &surf, NULL); + ok(hr == DDERR_INVALIDCAPS, "IDirectDraw2_CreateSurface didn't return %x08x, but %x08x\n", + DDERR_INVALIDCAPS, hr); + + IDirectDraw2_Release(dd2); + + hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirectDraw4, (void **) &dd4); + ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + + hr = IDirectDraw4_CreateSurface(dd4, &ddsd2, &surf4, NULL); + ok(hr == DDERR_INVALIDCAPS, "IDirectDraw4_CreateSurface didn't return %x08x, but %x08x\n", + DDERR_INVALIDCAPS, hr); + + IDirectDraw4_Release(dd4); + + hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirectDraw7, (void **) &dd7); + ok(SUCCEEDED(hr), "IDirectDraw_QueryInterface failed: 0x%08x\n", hr); + + hr = IDirectDraw7_CreateSurface(dd7, &ddsd2, &surf7, NULL); + ok(hr == DDERR_INVALIDCAPS, "IDirectDraw7_CreateSurface didn't return %x08x, but %x08x\n", + DDERR_INVALIDCAPS, hr); + + IDirectDraw7_Release(dd7); +} + START_TEST(d3d) { init_function_pointers(); @@ -3571,6 +3652,7 @@ START_TEST(d3d) TextureLoadTest(); ViewportTest(); FindDevice(); + BackBuffer3DCreateSurfaceTest(); D3D1_releaseObjects(); }
-- 1.7.2