summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2017-04-28 16:57:22 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2017-05-02 12:34:27 +0300
commit1fef80081ea1a890631ada4b952c56e6aaac32ea (patch)
treeec985050513746d9c9fb8b713e2d7ac17761e54c
parentee556215c3eecf29d0afd8537e81262003ba4d31 (diff)
downloadqtlocation-mapboxgl-1fef80081ea1a890631ada4b952c56e6aaac32ea.tar.gz
[core] Suppress "stencil mask overflow" warning
When it starts, we get a log warning for every frame, which is expensive. Now we get only one warning.
-rw-r--r--src/mbgl/algorithm/generate_clip_ids_impl.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mbgl/algorithm/generate_clip_ids_impl.hpp b/src/mbgl/algorithm/generate_clip_ids_impl.hpp
index 59ca66bf66..d63ba27b6b 100644
--- a/src/mbgl/algorithm/generate_clip_ids_impl.hpp
+++ b/src/mbgl/algorithm/generate_clip_ids_impl.hpp
@@ -76,8 +76,13 @@ void ClipIDGenerator::update(Renderables& renderables) {
bit_offset += bit_count;
}
- if (bit_offset > 8) {
+ // Prevent this warning from firing on every frame,
+ // which can be expensive in some platforms.
+ static bool warned = false;
+
+ if (!warned && bit_offset > 8) {
Log::Error(Event::OpenGL, "stencil mask overflow");
+ warned = true;
}
}