Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11114)

Issue 15340044: Threaded object update and EvaluationContext (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by sergey.vfx
Modified:
10 years, 4 months ago
Reviewers:
bf-codereview, ideasman42, brechtvl
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

Made objects update happening from multiple threads. It is a task-based scheduling system which uses current dependency graph for spawning new tasks. This means threading happens on object level, but the system is flexible enough for higher granularity. Technical details: - Uses task scheduler which was recently commited to trunk (that one which Brecht ported from Cycles). - Added two utility functions to dependency graph: * DAG_threaded_update_begin, which is called to initialize threaded objects update. It will also schedule root DAG node to the queue, hence starting evaluation process. Initialization will fill in DAG nodes valency (valency is how much dependencies which are not updated yet current node does have). This valency is used by task threads for faster detecting which nodes might be scheduled. * DAG_threaded_update_handle_node_updated which is called from task thread function when node was fully handled. This function decreases valency of node childs an schedules childs with zero valency. As it might have become clear, task thread receives DAG nodes and decides which callback to call for it. Currently only BKE_object_handle_update is called for object DAG nodes. In the future it'll call node->callback() from Ali's new dependency graph. - This required adding paradigma of derivedRender, which is used by modifiers when preparing scene for rendering. This is mainly needed to stop using get_object_dm() from modifiers' apply callback. Such a call was only a workaround for dependency graph glitch when rendering scene with, say, boolean modifiers before displaying this scene. This derivedReder is stored in Object and being created by database_init_objects and it happens in threads (the same way as it's done for scene update). Unfortunately, this bumps memory usage, but could not see how to actually solve it atm. using Locked interface from GSoC branch will help here, - Added paradigma of EvaluaitonContext. Currently it's more like just a replacement for G.is_rendering which fails in some circumstances. Future idea of this context is to also store all the local data needed for objects evaluation such as local time, copied objects (by Copy-on-Write system). So now there're two types of EvaluationContext: * Context used for viewport updated and owned by Main. in the future this context might be easily moved to Window or Screen to allow per-window/per-screen local time. * Context used by render engines to evaluate objects for render purposes. Render engine is an owner of this context. This context is passed to all object update routines. There still might be some TODOs in the patch, but no actual stoppers i think. And it might be some left-overs from unfinished work in the branch. Also we might want to have "locked interface rendering" perhaps?

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+911 lines, -249 lines) Patch
b/source/blender/blenkernel/BKE_DerivedMesh.h View 2 chunks +3 lines, -0 lines 0 comments Download
b/source/blender/blenkernel/BKE_anim.h View 2 chunks +3 lines, -2 lines 0 comments Download
b/source/blender/blenkernel/BKE_depsgraph.h View 1 chunk +24 lines, -0 lines 1 comment Download
b/source/blender/blenkernel/BKE_group.h View 2 chunks +2 lines, -1 line 0 comments Download
b/source/blender/blenkernel/BKE_library.h View 1 chunk +2 lines, -0 lines 0 comments Download
b/source/blender/blenkernel/BKE_main.h View 2 chunks +4 lines, -0 lines 0 comments Download
b/source/blender/blenkernel/BKE_object.h View 3 chunks +5 lines, -2 lines 0 comments Download
b/source/blender/blenkernel/BKE_scene.h View 2 chunks +13 lines, -2 lines 2 comments Download
b/source/blender/blenkernel/BKE_sequencer.h View 3 chunks +4 lines, -2 lines 0 comments Download
b/source/blender/blenkernel/BKE_shrinkwrap.h View 2 chunks +2 lines, -2 lines 0 comments Download
b/source/blender/blenkernel/BKE_smoke.h View 1 chunk +1 line, -1 line 0 comments Download
b/source/blender/blenkernel/depsgraph_private.h View 1 chunk +8 lines, -0 lines 1 comment Download
b/source/blender/blenkernel/intern/DerivedMesh.c View 2 chunks +28 lines, -4 lines 0 comments Download
b/source/blender/blenkernel/intern/anim.c View 19 chunks +34 lines, -27 lines 0 comments Download
b/source/blender/blenkernel/intern/blender.c View 2 chunks +2 lines, -1 line 0 comments Download
b/source/blender/blenkernel/intern/constraint.c View 2 chunks +10 lines, -2 lines 1 comment Download
b/source/blender/blenkernel/intern/depsgraph.c View 5 chunks +220 lines, -8 lines 0 comments Download
b/source/blender/blenkernel/intern/dynamicpaint.c View 1 chunk +1 line, -1 line 0 comments Download
b/source/blender/blenkernel/intern/group.c View 3 chunks +3 lines, -3 lines 0 comments Download
b/source/blender/blenkernel/intern/library.c View 2 chunks +7 lines, -0 lines 0 comments Download
b/source/blender/blenkernel/intern/object.c View 11 chunks +38 lines, -31 lines 0 comments Download
b/source/blender/blenkernel/intern/pointcache.c View 3 chunks +5 lines, -5 lines 0 comments Download
b/source/blender/blenkernel/intern/scene.c View 16 chunks +231 lines, -41 lines 0 comments Download
b/source/blender/blenkernel/intern/sequencer.c View 7 chunks +12 lines, -8 lines 0 comments Download
b/source/blender/blenkernel/intern/shrinkwrap.c View 6 chunks +10 lines, -6 lines 0 comments Download
b/source/blender/blenkernel/intern/smoke.c View 12 chunks +15 lines, -13 lines 0 comments Download
b/source/blender/blenloader/intern/readfile.c View 5 chunks +5 lines, -4 lines 0 comments Download
b/source/blender/collada/AnimationExporter.cpp View 1 chunk +1 line, -1 line 0 comments Download
b/source/blender/editors/mesh/editmesh_extrude.c View 2 chunks +3 lines, -1 line 0 comments Download
b/source/blender/editors/mesh/editmesh_utils.c View 2 chunks +4 lines, -1 line 0 comments Download
b/source/blender/editors/object/object_add.c View 2 chunks +2 lines, -1 line 0 comments Download
b/source/blender/editors/render/render_internal.c View 2 chunks +3 lines, -1 line 1 comment Download
b/source/blender/editors/render/render_opengl.c View 4 chunks +6 lines, -5 lines 0 comments Download
b/source/blender/editors/screen/screen_edit.c View 2 chunks +14 lines, -1 line 1 comment Download
b/source/blender/editors/sound/sound_ops.c View 1 chunk +2 lines, -2 lines 0 comments Download
b/source/blender/editors/space_sequencer/sequencer_draw.c View 2 chunks +2 lines, -2 lines 0 comments Download
b/source/blender/editors/space_view3d/view3d_draw.c View 3 chunks +3 lines, -2 lines 0 comments Download
b/source/blender/editors/space_view3d/view3d_view.c View 2 chunks +2 lines, -2 lines 0 comments Download
b/source/blender/editors/transform/transform_conversions.c View 1 chunk +4 lines, -2 lines 0 comments Download
b/source/blender/editors/transform/transform_snap.c View 4 chunks +6 lines, -3 lines 0 comments Download
b/source/blender/gpu/intern/gpu_material.c View 1 chunk +1 line, -1 line 0 comments Download
b/source/blender/makesdna/DNA_object_types.h View 1 chunk +2 lines, -1 line 0 comments Download
b/source/blender/makesrna/intern/rna_object_api.c View 2 chunks +5 lines, -3 lines 0 comments Download
b/source/blender/makesrna/intern/rna_scene_api.c View 2 chunks +8 lines, -2 lines 1 comment Download
b/source/blender/modifiers/intern/MOD_array.c View 4 chunks +7 lines, -5 lines 0 comments Download
b/source/blender/modifiers/intern/MOD_boolean.c View 3 chunks +3 lines, -20 lines 0 comments Download
b/source/blender/modifiers/intern/MOD_shrinkwrap.c View 2 chunks +4 lines, -3 lines 0 comments Download
b/source/blender/modifiers/intern/MOD_smoke.c View 1 chunk +3 lines, -2 lines 0 comments Download
b/source/blender/modifiers/intern/MOD_util.h View 1 chunk +1 line, -0 lines 0 comments Download
b/source/blender/modifiers/intern/MOD_util.c View 1 chunk +15 lines, -0 lines 0 comments Download
b/source/blender/render/intern/include/render_types.h View 2 chunks +2 lines, -0 lines 0 comments Download
b/source/blender/render/intern/source/convertblender.c View 10 chunks +96 lines, -7 lines 1 comment Download
b/source/blender/render/intern/source/external_engine.c View 1 chunk +1 line, -1 line 0 comments Download
b/source/blender/render/intern/source/pipeline.c View 6 chunks +11 lines, -10 lines 0 comments Download
b/source/blender/windowmanager/intern/wm_event_system.c View 1 chunk +1 line, -1 line 0 comments Download
b/source/blender/windowmanager/intern/wm_operators.c View 2 chunks +2 lines, -2 lines 0 comments Download
b/source/blender/windowmanager/intern/wm_playanim.c View 2 chunks +2 lines, -0 lines 0 comments Download
b/source/creator/creator.c View 1 chunk +1 line, -0 lines 0 comments Download
b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 4
sergey.vfx
10 years, 6 months ago (2013-10-20 15:37:39 UTC) #1
brechtvl
Some initial comments from first pass reading code, still need to dive into scene.c, depsgraph.c ...
10 years, 6 months ago (2013-10-29 16:27:25 UTC) #2
brechtvl
This file crashes when rendering with the patch: lib/tests/particles_and_hair/particle_dupligroups.blend https://codereview.appspot.com/15340044/diff/1/b/source/blender/render/intern/source/convertblender.c File b/source/blender/render/intern/source/convertblender.c (right): https://codereview.appspot.com/15340044/diff/1/b/source/blender/render/intern/source/convertblender.c#newcode5098 b/source/blender/render/intern/source/convertblender.c:5098: ...
10 years, 6 months ago (2013-10-29 17:05:47 UTC) #3
sergey.vfx
10 years, 4 months ago (2013-12-11 10:35:48 UTC) #4
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b