Tracking down remaining SOX crashes

This commit is contained in:
Bradley Austin Davis 2018-01-17 12:18:39 -08:00
parent 9f6c2c3cdd
commit 25b778be1d
3 changed files with 10 additions and 4 deletions

View file

@ -611,7 +611,11 @@ void FBXReader::buildModelMesh(FBXMesh& extractedMesh, const QString& url) {
const int normalsSize = fbxMesh.normals.size() * sizeof(NormalType);
const int tangentsSize = fbxMesh.tangents.size() * sizeof(NormalType);
// If there are normals then there should be tangents
assert(normalsSize == tangentsSize);
assert(normalsSize <= tangentsSize);
if (tangentsSize > normalsSize) {
qWarning() << "Unexpected tangents in " << url;
}
const auto normalsAndTangentsSize = normalsSize + tangentsSize;
const int normalsAndTangentsStride = 2 * sizeof(NormalType);
const int colorsSize = fbxMesh.colors.size() * sizeof(ColorType);

View file

@ -102,7 +102,7 @@ void GL41Backend::do_drawInstanced(const Batch& batch, size_t paramOffset) {
_stats._DSNumTriangles += (trueNumInstances * numVertices) / 3;
_stats._DSNumDrawcalls += trueNumInstances;
} else {
glDrawArraysInstancedARB(mode, startVertex, numVertices, numInstances);
glDrawArraysInstanced(mode, startVertex, numVertices, numInstances);
_stats._DSNumTriangles += (numInstances * numVertices) / 3;
_stats._DSNumDrawcalls += numInstances;
}

View file

@ -1098,7 +1098,9 @@ void Blender::run() {
int index = blendshape.indices.at(j);
meshVertices[index] += blendshape.vertices.at(j) * vertexCoefficient;
meshNormals[index] += blendshape.normals.at(j) * normalCoefficient;
meshTangents[index] += blendshape.tangents.at(j) * normalCoefficient;
if (blendshape.tangents.size() > j) {
meshTangents[index] += blendshape.tangents.at(j) * normalCoefficient;
}
}
}
}
@ -1319,7 +1321,7 @@ void Model::setBlendedVertices(int blendNumber, const Geometry::WeakPointer& geo
normalsAndTangents.clear();
normalsAndTangents.resize(normals.size()+tangents.size());
assert(normalsAndTangents.size() == 2 * vertexCount);
// assert(normalsAndTangents.size() == 2 * vertexCount);
// Interleave normals and tangents
#if 0