Repository navigation
perf(descriptor): batch TextureQueue writes across CopyDescriptors, sync_heaps, mirror_range, and heap_buffer_pass - #1675
Open
qlfu wants to merge 1 commit into
Conversation
…ync_heaps, mirror_range, and heap_buffer_pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).