First uploads over the line: the widest free range is what fits in either texture pool #4199
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4199"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by marquezlale-creator on 2026-11-30T17:22:08Z.
What it changes
resource::first_upload_decisionlets a first upload past the room line go without a new block when it fits a free range of the texture pools (pool::texture_widest_free). That took the wider of the large and small pools. A small face (4-12 KiB) can only be cut from the small pool (pool_for), so it was admitted on the large pool's room while its own pool grew a new 64 MiB block for it, with none refused at the whole card.Now
texture_widest_free(bytes)looks at the pool the texture goes to, told by its size (after review): 64 KiB or less in all → the small pool; over 256 KiB → the large pool, whatever the small one holds; in between, where the size alone does not tell (4 KiB placement depends on the first level), it must fit in both. Each pool's range counts after its start is moved up to the pool's alignment (64 KiB / 4 KiB), and the small pool only where small textures go (VICTORY_POOL_SMALLplacement andVICTORY_POOL_SMALL_APARTboth on). A unit test covers it (widest_free_is_its_own_pools).How it was tested
cargo testpassed for the crates it touches:cargo test -p victory-gpu widest_free first_uploadyes;cargo check -p victory --testsyes.Checked for overlap
texture_widest_free).🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by IRennie74 on 2026-11-30T18:23:02Z.
The fix is right for the flood you saw. One side effect of taking the smaller of the two pools: when the small pool's widest range is small or 0, every large texture over the line is now judged by the small pool's room too. A large texture that would fit the large pool's free range then falls through to the next check.
The caller knows which pool the texture goes to.
first_upload_decision's argument atresource.rs:2677is computed where the texture's size and placement are at hand, andpool_for(alignment, apart)picks the pool. Passing the alignment intotexture_widest_freeand looking only at that pool would keep the fix for small faces without refusing large textures on the small pool's account. On 8-12 GB cards, which run over the line most, extra refusals of large first uploads mean more textures shown at lower levels.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by marquezlale-creator on 2026-11-30T18:42:34Z.
Thanks, agreed.
texture_widest_freenow takes the texture's size and looks only at the pool it goes to: 64 KiB or less in all → the small pool; over 256 KiB → the large pool, whatever the small one holds; in between (where the size alone doesn't tell, since the 4 KiB placement depends on the first level) → both, as before. The alignment itself isn't known at that call site, so the size decides; the test covers all three cases (9392a57e).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:45:52Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed