Finish the queue before TOTK_SHOTS and --shot read the presented image, which the replay thread may not have rendered yet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-10-25 23:31:09 +03:00
1 parent 469c2be1e7
commit 06f4fe93aa
1 file changed
+2
+2
View File
@@ -200,6 +200,7 @@ static void save_shot(const tex_t *t, const char *path) {
view_t view;
memset(&view, 0, sizeof view);
NVNcopyRegion r = {.width = (int)w, .height = (int)h, .depth = 1};
gfx_backend()->finish(); // the presented frame's submissions may still be queued for the replay (vk_backend.c)
gfx_backend()->read_texels(t, &view, &r, px, 4ull * w, 4ull * w * h);
if (bgra)
for (uint64_t i = 0; i < 4ull * w * h; i += 4) {
@@ -238,6 +239,7 @@ static void series_shot(const tex_t *t, uint64_t n) {
view_t view;
memset(&view, 0, sizeof view);
NVNcopyRegion r = {.width = (int)w, .height = (int)h, .depth = 1};
gfx_backend()->finish(); // the presented frame's submissions may still be queued for the replay (vk_backend.c)
gfx_backend()->read_texels(t, &view, &r, px, 4ull * w, 4ull * w * h);
for (uint32_t y = 0; y < oh; y++)
for (uint32_t x = 0; x < ow; x++) {