summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 9dfa9a0efd..3f06fe3320 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -55,7 +55,6 @@
#include "llmemory.h"
#include "llparcel.h"
#include "llperfstats.h"
-#include "llpostprocess.h"
#include "llrender.h"
#include "llscenemonitor.h"
#include "llsdjson.h"
@@ -217,9 +216,10 @@ void display_update_camera()
{
final_far *= 0.5f;
}
- else if (LLViewerTexture::sDesiredDiscardBias > 2.f)
+ // When system memory is critically low or recovering, shrink draw distance.
+ else if (const F32 mem_factor = LLMemory::getSystemMemoryBudgetFactor(); mem_factor > 1.f)
{
- final_far = llmax(32.f, final_far / (LLViewerTexture::sDesiredDiscardBias - 1.f));
+ final_far = llmax(32.f, final_far / mem_factor);
}
LLViewerCamera::getInstance()->setFar(final_far);
LLVOAvatar::sRenderDistance = llclamp(final_far, 16.f, 256.f);
@@ -1074,7 +1074,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
LLGLSLShader::finishProfile(stats);
auto report_name = getProfileStatsFilename();
- std::ofstream outf(report_name);
+ llofstream outf(report_name);
if (! outf)
{
LL_WARNS() << "Couldn't write to " << std::quoted(report_name) << LL_ENDL;
@@ -1140,15 +1140,12 @@ std::string getProfileStatsFilename()
// same second), may produce (e.g.) sec==61, but avoids collisions and
// preserves chronological filename sort order.
std::string name;
- std::error_code ec;
do
{
// base + missing 2-digit seconds, append ".json"
// post-increment sec in case we have to try again
name = stringize(base, std::setw(2), std::setfill('0'), sec++, ".json");
- } while (std::filesystem::exists(fsyspath(name), ec));
- // Ignoring ec means we might potentially return a name that does already
- // exist -- but if we can't check its existence, what more can we do?
+ } while (LLFile::exists(name));
return name;
}