From: Zhiyi Zhang Subject: Re: [PATCH 1/2] wined3d: Introduce wined3d_output_get_ordinal(). Message-Id: <3b6153fa-e3bb-35f3-3249-afe2db230d2e@codeweavers.com> Date: Mon, 23 Nov 2020 22:36:48 +0800 In-Reply-To: References: On 2020/11/23 21:32, Henri Verbeet wrote: > On Fri, 13 Nov 2020 at 11:19, Zhiyi Zhang wrote: >> Secondhand Lands calls d3d9_device_GetDeviceCaps() frequently. Introduce a wined3d_output_get_ordinal() >> to get output ordinal only instead of using the more expensive wined3d_output_get_desc(). >> > Avoiding calls to EnumDisplaySettingsExW() is fine in principle, but I > don't think these two patches are quite enough to avoid the underlying > issue. In particular, wined3d_output_get_raster_status() is a > potential source of frequent wined3d_output_get_display_mode() calls, > either through d3d9_swapchain_GetRasterStatus() or > ddraw7_GetVerticalBlankStatus()/ddraw7_GetScanLine(). See also bug > 30538 and related bugs. Yes. I am aware of the root cause being that EnumDisplaySettingsExW() is too expensive. I plan to optimize it later. Meanwhile, I think these two patches are reasonable. Are you proposing another way to fix this? Thanks, Zhiyi