Fix a multithreading crash caused by modification of live Geometry

0.6.1
scrawl 8 years ago
parent 2873c10284
commit d8505e4f48

@ -318,9 +318,9 @@ namespace Shader
const ShaderRequirements& reqs = mRequirements.back();
bool useShader = reqs.mShaderRequired || mForceShaders;
bool generateTangents = reqs.mTexStageRequiringTangents != -1 && mAllowedToModifyStateSets;
bool generateTangents = reqs.mTexStageRequiringTangents != -1;
if (useShader || generateTangents)
if (mAllowedToModifyStateSets && (useShader || generateTangents))
{
osg::ref_ptr<osg::Geometry> sourceGeometry = &geometry;
SceneUtil::RigGeometry* rig = dynamic_cast<SceneUtil::RigGeometry*>(&geometry);
@ -329,8 +329,6 @@ namespace Shader
bool requiresSetGeometry = false;
if (mAllowedToModifyStateSets)
{
// make sure that all UV sets are there
for (std::map<int, std::string>::const_iterator it = reqs.mTextures.begin(); it != reqs.mTextures.end(); ++it)
{
@ -340,7 +338,6 @@ namespace Shader
requiresSetGeometry = true;
}
}
}
if (generateTangents)
{

Loading…
Cancel
Save