summaryrefslogtreecommitdiff
path: root/indra/llrender/llrendertarget.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-05-24 10:50:48 -0500
committerDave Parks <davep@lindenlab.com>2012-05-24 10:50:48 -0500
commitefda0814cbae7917fde634c5e245c81915b17a9c (patch)
treeb9557284c32016de2d4a32f484e66a8fcad47b2c /indra/llrender/llrendertarget.cpp
parentf2c2b88033e912be00ba0c08bc7f074d6881d1d5 (diff)
MAINT-616 Fix for corrupted mipmaps. Cleanup based on code review feedback.
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
-rw-r--r--indra/llrender/llrendertarget.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index f0dd6f3bd6..ced6b013ec 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -55,7 +55,6 @@ bool LLRenderTarget::sUseFBO = false;
LLRenderTarget::LLRenderTarget() :
mResX(0),
mResY(0),
- mTex(0),
mFBO(0),
mDepth(0),
mStencil(0),
@@ -135,7 +134,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
}
U32 tex;
- LLImageGL::generateTextures(mUsage, 1, &tex);
+ LLImageGL::generateTextures(mUsage, color_fmt, 1, &tex);
gGL.getTexUnit(0)->bindManual(mUsage, tex);
stop_glerror();
@@ -193,6 +192,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
}
mTex.push_back(tex);
+ mInternalFormat.push_back(color_fmt);
if (gDebugGL)
{ //bind and unbind to validate target
@@ -217,7 +217,7 @@ bool LLRenderTarget::allocateDepth()
}
else
{
- LLImageGL::generateTextures(mUsage, 1, &mDepth);
+ LLImageGL::generateTextures(mUsage, GL_DEPTH_COMPONENT24, 1, &mDepth);
gGL.getTexUnit(0)->bindManual(mUsage, mDepth);
U32 internal_type = LLTexUnit::getInternalType(mUsage);
@@ -294,7 +294,7 @@ void LLRenderTarget::release()
}
else
{
- LLImageGL::deleteTextures(mUsage, 1, &mDepth, true);
+ LLImageGL::deleteTextures(mUsage, 0, 1, &mDepth, true);
stop_glerror();
}
mDepth = 0;
@@ -326,8 +326,9 @@ void LLRenderTarget::release()
if (mTex.size() > 0)
{
sBytesAllocated -= mResX*mResY*4*mTex.size();
- LLImageGL::deleteTextures(mUsage, mTex.size(), &mTex[0], true);
+ LLImageGL::deleteTextures(mUsage, mInternalFormat[0], mTex.size(), &mTex[0], true);
mTex.clear();
+ mInternalFormat.clear();
}
mResX = mResY = 0;