diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-09-22 18:05:44 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-09-22 18:10:06 +0300 |
commit | bc1e675bb905baec73f2758b009826530678e436 (patch) | |
tree | f872c8b203340ed23312de18a3104a40d901ce8c /intern | |
parent | 1eba32c3e95effe3d3caef3bb7b6f508786c958f (diff) |
Fix T91603: Cycles crash when volume becomes visible
Making object which uses volume shader invisible will mark the shader
as not having a volume, forcing re-compilation of the shader to bring
it back to a consistent state.
The compilation is happening as part of scene update, which needs to
know kernel features. So there is a feedback loop.
Use more relaxed way of knowing whether there is a volume in the
shader for the kernel features, which doesn't require shader to be
compiled first.
Solves issues from the report, but potentially causes extra memory
allocated if the volume part of graph is fully optimized out. This
downside is solvable, but would need to split scene update into two
steps (the one which requires on kernel, and the one which does not).
It will be an interesting project to tackle, but for a bug fix is
better to use simpler solution.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/shader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index f6b23606e58..23786a3390f 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -729,7 +729,7 @@ uint ShaderManager::get_kernel_features(Scene *scene) } /* On top of volume nodes, also check if we need volume sampling because * e.g. an Emission node would slip through the KERNEL_FEATURE_NODE_VOLUME check */ - if (shader->has_volume) { + if (shader->has_volume_connected) { kernel_features |= KERNEL_FEATURE_VOLUME; } } |