perf(descriptor): batch TextureQueue writes across CopyDescriptors, sync_heaps, mirror_range, and heap_buffer_pass #1675
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1675"
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 qlfu on 2026-11-28T23:21:06Z.
What it changes
Enables concurrency-safe
TextureQueuewrite batching (QueueBatch/QueueFlusher) across bulk descriptor mirroring paths and removes per-call allocations inCopyDescriptors:crates/victory-gpu/src/descriptor/host.rs:slot_state: Box<[AtomicU32]>((seq << 1) | keeps) bumped on queue state transitions (queue_texture_inner,tabled_in_as, stale eviction innote_buffer_inner, andtexture_slot_sampled_again) so deferredQueueBatchflushes can safely run on already-published heaps without resurrecting stale or tabled slots.QueueBatch::applywith a singlefence(SeqCst)per batch, keepingQueueMarks::set/getonRelease/Acquireunder theTextureQueuemutex.QueueFlusher::new_unpublished(&mut HostHeap)withQueueFlusher::new(&HostHeap).queue_batch_concurrent_published_writes_and_removes_stay_consistent.crates/victory-gpu/src/descriptor.rs:QueueFlusher::new(host)inHeap::host,mirror_range, andsync_heaps(beforeandmakeparallel chunks).copy(ID3D12Device::CopyDescriptors) to walk source/destination range pointers directly without temporaryVecallocations and mirror all destination ranges under a single hoistedSHADER_HEAPS.read()+QueueFlusher(mirror_ranges).copy_multi_range_preserves_bytes_and_mirrors_single_slot_rangesand overlap regression coverage inmirror_range_overlap_falls_back_per_slot.crates/victory-gpu/src/draw.rs:QueueFlusher::new(host)insideheap_buffer_pass's paralleleach_viewworkers.How it was tested
game_scarlett_master.exe), 1440p DLSS Balanced,-NoFrameGenReady,VICTORY_PORT_CONSTANTS=1,VICTORY_WAIT_RESIDENT=textures, clean 90s gameplay runs (0 WARNs / 0 ERRORs).stack7without this PR):TextureQueueWRITElock takes:58,530 / 5smedian (59,375mean)med 44.2 ms,p95 65.4 ms,p99 74.6 ms,>100 ms: 16/2484 (0.6%)sub_all:38.65 msmedian,VICTORY_THIN:248.25 ms, titlepresent-wait:10.70 msstack8v2with this PR):TextureQueueWRITElock takes:44,418 / 5smedian (45,784mean, -24.1%)med 43.7 ms,p95 63.0 ms(-2.4 ms),p99 72.9 ms(-1.7 ms),>100 ms: 8/2417 (0.3%)(-50%)sub_all:36.25 msmedian (-2.4 ms),VICTORY_THIN:237.30 ms(-11.0 ms), titlepresent-wait:5.90 ms(-4.8 ms)cargo clippy -p victory-gpu --lib --tests --locked(default &--all-features): 0 new warnings.cargo testpassed for the crates it touches: yes (552 passed; 0 failedincargo test -p victory-gpu --lib --locked -- --test-threads=1).Checked for overlap
CopyDescriptors; this PR additionally batches multi-rangeCopyDescriptorsand enables concurrency-safeQueueBatchacrosssync_heaps,mirror_range, andheap_buffer_pass).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by amazedturnip on 2026-11-29T05:38:45Z.
Tested on 9800X3D + RTX 5070 Ti 16 GB in a combined perf stack across 20+ min gameplay sessions. Zero descriptor glitches or lockups; TextureQueue lock waits stayed low and combined stack moved ~4.2k-draw scenes from ~23 fps to ~31.6-33.5 fps.