From 34ab90f546f097cada951b2c9ca22bf271996980 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 6 Apr 2018 12:07:27 +0200 Subject: 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 --- source/blender/editors/render/render_internal.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/render/render_internal.c') 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); -- cgit v1.2.3