1 /* Copyright © 2022 Konstantin Seurer 2 * Copyright © 2024 Intel Corporation 3 * SPDX-License-Identifier: MIT 4 */ 5 6 #ifndef ANV_BVH_BUILD_INTERFACE_H 7 #define ANV_BVH_BUILD_INTERFACE_H 8 9 #ifdef VULKAN 10 #include "anv_build_helpers.h" 11 #else 12 #include <stdint.h> 13 #include "anv_bvh.h" 14 #define REF(type) uint64_t 15 #define VOID_REF uint64_t 16 #endif 17 18 struct encode_args { 19 /* Address within the IR BVH, marking the start of leaves/internal nodes. */ 20 VOID_REF intermediate_bvh; 21 22 /* Address within the ANV BVH, marking the start of leaves/internal nodes. */ 23 VOID_REF output_bvh; 24 25 REF(vk_ir_header) header; 26 27 /* The offset from start of anv header to output_bvh */ 28 uint32_t output_bvh_offset; 29 30 uint32_t leaf_node_count; 31 uint32_t geometry_type; 32 }; 33 34 struct header_args { 35 REF(vk_ir_header) src; 36 REF(anv_accel_struct_header) dst; 37 38 /* The offset from start of anv header to output_bvh */ 39 uint32_t bvh_offset; 40 41 uint32_t instance_count; 42 }; 43 44 #define ANV_COPY_MODE_COPY 0 45 #define ANV_COPY_MODE_SERIALIZE 1 46 #define ANV_COPY_MODE_DESERIALIZE 2 47 48 struct copy_args { 49 VOID_REF src_addr; 50 VOID_REF dst_addr; 51 uint32_t mode; 52 53 /* VK_UUID_SIZE bytes of data matching 54 * VkPhysicalDeviceIDProperties::driverUUID 55 */ 56 uint8_t driver_uuid[VK_UUID_SIZE]; 57 58 /* VK_UUID_SIZE bytes of data identifying the compatibility for comparison 59 * using vkGetDeviceAccelerationStructureCompatibilityKHR. 60 */ 61 uint8_t accel_struct_compat[VK_UUID_SIZE]; 62 }; 63 64 #endif 65 66