diff options
| -rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 16 | ||||
| -rw-r--r-- | indra/newview/llreflectionmapmanager.h | 3 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 2 | 
3 files changed, 14 insertions, 7 deletions
| diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index e8ad813ed2..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()) @@ -937,7 +935,11 @@ void LLReflectionMapManager::cleanup()      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();  } diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 4e2ff7c751..14a6c089da 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -97,6 +97,9 @@ public:  private:      friend class LLPipeline; +    // initialize mCubeFree array to default values +    void initCubeFree(); +      // delete the probe with the given index in mProbes      void deleteProbe(U32 i); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2d4db48ac5..2f3aa1238e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7405,6 +7405,8 @@ void LLPipeline::doResetVertexBuffers(bool forced)  	LLVOPartGroup::destroyGL();      gGL.resetVertexBuffer(); +    mReflectionMapManager.cleanup(); +  	SUBSYSTEM_CLEANUP(LLVertexBuffer);  	if (LLVertexBuffer::sGLCount != 0) | 
