Tolerate destruction of textures used in immediate queue operations prior to submit #7843
+76
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Textures used in "immediate" operations on GPUQueue (e.g.
writeTexture
) must not be destroyed at the time thatwriteTexture
is called, but it is okay to destroy the texture at any point after that. The actual commands effectingwriteTexture
will not be executed until the next submit, but my understanding is that that is our implementation detail.This change checks at submit time whether the texture is held pending deletion and, if so, does not raise a destroyed resource error.
It's possible that any texture used in
pending_writes
must either be active or in the list for pending deletion, but I'm not sure if that's the case. If it is, we might want to do something like make the check here a debug-only assertion.I've also included a separate commit that adds
env_logger
tocts_runner
.Testing
This may fix a large number of CTS tests, I haven't tried to identify them all, but I did add one set. I also added a directed test.
Squash or Rebase? Rebase
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.