Merge branch 'V2Mesh' of https://github.com/Shyotl/SingularityViewer into future
Conflicts: indra/llvfs/lldiriterator.cpp indra/newview/app_settings/settings.xml indra/newview/llviewerregion.cpp
This commit is contained in:
@@ -1330,10 +1330,6 @@ void LLGLState::checkTextureChannels(const std::string& msg)
|
||||
}
|
||||
}
|
||||
|
||||
GLint maxTextureUnits = 0;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits);
|
||||
stop_glerror();
|
||||
|
||||
static const char* label[] =
|
||||
{
|
||||
"GL_TEXTURE_2D",
|
||||
@@ -1366,7 +1362,7 @@ void LLGLState::checkTextureChannels(const std::string& msg)
|
||||
glh::matrix4f identity;
|
||||
identity.identity();
|
||||
|
||||
for (GLint i = 1; i < maxTextureUnits; i++)
|
||||
for (GLint i = 1; i < gGLManager.mNumTextureUnits; i++)
|
||||
{
|
||||
gGL.getTexUnit(i)->activate();
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||
@@ -1426,8 +1422,27 @@ void LLGLState::checkTextureChannels(const std::string& msg)
|
||||
gFailLog << "Texture matrix " << i << " is not identity." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
GLint tex = 0;
|
||||
stop_glerror();
|
||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);
|
||||
stop_glerror();
|
||||
|
||||
if (tex != 0)
|
||||
{
|
||||
error = TRUE;
|
||||
LL_WARNS("RenderState") << "Texture channel " << i << " still has texture " << tex << " bound." << llendl;
|
||||
|
||||
if (gDebugSession)
|
||||
{
|
||||
gFailLog << "Texture channel " << i << " still has texture " << tex << " bound." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stop_glerror();
|
||||
gGL.getTexUnit(0)->activate();
|
||||
glClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
stop_glerror();
|
||||
|
||||
@@ -1015,12 +1015,17 @@ void LLImageGL::generateTextures(S32 numTextures, U32 *textures)
|
||||
}
|
||||
|
||||
// static
|
||||
void LLImageGL::deleteTextures(S32 numTextures, U32 *textures)
|
||||
void LLImageGL::deleteTextures(S32 numTextures, U32 *textures, bool immediate)
|
||||
{
|
||||
for (S32 i = 0; i < numTextures; i++)
|
||||
{
|
||||
sDeadTextureList.push_back(textures[i]);
|
||||
}
|
||||
|
||||
if (immediate)
|
||||
{
|
||||
LLImageGL::deleteDeadTextures();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
// These 3 functions currently wrap glGenTextures(), glDeleteTextures(), and glTexImage2D()
|
||||
// for tracking purposes and will be deprecated in the future
|
||||
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);
|
||||
|
||||
BOOL createGLTexture() ;
|
||||
|
||||
@@ -261,7 +261,7 @@ void LLRenderTarget::release()
|
||||
}
|
||||
else
|
||||
{
|
||||
LLImageGL::deleteTextures(1, &mDepth);
|
||||
LLImageGL::deleteTextures(1, &mDepth, true);
|
||||
stop_glerror();
|
||||
}
|
||||
mDepth = 0;
|
||||
@@ -290,7 +290,7 @@ void LLRenderTarget::release()
|
||||
|
||||
if (mTex.size() > 0)
|
||||
{
|
||||
LLImageGL::deleteTextures(mTex.size(), &mTex[0]);
|
||||
LLImageGL::deleteTextures(mTex.size(), &mTex[0], true);
|
||||
mTex.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user