|
|
@ -79,6 +79,8 @@ CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDri
|
|
|
|
InitFBO = false;
|
|
|
|
InitFBO = false;
|
|
|
|
AttachDepthStencil = true;
|
|
|
|
AttachDepthStencil = true;
|
|
|
|
UsePackedDepthStencil = drvGl->supportPackedDepthStencil();
|
|
|
|
UsePackedDepthStencil = drvGl->supportPackedDepthStencil();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TextureUsedIdx = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
CTextureDrvInfosGL::~CTextureDrvInfosGL()
|
|
|
|
CTextureDrvInfosGL::~CTextureDrvInfosGL()
|
|
|
@ -91,7 +93,10 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL()
|
|
|
|
_Driver->_AllocatedTextureMemory-= TextureMemory;
|
|
|
|
_Driver->_AllocatedTextureMemory-= TextureMemory;
|
|
|
|
|
|
|
|
|
|
|
|
// release in TextureUsed.
|
|
|
|
// release in TextureUsed.
|
|
|
|
_Driver->_TextureUsed.erase (this);
|
|
|
|
if (TextureUsedIdx < _Driver->_TextureUsed.size() && _Driver->_TextureUsed[TextureUsedIdx] == this)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_Driver->_TextureUsed[TextureUsedIdx] = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(InitFBO)
|
|
|
|
if(InitFBO)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1492,7 +1497,11 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
|
|
|
|
if (_SumTextureMemoryUsed)
|
|
|
|
if (_SumTextureMemoryUsed)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Insert the pointer of this texture
|
|
|
|
// Insert the pointer of this texture
|
|
|
|
_TextureUsed.insert (gltext);
|
|
|
|
if (gltext->TextureUsedIdx >= _TextureUsed.size() || _TextureUsed[gltext->TextureUsedIdx] != gltext)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gltext->TextureUsedIdx = _TextureUsed.size();
|
|
|
|
|
|
|
|
_TextureUsed.push_back(gltext);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(tex->isTextureCube())
|
|
|
|
if(tex->isTextureCube())
|
|
|
|