Skip to content

fix(vulkan): accumulated present semaphores for multi-submit sync (ADR-058) - #302

Merged
kolkov merged 1 commit into
mainfrom
release/v0.30.36
Aug 6, 2026
Merged

fix(vulkan): accumulated present semaphores for multi-submit sync (ADR-058)#302
kolkov merged 1 commit into
mainfrom
release/v0.30.36

Conversation

@kolkov

@kolkov kolkov commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix Vulkan present semaphore race condition when multiple queue.Submit() calls target the same swapchain image per frame (g3d#22)
  • Each submit now signals a new semaphore from per-image pool; vkQueuePresentKHR waits on all accumulated semaphores
  • Rust wgpu SwapchainPresentSemaphores parity (native.rs:743-843)
  • Zero overhead for common single-submit-per-frame case (pool starts with 1 semaphore)

Test plan

  • go build ./... — Windows, Linux, macOS, WASM
  • go test -count=1 ./... — 18 packages, 0 failures
  • golangci-lint run — 0 issues (Win/Linux/macOS)
  • swapchain_fail_closed_test.go updated for new pool struct
  • Visual: GOGPU_GRAPHICS_API=vulkan g3d fullscreen-overlay — needs Asahi Linux tester (@porjo)

…R-058)

Per-image semaphore pool replaces single present semaphore. Each
queue.Submit() signals a new semaphore from the pool, vkQueuePresentKHR
waits on all accumulated semaphores. Fixes g3d#22 race on TBDR GPUs
(Asahi Linux) where only the first submit was synchronized with present.

Rust wgpu SwapchainPresentSemaphores parity (native.rs:743-843).
Pools grow on demand, recycle after present — zero overhead for the
common single-submit-per-frame case.
@kolkov
kolkov merged commit 905bb3a into main Aug 6, 2026
14 checks passed
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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