Skip to content

[deno] Fix dropping of command encoders/buffers, and an enum typo #7808

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

Merged

Conversation

andyleiserson
Copy link
Contributor

@andyleiserson andyleiserson commented Jun 14, 2025

Fixes #7797, a double-free error in deno. Command encoders, since they are the same wgpu object as the command buffer they become, should not be dropped after a buffer has been created from that encoder. Separately, I think command buffers should be explicitly dropped, even after they have been submitted.

Also fixes a typo in the GPUTextureFormat conversion.

This resolves a crash in the copyTextureToTexture tests, but they are still failing due to #7391, so they cannot be added to the regression until that is fixed.

Testing
Enables some CTS tests related to Queue.submit. As noted in a comment, the error reported if CommandEncoder.finish is called twice is not right, and I would not expect a CTS test for that to pass, but I also can't find one, so I made a note in gpuweb/cts#4401 to add it.

Squash or Rebase? Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • Run cargo xtask cts.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@andyleiserson andyleiserson requested review from crowlKats and a team as code owners June 14, 2025 19:15
@andyleiserson andyleiserson force-pushed the deno-encoder-drop-and-tex-format branch 2 times, most recently from a768ce0 to 93cc587 Compare June 14, 2025 19:29
@andyleiserson andyleiserson force-pushed the deno-encoder-drop-and-tex-format branch from 93cc587 to 42258d8 Compare June 14, 2025 19:32
@andyleiserson andyleiserson merged commit afa0f71 into gfx-rs:trunk Jun 16, 2025
40 checks passed
@andyleiserson andyleiserson deleted the deno-encoder-drop-and-tex-format branch June 16, 2025 17:50
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.

Intermittent cannot remove a vacant resource panics running in deno
2 participants