Repository navigation
perf(vk): reduce ASTC memory pressure on small VRAM budgets - #1009
Merged
Merged
Conversation
pablitorockz
force-pushed
the
fix/minimum-astc-mips
branch
from
November 9, 2026 13:06
4f4553c to
b4a6422
Compare
soltros
added a commit
to soltros/Longshot
that referenced
this pull request
Nov 11, 2026
Adopts and adapts NotRexed/Hookshot#1009 by pablitorockz, original head 9390d68afff33046a0529c3b37c23d39926d1bd0. Preserve current size guards, legacy skip override and Longshot docs.
Joey-Magnus
reviewed
Nov 11, 2026
Joey-Magnus
left a comment
Contributor
There was a problem hiding this comment.
The branch hasn't changed since the review on Nov 9, so all of those points are still open. Main doesn't have this trimming yet: there's no RX_VK_LOW_VRAM_MIPS or TEX_TRIM_MB on main. What's still needed after a rebase:
- Drop
RX_VK_TEX_TRIM_MB(vk_texture.cpp:1475) and have the low-VRAM default feed main'sskip_frominstead, withRX_VK_TEX_SKIP_MBstill winning when set. Update the readme paragraph and test modes to match. tests/run_all.pynow uses per-file declarations, so theARGSentry won't apply any more.test_low_vram_texture_mips.pyshould declare its ownRUN_ALL_ARGS.- The answer-domains commit is probably obsolete on current main.
RX_VK_LOW_VRAM_MIPSis read ase[0]=='0'(line 1419). Since #2042, on/off switches go through env_on/env_value_off, sooffandfalseshould work too.
Since then, main has also added BC3-by-VRAM and preset memory budgets, so the 4 GB numbers should be measured again on the rebased branch.
Use 1024 / 8 MiB mip-selection defaults on Minimum when the driver reports a nonzero budget of at most 4.5 GiB. Feed the existing skip_from path and keep RX_VK_TEX_SKIP_MB and RX_VK_TEX_MAX_DIM overrides authoritative. Use the shared off-value parser for RX_VK_LOW_VRAM_MIPS. Evaluate preset defaults for each new texture while retaining the session budget heuristic. Exercise the production selection block in a game-free fixture, with per-file runner arguments, override precedence, opt-out spellings, budget boundaries, preset changes and preservation of UI/render/depth textures. Retain current main's runner and answer-domain fixture unchanged. Assisted-by: OpenAI Codex Co-Authored-By: Codex <noreply@openai.com>
pablitorockz
force-pushed
the
fix/minimum-astc-mips
branch
from
November 11, 2026 22:15
9390d68 to
8c4682f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fully mipmapped 3072-square ASTC textures occupy about 48 MiB when decoded, below the existing 64 MiB mip-trimming threshold. On Minimum with a small driver VRAM budget, retaining several of these images can crowd the texture working set.
Use 1024 / 8 MiB automatic mip-selection defaults on Minimum when the driver reports a nonzero budget of at most 4.5 GiB. This trades sampled-texture detail for a smaller working set; it does not establish a stable FPS floor.
Changes
mainata740d67ad41d1c8df52e40ef64193aeb96a6af3c, retaining its BC3 policy, texture allocation handling and preset memory budgets.skip_frompath.RX_VK_TEX_SKIP_MBretains its existing parsing and wins when supplied; the separateRX_VK_TEX_TRIM_MBcontrol is removed.RX_VK_TEX_MAX_DIMas a dimension-only override. Other presets and larger or unknown driver budgets retain the existing 2048 / 64 MiB defaults. The separate allocation-size limit and uncompressed render/depth handling are unchanged.env_value_offhelper forRX_VK_LOW_VRAM_MIPS, including0,off,falseandno, case-insensitively. Unset keeps the automatic policy. The driver budget is sampled once per session; preset defaults are evaluated for each new texture.RX_VK_TEX_MAX_DIM=512 RX_VK_TEX_SKIP_MB=2.RUN_ALL_ARGSin the new game-free test. Keeptests/run_all.pyandtests/test_program_answer_domains.pyexactly as they are on this base; the obsolete answer-domain compatibility commit is dropped.Validation
Fedora 44, i5-12450H, NVIDIA RTX 2050 Laptop 4 GB, driver 615.71.09. Native builds use Clang; the suite also uses GCC 16.2.1 for tests that require it.
main, the same fixture fails the expected 3072-square mip-selection assertion.python -I -B tests/run_all.py --jobs 2: 424 passed, 0 failed, 21 skipped. Skips require Windows-specific functionality, game modules/a game build, an opt-in Vulkan-device test, or unavailable dav1d, Pillow or .NET dependencies.git diff --checkpasses. Onlygpu/vk/vk_texture.cpp,readme.mdandtests/test_low_vram_texture_mips.pydiffer from the base.Not validated
Gameplay FPS and visual quality have not been remeasured on this base. The installed game frontend uses Vulkan API 7, while this base requires API 17; it cannot provide a valid comparison with these new backends. No previous-base FPS measurements are used as evidence for this revision. Windows builds and AMD/Intel gameplay were not tested.
No game files or build artifacts are included.