On 7/27/22 06:07, RĂ©mi Bernon (@rbernon) wrote:
FWIW I intend to introduce a display mode cache in win32u (except for the current mode) in https://gitlab.winehq.org/wine/wine/-/merge_requests/406 and later patches to support display modes in nulldrv. I'm not sure if that would change our solve anything here.
Possibly, although IIRC the modes are already cached in some sense, and that it's the registry queries themselves that are slow. We're currently making 3 calls per mode, and I was debugging this issue on a machine that exposes over 500 unique modes, which sums to way too many server calls per frame. Maybe it's possible to cache modes without needing the registry, though.
Even if we did, though, EnumDisplaySettings() is still slow on Windows, and inasmuch as we support d3d9 on Windows I think it makes sense to still apply this patch.