Repository navigation
GPU: upload dirty title textures in HostList::prelude - #80
adritoyalser wants to merge 1 commit into
Conversation
texture::upload previously checked Staging::dirty at command-list recording time, before Staging::refresh ran at submission. Once a title-written texture became clean (after an unchanged submission, or after a multi-list submission where Batch::texture_due skipped the second refresh while the second defer_host cleared dirty), the next CPU update skipped CopyTextureRegion and sampled stale host texels until a subsequent use; conversely, a changed texture left dirty=true after submission and forced a redundant GPU copy on the next unchanged submission. Move CopyTextureRegion into HostList::prelude() right after run_deferred() refreshes staging buffers, so unchanged textures skip GPU copies and changed ones upload on the same submission. Add two D3D12 regression tests covering both cases.
|
Independent test run on commit
AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report. |
… (#82), core/VRAM scaling (#49/#38/#42/#45/#47), scatter batching (#108), prelude textures (#80), and shader/UAV fixes Integrates 15 upstream PRs orthogonal to Issue #2's default speed-switch measurements: - GPU culling & compute cap: - Marvisak/VIctory#1731: real host D3D12 occlusion queries (wired into read_backs for both sync execute and async VICTORY_RELAY/LATE_WAIT flights) - fxceless/victory-fork#82: hardware depth-bounds test pass-through in pipelines and command lists - fxceless/victory-fork#66: lower default compute shader loop cap (4096 -> 256) - CPU multicore, streaming & memory/VRAM scaling: - fxceless/victory-fork#49: scale shadow, pipeline (keeping VICTORY_PIPELINE_THREADS override), and DirectStorage workers with CPU cores - fxceless/victory-fork#38: default-on parallel host-copy refreshes on >=4 logical CPUs (VICTORY_WIDE_REFRESH=0 opts out) - fxceless/victory-fork#108: batch adjacent zero-page unmaps in XMemMapPhysicalPagesScatter - fxceless/victory-fork#67: release directly indexed buffer ranges with their heap - fxceless/victory-fork#42, #45, #47: auto-scale card buffers, texture staging/floor, and snapshot/scratch/list pools from VRAM and RAM - Rendering smoothness & correctness: - fxceless/victory-fork#80: upload dirty title textures in HostList::prelude - fxceless/victory-fork#114: mirror placed unordered texture views onto host textures - fxceless/victory-fork#121: preserve VGPR slots observed by relative reads - fxceless/victory-fork#122: recompute ISG1 input usage and barycentrics flag after bitcode opt - fxceless/victory-fork#112: fix DXIL signature ordering for packed semantics Verified: - cargo xtask policy --staged: 21 files ok - cargo clippy --workspace --all-features --lib --tests -- -D warnings: 0 warnings - cargo test --workspace: 0 failures (140 victory-gpu incl. host occlusion query + depth-bounds tests; 226/226 victory-shader) - Live 2560x1440 run (RTX 4080, VICTORY_RELAY=2 + VICTORY_INPLACE=1): reached 3D world (frame 1285), 77 in-place windows (364 MB, 0 refused), 0.0 ms texture remap waits, 0 crashes, 0 D3D12 errors Fixes #10
|
I tested this on Linux (RTX 4080, Proton Experimental) against the startup flicker from #39. The tree was 1684989 with #63 and upstream's #1524 applied. The measure is a count of presented frames that repeat a frame from up to six frames back while differing from the frame just before. Each run is 30 s, with every second frame captured from 100 to 600:
With #63 alone, every repeat that is left has the same cause. The title draws one Bink slot in two frames in a row. The second refresh finds it unchanged and clears There is also something in the world, from one run of each build, so take it as a lead. In the prison cell, with the skip switched off, the left wall, the window frame and the posters all render. With the skip on, the left wall is missing (the horizon shows through it) and the posters come out in blocks. With this PR the window frame renders, but the left wall is still missing and the main character's shirt is dark. A changed texture may have a second way to miss its copy that this PR doesn't cover. I haven't found it yet. #168 also reports walls missing in the first room. Thanks to @adritoyalser for the fix, to @arminkhaleghirod for tracing the flicker to the texture guard in #39 and #63, and to @fxceless for the fork. |
|
A follow-up on the walls, with five runs in the same spot (the prison cell window, nobody touching the pad) on the same tree as before (1684989 with #63 and upstream #1524). The cell's left wall shows up in both runs of the old path with the record-time skip switched off, so every list records its own copy. One run used stock Proton's wineserver and one a patched one. With this PR the wall is missing in all three runs: plain, with So something else in the move to
The always-copy switch also showed that this PR misses some changes the old path caught: the character's shirt print and the window frame's lighting came back with it. It cost about 2.5 % per frame here (253 ms to 260 ms median with The PR does fix the flicker. Thanks again to @adritoyalser. |
|
Thanks for the 5-run follow-up @brunofgmag — forcing I double-checked both points in the code:
That leaves two narrower differences between "always copy in
Happy to investigate further or adjust the approach if you spot anything in the logs/captures or if the maintainer prefers a different trade-off here. |
|
brunofgmag's flicker counts on #39 make a strong case for moving the uploads into A heads-up on overlap: #272 changes the same record-time block in Written with an AI assistant (Claude). |
|
Thanks for checking both points, @adritoyalser. I added a local switch at the end of Tree A is the one from before: 1684989 with #63, upstream #1524 and this PR. Tree B is
The wall reading is the mean brightness of the frame's left strip in the last captured frames. It is 3 to 60 where the wall is drawn and 140 to 240 where the sky shows through. So the fence needs only the list to know the texture's state. That points at the prelude's barriers for a texture the list has no The relay is a separate problem. With stage 2 the wall is missing even with the copy in the list, so it is not this PR's doing. It may be the in-flight staging overwrite from your point 2 (#141, #272). In tree B the relay is the default through #187, so I'll note it there. |
…uploads Credit NuraadGit (fxceless#159), ryotdev (unlocked reads), adritoyalser (fxceless#80), arminkhaleghirod (fxceless#39/fxceless#63), and brunofgmag (geometry A/B). Preserve inline placement for correctness testing. Native validation pending.
Problem
efresh while the second defer_host cleared dirty), the next CPU write was detiled into the staging buffer at submission without a recorded CopyTextureRegion, so the GPU sampled stale texels until a subsequent use.
efresh (which set dirty = true again), the next submission recorded and executed an extra CopyTextureRegion even when nothing had changed.
Fix
un_deferred() has refreshed staging buffers for the submission.
Verification