[PATCH] ddraw: add dsurface dimension tests, try 5

Stefan Dösinger stefandoesinger at gmail.com
Sun Dec 15 06:15:40 CST 2013


-----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.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSrZ1sAAoJEN0/YqbEcdMw6S0P/iZxvm5yH7hVoRJySKTtlDdD
JB5JgGnG64ghBFX3SNRY38WP5iJT/Sgq2J8ueN2m/J5r83Ms7gtVz/2e0dm8ENgs
MI2ln+0rXeC9vIAXNaM3VRTLKoOKql3sYSXEGvQNPtS56kvENz/2Mgfk00d6MfTJ
7tVtrgqfewR4KUjRzPnVDZO1Ofu4SiILFIYV75qAPO0ZQbEpqJGhxxJqoBYhpcpR
GM9bD+4zajM9NJhZR4w3G8p23JVpUySso3xEXiV9RL16SvODnedf5o69wEB6ihyl
zbSoyvntqDDiFkUSbrjPdu89TNVJ9vYRQsxEm/56P6DtN9SqHkQpQVBAFC370Tbd
fAHQQWVnG0yr7/YAhRcB5+8hoyeX7H8p5Vk8nbcYNNQouKFVLMmRICGoaRLHPnqC
7cnrXw6/fL583FgsnevuX/n+ENsqwa7OkkVzlNLm746SPTnF1I+14ERHe8ADh25l
3ushOkUCJvQISDmRAzV0T4m8if6ljMPIIfMCPR0xNDTAFt5tBcYaHexw0GOh9UCD
jGp9d6NYRuEf49jH3oYwVcdleGY8e1HrhT/N/s8pbMIWctgu/1s3RAERy5DEd8Hl
otUR9I4DbCD4qWcaF3tW1K3syL8E3UTYjzlQ1GBlc018MsaIfebH7ds44oE1tVgk
m0KcynUFCzigbONka3IB
=XDx8
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list