Skip to content

Deduplicate submitted surfaces to avoid a vulkan deadlock/crash#5799

Merged
cwfitzgerald merged 2 commits intogfx-rs:trunkfrom
Elabajaba:surface_dedup
Jun 12, 2024
Merged

Deduplicate submitted surfaces to avoid a vulkan deadlock/crash#5799
cwfitzgerald merged 2 commits intogfx-rs:trunkfrom
Elabajaba:surface_dedup

Conversation

@Elabajaba
Copy link
Copy Markdown
Contributor

Connections
Fixes #5774

Description
wgpu-hal's vulkan implementataion requires that we only submit each used surface texture once. If we submit the same surface texture multiple times, it'll deadlock.

To fix this, use a hashmap keyed on the surface texture arc's raw pointers instead of a smallvec to deduplicate the surface textures before we submit them.

Testing
Tested against https://github.com/Elabajaba/wgpu-vk-surface-crash

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Elabajaba Elabajaba requested a review from a team as a code owner June 11, 2024 22:25
Copy link
Copy Markdown
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

Crash on vulkan when multiple command encoders are used after #5681.

2 participants