WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
238428
[WebGPU] Implement CommandEncoder::copyBufferToTexture() according to the spec
https://bugs.webkit.org/show_bug.cgi?id=238428
Summary
[WebGPU] Implement CommandEncoder::copyBufferToTexture() according to the spec
Myles C. Maxfield
Reported
2022-03-27 19:00:32 PDT
.
Attachments
Patch
(35.53 KB, patch)
2022-03-27 19:03 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(35.58 KB, patch)
2022-03-28 12:20 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(35.85 KB, patch)
2022-03-28 14:07 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(35.85 KB, patch)
2022-03-28 14:09 PDT
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(35.85 KB, patch)
2022-03-28 14:10 PDT
,
Myles C. Maxfield
kkinnunen
: review+
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2022-03-27 19:03:43 PDT
Created
attachment 455875
[details]
Patch
Myles C. Maxfield
Comment 2
2022-03-28 12:20:32 PDT
Created
attachment 455940
[details]
Patch
Myles C. Maxfield
Comment 3
2022-03-28 14:07:54 PDT
Created
attachment 455952
[details]
Patch
Myles C. Maxfield
Comment 4
2022-03-28 14:09:04 PDT
Created
attachment 455953
[details]
Patch
Myles C. Maxfield
Comment 5
2022-03-28 14:10:39 PDT
Created
attachment 455954
[details]
Patch
Kimmo Kinnunen
Comment 6
2022-03-30 00:51:03 PDT
Comment on
attachment 455954
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=455954&action=review
with non-ascii chars fixed with integral auto variables declared explicitly as their intended type.
> Source/WebGPU/WebGPU/Texture.mm:2370 > + auto blockWidth = Texture::texelBlockWidth(fromAPI(imageCopyTexture.texture).descriptor().format);
explicitly declare the intended type
> Source/WebGPU/WebGPU/Texture.mm:2556 > + if ((imageCopyTexture.origin.x + copySize.width) > subresourceSize.width)
I think generally a+b>c is written without parenthesis. Even though the spec has the parenthesis, maybe the code would still be nicer without.
> Source/WebGPU/WebGPU/Texture.mm:2585 > + auto blockWidth = Texture::texelBlockWidth(format);
all these calculations are important part of the validation. the integral types should be declared explicitly to ensure less mistakes
> Source/WebGPU/WebGPU/Texture.mm:2618 > + if (layout.bytesPerRow <= bytesInLastRow)
off-by-one should be if (layout.bytesPerRow < bytesInLastRow) return false;
> Source/WebGPU/WebGPU/Texture.mm:2630 > + auto requiredBytesInCopy = 0;
this is declared as int, but it does calculations with layout members that are uint64_t. Instead, declare it explicitly as uint64_t
Kimmo Kinnunen
Comment 7
2022-03-30 00:52:58 PDT
Comment on
attachment 455954
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=455954&action=review
> Source/WebGPU/WebGPU/Texture.mm:2631 > +
this is also missing the checked arithmetic fixme? e.g. when you implement checked arithmetic, you will mark this as Checked<uint64_t> requiredBytesInCopy ?
> Source/WebGPU/WebGPU/Texture.mm:2662 > + if (layout.offset + requiredBytesInCopy > byteSize)
missing checked arithmetic fixme?
Myles C. Maxfield
Comment 8
2022-03-31 01:33:26 PDT
Comment on
attachment 455954
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=455954&action=review
>> Source/WebGPU/WebGPU/Texture.mm:2631 >> + > > this is also missing the checked arithmetic fixme? > e.g. when you implement checked arithmetic, you will mark this as Checked<uint64_t> requiredBytesInCopy ?
Right. Good catch.
Myles C. Maxfield
Comment 9
2022-03-31 01:42:45 PDT
Committed
r292147
(
249054@trunk
): <
https://commits.webkit.org/249054@trunk
>
Radar WebKit Bug Importer
Comment 10
2022-03-31 01:43:17 PDT
<
rdar://problem/91092275
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug