Title: [275036] trunk/Source/WebCore
Revision
275036
Author
[email protected]
Date
2021-03-25 09:19:39 -0700 (Thu, 25 Mar 2021)

Log Message

Only preheat MTLCopyAllDevices on Mac
https://bugs.webkit.org/show_bug.cgi?id=223747

Patch by Ben Nham <[email protected]> on 2021-03-25
Reviewed by Chris Dumez.

We should use adoptNS to avoid leaking the array returned by MTLCopyAllDevices. We should
also only do this on Mac because this is only a public API on the Mac, and the issue of
graphics drivers falling out of the dyld shared cache doesn't exist on iOS.

* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::prewarm):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275035 => 275036)


--- trunk/Source/WebCore/ChangeLog	2021-03-25 15:30:32 UTC (rev 275035)
+++ trunk/Source/WebCore/ChangeLog	2021-03-25 16:19:39 UTC (rev 275036)
@@ -1,3 +1,17 @@
+2021-03-25  Ben Nham  <[email protected]>
+
+        Only preheat MTLCopyAllDevices on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=223747
+
+        Reviewed by Chris Dumez.
+
+        We should use adoptNS to avoid leaking the array returned by MTLCopyAllDevices. We should
+        also only do this on Mac because this is only a public API on the Mac, and the issue of
+        graphics drivers falling out of the dyld shared cache doesn't exist on iOS.
+
+        * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
+        (WebCore::GPUDevice::prewarm):
+
 2021-03-25  Alex Christensen  <[email protected]>
 
         WKContentRuleList first-party should include other subdomains of the current registrable domain

Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm (275035 => 275036)


--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm	2021-03-25 15:30:32 UTC (rev 275035)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm	2021-03-25 16:19:39 UTC (rev 275036)
@@ -44,10 +44,12 @@
 
 void GPUDevice::prewarm()
 {
+#if PLATFORM(MAC)
     // Call MTLCopyAllDevices() on a background thread to avoid hanging the main thread.
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        MTLCopyAllDevices();
+        auto devices = adoptNS(MTLCopyAllDevices());
     });
+#endif
 }
 
 RefPtr<GPUDevice> GPUDevice::tryCreate(const Optional<GPURequestAdapterOptions>& options)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to