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/draw/intern/draw_manager.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/draw/intern/draw_manager.c')
-rw-r--r--source/blender/draw/intern/draw_manager.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 420841e2efa..b77218ec6ff 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -350,16 +350,6 @@ static void drw_viewport_cache_resize(void)
DRW_instance_data_list_resize(DST.idatalist);
}
-static void drw_state_eval_ctx_init(DRWManager *dst)
-{
- DRWContextState *draw_ctx = &dst->draw_ctx;
- DEG_evaluation_context_init_from_scene(
- &draw_ctx->eval_ctx,
- draw_ctx->scene,
- draw_ctx->view_layer,
- DST.options.is_scene_render ? DAG_EVAL_RENDER : DAG_EVAL_VIEWPORT);
-}
-
/* Not a viewport variable, we could split this out. */
static void drw_context_state_init(void)
{
@@ -388,8 +378,6 @@ static void drw_context_state_init(void)
else {
DST.draw_ctx.object_pose = NULL;
}
-
- drw_state_eval_ctx_init(&DST);
}
/* It also stores viewport variable to an immutable place: DST
@@ -1122,15 +1110,14 @@ void DRW_notify_id_update(const DRWUpdateContext *update_ctx, ID *id)
* for each relevant engine / mode engine. */
void DRW_draw_view(const bContext *C)
{
- EvaluationContext eval_ctx;
- CTX_data_eval_ctx(C, &eval_ctx);
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
RenderEngineType *engine_type = CTX_data_engine_type(C);
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
/* Reset before using it. */
drw_state_prepare_clean_for_draw(&DST);
- DRW_draw_render_loop_ex(eval_ctx.depsgraph, engine_type, ar, v3d, C);
+ DRW_draw_render_loop_ex(depsgraph, engine_type, ar, v3d, C);
}
/**