Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-04-04 18:24:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-04-04 18:49:08 +0300
commitb561707bed0e4a464ffa8f8027fa7869b1544fb4 (patch)
tree0967c8fe649c4ab905ceb6e7a6f4e916b3c11ea3 /intern
parent160e62b88cdcc927b7cb3741c7ea0565412e8016 (diff)
Gawain: Make removing batches more thread safe
The issue was mainly visible when copy-on-write was enabled. This was forcing lots of meshes to be freed from multiple thread, causing all sorts of race conditions in Gawain's VAO code. OpenGL resources seems already to be doing deferred deletion, need to do the same for CPU side arrays.
Diffstat (limited to 'intern')
-rw-r--r--intern/gawain/src/gwn_vertex_array_id.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/gawain/src/gwn_vertex_array_id.cpp b/intern/gawain/src/gwn_vertex_array_id.cpp
index ed54562c434..ad60dea7542 100644
--- a/intern/gawain/src/gwn_vertex_array_id.cpp
+++ b/intern/gawain/src/gwn_vertex_array_id.cpp
@@ -166,5 +166,7 @@ void gwn_context_add_batch(Gwn_Context* ctx, Gwn_Batch* batch)
void gwn_context_remove_batch(Gwn_Context* ctx, Gwn_Batch* batch)
{
+ ctx->orphans_mutex.lock();
ctx->batches.erase(batch);
+ ctx->orphans_mutex.unlock();
}