Repository navigation
Conversation
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 (
|
…-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.
6e5eb2d to
a03b5cc
Compare
|
Tested a03b5cc on NVIDIA GeForce RTX 4080, driver 617.42, Windows 11 (clang-cl cross-build): d3d12_xdxr_rt_test exits 0 ("BLAS 48768 bytes (prebuild 48768), TLAS (prebuild 640)", copies including "blas_compacted (113536 bytes)", "tlas: 4 instances, 768 bytes") and vk_xdxr_build_test exits 0 ("built every case"). The test prints no pass count, and the rejection lines such as "XDXR deserialize operation 3 rejected: invalid BLAS pointer in the serialized data" are the refused cases it expects. The validation layer was not loaded, and tools/xdxr_bvh.py check-build was not run over the output. AI-assisted. |
|
Additional RTX 4080 coverage for
Synthetic fixtures only. AI-assisted. |
|
Verified against main 3faac55 (your head already contains it): compileall clean; tests/test_xdxr_bvh.py 37/37 and the three docs guards green. The 9,947-line xdxr_build.inc is not an opaque blob — I re-ran the glslc command documented in xdxr_build_spv.h and the output matches byte-for-byte, so origin is reproducible and no game data is involved. The batch validator bounds read sound: all three StreamRecord variants are 16 bytes so the stride guard makes the stream walk safe, and the static_assert pins the memcpy prefix. Two points to consider: a descriptor with non-zero size_in_bytes but a null stream pointer currently takes the "measured default" path rather than being refused, and the UINT32_MAX clamp means a >4 GiB range validates against 4 GiB — conservative, but worth a comment saying so. The d3d12_xdxr_rt_test.cpp side needs a build + GPU and was not run; all four checks were still queued at check time. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested on RDNA3 at head
(AI-assisted.) |
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.
Checklist