Files
metal2vulkan/docs
Anees Iqbal 4a393990fa rt: a presenting command buffer is scheduled once its submission passed vkQueueSubmit2
What: the planner's change to the presenting design, and its additions.
- Scheduled means, for a command buffer that presents a drawable, that its submission has passed
  vkQueueSubmit2: the submit thread no longer schedules it as its last segment joins the group
  (the group goes at once anyway), but in submit(), between queue_submit2 and
  core.done.submitted, which is where the completion thread first learns of the batch
  (complete.rs, Done::submitted). Its status, kernel times, scheduled handlers and
  wait_until_scheduled all follow the call, with no window and no wait across threads, and its
  scheduled handlers still run before its completed handlers. A failed submission schedules
  nothing: its handlers run as it retires, as an ended command buffer's do. The split wait
  (CbState::signal_unsubmitted) is gone.
- A present from the command buffer's own scheduled handler is valid now; the docs still say to
  present from the consumer's thread, as the handler runs on the submit thread.
- Several drawables in one command buffer each signal their own semaphore; the same semaphore
  twice is Refusal::DrawableSemaphoreRepeated (new), the same drawable twice
  Refusal::DrawableNotAcquired.
- The Safety texts of the three unsafe calls name the Vulkan rules the runtime cannot check (the
  image is that swapchain's; `ready` unsignalled with no signal or wait pending; the swapchain not
  destroyed while in use).
- The README's "Destroying a swapchain": which completions and drops come first
  (VUID-vkDestroySwapchainKHR-swapchain-01282); views may outlive the image, as Vulkan's object
  lifetime rules let a child of the device outlive the image it views.

Tests: the render test's second frame presents from the scheduled handler, the first and third
from the test's thread beside a handler that sleeps 100 ms; both drawables' teardowns follow the
guide, destroying the stand-in image before the views go; a new test presents two drawables from
one command buffer and checks the two refusals. Not yet run: potluck jobs next.
2026-11-19 00:08:46 -08:00
..