Title: [248704] trunk/Source/WebCore
Revision
248704
Author
justin_...@apple.com
Date
2019-08-14 19:34:25 -0700 (Wed, 14 Aug 2019)

Log Message

[WebGPU] Use of WebGPU should not force discrete GPU
https://bugs.webkit.org/show_bug.cgi?id=200740

Reviewed by Myles C. Maxfield.

Request a low-power device from Metal by default.

No change in testable behavior.

* platform/graphics/gpu/GPURequestAdapterOptions.h:
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::tryCreate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (248703 => 248704)


--- trunk/Source/WebCore/ChangeLog	2019-08-15 02:20:54 UTC (rev 248703)
+++ trunk/Source/WebCore/ChangeLog	2019-08-15 02:34:25 UTC (rev 248704)
@@ -1,3 +1,18 @@
+2019-08-14  Justin Fan  <justin_...@apple.com>
+
+        [WebGPU] Use of WebGPU should not force discrete GPU
+        https://bugs.webkit.org/show_bug.cgi?id=200740
+
+        Reviewed by Myles C. Maxfield.
+
+        Request a low-power device from Metal by default.
+
+        No change in testable behavior.
+
+        * platform/graphics/gpu/GPURequestAdapterOptions.h:
+        * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
+        (WebCore::GPUDevice::tryCreate):
+
 2019-08-14  Chris Dumez  <cdu...@apple.com>
 
         Potentially non thread-safe usage of WebCore::MediaSample

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPURequestAdapterOptions.h (248703 => 248704)


--- trunk/Source/WebCore/platform/graphics/gpu/GPURequestAdapterOptions.h	2019-08-15 02:20:54 UTC (rev 248703)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPURequestAdapterOptions.h	2019-08-15 02:34:25 UTC (rev 248704)
@@ -37,7 +37,7 @@
 };
 
 struct GPURequestAdapterOptions {
-    Optional<GPUPowerPreference> powerPreference;
+    Optional<GPUPowerPreference> powerPreference { GPUPowerPreference::LowPower };
 };
     
 } // namespace WebCore

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


--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm	2019-08-15 02:20:54 UTC (rev 248703)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUDeviceMetal.mm	2019-08-15 02:34:25 UTC (rev 248704)
@@ -49,7 +49,7 @@
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
 #if PLATFORM(MAC)
-    if (options && options->powerPreference == GPUPowerPreference::LowPower) {
+    if (!options || !options->powerPreference || options->powerPreference == GPUPowerPreference::LowPower) {
         auto devices = adoptNS(MTLCopyAllDevices());
         
         for (id <MTLDevice> device : devices.get()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to