Cache various frequently accessed settings (#2080)
parent
8a3c9a0b9d
commit
7ebbc58ae3
|
|
@ -209,7 +209,7 @@ LLLayoutStack::Params::Params()
|
|||
open_time_constant("open_time_constant", 0.02f),
|
||||
close_time_constant("close_time_constant", 0.03f),
|
||||
resize_bar_overlap("resize_bar_overlap", 1),
|
||||
border_size("border_size", LLCachedControl<S32>(*LLUI::getInstance()->mSettingGroups["config"], "UIResizeBarHeight", 0)),
|
||||
border_size("border_size", LLUI::getInstance()->mSettingGroups["config"]->getS32("UIResizeBarHeight")),
|
||||
show_drag_handle("show_drag_handle", false),
|
||||
drag_handle_first_indent("drag_handle_first_indent", 0),
|
||||
drag_handle_second_indent("drag_handle_second_indent", 0),
|
||||
|
|
|
|||
|
|
@ -1931,7 +1931,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
|
|||
}
|
||||
else
|
||||
{
|
||||
LLCachedControl<F32> dynamic_camera_strength(gSavedSettings, "DynamicCameraStrength");
|
||||
static LLCachedControl<F32> dynamic_camera_strength(gSavedSettings, "DynamicCameraStrength");
|
||||
target_lag = vel * dynamic_camera_strength / 30.f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,19 +99,11 @@ LLVOAvatar *LLControlAvatar::getAttachedAvatar()
|
|||
|
||||
void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const
|
||||
{
|
||||
F32 max_legal_offset = MAX_LEGAL_OFFSET;
|
||||
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalOffset"))
|
||||
{
|
||||
max_legal_offset = gSavedSettings.getF32("AnimatedObjectsMaxLegalOffset");
|
||||
}
|
||||
max_legal_offset = llmax(max_legal_offset,0.f);
|
||||
static LLCachedControl<F32> anim_max_legal_offset(gSavedSettings, "AnimatedObjectsMaxLegalOffset", MAX_LEGAL_OFFSET);
|
||||
F32 max_legal_offset = llmax(anim_max_legal_offset(), 0.f);
|
||||
|
||||
F32 max_legal_size = MAX_LEGAL_SIZE;
|
||||
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalSize"))
|
||||
{
|
||||
max_legal_size = gSavedSettings.getF32("AnimatedObjectsMaxLegalSize");
|
||||
}
|
||||
max_legal_size = llmax(max_legal_size, 1.f);
|
||||
static LLCachedControl<F32> anim_max_legal_size(gSavedSettings, "AnimatedObjectsMaxLegalSize", MAX_LEGAL_SIZE);
|
||||
F32 max_legal_size = llmax(anim_max_legal_size(), 1.f);
|
||||
|
||||
new_pos_fixup = LLVector3();
|
||||
new_scale_fixup = 1.0f;
|
||||
|
|
@ -419,7 +411,8 @@ bool LLControlAvatar::updateCharacter(LLAgent &agent)
|
|||
//virtual
|
||||
void LLControlAvatar::updateDebugText()
|
||||
{
|
||||
if (gSavedSettings.getBOOL("DebugAnimatedObjects"))
|
||||
static LLCachedControl<bool> debug_animated_objects(gSavedSettings, "DebugAnimatedObjects");
|
||||
if (debug_animated_objects)
|
||||
{
|
||||
S32 total_linkset_count = 0;
|
||||
if (mRootVolp)
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
|
|||
forwardRender();
|
||||
|
||||
// final pass, render to depth for depth of field effects
|
||||
if (!LLPipeline::sImpostorRender && gSavedSettings.getBOOL("RenderDepthOfField") && !gCubeSnapshot && !LLPipeline::sRenderingHUDs && getType() == LLDrawPool::POOL_ALPHA_POST_WATER)
|
||||
if (!LLPipeline::sImpostorRender && LLPipeline::RenderDepthOfField && !gCubeSnapshot && !LLPipeline::sRenderingHUDs && getType() == LLDrawPool::POOL_ALPHA_POST_WATER)
|
||||
{
|
||||
//update depth buffer sampler
|
||||
simple_shader = fullbright_shader = &gDeferredFullbrightAlphaMaskProgram;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ U32 LLDrawPoolTerrain::getVertexDataMask()
|
|||
|
||||
void LLDrawPoolTerrain::prerender()
|
||||
{
|
||||
sPBRDetailMode = gSavedSettings.getS32("RenderTerrainPBRDetail");
|
||||
static LLCachedControl<S32> render_terrain_pbr_detail(gSavedSettings, "RenderTerrainPBRDetail");
|
||||
sPBRDetailMode = render_terrain_pbr_detail;
|
||||
}
|
||||
|
||||
void LLDrawPoolTerrain::boostTerrainDetailTextures()
|
||||
|
|
|
|||
|
|
@ -1685,9 +1685,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
|
|||
file.read(buffer, bytes);
|
||||
if (headerReceived(mesh_params, buffer, bytes) == MESH_OK)
|
||||
{
|
||||
std::string mid;
|
||||
mesh_params.getSculptID().toString(mid);
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mid << " - was retrieved from the cache." << LL_ENDL;
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mesh_params.getSculptID() << " - was retrieved from the cache." << LL_ENDL;
|
||||
|
||||
// Found mesh in cache
|
||||
return true;
|
||||
|
|
@ -1703,9 +1701,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
|
|||
|
||||
if (!http_url.empty())
|
||||
{
|
||||
std::string mid;
|
||||
mesh_params.getSculptID().toString(mid);
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mid << " - was retrieved from the simulator." << LL_ENDL;
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mesh_params.getSculptID() << " - was retrieved from the simulator." << LL_ENDL;
|
||||
|
||||
//grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits
|
||||
//within the first 4KB
|
||||
|
|
@ -1793,9 +1789,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
|
|||
{
|
||||
delete[] buffer;
|
||||
|
||||
std::string mid;
|
||||
mesh_id.toString(mid);
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mid << " - was retrieved from the cache." << LL_ENDL;
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the cache." << LL_ENDL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1810,9 +1804,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
|
|||
|
||||
if (!http_url.empty())
|
||||
{
|
||||
std::string mid;
|
||||
mesh_id.toString(mid);
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mid << " - was retrieved from the simulator." << LL_ENDL;
|
||||
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the simulator." << LL_ENDL;
|
||||
|
||||
LLMeshHandlerBase::ptr_t handler(new LLMeshLODHandler(mesh_params, lod, offset, size));
|
||||
LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler);
|
||||
|
|
@ -4607,7 +4599,8 @@ F32 LLMeshRepository::getStreamingCostLegacy(LLMeshHeader& header, F32 radius, S
|
|||
*unscaled_value = weighted_avg;
|
||||
}
|
||||
|
||||
return weighted_avg/gSavedSettings.getU32("MeshTriangleBudget")*15000.f;
|
||||
static LLCachedControl<U32> mesh_triangle_budget(gSavedSettings, "MeshTriangleBudget");
|
||||
return weighted_avg / mesh_triangle_budget * 15000.f;
|
||||
}
|
||||
|
||||
LLMeshCostData::LLMeshCostData()
|
||||
|
|
@ -4758,7 +4751,8 @@ F32 LLMeshCostData::getEstTrisForStreamingCost()
|
|||
|
||||
F32 LLMeshCostData::getRadiusBasedStreamingCost(F32 radius)
|
||||
{
|
||||
return getRadiusWeightedTris(radius)/gSavedSettings.getU32("MeshTriangleBudget")*15000.f;
|
||||
static LLCachedControl<U32> mesh_triangle_budget(gSavedSettings, "MeshTriangleBudget");
|
||||
return getRadiusWeightedTris(radius)/mesh_triangle_budget*15000.f;
|
||||
}
|
||||
|
||||
F32 LLMeshCostData::getTriangleBasedStreamingCost()
|
||||
|
|
@ -5334,8 +5328,9 @@ bool LLMeshRepository::meshUploadEnabled()
|
|||
|
||||
bool LLMeshRepository::meshRezEnabled()
|
||||
{
|
||||
static LLCachedControl<bool> mesh_enabled(gSavedSettings, "MeshEnabled");
|
||||
LLViewerRegion *region = gAgent.getRegion();
|
||||
if(gSavedSettings.getBOOL("MeshEnabled") &&
|
||||
if(mesh_enabled &&
|
||||
region)
|
||||
{
|
||||
return region->meshRezEnabled();
|
||||
|
|
|
|||
|
|
@ -1596,7 +1596,7 @@ void render_ui_2d()
|
|||
}
|
||||
|
||||
|
||||
if (gSavedSettings.getBOOL("RenderUIBuffer"))
|
||||
if (LLPipeline::RenderUIBuffer)
|
||||
{
|
||||
if (LLView::sIsRectDirty)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2675,7 +2675,7 @@ void LLViewerWindow::draw()
|
|||
|
||||
//S32 screen_x, screen_y;
|
||||
|
||||
if (!gSavedSettings.getBOOL("RenderUIBuffer"))
|
||||
if (!LLPipeline::RenderUIBuffer)
|
||||
{
|
||||
LLView::sDirtyRect = getWindowRectScaled();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4070,12 +4070,14 @@ void LLVOAvatar::updateDebugText()
|
|||
{
|
||||
// Leave mDebugText uncleared here, in case a derived class has added some state first
|
||||
|
||||
if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
|
||||
static LLCachedControl<bool> debug_av_appearance_message(gSavedSettings, "DebugAvatarAppearanceMessage");
|
||||
if (debug_av_appearance_message)
|
||||
{
|
||||
updateAppearanceMessageDebugText();
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
|
||||
static LLCachedControl<bool> debug_av_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
|
||||
if (debug_av_composite_baked)
|
||||
{
|
||||
if (!mBakedTextureDebugText.empty())
|
||||
addDebugText(mBakedTextureDebugText);
|
||||
|
|
@ -8592,7 +8594,8 @@ LLMotion* LLVOAvatar::findMotion(const LLUUID& id) const
|
|||
// colorized if using deferred rendering.
|
||||
void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
|
||||
{
|
||||
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
|
||||
static LLCachedControl<bool> debug_av_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
|
||||
if (debug_av_composite_baked)
|
||||
{
|
||||
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
|
||||
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
|
||||
|
|
|
|||
|
|
@ -4565,7 +4565,8 @@ void LLPipeline::renderDebug()
|
|||
mReflectionMapManager.renderDebug();
|
||||
}
|
||||
|
||||
if (gSavedSettings.getBOOL("RenderReflectionProbeVolumes") && !hud_only)
|
||||
static LLCachedControl<bool> render_ref_probe_volumes(gSavedSettings, "RenderReflectionProbeVolumes");
|
||||
if (render_ref_probe_volumes && !hud_only)
|
||||
{
|
||||
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("probe debug display");
|
||||
|
||||
|
|
@ -8960,7 +8961,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
|
|||
|
||||
gGL.diffuseColor4f(1, 1, 1, 1);
|
||||
|
||||
S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
|
||||
S32 shadow_detail = RenderShadowDetail;
|
||||
|
||||
// if not using VSM, disable color writes
|
||||
if (shadow_detail <= 2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue