Should I destroy GeometryGroup and that’s it, or should I destroy Buffers, Geometry, GeometryInstance
and GeometryTriangles that GeometryGroup contains?
That looks like a noob question, but I cannot find confirmation that destructors clears components.
while (geometry_group->getChildCount() > 0)
auto gi = geometry_group->getChild(0);
geometry_group = context->createGeometryGroup();
Using Optix 6.5, drivers: 496.76
Right, with the C++ wrappers inside the old OptiX API, you need to explicitly call destroy() to get rid of the underlying OptiX objects. Exactly the same as if you used the actual C API entry point functions.
The C++ wrappers are headers inside the OptiX SDK. You can step through them with your debugger to see what is actually happening.
(Inside the new OptiX 7 API all this is done with native CUDA allocations and you define where the necessary CUdeviceptrs come from, e.g. from individual allocations (slower) or by using some blocks of memory in some arena allocator.)
Yes, I must move to the Optix 7.
Thank you, I appreciate the link and your help!
Also I think I missed
as the last call in the loop… I’ve edited the post so it’s complete now.