diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2010-04-09 22:02:32 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2010-04-09 22:02:32 -0600 |
commit | 0dee7a3ece05f418c1deb422771cfed8d89826b3 (patch) | |
tree | d80665733bdea0a64653495dbc5cb73b63c7f1f8 /indra | |
parent | c5756c3f0f024c7d95cd7766573f8191befc7427 (diff) |
debug code for EXT-6791: Intel 965 Crash in glCopyTexSubImage2D.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 16 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 2 | ||||
-rw-r--r-- | indra/newview/lldynamictexture.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lldynamictexture.h | 13 | ||||
-rw-r--r-- | indra/newview/llfloateranimpreview.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfloateranimpreview.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llfloaterimagepreview.h | 4 | ||||
-rw-r--r-- | indra/newview/lltexlayer.cpp | 6 | ||||
-rw-r--r-- | indra/newview/lltexlayer.h | 1 | ||||
-rw-r--r-- | indra/newview/lltoolmorph.cpp | 12 | ||||
-rw-r--r-- | indra/newview/lltoolmorph.h | 3 |
12 files changed, 71 insertions, 6 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 36ac3ff119..68b556c3bb 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -105,9 +105,9 @@ void check_all_images() } } -void LLImageGL::checkTexSize() const +void LLImageGL::checkTexSize(bool forced) const { - if (gDebugGL && mTarget == GL_TEXTURE_2D) + if ((forced || gDebugGL) && mTarget == GL_TEXTURE_2D) { GLint texname; glGetIntegerv(GL_TEXTURE_BINDING_2D, &texname); @@ -129,6 +129,8 @@ void LLImageGL::checkTexSize() const glGetTexLevelParameteriv(mTarget, 0, GL_TEXTURE_WIDTH, (GLint*)&x); glGetTexLevelParameteriv(mTarget, 0, GL_TEXTURE_HEIGHT, (GLint*)&y) ; stop_glerror() ; + llcallstacks << "w: " << x << " h: " << y << llcallstacksendl ; + if(!x || !y) { return ; @@ -138,11 +140,13 @@ void LLImageGL::checkTexSize() const error = TRUE; if (gDebugSession) { - gFailLog << "wrong texture size and discard level!" << std::endl; + gFailLog << "wrong texture size and discard level!" << + mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << std::endl; } else { - llerrs << "wrong texture size and discard level!" << llendl ; + llerrs << "wrong texture size and discard level: width: " << + mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << llendl ; } } @@ -1044,7 +1048,9 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ { if (gGL.getTexUnit(0)->bind(this, false, true)) { - //checkTexSize() ; + checkTexSize(true) ; + llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height << llcallstacksendl ; + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, fb_x, fb_y, x_pos, y_pos, width, height); mGLTextureCreated = true; stop_glerror(); diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index f0870c3fc4..41239d24c8 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -157,7 +157,7 @@ public: void updatePickMask(S32 width, S32 height, const U8* data_in); BOOL getMask(const LLVector2 &tc); - void checkTexSize() const ; + void checkTexSize(bool forced = false) const ; // Sets the addressing mode used to sample the texture // (such as wrapping, mirrored wrapping, and clamp) diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index c7c79401a0..c423473740 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -167,6 +167,8 @@ void LLViewerDynamicTexture::postRender(BOOL success) { generateGLTexture() ; } + llcallstacks << "class type: " << (S32)getType() << llcallstacksendl ; + success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight); } } diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h index 2a944eaada..caf2603519 100644 --- a/indra/newview/lldynamictexture.h +++ b/indra/newview/lldynamictexture.h @@ -41,6 +41,19 @@ class LLViewerDynamicTexture : public LLViewerTexture { +public: + enum + { + LL_VIEWER_DYNAMIC_TEXTURE = LLViewerTexture::DYNAMIC_TEXTURE, + LL_TEX_LAYER_SET_BUFFER = LLViewerTexture::INVALID_TEXTURE_TYPE + 1, + LL_VISUAL_PARAM_HINT, + LL_VISUAL_PARAM_RESET, + LL_PREVIEW_ANIMATION, + LL_IMAGE_PREVIEW_SCULPTED, + LL_IMAGE_PREVIEW_AVATAR, + INVALID_DYNAMIC_TEXTURE + }; + protected: /*virtual*/ ~LLViewerDynamicTexture(); diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 5ec58c8dd6..72dc182461 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -1069,6 +1069,12 @@ LLPreviewAnimation::~LLPreviewAnimation() mDummyAvatar->markDead(); } +//virtual +S8 LLPreviewAnimation::getType() const +{ + return LLViewerDynamicTexture::LL_PREVIEW_ANIMATION ; +} + //----------------------------------------------------------------------------- // update() //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h index 3ee1f419ab..84f131a322 100644 --- a/indra/newview/llfloateranimpreview.h +++ b/indra/newview/llfloateranimpreview.h @@ -50,6 +50,8 @@ protected: public: LLPreviewAnimation(S32 width, S32 height); + /*virtual*/ S8 getType() const ; + BOOL render(); void requestUpdate(); void rotate(F32 yaw_radians, F32 pitch_radians); diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 6b754bd065..ef9da30552 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -629,6 +629,11 @@ LLImagePreviewAvatar::~LLImagePreviewAvatar() mDummyAvatar->markDead(); } +//virtual +S8 LLImagePreviewAvatar::getType() const +{ + return LLViewerDynamicTexture::LL_IMAGE_PREVIEW_AVATAR ; +} void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male) { @@ -808,6 +813,11 @@ LLImagePreviewSculpted::~LLImagePreviewSculpted() { } +//virtual +S8 LLImagePreviewSculpted::getType() const +{ + return LLViewerDynamicTexture::LL_IMAGE_PREVIEW_SCULPTED ; +} void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) { diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index 4a12543650..466bd1d0ec 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -54,6 +54,8 @@ protected: public: LLImagePreviewSculpted(S32 width, S32 height); + /*virtual*/ S8 getType() const ; + void setPreviewTarget(LLImageRaw *imagep, F32 distance); void setTexture(U32 name) { mTextureName = name; } @@ -85,6 +87,8 @@ protected: public: LLImagePreviewAvatar(S32 width, S32 height); + /*virtual*/ S8 getType() const ; + void setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male); void setTexture(U32 name) { mTextureName = name; } void clearPreviewTexture(const std::string& mesh_name); diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 386b636367..8cb319b122 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -99,6 +99,12 @@ LLTexLayerSetBuffer::~LLTexLayerSetBuffer() } //virtual +S8 LLTexLayerSetBuffer::getType() const +{ + return LLViewerDynamicTexture::LL_TEX_LAYER_SET_BUFFER ; +} + +//virtual void LLTexLayerSetBuffer::restoreGLTexture() { LLViewerDynamicTexture::restoreGLTexture() ; diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index 5be58f64a9..ae280dd063 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -325,6 +325,7 @@ public: LLTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height); virtual ~LLTexLayerSetBuffer(); + /*virtual*/ S8 getType() const ; virtual void preRender(BOOL clear_depth); virtual void postRender(BOOL success); virtual BOOL render(); diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 5f825b461e..79846b9160 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -108,6 +108,12 @@ LLVisualParamHint::~LLVisualParamHint() LLVisualParamHint::sInstances.erase( this ); } +//virtual +S8 LLVisualParamHint::getType() const +{ + return LLViewerDynamicTexture::LL_VISUAL_PARAM_HINT ; +} + //----------------------------------------------------------------------------- // static // requestHintUpdates() @@ -290,6 +296,12 @@ LLVisualParamReset::LLVisualParamReset() : LLViewerDynamicTexture(1, 1, 1, ORDER { } +//virtual +S8 LLVisualParamReset::getType() const +{ + return LLViewerDynamicTexture::LL_VISUAL_PARAM_RESET ; +} + //----------------------------------------------------------------------------- // render() //----------------------------------------------------------------------------- diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index b7df718ba2..c332c296bd 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -64,6 +64,8 @@ public: LLViewerVisualParam *param, F32 param_weight); + /*virtual*/ S8 getType() const ; + BOOL needsRender(); void preRender(BOOL clear_depth); BOOL render(); @@ -107,6 +109,7 @@ protected: public: LLVisualParamReset(); /*virtual */ BOOL render(); + /*virtual*/ S8 getType() const ; static BOOL sDirty; }; |