Number draw marks atomically, since the replay's workers record them too.

The mark counter and the ring were written as if only the replay thread made draw marks, but a pass's chunks are
recorded by the replay's workers side by side, and each of them marks its draws. The number is taken atomically now,
and each number has its own slot of the ring. The report says what the numbers mean with workers on: the two marks
the GPU names are exact, the numbers between them are in recording order and not all later in the queue; the mark
the GPU last reached is always printed, also when the list does not come to it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 22:28:26 -05:00
parent 96d656ba1d
commit 3572a4d433
2 changed files with 17 additions and 5 deletions

View File

@@ -188,7 +188,8 @@ void vk_pass_marks_format(const char *source, uint32_t started, uint32_t finishe
void vk_pass_marks_report(void); // vk_device.c device_fault_report: the AMD words and the NVIDIA checkpoints, formatted
// Draw marks (vk_crumbs.c, NX2NAVI_DRAW_CRUMBS=1 with VK_AMD_buffer_marker; off by default): a mark where the shaders
// or the pipeline state change inside pass m, before the draw with index draw in that pass, so a lost device's report
// names the shaders of the draws the GPU had not finished. Replay thread only; nothing while vk_draw_marks_on is 0.
// names the shaders of the draws the GPU had not finished. From any thread that records draws (the replay and its
// workers): the mark takes its number atomically. Nothing while vk_draw_marks_on is 0.
extern int vk_draw_marks_on;
void vk_draw_mark(VkCommandBuffer cb, const VkPassMark *m, const GfxShader *vs, const GfxShader *fs, uint32_t draw);