osu-framework
osu-framework copied to clipboard
Disable threaded optimization on NVIDIA GPUs for Windows users
Fixes ppy/osu#19421.
This pull request adds a bunch of code to interface with NVAPI to disable threaded optimization. Initializing NVAPI before the OpenGL context also seems to force the dedicated GPU to be used according to some online threads, but I haven't tested this myself because I don't have the hardware.
I'm a bit concerned about how the metadata is being filled out, but I couldn't find a good way to pass the game name from the game host all the way down to the graphics backend.
Thanks for the contribution.
Rather than reimplementing things from scratch, did you consider existing libraries? https://www.nuget.org/packages?q=nvapi
Also I have no idea if it will be helpful in review of this change, but here's stable's code:
https://gist.github.com/1ad50c4d3d9e376977ebbd8c598279e8
I did look into existing libraries, but I didn't really want to risk screwing up any license-related stuff from third-party packages. I'm only implementing a small subset of the API, so it wasn't much of a problem to just do it myself instead.
https://github.com/ppy/osu/pull/26354