summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 14:52:05 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 14:52:05 +0100
commit6fbc79d5e861085375d776a4da4a5921650b3115 (patch)
tree29dafcce870eb2f494bebe2d968721abe266e930 /indra
parentd53b6264850a5efe1e0182ab3629b99b86019d72 (diff)
parent6091c3a758b400039bb98d720256260b8e37ff88 (diff)
Final(???) merge from viewer-release to viewer-public.
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llgl.cpp14
-rw-r--r--indra/llrender/llgl.h4
-rw-r--r--indra/llrender/llimagegl.cpp12
-rw-r--r--indra/newview/lldynamictexture.cpp22
-rw-r--r--indra/newview/llstartup.cpp5
-rw-r--r--indra/newview/llvosky.cpp5
6 files changed, 49 insertions, 13 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 236594d602..98ed34d6fc 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -356,6 +356,8 @@ LLGLManager::LLGLManager() :
mHasSeparateSpecularColor(FALSE),
+ mDebugGPU(FALSE),
+
mDriverVersionMajor(1),
mDriverVersionMinor(0),
mDriverVersionRelease(0),
@@ -523,11 +525,23 @@ bool LLGLManager::initGL()
return false;
}
+ setToDebugGPU();
initGLStates();
return true;
}
+void LLGLManager::setToDebugGPU()
+{
+ //"MOBILE INTEL(R) 965 EXPRESS CHIP",
+ if (mGLRenderer.find("INTEL") != std::string::npos && mGLRenderer.find("965") != std::string::npos)
+ {
+ mDebugGPU = TRUE ;
+ }
+
+ return ;
+}
+
void LLGLManager::getGLInfo(LLSD& info)
{
info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR));
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index c4f5d91e1a..937bf63849 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -120,6 +120,9 @@ public:
// Misc extensions
BOOL mHasSeparateSpecularColor;
+
+ //whether this GPU is in the debug list.
+ BOOL mDebugGPU;
S32 mDriverVersionMajor;
S32 mDriverVersionMinor;
@@ -148,6 +151,7 @@ private:
void initExtensions();
void initGLStates();
void initGLImages();
+ void setToDebugGPU();
};
extern LLGLManager gGLManager;
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 1a48c8a06c..ab9abf88e8 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -150,12 +150,12 @@ void LLImageGL::checkTexSize(bool forced) const
if (gDebugSession)
{
gFailLog << "wrong texture size and discard level!" <<
- mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << std::endl;
+ mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << std::endl;
}
else
{
llerrs << "wrong texture size and discard level: width: " <<
- mWidth << " Height: " << mHeight << " Current Level: " << mCurrentDiscardLevel << llendl ;
+ mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << llendl ;
}
}
@@ -1057,8 +1057,12 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_
{
if (gGL.getTexUnit(0)->bind(this, false, true))
{
- checkTexSize(true) ;
- llcallstacks << fb_x << " : " << fb_y << " : " << x_pos << " : " << y_pos << " : " << width << " : " << height << llcallstacksendl ;
+ if(gGLManager.mDebugGPU)
+ {
+ llinfos << "Calling glCopyTexSubImage2D(...)" << llendl ;
+ 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;
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index bb4e6c7a3e..a460a4f618 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -167,12 +167,19 @@ void LLViewerDynamicTexture::postRender(BOOL success)
{
generateGLTexture() ;
}
- if(!mGLTexturep->getHasGLTexture())
+ else if(!mGLTexturep->getHasGLTexture())
+ {
+ generateGLTexture() ;
+ }
+ else if(mGLTexturep->getDiscardLevel() != 0)//do not know how it happens, but regenerate one if it does.
{
generateGLTexture() ;
}
- llcallstacks << "class type: " << (S32)getType() << llcallstacksendl ;
+ if(gGLManager.mDebugGPU)
+ {
+ LLGLState::dumpStates() ;
+ }
success = mGLTexturep->setSubImageFromFrameBuffer(0, 0, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
}
}
@@ -211,11 +218,16 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
{
LLViewerDynamicTexture *dynamicTexture = *iter;
if (dynamicTexture->needsRender())
- {
+ {
+ if(gGLManager.mDebugGPU)
+ {
+ llinfos << "class type: " << (S32)dynamicTexture->getType() << llendl;
+ LLGLState::dumpStates() ;
+ }
+
glClear(GL_DEPTH_BUFFER_BIT);
gDepthDirty = TRUE;
-
-
+
gGL.color4f(1,1,1,1);
dynamicTexture->preRender(); // Must be called outside of startRender()
result = FALSE;
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 2475870b17..e64c4c90b7 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2925,9 +2925,8 @@ bool process_login_success_response()
text = response["agent_region_access"].asString();
if (!text.empty())
{
- U32 preferredMaturity =
- llmin((U32)LLAgent::convertTextToMaturity(text[0]),
- gSavedSettings.getU32("PreferredMaturity"));
+ U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]);
+
gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
}
// During the AO transition, this flag will be true. Then the flag will
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index d73850cb49..bb80988854 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -975,7 +975,10 @@ void LLVOSky::calcAtmospherics(void)
}
temp2.mV[1] = llmax(0.f, lighty);
- temp2.mV[1] = 1.f / temp2.mV[1];
+ if(temp2.mV[1] > 0.f)
+ {
+ temp2.mV[1] = 1.f / temp2.mV[1];
+ }
componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1]));
// Distance