Asynchronously preload graphics drivers in Mac WebProcess
Created attachment 406023 [details] Patch
<rdar://problem/66587606>
Created attachment 406025 [details] Patch
Comment on attachment 406025 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406025&action=review > Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:227 > + if (settings.acceleratedDrawingEnabled()) { I would not bother checking this. It's the default, and even if it isn't, canvas or WebGL can use Metal.
Also, Darin will show up shortly to tell you that you don’t need the dispatch_once since this code is already not threadsafe; just use a static bool.
If I don't need to check the setting, then I'll probably move this to earlier in the init process (e.g. to WebProcess::platformInitializeWebProcess or WebProcess::platformSetWebsiteDataStoreParameters).
Definitely don't need to.
Created attachment 406110 [details] Patch
Comment on attachment 406110 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406110&action=review > Source/WebCore/page/ProcessWarming.cpp:47 > +#include <Metal/Metal.h> Looks like this is an Objective-C header.
(so the patch breaks the build)
Comment on attachment 406110 [details] Patch Seems like you could call WebCore::GPUDevice::tryCreate() to make this behavior C++-friendly.
Created attachment 406236 [details] Patch
Comment on attachment 406236 [details] Patch I profiled CompPLT with this patch applied and now see all MTLCopyAllDevices work happening in prewarmGlobally as expected.
Comment on attachment 406236 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406236&action=review > Source/WebCore/page/ProcessWarming.cpp:89 > + GPUDevice::tryCreate(gpuRequestAdapterOptions); Why is the local variable needed? Isn’t this the same as passing WTF::nullopt?
Created attachment 406261 [details] Patch
Committed r265418: <https://trac.webkit.org/changeset/265418> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406261 [details].