Fix part of #33132: render resoltuion refresh issues after persistent images

was added for cycles.

This fixes the case where the option is disabled. I moved the option now to
Blender itself and made it keep the engine around only when it's enabled. Also
fixes case where there could be issues when switching to another renderer.
This commit is contained in:
2012-11-09 23:54:58 +00:00
parent 5a29885007
commit 7d03e5c615
9 changed files with 45 additions and 13 deletions

View File

@@ -382,6 +382,11 @@ int RE_engine_render(Render *re, int do_all)
if (type->render)
type->render(engine, re->scene);
if(!(re->r.mode & R_PERSISTENT_DATA)) {
RE_engine_free(re->engine);
re->engine = NULL;
}
if (re->result->do_exr_tile) {
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
render_result_exr_file_end(re);

View File

@@ -244,6 +244,7 @@ Render *RE_GetRender(const char *name)
return re;
}
/* if you want to know exactly what has been done */
RenderResult *RE_AcquireResultRead(Render *re)
{
@@ -424,6 +425,19 @@ void RE_FreeAllRenderResults(void)
}
}
void RE_FreePersistentData()
{
Render *re;
/* render engines can be kept around for quick re-render, this clears all */
for (re = RenderGlobal.renderlist.first; re; re = re->next) {
if (re->engine) {
RE_engine_free(re);
re->engine = NULL;
}
}
}
/* ********* initialize state ******** */