Another reason why Visual Studio has the option grayed out is that the Visual Studio is run by clicking *.sln file in an app having HIGHDPIAWARE flag set.
The flag is usually set by right clicking the app -> Compatibility -> Change high DPI settings -> Override high DPI scaling behavior. Scaling performed by Application. It will add ~ HIGHDPIAWARE string for the app path to:
Computer\HKEY_USERS\S-1-5-21-786552173-3883971264-3181160094-1001\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
The flag can be removed by UI or deleting the key by regedit.exe from the above registry path.
If you click the *.sln file in a file manager app which has the flag set, Visual Studio Optimize rendering will be disabled.
So just ensure all the parent processes of Visual Studio have the flag disabled.