Skip to content

fix: Add geometry quarantine to BuildingPlacementPreview#1128

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-gpu-buffer-error-CTkjb
Jan 30, 2026
Merged

fix: Add geometry quarantine to BuildingPlacementPreview#1128
braedonsaunders merged 1 commit into
mainfrom
claude/fix-gpu-buffer-error-CTkjb

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

BuildingPlacementPreview was disposing geometry immediately during building placement updates, which happens frequently during gameplay. This could cause WebGPU "setIndexBuffer" crashes when the GPU still had pending draw commands using those buffers.

Changes:

  • Add geometryQuarantine array and GEOMETRY_QUARANTINE_FRAMES constant
  • Add queueGeometryForDisposal() and processGeometryQuarantine() methods
  • Update clearQueueVisuals() to use quarantine for queue line geometry
  • Update disposeGroup() to use quarantine for all child geometries
  • Update updateGridMesh() to use quarantine when replacing grid
  • Update clearMeshes() to use quarantine for grid mesh
  • Update update() to process quarantine each frame
  • Update dispose() to flush quarantine during teardown

https://claude.ai/code/session_01LA6RwJfSB6nsab6v8oAGf9

BuildingPlacementPreview was disposing geometry immediately during
building placement updates, which happens frequently during gameplay.
This could cause WebGPU "setIndexBuffer" crashes when the GPU still
had pending draw commands using those buffers.

Changes:
- Add geometryQuarantine array and GEOMETRY_QUARANTINE_FRAMES constant
- Add queueGeometryForDisposal() and processGeometryQuarantine() methods
- Update clearQueueVisuals() to use quarantine for queue line geometry
- Update disposeGroup() to use quarantine for all child geometries
- Update updateGridMesh() to use quarantine when replacing grid
- Update clearMeshes() to use quarantine for grid mesh
- Update update() to process quarantine each frame
- Update dispose() to flush quarantine during teardown

https://claude.ai/code/session_01LA6RwJfSB6nsab6v8oAGf9
@braedonsaunders braedonsaunders merged commit 2e602cb into main Jan 30, 2026
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