From 437f243d657e9ddb1d48b7c0eeabf261209de61e Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 8 Sep 2017 14:05:27 -0700 Subject: [PATCH] [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. --- src/mbgl/gl/context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index e18f1e0bc..87bdcc30a 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -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()));