diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2017-04-28 16:57:22 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-05-02 12:25:38 +0300 |
commit | bc868b8433f47e87bccfae0a52e5387aa8572050 (patch) | |
tree | 1bde092021aaafd7645f61202b38a6b71e75d1a9 /src/mbgl/algorithm | |
parent | df5252725c2e2668f341428cd3edd1a02c554e20 (diff) | |
download | qtlocation-mapboxgl-bc868b8433f47e87bccfae0a52e5387aa8572050.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.
Diffstat (limited to 'src/mbgl/algorithm')
-rw-r--r-- | src/mbgl/algorithm/generate_clip_ids_impl.hpp | 7 |
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; } } |