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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-11 17:29:49 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-11 18:06:28 +0300
commit0461f45e5e0bcaa8c94265ddbaf442ef7e1b1227 (patch)
tree754c0373b4325c0c4ee4904ea33c5fa97bc1aa56 /intern/cycles/render/image.cpp
parent84692844a3d6493ce0649c5021ec92e684b59a86 (diff)
Fix T55436: crash with point density and shader tweaking.
With copy-on-write we can no longer assumes the point density data is available after Cycles synchronization with Blender data is done. So force it to be loaded earlier, even if it's not great for interactivity.
Diffstat (limited to 'intern/cycles/render/image.cpp')
-rw-r--r--intern/cycles/render/image.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index 9c5e32e8219..6867ea95d63 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -943,6 +943,39 @@ void ImageManager::device_update_slot(Device *device,
}
}
+void ImageManager::device_load_builtin(Device *device,
+ Scene *scene,
+ Progress& progress)
+{
+ /* Load only builtin images, Blender needs this to load evaluated
+ * scene data from depsgraph before it is freed. */
+ if(!need_update) {
+ return;
+ }
+
+ TaskPool pool;
+ for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) {
+ for(size_t slot = 0; slot < images[type].size(); slot++) {
+ if(!images[type][slot])
+ continue;
+
+ if(images[type][slot]->need_load) {
+ if(images[type][slot]->builtin_data) {
+ pool.push(function_bind(&ImageManager::device_load_image,
+ this,
+ device,
+ scene,
+ (ImageDataType)type,
+ slot,
+ &progress));
+ }
+ }
+ }
+ }
+
+ pool.wait_work();
+}
+
void ImageManager::device_free_builtin(Device *device)
{
for(int type = 0; type < IMAGE_DATA_NUM_TYPES; type++) {