From 35eda06ae47255f4d4ba15ab7e3df443c1c39a6e Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Wed, 18 Jul 2012 17:35:10 -0700 Subject: llglheader include change for building on Lion --- indra/llrender/llglheaders.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index a0727b8686..d93f464502 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -993,7 +993,12 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); } #endif +#ifdef MAC_OS_VERSION_10_7 +#include +#else #include +#endif + #endif // LL_MESA / LL_WINDOWS / LL_DARWIN -- cgit v1.2.3 From afcc61a07a0449f390643aafea479e5ab068bda6 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 19 Jul 2012 15:31:33 -0600 Subject: fix for SH-3238: Textures are loaded at lower detail on subsequent log-ins --- indra/llrender/llimagegl.cpp | 17 ++++++++++------- indra/llrender/llimagegl.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index c04a3f6b41..c962193565 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -470,7 +470,7 @@ bool LLImageGL::checkSize(S32 width, S32 height) return check_power_of_two(width) && check_power_of_two(height); } -void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents) +void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level) { if (width != mWidth || height != mHeight || ncomponents != mComponents) { @@ -503,6 +503,11 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents) width >>= 1; height >>= 1; } + + if(discard_level > 0) + { + mMaxDiscardLevel = llmax(mMaxDiscardLevel, (S8)discard_level); + } } else { @@ -836,14 +841,13 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image) llassert(mCurrentDiscardLevel >= 0); discard_level = mCurrentDiscardLevel; } - discard_level = llclamp(discard_level, 0, (S32)mMaxDiscardLevel); - + // Actual image width/height = raw image width/height * 2^discard_level S32 w = raw_image->getWidth() << discard_level; S32 h = raw_image->getHeight() << discard_level; // setSize may call destroyGLTexture if the size does not match - setSize(w, h, raw_image->getComponents()); + setSize(w, h, raw_image->getComponents(), discard_level); if( !mHasExplicitFormat ) { @@ -1197,8 +1201,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S llassert(mCurrentDiscardLevel >= 0); discard_level = mCurrentDiscardLevel; } - discard_level = llclamp(discard_level, 0, (S32)mMaxDiscardLevel); - + // Actual image width/height = raw image width/height * 2^discard_level S32 raw_w = imageraw->getWidth() ; S32 raw_h = imageraw->getHeight() ; @@ -1206,7 +1209,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S S32 h = raw_h << discard_level; // setSize may call destroyGLTexture if the size does not match - setSize(w, h, imageraw->getComponents()); + setSize(w, h, imageraw->getComponents(), discard_level); if( !mHasExplicitFormat ) { diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index f34b9fa91a..ee240f2797 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -92,7 +92,7 @@ protected: public: virtual void dump(); // debugging info to llinfos - void setSize(S32 width, S32 height, S32 ncomponents); + void setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level = -1); void setComponents(S32 ncomponents) { mComponents = (S8)ncomponents ;} void setAllowCompression(bool allow) { mAllowCompression = allow; } -- cgit v1.2.3 From a1d026889343b4745eeebffc85695bbcb2b93d64 Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Tue, 24 Jul 2012 16:52:33 -0700 Subject: Minor improvement to identifying gl lib to use. Should use xcode version. --- indra/llrender/llglheaders.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index d93f464502..509de51f4d 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -993,7 +993,7 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); } #endif -#ifdef MAC_OS_VERSION_10_7 +#if __MAC_OS_X_VERSION_MAX_ALLOWED <= 1070 #include #else #include -- cgit v1.2.3