gpu: gate sampled_lately on consumed readback, accelerate held sweeps, and prioritize visible missing textures #2608
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2608
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2608"
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?
@nidea1 on GitHub · 2026-11-29 14:54 UTC · original
nidea1:fix/sampled-marks-readback-and-wake→main· +282 −66 · 2 files · 1 commits · merged 2026-11-30 14:12 UTCSummary
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.@dyshay on GitHub · 2026-11-29 15:40 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.@DBSN-code on GitHub · 2026-11-30 01:44 UTC · original
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
01a01eefrom this PR.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.