Bug 237871 - [WebGPU] Implement first draft of buffer copying according to the spec
Summary: [WebGPU] Implement first draft of buffer copying according to the spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on: 237870
Blocks: 237583 237875 237877
  Show dependency treegraph
 
Reported: 2022-03-14 20:39 PDT by Myles C. Maxfield
Modified: 2022-03-16 15:14 PDT (History)
4 users (show)

See Also:


Attachments
Patch (16.89 KB, patch)
2022-03-14 20:44 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (16.89 KB, patch)
2022-03-14 22:05 PDT, Myles C. Maxfield
kkinnunen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2022-03-14 20:39:21 PDT
.
Comment 1 Myles C. Maxfield 2022-03-14 20:44:09 PDT
Created attachment 454658 [details]
Patch
Comment 2 Myles C. Maxfield 2022-03-14 21:39:06 PDT
Comment on attachment 454658 [details]
Patch

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

> Source/WebGPU/WebGPU/CommandEncoder.mm:144
> +    if (validateCopyBufferToBuffer(source, sourceOffset, destination, destinationOffset, size)) {

if (!validateCopyBufferToBuffer(source, sourceOffset, destination, destinationOffset, size))
Comment 3 Myles C. Maxfield 2022-03-14 22:05:22 PDT
Created attachment 454664 [details]
Patch
Comment 4 Kimmo Kinnunen 2022-03-16 06:59:15 PDT
Comment on attachment 454664 [details]
Patch

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

> Source/WebGPU/WebGPU/CommandEncoder.mm:52
> +    commandBuffer.label = [NSString stringWithCString:descriptor.label encoding:NSUTF8StringEncoding];

nullptr label remark (in case it's not handled in the fromAPI patch)

> Source/WebGPU/WebGPU/CommandsMixin.h:32
> +class CommandsMixin : public RefCounted<CommandsMixin> {

Based on this commit alone, it's not clear why would the refcounted be in the mixin. it would indicate objects hold references to the mixin, which is counter (my) expectation of mixins being just "way to import a bag of common functionality"

Also having the WTF_MAKE_FAST_ALLOCATED here would imply you allocate the mixins
Comment 5 Kimmo Kinnunen 2022-03-16 07:08:01 PDT
Comment on attachment 454664 [details]
Patch

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

>> Source/WebGPU/WebGPU/CommandEncoder.mm:52
>> +    commandBuffer.label = [NSString stringWithCString:descriptor.label encoding:NSUTF8StringEncoding];
> 
> nullptr label remark (in case it's not handled in the fromAPI patch)

Checked, I think the fromAPI patch was not written with this patch in, so there's that.
so probably you could have some sort of fromAPI<NSString*>(descriptor.label) for these cases (or something else you come up with)
Comment 6 Myles C. Maxfield 2022-03-16 15:08:32 PDT
Comment on attachment 454664 [details]
Patch

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

>>> Source/WebGPU/WebGPU/CommandEncoder.mm:52
>>> +    commandBuffer.label = [NSString stringWithCString:descriptor.label encoding:NSUTF8StringEncoding];
>> 
>> nullptr label remark (in case it's not handled in the fromAPI patch)
> 
> Checked, I think the fromAPI patch was not written with this patch in, so there's that.
> so probably you could have some sort of fromAPI<NSString*>(descriptor.label) for these cases (or something else you come up with)

Right. I'll have to update the fromAPI patch after this lands.

>> Source/WebGPU/WebGPU/CommandsMixin.h:32
>> +class CommandsMixin : public RefCounted<CommandsMixin> {
> 
> Based on this commit alone, it's not clear why would the refcounted be in the mixin. it would indicate objects hold references to the mixin, which is counter (my) expectation of mixins being just "way to import a bag of common functionality"
> 
> Also having the WTF_MAKE_FAST_ALLOCATED here would imply you allocate the mixins

Ah, I see what you're saying. Yeah, I guess multiple inheritance is better than making a mixin class that appears to be refcounted.
Comment 7 Myles C. Maxfield 2022-03-16 15:13:51 PDT
Committed r291372 (248504@trunk): <https://commits.webkit.org/248504@trunk>
Comment 8 Radar WebKit Bug Importer 2022-03-16 15:14:16 PDT
<rdar://problem/90394764>