1. simon_linden
  2. viewer-rabbit

Commits

Monty Brandenberg  committed 527bf97 Merge

Merge from viewer-development.

  • Participants
  • Parent commits 9ab2ee2, 8ea4160
  • Branches default

Comments (0)

Files changed (143)

File .hgtags

View file
 09984bfa6cae17e0f72d02b75c1b7393c65eecfc 2.7.5-beta1
 e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-start
 502f6a5deca9365ddae57db4f1e30172668e171e 2.8.1-start
+c04e68e1b0034fd0a20815ae24c77e5f8428e822 DRTVWR-188
 888768f162d2c0a8de1dcc5fb9a08bd8bd120a6b DRTVWR-175
 2a3965b3ad202df7ea25d2be689291bb14a1280e DRTVWR-155
 6866d9df6efbd441c66451debd376d21211de39c DRTVWR-68_2.7.5-release
 28e100d0379a2b0710c57647a28fc5239d3d7b99 3.3.4-release
 a8b3eca451a9eaab59987efb0ab1c4217e3f2dcc DRTVWR-182
 1f27cdfdc54246484f8afbbe42ce48e954175cbd 3.4.0-beta1
+81f6b745ef27f5915fd07f988fdec9944f2bb73e DRTVWR-186
+cc953f00956be52cc64c30637bbeec310eea603f DRTVWR-181
+9ee9387789701d597130f879d9011a4958753862 DRTVWR-189

File indra/llcommon/indra_constants.h

View file
 	STAT_FILTER_BY_PARCEL	= 0x00000001,
 	STAT_FILTER_BY_OWNER	= 0x00000002,
 	STAT_FILTER_BY_OBJECT	= 0x00000004,
+	STAT_FILTER_BY_PARCEL_NAME	= 0x00000008,
 	STAT_REQUEST_LAST_ENTRY	= 0x80000000,
 };
 

File indra/llcommon/llinitparam.h

View file
 #include <boost/shared_ptr.hpp>
 
 #include "llerror.h"
-#include "lltypeinfolookup.h"
+#include "llstl.h"
 
 namespace LLInitParam
 {
 
 	public:
 		
-		struct CompareTypeID
-		{
-			bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
-			{
-				return lhs->before(*rhs);
-			}
-		};
-
 		typedef std::vector<std::pair<std::string, bool> >					name_stack_t;
 		typedef std::pair<name_stack_t::iterator, name_stack_t::iterator>	name_stack_range_t;
 		typedef std::vector<std::string>									possible_values_t;
 		typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&);
 		typedef boost::function<void (name_stack_t&, S32, S32, const possible_values_t*)>	parser_inspect_func_t;
 
-		typedef LLTypeInfoLookup<parser_read_func_t>		parser_read_func_map_t;
-		typedef LLTypeInfoLookup<parser_write_func_t>		parser_write_func_map_t;
-		typedef LLTypeInfoLookup<parser_inspect_func_t>		parser_inspect_func_map_t;
+		typedef std::map<const std::type_info*, parser_read_func_t>		parser_read_func_map_t;
+		typedef std::map<const std::type_info*, parser_write_func_t>	parser_write_func_map_t;
+		typedef std::map<const std::type_info*, parser_inspect_func_t>	parser_inspect_func_map_t;
 
 		Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
 		:	mParseSilently(false),

File indra/llcommon/llregistry.h

View file
 
 #include <boost/type_traits.hpp>
 #include "llsingleton.h"
-#include "lltypeinfolookup.h"
+#include "llstl.h"
 
 template <typename T>
