Title: [293718] trunk/Source/WebGPU
Revision
293718
Author
[email protected]
Date
2022-05-03 00:47:42 -0700 (Tue, 03 May 2022)

Log Message

[WebGPU] Device creation should not always fail if supported features are requested
https://bugs.webkit.org/show_bug.cgi?id=239955

Reviewed by Kimmo Kinnunen.

Somehow a block of code was remaining from before we implemented optional features.

Test: webgpu/api/validation/createTexture

* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):

Modified Paths

Diff

Modified: trunk/Source/WebGPU/ChangeLog (293717 => 293718)


--- trunk/Source/WebGPU/ChangeLog	2022-05-03 06:11:41 UTC (rev 293717)
+++ trunk/Source/WebGPU/ChangeLog	2022-05-03 07:47:42 UTC (rev 293718)
@@ -1,3 +1,19 @@
+2022-05-03  Myles C. Maxfield  <[email protected]>
+
+        [WebGPU] Device creation should not always fail if supported features are requested
+        https://bugs.webkit.org/show_bug.cgi?id=239955
+
+        Reviewed by Kimmo Kinnunen.
+
+        Somehow a block of code was remaining from before we implemented optional features.
+
+        Test: webgpu/api/validation/createTexture
+
+        * WebGPU/Adapter.mm:
+        (WebGPU::Adapter::requestDevice):
+        * WebGPU/Instance.mm:
+        (WebGPU::Instance::requestAdapter):
+
 2022-05-02  Alex Christensen  <[email protected]>
 
         Fix tvOS build

Modified: trunk/Source/WebGPU/WebGPU/Adapter.mm (293717 => 293718)


--- trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-05-03 06:11:41 UTC (rev 293717)
+++ trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-05-03 07:47:42 UTC (rev 293718)
@@ -91,13 +91,6 @@
         return;
     }
 
-    if (descriptor.requiredFeaturesCount) {
-        instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
-            callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Device does not support requested features"_s);
-        });
-        return;
-    }
-
     WGPULimits limits { };
 
     if (descriptor.requiredLimits) {

Modified: trunk/Source/WebGPU/WebGPU/Instance.mm (293717 => 293718)


--- trunk/Source/WebGPU/WebGPU/Instance.mm	2022-05-03 06:11:41 UTC (rev 293717)
+++ trunk/Source/WebGPU/WebGPU/Instance.mm	2022-05-03 07:47:42 UTC (rev 293718)
@@ -186,9 +186,9 @@
 
     auto device = sortedDevices[0];
 
-    auto deviceCapabilties = hardwareCapabilities(device);
+    auto deviceCapabilities = hardwareCapabilities(device);
 
-    if (!deviceCapabilties) {
+    if (!deviceCapabilities) {
         scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
             callback(WGPURequestAdapterStatus_Error, Adapter::createInvalid(strongThis), "Device does not support WebGPU"_s);
         });
@@ -195,8 +195,8 @@
         return;
     }
 
-    scheduleWork([strongThis = Ref { *this }, device = sortedDevices[0], deviceCapabilties = WTFMove(*deviceCapabilties), callback = WTFMove(callback)]() mutable {
-        callback(WGPURequestAdapterStatus_Success, Adapter::create(device, strongThis, WTFMove(deviceCapabilties)), { });
+    scheduleWork([strongThis = Ref { *this }, device = sortedDevices[0], deviceCapabilities = WTFMove(*deviceCapabilities), callback = WTFMove(callback)]() mutable {
+        callback(WGPURequestAdapterStatus_Success, Adapter::create(device, strongThis, WTFMove(deviceCapabilities)), { });
     });
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to