summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp123
1 files changed, 88 insertions, 35 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b1441cc281..5893259d96 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -528,8 +528,8 @@ public:
addText(xpos,ypos, llformat("%s streaming cost: %.1f", label, cost));
ypos += y_inc;
- addText(xpos, ypos, llformat(" %.1f KTris, %.1f/%.1f KB, %d objects",
- count/1024.f, visible_bytes/1024.f, total_bytes/1024.f, object_count));
+ addText(xpos, ypos, llformat(" %.3f KTris, %.1f/%.1f KB, %d objects",
+ count/1000.f, visible_bytes/1024.f, total_bytes/1024.f, object_count));
ypos += y_inc;
}
@@ -662,6 +662,17 @@ public:
addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3]));
ypos += y_inc;
}
+
+ if (gSavedSettings.getBOOL("DebugShowPrivateMem"))
+ {
+ LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ;
+ addText(xpos, ypos, llformat("Total Reserved(KB): %d", LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024));
+ ypos += y_inc;
+
+ addText(xpos, ypos, llformat("Total Allocated(KB): %d", LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024));
+ ypos += y_inc;
+ }
+
// only display these messages if we are actually rendering beacons at this moment
if (LLPipeline::getRenderBeacons(NULL) && LLFloaterReg::instanceVisible("beacons"))
{
@@ -726,19 +737,6 @@ public:
}
}
- if (gSavedSettings.getBOOL("DebugShowUploadCost"))
- {
- addText(xpos, ypos, llformat(" Meshes: L$%d", gPipeline.mDebugMeshUploadCost));
- ypos += y_inc/2;
- addText(xpos, ypos, llformat(" Sculpties: L$%d", gPipeline.mDebugSculptUploadCost));
- ypos += y_inc/2;
- addText(xpos, ypos, llformat(" Textures: L$%d", gPipeline.mDebugTextureUploadCost));
- ypos += y_inc/2;
- addText(xpos, ypos, "Upload Cost: ");
-
- ypos += y_inc;
- }
-
//temporary hack to give feedback on mesh upload progress
if (!gMeshRepo.mUploads.empty())
{
@@ -747,10 +745,8 @@ public:
{
LLMeshUploadThread* thread = *iter;
- addText(xpos, ypos, llformat("Mesh Upload -- price quote: %d:%d | upload: %d:%d | create: %d",
- thread->mPendingConfirmations, thread->mUploadQ.size()+thread->mTextureQ.size(),
- thread->mPendingUploads, thread->mConfirmedQ.size()+thread->mConfirmedTextureQ.size(),
- thread->mInstanceQ.size()));
+ addText(xpos, ypos, llformat("Mesh Uploads: %d",
+ thread->mPendingUploads));
ypos += y_inc;
}
}
@@ -1578,6 +1574,25 @@ LLViewerWindow::LLViewerWindow(
ignore_pixel_depth,
gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled
+ if (NULL == mWindow)
+ {
+ LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate"));
+
+ LL_WARNS("Window") << "Failed to create window, to be shutting Down, be sure your graphics driver is updated." << llendl ;
+
+ ms_sleep(5000) ; //wait for 5 seconds.
+
+ LLSplashScreen::update(LLTrans::getString("ShuttingDown"));
+#if LL_LINUX || LL_SOLARIS
+ llwarns << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information."
+ << llendl;
+#else
+ LL_WARNS("Window") << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings"
+ << LL_ENDL;
+#endif
+ LLAppViewer::instance()->fastQuit(1);
+ }
+
if (!LLAppViewer::instance()->restoreErrorTrap())
{
LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL;
@@ -1593,19 +1608,6 @@ LLViewerWindow::LLViewerWindow(
gSavedSettings.setS32("FullScreenHeight",scr.mY);
}
- if (NULL == mWindow)
- {
- LLSplashScreen::update(LLTrans::getString("ShuttingDown"));
-#if LL_LINUX || LL_SOLARIS
- llwarns << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information."
- << llendl;
-#else
- LL_WARNS("Window") << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings"
- << LL_ENDL;
-#endif
- LLAppViewer::instance()->fastQuit(1);
- }
-
// Get the real window rect the window was created with (since there are various OS-dependent reasons why
// the size of a window or fullscreen context may have been adjusted slightly...)
F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor");
@@ -1639,6 +1641,7 @@ LLViewerWindow::LLViewerWindow(
}
LLVertexBuffer::initClass(gSavedSettings.getBOOL("RenderVBOEnable"), gSavedSettings.getBOOL("RenderVBOMappingDisable"));
LL_INFOS("RenderInit") << "LLVertexBuffer initialization done." << LL_ENDL ;
+ gGL.init() ;
if (LLFeatureManager::getInstance()->isSafe()
|| (gSavedSettings.getS32("LastFeatureVersion") != LLFeatureManager::getInstance()->getVersion())
@@ -1979,7 +1982,10 @@ void LLViewerWindow::shutdownViews()
// destroy the nav bar, not currently part of gViewerWindow
// *TODO: Make LLNavigationBar part of gViewerWindow
+ if (LLNavigationBar::instanceExists())
+ {
delete LLNavigationBar::getInstance();
+ }
// destroy menus after instantiating navbar above, as it needs
// access to gMenuHolder
@@ -2032,15 +2038,17 @@ void LLViewerWindow::shutdownGL()
llinfos << "All textures and llimagegl images are destroyed!" << llendl ;
llinfos << "Cleaning up select manager" << llendl;
- LLSelectMgr::getInstance()->cleanup();
-
- LLVertexBuffer::cleanupClass();
+ LLSelectMgr::getInstance()->cleanup();
llinfos << "Stopping GL during shutdown" << llendl;
stopGL(FALSE);
stop_glerror();
gGL.shutdown();
+
+ LLVertexBuffer::cleanupClass();
+
+ llinfos << "LLVertexBuffer cleaned." << llendl ;
}
// shutdownViews() and shutdownGL() need to be called first
@@ -2293,6 +2301,11 @@ void LLViewerWindow::draw()
// Draw all nested UI views.
// No translation needed, this view is glued to 0,0
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gUIProgram.bind();
+ }
+
gGL.pushMatrix();
LLUI::pushMatrix();
{
@@ -2367,6 +2380,11 @@ void LLViewerWindow::draw()
LLUI::popMatrix();
gGL.popMatrix();
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gUIProgram.unbind();
+ }
+
//#if LL_DEBUG
LLView::sIsDrawing = FALSE;
//#endif
@@ -3142,6 +3160,12 @@ void LLViewerWindow::updateLayout()
//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
}
+ LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
+ if (build_options_floater && build_options_floater->getVisible())
+ {
+ build_options_floater->updateGridMode();
+ }
+
// Always update console
if(gConsole)
{
@@ -4138,6 +4162,19 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
return FALSE;
}
+ //check if there is enough memory for the snapshot image
+ if(LLPipeline::sMemAllocationThrottled)
+ {
+ return FALSE ; //snapshot taking is disabled due to memory restriction.
+ }
+ if(image_width * image_height > (1 << 22)) //if snapshot image is larger than 2K by 2K
+ {
+ if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3))
+ {
+ llwarns << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << llendl ;
+ return FALSE ; //there is no enough memory for taking this snapshot.
+ }
+ }
// PRE SNAPSHOT
gDisplaySwapBuffers = FALSE;
@@ -4512,6 +4549,14 @@ void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset)
glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]);
}
+void LLViewerWindow::revealIntroPanel()
+{
+ if (mProgressView)
+ {
+ mProgressView->revealIntroPanel();
+ }
+}
+
void LLViewerWindow::setShowProgress(const BOOL show)
{
if (mProgressView)
@@ -4520,6 +4565,14 @@ void LLViewerWindow::setShowProgress(const BOOL show)
}
}
+void LLViewerWindow::setStartupComplete()
+{
+ if (mProgressView)
+ {
+ mProgressView->setStartupComplete();
+ }
+}
+
BOOL LLViewerWindow::getShowProgress() const
{
return (mProgressView && mProgressView->getVisible());