Skip to content

fix(render): clone geometry buffers to prevent WebGPU disposal crash#1054

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-gpu-render-crash-mfoR7
Jan 26, 2026
Merged

fix(render): clone geometry buffers to prevent WebGPU disposal crash#1054
braedonsaunders merged 1 commit into
mainfrom
claude/fix-gpu-render-crash-mfoR7

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

When creating indirect meshes, geometry attributes and index buffers were set by reference instead of being cloned. This caused a crash after ~7 minutes of gameplay when cleanup disposed shared buffers that other meshes still referenced, resulting in "setIndexBuffer: parameter 1 is not of type GPUBuffer" errors.

The fix clones all geometry data so each IndirectMesh owns its own GPU buffers, allowing safe disposal without affecting the asset cache or other renderers using the same source geometry.

When creating indirect meshes, geometry attributes and index buffers
were set by reference instead of being cloned. This caused a crash after
~7 minutes of gameplay when cleanup disposed shared buffers that other
meshes still referenced, resulting in "setIndexBuffer: parameter 1 is
not of type GPUBuffer" errors.

The fix clones all geometry data so each IndirectMesh owns its own GPU
buffers, allowing safe disposal without affecting the asset cache or
other renderers using the same source geometry.
@braedonsaunders braedonsaunders merged commit f30804e into main Jan 26, 2026
4 checks passed
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