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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-06 13:07:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-16 20:55:33 +0300
commit34ab90f546f097cada951b2c9ca22bf271996980 (patch)
treeebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/editors/render/render_internal.c
parent0c495005dd83913864acb510c1d4194a2275dbb0 (diff)
Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
Diffstat (limited to 'source/blender/editors/render/render_internal.c')
-rw-r--r--source/blender/editors/render/render_internal.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 51a75e36044..965e213631d 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -1092,7 +1092,6 @@ typedef struct RenderPreview {
wmJob *job;
Scene *scene;
- EvaluationContext *eval_ctx;
Depsgraph *depsgraph;
ScrArea *sa;
ARegion *ar;
@@ -1108,7 +1107,7 @@ typedef struct RenderPreview {
bool has_freestyle;
} RenderPreview;
-static int render_view3d_disprect(Scene *scene, const Depsgraph *depsgraph,
+static int render_view3d_disprect(Scene *scene, Depsgraph *depsgraph,
ARegion *ar, View3D *v3d, RegionView3D *rv3d, rcti *disprect)
{
/* copied code from view3d_draw.c */
@@ -1145,7 +1144,7 @@ static int render_view3d_disprect(Scene *scene, const Depsgraph *depsgraph,
/* returns true if OK */
static bool render_view3d_get_rects(
- const Depsgraph *depsgraph,
+ Depsgraph *depsgraph,
ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewplane, RenderEngine *engine,
float *r_clipsta, float *r_clipend, float *r_pixsize, bool *r_ortho)
{
@@ -1341,7 +1340,7 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda
WM_job_main_thread_lock_release(rp->job);
/* do preprocessing like building raytree, shadows, volumes, SSS */
- RE_Database_Preprocess(rp->eval_ctx, re);
+ RE_Database_Preprocess(rp->depsgraph, re);
/* conversion not completed, need to do it again */
if (!rstats->convertdone) {
@@ -1407,7 +1406,6 @@ static void render_view3d_startjob(void *customdata, short *stop, short *do_upda
static void render_view3d_free(void *customdata)
{
RenderPreview *rp = customdata;
- DEG_evaluation_context_free(rp->eval_ctx);
MEM_freeN(rp);
}
@@ -1523,8 +1521,6 @@ static void render_view3d_do(RenderEngine *engine, const bContext *C)
/* customdata for preview thread */
rp->scene = scene;
rp->depsgraph = depsgraph;
- rp->eval_ctx = DEG_evaluation_context_new(DAG_EVAL_PREVIEW);
- CTX_data_eval_ctx(C, rp->eval_ctx);
rp->engine = engine;
rp->sa = CTX_wm_area(C);
rp->ar = CTX_wm_region(C);