diff options
| author | Cosmic Linden <cosmic@lindenlab.com> | 2024-04-10 09:59:18 -0700 | 
|---|---|---|
| committer | Cosmic Linden <cosmic@lindenlab.com> | 2024-04-10 15:34:48 -0700 | 
| commit | b7b962affd12d8559d3dcf8a70533548df8d6f25 (patch) | |
| tree | 2a6b94bec790b6ae74331bc23bd024b8fd7bc795 | |
| parent | 7c92398cf6d0c588a9e3504f107eb1d513877234 (diff) | |
viewer#1163: Unboost terrain textures when done to allow deletion
| -rw-r--r-- | indra/newview/llvlcomposition.cpp | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 234b24e440..6c0691c6a9 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -69,6 +69,11 @@ namespace          if (!tex) { return; }          tex->setBoostLevel(LLGLTexture::BOOST_NONE);          tex->setMinDiscardLevel(MAX_DISCARD_LEVEL + 1); + +        if (tex->getTextureState() == LLGLTexture::NO_DELETE) +        { +            tex->forceActive(); +        }      }      void unboost_minimap_material(LLPointer<LLFetchedGLTFMaterial>& mat) @@ -91,6 +96,11 @@ LLTerrainMaterials::LLTerrainMaterials()  LLTerrainMaterials::~LLTerrainMaterials()  { +    for (S32 i = 0; i < ASSET_COUNT; ++i) +    { +        unboost_minimap_texture(mDetailTextures[i]); +        unboost_minimap_material(mDetailMaterials[i]); +    }  }  BOOL LLTerrainMaterials::generateMaterials() @@ -131,6 +141,12 @@ LLPointer<LLViewerFetchedTexture> fetch_terrain_texture(const LLUUID& id)  void LLTerrainMaterials::setDetailAssetID(S32 asset, const LLUUID& id)  { +    // *NOTE: If there were multiple terrain swatches using the same asset +    // ID, the asset still in use will be temporarily unboosted. +    // It will be boosted again during terrain rendering. +    unboost_minimap_texture(mDetailTextures[asset]); +    unboost_minimap_material(mDetailMaterials[asset]); +  	// This is terrain texture, but we are not setting it as BOOST_TERRAIN  	// since we will be manipulating it later as needed.  	mDetailTextures[asset] = fetch_terrain_texture(id); | 
