Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2019-01-18 02:45:21 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2019-01-18 02:58:28 +0300
commitc9eef24903479a70783efb2e00766d0eeec43823 (patch)
treee8b7434dd06068e2030146fcd1922d44e95b5dcc /source/blender/render/extern/include/RE_engine.h
parentaf316e8bc87b053e5b50453c8c5081546777d4a9 (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/include/RE_engine.h')
-rw-r--r--source/blender/render/extern/include/RE_engine.h11
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);