-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can't enlarge vertex buffer #5878
Comments
The API was not designed to allow you to resize a VB this way, you need to re-create the VertexBuffer. You can always also create it larger and use only portion of it. |
So if we are using instancing with e.g. a custom LOD and culling system I imagine the only way to use a dynamic buffer is by doing this per frame right, if the buffer has grown (works in v1.67.3):
But if the buffer is smaller on a given frame and we try to use setData() with a smaller buffer then it fails with
This last bit worked with the previous version. Any other way to reuse a vertex buffer and avoid unnecessary garbage collection? |
I was always updating buffer.byteLength when updating the contents so the Debug.error never came up ;-) |
after #5758 can't enlarge vertex buffers
bufferSubData
throws when callingvertexBuffer.setData
with bigger buffer. This breaks for example instancingThe text was updated successfully, but these errors were encountered: