Fix computation of compositor refresh rate

Cannot use DwmGetCompositionTimingInfo as it fails WACK
このコミットが含まれているのは:
Sergio Pedri committed 2022-01-29 17:11:58 +01:00
1 親 ccc491d0e6
コミット 276f9da199
12ファイル変更
+199 -21

検索条件に一致するファイルはありません

+13
ファイルの表示
@@ -4,6 +4,11 @@ using System.Threading;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Interop;
#if WINDOWS_UWP
using ComputeSharp.Uwp.Extensions;
#else
using ComputeSharp.WinUI.Extensions;
#endif
#if !WINDOWS_UWP
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml.Controls;
@@ -471,6 +476,14 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
}
}
/// <inheritdoc/>
private unsafe partial void OnGetDynamicResolutionManager(out DynamicResolutionManager resolutionManager)
{
int targetFramerate = GraphicsDevice.Default.DXGIAdapter->GetCompositionRefreshRate(DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM);
resolutionManager = new DynamicResolutionManager(targetFramerate);
}
/// <inheritdoc/>
protected override void OnDispose()
{