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

Improve dynamic numVertices change performance for vertexBuffer #7071

Open
AlexAPPi opened this issue Oct 27, 2024 · 0 comments
Open

Improve dynamic numVertices change performance for vertexBuffer #7071

AlexAPPi opened this issue Oct 27, 2024 · 0 comments
Labels
area: graphics Graphics related issue enhancement

Comments

@AlexAPPi
Copy link
Contributor

AlexAPPi commented Oct 27, 2024

There is currently no way to dynamically quickly change the size of the storage area, but after removing webgl1 support, you can use:

https://registry.khronos.org/webgl/specs/latest/2.0/

  undefined bufferSubData(GLenum target, GLintptr dstByteOffset, [AllowShared] ArrayBufferView srcData,
                          unsigned long long srcOffset, optional GLuint length = 0);

https://github.com/playcanvas/engine/blob/main/src/platform/graphics/webgpu/webgpu-buffer.js#L91
https://github.com/playcanvas/engine/blob/main/src/platform/graphics/webgl/webgl-buffer.js#L49

Tested successfully: https://github.com/AlexAPPi/playcanvas-terrain-system/blob/main/src/ScriptHelpers/TerrainPatchesInstancing.mts#L93

@mvaligursky mvaligursky added area: graphics Graphics related issue enhancement labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue enhancement
Projects
None yet
Development

No branches or pull requests

2 participants