Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cycles Renderer : Remove the session reset code
This was an attempt to deal with a fundamental mismatch between the Cycles and Renderer APIs : you can't create a `ccl::session` without already having `ccl::SessionParams` (threads, shading system, device etc), but the values for those will arrive via `Renderer::option()` _after_ construction of the renderer. And unfortunately the Renderer constructor is the most natural place to construct the `ccl::Session`. Our strategy was to create a default session in the renderer constructor, and then store options into `m_sessionParams`, and then in `reset()` attempt to replace the original session with a new one constructed from `m_sessionParams`. This was made tricky by the fact that the session also owns the scene, and we needed to transplant all the old scene objects into the new scene. This almost worked, but had several flaws : - On Windows, we were getting deadlocks due to deleting the scene lock while holding it. This could have been fixed separately while keeping the reset concept alive - see GafferHQ#5101. - The Cycles objects we transplanted had pointers to the old scene, and this would trigger assertions when freeing them in debug builds. I suspect they were also the cause of the crash exposed by `InteractiveCyclesRenderTest.testShadingModes` - with the reset code removed, the test now passes. - More generally, it was working against the Cycles API, and could be broken in any number of ways by future Cycles changes. Just removing the `reset()` code isn't the end of the story though : it means that the options for devices, threads etc are now completely non-functioning. This results in test failures for `RendererTest.testCustomAOV` and `RendererTest.testOSLInSVMShadingSystem`. We'll deal with that in future commits : the purpose of this commit is to document why the old approach wasn't working, and clear the decks a little in preparation for a new approach.
- Loading branch information