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:
-rw-r--r--source/blender/makesrna/intern/rna_space.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index e5f6b36bb1f..db886692814 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -689,6 +689,17 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *UNUSED(scene), Poi
return;
}
+ for (Material *ma = bmain->mat.first; ma; ma = ma->id.next) {
+ /* XXX Dependency graph does not support CD mask tracking,
+ * so we trigger materials shading for until it's properly supported.
+ * This is to ensure material batches are all recreated when switching
+ * shading type. In the future DEG should replace this and just tag
+ * the meshes itself.
+ * This hack just tag BKE_MESH_BATCH_DIRTY_SHADING for every mesh that
+ * have a material. (see T55059) */
+ DEG_id_tag_update(&ma->id, DEG_TAG_SHADING_UPDATE);
+ }
+
bScreen *screen = ptr->id.data;
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {