Now letting LLRenderTarget delete bound textures immediately instead of having them hang around until next frame.
This commit is contained in:
@@ -1015,12 +1015,17 @@ void LLImageGL::generateTextures(S32 numTextures, U32 *textures)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void LLImageGL::deleteTextures(S32 numTextures, U32 *textures)
|
void LLImageGL::deleteTextures(S32 numTextures, U32 *textures, bool immediate)
|
||||||
{
|
{
|
||||||
for (S32 i = 0; i < numTextures; i++)
|
for (S32 i = 0; i < numTextures; i++)
|
||||||
{
|
{
|
||||||
sDeadTextureList.push_back(textures[i]);
|
sDeadTextureList.push_back(textures[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (immediate)
|
||||||
|
{
|
||||||
|
LLImageGL::deleteDeadTextures();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public:
|
|||||||
// These 3 functions currently wrap glGenTextures(), glDeleteTextures(), and glTexImage2D()
|
// These 3 functions currently wrap glGenTextures(), glDeleteTextures(), and glTexImage2D()
|
||||||
// for tracking purposes and will be deprecated in the future
|
// for tracking purposes and will be deprecated in the future
|
||||||
static void generateTextures(S32 numTextures, U32 *textures);
|
static void generateTextures(S32 numTextures, U32 *textures);
|
||||||
static void deleteTextures(S32 numTextures, U32 *textures);
|
static void deleteTextures(S32 numTextures, U32 *textures, bool immediate = false);
|
||||||
static void setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels);
|
static void setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels);
|
||||||
|
|
||||||
BOOL createGLTexture() ;
|
BOOL createGLTexture() ;
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ void LLRenderTarget::release()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLImageGL::deleteTextures(1, &mDepth);
|
LLImageGL::deleteTextures(1, &mDepth, true);
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
}
|
}
|
||||||
mDepth = 0;
|
mDepth = 0;
|
||||||
@@ -290,7 +290,7 @@ void LLRenderTarget::release()
|
|||||||
|
|
||||||
if (mTex.size() > 0)
|
if (mTex.size() > 0)
|
||||||
{
|
{
|
||||||
LLImageGL::deleteTextures(mTex.size(), &mTex[0]);
|
LLImageGL::deleteTextures(mTex.size(), &mTex[0], true);
|
||||||
mTex.clear();
|
mTex.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user