mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 17:09:57 -04:00
The user asked for it: the mode no longer gains frame rate, and the mesh shader fallback covers the cards it was written for. Its switch in the settings menu's Game tab is gone with the rows under it, and so are their 57 text ids and strings. low_end_gpu itself does nothing any more. It is still a known key, so an older nx2navi.ini gives no unknown-key warning, and while it is on the log says once that the mode was removed in 0.10.2. The preset that gave nine keys other defaults is gone, and so is the rule that read the mode's keys only while it was on: each of them (mesh_emulation, tex_clobber, foliage, vram_heap_limit, vram_reserve_mb, upload_batch_mb, mirror_stage, mirror_hot, submit_finish_gpu and the others) is an ordinary setting with the default of its row or of its reader, so a line a player wrote by hand keeps counting and a file with only the switch runs the game as it runs for everyone else. guest_opt in nx2navi.ini counts for the next rebuild without the switch too (tools/make_game.py). The recorder thread read the switch itself: on an AMD card without mesh shaders the mode turned it on. It is off on every AMD card now unless vk_recorder = 1 is set. nx2navi.ini.example lists the former mode's settings as single settings, the 0.10.2 notes have a Removed entry and name the foliage fix of the commit before this one, and the comments that said what the mode sets say so in the past tense. tests/cfg_parse_check has the new reading of the switch and of the keys without it; the test matrix is at 90 ok with the same two not ok as before (installer_test, worktree_test), and a clean build compiles 169 runtime files and links. Not run in the game. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
67 lines
4.3 KiB
C
67 lines
4.3 KiB
C
// runtime/vk_mesh_path.h: how the game's task and mesh programs are drawn (vk_device.c create_device): natively, through
|
|
// the mesh fallback, the mesh emulation or not at all, for each device kind and setting. Built and run by
|
|
// tests/mesh_path_check.py; prints each failed check and exits 1 on any.
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "vk_mesh_path.h"
|
|
|
|
static int fails;
|
|
#define CHECK(c, ...) do { if (!(c)) { fails++; printf("FAIL line %d: ", __LINE__); printf(__VA_ARGS__); printf("\n"); } } while (0)
|
|
|
|
static const char *const names[] = {"native", "fallback", "emulation", "none"};
|
|
|
|
static void expect_nv(int has_mesh, int amd_sc, int nvidia, const char *mf, const char *me, int want, const char *what) {
|
|
const char *why = NULL;
|
|
int got = mesh_path_decide(has_mesh, amd_sc, nvidia, mf, me, &why);
|
|
CHECK(got == want, "%s (mesh shaders %d, AMD RDNA 1/2 driver %d, mesh_fallback %s, mesh_emulation %s): %s, not %s",
|
|
what, has_mesh, amd_sc, mf, me, names[got], names[want]);
|
|
CHECK(why && *why, "%s: no reason for the boot line", what);
|
|
}
|
|
|
|
static void expect(int has_mesh, int amd_sc, const char *mf, const char *me, int want, const char *what) {
|
|
expect_nv(has_mesh, amd_sc, 0, mf, me, want, what);
|
|
}
|
|
|
|
int main(void) {
|
|
// ---- the default (auto, emulation off) by device
|
|
expect(1, 0, "auto", "0", MESH_PATH_NATIVE, "NVIDIA, Intel, Mesa or AMD's RDNA 3/4 driver with mesh shaders");
|
|
expect(1, 1, "auto", "0", MESH_PATH_FALLBACK, "an RX 6000 card on AMD's RDNA 1/2 driver");
|
|
expect(0, 1, "auto", "0", MESH_PATH_FALLBACK, "an RX 5000 card on AMD's RDNA 1/2 driver (no mesh shaders)");
|
|
expect(0, 0, "auto", "0", MESH_PATH_FALLBACK, "a GTX 10 card (no mesh shaders)");
|
|
// ---- mesh_fallback = 0 gives an RX 6000 card native mesh pipelines back, as 0.10.1 drew them
|
|
expect(1, 1, "0", "0", MESH_PATH_NATIVE, "an RX 6000 card with mesh_fallback = 0");
|
|
expect(1, 0, "0", "0", MESH_PATH_NATIVE, "a card with mesh shaders and mesh_fallback = 0");
|
|
expect(0, 0, "0", "0", MESH_PATH_NONE, "a card without mesh shaders and mesh_fallback = 0");
|
|
// ---- mesh_fallback = 1 on every device
|
|
expect(1, 0, "1", "0", MESH_PATH_FALLBACK, "an NVIDIA card with mesh_fallback = 1");
|
|
expect(1, 1, "1", "0", MESH_PATH_FALLBACK, "an RX 6000 card with mesh_fallback = 1");
|
|
// ---- the mesh emulation acts only without mesh shaders, and then before the fallback
|
|
expect(0, 0, "auto", "1", MESH_PATH_EMULATION, "no mesh shaders, mesh_emulation = 1");
|
|
expect(0, 1, "1", "1", MESH_PATH_EMULATION, "no mesh shaders, both set");
|
|
expect(1, 1, "auto", "1", MESH_PATH_FALLBACK, "an RX 6000 card with mesh_emulation = 1");
|
|
expect(1, 0, "auto", "1", MESH_PATH_NATIVE, "a card with mesh shaders and mesh_emulation = 1");
|
|
// ---- an NVIDIA card never takes the emulation, which ended the game inside its driver (GTX 10 cards in the
|
|
// low-end GPU mode of 0.10.1, which set mesh_emulation = 1)
|
|
expect_nv(0, 0, 1, "auto", "1", MESH_PATH_FALLBACK, "a GTX 10 card with mesh_emulation = 1");
|
|
expect_nv(0, 0, 1, "1", "1", MESH_PATH_FALLBACK, "a GTX 10 card with both set");
|
|
expect_nv(0, 0, 1, "0", "1", MESH_PATH_NONE, "a GTX 10 card with mesh_emulation = 1 and mesh_fallback = 0");
|
|
expect_nv(0, 0, 1, "auto", "0", MESH_PATH_FALLBACK, "a GTX 10 card by default");
|
|
expect_nv(1, 0, 1, "auto", "1", MESH_PATH_NATIVE, "an RTX card with mesh_emulation = 1");
|
|
expect_nv(1, 0, 1, "auto", "0", MESH_PATH_NATIVE, "an RTX card by default");
|
|
// ---- a value the settings table does not list reads as auto
|
|
expect(1, 1, "", "0", MESH_PATH_FALLBACK, "an RX 6000 card with an empty mesh_fallback");
|
|
expect(1, 0, "yes", "0", MESH_PATH_NATIVE, "a card with mesh shaders and mesh_fallback = yes");
|
|
// ---- the reason names the driver default, and how to turn it off
|
|
const char *why = NULL;
|
|
mesh_path_decide(1, 1, 0, "auto", "0", &why);
|
|
CHECK(why && strstr(why, "mesh_fallback = 0"), "the RX 6000 default's reason does not say how to turn it off: %s", why ? why : "(none)");
|
|
|
|
mesh_path_decide(0, 0, 1, "auto", "1", &why);
|
|
CHECK(why && strstr(why, "mesh_emulation"), "a GTX 10 card with mesh_emulation = 1: the reason does not name it: %s",
|
|
why ? why : "(none)");
|
|
|
|
printf("mesh_path_check: %s\n", fails ? "FAILED" : "passed");
|
|
return fails ? 1 : 0;
|
|
}
|