[Bf-blender-cvs] [709ffd94eec] blender2.8: Depsgraph: Fix missing shader updates with copy on write

Sergey Sharybin noreply at git.blender.org
Thu Mar 15 15:21:18 CET 2018


Commit: 709ffd94eeca1f2f6f7e929128b5657665b2736c
Author: Sergey Sharybin
Date:   Thu Mar 15 15:18:16 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB709ffd94eeca1f2f6f7e929128b5657665b2736c

Depsgraph: Fix missing shader updates with copy on write

Basically, don't do full in-place copy of node tree datablock if it's
already expanded. Current way how node tree is evaluated is fully
built around the idea that evaluation copies values from original
to copied datablocks.

Changing links is handled on another level.

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

M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc

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

diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index f9e99227337..5be95543801 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -870,6 +870,22 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph,
 				gpumaterial_ptr = &world->gpumaterial;
 				break;
 			}
+			case ID_NT:
+			{
+				/* Node trees should try to preserve their socket pointers
+				 * as much as possible. This is due to UBOs code in GPU,
+				 * which references sockets from trees.
+				 *
+				 * These flags CURRENTLY don't need full datablock update,
+				 * everything is done by node tree update function which
+				 * only copies socket values.
+				 */
+				const int ignore_flag = (ID_RECALC_DRAW | ID_RECALC_ANIMATION);
+				if ((id_cow->recalc & ~ignore_flag) == 0) {
+					return id_cow;
+				}
+				break;
+			}
 			case ID_OB:
 			{
 				Object *object = (Object *)id_cow;



More information about the Bf-blender-cvs mailing list