KhronosGroup / ANARI-Docs

ANARI Documentation
Other
31 stars 8 forks source link

Add anariUnsetAllParameters() API function #99

Closed jeffamstutz closed 1 year ago

jeffamstutz commented 1 year ago

This issue is for adding a new API call to ANARI: anariUnsetAllParameters().

TL;DR the premise is very simple -- it is helpful to have an API function which categorically unsets all parameters on an object. This enables a trivial way to robustly "clear" all set parameters.


When an application decouples a scene graph's parameter/array representation from a particular ANARI device's object handle, it can be tricky to keep track of what parameters were removed since the ANARI object was last updated. Currently this would require there to be significant book keeping of what parameters exist on the object vs. what has been set on the ANARI object -- if a new value is present, ANARI cleanly will just overwrite the old value to the new one. This is problematic if you want the parameter to no longer exist.

This use case came up specifically when multi-device applications are (lazily) managing N devices to a single scene representation. If an object could be cleanly cleared of all its parameters, it's trivial to then guarantee that the synchronizing of parameter values from the scene graph to the ANARI object is indeed correct.

johguenther commented 1 year ago

Sounds useful. So basically an object is reset into the state it was when freshly created (once the change is committed).