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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-03-15 17:18:16 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-03-15 17:21:07 +0300
commit709ffd94eeca1f2f6f7e929128b5657665b2736c (patch)
treedbeb41511aa8ba1d1574a2cfa1c93cfd2098c110 /source/blender/depsgraph
parent1816d1f992c45f6decf26a3afa2e8ba71964defc (diff)
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.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc16
1 files changed, 16 insertions, 0 deletions
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;