Bug 198591 - [WebGPU] Remove GPUBuffer.setSubData and implement GPUDevice.createBufferMapped
Summary: [WebGPU] Remove GPUBuffer.setSubData and implement GPUDevice.createBufferMapped
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-06-05 18:06 PDT by Justin Fan
Modified: 2019-06-07 15:25 PDT (History)
9 users (show)

See Also:


Attachments
Patch (38.91 KB, patch)
2019-06-05 18:52 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-06-05 18:06:14 PDT
[WebGPU] Remove GPUBuffer.setSubData and implement GPUDevice.createBufferMapped
Comment 1 Justin Fan 2019-06-05 18:06:41 PDT
<rdar://problem/50951309>
Comment 2 Justin Fan 2019-06-05 18:52:16 PDT
Created attachment 371464 [details]
Patch
Comment 3 Myles C. Maxfield 2019-06-07 15:00:11 PDT
Comment on attachment 371464 [details]
Patch

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

> Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm:226
> +    if (!m_device->tryGetQueue() || !(queue = m_device->tryGetQueue()->platformQueue()))

The group will investigate and probably add the idea of multiple queues. We should figure out how this will work in that world.

> Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm:233
> +    stagingMtlBuffer = adoptNS([m_device->platformDevice() newBufferWithLength:static_cast<NSUInteger>(m_byteLength) options:MTLResourceCPUCacheModeDefaultCache]);

Can we cache these somehow? It seems silly to continually create and destroy these.
Comment 4 WebKit Commit Bot 2019-06-07 15:25:01 PDT
Comment on attachment 371464 [details]
Patch

Clearing flags on attachment: 371464

Committed r246217: <https://trac.webkit.org/changeset/246217>
Comment 5 WebKit Commit Bot 2019-06-07 15:25:02 PDT
All reviewed patches have been landed.  Closing bug.