Repository navigation
gpu: gate sampled_lately on consumed readback, accelerate held sweeps, and prioritize visible missing textures - #2608
Conversation
…weeps, and prioritize visible missing textures
|
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch |
|
I tested #2608 on an RTX 3070 8 GB with the Series S profile, DLSS Quality and frame generation off. Both builds used v2026.11.29.05 with #2853, #3474 and #3406. The candidate added only commit The runtime picked up shader sampling marks every 4 frames under pressure, compared with 30 on the baseline. The player reported steadier motion and could still see textures arriving late.
The second run loaded a later story checkpoint and a larger warm pipeline cache. I compared the first 6 min 40 s of each session, selecting 3,000–4,999 draws per frame. This yielded 37 and 46 window samples and 24 and 28 queue reports respectively. A slot can count as held more than once. Different scenes and memory pressure limit what we can infer about performance. For a follow-up I would repeat both builds from the same save and camera position. The metric I would most like to see is the time from the first observed shader use of a pending slot to the corresponding texture becoming available, with a breakdown for budget waits and upload completion. This would help explain visible pop-in even when queue totals fall. |
Summary
Fixes three latency/correctness issues in sampled-slot readback (
sampled.rs) and texture queue scheduling (descriptor/host.rs) that delayed visible missing textures when VRAM is over the room line:crates/victory-gpu/src/sampled.rs):sampled_lately()previously compared againstlast_copy_frame(updated when the GPU copy was recorded, beforeconsume_readback()populatedseen), causingSome(false)for all slots before the first readback landed and across every sweep boundary whenframes < SWEEP_EVERY(24 < 30). Now trackslast_consumed_frameupdated withReleaseafterconsume_readback()writesseenand read withAcquireinsampled_lately().crates/victory-gpu/src/sampled.rs,descriptor/host.rs): tracks lock-freeHELD_HEAPScount viaQueueMarks::set_held/Dropand lowers readback cadence fromSWEEP_EVERY(30 frames, ~1.5–2.0 s at 15–20 FPS) toHELD_SWEEP_EVERY(4 frames) only while any heap holds textures back for VRAM room.DueBucketsparity & visible-slot priority (crates/victory-gpu/src/descriptor/host.rs):sampled_wake(30-frame window matchingSWEEP_EVERY) andFLAG_SOONhandling inDueBuckets::collect_due_and_censusandTextureQueue::changed_soon.freshandNO_CHECKEDretries) ahead of already-uploadedFLAG_CHECKEDspeculative rechecks inDue::ordered, preventing time-bounded passes from starving visible missing textures.Verification
cargo test -p victory-gpu --lib -- sampled:: descriptor::host::tests::: 77 passed, 0 failed (including 5 new unit tests covering consumed-readback gating, held sweep cadence,DueBucketsvs flat parity onsampled_wake/FLAG_SOON, priority ordering overFLAG_CHECKEDrechecks, andQueueMarksheld-counter lifecycle).cargo clippy -p victory-gpu --tests: 0 warnings in touched lines.cargo xtask policy --staged: passed.