You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a MacBook Pro Fyne uses the discrete rather than integrated GPU. This can lead to higher battery usage. Ideally, Fine would by default utilize the automatic switching by adding a hint to the GLFW window.
As is, when running a simple Fyne application I see usage of the discrete GPU, AMD Radeon Pro (as observed in gfxCardStatus and Activity Monitor GPU utilization). Adding glfw.WindowHint(glfw.CocoaGraphicsSwitching, 1) to glfw_core.go and running the same Fyne application shows usage of the integrated GPU, Intel HD Graphics.
GLFW_COCOA_GRAPHICS_SWITCHING specifies whether to in Automatic Graphics Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL context and move it between GPUs if necessary or whether to force it to always run on the discrete GPU. This only affects systems with both integrated and discrete GPUs. Possible values are GLFW_TRUE and GLFW_FALSE. This is ignored on other platforms.
Simpler programs and tools may want to enable this to save power, while games and other applications performing advanced rendering will want to leave it disabled.
A bundled application that wishes to participate in Automatic Graphics Switching should also declare this in its Info.plist by setting the NSSupportsAutomaticGraphicsSwitching key to true.
I believe that providing the hint is a better default as most applications will likely not need the performance of the discrete GPU and be better off saving power. It should also be possible to optionally (though I haven't considered the API) choose to use the discrete GPU (not providing the hint).
The text was updated successfully, but these errors were encountered:
Can you please test #2425 for me @samuel?
You will need to build and install the fyne command from this patch as well, because it needs an updated Info.plist template.
The change works great. Using the new Fyne command and fyne package and running the .app, and also just go build and running it outside of the .app. For both the integrated GPU is used instead of the discrete.
On a MacBook Pro Fyne uses the discrete rather than integrated GPU. This can lead to higher battery usage. Ideally, Fine would by default utilize the automatic switching by adding a hint to the GLFW window.
As is, when running a simple Fyne application I see usage of the discrete GPU, AMD Radeon Pro (as observed in gfxCardStatus and Activity Monitor GPU utilization). Adding
glfw.WindowHint(glfw.CocoaGraphicsSwitching, 1)
toglfw_core.go
and running the same Fyne application shows usage of the integrated GPU, Intel HD Graphics.Documentation for the hint is at https://www.glfw.org/docs/latest/window_guide.html
I believe that providing the hint is a better default as most applications will likely not need the performance of the discrete GPU and be better off saving power. It should also be possible to optionally (though I haven't considered the API) choose to use the discrete GPU (not providing the hint).
The text was updated successfully, but these errors were encountered: