diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-05 15:21:49 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-05 15:21:49 +0300 |
commit | 424901ad7b32a9bc4be5b5e4f062b98e83ebfde0 (patch) | |
tree | 9fea3b8349fe850ba194174df9949392c7a011cf /intern/cycles | |
parent | e4c5441286f3562127c85dd20eea0a89679db900 (diff) |
Cycles: Guard global write access in SVM compilation code
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/svm.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index 4cb4018e2b4..48287d872d4 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()); |