Skip to content

Release command buffer references after submit - #8

Open
jakubmaniak wants to merge 2 commits into
kommander:mainfrom
jakubmaniak:cmd-buffers-disposing
Open

Release command buffer references after submit#8
jakubmaniak wants to merge 2 commits into
kommander:mainfrom
jakubmaniak:cmd-buffers-disposing

Conversation

@jakubmaniak

@jakubmaniak jakubmaniak commented Jul 11, 2026

Copy link
Copy Markdown

Releases GPUCommandBuffer references after queue.submit(...).

This fixes a memory leak caused by the fact that <GPUCommandBuffer>._destroy() is only available internally
and cannot be called by users directly (without as any hack).
The leak becomes noticeable when command buffers are continuously created and submitted in a render loop.


GPUCommandBuffer objects are one-time-use according to the WebGPU specification - they do not need to be kept alive after submission.

Note: Once a GPUCommandBuffer object has been submitted, it cannot be used again.

Source: https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer

Tested on:

  • Windows 10 (x86_64)
  • Windows 11 (x86_64)
  • Linux Mint 22.3 (x86_64)

macOS not tested yet.

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