diff options
| author | Loren Shih <seraph@lindenlab.com> | 2010-10-27 16:19:18 -0400 | 
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2010-10-27 16:19:18 -0400 | 
| commit | 639bb11eefaa82e2875be99fc2222162fe45e437 (patch) | |
| tree | 85300dcdb3b5ef6d365359190ccf5e00c59377cd | |
| parent | 158e647247f67344a5d7a9dde6ccc80bad615c9a (diff) | |
| parent | 8d4dd1bcb9184093df807af12364f499c1f5fccf (diff) | |
Automated merge from viewer-development-shining
34 files changed, 664 insertions, 380 deletions
| diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 00c94404d4..10cdc7087b 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -635,6 +635,26 @@ U32 LLMemoryInfo::getPhysicalMemoryClamped() const  	}  } +//static +void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) +{ +#if LL_WINDOWS +	MEMORYSTATUSEX state; +	state.dwLength = sizeof(state); +	GlobalMemoryStatusEx(&state); + +	avail_physical_mem_kb = (U32)(state.ullAvailPhys/1024) ; +	avail_virtual_mem_kb = (U32)(state.ullAvailVirtual/1024) ; + +#else +	//do not know how to collect available memory info for other systems. +	//leave it blank here for now. + +	avail_physical_mem_kb = -1 ; +	avail_virtual_mem_kb = -1 ; +#endif +} +  void LLMemoryInfo::stream(std::ostream& s) const  {  #if LL_WINDOWS diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 39af74e5c8..41a4f25000 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -114,6 +114,9 @@ public:  	**  be returned.  	*/  	U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes + +	//get the available memory infomation in KiloBytes. +	static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb);  }; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 096e8e07ab..6ea63809f8 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1055,6 +1055,33 @@ void flush_glerror()  	glGetError();  } +//this function outputs gl error to the log file, does not crash the code. +void log_glerror() +{ +	if (LL_UNLIKELY(!gGLManager.mInited)) +	{ +		return ; +	} +	//  Create or update texture to be used with this data  +	GLenum error; +	error = glGetError(); +	while (LL_UNLIKELY(error)) +	{ +		GLubyte const * gl_error_msg = gluErrorString(error); +		if (NULL != gl_error_msg) +		{ +			llwarns << "GL Error: " << error << " GL Error String: " << gl_error_msg << llendl ;			 +		} +		else +		{ +			// gluErrorString returns NULL for some extensions' error codes. +			// you'll probably have to grep for the number in glext.h. +			llwarns << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << llendl; +		} +		error = glGetError(); +	} +} +  void do_assert_glerror()  {  	if (LL_UNLIKELY(!gGLManager.mInited)) diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index b0decc1499..85fab7a0f8 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -158,6 +158,7 @@ void rotate_quat(LLQuaternion& rotation);  void flush_glerror(); // Flush GL errors when we know we're handling them correctly. +void log_glerror();  void assert_glerror();  void clear_glerror(); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 9d037f2565..65940cb067 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -368,6 +368,18 @@ void LLImageGL::restoreGL()  	}  } +//static  +void LLImageGL::dirtyTexOptions() +{ +	for (std::set<LLImageGL*>::iterator iter = sImageList.begin(); +		 iter != sImageList.end(); iter++) +	{ +		LLImageGL* glimage = *iter; +		glimage->mTexOptionsDirty = true; +		stop_glerror(); +	} +	 +}  //----------------------------------------------------------------------------  //for server side use only. @@ -1057,6 +1069,8 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_  			checkTexSize(true) ;  			llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height <<  				" : " << (S32)mComponents << llcallstacksendl ; + +			log_glerror() ;  		}  		glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 87a835cdcc..6c980984c0 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -64,6 +64,7 @@ public:  	// Save off / restore GL textures  	static void destroyGL(BOOL save_state = TRUE);  	static void restoreGL(); +	static void dirtyTexOptions();  	// Sometimes called externally for textures not using LLImageGL (should go away...)	  	static S32 updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category) ; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index e26acd53a3..8eb160f4e7 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -431,6 +431,9 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio  			if (gGL.mMaxAnisotropy < 1.f)  			{  				glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gGL.mMaxAnisotropy); + +				llinfos << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << llendl ; +				gGL.mMaxAnisotropy = llmax(1.f, gGL.mMaxAnisotropy) ;  			}  			glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, gGL.mMaxAnisotropy);  		} diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index de4501dd0f..02160b09c4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -27,7 +27,7 @@  #include "linden_common.h"  #include <boost/static_assert.hpp> - +#include "llsys.h"  #include "llvertexbuffer.h"  // #include "llrender.h"  #include "llglheaders.h" @@ -854,6 +854,14 @@ U8* LLVertexBuffer::mapBuffer(S32 access)  		if (!mMappedData)  		{ +			log_glerror(); + +			//check the availability of memory +			U32 avail_phy_mem, avail_vir_mem; +			LLMemoryInfo::getAvailableMemoryKB(avail_phy_mem, avail_vir_mem) ; +			llinfos << "Available physical mwmory(KB): " << avail_phy_mem << llendl ;  +			llinfos << "Available virtual memory(KB): " << avail_vir_mem << llendl; +  			//--------------------  			//print out more debug info before crash  			llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl ; @@ -875,6 +883,8 @@ U8* LLVertexBuffer::mapBuffer(S32 access)  		if (!mMappedIndexData)  		{ +			log_glerror(); +  			GLint buff;  			glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);  			if ((GLuint)buff != mGLIndices) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7172f0359a..23b6edc321 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24,6 +24,17 @@        <key>Value</key>        <real>300</real>      </map> +    <key>AdminMenu</key> +    <map> +      <key>Comment</key> +      <string>Enable the debug admin menu from the main menu.  Note: This will just allow the menu to be shown; this does not grant admin privileges.</string> +      <key>Persist</key> +      <integer>0</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>0</integer> +    </map>      <key>AdvanceSnapshot</key>      <map>        <key>Comment</key> @@ -4581,6 +4592,17 @@        <key>Value</key>        <integer>0</integer>      </map> +    <key>LogTextureNetworkTraffic</key> +    <map> +      <key>Comment</key> +      <string>Log network traffic for textures</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>0</integer> +    </map>      <key>LoginAsGod</key>      <map>        <key>Comment</key> @@ -5893,6 +5915,17 @@        <key>Value</key>        <integer>0</integer>      </map> +    <key>ObjectCacheEnabled</key> +    <map> +      <key>Comment</key> +      <string>Enable the object cache.</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>1</integer> +    </map>      <key>OpenDebugStatAdvanced</key>      <map>        <key>Comment</key> @@ -11145,6 +11178,17 @@        <key>Value</key>        <integer>1</integer>      </map> +    <key>SpeakerParticipantDefaultOrder</key> +    <map> +      <key>Comment</key> +      <string>Order for displaying speakers in voice controls.  0 = alphabetical. 1 = recent.</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>U32</string> +      <key>Value</key> +      <integer>1</integer> +    </map>      <key>SpeakerParticipantRemoveDelay</key>      <map>        <key>Comment</key> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 931b9fd2f3..060e7a5d75 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -982,6 +982,7 @@ bool LLAppViewer::mainLoop()  	LLVoiceClient::getInstance()->init(gServicePump);  	LLTimer frameTimer,idleTimer;  	LLTimer debugTime; +	LLFrameTimer memCheckTimer;  	LLViewerJoystick* joystick(LLViewerJoystick::getInstance());  	joystick->setNeedsReset(true); @@ -992,11 +993,29 @@ bool LLAppViewer::mainLoop()      // point of posting.      LLSD newFrame; +	const F32 memory_check_interval = 1.0f ; //second +  	// Handle messages  	while (!LLApp::isExiting())  	{  		LLFastTimer::nextFrame(); // Should be outside of any timer instances +		//clear call stack records +		llclearcallstacks; + +		//check memory availability information +		{ +			if(memory_check_interval < memCheckTimer.getElapsedTimeF32()) +			{ +				memCheckTimer.reset() ; + +				//update the availability of memory +				LLMemoryInfo::getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; +			} +			llcallstacks << "Available physical mem(KB): " << mAvailPhysicalMemInKB << llcallstacksendl ; +			llcallstacks << "Available virtual mem(KB): " << mAvailVirtualMemInKB << llcallstacksendl ; +		} +  		try  		{  			pingMainloopTimeout("Main:MiscNativeWindowEvents"); @@ -1223,11 +1242,20 @@ bool LLAppViewer::mainLoop()  				resumeMainloopTimeout();  				pingMainloopTimeout("Main:End"); -			} -						 +			}			  		}  		catch(std::bad_alloc)  		{			 +			{ +				llinfos << "Availabe physical memory(KB) at the beginning of the frame: " << mAvailPhysicalMemInKB << llendl ; +				llinfos << "Availabe virtual memory(KB) at the beginning of the frame: " << mAvailVirtualMemInKB << llendl ; + +				LLMemoryInfo::getAvailableMemoryKB(mAvailPhysicalMemInKB, mAvailVirtualMemInKB) ; + +				llinfos << "Current availabe physical memory(KB): " << mAvailPhysicalMemInKB << llendl ; +				llinfos << "Current availabe virtual memory(KB): " << mAvailVirtualMemInKB << llendl ; +			} +  			//stop memory leaking simulation  			LLFloaterMemLeak* mem_leak_instance =  				LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking"); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index fdc3b9ef9e..a40cd83182 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -260,6 +260,8 @@ private:  	std::set<struct apr_dso_handle_t*> mPlugins; +	U32 mAvailPhysicalMemInKB ; +	U32 mAvailVirtualMemInKB ;  public:  	//some information for updater  	typedef struct diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 078bd73379..b2e9564f7d 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -45,6 +45,7 @@  #include "llspeakers.h"  #include "lltextutil.h"  #include "lltransientfloatermgr.h" +#include "llviewercontrol.h"  #include "llviewerdisplayname.h"  #include "llviewerwindow.h"  #include "llvoicechannel.h" @@ -335,8 +336,9 @@ void LLCallFloater::refreshParticipantList()  	{  		mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);  		mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1)); -		mParticipants->setSortOrder(LLParticipantList::E_SORT_BY_RECENT_SPEAKERS); - +		const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder"); +		mParticipants->setSortOrder(LLParticipantList::EParticipantSortOrder(speaker_sort_order)); +		  		if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager)  		{  			mAvatarList->setNoItemsCommentText(getString("no_one_near")); diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 3cd3c74ee4..1e91710552 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -104,6 +104,8 @@ void LLFloaterHardwareSettings::refreshEnabledState()  	getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders());  	getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders());  	getChildView("fsaa")->setEnabled(gPipeline.canUseAntiAliasing()); +	getChildView("antialiasing restart")->setVisible(!gSavedSettings.getBOOL("RenderUseFBO")); +  	/* Enable to reset fsaa value to disabled when feature is not available.  	if (!gPipeline.canUseAntiAliasing())  	{ @@ -129,30 +131,6 @@ BOOL LLFloaterHardwareSettings::postBuild()  void LLFloaterHardwareSettings::apply()  { -	// Anisotropic rendering -	BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; -	LLImageGL::sGlobalUseAnisotropic = getChild<LLUICtrl>("ani")->getValue(); - -	U32 fsaa = (U32) getChild<LLUICtrl>("fsaa")->getValue().asInteger(); -	U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples"); - -	BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED); - -	if (old_fsaa != fsaa) -	{ -		gSavedSettings.setU32("RenderFSAASamples", fsaa); -		LLWindow* window = gViewerWindow->getWindow(); -		LLCoordScreen size; -		window->getSize(&size); -		gViewerWindow->changeDisplaySettings(size, -											gSavedSettings.getBOOL("DisableVerticalSync"), -											logged_in); -	} -	else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) -	{ -		gViewerWindow->restartDisplay(logged_in); -	} -  	refresh();  } diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 01b3b5572e..54053cf89f 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -197,17 +197,20 @@ private:  	uuid_set_t mAvalineCallers;  }; -LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list,  bool use_context_menu/* = true*/, -		bool exclude_agent /*= true*/, bool can_toggle_icons /*= true*/): +LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,  +									 LLAvatarList* avatar_list, +									 bool use_context_menu/* = true*/, +									 bool exclude_agent /*= true*/,  +									 bool can_toggle_icons /*= true*/) :  	mSpeakerMgr(data_source),  	mAvatarList(avatar_list), -	mSortOrder(E_SORT_BY_NAME) -,	mParticipantListMenu(NULL) -,	mExcludeAgent(exclude_agent) -,	mValidateSpeakerCallback(NULL) +	mParticipantListMenu(NULL), +	mExcludeAgent(exclude_agent), +	mValidateSpeakerCallback(NULL)  { +  	mAvalineUpdater = new LLAvalineUpdater(boost::bind(&LLParticipantList::onAvalineCallerFound, this, _1), -		boost::bind(&LLParticipantList::onAvalineCallerRemoved, this, _1)); +										   boost::bind(&LLParticipantList::onAvalineCallerRemoved, this, _1));  	mSpeakerAddListener = new SpeakerAddListener(*this);  	mSpeakerRemoveListener = new SpeakerRemoveListener(*this); @@ -393,15 +396,15 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)  }  /* -Seems this method is not necessary after onAvalineCallerRemoved was implemented; +  Seems this method is not necessary after onAvalineCallerRemoved was implemented; -It does nothing because list item is always created with correct class type for Avaline caller. -For now Avaline Caller is removed from the LLSpeakerMgr List when it is removed from the Voice Client -session. -This happens in two cases: if Avaline Caller ends call itself or if Resident ends group call. +  It does nothing because list item is always created with correct class type for Avaline caller. +  For now Avaline Caller is removed from the LLSpeakerMgr List when it is removed from the Voice Client +  session. +  This happens in two cases: if Avaline Caller ends call itself or if Resident ends group call. -Probably Avaline caller should be removed from the LLSpeakerMgr list ONLY if it ends call itself. -Asked in EXT-4301. +  Probably Avaline caller should be removed from the LLSpeakerMgr list ONLY if it ends call itself. +  Asked in EXT-4301.  */  void LLParticipantList::onAvalineCallerFound(const LLUUID& participant_id)  { @@ -443,16 +446,19 @@ void LLParticipantList::onAvalineCallerRemoved(const LLUUID& participant_id)  void LLParticipantList::setSortOrder(EParticipantSortOrder order)  { -	if ( mSortOrder != order ) +	const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder"); + +	if ( speaker_sort_order != order )  	{ -		mSortOrder = order; +		gSavedSettings.setU32("SpeakerParticipantDefaultOrder", (U32)order);  		sort();  	}  } -LLParticipantList::EParticipantSortOrder LLParticipantList::getSortOrder() +const LLParticipantList::EParticipantSortOrder LLParticipantList::getSortOrder() const  { -	return mSortOrder; +	const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder"); +	return EParticipantSortOrder(speaker_sort_order);  }  void LLParticipantList::setValidateSpeakerCallback(validate_speaker_callback_t cb) @@ -551,28 +557,29 @@ void LLParticipantList::sort()  	if ( !mAvatarList )  		return; -	switch ( mSortOrder ) { -	case E_SORT_BY_NAME : -		// if mExcludeAgent == true , then no need to keep agent on top of the list -		if(mExcludeAgent) -		{ -			mAvatarList->sortByName(); -		} -		else -		{ -			mAvatarList->setComparator(&AGENT_ON_TOP_NAME_COMPARATOR); +	switch ( getSortOrder() )  +	{ +		case E_SORT_BY_NAME : +			// if mExcludeAgent == true , then no need to keep agent on top of the list +			if(mExcludeAgent) +			{ +				mAvatarList->sortByName(); +			} +			else +			{ +				mAvatarList->setComparator(&AGENT_ON_TOP_NAME_COMPARATOR); +				mAvatarList->sort(); +			} +			break; +		case E_SORT_BY_RECENT_SPEAKERS: +			if (mSortByRecentSpeakers.isNull()) +				mSortByRecentSpeakers = new LLAvatarItemRecentSpeakerComparator(*this); +			mAvatarList->setComparator(mSortByRecentSpeakers.get());  			mAvatarList->sort(); -		} -		break; -	case E_SORT_BY_RECENT_SPEAKERS: -		if (mSortByRecentSpeakers.isNull()) -			mSortByRecentSpeakers = new LLAvatarItemRecentSpeakerComparator(*this); -		mAvatarList->setComparator(mSortByRecentSpeakers.get()); -		mAvatarList->sort(); -		break; -	default : -		llwarns << "Unrecognized sort order for " << mAvatarList->getName() << llendl; -		return; +			break; +		default : +			llwarns << "Unrecognized sort order for " << mAvatarList->getName() << llendl; +			return;  	}  } @@ -645,7 +652,7 @@ bool LLParticipantList::SpeakerClearListener::handleEvent(LLPointer<LLOldEvents:  //  bool LLParticipantList::SpeakerModeratorUpdateListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)  { -		return mParent.onModeratorUpdateEvent(event, userdata); +	return mParent.onModeratorUpdateEvent(event, userdata);  }  bool LLParticipantList::SpeakerMuteListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) @@ -867,7 +874,7 @@ void LLParticipantList::LLParticipantListMenu::confirmMuteAllCallback(const LLSD  	const LLUUID& session_id = payload["session_id"];  	LLIMSpeakerMgr * speaker_manager = dynamic_cast<LLIMSpeakerMgr*> ( -			LLIMModel::getInstance()->getSpeakerManager(session_id)); +		LLIMModel::getInstance()->getSpeakerManager(session_id));  	if (speaker_manager)  	{  		speaker_manager->moderateVoiceAllParticipants(false); @@ -925,9 +932,9 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&  }  /* -Processed menu items with such parameters: -	can_allow_text_chat -	can_moderate_voice +  Processed menu items with such parameters: +  can_allow_text_chat +  can_moderate_voice  */  bool LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem(const LLSD& userdata)  { @@ -978,11 +985,11 @@ bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD&  	}  	else if(item == "is_sorted_by_name")  	{ -		return E_SORT_BY_NAME == mParent.mSortOrder; +		return E_SORT_BY_NAME == mParent.getSortOrder();  	}  	else if(item == "is_sorted_by_recent_speakers")  	{ -		return E_SORT_BY_RECENT_SPEAKERS == mParent.mSortOrder; +		return E_SORT_BY_RECENT_SPEAKERS == mParent.getSortOrder();  	}  	return false; diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 722a749d19..e0b3d42c25 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -24,6 +24,9 @@   * $/LicenseInfo$   */ +#ifndef LL_PARTICIPANTLIST_H +#define LL_PARTICIPANTLIST_H +  #include "llviewerprecompiledheaders.h"  #include "llevent.h"  #include "llavatarlist.h" // for LLAvatarItemRecentSpeakerComparator @@ -37,239 +40,247 @@ class LLAvalineUpdater;  class LLParticipantList  {  	LOG_CLASS(LLParticipantList); +public: + +	typedef boost::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t; + +	LLParticipantList(LLSpeakerMgr* data_source,  +					  LLAvatarList* avatar_list,  +					  bool use_context_menu = true,  +					  bool exclude_agent = true,  +					  bool can_toggle_icons = true); +	~LLParticipantList(); +	void setSpeakingIndicatorsVisible(BOOL visible); + +	enum EParticipantSortOrder +	{ +		E_SORT_BY_NAME = 0, +		E_SORT_BY_RECENT_SPEAKERS = 1, +	}; + +	/** +	 * Adds specified avatar ID to the existing list if it is not Agent's ID +	 * +	 * @param[in] avatar_id - Avatar UUID to be added into the list +	 */ +	void addAvatarIDExceptAgent(const LLUUID& avatar_id); + +	/** +	 * Set and sort Avatarlist by given order +	 */ +	void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME); +	const EParticipantSortOrder getSortOrder() const; + +	/** +	 * Refreshes the participant list if it's in sort by recent speaker order. +	 */ +	void updateRecentSpeakersOrder(); + +	/** +	 * Set a callback to be called before adding a speaker. Invalid speakers will not be added. +	 * +	 * If the callback is unset all speakers are considered as valid. +	 * +	 * @see onAddItemEvent() +	 */ +	void setValidateSpeakerCallback(validate_speaker_callback_t cb); + +protected: +	/** +	 * LLSpeakerMgr event handlers +	 */ +	bool onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	bool onRemoveItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	bool onClearListEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	bool onModeratorUpdateEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	bool onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); + +	/** +	 * Sorts the Avatarlist by stored order +	 */ +	void sort(); + +	/** +	 * List of listeners implementing LLOldEvents::LLSimpleListener. +	 * There is no way to handle all the events in one listener as LLSpeakerMgr registers +	 * listeners in such a way that one listener can handle only one type of event +	 **/ +	class BaseSpeakerListener : public LLOldEvents::LLSimpleListener +	{  	public: +		BaseSpeakerListener(LLParticipantList& parent) : mParent(parent) {} +	protected: +		LLParticipantList& mParent; +	}; -		typedef boost::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t; - -		LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true, bool exclude_agent = true, bool can_toggle_icons = true); -		~LLParticipantList(); -		void setSpeakingIndicatorsVisible(BOOL visible); - -		typedef enum e_participant_sort_oder { -			E_SORT_BY_NAME = 0, -			E_SORT_BY_RECENT_SPEAKERS = 1, -		} EParticipantSortOrder; +	class SpeakerAddListener : public BaseSpeakerListener +	{ +	public: +		SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} +		/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	}; -		/** -		 * Adds specified avatar ID to the existing list if it is not Agent's ID -		 * -		 * @param[in] avatar_id - Avatar UUID to be added into the list -		 */ -		void addAvatarIDExceptAgent(const LLUUID& avatar_id); +	class SpeakerRemoveListener : public BaseSpeakerListener +	{ +	public: +		SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} +		/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	}; -		/** -		 * Set and sort Avatarlist by given order -		 */ -		void setSortOrder(EParticipantSortOrder order = E_SORT_BY_NAME); -		EParticipantSortOrder getSortOrder(); +	class SpeakerClearListener : public BaseSpeakerListener +	{ +	public: +		SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} +		/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	}; -		/** -		 * Refreshes the participant list if it's in sort by recent speaker order. -		 */ -		void updateRecentSpeakersOrder(); +	class SpeakerModeratorUpdateListener : public BaseSpeakerListener +	{ +	public: +		SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} +		/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	}; +		 +	class SpeakerMuteListener : public BaseSpeakerListener +	{ +	public: +		SpeakerMuteListener(LLParticipantList& parent) : BaseSpeakerListener(parent) {} -		/** -		 * Set a callback to be called before adding a speaker. Invalid speakers will not be added. -		 * -		 * If the callback is unset all speakers are considered as valid. -		 * -		 * @see onAddItemEvent() -		 */ -		void setValidateSpeakerCallback(validate_speaker_callback_t cb); +		/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +	}; +	/** +	 * Menu used in the participant list. +	 */ +	class LLParticipantListMenu : public LLListContextMenu +	{ +	public: +		LLParticipantListMenu(LLParticipantList& parent):mParent(parent){}; +		/*virtual*/ LLContextMenu* createMenu(); +		/*virtual*/ void show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y);  	protected: +		LLParticipantList& mParent; +	private: +		bool enableContextMenuItem(const LLSD& userdata); +		bool enableModerateContextMenuItem(const LLSD& userdata); +		bool checkContextMenuItem(const LLSD& userdata); + +		void sortParticipantList(const LLSD& userdata); +		void toggleAllowTextChat(const LLSD& userdata); +		void toggleMute(const LLSD& userdata, U32 flags); +		void toggleMuteText(const LLSD& userdata); +		void toggleMuteVoice(const LLSD& userdata); +		  		/** -		 * LLSpeakerMgr event handlers +		 * Return true if Agent is group moderator(and moderator of group call).  		 */ -		bool onAddItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		bool onRemoveItemEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		bool onClearListEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		bool onModeratorUpdateEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		bool onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); +		bool isGroupModerator(); +		// Voice moderation support  		/** -		 * Sorts the Avatarlist by stored order +		 * Check whether specified by argument avatar is muted for group chat or not.  		 */ -		void sort(); - -		//List of listeners implementing LLOldEvents::LLSimpleListener. -		//There is no way to handle all the events in one listener as LLSpeakerMgr registers listeners in such a way -		//that one listener can handle only one type of event -		class BaseSpeakerListner : public LLOldEvents::LLSimpleListener -		{ -		public: -			BaseSpeakerListner(LLParticipantList& parent) : mParent(parent) {} -		protected: -			LLParticipantList& mParent; -		}; - -		class SpeakerAddListener : public BaseSpeakerListner -		{ -		public: -			SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} -			/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		}; - -		class SpeakerRemoveListener : public BaseSpeakerListner -		{ -		public: -			SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} -			/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		}; - -		class SpeakerClearListener : public BaseSpeakerListner -		{ -		public: -			SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} -			/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		}; - -		class SpeakerModeratorUpdateListener : public BaseSpeakerListner -		{ -		public: -			SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} -			/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		}; -		 -		class SpeakerMuteListener : public BaseSpeakerListner -		{ -		public: -			SpeakerMuteListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} - -			/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); -		}; +		bool isMuted(const LLUUID& avatar_id);  		/** -		 * Menu used in the participant list. +		 * Processes Voice moderation menu items. +		 * +		 * It calls either moderateVoiceParticipant() or moderateVoiceParticipant() depend on +		 * passed parameter. +		 * +		 * @param userdata can be "selected" or "others". +		 * +		 * @see moderateVoiceParticipant() +		 * @see moderateVoiceAllParticipants()  		 */ -		class LLParticipantListMenu : public LLListContextMenu -		{ -		public: -			LLParticipantListMenu(LLParticipantList& parent):mParent(parent){}; -			/*virtual*/ LLContextMenu* createMenu(); -			/*virtual*/ void show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y); -		protected: -			LLParticipantList& mParent; -		private: -			bool enableContextMenuItem(const LLSD& userdata); -			bool enableModerateContextMenuItem(const LLSD& userdata); -			bool checkContextMenuItem(const LLSD& userdata); - -			void sortParticipantList(const LLSD& userdata); -			void toggleAllowTextChat(const LLSD& userdata); -			void toggleMute(const LLSD& userdata, U32 flags); -			void toggleMuteText(const LLSD& userdata); -			void toggleMuteVoice(const LLSD& userdata); -		 -			/** -			 * Return true if Agent is group moderator(and moderator of group call). -			 */ -			bool isGroupModerator(); - -			// Voice moderation support -			/** -			 * Check whether specified by argument avatar is muted for group chat or not. -			 */ -			bool isMuted(const LLUUID& avatar_id); - -			/** -			 * Processes Voice moderation menu items. -			 * -			 * It calls either moderateVoiceParticipant() or moderateVoiceParticipant() depend on -			 * passed parameter. -			 * -			 * @param userdata can be "selected" or "others". -			 * -			 * @see moderateVoiceParticipant() -			 * @see moderateVoiceAllParticipants() -			 */ -			void moderateVoice(const LLSD& userdata); - -			/** -			 * Mutes/Unmutes avatar for current group voice chat. -			 * -			 * It only marks avatar as muted for session and does not use local Agent's Block list. -			 * It does not mute Agent itself. -			 * -			 * @param[in] avatar_id UUID of avatar to be processed -			 * @param[in] unmute if true - specified avatar will be muted, otherwise - unmuted. -			 * -			 * @see moderateVoiceAllParticipants() -			 */ -			void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute); - -			/** -			 * Mutes/Unmutes all avatars for current group voice chat. -			 * -			 * It only marks avatars as muted for session and does not use local Agent's Block list. -			 * -			 * @param[in] unmute if true - avatars will be muted, otherwise - unmuted. -			 * -			 * @see moderateVoiceParticipant() -			 */ -			void moderateVoiceAllParticipants(bool unmute); - -			static void confirmMuteAllCallback(const LLSD& notification, const LLSD& response); -		}; +		void moderateVoice(const LLSD& userdata);  		/** -		 * Comparator for comparing avatar items by last spoken time +		 * Mutes/Unmutes avatar for current group voice chat. +		 * +		 * It only marks avatar as muted for session and does not use local Agent's Block list. +		 * It does not mute Agent itself. +		 * +		 * @param[in] avatar_id UUID of avatar to be processed +		 * @param[in] unmute if true - specified avatar will be muted, otherwise - unmuted. +		 * +		 * @see moderateVoiceAllParticipants()  		 */ -		class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator, public LLRefCount -		{ -			LOG_CLASS(LLAvatarItemRecentSpeakerComparator); -		  public: -			LLAvatarItemRecentSpeakerComparator(LLParticipantList& parent):mParent(parent){}; -			virtual ~LLAvatarItemRecentSpeakerComparator() {}; -		  protected: -			virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const; -		  private: -			LLParticipantList& mParent; -		}; - -	private: -		void onAvatarListDoubleClicked(LLUICtrl* ctrl); -		void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); - -		void onAvalineCallerFound(const LLUUID& participant_id); -		void onAvalineCallerRemoved(const LLUUID& participant_id); +		void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute);  		/** -		 * Adjusts passed participant to work properly. +		 * Mutes/Unmutes all avatars for current group voice chat.  		 * -		 * Adds SpeakerMuteListener to process moderation actions. -		 */ -		void adjustParticipant(const LLUUID& speaker_id); - -		LLSpeakerMgr*		mSpeakerMgr; -		LLAvatarList*		mAvatarList; - -		std::set<LLUUID>	mModeratorList; -		std::set<LLUUID>	mModeratorToRemoveList; - -		LLPointer<SpeakerAddListener>				mSpeakerAddListener; -		LLPointer<SpeakerRemoveListener>			mSpeakerRemoveListener; -		LLPointer<SpeakerClearListener>				mSpeakerClearListener; -		LLPointer<SpeakerModeratorUpdateListener>	mSpeakerModeratorListener; -		LLPointer<SpeakerMuteListener>				mSpeakerMuteListener; - -		LLParticipantListMenu*    mParticipantListMenu; - -		EParticipantSortOrder	mSortOrder; -		/* -		 * This field manages an adding  a new avatar_id in the mAvatarList -		 * If true, then agent_id wont  be added into mAvatarList -		 * Also by default this field is controlling a sort procedure, @c sort()  +		 * It only marks avatars as muted for session and does not use local Agent's Block list. +		 * +		 * @param[in] unmute if true - avatars will be muted, otherwise - unmuted. +		 * +		 * @see moderateVoiceParticipant()  		 */ -		bool mExcludeAgent; +		void moderateVoiceAllParticipants(bool unmute); -		// boost::connections -		boost::signals2::connection mAvatarListDoubleClickConnection; -		boost::signals2::connection mAvatarListRefreshConnection; -		boost::signals2::connection mAvatarListReturnConnection; -		boost::signals2::connection mAvatarListToggleIconsConnection; +		static void confirmMuteAllCallback(const LLSD& notification, const LLSD& response); +	}; -		LLPointer<LLAvatarItemRecentSpeakerComparator> mSortByRecentSpeakers; -		validate_speaker_callback_t mValidateSpeakerCallback; -		LLAvalineUpdater* mAvalineUpdater; +	/** +	 * Comparator for comparing avatar items by last spoken time +	 */ +	class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator, public LLRefCount +	{ +		LOG_CLASS(LLAvatarItemRecentSpeakerComparator); +	public: +		LLAvatarItemRecentSpeakerComparator(LLParticipantList& parent):mParent(parent){}; +		virtual ~LLAvatarItemRecentSpeakerComparator() {}; +	protected: +		virtual bool doCompare(const LLAvatarListItem* avatar_item1, const LLAvatarListItem* avatar_item2) const; +	private: +		LLParticipantList& mParent; +	}; + +private: +	void onAvatarListDoubleClicked(LLUICtrl* ctrl); +	void onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param); + +	void onAvalineCallerFound(const LLUUID& participant_id); +	void onAvalineCallerRemoved(const LLUUID& participant_id); + +	/** +	 * Adjusts passed participant to work properly. +	 * +	 * Adds SpeakerMuteListener to process moderation actions. +	 */ +	void adjustParticipant(const LLUUID& speaker_id); + +	LLSpeakerMgr*		mSpeakerMgr; +	LLAvatarList*		mAvatarList; + +	std::set<LLUUID>	mModeratorList; +	std::set<LLUUID>	mModeratorToRemoveList; + +	LLPointer<SpeakerAddListener>				mSpeakerAddListener; +	LLPointer<SpeakerRemoveListener>			mSpeakerRemoveListener; +	LLPointer<SpeakerClearListener>				mSpeakerClearListener; +	LLPointer<SpeakerModeratorUpdateListener>	mSpeakerModeratorListener; +	LLPointer<SpeakerMuteListener>				mSpeakerMuteListener; + +	LLParticipantListMenu*    mParticipantListMenu; + +	/** +	 * This field manages an adding  a new avatar_id in the mAvatarList +	 * If true, then agent_id wont  be added into mAvatarList +	 * Also by default this field is controlling a sort procedure, @c sort()  +	 */ +	bool mExcludeAgent; + +	// boost::connections +	boost::signals2::connection mAvatarListDoubleClickConnection; +	boost::signals2::connection mAvatarListRefreshConnection; +	boost::signals2::connection mAvatarListReturnConnection; +	boost::signals2::connection mAvatarListToggleIconsConnection; + +	LLPointer<LLAvatarItemRecentSpeakerComparator> mSortByRecentSpeakers; +	validate_speaker_callback_t mValidateSpeakerCallback; +	LLAvalineUpdater* mAvalineUpdater;  }; + +#endif // LL_PARTICIPANTLIST_H diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index fafef84aa2..d6d38de225 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -299,6 +299,7 @@ public:  	{  		static LLCachedControl<bool> log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog");  		static LLCachedControl<bool> log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); +		static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ;  		if (log_to_viewer_log || log_to_sim)  		{ @@ -332,6 +333,16 @@ public:  			}  			S32 data_size = worker->callbackHttpGet(channels, buffer, partial, success); +			 +			if(log_texture_traffic && data_size > 0) +			{ +				LLViewerTexture* tex = LLViewerTextureManager::findTexture(mID) ; +				if(tex) +				{ +					gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ; +				} +			} +  			mFetcher->removeFromHTTPQueue(mID, data_size);  		}  		else diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index c87aff022f..b9a15fd1f4 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -514,7 +514,8 @@ void LLGLTexMemBar::draw()  	F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ;  	S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);  	S32 v_offset = (S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); -	S32 total_downloaded = BYTES_TO_MEGA_BYTES(gTotalTextureBytes); +	F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024); +	F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024);  	//----------------------------------------------------------------------------  	LLGLSUIDefault gls_ui;  	LLColor4 text_color(1.f, 1.f, 1.f, 0.75f); @@ -525,13 +526,13 @@ void LLGLTexMemBar::draw()  	LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6,  											 text_color, LLFontGL::LEFT, LLFontGL::TOP); -	text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot: %d MB", +	text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB",  					total_mem,  					max_total_mem,  					bound_mem,  					max_bound_mem,  					LLImageRaw::sGlobalRawMemory >> 20,	discard_bias, -					cache_usage, cache_max_usage, total_downloaded); +					cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded);  	//, cache_entries, cache_max_entries  	LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3, diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 522b5a7dfa..fbec2a7b9e 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -131,6 +131,13 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue)  	return true;  } +static bool handleAnisotropicChanged(const LLSD& newvalue) +{ +	LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); +	LLImageGL::dirtyTexOptions(); +	return true; +} +  static bool handleVolumeLODChanged(const LLSD& newvalue)  {  	LLVOVolume::sLODFactor = (F32) newvalue.asReal(); @@ -498,6 +505,7 @@ void settings_setup_listeners()  	gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); +	gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2));  	gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index d1cb9dabf1..dec9b8d48f 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -218,6 +218,16 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  	LLMemType mt_render(LLMemType::MTYPE_RENDER);  	LLFastTimer t(FTM_RENDER); +	if (gResizeScreenTexture) +	{ //skip render on frames where screen texture is resizing +		gGL.flush(); +		glClear(GL_COLOR_BUFFER_BIT); +		gViewerWindow->mWindow->swapBuffers(); +		gResizeScreenTexture = FALSE; +		gPipeline.resizeScreenTexture(); +		return; +	} +  	if (LLPipeline::sRenderFrameTest)  	{  		send_agent_pause(); @@ -531,6 +541,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  	gViewerWindow->setup3DViewport();  	gPipeline.resetFrameStats();	// Reset per-frame statistics. +	  	if (!gDisconnected)  	{  		LLMemType mt_du(LLMemType::MTYPE_DISPLAY_UPDATE); @@ -642,11 +653,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  				LLVertexBuffer::clientCopy(0.016);  			} -			if (gResizeScreenTexture) -			{ -				gResizeScreenTexture = FALSE; -				gPipeline.resizeScreenTexture(); -			} +			//if (gResizeScreenTexture) +			//{ +			//	gResizeScreenTexture = FALSE; +			//	gPipeline.resizeScreenTexture(); +			//}  			gGL.setColorMask(true, true);  			glClearColor(0,0,0,0); @@ -707,7 +718,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)  		//  		// Doing this here gives hardware occlusion queries extra time to complete  		LLAppViewer::instance()->pingMainloopTimeout("Display:UpdateImages"); -		LLError::LLCallStacks::clear() ;  		{  			LLMemType mt_iu(LLMemType::MTYPE_DISPLAY_IMAGE_UPDATE); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1778eaed68..2874a6ec79 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1961,6 +1961,16 @@ class LLAdvancedShowDebugSettings : public view_listener_t  // VIEW ADMIN OPTIONS //  //////////////////////// +class LLAdvancedEnableViewAdminOptions : public view_listener_t +{ +	bool handleEvent(const LLSD& userdata) +	{ +		// Don't enable in god mode since the admin menu is shown anyway. +		// Only enable if the user has set the appropriate debug setting. +		bool new_value = !gAgent.getAgentAccess().isGodlikeWithoutAdminMenuFakery() && gSavedSettings.getBOOL("AdminMenu"); +		return new_value; +	} +};  class LLAdvancedToggleViewAdminOptions : public view_listener_t  { @@ -1975,7 +1985,7 @@ class LLAdvancedCheckViewAdminOptions : public view_listener_t  {  	bool handleEvent(const LLSD& userdata)  	{ -		bool new_value = check_admin_override(NULL); +		bool new_value = check_admin_override(NULL) || gAgent.isGodlike();  		return new_value;  	}  }; @@ -8000,6 +8010,7 @@ void initialize_menus()  	view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates");  	view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage");  	view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); +	view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions");  	view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions");  	view_listener_t::addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions");  	view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index b597e6148e..f9bf0543c4 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -165,6 +165,11 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)  	{  		U32 local_id = object.mLocalID;  		LLHost region_host = object.getRegion()->getHost(); +		if(!region_host.isOk()) +		{ +			return FALSE ; +		} +  		U32 ip = region_host.getAddress();  		U32 port = region_host.getPort();  		U64 ipport = (((U64)ip) << 32) | (U64)port; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 42266ad233..46c78e2bb4 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -558,7 +558,7 @@ F32		gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f;  U32		gTotalWorldBytes = 0, gTotalObjectBytes = 0, gTotalTextureBytes = 0, gSimPingCount = 0;  U32		gObjectBits = 0;  F32		gAvgSimPing = 0.f; - +U32     gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0};  extern U32  gVisCompared;  extern U32  gVisTested; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index ca977d4599..3f9cfb9d9b 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -264,4 +264,6 @@ void send_stats();  extern std::map<S32,LLFrameTimer> gDebugTimers;  extern std::map<S32,std::string> gDebugTimerLabel;  extern U32	gTotalTextureBytes; +extern U32  gTotalObjectBytes; +extern U32  gTotalTextureBytesPerBoostLevel[] ;  #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5c262838ae..f96b93da4d 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1130,7 +1130,7 @@ void LLViewerFetchedTexture::init(bool firstinit)  	// does not contain this image.  	mIsMissingAsset = FALSE; -	mLoadedCallbackDesiredDiscardLevel = 0; +	mLoadedCallbackDesiredDiscardLevel = S8_MAX;  	mPauseLoadedCallBacks = TRUE ;  	mNeedsCreateTexture = FALSE; @@ -1155,9 +1155,11 @@ void LLViewerFetchedTexture::init(bool firstinit)  	mSavedRawImage = NULL ;  	mForceToSaveRawImage  = FALSE ; +	mSaveRawImage = FALSE ;  	mSavedRawDiscardLevel = -1 ;  	mDesiredSavedRawDiscardLevel = -1 ;  	mLastReferencedSavedRawImageTime = 0.0f ; +	mLastCallBackActiveTime = 0.f;  }  LLViewerFetchedTexture::~LLViewerFetchedTexture() @@ -1483,56 +1485,57 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height)  //virtual  void LLViewerFetchedTexture::processTextureStats()  { +	static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes"); +  	if(mFullyLoaded) -	{		 -		if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more +	{ +		if(needsToSaveRawImage())//needs to reload  		{ -			mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;  			mFullyLoaded = FALSE ;  		} -	} -	else -	{ -		updateVirtualSize() ; -		 -		static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes"); -		 -		if (textures_fullres) +		else  		{ -			mDesiredDiscardLevel = 0; +			return ;  		} -		else if(!mFullWidth || !mFullHeight) +	} + +	//updateVirtualSize() ;	 +	 +	if (textures_fullres) +	{ +		mDesiredDiscardLevel = 0; +	} +	else if(!mFullWidth || !mFullHeight) +	{ +		mDesiredDiscardLevel = 	llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel) ; +	} +	else +	{	 +		if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight)  		{ -			mDesiredDiscardLevel = 	getMaxDiscardLevel() ; -		} -		else -		{	 -			if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) +			if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)  			{ -				if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) -				{ -					mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 -				} -				else -				{ -					mDesiredDiscardLevel = 0; -				} -			} -			else if(mKnownDrawSizeChanged)//known draw size is set -			{			 -				mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2,  -													 log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; -				mDesiredDiscardLevel = 	llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; -				mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; +				mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048  			} -			mKnownDrawSizeChanged = FALSE ; -		 -			if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) +			else  			{ -				mFullyLoaded = TRUE ; +				mDesiredDiscardLevel = 0;  			}  		} -	} +		else if(mKnownDrawSizeChanged)//known draw size is set +		{			 +			mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2,  +												 log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; +			mDesiredDiscardLevel = 	llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; +			mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ; +		} +		mKnownDrawSizeChanged = FALSE ; +	 +		if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) +		{ +			mFullyLoaded = TRUE ; +		} +	}	  	if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) //force to refetch the texture.  	{ @@ -2074,13 +2077,14 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call  	mNeedsAux |= needs_aux;  	if(keep_imageraw)  	{ -		forceToSaveRawImage(discard_level, true) ; +		mSaveRawImage = TRUE ;  	}  	if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0)  	{  		// We need aux data, but we've already loaded the image, and it didn't have any  		llwarns << "No aux data available for callback for image:" << getID() << llendl;  	} +	mLastCallBackActiveTime = sCurrentTime ;  }  void LLViewerFetchedTexture::clearCallbackEntryList() @@ -2103,9 +2107,8 @@ void LLViewerFetchedTexture::clearCallbackEntryList()  	}  	gTextureList.mCallbackList.erase(this); -	mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;  	mLoadedCallbackDesiredDiscardLevel = S8_MAX ; -	if(mForceToSaveRawImage) +	if(needsToSaveRawImage())  	{  		destroySavedRawImage() ;  	} @@ -2151,14 +2154,13 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so  	{  		// If we have no callbacks, take us off of the image callback list.  		gTextureList.mCallbackList.erase(this); -		mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1; - -		if(mForceToSaveRawImage) +		 +		if(needsToSaveRawImage())  		{  			destroySavedRawImage() ;  		}  	} -	else if(mForceToSaveRawImage && mBoostLevel != LLViewerTexture::BOOST_PREVIEW) +	else if(needsToSaveRawImage() && mBoostLevel != LLViewerTexture::BOOST_PREVIEW)  	{  		if(desired_raw_discard != INVALID_DISCARD_LEVEL)  		{ @@ -2196,7 +2198,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry:  	mPauseLoadedCallBacks = FALSE ;  	if(need_raw)  	{ -		mForceToSaveRawImage = TRUE ; +		mSaveRawImage = TRUE ;  	}  } @@ -2227,16 +2229,23 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s  	{  		mPauseLoadedCallBacks = TRUE ;//when set, loaded callback is paused.  		resetTextureStats(); -		mForceToSaveRawImage = FALSE ; +		mSaveRawImage = FALSE ;  	}  }  bool LLViewerFetchedTexture::doLoadedCallbacks()  { +	static const F32 MAX_INACTIVE_TIME = 120.f ; //seconds +  	if (mNeedsCreateTexture)  	{  		return false;  	} +	if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME) +	{ +		clearCallbackEntryList() ; //remove all callbacks. +		return false ; +	}  	bool res = false; @@ -2302,13 +2311,11 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()  	bool run_raw_callbacks = false;  	bool need_readback = false; -	mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;  	for(callback_list_t::iterator iter = mLoadedCallbackList.begin();  		iter != mLoadedCallbackList.end(); )  	{  		LLLoadedCallbackEntry *entryp = *iter++; -		mMinDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)entryp->mDesiredDiscard) ; - +	  		if (entryp->mNeedsImageRaw)  		{  			if (mNeedsAux) @@ -2382,7 +2389,8 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()  				// to satisfy the interested party, then this is the last time that  				// we're going to call them. -				llassert_always(mRawImage.notNull()); +				mLastCallBackActiveTime = sCurrentTime ; +				//llassert_always(mRawImage.notNull());  				if(mNeedsAux && mAuxRawImage.isNull())  				{  					llwarns << "Raw Image with no Aux Data for callback" << llendl; @@ -2417,6 +2425,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()  			LLLoadedCallbackEntry *entryp = *curiter;  			if (!entryp->mNeedsImageRaw && (entryp->mLastUsedDiscard > gl_discard))  			{ +				mLastCallBackActiveTime = sCurrentTime ;  				BOOL final = gl_discard <= entryp->mDesiredDiscard ? TRUE : FALSE;  				entryp->mLastUsedDiscard = gl_discard;  				entryp->mCallback(TRUE, this, NULL, NULL, gl_discard, final, entryp->mUserData); @@ -2436,7 +2445,6 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()  	if (mLoadedCallbackList.empty())  	{  		gTextureList.mCallbackList.erase(this); -		mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;  	}  	// Done with any raw image data at this point (will be re-created if we still have callbacks) @@ -2516,6 +2524,11 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level)  	return mRawImage;  } +bool LLViewerFetchedTexture::needsToSaveRawImage() +{ +	return mForceToSaveRawImage || mSaveRawImage ; +} +  void LLViewerFetchedTexture::destroyRawImage()  {	  	if (mAuxRawImage.notNull()) sAuxCount--; @@ -2526,7 +2539,7 @@ void LLViewerFetchedTexture::destroyRawImage()  		if(mIsRawImageValid)  		{ -			if(mForceToSaveRawImage) +			if(needsToSaveRawImage())  			{  				saveRawImage() ;  			}		 @@ -2658,7 +2671,7 @@ void LLViewerFetchedTexture::saveRawImage()  	mSavedRawDiscardLevel = mRawDiscardLevel ;  	mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()) ; -	if(mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel) +	if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel)  	{  		mForceToSaveRawImage = FALSE ;  	} @@ -2691,13 +2704,10 @@ void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, bool from_  void LLViewerFetchedTexture::destroySavedRawImage()  {  	clearCallbackEntryList() ; -	//if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0 && mDesiredSavedRawDiscardLevel < getDiscardLevel()) -	//{ -	//	return ; //can not destroy the saved raw image before it is fully fetched, otherwise causing callbacks hanging there. -	//} - +	  	mSavedRawImage = NULL ;  	mForceToSaveRawImage  = FALSE ; +	mSaveRawImage = FALSE ;  	mSavedRawDiscardLevel = -1 ;  	mDesiredSavedRawDiscardLevel = -1 ;  	mLastReferencedSavedRawImageTime = 0.0f ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 7cb8bea4c8..b779396293 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -441,6 +441,7 @@ public:  	LLImageRaw* reloadRawImage(S8 discard_level) ;  	void destroyRawImage(); +	bool needsToSaveRawImage();  	const std::string& getUrl() const {return mUrl;}  	//--------------- @@ -532,6 +533,7 @@ protected:  	S8              mLoadedCallbackDesiredDiscardLevel;  	BOOL            mPauseLoadedCallBacks;  	callback_list_t mLoadedCallbackList; +	F32             mLastCallBackActiveTime;  	LLPointer<LLImageRaw> mRawImage;  	S32 mRawDiscardLevel; @@ -543,6 +545,7 @@ protected:  	//keep a copy of mRawImage for some special purposes  	//when mForceToSaveRawImage is set.  	BOOL mForceToSaveRawImage ; +	BOOL mSaveRawImage;  	LLPointer<LLImageRaw> mSavedRawImage;  	S32 mSavedRawDiscardLevel;  	S32 mDesiredSavedRawDiscardLevel; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index bbf7c8e60e..275dfaa996 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1161,6 +1161,8 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem)  // static  void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_data)  { +	static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; +  	LLFastTimer t(FTM_PROCESS_IMAGES);  	// Receive image header, copy into image object and decompresses  @@ -1171,14 +1173,16 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d  	char ip_string[256];  	u32_to_ip_string(msg->getSenderIP(),ip_string); +	U32 received_size ;  	if (msg->getReceiveCompressedSize())  	{ -		gTextureList.sTextureBits += msg->getReceiveCompressedSize() * 8; +		received_size = msg->getReceiveCompressedSize() ;		  	}  	else  	{ -		gTextureList.sTextureBits += msg->getReceiveSize() * 8; +		received_size = msg->getReceiveSize() ;		  	} +	gTextureList.sTextureBits += received_size * 8;  	gTextureList.sTexturePackets++;  	U8 codec; @@ -1213,6 +1217,11 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d  		delete [] data;  		return;  	} +	if(log_texture_traffic) +	{ +		gTotalTextureBytesPerBoostLevel[image->getBoostLevel()] += received_size ; +	} +  	//image->getLastPacketTimer()->reset();  	bool res = LLAppViewer::getTextureFetch()->receiveImageHeader(msg->getSender(), id, codec, packets, totalbytes, data_size, data);  	if (!res) @@ -1224,6 +1233,8 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d  // static  void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_data)  { +	static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; +  	LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);  	LLFastTimer t(FTM_PROCESS_IMAGES); @@ -1236,14 +1247,16 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d  	char ip_string[256];  	u32_to_ip_string(msg->getSenderIP(),ip_string); +	U32 received_size ;  	if (msg->getReceiveCompressedSize())  	{ -		gTextureList.sTextureBits += msg->getReceiveCompressedSize() * 8; +		received_size = msg->getReceiveCompressedSize() ;  	}  	else  	{ -		gTextureList.sTextureBits += msg->getReceiveSize() * 8; +		received_size = msg->getReceiveSize() ;		  	} +	gTextureList.sTextureBits += received_size * 8;  	gTextureList.sTexturePackets++;  	//llprintline("Start decode, image header..."); @@ -1277,6 +1290,11 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d  		delete [] data;  		return;  	} +	if(log_texture_traffic) +	{ +		gTotalTextureBytesPerBoostLevel[image->getBoostLevel()] += received_size ; +	} +  	//image->getLastPacketTimer()->reset();  	bool res = LLAppViewer::getTextureFetch()->receiveImagePacket(msg->getSender(), id, packet_num, data_size, data);  	if (!res) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0e494e90ee..040c7523de 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -306,6 +306,8 @@ public:  	void update()  	{ +		static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; +  		std::string wind_vel_text;  		std::string wind_vector_text;  		std::string rwind_vel_text; @@ -582,6 +584,23 @@ public:  				ypos += y_inc;  			}  		} +		if(log_texture_traffic) +		{	 +			U32 old_y = ypos ; +			for(S32 i = LLViewerTexture::BOOST_NONE; i < LLViewerTexture::MAX_GL_IMAGE_CATEGORY; i++) +			{ +				if(gTotalTextureBytesPerBoostLevel[i] > 0) +				{ +					addText(xpos, ypos, llformat("Boost_Level %d:  %.3f MB", i, (F32)gTotalTextureBytesPerBoostLevel[i] / (1024 * 1024))); +					ypos += y_inc; +				} +			} +			if(ypos != old_y) +			{ +				addText(xpos, ypos, "Network traffic for textures:"); +				ypos += y_inc; +			} +		}  	}  	void draw() @@ -1341,7 +1360,7 @@ LLViewerWindow::LLViewerWindow(  		gSavedSettings.getBOOL("DisableVerticalSync"),  		!gNoRender,  		ignore_pixel_depth, -		0); //gSavedSettings.getU32("RenderFSAASamples")); +		gSavedSettings.getBOOL("RenderUseFBO") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled  	if (!LLAppViewer::instance()->restoreErrorTrap())  	{ diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 8bdb8e069e..1cb3962daa 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -28,6 +28,7 @@  #include "llvocache.h"  #include "llerror.h"  #include "llregionhandle.h" +#include "llviewercontrol.h"  BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes)   { @@ -232,11 +233,11 @@ LLVOCache* LLVOCache::sInstance = NULL;  //static   LLVOCache* LLVOCache::getInstance()  -{ +{	  	if(!sInstance)  	{  		sInstance = new LLVOCache() ; -} +	}  	return sInstance ;  } @@ -262,13 +263,17 @@ LLVOCache::LLVOCache():  	mNumEntries(0),  	mCacheSize(1)  { +	mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled");  	mLocalAPRFilePoolp = new LLVolatileAPRPool() ;  }  LLVOCache::~LLVOCache()  { -	writeCacheHeader(); -	clearCacheInMemory(); +	if(mEnabled) +	{ +		writeCacheHeader(); +		clearCacheInMemory(); +	}  	delete mLocalAPRFilePoolp;  } @@ -282,7 +287,7 @@ void LLVOCache::setDirNames(ELLPath location)  void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version)  { -	if(mInitialized) +	if(mInitialized || !mEnabled)  	{  		return ;  	} @@ -409,6 +414,11 @@ BOOL LLVOCache::checkWrite(LLAPRFile* apr_file, void* src, S32 n_bytes)  void LLVOCache::readCacheHeader()  { +	if(!mEnabled) +	{ +		return ; +	} +  	//clear stale info.  	clearCacheInMemory();	 @@ -453,7 +463,7 @@ void LLVOCache::readCacheHeader()  void LLVOCache::writeCacheHeader()  { -	if(mReadOnly) +	if(mReadOnly || !mEnabled)  	{  		return ;  	}	 @@ -504,6 +514,10 @@ BOOL LLVOCache::updateEntry(const HeaderEntryInfo* entry)  void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map)   { +	if(!mEnabled) +	{ +		return ; +	}  	llassert_always(mInitialized);  	handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ; @@ -573,6 +587,10 @@ void LLVOCache::purgeEntries()  void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache)   { +	if(!mEnabled) +	{ +		return ; +	}  	llassert_always(mInitialized);  	if(mReadOnly) diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index ccdff5e96c..ed2bc8bafe 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -129,6 +129,7 @@ private:  	BOOL checkWrite(LLAPRFile* apr_file, void* src, S32 n_bytes) ;  private: +	BOOL                 mEnabled;  	BOOL                 mInitialized ;  	BOOL                 mReadOnly ;  	HeaderMetaInfo       mMetaInfo; @@ -143,7 +144,7 @@ private:  	static LLVOCache* sInstance ;  public:  	static LLVOCache* getInstance() ; -	static BOOL       hasInstance() ; +	static BOOL       hasInstance() ;	  	static void       destroyClass() ;  }; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 8731c9e1a7..8fabaaba80 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -126,7 +126,10 @@ void LLWorld::destroyClass()  		LLViewerRegion* region_to_delete = *region_it++;  		removeRegion(region_to_delete->getHost());  	} -	LLVOCache::getInstance()->destroyClass() ; +	if(LLVOCache::hasInstance()) +	{ +		LLVOCache::getInstance()->destroyClass() ; +	}  	LLViewerPartSim::getInstance()->destroyClass();  } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 56f55b8bd7..b467df1308 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -874,7 +874,7 @@ BOOL LLPipeline::canUseWindLightShadersOnObjects() const  BOOL LLPipeline::canUseAntiAliasing() const  { -	return (gSavedSettings.getBOOL("RenderUseFBO")); +	return TRUE; //(gSavedSettings.getBOOL("RenderUseFBO"));  }  void LLPipeline::unloadShaders() diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index 27f8b4bb39..0ea42f9757 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -71,6 +71,18 @@           name="16x"           value="16" />      </combo_box> +   <text +     type="string" +     length="1" +     follows="left|top" +     height="12" +     layout="topleft" +     left_pad="10" +     name="antialiasing restart" +     top_delta="0" +     width="188"> +      (requires viewer restart) +    </text>      <spinner       control_name="RenderGamma"       decimal_digits="2" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 43058a5ee3..b36cf13f1b 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3058,15 +3058,6 @@          <menu_item_separator/> -        <menu_item_check -         label="Show Admin Menu" -         name="View Admin Options"> -            <menu_item_check.on_check -             function="Advanced.CheckViewAdminOptions" -             parameter="ViewAdminOptions" /> -            <menu_item_check.on_click -             function="Advanced.ToggleViewAdminOptions" /> -        </menu_item_check>          <menu_item_call           label="Request Admin Status"           name="Request Admin Options" @@ -3081,6 +3072,17 @@              <menu_item_call.on_click               function="Advanced.LeaveAdminStatus" />          </menu_item_call> +        <menu_item_check +         label="Show Admin Menu" +         name="View Admin Options"> +            <menu_item_check.on_enable +             function="Advanced.EnableViewAdminOptions" /> +            <menu_item_check.on_check +             function="Advanced.CheckViewAdminOptions" +             parameter="ViewAdminOptions" /> +            <menu_item_check.on_click +             function="Advanced.ToggleViewAdminOptions" /> +        </menu_item_check>      </menu>      <menu       create_jump_keys="true" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4ee04b44b6..1f747ab997 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6339,7 +6339,6 @@ You sent out an update of your appearance after [TIME] seconds.  [STATUS]    </notification> -    <notification     icon="notifytip.tga"     name="AvatarRezCloudNotification" | 
