Merge branch 'threadsafe-createchunk' into 'master'

Avoid OSG setting array binding from multiple threads

Closes #4765

See merge request OpenMW/openmw!557
pull/3044/head
psi29a 3 years ago
commit 49c828c138

@ -31,6 +31,7 @@
Bug #4623: Corprus implementation is incorrect
Bug #4631: Setting MSAA level too high doesn't fall back to highest supported level
Bug #4764: Data race in osg ParticleSystem
Bug #4765: Data race in ChunkManager -> Array::setBinding
Bug #4774: Guards are ignorant of an invisible player that tries to attack them
Bug #5101: Hostile followers travel with the player
Bug #5108: Savegame bloating due to inefficient fog textures format

@ -186,7 +186,7 @@ namespace Terrain
int vertexCount = numVerts * numVerts;
osg::ref_ptr<osg::Vec2Array> uvs (new osg::Vec2Array);
osg::ref_ptr<osg::Vec2Array> uvs (new osg::Vec2Array(osg::Array::BIND_PER_VERTEX));
uvs->reserve(vertexCount);
for (unsigned int col = 0; col < numVerts; ++col)

@ -197,8 +197,7 @@ osg::ref_ptr<osg::Node> ChunkManager::createChunk(float chunkSize, const osg::Ve
bool useCompositeMap = chunkSize >= mCompositeMapLevel;
unsigned int numUvSets = useCompositeMap ? 1 : 2;
for (unsigned int i=0; i<numUvSets; ++i)
geometry->setTexCoordArray(i, mBufferCache.getUVBuffer(numVerts));
geometry->setTexCoordArrayList(osg::Geometry::ArrayList(numUvSets, mBufferCache.getUVBuffer(numVerts)));
geometry->createClusterCullingCallback();

Loading…
Cancel
Save