ospray / anari-ospray

Translation layer from ANARI to OSPRay, ANARILibrary and ANARIDevice "ospray".
Apache License 2.0
17 stars 5 forks source link

Reset current frame pointer after rendering has finished #10

Closed stukowski closed 1 year ago

stukowski commented 1 year ago

In my application I observe crashes within the anari-ospray/OSPRay code, which are probably due to a bug. This pull request proposes a fix for it.

I render a series of images using an OSPRay ANARI device (which is reused). For each image a new Frame object is created and then released immediately after rendering is complete. The internal OSPRayGlobalState::currentFrame pointer does not seem to get updated and still points to the already destroyed Frame object after rendering the first image. When trying to render the next image, this leads to a crash in Frame::renderFrame(), which calls state->waitOnCurrentFrame() to wait for the previous frame to finish.

johguenther commented 1 year ago

Nice, a better fix than we had internally, thanks! Merged manually.