summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llrender/llgl.cpp3
-rw-r--r--indra/llui/llfloater.cpp3
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llface.cpp4
-rw-r--r--indra/newview/llface.h6
-rw-r--r--indra/newview/llhudnametag.cpp27
-rw-r--r--indra/newview/llhudnametag.h2
-rw-r--r--indra/newview/llviewerdisplay.cpp2
-rw-r--r--indra/newview/llviewertexturelist.cpp129
-rw-r--r--indra/newview/llvoicevisualizer.cpp2
-rw-r--r--indra/newview/llvovolume.cpp1
11 files changed, 93 insertions, 88 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 7959b3bb57..c14efe8ab4 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -2742,7 +2742,7 @@ LLGLDepthTest::LLGLDepthTest(GLboolean depth_enabled, GLboolean write_enabled, G
: mPrevDepthEnabled(sDepthEnabled), mPrevDepthFunc(sDepthFunc), mPrevWriteEnabled(sWriteEnabled)
{
stop_glerror();
-
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE;
checkState();
if (!depth_enabled)
@@ -2775,6 +2775,7 @@ LLGLDepthTest::LLGLDepthTest(GLboolean depth_enabled, GLboolean write_enabled, G
LLGLDepthTest::~LLGLDepthTest()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE;
checkState();
if (sDepthEnabled != mPrevDepthEnabled )
{
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index ff174d8470..6ad74c09e6 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1983,6 +1983,9 @@ void LLFloater::onClickCloseBtn(bool app_quitting)
// virtual
void LLFloater::draw()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
+ LL_PROFILE_ZONE_TEXT(getTitle().c_str(), getTitle().length());
+
const F32 alpha = getCurrentTransparency();
// draw background
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1d8cae4e95..ec06582d90 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10314,7 +10314,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>2</integer>
+ <integer>1</integer>
</map>
<key>ShowAxes</key>
<map>
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index a8001699fe..df08dcf503 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -2143,7 +2143,7 @@ F32 LLFace::getTextureVirtualSize()
face_area = mPixelArea / llclamp(texel_area, 0.015625f, 128.f);
}
- face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area) ;
+ face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area);
if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
{
if(mImportanceToCamera > LEAST_IMPORTANCE_FOR_LARGE_IMAGE && mTexture[LLRender::DIFFUSE_MAP].notNull() && mTexture[LLRender::DIFFUSE_MAP]->isLargeImage())
@@ -2161,7 +2161,6 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE;
- //VECTORIZE THIS
//get area of circle around face
LLVector4a center;
@@ -2286,6 +2285,7 @@ const F32 FACE_IMPORTANCE_TO_CAMERA_OVER_ANGLE[FACE_IMPORTANCE_LEVEL][2] = //
//static
F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE;
F32 importance = 0.f ;
if(cos_angle_to_view_dir > LLViewerCamera::getInstance()->getCosHalfFov() &&
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 7cf256f731..99642016f7 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -209,7 +209,6 @@ public:
void setDrawInfo(LLDrawInfo* draw_info);
F32 getTextureVirtualSize() ;
- F32 getImportanceToCamera()const {return mImportanceToCamera ;}
void resetVirtualSize();
void setHasMedia(bool has_media) { mHasMedia = has_media ;}
@@ -265,6 +264,11 @@ public:
// return mSkinInfo->mHash or 0 if mSkinInfo is null
U64 getSkinHash();
+ // true if face was recently in the main camera frustum according to LLViewerTextureList updates
+ bool mInFrustum = false;
+ // value of gFrameCount the last time the face was touched by LLViewerTextureList::updateImageDecodePriority
+ U32 mLastTextureUpdate = 0;
+
private:
LLPointer<LLVertexBuffer> mVertexBuffer;
LLPointer<LLVertexBuffer> mVertexBufferGLTF;
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 205089c662..11f049564a 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -229,35 +229,20 @@ void LLHUDNameTag::render()
if (sDisplayText)
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
- //LLGLDisable gls_stencil(GL_STENCIL_TEST);
- renderText(false);
+ renderText();
}
}
-void LLHUDNameTag::renderText(bool for_select)
+void LLHUDNameTag::renderText()
{
if (!mVisible || mHidden)
{
return;
}
- // don't pick text that isn't bound to a viewerobject
- if (for_select &&
- (!mSourceObject || mSourceObject->mDrawable.isNull()))
- {
- return;
- }
-
- if (for_select)
- {
- gGL.getTexUnit(0)->disable();
- }
- else
- {
- gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
- }
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
- LLGLState gls_blend(GL_BLEND, !for_select);
+ gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
F32 alpha_factor = 1.f;
@@ -393,10 +378,6 @@ void LLHUDNameTag::renderText(bool for_select)
}
/// Reset the default color to white. The renderer expects this to be the default.
gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f);
- if (for_select)
- {
- gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
- }
}
void LLHUDNameTag::setString(const std::string &text_utf8)
diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h
index 9abd8f33cc..5cb7fa877e 100644
--- a/indra/newview/llhudnametag.h
+++ b/indra/newview/llhudnametag.h
@@ -145,7 +145,7 @@ protected:
LLHUDNameTag(const U8 type);
/*virtual*/ void render();
- void renderText(bool for_select);
+ void renderText();
static void updateAll();
void setLOD(S32 lod);
S32 getMaxLines();
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 8c6a38876a..9bd0973cc0 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1502,6 +1502,7 @@ void draw_axes()
void render_ui_3d()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
LLGLSPipeline gls_pipeline;
//////////////////////////////////////
@@ -1550,6 +1551,7 @@ void render_ui_3d()
void render_ui_2d()
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
LLGLSUIDefault gls_ui;
/////////////////////////////////////////////////////////////
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 53b054cb24..2df60dbf6c 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -889,79 +889,90 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
{
llassert(!gCubeSnapshot);
- static LLCachedControl<F32> bias_distance_scale(gSavedSettings, "TextureBiasDistanceScale", 1.f);
- static LLCachedControl<F32> texture_scale_min(gSavedSettings, "TextureScaleMinAreaFactor", 0.04f);
- static LLCachedControl<F32> texture_scale_max(gSavedSettings, "TextureScaleMaxAreaFactor", 25.f);
+ if (imagep->getBoostLevel() < LLViewerFetchedTexture::BOOST_HIGH) // don't bother checking face list for boosted textures
+ {
+ static LLCachedControl<F32> bias_distance_scale(gSavedSettings, "TextureBiasDistanceScale", 1.f);
+ static LLCachedControl<F32> texture_scale_min(gSavedSettings, "TextureScaleMinAreaFactor", 0.04f);
+ static LLCachedControl<F32> texture_scale_max(gSavedSettings, "TextureScaleMaxAreaFactor", 25.f);
+ F32 max_vsize = 0.f;
+ bool on_screen = false;
- F32 max_vsize = 0.f;
- bool on_screen = false;
+ U32 face_count = 0;
- LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
- {
- for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi)
- {
- LLFace* face = (*(imagep->getFaceList(i)))[fi];
+ F32 bias = (F32) llroundf(powf(4, LLViewerTexture::sDesiredDiscardBias - 1.f));
- if (face && face->getViewerObject())
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
+ for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
+ {
+ for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi)
{
- F32 radius;
- F32 cos_angle_to_view_dir;
- static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f);
- F32 vsize = face->getPixelArea();
- bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
-
- on_screen = in_frustum;
-
- // Scale desired texture resolution higher or lower depending on texture scale
- //
- // Minimum usage examples: a 1024x1024 texture with aplhabet, runing string
- // shows one letter at a time
- //
- // Maximum usage examples: huge chunk of terrain repeats texture
- S32 te_offset = face->getTEOffset(); // offset is -1 if not inited
- LLViewerObject* objp = face->getViewerObject();
- const LLTextureEntry* te = (te_offset < 0 || te_offset >= objp->getNumTEs()) ? nullptr : objp->getTE(te_offset);
- F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f;
- min_scale = llclamp(min_scale * min_scale, texture_scale_min(), texture_scale_max());
- vsize /= min_scale;
-
- // if bias is > 2, apply to on-screen textures as well
- bool apply_bias = LLViewerTexture::sDesiredDiscardBias > 2.f;
-
- // apply bias to off screen objects or objects that are small on screen all the time
- if (!in_frustum || !face->getDrawable()->isVisible() || face->getImportanceToCamera() < bias_unimportant_threshold)
- { // further reduce by discard bias when off screen or occluded
- apply_bias = true;
- }
+ LLFace* face = (*(imagep->getFaceList(i)))[fi];
- if (apply_bias)
+ if (face && face->getViewerObject())
{
- F32 bias = powf(4, LLViewerTexture::sDesiredDiscardBias - 1.f);
- bias = (F32) llround(bias);
- vsize /= bias;
+ ++face_count;
+ F32 radius;
+ F32 cos_angle_to_view_dir;
+ static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f);
+
+ if ((gFrameCount - face->mLastTextureUpdate) > 10)
+ { // only call calcPixelArea at most once every 10 frames for a given face
+ // this helps eliminate redundant calls to calcPixelArea for faces that have multiple textures
+ // assigned to them, such as is the case with GLTF materials or Blinn-Phong materials
+ face->mInFrustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
+ face->mLastTextureUpdate = gFrameCount;
+ }
+
+ F32 vsize = face->getPixelArea();
+
+ on_screen = face->mInFrustum;
+
+ // Scale desired texture resolution higher or lower depending on texture scale
+ //
+ // Minimum usage examples: a 1024x1024 texture with aplhabet, runing string
+ // shows one letter at a time
+ //
+ // Maximum usage examples: huge chunk of terrain repeats texture
+ // TODO: make this work with the GLTF texture transforms
+ S32 te_offset = face->getTEOffset(); // offset is -1 if not inited
+ LLViewerObject* objp = face->getViewerObject();
+ const LLTextureEntry* te = (te_offset < 0 || te_offset >= objp->getNumTEs()) ? nullptr : objp->getTE(te_offset);
+ F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f;
+ min_scale = llclamp(min_scale * min_scale, texture_scale_min(), texture_scale_max());
+ vsize /= min_scale;
+
+ // apply bias to offscreen faces all the time, but only to onscreen faces when bias is large
+ if (!face->mInFrustum || LLViewerTexture::sDesiredDiscardBias > 2.f)
+ {
+ vsize /= bias;
+ }
+
+ max_vsize = llmax(max_vsize, vsize);
}
-
- max_vsize = llmax(max_vsize, vsize);
}
}
- }
- if (imagep->getType() == LLViewerTexture::LOD_TEXTURE && imagep->getBoostLevel() == LLViewerTexture::BOOST_NONE)
- { // conditionally reset max virtual size for unboosted LOD_TEXTURES
- // this is an alternative to decaying mMaxVirtualSize over time
- // that keeps textures from continously downrezzing and uprezzing in the background
-
- if (LLViewerTexture::sDesiredDiscardBias > 2.f ||
- (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f))
- {
- imagep->mMaxVirtualSize = 0.f;
+ if (face_count > 1024)
+ { // this texture is used in so many places we should just boost it and not bother checking its vsize
+ // this is especially important because the above is not time sliced and can hit multiple ms for a single texture
+ imagep->setBoostLevel(LLViewerFetchedTexture::BOOST_HIGH);
}
- }
+ if (imagep->getType() == LLViewerTexture::LOD_TEXTURE && imagep->getBoostLevel() == LLViewerTexture::BOOST_NONE)
+ { // conditionally reset max virtual size for unboosted LOD_TEXTURES
+ // this is an alternative to decaying mMaxVirtualSize over time
+ // that keeps textures from continously downrezzing and uprezzing in the background
+
+ if (LLViewerTexture::sDesiredDiscardBias > 2.f ||
+ (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f))
+ {
+ imagep->mMaxVirtualSize = 0.f;
+ }
+ }
- imagep->addTextureStats(max_vsize);
+ imagep->addTextureStats(max_vsize);
+ }
#if 0
imagep->setDebugText(llformat("%d/%d - %d/%d -- %d/%d",
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp
index 305fd77126..9412136272 100644
--- a/indra/newview/llvoicevisualizer.cpp
+++ b/indra/newview/llvoicevisualizer.cpp
@@ -342,6 +342,8 @@ void LLVoiceVisualizer::render()
return;
}
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
+
if ( mSoundSymbol.mActive )
{
mPreviousTime = mCurrentTime;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index dcaf85b894..b7738b9135 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3219,6 +3219,7 @@ void LLVOVolume::updateSpotLightPriority()
{
return;
}
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
F32 r = getLightRadius();
LLVector3 pos = mDrawable->getPositionAgent();