Skip to content
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

Improve the low processor mode sleep precision #36052

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 9, 2020

Windows 64-bit editor build for testing: https://0x0.st/i-iB.zip (link expires in late 2020)

The Low Processor Usage Mode Sleep Usec setting is now used as a FPS limiter rather than a constant sleep duration.

This will increase CPU/GPU usage slightly due to the higher effective FPS, but the increase in overall smoothness is worth it. When used in the editor, it will now really cap at ~145 FPS (as it's supposed to) instead of ~130 FPS.

If both Force Fps and Low Processor Usage Mode settings are enabled in the project settings, only the setting that causes the highest sleep duration will be retained.

@Zylann Please test this 🙂

This closes #11030.

@Calinou Calinou force-pushed the improve-low-processor-sleep branch 2 times, most recently from acc2cc9 to 7d27d09 Compare February 9, 2020 16:41
@Calinou Calinou added this to the 4.0 milestone Mar 12, 2020
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Mar 12, 2020
@Calinou
Copy link
Member Author

Calinou commented Jun 9, 2020

@akien-mga Can this be considered for merging in 3.2.2 (as requested here), or is it too late now?

main/main.cpp Outdated Show resolved Hide resolved
@akien-mga
Copy link
Member

Can this be considered for merging in 3.2.2 (as requested here), or is it too late now?

I guess, we can get it tested in 3.2.2 RC 1. Needs a rebase (and possibly further changes, see my review).

@Calinou
Copy link
Member Author

Calinou commented Jun 12, 2020

Now that 3.2.2RC1 has been released, it's probably too late to merge it for 3.2.2 🙁
Sorry for the inconvenience.

Also, we'd have to move this PR's base branch to 3.2, as low-processor usage mode isn't currently working in the master branch.

@akien-mga
Copy link
Member

Now that 3.2.2RC1 has been released, it's probably too late to merge it for 3.2.2
Sorry for the inconvenience.

Well if it's rebased soon I can likely include it in 3.2.2 RC 2, unless you think it's too risky.

Also, we'd have to move this PR's base branch to 3.2, as low-processor usage mode isn't currently working in the master branch.

It should be merged in master nevertheless, even if not working, so that the code is there. If the 3.2 code is too different to easily cherry-pick, you can make a dedicated PR for 3.2.

The Low Processor Usage Mode Sleep Usec setting is now used as a
FPS limiter rather than a constant sleep duration.

This will increase CPU/GPU usage slightly due to the higher
effective FPS, but the increase in overall smoothness is worth it.

If both Force Fps and Low Processor Usage Mode settings are enabled
in the project settings, only the setting that causes the highest
sleep duration will be retained.

This closes godotengine#11030.
@Calinou Calinou force-pushed the improve-low-processor-sleep branch from 7d27d09 to 1c28b26 Compare June 15, 2020 17:31
@Calinou
Copy link
Member Author

Calinou commented Jun 15, 2020

@akien-mga Rebased 🙂

I tested the code by backporting it to the 3.2 branch, it works well. When cherry-picking to the 3.2 branch, you'll need to replace !DisplayServer::get_singleton()->window_can_draw() with !OS::get_singleton()->can_draw().

@akien-mga akien-mga merged commit 4dede9e into godotengine:master Jun 24, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The editor is less responsive when set to "update only changes"
2 participants