summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-11-29 20:33:13 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-11-29 20:33:13 +0200
commit27e4e245d948e4d11f78a272d969b533cfe65fbf (patch)
treeeeef5d10decb9caa671eb8d9e42b02a4c11a6b72 /indra/llmath
parent7a0ca277f82acd2511a5dbf33956c1665d14b957 (diff)
parentcba1daaf6be4dfd031cd10d9aea07c7124d32726 (diff)
Merge branch 'DRTVWR-542-meshopt' into DRTVWR-546
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp4
-rw-r--r--indra/llmath/llvolume.h16
2 files changed, 13 insertions, 7 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 130f30bedc..c226315e5c 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -6348,9 +6348,9 @@ void LLVolumeFace::resizeVertices(S32 num_verts)
if (num_verts)
{
//pad texture coordinate block end to allow for QWORD reads
- S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
+ S32 tc_size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
- mPositions = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size);
+ mPositions = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+tc_size);
mNormals = mPositions+num_verts;
mTexCoords = (LLVector2*) (mNormals+num_verts);
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index a77e8c08c6..c0b224b1ff 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -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;