summaryrefslogtreecommitdiff
path: root/indra/llrender/llrendertarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
-rw-r--r--indra/llrender/llrendertarget.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index e773a639b0..b6463309e1 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -75,6 +75,9 @@ LLRenderTarget::~LLRenderTarget()
void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples)
{
stop_glerror();
+
+ release();
+
mResX = resx;
mResY = resy;
@@ -96,8 +99,6 @@ void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo
mSamples = 0;
}
- release();
-
if ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
{
if (depth)
@@ -337,6 +338,8 @@ void LLRenderTarget::release()
LLImageGL::deleteTextures(mTex.size(), &mTex[0], true);
mTex.clear();
}
+
+ mResX = mResY = 0;
sBoundTarget = NULL;
}