diff options
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 63951be828..14c33b9d8e 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -1264,13 +1264,18 @@ void LLReflectionMapManager::initReflectionMaps() mProbeResolution = nhpo2(llclamp(gSavedSettings.getU32("RenderReflectionProbeResolution"), (U32)64, (U32)512)); mMaxProbeLOD = log2f(mProbeResolution) - 1.f; // number of mips - 1 - mTexture = new LLCubeMapArray(); + if (mTexture.isNull() || + mTexture->getWidth() != mProbeResolution || + mReflectionProbeCount + 2 != mTexture->getCount()) + { + mTexture = new LLCubeMapArray(); - // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation source) - mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2); + // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation source) + mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2); - mIrradianceMaps = new LLCubeMapArray(); - mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, FALSE); + mIrradianceMaps = new LLCubeMapArray(); + mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, FALSE); + } // reset probe state mUpdatingFace = 0; @@ -1278,6 +1283,9 @@ void LLReflectionMapManager::initReflectionMaps() mRadiancePass = false; mRealtimeRadiancePass = false; + // if default probe already exists, remember whether or not it's complete (SL-20498) + bool default_complete = mDefaultProbe.isNull() ? false : mDefaultProbe->mComplete; + for (auto& probe : mProbes) { probe->mLastUpdateTime = 0.f; @@ -1305,6 +1313,8 @@ void LLReflectionMapManager::initReflectionMaps() mDefaultProbe->mDistance = 64.f; mDefaultProbe->mRadius = 4096.f; mDefaultProbe->mProbeIndex = 0; + mDefaultProbe->mComplete = default_complete; + touch_default_probe(mDefaultProbe); } |