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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-24 17:15:57 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-24 20:05:42 +0300
commit6260b3c15e5afd0a38c97a16d47665833f69a79f (patch)
treea93ee36a118fad479daae3db8bf0a95f6c77e005 /intern
parentc26fe3433ef369aaf68b890ca3356b29fde19ec8 (diff)
Fix T60597, T60806: Cycles crash rendering principled BSDF + volume interior.
The integrator maximum number of closures was not set properly for the CPU/mega kernels to match the actual available memory. Before relatively recent code refactoring we did not use this value in those kernels so it worked fine.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/session.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index edbf9947b70..c818f2b496c 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -886,7 +886,7 @@ bool Session::update_scene()
}
else {
/* Currently viewport render is faster with higher max_closures, needs investigating. */
- kintegrator->max_closures = 64;
+ kintegrator->max_closures = MAX_CLOSURE;
}
progress.set_status("Updating Scene");
@@ -1086,6 +1086,20 @@ int Session::get_max_closure_count()
max_closures = max(max_closures, num_closures);
}
max_closure_global = max(max_closure_global, max_closures);
+
+ if (max_closure_global > MAX_CLOSURE) {
+ /* This is usually harmless as more complex shader tend to get many
+ * closures discarded due to mixing or low weights. We need to limit
+ * to MAX_CLOSURE as this is hardcoded in CPU/mega kernels, and it
+ * avoids excessive memory usage for split kernels. */
+ VLOG(2) << "Maximum number of closures exceeded: "
+ << max_closure_global
+ << " > "
+ << MAX_CLOSURE;
+
+ max_closure_global = MAX_CLOSURE;
+ }
+
return max_closure_global;
}