-class LLRegistryDefaultComparator
+struct LLRegistryDefaultComparator
 {
-	bool operator()(const T& lhs, const T& rhs) { return lhs < rhs; }
-};
-
-template <typename KEY, typename VALUE>
-struct LLRegistryMapSelector
-{
-    typedef std::map<KEY, VALUE> type;
-};
-
-template <typename VALUE>
-struct LLRegistryMapSelector<std::type_info*, VALUE>
-{
-    typedef LLTypeInfoLookup<VALUE> type;
-};
-
-template <typename VALUE>
-struct LLRegistryMapSelector<const std::type_info*, VALUE>
-{
-    typedef LLTypeInfoLookup<VALUE> type;
+	bool operator()(const T& lhs, const T& rhs) const
+	{
+		using std::less;
+		return less<T>()(lhs, rhs);
+	}
 };
 
 template <typename KEY, typename VALUE, typename COMPARATOR = LLRegistryDefaultComparator<KEY> >
 	{
 		friend class LLRegistry<KEY, VALUE, COMPARATOR>;
 	public:
-		typedef typename LLRegistryMapSelector<KEY, VALUE>::type registry_map_t;
+		typedef std::map<KEY, VALUE, COMPARATOR> registry_map_t;
 
 		bool add(ref_const_key_t key, ref_const_value_t value)
 		{

File indra/llcommon/llstl.h

View file
 #include <vector>
 #include <set>
 #include <deque>
+#include <typeinfo>
 
 // Use to compare the first element only of a pair
 // e.g. typedef std::set<std::pair<int, Data*>, compare_pair<int, Data*> > some_pair_set_t; 
   return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
 }
 
+/**
+ * Compare std::type_info* pointers a la std::less. We break this out as a
+ * separate function for use in two different std::less specializations.
+ */
+inline
+bool before(const std::type_info* lhs, const std::type_info* rhs)
+{
+#if LL_LINUX && defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
+    // If we're building on Linux with gcc, and it's either gcc 3.x or
+    // 4.{0,1,2,3}, then we have to use a workaround. Note that we use gcc on
+    // Mac too, and some people build with gcc on Windows (cygwin or mingw).
+    // On Linux, different load modules may produce different type_info*
+    // pointers for the same type. Have to compare name strings to get good
+    // results.
+    return strcmp(lhs->name(), rhs->name()) < 0;
+#else  // not Linux, or gcc 4.4+
+    // Just use before(), as we normally would
+    return lhs->before(*rhs);
+#endif
+}
+
+/**
+ * Specialize std::less<std::type_info*> to use std::type_info::before().
+ * See MAINT-1175. It is NEVER a good idea to directly compare std::type_info*
+ * because, on Linux, you might get different std::type_info* pointers for the
+ * same type (from different load modules)!
+ */
+namespace std
+{
+	template <>
+	struct less<const std::type_info*>:
+		public std::binary_function<const std::type_info*, const std::type_info*, bool>
+	{
+		bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
+		{
+			return before(lhs, rhs);
+		}
+	};
+
+	template <>
+	struct less<std::type_info*>:
+		public std::binary_function<std::type_info*, std::type_info*, bool>
+	{
+		bool operator()(std::type_info* lhs, std::type_info* rhs) const
+		{
+			return before(lhs, rhs);
+		}
+	};
+} // std
+
 #endif // LL_LLSTL_H

File indra/llcommon/lltypeinfolookup.h

View file
 #if ! defined(LL_LLTYPEINFOLOOKUP_H)
 #define LL_LLTYPEINFOLOOKUP_H
 
-#include "llsortedvector.h"
+#include <boost/unordered_map.hpp>
+#include <boost/functional/hash.hpp>
+#include <boost/optional.hpp>
+#include <functional>               // std::binary_function
 #include <typeinfo>
 
 /**
+ * The following helper classes are based on the Boost.Unordered documentation:
+ * http://www.boost.org/doc/libs/1_45_0/doc/html/unordered/hash_equality.html
+ */
+
+/**
+ * Compute hash for a string passed as const char*
+ */
+struct const_char_star_hash: public std::unary_function<const char*, std::size_t>
+{
+    std::size_t operator()(const char* str) const
+    {
+        std::size_t seed = 0;
+        for ( ; *str; ++str)
+        {
+            boost::hash_combine(seed, *str);
+        }
+        return seed;
+    }
+};
+
+/**
+ * Compute equality for strings passed as const char*
+ *
+ * I (nat) suspect that this is where the default behavior breaks for the
+ * const char* values returned from std::type_info::name(). If you compare the
+ * two const char* pointer values, as a naive, unspecialized implementation
+ * will surely do, they'll compare unequal.
+ */
+struct const_char_star_equal: public std::binary_function<const char*, const char*, bool>
+{
+    bool operator()(const char* lhs, const char* rhs) const
+    {
+        return strcmp(lhs, rhs) == 0;
+    }
+};
+
+/**
  * LLTypeInfoLookup is specifically designed for use cases for which you might
  * consider std::map<std::type_info*, VALUE>. We have several such data
  * structures in the viewer. The trouble with them is that at least on Linux,
  * different load modules will produce different std::type_info*.
  * LLTypeInfoLookup contains a workaround to address this issue.
  *
- * Specifically, when we don't find the passed std::type_info*,
- * LLTypeInfoLookup performs a linear search over registered entries to
- * compare name() strings. Presuming that this succeeds, we cache the new
- * (previously unrecognized) std::type_info* to speed future lookups.
- *
- * This worst-case fallback search (linear search with string comparison)
- * should only happen the first time we look up a given type from a particular
- * load module other than the one from which we initially registered types.
- * (However, a lookup which wouldn't succeed anyway will always have
- * worst-case performance.) This class is probably best used with less than a
- * few dozen different types.
+ * The API deliberately diverges from std::map in several respects:
+ * * It avoids iterators, not only begin()/end() but also as return values
+ *   from insert() and find(). This bypasses transform_iterator overhead.
+ * * Since we literally use compile-time types as keys, the essential insert()
+ *   and find() methods accept the key type as a @em template parameter,
+ *   accepting and returning value_type as a normal runtime value. This is to
+ *   permit future optimization (e.g. compile-time type hashing) without
+ *   changing the API.
  */
 template <typename VALUE>
 class LLTypeInfoLookup
 {
+    // Use this for our underlying implementation: lookup by
+    // std::type_info::name() string. This is one of the rare cases in which I
+    // dare use const char* directly, rather than std::string, because I'm
+    // sure that every value returned by std::type_info::name() is static.
+    // HOWEVER, specify our own hash + equality functors: naively comparing
+    // distinct const char* values won't work.
+    typedef boost::unordered_map<const char*, VALUE,
+                                 const_char_star_hash, const_char_star_equal> impl_map_type;
+
 public:
-    typedef LLTypeInfoLookup<VALUE> self;
-    typedef LLSortedVector<const std::type_info*, VALUE> vector_type;
-    typedef typename vector_type::key_type key_type;
-    typedef typename vector_type::mapped_type mapped_type;
-    typedef typename vector_type::value_type value_type;
-    typedef typename vector_type::iterator iterator;
-    typedef typename vector_type::const_iterator const_iterator;
+    typedef VALUE value_type;
 
     LLTypeInfoLookup() {}
 
-    iterator begin() { return mVector.begin(); }
-    iterator end()   { return mVector.end(); }
-    const_iterator begin() const { return mVector.begin(); }
-    const_iterator end()   const { return mVector.end(); }
-    bool empty() const { return mVector.empty(); }
-    std::size_t size() const { return mVector.size(); }
+    bool empty() const { return mMap.empty(); }
+    std::size_t size() const { return mMap.size(); }
 
-    std::pair<iterator, bool> insert(const std::type_info* key, const VALUE& value)
+    template <typename KEY>
+    bool insert(const value_type& value)
     {
-        return insert(value_type(key, value));
+        // Obtain and store the std::type_info::name() string as the key.
+        // Return just the bool from std::map::insert()'s return pair.
+        return mMap.insert(typename impl_map_type::value_type(typeid(KEY).name(), value)).second;
     }
 
-    std::pair<iterator, bool> insert(const value_type& pair)
+    template <typename KEY>
+    boost::optional<value_type> find() const
     {
-        return mVector.insert(pair);
-    }
-
-    // const find() forwards to non-const find(): this can alter mVector!
-    const_iterator find(const std::type_info* key) const
-    {
-        return const_cast<self*>(this)->find(key);
-    }
-
-    // non-const find() caches previously-unknown type_info* to speed future
-    // lookups.
-    iterator find(const std::type_info* key)
-    {
-        iterator found = mVector.find(key);
-        if (found != mVector.end())
-        {
-            // If LLSortedVector::find() found, great, we're done.
-            return found;
-        }
-        // Here we didn't find the passed type_info*. On Linux, though, even
-        // for the same type, typeid(sametype) produces a different type_info*
-        // when used in different load modules. So the fact that we didn't
-        // find the type_info* we seek doesn't mean this type isn't
-        // registered. Scan for matching name() string.
-        for (typename vector_type::iterator ti(mVector.begin()), tend(mVector.end());
-             ti != tend; ++ti)
-        {
-            if (std::string(ti->first->name()) == key->name())
-            {
-                // This unrecognized 'key' is for the same type as ti->first.
-                // To speed future lookups, insert a new entry that lets us
-                // look up ti->second using this same 'key'.
-                return insert(key, ti->second).first;
-            }
-        }
-        // We simply have never seen a type with this type_info* from any load
-        // module.
-        return mVector.end();
+        // Use the std::type_info::name() string as the key.
+        typename impl_map_type::const_iterator found = mMap.find(typeid(KEY).name());
+        if (found == mMap.end())
+            return boost::optional<value_type>();
+        return found->second;
     }
 
 private:
-    vector_type mVector;
+    impl_map_type mMap;
 };
 
 #endif /* ! defined(LL_LLTYPEINFOLOOKUP_H) */

File indra/llrender/llglstates.h

View file
 	LLGLEnable mColorMaterial;
 	LLGLDisable mAlphaTest, mBlend, mCullFace, mDither, mFog, 
 		mLineSmooth, mLineStipple, mNormalize, mPolygonSmooth,
-		mTextureGenQ, mTextureGenR, mTextureGenS, mTextureGenT,
 		mGLMultisample;
 public:
 	LLGLSDefault()
 		mLineStipple(GL_LINE_STIPPLE),
 		mNormalize(GL_NORMALIZE),
 		mPolygonSmooth(GL_POLYGON_SMOOTH),
-		mTextureGenQ(GL_TEXTURE_GEN_Q), 
-		mTextureGenR(GL_TEXTURE_GEN_R),
-		mTextureGenS(GL_TEXTURE_GEN_S), 
-		mTextureGenT(GL_TEXTURE_GEN_T),
 		mGLMultisample(GL_MULTISAMPLE_ARB)
 	{ }
 };

