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

[Windows] Fix not applying NVIDIA profile to new executables #81251

Merged
merged 1 commit into from Sep 24, 2023

Conversation

aitorciki
Copy link
Contributor

@aitorciki aitorciki commented Sep 2, 2023

An NVIDIA profile is applied to the current executable to disable threaded OpenGL optimizations on Windows (see #71472). But because the application is only added to the profile upon the profile creation, newer executables won't be added to the profile (e.g. if the profile is created on first launch of Godot_v4.1-stable_win64.exe, when users update the editor and launch Godot_v4.2-stable_win64.exe, the profile will never be applied to this new executable).

This patch fixes that scenario by splitting creating the profile (if it doesn't exist) and adding the application (if it doesn't have a profile applied) into two separate steps.

Applications that have been manually added to a different profile aren't overriden to avoid confusing users who know what they're doing.

@aitorciki aitorciki requested a review from a team as a code owner September 2, 2023 14:59
@AThousandShips AThousandShips added this to the 4.x milestone Sep 2, 2023
@Calinou Calinou added bug cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Sep 2, 2023
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 9, 2023
@akien-mga
Copy link
Member

CC @EIREXE @Calinou

@EIREXE
Copy link
Contributor

EIREXE commented Sep 19, 2023

CC @EIREXE @Calinou

Looks good to me, I had no previous experience with the NVAPI so I think I indeed messed up the original implementation.

An NVIDIA profile is applied to the current executable to disable
threaded OpenGL optimizations on Windows (see godotengine#71472). But because the
application is only added to the profile upon the profile creation,
newer executables won't be added to the profile (e.g. if the profile is
created on first launch of Godot_v4.1-stable_win64.exe, when users
update the editor and launch Godot_v4.2-stable_win64.exe, the profile
will never be applied to this new executable).
This patch fixes that scenario by splitting creating the profile (if it
doesn't exist) and adding the application (if it doesn't have a profile
applied) into two separate steps.
Applications that have been manually added to a different profile aren't
overriden to avoid confusing users who know what they're doing.
@akien-mga akien-mga modified the milestones: 4.x, 4.2 Sep 24, 2023
@akien-mga akien-mga merged commit b8238ec into godotengine:master Sep 24, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@aitorciki aitorciki deleted the nvidia-profile-multiapp branch September 24, 2023 22:38
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Oct 24, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:3.x Considered for cherry-picking into a future 3.x release platform:windows topic:porting topic:rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants