summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-16 16:25:26 -0500
committerDave Parks <davep@lindenlab.com>2022-09-16 16:25:26 -0500
commit8dc59e5ef37836b15d478fb0d04e3043a9f986de (patch)
tree5d94ac257d5ea6639839d84129c0da572fa86d89 /indra/llmath/llvolume.cpp
parent5a3631659fb4fe8c2b70c90c490a6c7e486289e9 (diff)
SL-18128 Clear out much OpenGL cruft and switch to core profile on AMD
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index ae753fc0f3..559d790d77 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2783,7 +2783,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
}
}
- if (!cacheOptimize())
+ if (!cacheOptimize(true))
{
// Out of memory?
LL_WARNS() << "Failed to optimize!" << LL_ENDL;
@@ -2824,11 +2824,11 @@ void LLVolume::copyVolumeFaces(const LLVolume* volume)
mSculptLevel = 0;
}
-bool LLVolume::cacheOptimize()
+bool LLVolume::cacheOptimize(bool gen_tangents)
{
for (S32 i = 0; i < mVolumeFaces.size(); ++i)
{
- if (!mVolumeFaces[i].cacheOptimize())
+ if (!mVolumeFaces[i].cacheOptimize(gen_tangents))
{
return false;
}
@@ -5478,18 +5478,13 @@ struct MikktData
};
-bool LLVolumeFace::cacheOptimize()
+bool LLVolumeFace::cacheOptimize(bool gen_tangents)
{ //optimize for vertex cache according to Forsyth method:
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
llassert(!mOptimized);
mOptimized = TRUE;
- if (!mNormals || !mTexCoords)
- { // can't perform this operation without normals and texture coordinates
- return false;
- }
-
- if (mMikktSpaceTangents == nullptr)
+ if (mMikktSpaceTangents == nullptr && gen_tangents && mNormals && mTexCoords)
{ // make sure to generate mikkt space tangents for cache optimizing since the index buffer may change
allocateTangents(mNumVertices, true);