diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2019-01-18 02:45:21 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2019-01-18 02:58:28 +0300 |
commit | c9eef24903479a70783efb2e00766d0eeec43823 (patch) | |
tree | e8b7434dd06068e2030146fcd1922d44e95b5dcc /source/blender/render/extern | |
parent | af316e8bc87b053e5b50453c8c5081546777d4a9 (diff) |
Fix T56799: Custom render passes missing when using Save Buffers
The problem here was that when a render result is allocated, the standard render passes are added according to the
pass bitfield. Then, when the render engine sets the result, it adds the additional passes which are then merged
into the main render result.
However, when using Save Buffers, the EXR is created before the actual render starts, so it's missing all those
additional passes.
To fix that, we need to query the render engine for a list of additional passes so they can be added before the EXR
is created. Luckily, there already is a function to do that for the node editor.
The same needs to be done when the EXR is loaded back.
Due to how that is implemented though (Render API calls into engine, engine calls back for each pass), if we have
multiple places that call this function there needs to be a way to tell which one the call came from in the pass
registration callback. Therefore, the original caller now provides a callback that is called for each pass.
Diffstat (limited to 'source/blender/render/extern')
-rw-r--r-- | source/blender/render/extern/include/RE_engine.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index 5c1dc468b8f..e23d881c7b1 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -37,6 +37,8 @@ #include "RNA_types.h" #include "RE_bake.h" +#include "BLI_threads.h" + struct bNode; struct bNodeTree; struct Object; @@ -102,6 +104,9 @@ typedef struct RenderEngineType { ExtensionRNA ext; } RenderEngineType; +typedef void (*update_render_passes_cb_t)(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl, + const char *name, int channels, const char *chanid, int type); + typedef struct RenderEngine { RenderEngineType *type; void *py_instance; @@ -125,6 +130,10 @@ typedef struct RenderEngine { int update_flag; int job_update_flag; + /* callback for render pass query */ + ThreadMutex update_render_passes_mutex; + update_render_passes_cb_t update_render_passes_cb; + rctf last_viewplane; rcti last_disprect; float last_viewmat[4][4]; @@ -163,6 +172,8 @@ bool RE_engine_is_external(struct Render *re); void RE_engine_frame_set(struct RenderEngine *engine, int frame, float subframe); +void RE_engine_update_render_passes(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl, + update_render_passes_cb_t callback); void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct SceneRenderLayer *srl, const char *name, int channels, const char *chanid, int type); |