summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-04-09 22:02:32 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-04-09 22:02:32 -0600
commit0dee7a3ece05f418c1deb422771cfed8d89826b3 (patch)
treed80665733bdea0a64653495dbc5cb73b63c7f1f8 /indra/llrender
parentc5756c3f0f024c7d95cd7766573f8191befc7427 (diff)
debug code for EXT-6791: Intel 965 Crash in glCopyTexSubImage2D.
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp16
-rw-r--r--indra/llrender/llimagegl.h2
2 files changed, 12 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)