In the November 2018 progress report, MayImilae wrote about the frame pacing being really bad on macOS.
I don't know if this has been investigated since – but I did some searches, and found some explanations, and a fix.
The problem
Describing the problem as Dolphin "Fighting the system compositor" seems a good intuition. If Dolphin is pushing frames without coordination with the system compositor, both bad pacing and tearing can be expected.
I don't know much about graphics rendering, but it seems there are two ways of doing V-Sync on macOS: requesting v-sync from OpenGL, or waiting for a compositor callback that notifies of a V-Sync (akin to `requestAnimationFrame` on the web).
Well, it seems that in macOS 10.14, and the OpenGL deprecation, Apple wants apps to use the compositor callback. But Apple can't deprecate the OpenGL V-Sync without breaking old apps. So, instead, they decided OpenGL Sync would stop working only for apps compiled against the 10.14 SDK. Apps compiled before are fine. And apps compiled against the newest 10.14 SDK should upgrade to the compositor callback, using CVDisplayLink.
Seems like a good lead. Indeed Dolphin is compiled using the 10.14 SDK. And the V-Sync method is handled by Qt, which uses the OpenGL V-Sync method – and has a long-standing issue about "We should use CVDisplayLink instead".
Indeed, the SDL folks bumped into the same issue – and fixed it by using CVDisplayLink on macOS. And the glfw people too ; their PR with the fix is brand new.
The fix
Good news: Qt transitionned to CVDisplayLink in Qt 5.12.0, released on December 6th 2018… a few days after November's Progress Report
For now Dolphin is using Qt 5.9.0 – but the upgrade to Qt 5.12.0 seems easy. I compiled locally a Dolphin using the newest version of Qt, and behold! the tearing is gone. I don't have the tools to measure the frame pacing, but it should be improved as well.
I'll try to submit a PR that bumps Qt in the next few days.
I don't know if this has been investigated since – but I did some searches, and found some explanations, and a fix.
The problem
Describing the problem as Dolphin "Fighting the system compositor" seems a good intuition. If Dolphin is pushing frames without coordination with the system compositor, both bad pacing and tearing can be expected.
I don't know much about graphics rendering, but it seems there are two ways of doing V-Sync on macOS: requesting v-sync from OpenGL, or waiting for a compositor callback that notifies of a V-Sync (akin to `requestAnimationFrame` on the web).
Well, it seems that in macOS 10.14, and the OpenGL deprecation, Apple wants apps to use the compositor callback. But Apple can't deprecate the OpenGL V-Sync without breaking old apps. So, instead, they decided OpenGL Sync would stop working only for apps compiled against the 10.14 SDK. Apps compiled before are fine. And apps compiled against the newest 10.14 SDK should upgrade to the compositor callback, using CVDisplayLink.
Seems like a good lead. Indeed Dolphin is compiled using the 10.14 SDK. And the V-Sync method is handled by Qt, which uses the OpenGL V-Sync method – and has a long-standing issue about "We should use CVDisplayLink instead".
Indeed, the SDL folks bumped into the same issue – and fixed it by using CVDisplayLink on macOS. And the glfw people too ; their PR with the fix is brand new.
The fix
Good news: Qt transitionned to CVDisplayLink in Qt 5.12.0, released on December 6th 2018… a few days after November's Progress Report
For now Dolphin is using Qt 5.9.0 – but the upgrade to Qt 5.12.0 seems easy. I compiled locally a Dolphin using the newest version of Qt, and behold! the tearing is gone. I don't have the tools to measure the frame pacing, but it should be improved as well.
I'll try to submit a PR that bumps Qt in the next few days.