diff options
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 39 |
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(); +} |