Bug 199740 - [WebGPU] Move error scopes out of GPUDevice for more portable error generation
Summary: [WebGPU] Move error scopes out of GPUDevice for more portable error generation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Fan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-11 17:39 PDT by Justin Fan
Modified: 2019-07-16 17:04 PDT (History)
7 users (show)

See Also:


Attachments
Patch (29.16 KB, patch)
2019-07-11 17:54 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (30.64 KB, patch)
2019-07-12 13:21 PDT, Justin Fan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2019-07-11 17:39:49 PDT
[WebGPU] Move error scopes out of GPUDevice for more portable error generation
Comment 1 Justin Fan 2019-07-11 17:54:00 PDT
Created attachment 373984 [details]
Patch
Comment 2 Myles C. Maxfield 2019-07-11 18:05:17 PDT
Comment on attachment 373984 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373984&action=review

> Source/WebCore/Modules/webgpu/WebGPUDevice.cpp:90
> +    auto buffer = m_device->tryCreateBuffer(descriptor, false, m_errorGenerator.copyRef());

It's not obvious what "false" means here. Usually we use two-value enums to make this more readable.

> Source/WebCore/Modules/webgpu/WebGPUDevice.cpp:189
> -void WebGPUDevice::pushErrorScope(GPUErrorFilter filter) const
> +void WebGPUDevice::popErrorScope(ErrorPromise&& promise)

wat

> Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm:105
> +        errorGenerator->generateError("", GPUErrorFilter::OutOfMemory);

"generator" isn't really the best name. It doesn't actually generate errors...
Comment 3 Justin Fan 2019-07-11 18:15:22 PDT
Comment on attachment 373984 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=373984&action=review

>> Source/WebCore/Modules/webgpu/WebGPUDevice.cpp:189
>> +void WebGPUDevice::popErrorScope(ErrorPromise&& promise)
> 
> wat

Moved implementation of pushErrorScope to header since it's trivial and we need to include GPUErrorGenerator anyway.
Comment 4 Justin Fan 2019-07-12 13:21:08 PDT
Created attachment 374030 [details]
Patch
Comment 5 Justin Fan 2019-07-12 14:07:55 PDT
Comment on attachment 374030 [details]
Patch

Clearing flags on attachment: 374030

Committed r247397: <https://trac.webkit.org/changeset/247397>
Comment 6 Justin Fan 2019-07-12 14:07:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-07-12 14:08:13 PDT
<rdar://problem/53025854>
Comment 8 Ryan Haddad 2019-07-15 13:38:09 PDT
Rolled out in https://trac.webkit.org/r247442 because it conflicted with the rollout of https://bugs.webkit.org/show_bug.cgi?id=199655, which broke the watchOS build.
Comment 9 Ryan Haddad 2019-07-15 13:38:21 PDT
Reopening.
Comment 10 Justin Fan 2019-07-16 17:04:18 PDT
Re-landed in https://trac.webkit.org/changeset/247500/webkit.