Add the texture_detail setting, which makes large ASTC textures without their largest one or two mip levels on cards with little video memory.

The textures of a loaded area are what fills a 6 GiB card: with the budget taken as 4,730 MiB a walk through Castle Town held 6,907 MiB of device memory, 4,302 MiB of it textures, 201 pools were refused their mirrors and the game ran at 20 fps. With texture_detail = reduced a mipmapped 2D or 2D-array ASTC texture of 256x256 and more that the game's CPU fills is made without its largest level, with low without its two largest when it is 1024x1024 or more. The same walk then held 5,472 MiB (textures 2,357) and 4,987 MiB (textures 1,997), and the ASTC texels decoded fell from 2,589 M to 826 M and 503 M. auto, the default, picks full from 8,192 MiB of device-local budget, low under 6,144 MiB and reduced between. full changes nothing.

The image holds the game's levels from the one it starts at (VkTexImage.skip), and the upload with its ASTC regions and BC3 encoding, WriteTexels, the write-back, the views and the sampler LOD clamp of combined bindings count from there. Render targets, storage images, 3D and cube textures, small and unmipped textures and textures the device samples as ASTC itself are left whole, as is a texture made over a live one that holds GPU-written content. A shader that fetches texels by position or uses a texture's size gets the texture whole: gfx_shader.c marks such bindings from the SPIR-V (the layer count of an array, which the translator's layer clamp asks for, does not count), and the replay makes a reduced texture bound there again with every level.

Not run on a card with 6 GiB: the figures come from an RTX 5090 with NX2NAVI_VRAM_BUDGET_MB=4730.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 09:38:07 -05:00
parent f747c4e43d
commit 8603b0e1e9
8 changed files with 389 additions and 43 deletions

View File

@@ -328,6 +328,14 @@
# are raised; shadow maps, data maps and screen-sized buffers keep the game's setting. Changes while the game runs take
# effect at once.
# aniso = game
# Texture detail: auto, full, reduced or low. The textures of a loaded area are what fills a card with little video
# memory, and three quarters of a texture is its largest mip level. reduced makes the large surface textures (256x256 and
# more, with smaller levels) without that level, low without the two largest when they are 1024x1024 or more. Surfaces
# seen up close look softer; interface art, small textures, shadow maps and everything the game draws itself keep their
# size. auto picks by the video memory Windows grants the game: full from 8192 MiB (cards of 10 GB and more), low under
# 6144 MiB (cards of 6 GB and less), reduced between (8 GB cards). The log says what was picked ("texture detail:").
# Read at start.
# texture_detail = auto
# Sun shadow map size: game (the game's own, which changes with the view and drops to about 400 near the ground, so
# leaf shadows look blocky and jump) or a fixed 256, 512, 768, 1024, 1536 or 2048. Above 960 the texture heap grows with
# it. 256 is coarser than the game's own and is for integrated GPUs short of memory bandwidth. Read at start.