-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Patrick,
I've run the tests on a few of my machines, and here are the results:
First up, a Windows 7 64 bit box with 16 GB ram and a 1024MB Radeon 5770:
ddraw7.c:5752: Test failed: Creating an offscreen plain surface with width 0xffff and height 0xffff returned 88760827
Looks like the AMD driver returns a different error code. I can't find anything about this error code in the headers or via Google - except for some registry cleaner spam.
ddraw7.c:5777: 776914944 bytes of video memory. ddraw7.c:5787: Test failed: surface flag DDSCAPS_SYSTEMMEMORY is not set. ddraw7.c:5788: Test failed: surface flag DDSCAPS_VIDEOMEMORY is set. ddraw7.c:5789: dwCaps 0x10004040, dwCaps2 0, width 3063, height 65535.
I've added osme extra lines as you can see. I've also increased the size for testing purposes. It looks like the AMD driver doesn't care about the video memory size here. I think the best is just to ignore this test until we find an application that depends on this behavior, which I think is unlikely. At very least this test needs an explicitly requested pixel format to make the width * height * 4 size calculation work out.
Although if you're interested in doing some extra work, porting test_vidmem_accounting() from dlls/d3d9/tests/device.c to d3d8 and ddraw might be a good idea. I guess I should have done so when I wrote that test, but at the time the main point was to separate d3d9 and d3d9ex behavior.
My 32 bit Windows Vista machine equipped with a Geforce 7400 responds like your test expects, except for this:
ddraw7.c:5686: Test failed: Creating an offscreen plain surface with width 0xffff and height 1 returned 80070057
Which is the same as your testbot VM codepath expects. I'll see if I find an explanation for this. Interestingly the height = 0xffff codepath works as expected.
My third test machine, an ancient Windows XP 32 bit box with 2 GB ram and a Radeon 9000 Mobility (dx8 era) passes the tests, except that the width = 0xffff and height = 0xffff test returns DDERR_INVALIDPIXELFORMAT instead of DDERR_OUTOFVIDEOMEMORY.
I think it's a good idea to explicitly request a specific format.