Files
NX2navi/runtime/vk_tex_detail.h
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

21 lines
1.1 KiB
C

// The level texture_detail = auto picks (vk_texture.c "texture detail", vk_texture_detail_auto). Header only, so that
// tests/tex_detail_check.c checks the choice without a device.
#pragma once
#include <stdint.h>
// Full from DETAIL_FULL_MB of device-local budget on, low under DETAIL_LOW_MB, reduced between; under DETAIL_RGBA8_MB
// one step lower where the ASTC textures stay uncompressed. vk_texture.c says where each number comes from.
#define DETAIL_FULL_MB 10240
#define DETAIL_LOW_MB 6144
#define DETAIL_RGBA8_MB 20480
// mb: the device-local budget in MiB, 0 when the device reports none. shared: the video memory is the system's own
// (an integrated GPU), whose budget is a share of the PC's memory: never full. rgba8: the ASTC textures stay RGBA8
// here (astc = cpu, a card without the decoder, astc_bc = 0). Returns 0 full, 1 reduced, 2 low.
static inline int tex_detail_auto(int64_t mb, int shared, int rgba8) {
int most = !mb || mb >= DETAIL_FULL_MB ? 0 : mb >= DETAIL_LOW_MB ? 1 : 2;
if (mb && !most && shared) most = 1;
if (mb && mb < DETAIL_RGBA8_MB && most < 2 && rgba8) most++;
return most;
}