Skip to content

fix(webgpu): defer GPU resource destruction for pending commands#8655

Merged
mvaligursky merged 1 commit intomainfrom
mv-webgpu-deferred-destroy
Apr 27, 2026
Merged

fix(webgpu): defer GPU resource destruction for pending commands#8655
mvaligursky merged 1 commit intomainfrom
mv-webgpu-deferred-destroy

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

Defer destruction of WebGPU textures and buffers that may still be referenced by encoded-but-not-yet-submitted command buffers, matching the existing pattern used by WebgpuBuffer and WebgpuTexture.destroy.

Changes:

  • Query sets: Defer destruction of GPUQuerySet and its resolve buffer when tearing down profiling queries.
  • Render targets: Defer destruction of multisampled color attachments and internally allocated depth textures when releasing or resizing render targets.
  • Textures: When recreating a GPU texture after a dimension change during upload, defer destruction of the previous gpuTexture.

No public API changes.

Use deferDestroy for query sets, render target attachments, and texture
recreate path so resources are not destroyed while still referenced by
encoded-but-not-submitted command buffers.
@mvaligursky mvaligursky self-assigned this Apr 27, 2026
@mvaligursky mvaligursky merged commit e739de9 into main Apr 27, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-webgpu-deferred-destroy branch April 27, 2026 10:13
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.

1 participant