1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 10:19:56 +00:00
openmw-tes3mp/components/nifosg
scrawl 115e563a7a Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580)
The first part of the fix is to assign VBO/EBO's upon loading the array in the Nif reader. This avoids triggering the 'addVertexBufferObjectIfRequired' code path in osg::Geometry which has the race condition when two threads add the same Array at the same time. Essentially, we want the Arrays to be 'const' when they come out of the Nif reader.

The second part of the fix is to make sure not to create empty arrays in the Nif reader (importantly, not assigning a VBO to the empty array). This empty array would be deleted when the NIFFile is cleaned up, and the detachment of the VBO assigned to it (which is still in use by other arrays) would cause threading issues.

This rare crash bug was first introduced with commit a7c5beb7c5. When using OSG dev version 3.5 the crashes were a little more prevalent, because 'addVertexBufferObjectIfRequired' in osg::Geometry is now used even when VBO's are disabled (as part of the VAO support changes).
2017-01-19 22:23:41 +01:00
..
controller.cpp Use ref_ptr 2016-08-14 16:41:33 +02:00
controller.hpp Remove debug output 2016-02-09 21:16:11 +01:00
nifloader.cpp Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580) 2017-01-19 22:23:41 +01:00
nifloader.hpp More renaming of TextureManager -> ImageManager 2016-02-05 23:10:27 +01:00
particle.cpp Implement NiSphericalCollider (Closes #3644) 2016-12-06 01:32:13 +01:00
particle.hpp Implement NiSphericalCollider (Closes #3644) 2016-12-06 01:32:13 +01:00
userdata.hpp Update comment, osgAnimation::RigGeometry is no longer used 2016-09-17 18:31:39 +02:00