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
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-11-19 21:09:24 +0300
committerJacques Lucke <jacques@blender.org>2020-11-19 21:09:24 +0300
commitdca36a8ec922bcce6bc4882cd6cba52792ed56ee (patch)
tree0216b0fb48b8cd7a82f3775c6310786163d0b3b2 /source/blender/blenkernel/BKE_pointcache.h
parente01bf7a92ecad3c64d0b1ae176f402d2638e246c (diff)
Fix T82769: remove thread local data from PTCacheMem
The issue was that the same point cache was read by multiple threads at the same time (the same object was evaluated for render and for the viewport). Both threads incremented PTCacheMem->cur which lead to the crash. The fix is to remove the PTCacheMem->cur and store it on the stack instead. This way every thread has its own cur. Reviewers: brecht Differential Revision: https://developer.blender.org/D9606
Diffstat (limited to 'source/blender/blenkernel/BKE_pointcache.h')
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index f8e04b75b3d..9285a0a30eb 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -322,9 +322,11 @@ int BKE_ptcache_data_size(int data_type);
int BKE_ptcache_mem_index_find(struct PTCacheMem *pm, unsigned int index);
/* Memory cache read/write helpers. */
-void BKE_ptcache_mem_pointers_init(struct PTCacheMem *pm);
-void BKE_ptcache_mem_pointers_incr(struct PTCacheMem *pm);
-int BKE_ptcache_mem_pointers_seek(int point_index, struct PTCacheMem *pm);
+void BKE_ptcache_mem_pointers_init(struct PTCacheMem *pm, void *cur[BPHYS_TOT_DATA]);
+void BKE_ptcache_mem_pointers_incr(void *cur[BPHYS_TOT_DATA]);
+int BKE_ptcache_mem_pointers_seek(int point_index,
+ struct PTCacheMem *pm,
+ void *cur[BPHYS_TOT_DATA]);
/* Main cache reading call. */
int BKE_ptcache_read(PTCacheID *pid, float cfra, bool no_extrapolate_old);