Delete the boot prebuild's running marker at every orderly exit, so closing the game during boot is not taken for a driver crash.

The marker was deleted only when the boot's builds ended. A window closed before that left it, the next start read it as a start that died in the driver's compiler, and every later start on that GPU and driver skipped the prebuild and built each pipeline at its first draw.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 23:22:27 -05:00
parent b933e3d996
commit e887a1d18b
4 changed files with 7 additions and 1 deletions

View File

@@ -324,6 +324,7 @@ void rt_frame_presented(const tex_t *t, uint64_t n) {
fflush(stdout);
fflush(stderr);
fs_save_flush();
vk_pipeline_prewarm_marker_clear(); // an orderly end, not a driver crash in the boot's builds (vk_pipeline.c pm_skipped)
vk_pipeline_save(); // no-op without the Vulkan back end
prof_write();
rtss_limit_restore();

View File

@@ -82,6 +82,9 @@ void gfx_window_closed(void) {
int restart = plat_cas32(&g_restart, 0, 0) != 0;
rt_log("gfx: window closed; %s", restart ? "restarting" : "exiting");
cfg_save(); // a menu change saves 400 ms later on the render thread (option_rows.cpp); closing sooner kept the old file
// The window closed while the boot still built its pipelines: not the driver crash the marker is there to catch.
// Left in place, the next start took it for one and every later start skipped the prebuild (vk_pipeline.c pm_skipped).
vk_pipeline_prewarm_marker_clear();
vk_pipeline_save();
prof_write(); // plat_exit runs no atexit handlers
rtss_limit_restore(); // RivaTuner Statistics Server's profile as it was

View File

@@ -244,6 +244,7 @@ static void svc_body(Cpu *c, uint32_t imm, uint64_t pc) {
char at[160];
rt_log("guest ExitProcess at %s; exiting", ldr_describe(pc, at, sizeof at));
fs_save_flush();
vk_pipeline_prewarm_marker_clear(); // as the window's close (gfx_present.c gfx_window_closed)
vk_pipeline_save();
prof_write();
rtss_limit_restore();

View File

@@ -4232,7 +4232,8 @@ static void prewarm_run(void) {
// GPU and driver in <dir>/pipeline-prewarm-skip.txt, and starts on them build no recorded pipelines ahead of play:
// each one is built at its first draw instead, as with NX2NAVI_PIPE_PREBUILD=0. Another driver version, or deleting
// the file, brings the prebuild back. Only the boot's own share is covered: a crash during play, where the pool also
// builds what the boot left, says nothing about these builds.
// builds what the boot left, says nothing about these builds. An orderly end of the process during the boot (the
// window closed, the guest's ExitProcess, a --seconds run) deletes the marker as well: only a process that died leaves it.
static int cache_dir(char *dir, size_t n);
static void gpu_key(char *out, size_t n);
static char PM_run[PLAT_PATH_MAX * 2 + 48];