WebGPUAttributeUtils: Use correct buffer offset for updateRanges.#30617
Merged
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Collaborator
|
Do you mind demonstrating the current issue with a fiddle so it is easier for us to reproduce the bug and validate your fix? Use https://jsfiddle.net/xno7bmw0/ as a start template. |
Contributor
Author
Here's a fiddle: https://jsfiddle.net/zonkypop/0s6u4dac/11/ You can see the difference by changing: forceWebGL: true Tested on macOS and Linux WebGPU |
Mugen87
reviewed
Feb 27, 2025
1310834 to
2850320
Compare
updateRanges.
zonkypop
added a commit
to zonkypop/three.js
that referenced
this pull request
Feb 28, 2025
…rdoob#30617) * WebGPU: use correct destination offset for updateRanges * Take into account BYTES_PER_ELEMENT for updateRanges * Update WebGPUAttributeUtils.js --------- Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
Contributor
|
This is exactly what I was looking for to update individual parts of a storage buffer on the CPU side. I've solved this problem with a workaround so far. UpdateRanges is better. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently when using updateRanges with the WebGPU renderer, the updates are being copied to the start of the buffer.
This PR sets the correct buffer destination offset for: device.queue.writeBuffer, so updateRanges work the same as the WebGLRenderer.