From f4ff1430f0d6ae7dd5a6be0bd665678b30a63aca Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 3 Dec 2010 22:16:16 -0700 Subject: first iteration of memory pool code --- indra/newview/llviewerwindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 64698ed006..943b5b5886 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3874,6 +3874,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; -- cgit v1.2.3 From 4de6759cd9d566ab92f0d9efa0c0338359dfa85c Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 6 Jan 2011 16:18:26 -0700 Subject: add debug info to the UI. --- indra/newview/llviewerwindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 943b5b5886..f1d0cf2128 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -548,6 +548,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")) { -- cgit v1.2.3 From 844bf22d250833b000d306b9179580d6e032a632 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 23 Feb 2011 19:48:08 -0700 Subject: apply private pool to VBO --- indra/newview/llviewerwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index dfdf429455..8ce367efd2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1489,6 +1489,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.setBOOL("RenderVBOEnable", FALSE); } LLVertexBuffer::initClass(gSavedSettings.getBOOL("RenderVBOEnable"), gSavedSettings.getBOOL("RenderVBOMappingDisable")); + gGL.init() ; if (LLFeatureManager::getInstance()->isSafe() || (gSavedSettings.getS32("LastFeatureVersion") != LLFeatureManager::getInstance()->getVersion()) -- cgit v1.2.3 From ae65347e3391be56b8919349a269e0abe52cf656 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 23 Feb 2011 20:11:01 -0700 Subject: fix an exit crash. --- indra/newview/llviewerwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8ce367efd2..b8f70e1705 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1877,9 +1877,7 @@ 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; if (!gNoRender) @@ -1889,6 +1887,10 @@ void LLViewerWindow::shutdownGL() } gGL.shutdown(); + + LLVertexBuffer::cleanupClass(); + + llinfos << "LLVertexBuffer cleaned." << llendl ; } // shutdownViews() and shutdownGL() need to be called first -- cgit v1.2.3