upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/d3d12_vulkan.md
diff options
context:
space:
mode:
authorromainveurrier <romain.veurrier@gmail.com>2026-11-22 14:04:34 +0100
committerromainveurrier <romain.veurrier@gmail.com>2026-11-22 14:04:34 +0100
commit1c58d6cfbc63ef3eb41d332c8aa443bb65ac4b4d (patch)
treead1aafa19ed74e0b550af8081fd7024b32596c83 /docs/d3d12_vulkan.md
parent51a028115446da42565fa75d4657e82c214afc2d (diff)
D3D12: BuildRaytracingAccelerationStructure writes XDXR BVH4 records
The game's translated RT shaders read the console's XDXR records, which a VkAccelerationStructureKHR is not (docs/d3d12_vulkan.md 4.8). The standalone Vulkan device now builds them with src/xdxr_build.h, unless LEONIDA_RT_AS=khr keeps #743's KHR builds (the proposal in the maintainer decisions of #1548). - VulkanDeviceInfo::xdxr_acceleration_structures; the standalone device sets it with bufferDeviceAddress and then leaves the KHR extensions off, so acceleration-structure buffers keep their console VAs. - VulkanContext owns an XdxrBuilder; replay checks the inputs while the list is prepared (R32G32B32/R32G32 vertices, none/R16/R32 indices, addresses, counts) and records the build with heap_base added to every VA and as the bias for instance BLAS addresses. - GetRaytracingAccelerationStructurePrebuildInfo answers from XdxrLayout, exactly; an update rebuilds, so it needs the same scratch. - The geometry's vertex format is mapped per DXGI format (an unknown one is refused instead of read as R32G32B32), and its D3D12 flags reach the build. - test/d3d12_xdxr_rt_test.cpp: a two-geometry BLAS (a soup; an R16-indexed grid with stride 16 and a transform) and a TLAS of three instances through the D3D12 API; ctest d3d12_xdxr_rt + d3d12_xdxr_rt_check. - tools/xdxr_bvh.py: check-build compares TLAS hits by (geometry, primitive), and skips (77) when the build step wrote no cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/d3d12_vulkan.md')
-rw-r--r--docs/d3d12_vulkan.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md
index 77fdf89bb..c12c93ab6 100644
--- a/docs/d3d12_vulkan.md
+++ b/docs/d3d12_vulkan.md
@@ -1987,8 +1987,13 @@ Vulkan AS would be invisible to them. Two paths:
1987 and make `GetRaytracingAccelerationStructurePrebuildInfo` return sizes for that layout. 1987 and make `GetRaytracingAccelerationStructurePrebuildInfo` return sizes for that layout.
1988 The layout is the XDXR BVH4 runtime form ([bvh.md](bvh.md) §3.1). `tools/xdxr_bvh.py` encodes it on the 1988 The layout is the XDXR BVH4 runtime form ([bvh.md](bvh.md) §3.1). `tools/xdxr_bvh.py` encodes it on the
1989 CPU, with a reference traversal and a validator ([bvh.md](bvh.md) §7a). `runtime/src/xdxr_build.h` builds it on 1989 CPU, with a reference traversal and a validator ([bvh.md](bvh.md) §7a). `runtime/src/xdxr_build.h` builds it on
1990 the GPU and is checked against that reference. It is not yet wired to `BuildRaytracingAccelerationStructure`, which 1990 the GPU and is checked against that reference. The standalone device uses it for `BuildRaytracingAccelerationStructure`
1991 today builds a `VkAccelerationStructureKHR` (#743) that the game's shaders can't read. 1991 and answers `GetRaytracingAccelerationStructurePrebuildInfo` from its layout, exactly. Acceleration-structure
1992 buffers then keep their console VAs, the addresses the records name each other by. `LEONIDA_RT_AS=khr` keeps
1993 #743's `VkAccelerationStructureKHR` builds (for `RayQueryKHR`), which the game's shaders can't read. Updates rebuild
1994 the structure; compaction, copies, serialization and the Xbox batched/streaming builds are not implemented. The
1995 reported `RaytracingTier` is unchanged (`NOT_SUPPORTED`). Checked by `runtime/test/d3d12_xdxr_rt_test.cpp` through
1996 the D3D12 API.
1992 1997
1993**Open:** which path the game uses. Resolve by logging the first call to the standard AS methods and by tracing the 1998**Open:** which path the game uses. Resolve by logging the first call to the standard AS methods and by tracing the
1994builder's command-list usage. If XDXR batched/streaming builds are used, their structs and compression formats need 1999builder's command-list usage. If XDXR batched/streaming builds are used, their structs and compression formats need