You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit tutorial to reset & record command buffers each frame (#255)
* Update tutorial for command buffer re-recording
Means the code now calls recordCommandBuffer every frame instead of ahead of time
Many changes to the structure of chapters 14 & 15, with small changes to subsequent
chapters.
Primary focus was shifting everything away from 'swapchain image count' to
MAX_FRAMES_IN_FLIGHT. This has caused a lot of chapter 15 to need to be rewritten.
Such as: Introducing fences alongside semaphores and not later; Waiting on a fence
at the start of the frame before introducing acquireNextImage; consolidating the
Frames In Flight concepts to apply to command buffers, fences, and semaphores at
the same time.
Chapter 14 saw command buffer allocation reduced to 1 at a time. This allows the
concept of Frames in Flight to not need introduction before having a triangle
drawing on the screen.
* Update introduction to semaphores and fences
Greatly improve the descriptions of semaphores and fences before their
introduction into the code. Provide examples with psuedo code.
By using max_frames_in_flight command buffers & semaphores, we dont
need to keep track of previously sumitted frames' fences and wait
on them "just in case". This removes a lot of the confusion I had
when I first was trying to understand the vulkan update loop.
* Remove accidental code changes
Un-comment vkDeviceWaitIdle and remove resizing of imagesInFlight (which was removed)
* Use uint32_t instead of size_t for currentFrame
* Address typos and fixup changes for re-recording command buffers PR
* Add description of fences needing explicit resetting while semaphores are automatic
* Elaborate on why 2 frames in flight are chosen
* Fix deadlock in resizing from resetting the fence too early
Because acquiring the swapchain image index may cause drawFrame to return early,
it was possible to cause the next vkWaitForFences to deadlock. By delaying fence
resetting till after acquiring, it prevents the deadlock.
0 commit comments