From bc868b8433f47e87bccfae0a52e5387aa8572050 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 28 Apr 2017 16:57:22 +0300 Subject: [PATCH] [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. --- src/mbgl/algorithm/generate_clip_ids_impl.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mbgl/algorithm/generate_clip_ids_impl.hpp b/src/mbgl/algorithm/generate_clip_ids_impl.hpp index 59ca66bf6..d63ba27b6 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; } }