summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmapmanager.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-12-09 16:34:28 -0500
committerNat Goodspeed <nat@lindenlab.com>2022-12-09 16:34:28 -0500
commitf41278082f2ab204ec60c15ee1530ca4440937a5 (patch)
treec382bb0e6cde299e853d09b19a47f1d82dc537fa /indra/newview/llreflectionmapmanager.cpp
parentfc424a0db90fd2d2e44e85a19750ad6eaa57b28a (diff)
parente3b34fec6962e6deda3dd9dd83bf9fa20ab594af (diff)
SL-18809: Merge 'DRTVWR-559' of secondlife/viewer into sl-18809
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r--indra/newview/llreflectionmapmanager.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 8282aa2507..088b83a8e9 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -41,6 +41,11 @@ extern BOOL gTeleportDisplay;
LLReflectionMapManager::LLReflectionMapManager()
{
+ initCubeFree();
+}
+
+void LLReflectionMapManager::initCubeFree()
+{
for (int i = 1; i < LL_MAX_REFLECTION_PROBE_COUNT; ++i)
{
mCubeFree[i] = true;
@@ -50,12 +55,6 @@ LLReflectionMapManager::LLReflectionMapManager()
mCubeFree[0] = false;
}
-struct CompareReflectionMapDistance
-{
-
-};
-
-
struct CompareProbeDistance
{
bool operator()(const LLPointer<LLReflectionMap>& lhs, const LLPointer<LLReflectionMap>& rhs)
@@ -79,7 +78,6 @@ void LLReflectionMapManager::update()
return;
}
- // =============== TODO -- move to an init function =================
initReflectionMaps();
if (!mRenderTarget.isComplete())
@@ -918,3 +916,30 @@ void LLReflectionMapManager::initReflectionMaps()
mVertexBuffer = buff;
}
}
+
+void LLReflectionMapManager::cleanup()
+{
+ mVertexBuffer = nullptr;
+ mRenderTarget.release();
+
+ mMipChain.clear();
+
+ mTexture = nullptr;
+ mIrradianceMaps = nullptr;
+
+ mProbes.clear();
+ mKillList.clear();
+ mCreateList.clear();
+
+ mReflectionMaps.clear();
+ mUpdatingFace = 0;
+
+ mDefaultProbe = nullptr;
+ mUpdatingProbe = nullptr;
+
+ glDeleteBuffers(1, &mUBO);
+ mUBO = 0;
+
+ // note: also called on teleport (not just shutdown), so make sure we're in a good "starting" state
+ initCubeFree();
+}