Cycles: Fix race condition in attributes creation during SVM compilation

This commit is contained in:
Sergey Sharybin 2017-04-05 14:57:54 +02:00
parent 3ce30823ff
commit 52029e689c
2 changed files with 4 additions and 0 deletions

View File

@ -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);
}

View File

@ -218,6 +218,8 @@ protected:
int max_stack_use;
uint mix_weight_offset;
bool compile_failed;
thread_spin_lock attribute_lock_;
};
CCL_NAMESPACE_END