Card steps: fix the stretched characters and boat (places the title writes after sending are learned; submissions reading them wait) #434
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/434"
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 avatarmanz/VIctory-7900XTX. Originally posted by Jrjy3 on 2026-11-27T06:10:46Z.
Fixes the stretched characters and boat with card steps on (
VICTORY_CARD_STEPS=1or2,play.ps1's default), reported in #13: vertices thrown off into long sheets or spikes. It happens a few times a second, gets more frequent the longer a cutscene runs, and gets much worse after the camera moves up and down.Cause
Without card steps, a submission that sits behind flights waits for them, so every fill in it reads title memory after that wait. The console's GPU reads a constant buffer when the draw runs, which is also late. The title relies on that: it writes some constant buffers again after it has sent the submission that reads them.
With card steps, a taken submission is sent at once, so its fills read the bytes too early. That applies to the fills done on the card and also to the ones left to the CPU, which run while the submission is prepared.
How it was found
R9700, Windows, main
014d52d+ #55, the boat cutscene.CARD_STEPS=0CARD_STEPS=1, card steps on everywhere but nothing taken (a test switch)CARD_STEPS=1runs_leftcaused it:VICTORY_CARD_STEPS_RUNS=0still stretched.Change (
host/card_steps.rsonly)CopyBufferRegionof the bytes used. For fills done on the CPU, it's the upload memory they filled.a fill reads a place the title was found writing after sending). The first frame on a new place is drawn with the old bytes; after that it's exact.VICTORY_CARD_STEPS_LEARN=0turns it off.cargo test -p victory-gpu card_stepspasses 11/11, Clippy is clean on the file, and the diagnostics build compiles.Cost
At the boat, idle, per frame:
CARD_STEPS=1with this changeCARD_STEPS=1without itCARD_STEPS=0All three are within run-to-run spread. The frame waits on the card, about 70–77 ms of GPU time.
In this title about every submission card steps took has one of these fills, so in practice they mostly wait now. Card steps no longer buy anything here, but they no longer break the picture either. A faster fix would have to let the card read those few places at draw time, which is what the console does. I haven't tried that.
The CI failures are the ones
mainhas now: Clippy'stransmuteindescriptor_sites.rs, anddepth_bounds_pipeline_loads_and_filters_draws.🤖 Generated with Claude Code
Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-27T06:30:54Z.
I ported the late-fill check to the AMD branch and kept its existing card-step planner. The Windows MSVC build passed nine tests under Wine, including changed and unchanged title pages for both fill paths in one fixture. The separate flight test is still pending. I’ll check the same saved route with learning off and on to see whether it addresses the geometry stretching on RX 7900 XT/RADV. AMD #56
Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-27T06:45:11Z.
The standalone flight test now passes with learning off and on in separate processes on the RX 7900 XT (RADV 26.3.1, GE vkd3d-proton
cae8353ed7959c4). Both runs used relay 2 and card steps 2. This exercises copy and fill ordering across submissions with generated buffers. The saved replay is queued separately. AMD #56Imported from avatarmanz/VIctory-7900XTX. Originally posted by YaBulochka on 2026-11-27T10:13:22Z.
Tested this branch on Linux under Wine, on top of #440's
linux-wine-pr(48b49c7=b62290c+ this branch merged, no conflicts). The learning works, but it does not stop the stretching here, and the one switch that does is the relay.Environment: RX 7600 XT 8 GB (RDNA3), Mesa 27.0.0-devel (RADV), Wine 11.22 (system), kernel 7.3.5, 30 GB RAM, Series S, 1280x720,
VICTORY_RENDER_SCALE=1.0,VICTORY_UPSCALER=6, plus #440's 1080p preset (PORT_CONSTANTS,PORT_DESCRIPTORS,PORT_CBV,FRAME_INTERVAL_MS=16.667+DRAWS=500,CARD_BUFFERS_MIN_KB=64,JOIN_PARTS_DRAWS=500), textures 3 GB, card buffers 2 GB.VICTORY_RELAYVICTORY_CARD_STEPSWith this branch merged,
RELAY=2 CARD_STEPS=2still stretches. The log does show the waits it adds (waits for a fill of upload memory +0xd0 (last at 0xe51b7bfe30),+0xf0,+0x1e0,+0xb0), so it is learning something — it just is not what moves these vertices.What this points at: with the relay on, something a draw reads is still a submission's own early bytes, and it is not a title CPU write to a page (your comparison would have caught it) and not the card steps' fills (off changes nothing). The two candidates left are the landing of shader writes (a skinning pass's output read before it lands) and a descriptor table rewritten after the send.
Is there already a path that pays for "reads what a flight's shaders wrote" as opposed to "reads a page the title later wrote"? If yes, that is the switch I should be testing; if not, this may be a second, unrelated race on the same relay.
For reference,
RELAY=0on this card costs about 60 % (43 -> 70 ms), so it is not a usable setting, only a diagnostic.Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-27T10:28:58Z.
I brought this over to the current #440 Wine test build and kept its placement-order behavior. The nine focused Windows MSVC tests passed under Wine 11.22, including both CPU and GPU late-fill comparisons with distinct live pages. The flight test also passed with the switch off and on on an RX 7900 XT, RADV 26.3.1, with vkd3d-proton
71cae091.I’ve queued an off/on replay of the same indoor save at 720p. That will show whether this path is exercised there and whether the visible flicker changes. Wine port and fixture results
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.