[Bf-blender-cvs] [4d78f5a4a77] master: DrawManager: External Engines + Overlays

Jeroen Bakker noreply at git.blender.org
Tue May 7 09:28:09 CEST 2019


Commit: 4d78f5a4a77e71aeb6a7084b64307c9987978dbe
Author: Jeroen Bakker
Date:   Fri May 3 15:48:21 2019 +0200
Branches: master
https://developer.blender.org/rB4d78f5a4a77e71aeb6a7084b64307c9987978dbe

DrawManager: External Engines + Overlays

Do not iterate over degsgraph when overlays are turned off and
rendering via an external engine. External engines sync data
from Blender differently. The external engine
draws the depth buffer, but that is only needed for overlays.

Reviewers: fclem, brecht

Differential Revision: https://developer.blender.org/D4791

===================================================================

M	source/blender/draw/intern/draw_manager.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index d7208bd0616..afda1b5d7e4 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1558,22 +1558,25 @@ void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph,
     drw_engines_cache_init();
     drw_engines_world_update(scene);
 
-    const int object_type_exclude_viewport = v3d->object_type_exclude_viewport;
-    const int iter_flag = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |
-                          DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | DEG_ITER_OBJECT_FLAG_VISIBLE |
-                          DEG_ITER_OBJECT_FLAG_DUPLI;
-    DEG_OBJECT_ITER_BEGIN (depsgraph, ob, iter_flag) {
-      if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
-        continue;
-      }
-      if (v3d->localvd && ((v3d->local_view_uuid & ob->base_local_view_bits) == 0)) {
-        continue;
+    /* Only iterate over objects for internal engines or when overlays are enabled */
+    if ((engine_type->flag & RE_INTERNAL) != 0 || (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) {
+      const int object_type_exclude_viewport = v3d->object_type_exclude_viewport;
+      const int iter_flag = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |
+                            DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | DEG_ITER_OBJECT_FLAG_VISIBLE |
+                            DEG_ITER_OBJECT_FLAG_DUPLI;
+      DEG_OBJECT_ITER_BEGIN (depsgraph, ob, iter_flag) {
+        if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
+          continue;
+        }
+        if (v3d->localvd && ((v3d->local_view_uuid & ob->base_local_view_bits) == 0)) {
+          continue;
+        }
+        DST.dupli_parent = data_.dupli_parent;
+        DST.dupli_source = data_.dupli_object_current;
+        drw_engines_cache_populate(ob);
       }
-      DST.dupli_parent = data_.dupli_parent;
-      DST.dupli_source = data_.dupli_object_current;
-      drw_engines_cache_populate(ob);
+      DEG_OBJECT_ITER_END;
     }
-    DEG_OBJECT_ITER_END;
 
     drw_engines_cache_finish();



More information about the Bf-blender-cvs mailing list