-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-12-14 12:34, schrieb Patrick Rudolph:
- /* Test maximum surface width */ + memset(&desc, 0,
sizeof(desc)); + desc.dwSize = sizeof(desc); + desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; + desc.ddsCaps.dwCaps |= DDSCAPS_OFFSCREENPLAIN; + desc.dwHeight = 1; + desc.dwWidth = 0xffff; + ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL); + if(!(ddcaps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + ok(ret == DDERR_INVALIDPARAMS, "Creating an offscreen plain surface with width 0xffff and height 1 returned %08x\n", ret); + } + else
- { + todo_wine ok(ret == DD_OK, "Creating an offscreen
plain surface with width 0xffff and height 1 returned %08x\n", ret); + }
I found the reason for this behavior. Some drivers seem to have a pitch limit of slightly under 128kb, specifically 131008 bytes. If you use a P8 pixel format here, the test passes on at least my Nvidia machine with this behavior.
The same machine still has the 0xffff width limitation. So a 0x10000 width P8 surface isn't allowed, even though the pitch stays below the limit.
I guess you could test for the pitch limit by setting DDSD_PITCH, either in CreateSurface, if it works, or pass it to SetSurfaceDesc. I don't think we have to test this unless we know an application that depends on this limitation - which I guess is unlikely because not all Windows drivers have it.