-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples: Win32: Let the CPU and GPU chill when minimized #3907
Conversation
When the window is minimized, in the task manager i see 100% GPU usage and 10% CPU usage
I have tested with your code-changes, but I found another problem. Reproduce the problem (my machine runs Window 10 Pro 19042.867):
Caused by:
Maybe a simple solution is: - if (wParam == SIZE_MINIMIZED)
- {
- g_wndMinimized = true;
- }
- else if (wParam == SIZE_RESTORED)
- {
- g_wndMinimized = false;
- }
+ g_wndMinimized = (wParam == SIZE_MINIMIZED); |
Less code and works better Co-Authored-By: kayws426 <[email protected]>
0c1e5bd
to
bb6a60b
Compare
8b83e0a
to
d735066
Compare
b3b85d8
to
0755767
Compare
c817acb
to
8d39063
Compare
Thank you for the PR and sorry for my late reaction. I have pushed ec1d2be which seemingly solves it for both cases. Implemented this for the DX9, DX10, DX11 and DX12 examples. Both DX9 and DX12 weren't burning as much CPU when looping with no visible swap chain, as Present() would still honor vsync, but it's still best to not loop when locked. Note this issue for multi-viewports #7615 (comment) |
When the window is minimized, in the task manager i see 100% GPU usage and 10% CPU usage
When the window is restored, i see 7% GPU usage and 0,5% CPU usage
So i added SIZE_MINIMIZED handling, to prevent CPU and GPU usage when the window is minimized