Correct and revise OpenGL texture pooling (#2709)

This commit is contained in:
alasram
2024-08-29 14:13:26 -07:00
committed by GitHub
parent 290bf927f5
commit b850c257a3
79 changed files with 817 additions and 247 deletions

View File

@@ -23,13 +23,10 @@ void BufferDeleter::operator()(BufferID id) const {
void TextureDeleter::operator()(TextureID id) const {
assert(context);
if (context->pooledTextures.size() >= TextureMax) {
context->abandonedTextures.push_back(id);
} else {
context->pooledTextures.push_back(id);
}
context->abandonedTextures.push_back(id);
context->renderingStats().numActiveTextures--;
assert(context->renderingStats().numActiveTextures >= 0);
assert(context->renderingStats().numActiveTextures < context->renderingStats().numCreatedTextures);
}
void VertexArrayDeleter::operator()(VertexArrayID id) const {