Page MenuHome

Cycles: refactor to keep session thread alive for duration of session
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Feb 10 2022, 9:25 PM.

Details

Summary

Instead of creating and destroying threads when starting and stopping renders,
keep a single thread alive for the duration of the session. This makes it so all
display driver OpenGL resource allocation and destruction can happen in the same
thread.

This was implemented as part of trying to solve another bug, but it did not
help. Still I prefer this behavior, to eliminate potential future issues wit
graphics drivers or with future Cycles display driver implementations.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested review of this revision.Feb 10 2022, 9:25 PM
Brecht Van Lommel (brecht) created this revision.
This revision is now accepted and ready to land.Feb 11 2022, 10:20 AM

Testing this revision in Windows 11 using vs2019 debugger it causes an assertion fail on line 113 "assert(session_thread_state_ == SESSION_THREAD_WAIT);" when using preview render. The session start is being call more than once at the render preview update, since it is already rendering it will cause the assertion to fail. Only happens with preview render not final render.

This revision is now accepted and ready to land.Feb 12 2022, 11:11 PM

Thanks, I'll commit a fix for that. No need to re-open revisions for this though.