diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index e8ad813ed2722c45be72a819612ffa6da1a88fb3..088b83a8e92c307efda8505ed47ce2692be9a2f8 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -40,6 +40,11 @@ extern BOOL gCubeSnapshot; extern BOOL gTeleportDisplay; LLReflectionMapManager::LLReflectionMapManager() +{ + initCubeFree(); +} + +void LLReflectionMapManager::initCubeFree() { for (int i = 1; i < LL_MAX_REFLECTION_PROBE_COUNT; ++i) { @@ -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 4e2ff7c751967f32be8978d5474ebee77328d9f6..14a6c089da8fbae5dea0600d5efec07d16687bd6 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -97,6 +97,9 @@ class alignas(16) LLReflectionMapManager 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 2d4db48ac55fa34f249eed4c0bcb86e7a1976a59..2f3aa1238ea443aff4d9a382a8e2beef40497343 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)