wine/dlls/ddraw
Zebediah Figura 0ee74e9f81 d3d9: Cache the output mode list.
Garou: Mark of the Wolves calls IDirect3D9::GetAdapterModeCount() on every
frame. This results in calling EnumDisplaySettingsExW() once per available mode,
which is a very slow operation, both on Windows and Wine.

Manual testing shows that Windows caches the mode list (as well as the adapter
list, which is already cached in Wine) in Direct3D 9 and lower. Calls to
GetAdapterModeCount() and EnumAdapterDisplayModes() are fast, and they also do
not change if monitors are added or removed.

DXGI behaves differently, however. The list of outputs attached to an adapter is
cached—that is, calls to IDXGIAdapter::EnumOutputs() are fast, and return stale
data. However, at least some other calls are slow and do not seem to be cached,
including IDXGIOutput::GetDisplayModeList() and IDXGIOutput::GetDesc().

ddraw is also slow and uncached. Since all testing was done on Windows 10 (for
lack of available older hardware to test with) it is not unlikely that ddraw was
reimplemented over dxgi on newer Windows, and that older Windows versions would
be fast and cached, but this is speculation. In any case I have not included
patches to cache ddraw modes.

Tests were done on Windows 10 21H2, both on real hardware with NVidia drivers
and on software drivers via qemu/KVM. In the latter case only speed could be
tested, but this was consistent with the results from the NVidia machine.
2022-08-02 21:49:54 +02:00
..
tests ddraw/tests: Add some video memory accounting tests. 2022-08-02 11:59:03 +02:00
clipper.c ddraw: Build without -DWINE_NO_LONG_TYPES. 2022-04-15 20:55:37 +02:00
ddraw.c d3d9: Cache the output mode list. 2022-08-02 21:49:54 +02:00
ddraw.spec
ddraw_classes.idl
ddraw_private.h
device.c ddraw: Improve tracing format for unsigned fields. 2022-04-21 19:57:44 +02:00
executebuffer.c ddraw: Improve tracing format for unsigned fields. 2022-04-21 19:57:44 +02:00
light.c ddraw: Build without -DWINE_NO_LONG_TYPES. 2022-04-15 20:55:37 +02:00
main.c ddraw: Build without -DWINE_NO_LONG_TYPES. 2022-04-15 20:55:37 +02:00
Makefile.in ddraw: Build without -DWINE_NO_LONG_TYPES. 2022-04-15 20:55:37 +02:00
material.c ddraw: Improve tracing format for unsigned fields. 2022-04-21 19:57:44 +02:00
palette.c ddraw: Build without -DWINE_NO_LONG_TYPES. 2022-04-15 20:55:37 +02:00
surface.c ddraw: Don't account video memory for sysmem surfaces' draw textures. 2022-08-02 11:58:59 +02:00
utils.c ddraw: Improve tracing format for unsigned fields. 2022-04-21 19:57:44 +02:00
version.rc
vertexbuffer.c ddraw: Build without -DWINE_NO_LONG_TYPES. 2022-04-15 20:55:37 +02:00
viewport.c ddraw: Improve tracing format for unsigned fields. 2022-04-21 19:57:44 +02:00