GPU: a decoration bake draw's own textures are uploaded before it #1264
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1264
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1264"
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?
@UwUCammie on GitHub · 2026-11-26 05:26 UTC · original
UwUCammie:fix/bake-draw-sources→main· +488 −32 · 2 files · 1 commits · openThe decoration bake (the pass that composites characters' skin once while a scene loads) binds no texture through a table. Each draw's constants and its buffer of 304-byte records hold view heap indices, so everything it samples has to be on the card already through the queue of textures picked by index. A source still waiting at that moment is baked wrong for the rest of the run: black, blotched or missing skin on NPCs.
The early pass that is meant to cover this misses in three ways:
resource::room()says the card is full.Change
VICTORY_BAKE_SOURCES_MB(default 1024) per draw.VICTORY_BAKE_SOURCES=0only counts.sampled_wrongis counted after the passes: textures whose memory is mapped and whose host slot still shows nothing.The existing budgeted pass for the four listed programs is left as it is.
Measured
RX 7900 XT 20 GB, RADV 26.3.1, Wine 11.22, vkd3d-proton;
988aa41plus this commit, diagnostics build; opening cutscene to about 100 s; no relay, late wait or async submit, 24 ms pipeline wait. One run per row:VICTORY_BAKE_SOURCESThe 55 % rows use
VICTORY_TEXTURE_ROOM_PERCENT=55to get the accounting of a card shared with another game. That is a simulation: the queue is told there is no room while the memory is really there, so it shows that the bake no longer depends on the room check, not what happens when an allocation actually fails.Most of what a bake draw finds "waiting" on main is a streamed texture that is partly mapped and already uploaded as far as it is mapped; those are counted separately (
as_far_as_mapped_already) and left alone.What this does not fix
Related
#1097 raises the room line for bake passes and widens the due list for the four listed programs. This goes at the same problem from the draw's side and covers every bake program. They overlap in
early_textures, so whichever lands second needs a small rebase.Tests
cargo clippy --workspace --all-targets --locked -- -D warnings, and with--all-features: clean.cargo test -p victory-gpu --locked -- --test-threads=1under Wine: 204 passed, 2 failed. The two (drvwatch::tests::the_system_takes_the_subscription,watch::tests::holes_are_known_by_their_bits_only_when_noted_for_good) fail the same way on988aa41without this change here.@Ym1r1710 on GitHub · 2026-11-26 08:22 UTC · original
Tried this on an RTX 5080 (16 GB, Windows 11), Series X, prison cell opening. Card is tight on room here: around 250 texture passes a run find no room.
5 runs with it on, 2 with VICTORY_BAKE_SOURCES=0. Without it sampled_wrong_so_far ends at 71-84, with it 0 every time, so the counting side does what it says.
One thing I can't explain yet: in 1 of the 5 runs with it on, Lucia's whole shirt went black at about world+170 frames and stayed black for the rest of the run. I have around 60 earlier runs of the same scene without this PR and never saw that. Could be chance, but my guess is the forced uploads ignoring room() push out something the shirt needs at display time, which is the case you mention under "what this does not fix". Frame times were about the same (median 107-113 ms with it, 99-108 ms without, my noise is about 5-10 ms).
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.