-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Update instanced buffer attributes array breaks in webGPU #29966
Comments
The issue is this function call in WebGPUAttributeUtils.js:
According to the WebGPU API, the writeBuffer command treats the last two arguments (dataOffset and size) as number of elements if the array is a TypedArray, not as number of bytes. So the multiplication by array.BYTES_PER_ELEMENT is wrong and causes the error. As a dirty workaround until it is fixed you can just not specify an update range or divide the start and count by array.BYTES_PER_ELEMENT. |
Fixed with #29967. Thanks! |
Description
1 ) Create an instancedgeometry
2 ) fill it with instancedattributes
3 ) update with new values later
This works in WebGL, but not in WebGPU
This is exactly the break :
OperationError: Failed to execute 'writeBuffer' on 'GPUQueue': Number of bytes to write is too large
My guess is, once the buffer is created, it cannot be replaced ?
Live example
Live fiddle
Uncomment the line 81
Version
last
Device
Desktop
Browser
Chrome
OS
MacOS
The text was updated successfully, but these errors were encountered: