diff options
Diffstat (limited to 'intern/cycles/render/svm.cpp')
-rw-r--r-- | intern/cycles/render/svm.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index 4cb4018e2b4..9cf3f4cb0b2 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -67,6 +67,7 @@ void SVMShaderManager::device_update_shader(Scene *scene, << "Shader name: " << shader->name << "\n" << summary.full_report(); + nodes_lock_.lock(); if(shader->use_mis && shader->has_surface_emission) { scene->light_manager->need_update = true; } @@ -74,7 +75,6 @@ void SVMShaderManager::device_update_shader(Scene *scene, /* The copy needs to be done inside the lock, if another thread resizes the array * while memcpy is running, it'll be copying into possibly invalid/freed ram. */ - nodes_lock_.lock(); size_t global_nodes_size = global_svm_nodes->size(); global_svm_nodes->resize(global_nodes_size + svm_nodes.size()); @@ -393,11 +393,13 @@ void SVMCompiler::add_node(const float4& f) uint SVMCompiler::attribute(ustring name) { + thread_scoped_spin_lock lock(attribute_lock_); return shader_manager->get_attribute_id(name); } uint SVMCompiler::attribute(AttributeStandard std) { + thread_scoped_spin_lock lock(attribute_lock_); return shader_manager->get_attribute_id(std); } |