问题
There is an option in Windows control panel that allows to set a app to "high performance". Control Panel -> System -> Display -> Graphics Settings.
On adding my application there, I noticed that, when encoding with Media Foundation and H.265 it uses the NVIDIA gfx adapter for encoding. Before that, it used to use the embedded Intel graphics which would only do H.264 encoding, so H.265 encoding was slowly done in CPU.
How can I add my application there programmatically? It's crucial for my sequencer's performance.
Thanks a lot.
回答1:
To my best knowledge there is no API or documentation for this. The preference is, however, kept in registry under
HKEY_CURRENT_USER\Software\Microsoft\DirectX\UserGpuPreferences
String value with GpuPreference
part and integer value corresponding DXGI_GPU_PREFERENCE enumeration.
If you set the value there programmatically, it is picked up with next app restart.
Also, to my best knowledge, this preference takes precedence over possibly existing similar preference setting in vendor (AMD, NVIDIA) specific settings.
See also:
- Graphics performance preference on MSDN Forums
来源:https://stackoverflow.com/questions/59732181/programmatically-set-graphics-performance-for-an-app