upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorDennis Schöneberg <schoenebergde@gmail.com>2026-11-23 16:49:28 +0100
committerGitHub <noreply@github.com>2026-11-23 09:49:28 -0600
commit2c72b0d28147d336a106f35d0ee76cd6635652dd (patch)
tree9f0d750ec845b00604b4a620d12f76d72ed14922 /runtime/src
parent0805d30d5411ca0df33eeede637442518b3f6169 (diff)
d3d12: validate DXR acceleration-structure prebuild and recording inputs (#6825)
Squash-merged after diff review of PR #6825 - d3d12: validate DXR acceleration-structure prebuild and recording inputs
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/command_list.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/src/command_list.h b/runtime/src/command_list.h
index 36fee95af..1325b789c 100644
--- a/runtime/src/command_list.h
+++ b/runtime/src/command_list.h
@@ -875,17 +875,18 @@ public:
875 return append(indirect); 875 return append(indirect);
876 } 876 }
877 877
878 // D3D12: acceleration structures and build scratch are 256-byte aligned; postbuild destinations 8-byte aligned.
878 bool build_acceleration_structure(BuildAccelerationStructure build) { 879 bool build_acceleration_structure(BuildAccelerationStructure build) {
879 if (!build.dst_va || !build.scratch_va) return false; 880 if (!build.dst_va || build.dst_va % 256 || !build.scratch_va || build.scratch_va % 256) return false;
881 if (build.update && (!build.src_va || build.src_va % 256)) return false;
880 return append(std::move(build)); 882 return append(std::move(build));
881 } 883 }
882 // D3D12: acceleration structures are 256-byte aligned, postbuild destinations 8-byte aligned.
883 bool copy_acceleration_structure(CopyAccelerationStructure copy) { 884 bool copy_acceleration_structure(CopyAccelerationStructure copy) {
884 if (!copy.dst_va || !copy.src_va || copy.dst_va % 256 || copy.src_va % 256) return false; 885 if (!copy.dst_va || !copy.src_va || copy.dst_va % 256 || copy.src_va % 256 || copy.mode > 4) return false;
885 return append(copy); 886 return append(copy);
886 } 887 }
887 bool acceleration_structure_postbuild(AccelerationStructurePostbuild info) { 888 bool acceleration_structure_postbuild(AccelerationStructurePostbuild info) {
888 if (!info.dest_va || info.dest_va % 8 || info.sources.empty()) return false; 889 if (!info.dest_va || info.dest_va % 8 || info.type > 3 || info.sources.empty()) return false;
889 for (const auto va : info.sources) 890 for (const auto va : info.sources)
890 if (!va || va % 256) return false; 891 if (!va || va % 256) return false;
891 return append(std::move(info)); 892 return append(std::move(info));