Repository navigation
D3D12.X: slice direct mesh draws within the record cap - #2902
coolpersonnn wants to merge 4 commits into
Conversation
Sweep expired reusable buffers even when an allocator releases no buffers of its own. The WARP regression seeds the free pool, then checks it directly after an unrelated allocator release. Suggested-by: thehollowedone (xcl-dev#2815 (comment)) Publish the retired batch and its byte charge under the same lock. Otherwise reclamation can subtract a batch before the publisher adds its bytes. Reclaim retired and reset two-pass record, batch, and argument scratch buffers when their recording's submit queue fences pass, without waiting for the owning command allocator to reset. Guard fence polling against device removal (`u64::MAX` / `FenceState::Removed`) so in-flight buffers are never returned to the reuse pool on a lost device, keep closed command lists' buffers intact across idle trims for Reset-less replay, and track upstream `batch_buf` allocations through the same submit fences. Part of xcl-dev#2688 Assisted-by: T3 Code / Antigravity (Gemini Pro Orchestrator Neon) Assisted-by: Codex (GPT-6.2 Sol) Assisted-by: Codex (gpt-6.2-sol)
…uckets Add 256 KiB half-step record buffer buckets and async GPU group-count feedback for two-pass ExecuteIndirect draws (including deferred batch mode), eliminate cold-start clamping so initial indirect draws keep full capacity, keep active frustum-culled PSOs warm over a 16-window history while dropping unused PSOs to 256 KiB, report exact clamped command and dropped group counts, guard feedback readback against device removal (`u64::MAX` / `q.Signal`), and bound reuse growth in `ensure_res_buffer`. Part of xcl-dev#2688 Assisted-by: T3 Code / Antigravity (Gemini Pro Orchestrator Neon) Assisted-by: Codex (GPT-6.2 Sol)
Reclaim completed batches on other queues at elapsed-time intervals during the cap wait. One pending fence must not hide a reusable record buffer until the wait deadline. The WARP regression completes the later batch after polling changes from yields to sleeps. Reported-by: thehollowedone (xcl-dev#2817 (comment)) Assisted-by: Codex (gpt-6.2-sol) Cap the two-pass pool dynamically at 25% of remaining DXGI local VRAM headroom with a card-scaled floor `(local_budget / 32).clamp(256 MiB, 512 MiB)` and a `min(local_budget / 4, 2048 MiB)` ceiling cached for 250 ms, remove the `/ 2` reuse pool clamp in `put_free_bufs` that caused buffer churn, retry oversized reuse candidates before waiting, bound submit-fence waits at 10 ms with 250 ms timeout backoff and device-removal short-circuiting, walk every 256 KiB half-step bucket while shrinking record buffers down to a single record (avoiding unnecessary jumps past 1.5x steps) while counting direct `DispatchMesh` cuts/drops, and let `XCL_TWO_PASS_BATCH` halves and batch-buffer allocations fall back without polluting `TP_REFUSED`. Part of xcl-dev#2688 Assisted-by: T3 Code / Antigravity (Gemini Pro Orchestrator Neon) Assisted-by: Codex (GPT-6.2 Sol)
Give each slice its original console group IDs while reusing the same records. The mesh shader test compares the generated records in both shader backends. Assisted-by: Codex (gpt-6.2-sol)
8e16f9c to
96dfa76
Compare
RTX 5070 direct mesh slice verificationThe focused tests on clean PR #2902 head The command was This verifies the group-base math on a discrete GPU with less memory than the original RTX 5090 host. The mesh fixture supplies the slice base directly. It does not drive the allocator into a low-memory state, measure a retail world load, or exercise indirect mesh slicing. AI use: OpenAI Codex selected and ran the existing tests, checked the fixture and prepared this report. |
Stacked on #2817. This PR adds the top commit,
96dfa767.Part of #2688. Direct two-pass mesh draws that fit the normal record limit can lose groups if the cap allows only a smaller buffer. Record those draws in slices while keeping the console group IDs used to generate geometry.
What is in it
Tested
32.0.16.2101, Radeon integrated graphics with driver32.0.21045.29003, Rust1.100.0, and DXC1.8.2502.11.gpu_mesh_mode_two_passesregression on the lab version passed on each adapter with both shader backends exercised and zero GPU skips.XCL_TWO_PASS_MB=256recorded 126 direct mesh groups dropped on controlad352c36and zero on patched lab build001e9abf. The patched run still recorded 4,687 allocation refusals. Both runs stopped presenting during world load.a2c10b4aand verified the top patch withgit range-diffandgit diff --check.96dfa767, RTX 5090 plus WARP.cargo test --offline --locked -j 4 -p xcl --lib -- gpu_mesh_mode_two_passes later_queue_completion_during_sleep_reclaims_before_wait_deadline --test-threads=1 --nocapturereported 2 passed, 0 failed, 0 ignored, and zero GPU skips.Regression run
Not tested
AI use
gpt-6.2-sol) wrote the slicing change and regression coverage, ran the GPU and title checks, and rebased the patch.