Textures: add an opt-in maximum dimension (VICTORY_TEXTURE_MAX_DIM) #63

Open
github-bot wants to merge 1 commit from github-bot/gh-63 into beta AGit
Owner

@⁠Evan-Lowry on GitHub · 2026-11-26 05:43 UTC · original
Evan-Lowry:textures-max-dim → beta · +344 −23 · 5 files · 1 commits · open

Summary

Add an opt-in VICTORY_TEXTURE_MAX_DIM limit for eligible sampled, block-compressed placed textures. The host uses an existing smaller mip chain and remaps shader views and uploads to match. Unset or 0 leaves the cap off. Diagnostics report cap savings and, with VICTORY_VRAM_TEXTURE_CENSUS=1, texture allocation buckets.

Measurements

RX 6800, 16 GB RAM; same gameplay scene, moving camera, ABBA-style comparisons. No game assets are included.

Maximum dimension Private memory Local VRAM Capped textures
Off 22.4–22.5 GB 11.3–11.4 GB 0
512 18.2–18.5 GB 7.1 GB 3,900
1024 20.4 GB 9.4 GB 753
256 17.3 GB — —

At 256 the frame pacing got worse (p95 1183 ms vs 383 ms at 512 with VICTORY_STAGING_BUDGET_MB=384), so 512 looks like the practical floor on a 16 GB PC.

The cap makes textures softer. Observed lettering, posters and walls retained correct materials, with no dark, grey or wrong materials. Frame times were noisy on the paging-bound PC, with no consistent regression.

Validated on this branch itself (current beta + this commit, same PC, camera moving; this build's first runs start from a fresh shader cache, so they reach the cell later and frame times aren't comparable to the table above):

VICTORY_TEXTURE_MAX_DIM Private median / peak System commit median
0 21.4 / 22.3 GB 50.5 GB
512 18.7 / 18.9 GB 46.6 GB

Screenshots in the cell show correct materials with the cap. They're softer, with no dark or wrong textures.

Test plan

  • Release build of victory, with and without diagnostics.
  • victory-gpu tests on D3D12 WARP, excluding depth_bounds_pipeline_loads_and_filters_draws; run the cap-specific WARP test with VICTORY_TEXTURE_MAX_DIM=512.
  • Clippy for the touched crate, including diagnostics: strict runs report existing dead-code and unnecessary_sort_by warnings in unrelated code; both configurations pass with those two lint categories allowed.

🤖 Generated with Claude Code

**@⁠Evan-Lowry** on GitHub · 2026-11-26 05:43 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/63) `Evan-Lowry:textures-max-dim` → `beta` · +344 −23 · 5 files · 1 commits · open ## Summary Add an opt-in `VICTORY_TEXTURE_MAX_DIM` limit for eligible sampled, block-compressed placed textures. The host uses an existing smaller mip chain and remaps shader views and uploads to match. Unset or `0` leaves the cap off. Diagnostics report cap savings and, with `VICTORY_VRAM_TEXTURE_CENSUS=1`, texture allocation buckets. ## Measurements RX 6800, 16 GB RAM; same gameplay scene, moving camera, ABBA-style comparisons. No game assets are included. | Maximum dimension | Private memory | Local VRAM | Capped textures | | --- | --- | --- | --- | | Off | 22.4–22.5 GB | 11.3–11.4 GB | 0 | | 512 | 18.2–18.5 GB | 7.1 GB | 3,900 | | 1024 | 20.4 GB | 9.4 GB | 753 | | 256 | 17.3 GB | — | — | At 256 the frame pacing got worse (p95 1183 ms vs 383 ms at 512 with `VICTORY_STAGING_BUDGET_MB=384`), so 512 looks like the practical floor on a 16 GB PC. The cap makes textures softer. Observed lettering, posters and walls retained correct materials, with no dark, grey or wrong materials. Frame times were noisy on the paging-bound PC, with no consistent regression. Validated on this branch itself (current beta + this commit, same PC, camera moving; this build's first runs start from a fresh shader cache, so they reach the cell later and frame times aren't comparable to the table above): | `VICTORY_TEXTURE_MAX_DIM` | Private median / peak | System commit median | | --- | --- | --- | | 0 | 21.4 / 22.3 GB | 50.5 GB | | 512 | 18.7 / 18.9 GB | 46.6 GB | Screenshots in the cell show correct materials with the cap. They're softer, with no dark or wrong textures. ## Test plan - Release build of `victory`, with and without `diagnostics`. - `victory-gpu` tests on D3D12 WARP, excluding `depth_bounds_pipeline_loads_and_filters_draws`; run the cap-specific WARP test with `VICTORY_TEXTURE_MAX_DIM=512`. - Clippy for the touched crate, including diagnostics: strict runs report existing dead-code and `unnecessary_sort_by` warnings in unrelated code; both configurations pass with those two lint categories allowed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:54:17 +00:00
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-26 05:43 UTC · original

