gpu: requeue remapped textures after their table grace period #3551
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3551"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-30T00:51:54Z.
A draw can read a placed texture through a descriptor table, then later read the same heap slot by shader index. If the backing pages change between these draws and the descriptor stays the same, dropping the slot from the remap selection can leave the indexed draw reading the old texels. The table-recency window is 240 frames. After #2607, an empty selection also advances the heap cursor, so that notification will not be reconsidered when recency expires.
Keep the remapped slot in the texture queue with the existing eight-frame table grace period. A subsequent table read can service it and remove the queued entry. Indexed reads can otherwise pick it up through the usual mapping checks, upload and publication path. This applies to exact overlaps and to the existing conservative rescan after history eviction. A rescan can therefore queue additional recently tabled slots.
I verified consumption using an independently generated Win64 D3D12 fixture on an RTX 5070 under Proton. Across 330 frames, 128 shader-indexed pixels identified each synthetic resource and generation. The dense case used 3,072 initially unavailable heap slots, actual page commits, and the production table-entry preparation path. Frame 80 read generation 1 through a table. Frame 81 replaced the backing at the same address. With the original compacting-history and cursor routines from #2607 on the common Linux test base, the indexed pixel still showed generation 1 at frame 330. The pre-#2607 Linux base first showed generation 2 at frame 322. With the fix on that base, it appeared at frame 89. The smaller test also verified frame 89 with the fix on top of both #2607 routines. Readback followed a fence on every frame.
The regression in the existing heap test exercises overflow of a private remap history, retention through the grace period and cancellation by a new table read. All 112 resources whose memory arrived became visible in the dense fixture. The 16 sampled unavailable controls kept their neutral color. Average dense fence cadence on the Linux base was 0.410 ms before and 0.413 ms after. This change addresses stale texture content. Credit to nidea1 for #2607.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-30T05:17:34Z.
Review: APPROVED
Tested locally merged onto
main(41adb551).crates/victory-gpu/src/descriptor/host.rs.cargo test -p victory-gpu --lib descriptor::host::tests::passed (72 passed; 0 failed; 1 ignored) with 0 new warnings.Clean fix ensuring remapped textures are requeued after their table grace period. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T05:49:55Z.
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. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T03:14:17Z.
@ghptc Thanks for catching and cleanly fixing that #2607 empty-refresh cursor + 240-frame table-recency interaction — keeping the remapped slot queued with the 8-frame grace period handles shader-indexed reads cleanly.
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.