[Bf-blender-cvs] [424901ad7b3] master: Cycles: Guard global write access in SVM compilation code

Sergey Sharybin noreply at git.blender.org
Wed Apr 5 14:59:10 CEST 2017


Commit: 424901ad7b32a9bc4be5b5e4f062b98e83ebfde0
Author: Sergey Sharybin
Date:   Wed Apr 5 14:21:49 2017 +0200
Branches: master
https://developer.blender.org/rB424901ad7b32a9bc4be5b5e4f062b98e83ebfde0

Cycles: Guard global write access in SVM compilation code

===================================================================

M	intern/cycles/render/svm.cpp

===================================================================

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());




More information about the Bf-blender-cvs mailing list