Repository navigation
Conversation
…GPU views Add outer XboxBvhBuilder.dll HLE hooks (BuildRaytracingAccelerationStructureBatched2X and RehydrateRaytracingAccelerationStructureBatched2X, extern "system-unwind") that ask view_want (Path::BvhBuild) for every range a build or rehydrate names whole before forwarding to the DLL. The builder's compute programs reach vertex and index buffers through addresses inside uploaded geometry descriptions and reach destination, source, and scratch through root views, which view_want only asks for 64 KiB from their base address. On the 16-window GPU-view layout, tiles past that first 64 KiB stay unmapped until requested. Asking for each item's result, source, scratch, instance descriptions, per-geometry vertices/indices/transforms/AABBs (handling R16_TYPELESS=53 as 2 bytes), and postbuild destinations sized via GetRaytracingAccelerationStructurePrebuildInfo closes that gap: - Resolve GetRaytracingAccelerationStructurePrebuildInfo directly from the mapped XboxBvhBuilder.dll module when wrapping any export (including ordinal imports) instead of waiting for the title to import it. - Cache UpdateScratchDataSizeInBytes on ALLOW_UPDATE builds so a later PERFORM_UPDATE whose prebuild query returns 0 reuses the cached size (or falls back to scratch_size.max(update_scratch_size).max(SCRATCH_GUESS)) instead of dropping the scratch range. - For ARRAY_OF_POINTERS TLAS builds, translate the GPU-VA pointer table via list_x::cpu_at, read it under shader::readable, and request coalesced 64-byte D3D12_RAYTRACING_INSTANCE_DESC target ranges alongside the pointer array. Wrapping is gated on Uma view windows existing, so default 4-window runs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Antigravity (Gemini 4 Neon)
Add the pure acceleration-structure shadow registry and DXR 1.1 triangle geometry and TLAS instance translation helpers in hle::d3d12x::hw_rt. Nothing calls this module yet; the shadow command-list builder and XboxBvhBuilder hooks follow in a stacked PR. Tracks native BLAS/TLAS entries keyed by console GPU VA, validates DXR 1.1 PERFORM_UPDATE refits against build flags and per-geometry signatures, marks referencing TLASes stale whenever a BLAS GPU VA relocates or is invalidated, canonicalizes console typeless index formats (R16_TYPELESS / R32_TYPELESS) to PC typed uint formats, and gates opt-in XCL_HW_RT=1 against XCL_RAYTRACING=0. Part of xcl-dev#1751. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Antigravity (Gemini 4 Neon)
Wire the opt-in native D3D12 DXR 1.1 BLAS/TLAS shadow builder (XCL_HW_RT=1, off by default) into XboxBvhBuilder.dll's BuildBatched2X, RehydrateBatched2X, and CopyRaytracingAccelerationStructure hooks. Builds native DXR 1.1 bottom-level and top-level acceleration structures alongside the console compute path (leaving console output untouched for software fallback): - Translates triangle BLAS geometry (including R16_TYPELESS/R32_TYPELESS canonicalization) and rewrites TLAS instance descriptors to native BLAS GPU VAs (masking unresolved instances cleanly). - Builds rehydrated BLASes natively when their geometry has at least as many triangles as the archive header's primitive count, and clones native structures on clone/compact copies. - Invalidates stale entries on every skipped rebuild or fallback, marks referencing TLASes stale when a BLAS GPU VA relocates or is removed, and retires replaced AS buffers past RETIRE_FRAMES presents into late_release::hold_owned_resource so active GPU queues finish before drop. - Respects XCL_RAYTRACING=0 dynamically on every hook and logs a periodic summary line in host.rs when active. Part of xcl-dev#1751. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Antigravity (Gemini 4 Neon)
|
merge-check claim |
|
merge-check Regression run, |
Add the opt-in
XCL_HW_RT=1native DXR 1.1 shadow builder that mirrorsXboxBvhBuilderbottom-level builds, top-level builds, rehydrates, and copies into host DXR acceleration structures recorded on the title's own command list after the console build. Off by default: no extra hooks are installed for it whenXCL_HW_RTis unset (on the 16-window layout #3662's hooks still run and checkhw_rt::enabled()per call;XCL_RAYTRACING=0also disables it).Part of #1751. Stacked on #3697 (and #3662 on
main5eaadb54c; commit3620d7652is the new diff here). Note:title_list::active_backing(and its unit test) was moved here from #3653 because this PR is its only caller, so #3653 can drop it.Related: #2184, #2185. Unlike those earlier PRs, this stacks on #3662's GPU-view hooks and #3697's pure registry/geometry translator, mirrors
XboxBvhBuilderBuildRaytracingAccelerationStructureBatched2X,RehydrateRaytracingAccelerationStructureBatched2X, andCopyRaytracingAccelerationStructureXwith explicit UAV barriers between BLAS/TLAS/copy phases, resolves consoleR16_TYPELESS/R32_TYPELESSindex formats, retires native AS buffers vialate_releaseGPU fences, and includes WARP DXR 1.1 tests covering builds, rehydration, and copies.Why this PR is over 800 changed lines: The diff is +1612 / -14 lines across 5 files, consisting of ~1195 production lines (
hw_rt.rshost DXR state, scratch/staging pools,Batched2XBLAS/TLAS/rehydrate/copy recording,bvh_builder.rshook wiring,late_release.rsfence-backed retirement,title_list.rsactive backing helper,host.rsperiodic summary logging) and ~417 lines of WARP DXR 1.1 and command-list tests. The pure registry and geometry translation were already split out into #3697; splitting the remaining host state from its hook callers or its WARP tests would either introduce unused code or land unverified host DXR command recording.What is in it
crates/xcl/src/hle/d3d12x/hw_rt.rs:HostDxr(DXR 1.1 device/tier probe),ShadowState(registry, pooled scratch/staging buffers reused after 4 presents under a configurable VRAM budget, retired list draining throughlate_release),on_build_batched2x(two-phase BLAS then TLAS recording with UAV barrier),on_rehydrate_batched2x(native rebuild when geometry count matches, fallback tracking otherwise),on_copy_as(nativeCopyRaytracingAccelerationStructurefor clone/compact with surrounding UAV barriers), periodicHW RT shadow (XCL_HW_RT):summary formatting, and 3 WARP DXR 1.1 integration tests.crates/xcl/src/hle/bvh_builder.rs: hookBuild*Batched2X,Rehydrate*Batched2X, andCopy*Xto forward tohw_rtwhenXCL_HW_RT=1.crates/xcl/src/hle/d3d12x/late_release.rs:hold_owned_resourcehelper so replaced native AS buffers wait until every active queue is past a fence before release.crates/xcl/src/hle/d3d12x/title_list.rs:active_backinghelper (moved from Memory: cover overflow MEM_GRAPHICS reservations in trailing view windows #3653, its only caller) returning the active PC command list backing a wrapped console list across split segments, plus unit testactive_backing_tracks_primary_and_split_segment.crates/xcl/src/host.rs: loghw_rt::summary_line()every 10 s when active.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5070 Ti (15995 MiB VRAM, DXR Tier 1.1), AMD Ryzen 9 9950X,
rustc 1.99.0, DXC1.9.2609.5(XCL_DXC_DIR).cargo build --release -p xcl(commit3620d76522ae28985d4f0d982b3afd16732adbda): succeeded, 39 warnings (0 new vsmain)..\scripts\test.ps1(commit3620d76522ae28985d4f0d982b3afd16732adbda): 2995 passed, 0 failed, 52 ignored across 43 test binaries; 24 GPU tests skipped on this adapter (22no wave64, 2no heap windows). All 9hle::d3d12x::hw_rttests (including all 3 WARP DXR 1.1 tests) andactive_backing_tracks_primary_and_split_segmentpassed.vertex buffer VA outside UMA: the geometry lives at GPU-view addresses that only the 16-window layout maps), so native bottom levels are built primarily withXCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16.XCL_HW_RT=1run on3620d76522ae28985d4f0d982b3afd16732adbda(default memory layout,XCL_PREPARE=0,XCL_NETWORK=0,XCL_PSO_EVICT_FRAMES=600, automated title-screen advance):exit: 0x0,2149frames shown,0device removals,0crashes:HW RT shadow (XCL_HW_RT): live 2 BLAS / 5 TLAS / 90 rehydrated (1 MiB AS, 6 MiB pools); built 2 BLAS (0 updates, 2324 skipped), 75 TLAS (35 complete, 40 hybrid, 0 skipped); insts 34307 resolved / 0 null / 1487 rehydrated-skip / 29212 missing-skip; 1137 rehydrated recorded (0 built natively, 95 count mismatch), 0 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skipXCL_HW_RT=1 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16run on3620d76522ae28985d4f0d982b3afd16732adbda(same settings, with GPU view windows active):exit: 0x0,2016frames shown,0device removals,0crashes:HW RT shadow (XCL_HW_RT): live 2654 BLAS / 5 TLAS / 140 rehydrated (238 MiB AS, 118 MiB pools); built 1199 BLAS (0 updates, 1371 skipped), 154 TLAS (82 complete, 72 hybrid, 0 skipped); insts 104399 resolved / 0 null / 2188 rehydrated-skip / 31495 missing-skip; 1960 rehydrated recorded (1809 built natively, 151 count mismatch), 158 stale invalidated, 0 copy-invalidated, 0 copied natively, 0 alloc-err, 0 budget-skipXCL_HW_RT=1runs that hit0x887a0006.)Regression run
Base (
main):PR (
pr/hw-rt-shadow):Not tested
XCL_SAMPLE_*unset).XCL_HW_RT_TRAVERSE=1; handled in the follow-up stacked PRs).late_releaseuntil every active queue is past a fence).AccelerationStructure = 0, InstanceMask = 0so there is no GPU fault, though those instances are skipped until the BLAS is known).XCL_HW_RT=1runs (including DXIL: swap GPURT traversal loops for native RayQuery (XCL_HW_RT_TRAVERSE) #3705's 180 sXCL_HW_RT_TRAVERSE=1run) ended in0x887a0006(DEVICE_HUNG) at154.2 s/ frame1969with+3.9 GiBVRAM overcommit (last recorded:DispatchMesh in two passes); one 180 sXCL_HW_RT=0control finished (1920frames,0removals). Cause not determined; the native structures add about 360 MiB of VRAM (238 MiB AS + 118 MiB poolsat180 s).AI use
Claude Opus 5.5): architecture, hang/TDR audit, barrier and lifetime review, and final diff/description review.Gemini 4 Neon): split, rebase ontomain, builds, test suite, smoke runs, liveXCL_HW_RT=1verification, and PR description.