Description
QtWebEngine shows blank content with the following setup:
o A dual graphics card MacBook pro
o iPad
o Connect to iPad using Airplay
o Qt global shared context is set to CoreProfile
o NSSupportsAutomaticGraphicsSwitching is not set in bundle plist
QtWebEngine/Chromium will print opengl errors if it's launched after Airplay is enabled.
There was a patch to add --use-gl=core_profile flag: https://github.com/qt/qtwebengine-chromium/commit/28831bc8c384ab51ae81a5fdeeb3582ae8d7dde4
But SwitchableGPUsSupported() method was not updated at that time: https://github.com/qt/qtwebengine-chromium/blob/v5.12.2/chromium/gpu/config/gpu_switching.cc#L57-L59
bool SwitchableGPUsSupported(const GPUInfo& gpu_info, const base::CommandLine& command_line) { #if defined(OS_MACOSX) if (command_line.HasSwitch(switches::kUseGL) && command_line.GetSwitchValueASCII(switches::kUseGL) != gl::kGLImplementationDesktopName) { return false; }
Official Chromium:
--use-gl=(not set): do gpu check, core profile
--use-gl=desktop: do gpu check, compatibility profile
Qt patched Chromium:
--use-gl=core_profile: return false before gpu check, core profile
--use-gl=desktop: do gpu check, compatibility profile
If --use-gl=core_profile is passed in, SwitchableGPUsSupported() always returns false. Then, kCGLPFAAllowOfflineRenderers is not added when Chromium's pixel format. On the other hand, Qt will always add kCGLPFAAllowOfflineRenderers.
For example, after connecting to Airplay,
If kCGLPFAAllowOfflineRenderers is set, the OpenGL context is associated with 2 virtual screens (AMD / Apple Renderer)
If kCGLPFAAllowOfflineRenderers is not set, the OpenGL context is associated with 3 virtual screens (Intel / AMD / Apple Renderer).
OpenGL context with different set of renderers are not shareable. Chromium will fail to create a sharing OpenGL context.
NSSupportsAutomaticGraphicsSwitching is not set because the application needs to switch to discrete GPU for gl rendering.
Attachments
Issue Links
- is duplicated by
-
QTBUG-65403 QtWebEngine forces use of high-power GPU when core profile is requested
-
- Closed
-
- is required for
-
QTBUG-60002 Youtube videos with AVC codec are rendered incorrectly on macOS with proprietary codecs enabled
-
- Closed
-