diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-09-08 14:05:27 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-09-08 14:05:27 -0700 |
commit | b168e6c687903c92f563c5c56a4a303aaf6e99a9 (patch) | |
tree | 20aa93bb7325774ff7195fe605116ad310938160 | |
parent | aa4dff1095e8f5e8ad584f5f7dcab3e61d8cf8ee (diff) | |
download | qtlocation-mapboxgl-b168e6c687903c92f563c5c56a4a303aaf6e99a9.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.cpp | 6 |
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())); |