summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-02-14 02:46:24 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-02-15 19:31:41 +0200
commita2971d84d5aba0c2dcda9ec8274a5c5b72ccd67c (patch)
tree0d1f164e96fdd9aecee9bf6ae103fe561629ffd3 /indra/newview
parent17b5bc9403da9608a9ddff3f989644c98bf936a7 (diff)
Viewer#779 Make RenderMaxVRAMBudget more consistent
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llviewerwindow.cpp12
-rw-r--r--indra/newview/llviewerwindow.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 4fd422e59a..a9b4ebcc04 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9376,7 +9376,7 @@
<key>RenderMaxVRAMBudget</key>
<map>
<key>Comment</key>
- <string>Maximum amount of texture memory to budget for (in MB), or 0 for autodetect. Requires restart.</string>
+ <string>Maximum amount of texture memory to budget for (in MB), or 0 for autodetect.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 349847c57a..a218079fb5 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1864,8 +1864,16 @@ LLViewerWindow::LLViewerWindow(const Params& p)
// create window
U32 max_core_count = gSavedSettings.getU32("EmulateCoreCount");
- U32 max_vram = gSavedSettings.getU32("RenderMaxVRAMBudget");
F32 max_gl_version = gSavedSettings.getF32("RenderMaxOpenGLVersion");
+
+ LLControlVariable* vram_control = gSavedSettings.getControl("RenderMaxVRAMBudget");
+ U32 max_vram = vram_control->getValue().asInteger();
+ mMaxVRAMControlConnection = vram_control->getSignal()->connect(
+ [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val)
+ {
+ if (mWindow) mWindow->setMaxVRAMMegabytes(new_val.asInteger());
+ });
+
mWindow = LLWindowManager::createWindow(this,
p.title, p.name, p.x, p.y, p.width, p.height, 0,
@@ -2421,6 +2429,8 @@ LLViewerWindow::~LLViewerWindow()
LLViewerShaderMgr::releaseInstance();
LLViewerShaderMgr::sInitialized = FALSE;
}
+
+ mMaxVRAMControlConnection.disconnect();
}
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 96c5c3115a..3355c0cf6d 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -545,6 +545,8 @@ private:
// Object temporarily hovered over while dragging
LLPointer<LLViewerObject> mDragHoveredObject;
+ boost::signals2::connection mMaxVRAMControlConnection;
+
static LLTrace::SampleStatHandle<> sMouseVelocityStat;
};