diff options
| author | Dennis Schöneberg <schoenebergde@gmail.com> | 2026-11-23 16:49:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-23 09:49:28 -0600 |
| commit | 2c72b0d28147d336a106f35d0ee76cd6635652dd (patch) | |
| tree | 9f0d750ec845b00604b4a620d12f76d72ed14922 /runtime/test/command_list_test.cpp | |
| parent | 0805d30d5411ca0df33eeede637442518b3f6169 (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/test/command_list_test.cpp')
| -rw-r--r-- | runtime/test/command_list_test.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/runtime/test/command_list_test.cpp b/runtime/test/command_list_test.cpp index 726dd2659..2ab6b7d20 100644 --- a/runtime/test/command_list_test.cpp +++ b/runtime/test/command_list_test.cpp | |||
| @@ -313,5 +313,53 @@ int main() { | |||
| 313 | CHECK(query_fits_heap(h::so_statistics, q::so_statistics_stream3) && !query_fits_heap(6, q::occlusion)); | 313 | CHECK(query_fits_heap(h::so_statistics, q::so_statistics_stream3) && !query_fits_heap(6, q::occlusion)); |
| 314 | CHECK(query_result_size(q::occlusion) == 8 && query_result_size(q::timestamp) == 8); | 314 | CHECK(query_result_size(q::occlusion) == 8 && query_result_size(q::timestamp) == 8); |
| 315 | CHECK(query_result_size(q::pipeline_statistics) == 88 && query_result_size(q::so_statistics_stream0) == 16); | 315 | CHECK(query_result_size(q::pipeline_statistics) == 88 && query_result_size(q::so_statistics_stream0) == 16); |
| 316 | |||
| 317 | // Acceleration-structure commands: 256-byte AS/scratch alignment, 8-byte postbuild alignment, | ||
| 318 | // valid copy modes (0..4), valid postbuild info types (0..3), and PERFORM_UPDATE source checks. | ||
| 319 | CHECK(list.close()); | ||
| 320 | CHECK(list.reset()); | ||
| 321 | BuildAccelerationStructure build{}; | ||
| 322 | build.dst_va = 0x1000; | ||
| 323 | build.scratch_va = 0x2000; | ||
| 324 | CHECK(list.build_acceleration_structure(build)); | ||
| 325 | build.dst_va = 0; | ||
| 326 | CHECK(!list.build_acceleration_structure(build)); | ||
| 327 | build.dst_va = 0x1080; // misaligned | ||
| 328 | CHECK(!list.build_acceleration_structure(build)); | ||
| 329 | build.dst_va = 0x1000; | ||
| 330 | build.scratch_va = 0; | ||
| 331 | CHECK(!list.build_acceleration_structure(build)); | ||
| 332 | build.scratch_va = 0x2080; // misaligned | ||
| 333 | CHECK(!list.build_acceleration_structure(build)); | ||
| 334 | build.scratch_va = 0x2000; | ||
| 335 | build.update = true; | ||
| 336 | build.src_va = 0; | ||
| 337 | CHECK(!list.build_acceleration_structure(build)); | ||
| 338 | build.src_va = 0x3080; // misaligned update source | ||
| 339 | CHECK(!list.build_acceleration_structure(build)); | ||
| 340 | build.src_va = 0x3000; | ||
| 341 | CHECK(list.build_acceleration_structure(build)); | ||
| 342 | build.update = false; | ||
| 343 | build.src_va = 0x3080; // ignored when not updating | ||
| 344 | CHECK(list.build_acceleration_structure(build)); | ||
| 345 | |||
| 346 | CHECK(list.copy_acceleration_structure({0x1000, 0x2000, 0})); | ||
| 347 | CHECK(list.copy_acceleration_structure({0x1000, 0x2000, 4})); | ||
| 348 | CHECK(!list.copy_acceleration_structure({0x1000, 0x2000, 5})); | ||
| 349 | CHECK(!list.copy_acceleration_structure({0, 0x2000, 0})); | ||
| 350 | CHECK(!list.copy_acceleration_structure({0x1080, 0x2000, 0})); | ||
| 351 | CHECK(!list.copy_acceleration_structure({0x1000, 0, 0})); | ||
| 352 | CHECK(!list.copy_acceleration_structure({0x1000, 0x2080, 0})); | ||
| 353 | |||
| 354 | CHECK(list.acceleration_structure_postbuild({0x4000, 0, {0x1000}})); | ||
| 355 | CHECK(list.acceleration_structure_postbuild({0x4008, 3, {0x1000, 0x2000}})); | ||
| 356 | CHECK(!list.acceleration_structure_postbuild({0x4000, 4, {0x1000}})); | ||
| 357 | CHECK(!list.acceleration_structure_postbuild({0, 0, {0x1000}})); | ||
| 358 | CHECK(!list.acceleration_structure_postbuild({0x4004, 0, {0x1000}})); | ||
| 359 | CHECK(!list.acceleration_structure_postbuild({0x4000, 0, {}})); | ||
| 360 | CHECK(!list.acceleration_structure_postbuild({0x4000, 0, {0}})); | ||
| 361 | CHECK(!list.acceleration_structure_postbuild({0x4000, 0, {0x1080}})); | ||
| 362 | CHECK(list.close()); | ||
| 363 | CHECK(list.commands().size() == 7); | ||
| 316 | return 0; | 364 | return 0; |
| 317 | } | 365 | } |