diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-06 13:07:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-16 20:55:33 +0300 |
commit | 34ab90f546f097cada951b2c9ca22bf271996980 (patch) | |
tree | ebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/editors/render/render_opengl.c | |
parent | 0c495005dd83913864acb510c1d4194a2275dbb0 (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_opengl.c')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index be2b184626d..a334d3abc68 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -268,6 +268,7 @@ static void screen_opengl_views_setup(OGLRender *oglrender) static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, RenderResult *rr) { + Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = oglrender->scene; ViewLayer *view_layer = oglrender->view_layer; ARegion *ar = oglrender->ar; @@ -282,9 +283,6 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R float *rectf = NULL; const char *viewname = RE_GetActiveRenderView(oglrender->re); ImBuf *ibuf_result = NULL; - EvaluationContext eval_ctx; - - CTX_data_eval_ctx(C, &eval_ctx); if (oglrender->is_sequencer) { SpaceSeq *sseq = oglrender->sseq; @@ -362,7 +360,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R draw_flags |= (draw_bgpic) ? V3D_OFSDRAW_USE_BACKGROUND : 0; ibuf_view = ED_view3d_draw_offscreen_imbuf( - &eval_ctx, scene, view_layer, engine_type, + depsgraph, scene, view_layer, engine_type, v3d, ar, sizex, sizey, IB_rectfloat, draw_flags, alpha_mode, oglrender->ofs_samples, viewname, oglrender->ofs, err_out); @@ -375,7 +373,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R else { draw_flags |= (V3D_OFSDRAW_USE_GPENCIL | V3D_OFSDRAW_USE_BACKGROUND); ibuf_view = ED_view3d_draw_offscreen_imbuf_simple( - &eval_ctx, scene, view_layer, engine_type, + depsgraph, scene, view_layer, engine_type, scene->camera, oglrender->sizex, oglrender->sizey, IB_rectfloat, draw_flags, OB_SOLID, alpha_mode, oglrender->ofs_samples, viewname, @@ -539,8 +537,8 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender) int chanshown = sseq ? sseq->chanshown : 0; BKE_sequencer_new_render_data( - oglrender->bmain->eval_ctx, oglrender->bmain, scene, - oglrender->sizex, oglrender->sizey, 100.0f, + oglrender->bmain, scene, + oglrender->sizex, oglrender->sizey, 100.0f, false, &context); for (view_id = 0; view_id < oglrender->views_len; view_id++) { |