Fix T72445: Cycles crash with Displacement maps in OSL
authorLukas Stockner <lukas.stockner@freenet.de>
Fri, 20 Dec 2019 19:28:16 +0000 (20:28 +0100)
committerLukas Stockner <lukas.stockner@freenet.de>
Fri, 20 Dec 2019 19:28:16 +0000 (20:28 +0100)
The UDIM commit accidentally removed a check that skipped Image updates
if the image was managed by OSL.

intern/cycles/render/mesh.cpp

index 2bf1040455f464cb8103916f2ab4434fab73b3bf..d9e6d998ebd676ce10335e0d0481925fad059705 100644 (file)
@@ -2130,7 +2130,9 @@ void MeshManager::device_update_displacement_images(Device *device,
 
           ImageSlotTextureNode *image_node = static_cast<ImageSlotTextureNode *>(node);
           foreach (int slot, image_node->slots) {
-            bump_images.insert(slot);
+            if (slot != -1) {
+              bump_images.insert(slot);
+            }
           }
         }
       }