Commit Graph

1 Commits

Author SHA1 Message Date
Sam Sung 0bd7d0531c A Vulkan presentation stall waits instead of losing the device (#2393)
On Vulkan, the Windows default, a presentation stall longer than a second crashed the client. wgpu-hal 27.0.4's `acquire_texture` maps a `VK_TIMEOUT` from its post-acquire fence wait to `DeviceError::Unexpected`. wgpu-core treats that as a lost device, and Bevy then panics on "Couldn't get swap chain texture". Upstream tracks this as gfx-rs/wgpu#9029, still open in wgpu 30.

wgpu-hal 27.0.4 is now vendored under `third_party/wgpu-hal` through `[patch.crates-io]`, as `kira` is. Only `src/vulkan/instance.rs` differs. A timeout of the previous submission's wait, of the acquire, or of the acquired image's fence now waits again within a 30 s budget, then fails as upstream does. The Vulkan spec leaves the semaphore and fence unaffected by a timed-out call, so the retry is legal. Each retry logs, with the raw result. `BENILLA.md` says how to check the patch and when to drop it.

Tests: the lock resolves to the patch. Built for Linux and Windows.

Fixes #2373

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 11:59:54 +07:00