On Apr 24, 2019, at 11:28 AM, Zhiyi Zhang zzhang@codeweavers.com wrote:
Automatic graphics switching shouldn't cause a problem. Apple said[1] one display is connected to one GPU at any given time. So we can report what ever GPU driving the main display and a device change event should re-init all of this if switching happens.
The problem is that if we report the integrated GPU as primary then (if someday wined3d supports selecting a specific adapter) the Windows app and wined3d may select the integrated GPU. Then automatic graphics switching will never engage, because nothing has requested the use of the discrete GPU, and no re-init will occur. And performance will suck (more).
On the other hand, apps other than Wine could cause the OS to switch to the discrete GPU at any time. If Wine is using the integrated GPU and it or the Windows app are not prepared to handle the switch, then we continue to use the integrated GPU for rendering and the OS uses the discrete GPU for presenting.
Unless we're confident that all Windows apps will handle switching properly, then I think we should just always force using the discrete GPU for GL or Metal (as is currently the case). And, if we're going to do that, then we should only report the discrete GPU and hide the integrated GPU.
-Ken