Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPUAttributeUtils: use correct buffer offset for updateRanges #30617

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

zonkypop
Copy link
Contributor

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.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.64
78.39
336.64
78.39
+0 B
+0 B
WebGPU 522.6
145.08
522.6
145.09
+2 B
+5 B
WebGPU Nodes 522.07
144.98
522.07
144.98
+2 B
+4 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 465.76
112.28
465.76
112.28
+0 B
+0 B
WebGPU 593.07
160.7
593.07
160.71
+2 B
+5 B
WebGPU Nodes 548.19
150.13
548.2
150.14
+2 B
+4 B

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 26, 2025

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.

@zonkypop
Copy link
Contributor Author

Do you mind demonstrating the current issue with a fiddle so it is easier for us to reproduce the bug and validate your fix?

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

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.

2 participants