diff options
author | Dave Parks <davep@lindenlab.com> | 2010-05-26 14:55:29 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-05-26 14:55:29 -0500 |
commit | bac3623e26d62f6e1eb3c6be1f5fcfcf69a0e714 (patch) | |
tree | ca850de918a3810904eb556c91de0d48c12649d4 | |
parent | 9008bd8bb4359aed46ea62f363c208802f48dc6d (diff) |
Faster index buffer copying.
-rw-r--r-- | indra/newview/llface.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 1 |
2 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 5cdfdbacde..26554997c0 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1165,9 +1165,21 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (full_rebuild) { mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex); - for (U32 i = 0; i < (U32) num_indices; i++) + __m128i* dst = (__m128i*) indicesp.get(); + __m128i* src = (__m128i*) vf.mIndices; + __m128i offset = _mm_set1_epi16(index_offset); + + S32 end = num_indices/8; + + for (S32 i = 0; i < end; i++) + { + __m128i res = _mm_add_epi16(src[i], offset); + _mm_storeu_si128(dst+i, res); + } + + for (S32 i = end*8; i < num_indices; ++i) { - *indicesp++ = vf.mIndices[i] + index_offset; + indicesp[i] = vf.mIndices[i]+index_offset; } } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c03ec67c79..a9f3abeef8 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3354,7 +3354,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, model_mat = &(drawable->getRegion()->mRenderMatrix); } - U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; LLViewerTexture* tex = facep->getTexture(); |