Thanks @⁠Evan-Lowry, a clear opt-in with real numbers on a 16 GB PC. We'll try 512 on our RX 9070 XT and report here.

**@⁠PastiiJay** on GitHub · 2026-11-26 05:43 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/63#issuecomment-7183750594) Thanks @⁠Evan-Lowry, a clear opt-in with real numbers on a 16 GB PC. We'll try 512 on our RX 9070 XT and report here.
Author
Owner

@⁠HandshakeHackin on GitHub · 2026-11-26 05:54 UTC · original

I tested 56d62d0 on Windows WARP using a synthetic 768×512 BC1 texture with four mip levels. Each row and level had a distinct byte pattern. With the cap off, I compared all 261,120 active bytes across four staged levels. With VICTORY_TEXTURE_MAX_DIM=256, I compared all 15,360 active bytes in the two retained levels, including rows with padding in the host footprint. Both runs matched the original title mip data byte for byte. This checks staging and mip offsets; in-game VRAM and frame pacing remain for the hardware comparison. Reproducible fixture and results

**@⁠HandshakeHackin** on GitHub · 2026-11-26 05:54 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/63#issuecomment-7183919578) I tested `56d62d0` on Windows WARP using a synthetic 768×512 BC1 texture with four mip levels. Each row and level had a distinct byte pattern. With the cap off, I compared all 261,120 active bytes across four staged levels. With `VICTORY_TEXTURE_MAX_DIM=256`, I compared all 15,360 active bytes in the two retained levels, including rows with padding in the host footprint. Both runs matched the original title mip data byte for byte. This checks staging and mip offsets; in-game VRAM and frame pacing remain for the hardware comparison. [Reproducible fixture and results](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45764302258/job/139721392506)
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-26 06:05 UTC · original

Result on our RX 9070 XT (16 GB, Windows 11, Series S mode, same scene, current beta + this PR, 5 min per run, dedicated VRAM sampled every 10 s after the first minute):

VICTORY_TEXTURE_MAX_DIM Dedicated VRAM median (max) Private RAM
unset 10,609 MB (10,795) 22,919 MB
512 8,269 MB (8,375) 21,015 MB

So about 2.3 GB less VRAM (-22%) and 1.9 GB less RAM. The log shows limiting the host size of sampled placed BC textures max_dim=512, no crash. Room fps: 7.5 without, 8.0 and 6.4 with (two passes), no clear difference beyond this build's usual run-to-run spread.

**@⁠PastiiJay** on GitHub · 2026-11-26 06:05 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/63#issuecomment-7184083474) Result on our RX 9070 XT (16 GB, Windows 11, Series S mode, same scene, current beta + this PR, 5 min per run, dedicated VRAM sampled every 10 s after the first minute): | `VICTORY_TEXTURE_MAX_DIM` | Dedicated VRAM median (max) | Private RAM | | --- | --- | --- | | unset | 10,609 MB (10,795) | 22,919 MB | | 512 | 8,269 MB (8,375) | 21,015 MB | So about 2.3 GB less VRAM (-22%) and 1.9 GB less RAM. The log shows `limiting the host size of sampled placed BC textures max_dim=512`, no crash. Room fps: 7.5 without, 8.0 and 6.4 with (two passes), no clear difference beyond this build's usual run-to-run spread.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/63/head:github-bot/gh-63'
git switch 'github-bot/gh-63'

Merge

Merge the changes and update on Forgejo.
git switch 'beta'
git merge --no-ff 'github-bot/gh-63'
git switch 'github-bot/gh-63'
git rebase 'beta'
git switch 'beta'
git merge --ff-only 'github-bot/gh-63'
git switch 'github-bot/gh-63'
git rebase 'beta'
git switch 'beta'
git merge --no-ff 'github-bot/gh-63'
git switch 'beta'
git merge --squash 'github-bot/gh-63'
git switch 'beta'
git merge --ff-only 'github-bot/gh-63'
git switch 'beta'
git merge 'github-bot/gh-63'
git push origin 'beta'
This discussion has been locked. Commenting is limited to contributors.
No description provided.