File indra/llrender/llrender.cpp

View file
 		gGL.flush();
 		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
 	}
-
+	
 	// We want an early out, because this function does a LOT of stuff.
 	if ( ( (isAlpha && (mCurrAlphaOp == op) && (mCurrAlphaSrc1 == src1) && (mCurrAlphaSrc2 == src2))
 			|| (!isAlpha && (mCurrColorOp == op) && (mCurrColorSrc1 == src1) && (mCurrColorSrc2 == src2)) ) && !gGL.mDirty)
 	mMatrixMode = mode;
 }
 
+U32 LLRender::getMatrixMode()
+{
+	if (mMatrixMode >= MM_TEXTURE0 && mMatrixMode <= MM_TEXTURE3)
+	{ //always return MM_TEXTURE if current matrix mode points at any texture matrix
+		return MM_TEXTURE;
+	}
+
+	return mMatrixMode;
+}
+
+
 void LLRender::loadIdentity()
 {
 	flush();

File indra/llrender/llrender.h

View file
 	void loadIdentity();
 	void multMatrix(const GLfloat* m);
 	void matrixMode(U32 mode);	
+	U32 getMatrixMode();
 
 	const glh::matrix4f& getModelviewMatrix();
 	const glh::matrix4f& getProjectionMatrix();

File indra/llrender/llshadermgr.cpp

View file
 		text[count++] = strdup("#define textureCube texture\n");
 		text[count++] = strdup("#define texture2DLod textureLod\n");
 		text[count++] = strdup("#define	shadow2D(a,b) vec2(texture(a,b))\n");
-
+		
 		if (major_version > 1 || minor_version >= 40)
 		{ //GLSL 1.40 replaces texture2DRect et al with texture
 			text[count++] = strdup("#define texture2DRect texture\n");

File indra/llrender/llvertexbuffer.cpp

View file
 
 
 
+
 void LLVBOPool::cleanup()
 {
 	U32 size = LL_VBO_BLOCK_SIZE;

File indra/llui/llfloater.cpp

File contents unchanged.

File indra/llui/llradiogroup.cpp

File contents unchanged.

File indra/llui/llrngwriter.cpp

File contents unchanged.

File indra/llui/llscrolllistcolumn.cpp

File contents unchanged.

File indra/llui/llscrolllistctrl.cpp

View file
 	return !mSortColumns.empty();
 }
 
+void LLScrollListCtrl::clearSortOrder()
+{
+	mSortColumns.clear();
+}
+
 void LLScrollListCtrl::clearColumns()
 {
 	column_map_t::iterator itor;

File indra/llui/llscrolllistctrl.h

View file
 	std::string     getSortColumnName();
 	BOOL			getSortAscending() { return mSortColumns.empty() ? TRUE : mSortColumns.back().second; }
 	BOOL			hasSortOrder() const;
+	void			clearSortOrder();
 
 	S32		selectMultiple( uuid_vec_t ids );
 	// conceptually const, but mutates mItemList

File indra/llui/lltextbase.cpp

File contents unchanged.

File indra/llui/lltooltip.cpp

File contents unchanged.

File indra/llui/lluictrlfactory.cpp

File contents unchanged.

File indra/llui/lluictrlfactory.h

View file
 #include "llinitparam.h"
 #include "llregistry.h"
 #include "llxuiparser.h"
+#include "llstl.h"
 
 class LLView;
 
-// sort functor for typeid maps
-struct LLCompareTypeID
-{
-	bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
-	{
-		return lhs->before(*rhs);
-	}
-};
-
 // lookup widget constructor funcs by widget name
 template <typename DERIVED_TYPE>
 class LLChildRegistry : public LLRegistrySingleton<std::string, LLWidgetCreatorFunc, DERIVED_TYPE>
 
 // lookup widget name by type
 class LLWidgetNameRegistry 
-:	public LLRegistrySingleton<const std::type_info*, std::string, LLWidgetNameRegistry , LLCompareTypeID>
+:	public LLRegistrySingleton<const std::type_info*, std::string, LLWidgetNameRegistry>
 {};
 
 // lookup function for generating empty param block by widget type
 // this is used for schema generation
 //typedef const LLInitParam::BaseBlock& (*empty_param_block_func_t)();
 //class LLDefaultParamBlockRegistry
-//:	public LLRegistrySingleton<const std::type_info*, empty_param_block_func_t, LLDefaultParamBlockRegistry, LLCompareTypeID>
+//:	public LLRegistrySingleton<const std::type_info*, empty_param_block_func_t, LLDefaultParamBlockRegistry>
 //{};
 
 extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP;

File indra/llui/llxuiparser.cpp

File contents unchanged.

File indra/llui/llxuiparser.h

File contents unchanged.

File indra/newview/app_settings/settings.xml

View file
     <key>Type</key>
     <string>F32</string>
     <key>Value</key>
-    <real>0</real>
+    <real>-0.007</real>
   </map>
   <key>RenderShadowOffsetError</key>
   <map>

File indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl

View file
 VARYING vec4 vertex_color;
 VARYING vec2 vary_texcoord0;
 
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
+uniform sampler2DShadow shadowMap0;
+uniform sampler2DShadow shadowMap1;
+uniform sampler2DShadow shadowMap2;
+uniform sampler2DShadow shadowMap3;
 uniform sampler2DRect depthMap;
 
 uniform mat4 shadow_matrix[6];
 
 uniform mat4 inv_proj;
 
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc)
+float pcfShadow(sampler2DShadow shadowMap, vec4 stc)
 {
 	stc.xyz /= stc.w;
 	stc.z += shadow_bias;
-
-	stc.x = floor(stc.x + fract(stc.y*12345)); // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
+		
+	stc.x = floor(stc.x*shadow_res.x + fract(stc.y*shadow_res.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
 	
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 	float shadow = cs;
-
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(2.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(1.0, -1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-1.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-2.0, -1.5, 0.0)).x;
-                        
-        return shadow*0.2;
+	
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+                       
+    return shadow*0.2;
 }
 
 
 		if (spos.z < near_split.z)
 		{
 			lpos = shadow_matrix[3]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
 			shadow += pcfShadow(shadowMap3, lpos)*w;
 		if (spos.z < near_split.y && spos.z > far_split.z)
 		{
 			lpos = shadow_matrix[2]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
 			w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
 		if (spos.z < near_split.x && spos.z > far_split.y)
 		{
 			lpos = shadow_matrix[1]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
 			w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
 		if (spos.z > far_split.x)
 		{
 			lpos = shadow_matrix[0]*spos;
-			lpos.xy *= shadow_res;
-				
+							
 			float w = 1.0;
 			w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
 				

File indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl

View file
 #define frag_color gl_FragColor
 #endif
 
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
+uniform sampler2DShadow shadowMap0;
+uniform sampler2DShadow shadowMap1;
+uniform sampler2DShadow shadowMap2;
+uniform sampler2DShadow shadowMap3;
 uniform sampler2DRect depthMap;
 uniform sampler2D diffuseMap;
 
 uniform mat4 shadow_matrix[6];
 uniform vec4 shadow_clip;
 uniform vec2 screen_res;
-uniform vec2 shadow_res;
 
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 VARYING vec2 vary_texcoord0;
 VARYING vec4 vertex_color;
 
+uniform vec2 shadow_res;
 uniform float shadow_bias;
 
 uniform mat4 inv_proj;
 	return pos;
 }
 
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc)
+float pcfShadow(sampler2DShadow shadowMap, vec4 stc)
 {
 	stc.xyz /= stc.w;
 	stc.z += shadow_bias;
 
-	stc.x = floor(stc.x + fract(stc.y*12345)); // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
+	stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
 	
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 	float shadow = cs;
-
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(2.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(1.0, -1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-1.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-2.0, -1.5, 0.0)).x;
+	
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
                         
-        return shadow*0.2;
+    return shadow*0.2;
 }
 
 
 		if (spos.z < near_split.z)
 		{
 			lpos = shadow_matrix[3]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
 			shadow += pcfShadow(shadowMap3, lpos)*w;
 		if (spos.z < near_split.y && spos.z > far_split.z)
 		{
 			lpos = shadow_matrix[2]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
 			w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
 		if (spos.z < near_split.x && spos.z > far_split.y)
 		{
 			lpos = shadow_matrix[1]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
 			w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
 		if (spos.z > far_split.x)
 		{
 			lpos = shadow_matrix[0]*spos;
-			lpos.xy *= shadow_res;
-				
+							
 			float w = 1.0;
 			w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
 				

File indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl

View file
 
 uniform float minimum_alpha;
 
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
+uniform sampler2DShadow shadowMap0;
+uniform sampler2DShadow shadowMap1;
+uniform sampler2DShadow shadowMap2;
+uniform sampler2DShadow shadowMap3;
 uniform sampler2DRect depthMap;
 uniform sampler2D diffuseMap;
 
 uniform mat4 shadow_matrix[6];
 uniform vec4 shadow_clip;
 uniform vec2 screen_res;
-uniform vec2 shadow_res;
 
 vec3 atmosLighting(vec3 light);
 vec3 scaleSoftClip(vec3 light);
 VARYING vec3 vary_pointlight_col;
 VARYING vec2 vary_texcoord0;
 
+uniform vec2 shadow_res;
+
 uniform float shadow_bias;
 
 uniform mat4 inv_proj;
 	return pos;
 }
 
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc)
+float pcfShadow(sampler2DShadow shadowMap, vec4 stc)
 {
 	stc.xyz /= stc.w;
 	stc.z += shadow_bias;
 
-	stc.x = floor(stc.x + fract(stc.y*12345)); // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
+	stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 	
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
 	float shadow = cs;
 
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(2.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(1.0, -1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-1.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-2.0, -1.5, 0.0)).x;
+        shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+        shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+        shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+        shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
                         
         return shadow*0.2;
 }
 		if (spos.z < near_split.z)
 		{
 			lpos = shadow_matrix[3]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
 			shadow += pcfShadow(shadowMap3, lpos)*w;
 		if (spos.z < near_split.y && spos.z > far_split.z)
 		{
 			lpos = shadow_matrix[2]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
 			w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
 		if (spos.z < near_split.x && spos.z > far_split.y)
 		{
 			lpos = shadow_matrix[1]*spos;
-			lpos.xy *= shadow_res;
-
+			
 			float w = 1.0;
 			w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
 			w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
 		if (spos.z > far_split.x)
 		{
 			lpos = shadow_matrix[0]*spos;
-			lpos.xy *= shadow_res;
-				
+							
 			float w = 1.0;
 			w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
 				

File indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl

View file
 
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
+uniform sampler2DShadow shadowMap0;
+uniform sampler2DShadow shadowMap1;
+uniform sampler2DShadow shadowMap2;
+uniform sampler2DShadow shadowMap3;
 uniform sampler2DShadow shadowMap4;
 uniform sampler2DShadow shadowMap5;
 
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
-uniform vec2 shadow_res;
 uniform vec2 proj_shadow_res;
 uniform vec3 sun_dir;
 
+uniform vec2 shadow_res;
 uniform float shadow_bias;
 uniform float shadow_offset;
 
 	return pos;
 }
 
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
+float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
 {
 	stc.xyz /= stc.w;
-	stc.z += shadow_bias*scl;
+	stc.z += shadow_bias;
 
-	stc.x = floor(stc.x + fract(pos_screen.y*0.666666666)); // add some jitter to X sample pos according to Y to disguise the snapping going on here
+	stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*0.666666666))/shadow_res.x; // add some jitter to X sample pos according to Y to disguise the snapping going on here
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
 	float shadow = cs;
 
-	shadow += shadow2DRect(shadowMap, stc.xyz+vec3(2.0, 1.5, 0.0)).x;
-	shadow += shadow2DRect(shadowMap, stc.xyz+vec3(1.0, -1.5, 0.0)).x;
-	shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-2.0, 1.5, 0.0)).x;
-	shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-1.0, -1.5, 0.0)).x;
+	shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+	shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+	shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+	shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+
 			
-        return shadow*0.2;
+    return shadow*0.2;
 }
 
-float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
+float pcfSpotShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
 {
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	stc.x = floor(proj_shadow_res.x * stc.x + fract(pos_screen.y*0.666666666)) / proj_shadow_res.x; // snap
-	
+
 	float cs = shadow2D(shadowMap, stc.xyz).x;
 	float shadow = cs;
 
 			if (spos.z < near_split.z)
 			{
 				lpos = shadow_matrix[3]*spos;
-				lpos.xy *= shadow_res;
-
+				
 				float w = 1.0;
 				w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
 				shadow += pcfShadow(shadowMap3, lpos, 0.25, pos_screen)*w;
 			if (spos.z < near_split.y && spos.z > far_split.z)
 			{
 				lpos = shadow_matrix[2]*spos;
-				lpos.xy *= shadow_res;
-
+				
 				float w = 1.0;
 				w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
 				w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
 			if (spos.z < near_split.x && spos.z > far_split.y)
 			{
 				lpos = shadow_matrix[1]*spos;
-				lpos.xy *= shadow_res;
 
 				float w = 1.0;
 				w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
 			if (spos.z > far_split.x)
 			{
 				lpos = shadow_matrix[0]*spos;
-				lpos.xy *= shadow_res;
 				
 				float w = 1.0;
 				w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
 	
 	//spotlight shadow 1
 	vec4 lpos = shadow_matrix[4]*spos;
-	frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8, pos_screen); 
+	frag_color[2] = pcfSpotShadow(shadowMap4, lpos, 0.8, pos_screen); 
 	
 	//spotlight shadow 2
 	lpos = shadow_matrix[5]*spos;
-	frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8, pos_screen); 
+	frag_color[3] = pcfSpotShadow(shadowMap5, lpos, 0.8, pos_screen); 
 
 	//frag_color.rgb = pos.xyz;
 	//frag_color.b = shadow;

File indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl

View file
 
 uniform sampler2DRect depthMap;
 uniform sampler2DRect normalMap;
-uniform sampler2DRectShadow shadowMap0;
-uniform sampler2DRectShadow shadowMap1;
-uniform sampler2DRectShadow shadowMap2;
-uniform sampler2DRectShadow shadowMap3;
+uniform sampler2DShadow shadowMap0;
+uniform sampler2DShadow shadowMap1;
+uniform sampler2DShadow shadowMap2;
+uniform sampler2DShadow shadowMap3;
 uniform sampler2DShadow shadowMap4;
 uniform sampler2DShadow shadowMap5;
 uniform sampler2D noiseMap;
 
 uniform mat4 inv_proj;
 uniform vec2 screen_res;
-uniform vec2 shadow_res;
 uniform vec2 proj_shadow_res;
 uniform vec3 sun_dir;
 
+uniform vec2 shadow_res;
+
 uniform float shadow_bias;
 uniform float shadow_offset;
 
 	return min(ret, 1.0);
 }
 
-float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
+float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
 {
 	stc.xyz /= stc.w;
-	stc.z += shadow_bias*scl;
+	stc.z += shadow_bias;
 
-	stc.x = floor(stc.x + fract(pos_screen.y*0.666666666));
+	stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*0.666666666))/shadow_res.x;
+	float cs = shadow2D(shadowMap, stc.xyz).x;
 	
-	float cs = shadow2DRect(shadowMap, stc.xyz).x;
 	float shadow = cs;
 	
-	shadow += shadow2DRect(shadowMap, stc.xyz+vec3(2.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(1.0, -1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-1.0, 1.5, 0.0)).x;
-        shadow += shadow2DRect(shadowMap, stc.xyz+vec3(-2.0, -1.5, 0.0)).x;
-                        
+	shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x;
+    shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x;
+	         
         return shadow*0.2;
 }
 
-float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
+float pcfSpotShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen)
 {
 	stc.xyz /= stc.w;
 	stc.z += spot_shadow_bias*scl;
 	stc.x = floor(proj_shadow_res.x * stc.x + fract(pos_screen.y*0.666666666)) / proj_shadow_res.x; // snap
-	
+		
 	float cs = shadow2D(shadowMap, stc.xyz).x;
 	float shadow = cs;
 
 			if (spos.z < near_split.z)
 			{
 				lpos = shadow_matrix[3]*spos;
-				lpos.xy *= shadow_res;
-
+				
 				float w = 1.0;
 				w -= max(spos.z-far_split.z, 0.0)/transition_domain.z;
 				shadow += pcfShadow(shadowMap3, lpos, 0.25, pos_screen)*w;
 			if (spos.z < near_split.y && spos.z > far_split.z)
 			{
 				lpos = shadow_matrix[2]*spos;
-				lpos.xy *= shadow_res;
-
+				
 				float w = 1.0;
 				w -= max(spos.z-far_split.y, 0.0)/transition_domain.y;
 				w -= max(near_split.z-spos.z, 0.0)/transition_domain.z;
 			if (spos.z < near_split.x && spos.z > far_split.y)
 			{
 				lpos = shadow_matrix[1]*spos;
-				lpos.xy *= shadow_res;
-
+				
 				float w = 1.0;
 				w -= max(spos.z-far_split.x, 0.0)/transition_domain.x;
 				w -= max(near_split.y-spos.z, 0.0)/transition_domain.y;
 			if (spos.z > far_split.x)
 			{
 				lpos = shadow_matrix[0]*spos;
-				lpos.xy *= shadow_res;
-				
+								
 				float w = 1.0;
 				w -= max(near_split.x-spos.z, 0.0)/transition_domain.x;
 				
 	
 	//spotlight shadow 1
 	vec4 lpos = shadow_matrix[4]*spos;
-	frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8, pos_screen);
+	frag_color[2] = pcfSpotShadow(shadowMap4, lpos, 0.8, pos_screen);
 	
 	//spotlight shadow 2
 	lpos = shadow_matrix[5]*spos;
-	frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8, pos_screen);
+	frag_color[3] = pcfSpotShadow(shadowMap5, lpos, 0.8, pos_screen);
 
 	//frag_color.rgb = pos.xyz;
 	//frag_color.b = shadow;

File indra/newview/llavatarlistitem.cpp

File contents unchanged.

File indra/newview/lldrawable.cpp

View file
 	mPositionGroup.clear();
 	mExtents[0].clear();
 	mExtents[1].clear();
-	mQuietCount = 0;
 
 	mState     = 0;
 	mVObjp   = NULL;
 		if (!isRoot() && !mParent->isActive())
 		{
 			mParent->makeActive();
+			//NOTE: linked set will now NEVER become static
+			mParent->setState(LLDrawable::ACTIVE_CHILD);
 		}
 
 		//all child objects must also be active
 
 		if (mVObjp->getPCode() == LL_PCODE_VOLUME)
 		{
-			if (mVObjp->isFlexible())
-			{
-				return;
-			}
-		}
-	
-		if (mVObjp->getPCode() == LL_PCODE_VOLUME)
-		{
 			gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
 		}
 		updatePartition();
 	}
 
-	if (isRoot())
-	{
-		mQuietCount = 0;
-	}
-	else
-	{
-		getParent()->mQuietCount = 0;
-	}
+	llassert(isAvatar() || isRoot() || mParent->isActive());
 }
 
 
 void LLDrawable::makeStatic(BOOL warning_enabled)
 {
-	if (isState(ACTIVE))
+	if (isState(ACTIVE) && 
+		!isState(ACTIVE_CHILD) && 
+		!mVObjp->isAttachment() && 
+		!mVObjp->isFlexible())
 	{
 		clearState(ACTIVE | ANIMATED_CHILD);
 
-		if (mParent.notNull() && mParent->isActive() && warning_enabled)
-		{
-			LL_WARNS_ONCE("Drawable") << "Drawable becomes static with active parent!" << LL_ENDL;
-		}
-
+		//drawable became static with active parent, not acceptable
+		llassert(mParent.isNull() || !mParent->isActive() || !warning_enabled);
+		
 		LLViewerObject::const_child_list_t& child_list = mVObjp->getChildren();
 		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
 			 iter != child_list.end(); iter++)
 			mSpatialBridge->markDead();
 			setSpatialBridge(NULL);
 		}
+		updatePartition();
 	}
-	updatePartition();
 }
 
 // Returns "distance" between target destination and resulting xfrom
 		return FALSE;
 	}
 	
-	makeActive();
-	
 	BOOL done;
 
 	if (isState(MOVE_UNDAMPED))
 	}
 	else
 	{
+		makeActive();
 		done = updateMoveDamped();
 	}
 	return done;

File indra/newview/lldrawable.h

View file
 		RIGGED			= 0x08000000,
 		PARTITION_MOVE	= 0x10000000,
 		ANIMATED_CHILD  = 0x20000000,
+		ACTIVE_CHILD	= 0x40000000,
 	} EDrawableFlags;
 
 private: //aligned members
 	LLPointer<LLDrawable> mParent;
 
 	F32				mDistanceWRTCamera;
-	
-	S32				mQuietCount;
 
 	static S32 getCurrentFrame() { return sCurVisible; }
 	static S32 getMinVisFrameRange();

File indra/newview/lldrawpool.cpp

View file
 		gGL.loadMatrix(gGLModelView);
 		if (params.mModelMatrix)
 		{
+			llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
 			gGL.multMatrix((GLfloat*) params.mModelMatrix->mMatrix);
 		}
 		gPipeline.mMatrixOpCount++;

File indra/newview/lldrawpoolterrain.cpp

View file
 
 			if (model_matrix != gGLLastMatrix)
 			{
+				llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
 				gGLLastMatrix = model_matrix;
 				gGL.loadMatrix(gGLModelView);
 				if (model_matrix)
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.translatef(-1.f, 0.f, 0.f);
-  
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
+
 	// Set alpha texture and do lighting modulation
 	gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR);
 	gGL.getTexUnit(3)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.translatef(-1.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	// Care about alpha only
 	gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
 	gGL.matrixMode(LLRender::MM_TEXTURE);
 	gGL.loadIdentity();
 	gGL.translatef(-2.f, 0.f, 0.f);
+	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
 	// Care about alpha only
 	gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);

File indra/newview/lldrawpooltree.cpp

View file
 				gGL.loadMatrix(gGLModelView);
 				if (model_matrix)
 				{
+					llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
 					gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
 				}
 				gPipeline.mMatrixOpCount++;

File indra/newview/lldynamictexture.cpp

View file
 	llassert(mFullHeight <= 512);
 	llassert(mFullWidth <= 512);
 
-	if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete())
+	if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI)
 	{ //using offscreen render target, just use the bottom left corner
 		mOrigin.set(0, 0);
 	}
 		return TRUE;
 	}
 
