Skip to content

Add GPUComandEncoder.fillBuffer()#2208

Merged
litherum merged 3 commits intogpuweb:mainfrom
litherum:fillbuffer
Oct 26, 2021
Merged

Add GPUComandEncoder.fillBuffer()#2208
litherum merged 3 commits intogpuweb:mainfrom
litherum:fillbuffer

Conversation

@litherum
Copy link
Copy Markdown
Contributor

@litherum litherum commented Oct 23, 2021

Fixes #1968.

In the future, we can add a 4th parameter, value, of type octet or byte. For now, though, the group seems to have just agreed on zeroing, rather than filling with a particular byte.

There are two commits in this PR, one that requires GPUBufferUsage.STORAGE on the buffer, and a second that relaxes this requirement because of #1968 (comment).


Preview | Diff

Fixes gpuweb#1968.

In the future, we can add a 4th parameter, |value|, of type "octet" or "byte".
For now, though, the group seems to have just agreed on zeroing, rather than
filling with a particular byte.
D3D implementations can implement this by copying from a pre-zeroed buffer.

(If the buffer just happens to also have GPUBufferUsage.STORAGE, then D3D
implementations can use ID3D12GraphicsCommandList::ClearUnorderedAccessViewUint(),
if it's faster. But it isn't necessary.)
@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (3c7b141):
WebGPU | IDL
WGSL
Explainer

@litherum litherum requested review from kainino0x and kvark October 23, 2021 17:49
@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (2de05ae):
WebGPU | IDL
WGSL
Explainer

Copy link
Copy Markdown
Contributor

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's going to be useful!

@litherum litherum enabled auto-merge (squash) October 26, 2021 22:48
@litherum litherum merged commit cee9ad6 into gpuweb:main Oct 26, 2021
@github-actions
Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (6f9ec61):
WebGPU | IDL
WGSL
Explainer

github-actions bot added a commit that referenced this pull request Oct 26, 2021
SHA: cee9ad6
Reason: push, by @litherum

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Oct 26, 2021
SHA: cee9ad6
Reason: push, by @litherum

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Oct 26, 2021
SHA: cee9ad6
Reason: push, by @litherum

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@litherum litherum deleted the fillbuffer branch October 26, 2021 23:45
RobinMorisset pushed a commit to RobinMorisset/gpuweb that referenced this pull request Nov 4, 2021
Add GPUComandEncoder.fillBuffer() (gpuweb#2208)

Fixes gpuweb#1968.

In the future, we can add a 4th parameter, `value`, of type `octet` or `byte`. For now, though, the group seems to have just agreed on zeroing, rather than filling with a particular byte.

There are two commits in this PR, one that requires `GPUBufferUsage.STORAGE` on the buffer, and a second that relaxes this requirement because of gpuweb#1968 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request for a GPUCommandEncoder fillBuffer operation

3 participants