Commit: 9299a88d7c67283e18aa176a9971d83f4d7cd710
Author: Kévin Dietrich
Date:   Tue Nov 10 16:05:20 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rB9299a88d7c67283e18aa176a9971d83f4d7cd710

cleanup, merge loops on shaders for detecting changes

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

M       intern/cycles/render/geometry.cpp

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

diff --git a/intern/cycles/render/geometry.cpp 
b/intern/cycles/render/geometry.cpp
index 24997b56ae6..1e3400f81ed 100644
--- a/intern/cycles/render/geometry.cpp
+++ b/intern/cycles/render/geometry.cpp
@@ -1372,9 +1372,31 @@ void GeometryManager::device_update_preprocess(Device 
*device, Scene *scene, Pro
       if (shader->has_volume) {
         geom->has_volume = true;
       }
+
       if (shader->has_surface_bssrdf) {
         geom->has_surface_bssrdf = true;
       }
+
+      if (shader->need_update_uvs) {
+        // todo: attributes
+        geom->tag_modified();
+      }
+
+      if (shader->need_update_attribute) {
+        // todo: attributes
+        geom->tag_modified();
+      }
+
+      if (shader->need_update_displacement) {
+        // tag displacement related sockets as modified
+        if (geom->is_mesh()) {
+          Mesh *mesh = static_cast<Mesh *>(geom);
+          mesh->tag_verts_modified();
+          mesh->tag_subd_dicing_rate_modified();
+          mesh->tag_subd_max_level_modified();
+          mesh->tag_subd_objecttoworld_modified();
+        }
+      }
     }
 
     /* Re-create volume mesh if we will rebuild or refit the BVH. Note we
@@ -1531,30 +1553,6 @@ void GeometryManager::device_update(Device *device,
     });
 
     foreach (Geometry *geom, scene->geometry) {
-      foreach (Node *node, geom->get_used_shaders()) {
-        Shader *shader = static_cast<Shader *>(node);
-        if (shader->need_update_uvs) {
-          // todo: attributes
-          geom->tag_modified();
-        }
-
-        if (shader->need_update_attribute) {
-          // todo: attributes
-          geom->tag_modified();
-        }
-
-        if (shader->need_update_displacement) {
-          // tag displacement related sockets as modified
-          if (geom->is_mesh()) {
-            Mesh *mesh = static_cast<Mesh *>(geom);
-            mesh->tag_verts_modified();
-            mesh->tag_subd_dicing_rate_modified();
-            mesh->tag_subd_max_level_modified();
-            mesh->tag_subd_objecttoworld_modified();
-          }
-        }
-      }
-
       if (geom->is_modified() &&
           (geom->geometry_type == Geometry::MESH || geom->geometry_type == 
Geometry::VOLUME)) {
         Mesh *mesh = static_cast<Mesh *>(geom);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to