LL has played with texture discard priority/bias. Giving it a trial here.
This commit is contained in:
@@ -2,33 +2,26 @@
|
||||
* @file llviewertexture.cpp
|
||||
* @brief Object which handles a received image (and associated texture(s))
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2010, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
@@ -100,6 +93,7 @@ S32 LLViewerTexture::sMaxBoundTextureMemInMegaBytes = 0;
|
||||
S32 LLViewerTexture::sMaxTotalTextureMemInMegaBytes = 0;
|
||||
S32 LLViewerTexture::sMaxDesiredTextureMemInBytes = 0 ;
|
||||
S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ;
|
||||
F32 LLViewerTexture::sCameraMovingBias = 0.0f ;
|
||||
S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size
|
||||
const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64 ;
|
||||
const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez ;
|
||||
@@ -109,6 +103,9 @@ S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA ;
|
||||
BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE ;
|
||||
F32 LLViewerTexture::sCurrentTime = 0.0f ;
|
||||
//BOOL LLViewerTexture::sUseTextureAtlas = FALSE ;
|
||||
F32 LLViewerTexture::sTexelPixelRatio = 1.0f;
|
||||
|
||||
LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF;
|
||||
|
||||
const F32 desired_discard_bias_min = -2.0f; // -max number of levels to improve image quality by
|
||||
const F32 desired_discard_bias_max = (F32)MAX_DISCARD_LEVEL; // max number of levels to reduce image quality by
|
||||
@@ -192,7 +189,12 @@ LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id)
|
||||
#endif //NEW_MEDIA_TEXTURE
|
||||
return tex ;
|
||||
}
|
||||
|
||||
|
||||
LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id)
|
||||
{
|
||||
return gTextureList.findImage(id);
|
||||
}
|
||||
|
||||
#if NEW_MEDIA_TEXTURE
|
||||
LLViewerMediaTexture* LLViewerTextureManager::findMediaTexture(const LLUUID &media_id)
|
||||
{
|
||||
@@ -406,7 +408,7 @@ void LLViewerTextureManager::cleanup()
|
||||
void LLViewerTexture::initClass()
|
||||
{
|
||||
LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture() ;
|
||||
|
||||
sTexelPixelRatio = gSavedSettings.getF32("TexelPixelRatio");
|
||||
if(gAuditTexture)
|
||||
{
|
||||
LLImageGL::setHighlightTexture(LLViewerTexture::OTHER) ;
|
||||
@@ -561,7 +563,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
|
||||
|
||||
F32 camera_moving_speed = LLViewerCamera::getInstance()->getAverageSpeed() ;
|
||||
F32 camera_angular_speed = LLViewerCamera::getInstance()->getAverageAngularSpeed();
|
||||
sCameraMovingDiscardBias = (S8)llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1) ;
|
||||
sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1);
|
||||
sCameraMovingDiscardBias = (S8)(sCameraMovingBias);
|
||||
|
||||
LLViewerTexture::sFreezeImageScalingDown = (BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < 0.75f * sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale) &&
|
||||
(BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < 0.75f * sMaxTotalTextureMemInMegaBytes * texmem_middle_bound_scale) ;
|
||||
@@ -745,6 +748,7 @@ void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) co
|
||||
mNeedsGLTexture = TRUE ;
|
||||
}
|
||||
|
||||
virtual_size *= sTexelPixelRatio;
|
||||
if(!mMaxVirtualSizeResetCounter)
|
||||
{
|
||||
//flag to reset the values because the old values are used.
|
||||
@@ -1923,6 +1927,8 @@ S32 LLViewerFetchedTexture::getCurrentDiscardLevelForFetching()
|
||||
bool LLViewerFetchedTexture::updateFetch()
|
||||
{
|
||||
static LLCachedControl<bool> textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled");
|
||||
static LLCachedControl<F32> sCameraMotionThreshold(gSavedSettings,"TextureCameraMotionThreshold");
|
||||
static LLCachedControl<S32> sCameraMotionBoost(gSavedSettings,"TextureCameraMotionBoost");
|
||||
if(textures_decode_disabled)
|
||||
{
|
||||
return false ;
|
||||
@@ -2091,14 +2097,18 @@ bool LLViewerFetchedTexture::updateFetch()
|
||||
{
|
||||
//load the texture progressively.
|
||||
S32 delta_level = (mBoostLevel > LLViewerTexture::BOOST_NONE) ? 2 : 1 ;
|
||||
if(current_discard < 0)
|
||||
if (current_discard < 0)
|
||||
{
|
||||
desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level);
|
||||
}
|
||||
else
|
||||
else if (LLViewerTexture::sCameraMovingBias < sCameraMotionThreshold)
|
||||
{
|
||||
desired_discard = llmax(desired_discard, current_discard - delta_level);
|
||||
desired_discard = llmax(desired_discard, current_discard - sCameraMotionBoost);
|
||||
}
|
||||
else
|
||||
{
|
||||
desired_discard = llmax(desired_discard, current_discard - delta_level);
|
||||
}
|
||||
|
||||
if (mIsFetching)
|
||||
{
|
||||
@@ -2166,6 +2176,17 @@ bool LLViewerFetchedTexture::updateFetch()
|
||||
return mIsFetching ? true : false;
|
||||
}
|
||||
|
||||
void LLViewerFetchedTexture::forceToDeleteRequest()
|
||||
{
|
||||
if (mHasFetcher)
|
||||
{
|
||||
LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
|
||||
mHasFetcher = FALSE;
|
||||
mIsFetching = FALSE ;
|
||||
resetTextureStats();
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerFetchedTexture::setIsMissingAsset()
|
||||
{
|
||||
if (mUrl.empty())
|
||||
|
||||
@@ -322,6 +322,7 @@ protected:
|
||||
} LLGLTextureState;
|
||||
LLGLTextureState mTextureState ;
|
||||
|
||||
static F32 sTexelPixelRatio;
|
||||
public:
|
||||
static const U32 sCurrentFileVersion;
|
||||
static S32 sImageCount;
|
||||
@@ -336,6 +337,7 @@ public:
|
||||
static S32 sMaxTotalTextureMemInMegaBytes;
|
||||
static S32 sMaxDesiredTextureMemInBytes ;
|
||||
static S8 sCameraMovingDiscardBias;
|
||||
static F32 sCameraMovingBias;
|
||||
static S32 sMaxSculptRez ;
|
||||
static S32 sMinLargeImageSize ;
|
||||
static S32 sMaxSmallImageSize ;
|
||||
@@ -343,6 +345,16 @@ public:
|
||||
static F32 sCurrentTime ;
|
||||
//static BOOL sUseTextureAtlas ;
|
||||
|
||||
enum EDebugTexels
|
||||
{
|
||||
DEBUG_TEXELS_OFF,
|
||||
DEBUG_TEXELS_CURRENT,
|
||||
DEBUG_TEXELS_DESIRED,
|
||||
DEBUG_TEXELS_FULL
|
||||
};
|
||||
|
||||
static EDebugTexels sDebugTexelsMode;
|
||||
|
||||
static LLPointer<LLViewerTexture> sNullImagep; // Null texture for non-textured objects.
|
||||
static LLPointer<LLViewerTexture> sBlackImagep; // Texture to show NOTHING (pure black)
|
||||
};
|
||||
@@ -491,6 +503,7 @@ public:
|
||||
BOOL hasFetcher() const { return mHasFetcher;}
|
||||
void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;}
|
||||
|
||||
void forceToDeleteRequest();
|
||||
protected:
|
||||
/*virtual*/ void switchToCachedImage();
|
||||
S32 getCurrentDiscardLevelForFetching() ;
|
||||
@@ -710,6 +723,7 @@ public:
|
||||
//"find-texture" just check if the texture exists, if yes, return it, otherwise return null.
|
||||
//
|
||||
static LLViewerTexture* findTexture(const LLUUID& id) ;
|
||||
static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id) ;
|
||||
#if NEW_MEDIA_TEXTURE
|
||||
static LLViewerMediaTexture* findMediaTexture(const LLUUID& id) ;
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "llviewerstats.h"
|
||||
#include "pipeline.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llagent.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -622,6 +623,11 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_MEDIA("Media");
|
||||
|
||||
void LLViewerTextureList::updateImages(F32 max_time)
|
||||
{
|
||||
if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
|
||||
{
|
||||
clearFetchingRequests();
|
||||
return;
|
||||
}
|
||||
LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec());
|
||||
|
||||
S32 global_raw_memory;
|
||||
@@ -693,6 +699,24 @@ void LLViewerTextureList::updateImages(F32 max_time)
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerTextureList::clearFetchingRequests()
|
||||
{
|
||||
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (image_priority_list_t::iterator iter = mImageList.begin();
|
||||
iter != mImageList.end(); ++iter)
|
||||
{
|
||||
LLViewerFetchedTexture* image = *iter;
|
||||
if(image->hasFetcher())
|
||||
{
|
||||
image->forceToDeleteRequest() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerTextureList::updateImagesDecodePriorities()
|
||||
{
|
||||
// Update the decode priority for N images each frame
|
||||
|
||||
@@ -2,33 +2,26 @@
|
||||
* @file llviewertexturelist.h
|
||||
* @brief Object for managing the list of images within a region
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2000-2010, Linden Research, Inc.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LL_LLVIEWERTEXTURELIST_H
|
||||
@@ -116,6 +109,8 @@ public:
|
||||
void doPreloadImages();
|
||||
void doPrefetchImages();
|
||||
|
||||
void clearFetchingRequests();
|
||||
|
||||
static S32 getMinVideoRamSetting();
|
||||
static S32 getMaxVideoRamSetting(bool get_recommended = false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user