microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.35k stars 678 forks source link

FPS limited to 30 FPS after updating Windows App SDK from 1.5.24 to 1.6.2 #10092

Open defprotolab opened 1 week ago

defprotolab commented 1 week ago

Describe the bug

After updating the Windows App SDK in my C# WinUI 3 application from version 1.5.24 to 1.6.24, I noticed that the frame rate (FPS) is now limited to 32 FPS. In the previous version (1.5.24), the application was able to render at a much higher frame rate (e.g., 60 FPS). The limitation persists across different systems, and the app is consistently capped at 32 FPS.

Steps to reproduce the bug

  1. Create an empty WinUI Desktop application;
  2. Update the Windows App SDK to version 1.6.24 in a WinUI 3 project.
  3. Add a code to measure real-time FPS;
  4. Run the application in debug mode (or release mode) and monitor the frame rate.
  5. The FPS is limited to 32 FPS, regardless of system performance or display settings.

Expected behavior

The application should be able to render at higher frame rates (e.g., 60 FPS or more) without being capped at 32 FPS after the SDK update.

Screenshots

Image Image

NuGet package version

Windows App SDK 1.6.1: 1.6.240923002

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

whiskhub commented 1 week ago

What code do you use to render the framerate?

castorix commented 1 week ago

I also noticed this problem, by measuring FPS with Stopwatch or IDXGISwapChain::GetFrameStatistics (like in this test that I tested with 1.6.24 and 1.4, I get 32/33 vs 60 FPS) (tested on my old PC with Intel HD Graphics card)

lhak commented 1 week ago

@castorix I briefly tried your application and it crashes most of the time at random positions in the code on my machine. However, when it starts I observe stable 60fps.

castorix commented 1 week ago

@castorix I briefly tried your application and it crashes most of the time at random positions in the code on my machine. However, when it starts I observe stable 60fps.

Weird, at which line(s) ? I tested yesterday, by adding many butterflies, I cannot make it crash and I always get 32 or 33 FPS now (59/60 before) (Windows 10 22H2, x86 or x64, Windows App SDK 1.6.240829007)

ghost1372 commented 1 week ago

@castorix I briefly tried your application and it crashes most of the time at random positions in the code on my machine. However, when it starts I observe stable 60fps.

Weird, at which line(s) ? I tested yesterday, by adding many butterflies, I cannot make it crash and I always get 32 or 33 FPS now (59/60 before) (Windows 10 22H2, x86 or x64, Windows App SDK 1.6.240829007)

Windows 11 24H2

<WindowsPackageType>None</WindowsPackageType>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240627000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />

==> 61 fps

Image

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />

==> 62 fps

Image

castorix commented 1 week ago

Windows 11 24H2

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />

==> 62 fps

Ok, thanks. Then maybe the problem is only on Windows 10 , as @defprotolab wrote "Windows 10 version 22H2", like my OS