Repository navigation
GPU: a texture pass with no room gives up the oldest slots' host copies - #140
Draft
undeadhuman37 wants to merge 9 commits into
Draft
undeadhuman37 wants to merge 9 commits into
undeadhuman37 wants to merge 9 commits into
Conversation
The host removes the device for a constant buffer view of more than 65,536 bytes. The title's view heap holds larger sizes in slots it does not use, and the size went to the host as it was.
No PC GPU renders to R9G9B9E5, so CreateRenderTargetView on such a target removes the device. Add it to the existing stand-in table, next to the 16-bit colour formats.
Slots hold the host copy of what they view, so the idle sweep never frees copies the index pass made; once the card passed 90% of its budget room() stayed false and uploads stopped for the rest of the run. When a pass finds no room it now nulls up to 256 slots made more than 4 s ago, oldest first, so the sweep can free them. The memory line counts the slots given up. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Test run on an RTX 4070: the texture queue stays short for the whole run. Note that this branch also carries #25, #32 and #24 (merged into Tested
Texture queue, last 30 samples (~3 minutes) of each run
Visual differences I saw, cause not isolated (any of the four PRs could be behind them):
Not tested: this commit without #25/#32/#24, process memory (still about 23 GB committed), other GPUs. AI use: the run was done on my machine. Claude Code (Claude Opus 5.5) built and ran it, read the logs, worked out the figures and wrote this comment. |
triippywhale
pushed a commit
to triippywhale/victory-fork
that referenced
this pull request
Nov 25, 2026
…ig block first; constant lane masks on host halves refused; failed title images unmapped Cherry-picked from PalmVIDev, clean on this tree: - 0a3ca499b (AscilCH) GPU: Counting::realloc unregisters a big block before the allocator can reuse its address - c961a2ffa (LF2000 Builder) Shaders: a constant or opaque lane mask on host halves is refused - d689ae079 (dharmon96) Loader: a title image whose TLS redirect or imports fail is unmapped 3036f78da (paired dword mask copies) is already in this tree. The rest of fxceless#140 (AscilCH's lowering and IR fixes) conflicts and is handled or recorded separately in PALM-PORTS.md. Co-authored-by: LF2000 Builder <builder@lf2000.local> Co-authored-by: dharmon96 <lettucedevils51@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
The index pass keeps a host copy for every slot it uploads, and a slot's copy is never idle to the sweep, so only unmapping frees it. Once the card passed 90% of its budget,
room()stayed false: the pass refused 256 slots and stopped every frame for the rest of the run, and uploads froze (about 14 GB, thousands of slots still due).Now, when a pass finds no room, up to 256 slots the pass made more than 4 s ago, oldest first, are made null so the sweep can free their copies. The memory line gets a count of slots given up. Marked
shortcut:in the code: oldest made first, not least sampled, because a draw reading a texture by index leaves no trace. A slot given up stays empty until the title writes or maps it again, so a texture still on screen may draw empty meanwhile.Tested
cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace(499 passed, 0 failed) andcargo xtask policypass.eviction_takes_the_oldest_made_slots_and_spares_the_recent(synthetic, no game files).AI use: an AI tool (Claude Code) wrote this change; a person ran and reviewed the checks.
Note on this branch: it is based on
fx-main, so besides this change (one commit, 3 files) the diff also carries the other commits merged there. A one-commit version onmainis prepared and not yet pushed. Eviction can leave a slot drawing empty; see the test comment below about visual differences, whose cause is not isolated.