[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:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user