[core] Dirty the correct state when a texture is deleted

When a texture is deleted, it is as if all texture units to which that texture object is bound are rebound to texture object zero. Therefore it's the *bindings* that need to be dirtied, not the active texture unit.
This commit is contained in:
John Firebaugh
2017-09-08 14:05:27 -07:00
parent dfc5d51ae1
commit 437f243d65

View File

@@ -709,8 +709,10 @@ void Context::performCleanup() {
if (!abandonedTextures.empty()) {
for (const auto id : abandonedTextures) {
if (activeTexture == id) {
activeTexture.setDirty();
for (auto& binding : texture) {
if (binding == id) {
binding.setDirty();
}
}
}
MBGL_CHECK_ERROR(glDeleteTextures(int(abandonedTextures.size()), abandonedTextures.data()));