Repository navigation
GPU: back indirect arguments in VRAM, use RwLock for SHADER_HEAPS, and batch copy_back_marks - #3320
danielibabet wants to merge 1 commit into
Conversation
…d batch copy_back_marks
Dukestar69
left a comment
There was a problem hiding this comment.
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090):
- Backing indirect argument buffers in VRAM (with
CopyBufferRegionreadback in tests), switchingSHADER_HEAPStoRwLock, and reusingtitle_buf+ batchingt.taken(&synced)incopy_back_marksare clean and sound. cargo test -p victory-gpu --lib indirect:: -- --test-threads=1(RTX 5090): 6 passed, 0 failed.cargo test -p victory-gpu --lib descriptor:: -- --test-threads=1 --skip dynamic_slots_are_held_until_released(RTX 5090): 21 passed, 0 failed.cargo test -p victory-gpu --lib shadow:: -- --test-threads=1(RTX 5090): 10 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
I checked the DEFAULT-heap argument buffers with the #3307 + #3197 + #2996 composition. They conflict in allocation and in tests that directly mapped the argument buffer. Exact integration Verified app-local Agility 1.620.2/WARP 1.0.22 passed all 15 indirect tests. The mixed test alternates window and single clamps in one list, grows the buffer with 6,000 records, checks the output, and replays transitions back to COMMON. The translated 24-group mesh test and full GPU diagnostics (259 passed, 0 failed, 1 ignored) passed with @danielibabet the integration is available if #3307 lands first. Please retain its Git author if using the resolution, or add |
Summary
Three independent CPU/GPU contention and barrier fixes on top of
main:indirect.rs,host.rs)Host::uav_buffer(D3D12_HEAP_TYPE_DEFAULT,ALLOW_UNORDERED_ACCESS,COMMON) and backHostList::argumentsin VRAM instead ofL0system memory (shared_buffer), avoiding PCIe round-trips for bothclampUAV stores andExecuteIndirectreads.uav_barrier()(pResource = None) right before transitioningoutfromUNORDERED_ACCESStoINDIRECT_ARGUMENTinindirect::bound(the resource transition already synchronizesout, and the nextboundcall issues the pre-dispatchuav_barrier()forbudget).indirect::tests::clampedandargument_buffers_move_from_their_current_statesto read backoutviareadback.SHADER_HEAPSmutex contention during descriptor mirroring (descriptor.rs)SHADER_HEAPSfromMutextoRwLock:mirror(title threads),sync_heaps(submission thread), and all read-only queries take.read(), whileDropandcreatetake.write(), sosync_heapsno longer stalls title threads writing descriptors (MirrorWaitUs).Tracked::takenincopy_back_marks(shadow.rs)pooled(PAGE)scratch buffer across all marked pages incopy_back_marksinstead of heap-allocating and zeroingvec![0u8; n]per 64 KiB page.t.taken(&list)once perShadowinstead of callingVirtualProtect/ taking theGUARDSlock page by page.Verification
cargo test -p victory-gpu --locked -- --test-threads=1 --skip dynamic_slots_are_held_until_released --skip lists_share_a_table_and_copies_keep_their_views:229 passed; 0 failed; 1 ignored; 2 filtered outcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: 0 warningscargo run -p xtask --locked -- policy:asset policy: 191 files ok