diff options
| author | romainveurrier <romain.veurrier@gmail.com> | 2026-11-22 15:29:57 +0100 |
|---|---|---|
| committer | romainveurrier <romain.veurrier@gmail.com> | 2026-11-22 15:29:57 +0100 |
| commit | 9fd1aaed6677cb5f196c107c8b4477291547ba2a (patch) | |
| tree | e233391a34989c910010019a0e4fc65402307c18 /runtime/src/vulkan_backend.h | |
| parent | f6d6121c9c54d406f1cfc8791df628a82dc673d8 (diff) | |
XDXR: CopyRaytracingAccelerationStructure (clone, compact) and postbuild sizes
CopyRaytracingAccelerationStructure and EmitRaytracingAccelerationStructure-
PostbuildInfo were not implemented, and the postbuild descs of
BuildRaytracingAccelerationStructure were ignored.
- CLONE and COMPACT copy the structure's bytes (MODE_COPY_AS). XDXR records
are position-independent: node pointers count from the structure's start
and a TLAS names its BLASes by address. The size comes from the source
header, so a copy can follow a build in the same list; the destination
resource bounds it.
- COMPACTED_SIZE and CURRENT_SIZE (MODE_POSTBUILD) are totalSizeIn64BNodes *
64: a build is already exactly its layout's size. Written for
EmitRaytracingAccelerationStructurePostbuildInfo and for each postbuild
desc of a build, after it.
- New IR commands CopyAccelerationStructure and AccelerationStructurePostbuild.
Serialization, deserialization and tools visualization are refused at
replay. With LEONIDA_RT_AS=khr the postbuild descs stay ignored, as before.
- vk_xdxr_build_test: a clone of blas_random, its COMPACTED_SIZE (== layout
size), a compaction into exactly that size with a guard word after it, and
a clone of the refitted TLAS.
- d3d12_xdxr_rt_test: EmitRaytracingAccelerationStructurePostbuildInfo for
both structures and a TLAS rebuild with a CURRENT_SIZE desc (all equal to
the prebuild sizes), then COMPACT into a buffer of that size, checked as
d3d12_blas_compacted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/vulkan_backend.h')
| -rw-r--r-- | runtime/src/vulkan_backend.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index 0d73bb2de..390602f57 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h | |||
| @@ -744,6 +744,14 @@ public: | |||
| 744 | xdxr_->record_blas(cb, layout, geometries, base + b.dst_va, base + b.scratch_va, from); | 744 | xdxr_->record_blas(cb, layout, geometries, base + b.dst_va, base + b.scratch_va, from); |
| 745 | } | 745 | } |
| 746 | }; | 746 | }; |
| 747 | replay_.xdxr_copy = [this](VkCommandBuffer cb, std::uint64_t src, std::uint64_t dst, std::uint64_t bytes) { | ||
| 748 | const std::uint64_t base = replay_.heap_base; | ||
| 749 | xdxr_->record_copy(cb, base + src, base + dst, bytes); | ||
| 750 | }; | ||
| 751 | replay_.xdxr_postbuild = [this](VkCommandBuffer cb, std::uint64_t src, std::uint64_t dest) { | ||
| 752 | const std::uint64_t base = replay_.heap_base; | ||
| 753 | xdxr_->record_postbuild(cb, base + src, base + dest); | ||
| 754 | }; | ||
| 747 | } else { | 755 | } else { |
| 748 | xdxr_.reset(); | 756 | xdxr_.reset(); |
| 749 | } | 757 | } |