-#if 0 //THIS CAUSES MAINT-1092
-	bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete();
+	bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI;
 
 	if (use_fbo)
 	{
 		gPipeline.mWaterDis.bindTarget();
 	}
-#endif
 
 	LLGLSLShader::bindNoShader();
 	LLVertexBuffer::unbind();
 		}
 	}
 
-#if 0
 	if (use_fbo)
 	{
 		gPipeline.mWaterDis.flush();
 	}
-#endif
 
 	return ret;
 }

File indra/newview/llface.cpp

File contents unchanged.

File indra/newview/llflexibleobject.cpp

View file
 #include "llvoavatar.h"
 
 /*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f;
+std::vector<LLVolumeImplFlexible*> LLVolumeImplFlexible::sInstanceList;
+std::vector<S32> LLVolumeImplFlexible::sUpdateDelay;
 
 static LLFastTimer::DeclareTimer FTM_FLEXIBLE_REBUILD("Rebuild");
 static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Update");
 	{
 		mVO->mDrawable->makeActive() ;
 	}
+
+	mInstanceIndex = sInstanceList.size();
+	sInstanceList.push_back(this);
+	sUpdateDelay.push_back(0);
 }//-----------------------------------------------
 
+LLVolumeImplFlexible::~LLVolumeImplFlexible()
+{
+	S32 end_idx = sInstanceList.size()-1;
+	
+	if (end_idx != mInstanceIndex)
+	{
+		sInstanceList[mInstanceIndex] = sInstanceList[end_idx];
+		sInstanceList[mInstanceIndex]->mInstanceIndex = mInstanceIndex;
+		sUpdateDelay[mInstanceIndex] = sUpdateDelay[end_idx];
+	}
+
+	sInstanceList.pop_back();
+	sUpdateDelay.pop_back();
+}
+
+//static
+void LLVolumeImplFlexible::updateClass()
+{
+	std::vector<S32>::iterator delay_iter = sUpdateDelay.begin();
+
+	for (std::vector<LLVolumeImplFlexible*>::iterator iter = sInstanceList.begin();
+			iter != sInstanceList.end();
+			++iter)
+	{
+		--(*delay_iter);
+		if (*delay_iter <= 0)
+		{
+			(*iter)->doIdleUpdate();
+		}
+		++delay_iter;
+	}
+}
+
 LLVector3 LLVolumeImplFlexible::getFramePosition() const
 {
 	return mVO->getRenderPosition();
 // optimization similar to what Havok does for objects that are stationary. 
 //---------------------------------------------------------------------------------
 static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
-void LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
+void LLVolumeImplFlexible::doIdleUpdate()
 {
 	LLDrawable* drawablep = mVO->mDrawable;
 
 	if (drawablep)
 	{
 		//LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
-
-		//flexible objects never go static
-		drawablep->mQuietCount = 0;
-		if (!drawablep->isRoot())
-		{
-			LLViewerObject* parent = (LLViewerObject*) mVO->getParent();
-			parent->mDrawable->mQuietCount = 0;
-		}
-
+		
+		//ensure drawable is active
+		drawablep->makeActive();
+			
 		if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
 		{
 			bool visible = drawablep->isVisible();
 				updateRenderRes();
 				gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
 			}
-			else if	(visible &&
-				!drawablep->isState(LLDrawable::IN_REBUILD_Q1) &&
-				mVO->getPixelArea() > 256.f)
+			else
 			{
-				U32 id;
 				F32 pixel_area = mVO->getPixelArea();
 
-				if (mVO->isRootEdit())
+				U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
+
+				if	(visible)
 				{
-					id = mID;
+					if (!drawablep->isState(LLDrawable::IN_REBUILD_Q1) &&
+					mVO->getPixelArea() > 256.f)
+					{
+						U32 id;
+				
+						if (mVO->isRootEdit())
+						{
+							id = mID;
+						}
+						else
+						{
+							LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
+							id = parent->getVolumeInterfaceID();
+						}
+
+						if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
+						{
+							sUpdateDelay[mInstanceIndex] = (S32) update_period-1;
+
+							updateRenderRes();
+
+							gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
+						}
+					}
 				}
 				else
 				{
-					LLVOVolume* parent = (LLVOVolume*) mVO->getParent();
-					id = parent->getVolumeInterfaceID();
-				}
-
-				U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
-
-				if ((LLDrawable::getCurrentFrame()+id)%update_period == 0)
-				{
-					updateRenderRes();
-					gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
+					sUpdateDelay[mInstanceIndex] = (S32) update_period;
 				}
 			}
+
 		}
 	}
 }
 	LLPath *path = &volume->getPath();
 	if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible()) 
 	{
-		//mVO->markForUpdate(TRUE);
-		doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0);
+		BOOL force_update = mSimulateRes == 0 ? TRUE : FALSE;
+		doIdleUpdate();
 
-		if (mSimulateRes == 0)
+		if (!force_update || !gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE))
 		{
 			return;	// we did not get updated or initialized, proceeding without can be dangerous
 		}

File indra/newview/llflexibleobject.h

View file
 //---------------------------------------------------------
 class LLVolumeImplFlexible : public LLVolumeInterface
 {
+private:
+	static std::vector<LLVolumeImplFlexible*> sInstanceList;
+	static std::vector<S32> sUpdateDelay;
+	S32 mInstanceIndex;
+
 	public:
+		static void updateClass();
+
 		LLVolumeImplFlexible(LLViewerObject* volume, LLFlexibleObjectData* attributes);
+		~LLVolumeImplFlexible();
 
 		// Implements LLVolumeInterface
 		U32 getID() const { return mID; }
 		LLQuaternion getFrameRotation() const;
 		LLVolumeInterfaceType getInterfaceType() const		{ return INTERFACE_FLEXIBLE; }
 		void updateRenderRes();
-		void doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
+		void doIdleUpdate();
 		BOOL doUpdateGeometry(LLDrawable *drawable);
 		LLVector3 getPivotPosition() const;
 		void onSetVolume(const LLVolumeParams &volume_params, const S32 detail);

File indra/newview/llfloaterland.cpp

View file
 void LLPanelLandAccess::refresh()
 {
 	LLFloater* parent_floater = gFloaterView->getParentFloater(this);
-	
-	if (mListAccess)
-		mListAccess->deleteAllItems();
-	if (mListBanned)
-		mListBanned->deleteAllItems();
-	
 	LLParcel *parcel = mParcel->getParcel();
 		
 	// Display options
 		getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name );
 		
 		// Allow list
+		if (mListAccess)
 		{
+			// Clear the sort order so we don't re-sort on every add.
+			mListAccess->clearSortOrder();
+			mListAccess->deleteAllItems();
 			S32 count = parcel->mAccessList.size();
 			getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count));
 			getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST));
 					}
 					suffix.append(" " + parent_floater->getString("Remaining") + ")");
 				}
-				if (mListAccess)
-					mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
+				mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
 			}
+			mListAccess->sortByName(TRUE);
 		}
 		
 		// Ban List
+		if(mListBanned)
 		{
+			// Clear the sort order so we don't re-sort on every add.
+			mListBanned->clearSortOrder();
+			mListBanned->deleteAllItems();
 			S32 count = parcel->mBanList.size();
 
 			getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count));
 				}
 				mListBanned->addNameItem(entry.mID, ADD_DEFAULT, TRUE, suffix);
 			}
+			mListBanned->sortByName(TRUE);
 		}
 
 		if(parcel->getRegionDenyAnonymousOverride())
 		getChildView("AccessList")->setEnabled(can_manage_allowed);
 		S32 allowed_list_count = parcel->mAccessList.size();
 		getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST);
-		BOOL has_selected = mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0;
+		BOOL has_selected = (mListAccess && mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0);
 		getChildView("remove_allowed")->setEnabled(can_manage_allowed && has_selected);
 		
 		getChildView("BannedList")->setEnabled(can_manage_banned);
 		S32 banned_list_count = parcel->mBanList.size();
 		getChildView("add_banned")->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST);
-		has_selected = mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0;
+		has_selected = (mListBanned && mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0);
 		getChildView("remove_banned")->setEnabled(can_manage_banned && has_selected);
 	}
 }

File indra/newview/llfloaterpathfindingconsole.h

View file
 
 	LLPathingLib::LLPLCharacterType getRenderHeatmapType() const;
 	void                            setRenderHeatmapType(LLPathingLib::LLPLCharacterType pRenderHeatmapType);
-
+	void onRegionBoundaryCross();
 protected:
 
 private:
 	void onClearPathClicked();
 
 	void handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus);
-	void onRegionBoundaryCross();
+	
 	void onPathEvent();
 
 	void setDefaultInputs();

File indra/newview/llfloaterpreference.cpp

View file
 #include "llviewerthrottle.h"
 #include "llvotree.h"
 #include "llvosky.h"
-
+#include "llfloaterpathfindingconsole.h"
 // linden library includes
 #include "llavatarnamecache.h"
 #include "llerror.h"
 	{
 		advanced_proxy_settings->cancel();
 	}
+	//Need to reload the navmesh if the pathing console is up
+	LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+	if ( !pathfindingConsoleHandle.isDead() )
+	{
+		LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();
+		pPathfindingConsole->onRegionBoundaryCross();
+	}
 }
 
 void LLFloaterPreference::onOpen(const LLSD& key)
 		llinfos << "Can't close preferences!" << llendl;
 	}
 
-	LLPanelLogin::updateLocationSelectorsVisibility();
+	LLPanelLogin::updateLocationSelectorsVisibility();	
+	//Need to reload the navmesh if the pathing console is up
+	LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle();
+	if ( !pathfindingConsoleHandle.isDead() )
+	{
+		LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();
+		pPathfindingConsole->onRegionBoundaryCross();
+	}
+	
 }
 
 // static 

File indra/newview/llfloaterregioninfo.cpp

View file
 	//dispatch the message
 	dispatch.dispatch(request, invoice, strings);
 
-	LLViewerRegion* region = gAgent.getRegion();
-	panel->updateControls(region);
+	panel->updateControls(gAgent.getRegion());
 }
 
 
 	BOOL manager = (region && region->isEstateManager());
 	setCtrlsEnabled(god || owner || manager);
 	
+	BOOL has_allowed_avatar = getChild<LLNameListCtrl>("allowed_avatar_name_list")->getFirstSelected() ?  TRUE : FALSE;
+	BOOL has_allowed_group = getChild<LLNameListCtrl>("allowed_group_name_list")->getFirstSelected() ?  TRUE : FALSE;
+	BOOL has_banned_agent = getChild<LLNameListCtrl>("banned_avatar_name_list")->getFirstSelected() ?  TRUE : FALSE;
+	BOOL has_estate_manager = getChild<LLNameListCtrl>("estate_manager_name_list")->getFirstSelected() ?  TRUE : FALSE;
+
 	getChildView("add_allowed_avatar_btn")->setEnabled(god || owner || manager);
-	getChildView("remove_allowed_avatar_btn")->setEnabled(god || owner || manager);
+	getChildView("remove_allowed_avatar_btn")->setEnabled(has_allowed_avatar && (god || owner || manager));
+	getChildView("allowed_avatar_name_list")->setEnabled(god || owner || manager);
+	
 	getChildView("add_allowed_group_btn")->setEnabled(god || owner || manager);
-	getChildView("remove_allowed_group_btn")->setEnabled(god || owner || manager);
+	getChildView("remove_allowed_group_btn")->setEnabled(has_allowed_group && (god || owner || manager) );
+	getChildView("allowed_group_name_list")->setEnabled(god || owner || manager);
 
 	// Can't ban people from mainland, orientation islands, etc. because this
 	// creates much network traffic and server load.
 	bool linden_estate = isLindenEstate();
 	bool enable_ban = (god || owner || manager) && !linden_estate;
 	getChildView("add_banned_avatar_btn")->setEnabled(enable_ban);
-	getChildView("remove_banned_avatar_btn")->setEnabled(enable_ban);
+	getChildView("remove_banned_avatar_btn")->setEnabled(has_banned_agent && enable_ban);
+	getChildView("banned_avatar_name_list")->setEnabled(god || owner || manager);
 
 	getChildView("message_estate_btn")->setEnabled(god || owner || manager);
 	getChildView("kick_user_from_estate_btn")->setEnabled(god || owner || manager);
 
 	// estate managers can't add estate managers
 	getChildView("add_estate_manager_btn")->setEnabled(god || owner);
-	getChildView("remove_estate_manager_btn")->setEnabled(god || owner);
+	getChildView("remove_estate_manager_btn")->setEnabled(has_estate_manager && (god || owner));
 	getChildView("estate_manager_name_list")->setEnabled(god || owner);
 
 	refresh();
 
 void LLPanelEstateInfo::updateChild(LLUICtrl* child_ctrl)
 {
-	if (checkRemovalButton(child_ctrl->getName()))
-	{
-		// do nothing
-	}
+	// Ensure appropriate state of the management ui.
+	updateControls(gAgent.getRegion());
 }
 
 bool LLPanelEstateInfo::estateUpdate(LLMessageSystem* msg)
 	getChild<LLUICtrl>("limit_payment")->setValue(estate_info.getDenyAnonymous());
 	getChild<LLUICtrl>("limit_age_verified")->setValue(estate_info.getDenyAgeUnverified());
 
-	// If visible from mainland, disable the access allowed
-	// UI, as anyone can teleport there.
-	// However, gods need to be able to edit the access list for
-	// linden estates, regardless of visibility, to allow object
-	// and L$ transfers.
-	{
-		bool visible_from_mainland = estate_info.getIsExternallyVisible();
-		bool god = gAgent.isGodlike();
-		bool linden_estate = isLindenEstate();
-
-		bool enable_agent = (!visible_from_mainland || (god && linden_estate));
-		bool enable_group = enable_agent;
-		bool enable_ban = !linden_estate;
-
-		setAccessAllowedEnabled(enable_agent, enable_group, enable_ban);
-	}
-
+	// Ensure appriopriate state of the management UI
+	updateControls(gAgent.getRegion());
 	refresh();
 }
 
 	getChild<LLUICtrl>("estate_owner")->setValue(LLSD(name));
 }
 
-void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,
-												bool enable_group,
-												bool enable_ban)
-{
-	getChildView("allow_resident_label")->setEnabled(enable_agent);
-	getChildView("allowed_avatar_name_list")->setEnabled(enable_agent);
-	getChildView("allowed_avatar_name_list")->setVisible( enable_agent);
-	getChildView("add_allowed_avatar_btn")->setEnabled(enable_agent);
-	getChildView("remove_allowed_avatar_btn")->setEnabled(enable_agent);
-
-	// Groups
-	getChildView("allow_group_label")->setEnabled(enable_group);
-	getChildView("allowed_group_name_list")->setEnabled(enable_group);