DRTVWR-542 Fix malfunctioning warning

master
Andrey Kleshchev 2021-07-28 21:30:49 +03:00
parent 1531a31cd9
commit 2d2ed85c56
2 changed files with 17 additions and 6 deletions

View File

@ -936,17 +936,23 @@ public:
LLVector4a* mCenter;
LLVector2 mTexCoordExtents[2]; //minimum and maximum of texture coordinates of the face.
S32 mNumVertices;
S32 mNumVertices; // num vertices == num normals == num texcoords
S32 mNumAllocatedVertices;
S32 mNumIndices;
LLVector4a* mPositions;
LLVector4a* mNormals;
LLVector4a* mPositions; // Contains vertices, nortmals and texcoords
LLVector4a* mNormals; // pointer into mPositions
LLVector4a* mTangents;
LLVector2* mTexCoords;
LLVector2* mTexCoords; // pointer into mPositions
// mIndices contains mNumIndices amount of elements.
// It contains triangles, each 3 indices describe one triangle.
// If mIndices contains {0, 2, 3, 1, 2, 4}, it means there
// are two triangles {0, 2, 3} and {1, 2, 4} with values being
// indexes for mPositions/mNormals/mTexCoords
U16* mIndices;
//vertex buffer filled in by LLFace to cache this volume face geometry in vram
// vertex buffer filled in by LLFace to cache this volume face geometry in vram
// (declared as a LLPointer to LLRefCount to avoid dependency on LLVertexBuffer)
mutable LLPointer<LLRefCount> mVertexBuffer;

View File

@ -787,7 +787,12 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
for (U32 i = 0; i < verts.size(); ++i)
{
indices[i] = vert_idx[verts[i]];
llassert(!i || (indices[i-1] != indices[i]));
if (i % 3 != 0) // assumes GL_TRIANGLES, compare 0-1, 1-2, 3-4, 4-5 but not 2-3 or 5-6
{
// A faulty degenerate triangle detection (triangle with 0 area),
// probably should be a warning and not an assert
llassert(!i || (indices[i-1] != indices[i]));
}
}
// DEBUG just build an expanded triangle list