upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorromainveurrier <romain.veurrier@gmail.com>2026-11-22 15:09:14 +0100
committerromainveurrier <romain.veurrier@gmail.com>2026-11-22 15:09:14 +0100
commitf6d6121c9c54d406f1cfc8791df628a82dc673d8 (patch)
treedd1908feabb57fb4295226d3e506cd4b3d6bfc10 /docs
parentfa2712e2b00f639906d4de63aa5ec326a1fa2b37 (diff)
XDXR builds: PERFORM_UPDATE refits instead of rebuilding
An update (same topology, new positions or instance transforms) now keeps the source's tree and recomputes its boxes: the source is copied to the destination unless it is the destination (MODE_COPY), the elements are rewritten at their slots, MODE_LEVEL with arg2 = 1 recomputes each node's boxes from the children it already points to, and the header gets the new bounds. No Morton pass, no sort, and the parent table is kept. RTX 2050: 1,000 triangles 0.07 ms (build 0.19), 100,000 1.02 ms (2.24), 1,000,000 9.8 ms (22.0); Iris Xe 13.1 ms for 1M (47.9). - XdxrBuilder::record_blas / record_tlas take `update_from`; the Vulkan backend passes the source (or the destination, for an in-place update) when the D3D12 build has PERFORM_UPDATE. - vk_xdxr_build_test: a 3,000-triangle BLAS refitted in place (radix-sort tree), an R32-indexed grid refitted into another buffer (its untouched source is checked too), and the TLAS refitted after its instances move; the timing mode also times refits. - d3d12_xdxr_rt_test: the BLAS is built with ALLOW_UPDATE, its soup moves, and a PERFORM_UPDATE in place is checked as d3d12_blas_update. - tools/xdxr_bvh.py check-build: the case being checked answers reads at its address first (an in-place update leaves two dumps at one address). A sabotaged refit (no box pass) fails every update case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/bvh.md10
-rw-r--r--docs/d3d12_vulkan.md4
2 files changed, 10 insertions, 4 deletions
diff --git a/docs/bvh.md b/docs/bvh.md
index 47322a88a..16472f49a 100644
--- a/docs/bvh.md
+++ b/docs/bvh.md
@@ -361,8 +361,14 @@ them the same way.
361scene. `xdxr_bvh.py check-build <dir>` validates them and traces rays against brute force. `ctest` runs both as 361scene. `xdxr_bvh.py check-build <dir>` validates them and traces rays against brute force. `ctest` runs both as
362`xdxr_build` and `xdxr_build_check`. 362`xdxr_build` and `xdxr_build_check`.
363 363
364Not done yet: pairing triangles into TRI1 leaves, BOX16 nodes, updates, compaction and copies. A higher-quality 364**Updates** (D3D12 `PERFORM_UPDATE`) refit: the source structure is copied to the destination unless it is the
365build (SAH) would also come later. 365destination, the elements are rewritten at their slots, and each node's boxes are recomputed bottom-up from the
366children it already points to. The tree is kept, so a refit is valid for any motion and skips the Morton pass and
367the sort. It takes 0.07 ms for 1,000 triangles and 9.8 ms for 1,000,000 on an RTX 2050, against 0.19 ms and 22 ms for
368a build, but the tree traverses more slowly as the geometry moves away from where it was built.
369
370Not done yet: pairing triangles into TRI1 leaves, BOX16 nodes, compaction and copies. A higher-quality build (SAH)
371would also come later.
366 372
367```powershell 373```powershell
368python -I tools/xdxr_bvh.py selftest --seed 1 --rays 400 # build BLASes, compare closest hits with brute force 374python -I tools/xdxr_bvh.py selftest --seed 1 --rays 400 # build BLASes, compare closest hits with brute force
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md
index 83951f226..0ef0da242 100644
--- a/docs/d3d12_vulkan.md
+++ b/docs/d3d12_vulkan.md
@@ -2097,8 +2097,8 @@ Vulkan AS would be invisible to them. Two paths:
2097 the GPU and is checked against that reference. The standalone device uses it for `BuildRaytracingAccelerationStructure` 2097 the GPU and is checked against that reference. The standalone device uses it for `BuildRaytracingAccelerationStructure`
2098 and answers `GetRaytracingAccelerationStructurePrebuildInfo` from its layout, exactly. Acceleration-structure 2098 and answers `GetRaytracingAccelerationStructurePrebuildInfo` from its layout, exactly. Acceleration-structure
2099 buffers then keep their console VAs, the addresses the records name each other by. `LEONIDA_RT_AS=khr` keeps 2099 buffers then keep their console VAs, the addresses the records name each other by. `LEONIDA_RT_AS=khr` keeps
2100 #743's `VkAccelerationStructureKHR` builds (for `RayQueryKHR`), which the game's shaders can't read. Updates rebuild 2100 #743's `VkAccelerationStructureKHR` builds (for `RayQueryKHR`), which the game's shaders can't read. Updates refit
2101 the structure; compaction, copies, serialization and the Xbox batched/streaming builds are not implemented. The 2101 the source structure instead of rebuilding it ([bvh.md](bvh.md) §7a); compaction, copies, serialization and the Xbox batched/streaming builds are not implemented. The
2102 reported `RaytracingTier` is unchanged (`NOT_SUPPORTED`). Checked by `runtime/test/d3d12_xdxr_rt_test.cpp` through 2102 reported `RaytracingTier` is unchanged (`NOT_SUPPORTED`). Checked by `runtime/test/d3d12_xdxr_rt_test.cpp` through
2103 the D3D12 API. 2103 the D3D12 API.
2104 2104