[WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2019 00:17:51 +0000 (00:17 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2019 00:17:51 +0000 (00:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194120

Unreviewed build fix.

No new tests; no change in behavior.

Patch by Justin Fan <justin_fan@apple.com> on 2019-01-31

* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm

index 33881fd..fbd56ce 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-31  Justin Fan  <justin_fan@apple.com>
+
+        [WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
+        https://bugs.webkit.org/show_bug.cgi?id=194120
+
+        Unreviewed build fix. 
+
+        No new tests; no change in behavior.
+
+        * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
+        (WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
+
 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
 
         Basic scrollability for async overflow scrolling on macOS
index ee9777e..c76ec8b 100644 (file)
@@ -42,6 +42,7 @@ RefPtr<GPUDevice> GPUDevice::create(Optional<GPURequestAdapterOptions>&& options
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
+#if PLATFORM(MAC)
     if (options && options->powerPreference == GPURequestAdapterOptions::PowerPreference::LowPower) {
         auto devices = adoptNS(MTLCopyAllDevices());
         
@@ -54,6 +55,7 @@ RefPtr<GPUDevice> GPUDevice::create(Optional<GPURequestAdapterOptions>&& options
     }
     
     if (!devicePtr)
+#endif // PLATFORM(MAC)
         devicePtr = adoptNS(MTLCreateSystemDefaultDevice());
 
     END_BLOCK_OBJC_EXCEPTIONS;