1 /* 2 * Copyright © 2022 Konstantin Seurer 3 * 4 * SPDX-License-Identifier: MIT 5 */ 6 7 #ifndef BVH_BUILD_INTERFACE_H 8 #define BVH_BUILD_INTERFACE_H 9 10 #ifdef VULKAN 11 #include "build_helpers.h" 12 #else 13 #include <stdint.h> 14 #include "bvh.h" 15 #define REF(type) uint64_t 16 #define VOID_REF uint64_t 17 #endif 18 19 #define RADV_COPY_MODE_COPY 0 20 #define RADV_COPY_MODE_SERIALIZE 1 21 #define RADV_COPY_MODE_DESERIALIZE 2 22 23 struct copy_args { 24 VOID_REF src_addr; 25 VOID_REF dst_addr; 26 uint32_t mode; 27 }; 28 29 struct encode_args { 30 VOID_REF intermediate_bvh; 31 VOID_REF output_bvh; 32 REF(vk_ir_header) header; 33 uint32_t output_bvh_offset; 34 uint32_t leaf_node_count; 35 uint32_t geometry_type; 36 }; 37 38 struct header_args { 39 REF(vk_ir_header) src; 40 REF(radv_accel_struct_header) dst; 41 uint32_t bvh_offset; 42 uint32_t instance_count; 43 }; 44 45 struct update_args { 46 REF(radv_accel_struct_header) src; 47 REF(radv_accel_struct_header) dst; 48 REF(vk_aabb) leaf_bounds; 49 REF(uint32_t) internal_ready_count; 50 uint32_t leaf_node_count; 51 52 vk_bvh_geometry_data geom_data; 53 }; 54 55 #endif /* BUILD_INTERFACE_H */ 56