RemoveChild cause a memory viollation if I dont call launch every frame.

Hello.

I have a problem when work with D3D11 interop in that situation:

Rendering on D3D only (dont call optix launch)

  • Add geometry, material, accel etc and bind to a topgroup
  • Remove this geometry from topgroup (removechild)

Remember, I dont call optix launch, only D3D calls, but execute all operations in OptiX structs, Add geometry, material, accel etc. In theory all structs and graphs of OptiX are OK.

When I change the rendering mode to OptiX, the optix launch are invoked and cause memory violation.

But, if I execute exactly same proccess calling the launch everyframe all works fine. Why?

I have a lot of time about this and dont have success.

Thanks

I found the problem.

In this scenario where I add a geometry and soon remove, without calling the launch between the operations. The optix should try to build the graphs using Geometry which was removed in the next operation. Basically the sequence of operations Add> Remove-> Launch does not work. With the sequence Add-> Launch-> Remove-> Launch everything works fine.

Any idea how to solve this problem without this call between Add-> Remove?

My primary idea would accumulate operations when I’m in D3D mode and validate / perform before calling the launch.

Done.

Work’s perfectly now. Now a can change between tech targets with no problems.