Blender Git Loki

Git Commits -> Revision c626462

Revision c626462 by Sergey Sharybin (master)
March 21, 2014, 12:50 (GMT)
Fix T39209: Localizing materials could cause heisenbug with concurrent
depsgraph updates.

Material datablocks were localized by first making a regular datablock
copy, which always gets inserted into the bmain list, and then removing
it again from bmain.

Problem is that this localization happens in preview threads, which can
run while the depsgraph is also updating GPU materials. In case the
copying of materials takes any amount of time, this can cause the
depsgraph call to material_changed to use an invalid, localized material
and access invalid GPUMaterial lists which have already been freed for
the actual material.

Solution is to not add localized datablocks to the bmain lists in the
first place. bmain should be totally immutable during preview or render
threads.

Commit Details:

Full Hash: c626462c0fe1257c07948b49db1a41526682ba3f
Parent Commit: 7148c97
Committed By: Lukas Toenne
Lines Changed: +29, -2

4 Modified Paths:

/source/blender/blenkernel/BKE_library.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/library.c (+26, -0) (Diff)
/source/blender/blenkernel/intern/mask.c (+1, -0) (Diff)
/source/blender/blenkernel/intern/material.c (+1, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021