⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 293718 in webkit


Ignore:
Timestamp:
May 3, 2022, 12:47:42 AM (4 years ago)
Author:
mmaxfield@apple.com
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):

Location:
trunk/Source/WebGPU
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebGPU/ChangeLog

    r293675 r293718  
     12022-05-03  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [WebGPU] Device creation should not always fail if supported features are requested
     4        https://bugs.webkit.org/show_bug.cgi?id=239955
     5
     6        Reviewed by Kimmo Kinnunen.
     7
     8        Somehow a block of code was remaining from before we implemented optional features.
     9
     10        Test: webgpu/api/validation/createTexture
     11
     12        * WebGPU/Adapter.mm:
     13        (WebGPU::Adapter::requestDevice):
     14        * WebGPU/Instance.mm:
     15        (WebGPU::Instance::requestAdapter):
     16
    1172022-05-02  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebGPU/WebGPU/Adapter.mm

    r293098 r293718  
    8888        instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
    8989            callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Unknown descriptor type"_s);
    90         });
    91         return;
    92     }
    93 
    94     if (descriptor.requiredFeaturesCount) {
    95         instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
    96             callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Device does not support requested features"_s);
    9790        });
    9891        return;
  • trunk/Source/WebGPU/WebGPU/Instance.mm

    r293098 r293718  
    187187    auto device = sortedDevices[0];
    188188
    189     auto deviceCapabilties = hardwareCapabilities(device);
    190 
    191     if (!deviceCapabilties) {
     189    auto deviceCapabilities = hardwareCapabilities(device);
     190
     191    if (!deviceCapabilities) {
    192192        scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
    193193            callback(WGPURequestAdapterStatus_Error, Adapter::createInvalid(strongThis), "Device does not support WebGPU"_s);
    … …  
    196196    }
    197197
    198     scheduleWork([strongThis = Ref { *this }, device = sortedDevices[0], deviceCapabilties = WTFMove(*deviceCapabilties), callback = WTFMove(callback)]() mutable {
    199         callback(WGPURequestAdapterStatus_Success, Adapter::create(device, strongThis, WTFMove(deviceCapabilties)), { });
     198    scheduleWork([strongThis = Ref { *this }, device = sortedDevices[0], deviceCapabilities = WTFMove(*deviceCapabilities), callback = WTFMove(callback)]() mutable {
     199        callback(WGPURequestAdapterStatus_Success, Adapter::create(device, strongThis, WTFMove(deviceCapabilities)), { });
    200200    });
    201201}
Note: See TracChangeset for help on using the changeset viewer.