Updating AS guarantees OptixTraversableHandle unchanged?

Hi,

I have an elementary question.
Does updating an AS (call optixAccelBuild() with OPTIX_BUILD_OPERATION_UPDATE) guarantee that it doesn’t change the resulting handle?
If it is true, which section in the doc explains?

If it possibly changes the handle, I can’t update IAS, instead always need to rebuild IAS whenever a GAS belonging to the IAS updates because the doc states that

You cannot change the number of build inputs, the build input types, build flags, traversable handles for instances (for an instance-AS)

at 5.5 Dynamic updates.

Thanks,

Yes the accel update operation will guarantee that it does not change the handle, and you can update your IAS without rebuilding after updating a GAS. And it’s rare, but if the outer bounds of your GAS don’t change during your GAS update, and only primitives inside the GAS move around, then you don’t even have to update the IAS at all.

The relevant material is in the programming guide in the section 5.5 you already found on “Dynamic Updates”

“To update the previously built acceleration structure, set OPTIX_BUILD_OPERATION_UPDATE and then call optixAccelBuild on the same output data. All other options are required to be identical to the original build. The update is done in-place on the output data.”

https://raytracing-docs.nvidia.com/optix7/guide/index.html#acceleration_structures#6166

Yes, it does say “in-place”, but I was not completely sure that it doesn’t change the handle (even if it is relatively easy to guess so). And the doc says:

The traversable handle is considered opaque and the application should not rely on any particular mapping of a pointer to the traversable handle.

Anyway, thanks for the reply, it clarify my question!

In addition to update, can I assume that returned handle always the same when I pass the same outputBuffer?

In addition to update, can I assume that returned handle always the same when I pass the same outputBuffer?

Nope… you were right to be careful and avoid assuming that “in-place” means means the handle won’t change. The reason that the handle doesn’t change during update has as much to do with none of the acceleration structure’s build options changing as it does with the buffer pointer staying constant. In general, especially when doing a build and not an update, the handle might change even though the pointer doesn’t.


David.

OK, I understand.

I hope someday OptiX adds specification that AS build as the alternative to updating doesn’t change the handle.

Currently it seems safe to assume that handle may change when I do optixAccelBuild with build flag.

Thanks.