mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 10:19:57 -04:00
Show Prepare the Shaders moving in the launcher: the game prints its counts and the step sends them on.
The step sat at 0 % until it was done, an hour on some PCs, because nothing it ran reported progress to the launcher. nx2navi.exe --prepare-shaders now prints how many shaders it has translated and how many it has built into the driver's cache every 2 s. make_game.py reads them as they come and fills the bar, the translation the first half and the build the second, with the counts in the step's text. An event every 10 s keeps the text current while nothing is printed, and after 3 minutes without a count moving it says so, and that the step is still running. The selftest draws the step as a tenth screen. Its made-up update was version 0.3.11, so from 0.4.0 on the update-ready screen showed Up to Date and was no longer drawn; it is now a minor version past the launcher running it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BSHQpLnScF9sNv4LNAaaS3
This commit is contained in:
@@ -2221,10 +2221,18 @@ static long long prepare_files(const char *ans_path, const char *prg_path, int t
|
||||
for (int i = 0; i < threads; i++)
|
||||
if ((t[k] = plat_thread_new(prep_worker, &p, "shader prepare"))) k++;
|
||||
if (!k) prep_worker(&p);
|
||||
for (int m = 0; m < k; m++)
|
||||
while (!plat_thread_join_ns(t[m], 5000000000u))
|
||||
rt_log("gfx_shader: prepare: %lld of %zu pairs, %llu translated, %.0f ms", (long long)p.done, p.n_ans,
|
||||
(unsigned long long)((uint64_t)n_xlated - xl0), (double)plat_now_ms() - t0);
|
||||
// every 2 s a count on stdout for tools/make_game.py (step_shaders reads "prepare-shaders: progress" lines and shows
|
||||
// them in the launcher, which otherwise sat at 0 % for the whole step), and every 10 s one in the log
|
||||
for (int m = 0, polls = 0; m < k; m++)
|
||||
while (!plat_thread_join_ns(t[m], 2000000000u)) {
|
||||
printf("prepare-shaders: progress translate %lld %zu\n", (long long)p.done, p.n_ans);
|
||||
fflush(stdout);
|
||||
if (++polls % 5 == 0)
|
||||
rt_log("gfx_shader: prepare: %lld of %zu pairs, %llu translated, %.0f ms", (long long)p.done, p.n_ans,
|
||||
(unsigned long long)((uint64_t)n_xlated - xl0), (double)plat_now_ms() - t0);
|
||||
}
|
||||
printf("prepare-shaders: progress translate %zu %zu\n", p.n_ans, p.n_ans);
|
||||
fflush(stdout);
|
||||
svc_set_limit(svc_runtime_limit());
|
||||
rt_log("gfx_shader: prepare: %zu %s of %zu programs: %llu translated, %lld failed, %lld without a program, the rest "
|
||||
"cached; %lld default variants with refined answers; %.0f ms", p.n_ans, what, p.progs.n,
|
||||
|
||||
Reference in New Issue
Block a user