On Mon, 8 Mar 2021 at 11:03, Paul Gofman pgofman@codeweavers.com wrote:
hardware device. The general rules for output device caps when no explicit video or system memory are requested here are:
if there is no hardware device at all, sysmem surface will be used;
if there is a hardware device and surface format is supported by it
the surface will be created in video memory;
- if the format is not supported (happens with _P8 formats in this test
on most GPUs with the exception of at least AMD Evergreen) the surface will be created in system memory.
So I think marking 'surface_desc.ddsCaps.dwCaps == test_data[i].caps_out[0]' as broken and todo_wine as I did initially is just wrong, it is actually the default case when hardware device is present. And it wasn't mark as such for other ddraw versions tests.
So Wine returns the video memory here (previously marked as broken in ddraw7) all the time except for _P8 format, which seems to match the most typical behaviour on Windows.
From your comment to patch 03/11:
Somewhat similar to 02/11, I'd expect the video memory variants if the
ddraw implementation supports video memory surfaces, and the system memory variants if not.
Yes, this is the case as far as I could see, with the exception of formats not supported by the hardware device.
So I think what we'd want here would then be something like the following:
IDirectDraw7_GetCaps(ddraw, &hal_caps, &hel_caps); ... if ((caps_in & DDSCAPS_VIDEOMEMORY) && !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) expected_hr = DDERR_NODIRECTDRAWHW; ... if ((caps_in & DDSCAPS_SYSTEMMEMORY) || (caps2_in & DDSCAPS2_D3DTEXTUREMANAGE) || !(hal_caps.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) expected_caps = caps_in | DDSCAPS_SYSTEMMEMORY else expected_caps = caps_in | DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM; ... if (pf == &p8_fmt) ... ...
and we could get rid of the caps_out[] and caps2_out fields.