Files
NX2navi/tests/tex_detail_check.c
chrg6 6e57ef9619 Check three of this pass's decisions without a device: the automatic texture detail, the device made with DLSS Frame Generation on, and the mesh fallback's depth hold.
Each decision moves into a header the runtime and a test both read, as vk_mesh_path.h does: vk_tex_detail.h (tex_detail_auto), vk_dlssg_device.h (dlssg_card_skipped, dlssg_device_create) and mesh_fb_hold.h (the hold's table). The runtime's behaviour is the same as before the move.

tests/tex_detail_check has the budgets from players' logs of 0.10.1 (a handheld's integrated GPU at 10,361 MiB now gets reduced, a 12 GiB card at 11,313 MiB full). tests/dlssg_device_check plays the laptop of the report with stand-ins for the interposer and the loader: the chosen Intel card is skipped, the NVIDIA card is made through the interposer, a card of another vendor is made by the loader without the interposer being asked, and a refusal falls through to the loader. tests/mesh_fb_hold_check holds a list for two presents after its colour draw was skipped, through a wait of 600 frames, and no longer once it is drawn or gone. Built against the rule 0.10.1 had, the first two and mesh_path_check fail (6, 13 and 3 checks).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-14 05:35:49 -05:00

54 lines
2.6 KiB
C

// runtime/vk_tex_detail.h: the level texture_detail = auto picks (vk_texture.c vk_texture_detail_auto), for the cards and
// budgets players reported. Built and run by tests/tex_detail_check.py; prints each failed check and exits 1 on any.
#include <stdio.h>
#include "vk_tex_detail.h"
static int fails;
static const char *const names[] = {"full", "reduced", "low"};
static void expect(long long mb, int shared, int rgba8, int want, const char *what) {
int got = tex_detail_auto(mb, shared, rgba8);
if (got != want) {
fails++;
printf("FAIL: %s (budget %lld MiB, integrated %d, uncompressed ASTC %d): %s, not %s\n", what, mb, shared, rgba8,
names[got], names[want]);
} else {
printf(" ok: %-62s budget %5lld MiB -> %s\n", what, mb, names[got]);
}
}
int main(void) {
// ---- the budgets in players' logs of 0.10.1
expect(10361, 1, 0, 1, "ROG Ally X, integrated (0.10.1: full, ended at save load)");
expect(7365, 0, 0, 1, "RX 7600, 8 GiB");
expect(11313, 0, 0, 0, "RX 7700 XT, 12 GiB");
expect(15569, 0, 0, 0, "RX 6800 XT, 16 GiB");
expect(31419, 0, 0, 0, "RTX 5090, 32 GiB");
// ---- between the old 8,192 MiB and the new 10,240: the cards of 10 GiB
expect(9300, 0, 0, 1, "a 10 GiB card (0.10.1: full)");
expect(8192, 0, 0, 1, "8,192 MiB, where full started in 0.10.1");
expect(10239, 0, 0, 1, "one MiB under the new start of full");
expect(10240, 0, 0, 0, "the new start of full");
// ---- low under 6,144 MiB, as before
expect(6144, 0, 0, 1, "6,144 MiB");
expect(6143, 0, 0, 2, "one MiB under it");
expect(4730, 0, 0, 2, "an RTX 3060 Laptop, 6 GiB");
// ---- an integrated GPU never gets full, and follows the budget below that
expect(16000, 1, 0, 1, "integrated with a 16 GiB budget");
expect(8034, 1, 0, 1, "Intel Iris Xe (8,034 MiB)");
expect(5000, 1, 0, 2, "integrated with a 5 GiB budget");
// ---- no budget reported: full, as before, also on an integrated GPU
expect(0, 0, 0, 0, "no budget reported");
expect(0, 1, 0, 0, "no budget reported, integrated");
// ---- uncompressed ASTC textures: one step lower under 20,480 MiB
expect(15569, 0, 1, 1, "a 16 GiB card with uncompressed ASTC");
expect(7365, 0, 1, 2, "an 8 GiB card with uncompressed ASTC");
expect(4730, 0, 1, 2, "a 6 GiB card with uncompressed ASTC (already low)");
expect(24000, 0, 1, 0, "a 24 GiB card with uncompressed ASTC");
expect(10361, 1, 1, 2, "integrated with uncompressed ASTC");
printf("tex_detail_check: %s\n", fails ? "FAILED" : "passed");
return fails ? 1 : 0;
}