L1. A change of the GPU mappings lands the pending results first, under vk_lock, with the mappings that they
were made with.
buffer.c, above page_cmp, and above ChgRun. compute.c, above vk_compute_mem_need_map.check_map_lands_covered in tests/vulkan_headless.c, check_mapping_landing in
tests/vulkan_lock_waits.inc, and the ctest pending_pages.L2. A change of guest memory that the renderer holds nothing of does not wait for vk_lock.
pend_lock, so that a change that skipped
vk_lock finds no new owner on its pages before it ends.owned.c, own_publish.check_mapping_lock in tests/vulkan_lock_waits.inc, and check_map_waits in tests/vulkan_headless.c.L3. The question "is a result pending here" is asked first with no lock.
buffer.c, mem_need_reason.check_need_unlocked in tests/vulkan_storage_logged.inc.L4. The thread that lands passes the lookups, and other readers wait under vk_lock for the landing.
buffer.c, the member out_landing of t_buffer. compute.c, above cs_mem_need, and cs_land.tests/vulkan_release.c covers the recursion. check_landing_wait covers a reader on another thread.L5. A landing does not start inside another landing.
vk_lock.cmd.c, above g_landing, and writeback.c, vk_write_runs.tests/vulkan_release.c, whose header names the recursion. No test makes the 2^64 stamp.L6. A result can flush a render target that overlaps it while it lands.
writeback.c, above t_result_depth.tests/vulkan_release.c.L7. Nothing records into the frame's command buffer inside a landing, a recycle or a submission.
cmd.c, above g_rec_unsafe. mirror.c, above own_entries, and harvest_left.check_mirror in tests/vulkan_mirror.inc, the case "not published inside the landing".L8. The mirror takes a batch out of its list before it takes the batch in.
mirror.c, vk_mirror_done, and above vk_mirror_publish.L9. The GPU thread waits for its next frame slot with no lock held.
vk_lock held, up to 3.1 s at a time in one game's menus. The
game threads that landed results, changed memory or performed releases waited behind it.cmd.c, above g_recycle_at.check_frame_ready in tests/vulkan_lock_waits.inc.L10. A landing waits for the GPU with no lock held, and then takes vk_lock.
vk_lock while the recording thread waited for a pipeline of a draw. When the
work is done on the GPU already, the copy waits for nothing of the recording thread.owned.c, own_land, and above own_wait.check_landing_wait in tests/vulkan_lock_waits.inc.L11. A landing uses a command pool and a host buffer of its own, apart from the pools and rings of the frames.
owned.c, the member pool of g_owned, and own_land. cmd.c, above vk_submit_for_readback.check_owned_readback in tests/vulkan_owned_readback.inc.L12. The hooks of the ownership layer call vk_lock and vk_unlock, not the lock object.
owned.c, vk_own_init.tests/vulkan_release.c checks the signaled events and the lock depth.L13. The submission stamp of an owner is atomic.
vk_lock, before the landing takes the lock.owned.c, vk_own_res_wrote and own_writer.check_owned_in_place_write in tests/vulkan_owned_readback.inc.L14. The host address of an entry is kept with the generation of the GPU mappings.
buffer.c, above entry_host.L15. The marks at the other addresses of a page are made after the scan locks are released.
buffer.c, above ww_take_peers.check_wt_alias runs the path. No test forces the lock order.L16. The pending targets at the aliases of a range are collected under the alias lock and flushed after it.
surface.c, above rt_pending_alias.check_alias_newer_target in tests/vulkan_headless.c runs the path.Made from docs/layers/gpu/buffer-rewrite-inventory.md at 69237645142c. GPL-3.0-or-later.