Get notified that render thread is being destroyed


I was wondering if there’s any way for a plugin to get notified that render thread is being destroyed/recreated via SCOPED_SUSPEND_RENDERING_THREAD(true) ?

I work with an external library that is quite sensitive to rendering thread suddenly changing and I need to do some de-initialization in the old render thread before re-initializing in the new one. Right now I wrap all my rendering code in ENQUEUE_UNIQUE_RENDER_COMMAND_* macros but I have no way to tell if the next command in queue is going to get executed on a different thread due to render thread being recreated in the meantime (this happens, among other cases, when the user resizes the game viewport).

Any help in this matter is greatly appreciated. :slight_smile:

Found it! There’s