Fix GPU synchronization errors after frame dumps #162

Merged
klimovich008 merged 3 commits from codex/dump-timeline-values into main 2026-11-07 23:46:14 +00:00
klimovich008 commented 2026-11-07 14:07:40 +00:00 (Migrated from github.com)

What this fixes

Returning from a frame dump to normal rendering can signal an already reached timeline value and report VUID-VkSubmitInfo2-semaphore-03882. This can stall rendering or break synchronization after capture.

Why merge

  • Every replay mode allocates values from the existing shared counter.
  • Both synchronous paths use the ordering lock; queued work and reserved present values retain their behavior.
  • Command batching, defaults and environment-variable controls stay unchanged.

Change

  • gpu/vk/vk_replay.cpp: share timeline allocation across normal/dump modes and protect synchronous allocation/submission ordering.
  • nx2/test_timeline_modes.py: check mode switches, queued/legacy paths and reserved present values.

Tested

  • From a compiler developer shell: python nx2/test_timeline_modes.py --cxx clang++ checks 100 transitions and allocation controls. Fails on the old code, passes now.
  • RX 9070 XT: the newer renderer reports 03882 after the frame dump. With this fix, a 258-second run completes the dump and continues rendering with zero validation errors. The same #217/#225 shader fixes are included in both runs.

Not covered

  • Tested on AMD only.
  • Colored noise remains; this does not claim to fix every synchronization or rendering problem.
## What this fixes Returning from a frame dump to normal rendering can signal an already reached timeline value and report `VUID-VkSubmitInfo2-semaphore-03882`. This can stall rendering or break synchronization after capture. ## Why merge - Every replay mode allocates values from the existing shared counter. - Both synchronous paths use the ordering lock; queued work and reserved present values retain their behavior. - Command batching, defaults and environment-variable controls stay unchanged. ## Change - `gpu/vk/vk_replay.cpp`: share timeline allocation across normal/dump modes and protect synchronous allocation/submission ordering. - `nx2/test_timeline_modes.py`: check mode switches, queued/legacy paths and reserved present values. ## Tested - From a compiler developer shell: `python nx2/test_timeline_modes.py --cxx clang++` checks 100 transitions and allocation controls. Fails on the old code, passes now. - RX 9070 XT: the newer renderer reports `03882` after the frame dump. With this fix, a 258-second run completes the dump and continues rendering with zero validation errors. The same #217/#225 shader fixes are included in both runs. ## Not covered - Tested on AMD only. - Colored noise remains; this does not claim to fix every synchronization or rendering problem.
Commenting is not possible because the repository is archived.
No description provided.