Repository navigation
Conversation
…-148) Write the DXR header and raw BVH4 payload on the GPU, and restore TLAS references from the serialized address table. Check the format and ranges before writing the destination. Record the measured batch descriptors through the existing XDXR build path. Cover round trips, default stream settings and rejected inputs with synthetic GPU fixtures.
Kam471
left a comment
There was a problem hiding this comment.
Built d3d12_xdxr_rt_test at 6e5eb2da and ran it on Windows 11, RTX 5070 Ti (temp output dir, deleted after):
d3d12_xdxr_rt: batched/streamed builds, BLAS and TLAS serialization round trips, invalid blobs rejected; BLAS 48,768 bytes (prebuild 48,768), TLAS (prebuild 640), exit 0. The invalid cases were refused individually (unsupported stream settings/postbuild info, incompatible driver id, bad BLAS pointer, invalid layout/range, wrong root type). No blocking issue.
|
Tested
AI-assisted (Claude Code). |
|
Verified Hardware & CTest results (
|
Claimed in the coordination issue as: RT-148 (claim; status)
What and why
Implements D3D12 serialize and deserialize for raw XDXR BVH4 buffers. The GPU writes the documented 56-byte DXR header, the TLAS BLAS-address array, and the BVH4 bytes. Deserialization checks the format identifier, the header and buffer lengths, and the TLAS references before copying. It applies the caller's BLAS addresses so a TLAS can be restored after its BLAS moves.
The format uses the RT-151 size field, which excludes the 64-byte BVH4 header. One shader helper reads the size for serialization, deserialization validation, and the 16-byte serialization postbuild result. The format identifier is at version 2 because the earlier development build used the pre-RT-151 size field. RT-151
Behaviour change
CopyRaytracingAccelerationStructuresupportsSERIALIZEandDESERIALIZEon XDXR. A rejected GPU copy leaves the destination intact and reports the reason when the queue retires the submission.EmitRaytracingAccelerationStructurePostbuildInfoand builds can report the serialized byte count and TLAS pointer count.BatchedDesc2layout and default-equivalent stream settings. It validates the descriptions before recording, then uses one existing build per entry. UAV barriers between entries allow scratch reuse and let a later TLAS consume an earlier BLAS.Scope
Serialization is for the runtime's uncompressed XDXR layout. Actual serialized copies are limited to a 32-bit byte range. Streaming support covers default-equivalent settings. Offline statistics and other unsupported postbuild types are rejected. The shipping Xbox call route still needs a measured ABI binding.
The upstream base includes clone, compact and the size queries in
9fd1aaed, and @esteban-dcp's RT-151 header-size correction in8ab01bbe. Clone/compact implementation, RT-151 implementationInteraction with #3315 (RT-214)
The shared
runtime_bvh_byteshelper checks the BVH4 size and BOX32 root together. RT-214 adds a 64-byte BOX16 root and a spare 64-byte unit forMINIMIZE_MEMORYBLASes. Until that layout is supported, a BOX16 root produces a diagnostic and the serialization size query returns zero. Whichever PR lands second will adapt the helper and regeneratexdxr_build.inc. RT-214#3944 excludes RT-148 from its scope. At
82bcd9a1, ten of its fourteen changed files overlap with this branch, including the shader and its generated include. If it lands first, rebase this branch, regenerate the include and re-run the XDXR tests. #3944Tested
MSVC 19.44.35229, Ninja RelWithDebInfo
-j 4, Vulkan SDK 1.4.363.0, NVIDIA GeForce RTX 5070 Ti, driver 617.42.runtime/test/xgameruntime_test.cpp:492. The generated shader passedspirv-val --target-env vulkan1.2, and regeneratingxdxr_build.incproduced the same SHA-256.AI-assisted (Claude Code orchestration; GPT/GLM/Hy4 sub-agents).
Checklist