wine/dlls/d3d9
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 d3d9/tests: Use a nonzero start index in test_sysmem_draw(). 2022-07-13 15:03:49 +02:00
buffer.c d3d9: Upload sysmem vertex buffers into the streaming buffer in d3d9_device_DrawPrimitive(). 2022-07-13 15:03:48 +02:00
d3d9.spec
d3d9_main.c
d3d9_private.h d3d9: Upload sysmem vertex buffers into the streaming buffer in d3d9_device_DrawPrimitive(). 2022-07-13 15:03:48 +02:00
device.c d3d9: Do not release the wined3d mutex in d3d9_device_upload_sysmem_index_buffer(). 2022-07-27 23:07:06 +02:00
directx.c d3d9: Cache the output mode list. 2022-08-02 21:49:54 +02:00
Makefile.in include: Add support for defining Win32 types as 'long' where possible. 2022-01-27 20:38:22 +01:00
query.c d3d9: Don't grab wined3d lock for wined3d_query_issue(). 2021-11-01 20:46:21 +01:00
shader.c d3d9: Don't grab wined3d lock for wined3d incref/decref functions. 2021-11-01 20:46:21 +01:00
stateblock.c d3d9: Correctly check for sysmem index buffers in d3d9_stateblock_Apply(). 2022-07-27 23:07:06 +02:00
surface.c d3d9: Don't grab wined3d lock for surface AddRef/Release(). 2021-11-01 20:46:21 +01:00
swapchain.c
texture.c
version.rc
vertexdeclaration.c d3d9: Don't grab wined3d lock for wined3d incref/decref functions. 2021-11-01 20:46:21 +01:00
volume.c