summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-09-08 14:05:27 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-09-11 10:17:54 -0700
commit437f243d657e9ddb1d48b7c0eeabf261209de61e (patch)
treeaf8778535109fc2b0353267da8421f1b9f06c0b1
parentdfc5d51ae150b92ce2645d34383f04361d784bc3 (diff)
downloadqtlocation-mapboxgl-437f243d657e9ddb1d48b7c0eeabf261209de61e.tar.gz
[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.
-rw-r--r--src/mbgl/gl/context.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index e18f1e0bcf..87bdcc30aa 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()));