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.
This commit is contained in:
Sergey Sharybin
2018-03-15 15:18:16 +01:00
parent 1816d1f992
commit 709ffd94ee

View File

@@ -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;