diff options
| author | Xiaohong Bao <bao@lindenlab.com> | 2012-05-01 21:29:19 -0600 | 
|---|---|---|
| committer | Xiaohong Bao <bao@lindenlab.com> | 2012-05-01 21:29:19 -0600 | 
| commit | da29210ed601f2736ca36d3657cd7b1b463b3a9b (patch) | |
| tree | ed51f81a453b2f2735d63af8e141f7ae9dd0db8a | |
| parent | aa44ec81e18fa91e718e1a22606b3f385bb8170f (diff) | |
fix a sculpt crash
| -rwxr-xr-x | indra/llrender/llimagegl.cpp | 17 | ||||
| -rwxr-xr-x | indra/llrender/llimagegl.h | 1 | ||||
| -rw-r--r-- | indra/newview/llviewertexture.cpp | 5 | 
3 files changed, 20 insertions, 3 deletions
| diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index bd9953e418..2c13fead97 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1464,13 +1464,24 @@ void LLImageGL::destroyGLTexture()  		}  		LLImageGL::deleteTextures(1, &mTexName);			 +		mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel.  		mTexName = 0;		  		mGLTextureCreated = FALSE ; -	} -	mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. +	}	  } - +//force to invalidate the gl texture, most likely a sculpty texture +void LLImageGL::forceToInvalidateGLTexture() +{ +	if (mTexName != 0) +	{ +		destroyGLTexture(); +	} +	else +	{ +		mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. +	} +}  //---------------------------------------------------------------------------- diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 2060be914b..e515d6b324 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -114,6 +114,7 @@ public:  	// Read back a raw image for this discard level, if it exists  	BOOL readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) const;  	void destroyGLTexture(); +	void forceToInvalidateGLTexture();  	void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE);  	void setComponents(S8 ncomponents) { mComponents = ncomponents; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index d83a595220..ea329f6aac 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2156,6 +2156,11 @@ void LLViewerFetchedTexture::clearFetchedResults()  	cleanup();  	destroyGLTexture(); + +	if(getDiscardLevel() >= 0) //sculpty texture, force to invalidate +	{ +		mGLTexturep->forceToInvalidateGLTexture(); +	}  }  void LLViewerFetchedTexture::forceToDeleteRequest() | 
