mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 23:19:57 -04:00
An update that carries the shaders over builds the kit's current pipeline list, and a GPU without mesh shaders skips the list's mesh pipelines.
The carry path of an update does not run the shader preparation: it runs --warm-shaders, which builds the listed pipelines from the seed-pipeline-keys.bin the game folder already has. make_game.py now writes that file from the kit's list first, so a newer list reaches an updated install. Its shader variants are not translated on this path; a record whose variant the folder has neither prepared nor met is left out and counted. On a GPU that has no mesh shaders every mesh record failed with a log line each. They are counted in the step's line instead. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -5898,7 +5898,7 @@ static int seed_pipelines(const char *dir) {
|
|||||||
gfx_shader_prewarm((const uint8_t(*)[32])ids, u, sh, cpus, procs < 1 ? 1 : procs);
|
gfx_shader_prewarm((const uint8_t(*)[32])ids, u, sh, cpus, procs < 1 ? 1 : procs);
|
||||||
static const char note[] = "the listed pipelines are being built; a run that finds this file skips them\n";
|
static const char note[] = "the listed pipelines are being built; a run that finds this file skips them\n";
|
||||||
plat_file_write_atomic(mark, note, sizeof note - 1);
|
plat_file_write_atomic(mark, note, sizeof note - 1);
|
||||||
uint32_t queued = 0, dropped = 0, known = 0, other = 0, mesh = 0;
|
uint32_t queued = 0, dropped = 0, known = 0, other = 0, mesh = 0, no_mesh = 0;
|
||||||
plat_mutex_lock(&P.lock);
|
plat_mutex_lock(&P.lock);
|
||||||
uint32_t built0 = K.built, failed0 = K.failed;
|
uint32_t built0 = K.built, failed0 = K.failed;
|
||||||
K.loading = 1;
|
K.loading = 1;
|
||||||
@@ -5917,6 +5917,10 @@ static int seed_pipelines(const char *dir) {
|
|||||||
other++;
|
other++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (is_mesh(&s) && !vk_ctx()->has_mesh_shader) { // this GPU draws no mesh pipeline
|
||||||
|
no_mesh++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!is_mesh(&s) && P.indep && fs && gfx_shader_stage(vs) == GFX_STAGE_VS) { // its vertex output union, as the boot
|
if (!is_mesh(&s) && P.indep && fs && gfx_shader_stage(vs) == GFX_STAGE_VS) { // its vertex output union, as the boot
|
||||||
GfxShaderIo io[32];
|
GfxShaderIo io[32];
|
||||||
vs_outs(vs, fs, io);
|
vs_outs(vs, fs, io);
|
||||||
@@ -5953,9 +5957,9 @@ static int seed_pipelines(const char *dir) {
|
|||||||
char msg[640];
|
char msg[640];
|
||||||
snprintf(msg, sizeof msg, "prepare-pipelines: %zu listed pipelines: %u built (%u mesh), %u failed, %u the same as one "
|
snprintf(msg, sizeof msg, "prepare-pipelines: %zu listed pipelines: %u built (%u mesh), %u failed, %u the same as one "
|
||||||
"built before, %u without a shader this game version or its shader cache has, %u vertex pipelines left to "
|
"built before, %u without a shader this game version or its shader cache has, %u vertex pipelines left to "
|
||||||
"their first draw (NX2NAVI_PREPARE_PIPELINES=%s); on %d threads in %.0f ms; pipeline cache %s", n, built,
|
"their first draw (NX2NAVI_PREPARE_PIPELINES=%s), %u mesh pipelines this GPU cannot draw; on %d threads in "
|
||||||
mesh, failed, known, dropped, other, all ? "all" : "mesh", nt ? nt : 1, now_ms() - t0,
|
"%.0f ms; pipeline cache %s", n, built, mesh, failed, known, dropped, other, all ? "all" : "mesh", no_mesh,
|
||||||
saved ? "saved" : "not saved (builds kept running)");
|
nt ? nt : 1, now_ms() - t0, saved ? "saved" : "not saved (builds kept running)");
|
||||||
printf("%s\n", msg);
|
printf("%s\n", msg);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
rt_log("vk_pipeline: %s", msg);
|
rt_log("vk_pipeline: %s", msg);
|
||||||
|
|||||||
@@ -1622,6 +1622,20 @@ def shader_run(cmd, cwd=None):
|
|||||||
return rc
|
return rc
|
||||||
|
|
||||||
|
|
||||||
|
def refresh_pipeline_seed(out):
|
||||||
|
"""The kit's pipeline list (tools/pipeline_list.py) as the game folder's seed-pipeline-keys.bin, so that an update
|
||||||
|
which carries the shaders over builds a newer list's pipelines too: `--warm-shaders` builds from that file. The
|
||||||
|
list's shader variants are not translated on this path, so a record whose variant this folder has neither prepared
|
||||||
|
nor met is left out by the game, which counts those in its line."""
|
||||||
|
lst = KIT / 'tools' / 'data' / 'pipeline_list.bin'
|
||||||
|
if not lst.is_file():
|
||||||
|
return
|
||||||
|
import pipeline_list
|
||||||
|
got = pipeline_list.unpack(lst.read_bytes())
|
||||||
|
if got:
|
||||||
|
(out / 'seed-pipeline-keys.bin').write_bytes(got[1])
|
||||||
|
|
||||||
|
|
||||||
def warm_driver_cache(out):
|
def warm_driver_cache(out):
|
||||||
"""After an update that carries the shaders over: every prepared stage library is built into the graphics driver's
|
"""After an update that carries the shaders over: every prepared stage library is built into the graphics driver's
|
||||||
cache again (`nx2navi.exe --warm-shaders`). It takes seconds while the driver still has them. It takes minutes when
|
cache again (`nx2navi.exe --warm-shaders`). It takes seconds while the driver still has them. It takes minutes when
|
||||||
@@ -1633,6 +1647,7 @@ def warm_driver_cache(out):
|
|||||||
exe = out / EXE_NAME
|
exe = out / EXE_NAME
|
||||||
if not exe.is_file() or not (out / 'shader-prepared.bin').is_file():
|
if not exe.is_file() or not (out / 'shader-prepared.bin').is_file():
|
||||||
return
|
return
|
||||||
|
refresh_pipeline_seed(out)
|
||||||
say(" the prepared shaders are built into the graphics driver's cache again")
|
say(" the prepared shaders are built into the graphics driver's cache again")
|
||||||
t0 = time.monotonic()
|
t0 = time.monotonic()
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user