mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 18:09:58 -04:00
Keep textures released on the game's loader threads until the submission being recorded has run.
With the replay on the submitting thread (the default), vk_texture_release and entry_of destroy textures on the game's loader threads, where vk_exec_recording_fence is 0: the deferral took the last submitted value, so the image could go while another thread's submission, or the recorder behind it, still named it. Such deferrals now wait for issued + 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2767,6 +2767,10 @@ static void defer(int kind, uint64_t handle, VmaAllocation alloc) {
|
||||
static int stamp = -1;
|
||||
if (stamp < 0) stamp = rt_knob("DEFER_STAMP", "1") != 0;
|
||||
uint64_t tl = tl_noted, rf = stamp ? vk_exec_recording_fence() : 0;
|
||||
// vk_exec_recording_fence knows only the recording thread's own submission. A texture a guest thread releases (the
|
||||
// synchronous replay: vk_texture_release, entry_of, sweep_released on the game's loader threads) can be named by
|
||||
// the submission another thread records meanwhile: that one is issued + 1 (vk_sync_submit sets issued after it).
|
||||
if (stamp && !rf) rf = vk_sync_issued() + 1;
|
||||
if (rf > tl) tl = rf;
|
||||
dead[ndead++] = (Dead){kind, handle, alloc, open_active ? open_b.seq : next_seq, tl};
|
||||
rec_check_handle(kind == DEAD_VIEW ? REC_VIEW : kind == DEAD_BUFFER_VMA ? REC_BUFFER : REC_IMAGE, handle, 0, tl,
|
||||
|
||||
Reference in New Issue
Block a user