From 05e7d765fd15e0008db36f26d735396a52aeae9f Mon Sep 17 00:00:00 2001 From: iaomw Date: Fri, 18 Oct 2024 16:27:34 +0800 Subject: [PATCH] Minor update --- zenovis/xinxinoptix/XAS.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zenovis/xinxinoptix/XAS.h b/zenovis/xinxinoptix/XAS.h index 87d2c6e42..c46ef6868 100644 --- a/zenovis/xinxinoptix/XAS.h +++ b/zenovis/xinxinoptix/XAS.h @@ -118,6 +118,13 @@ namespace xinxinoptix { inline void buildIAS(OptixDeviceContext& context, OptixAccelBuildOptions& accel_options, std::vector& instances, raii& bufferIAS, OptixTraversableHandle& handleIAS) { + + if (instances.empty()) { + bufferIAS.reset(); + handleIAS = 0llu; + return; + } + raii d_instances; const size_t size_in_bytes = sizeof( OptixInstance ) * instances.size(); CUDA_CHECK( cudaMalloc( reinterpret_cast( &d_instances.reset() ), size_in_bytes ) );