[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.
This commit is contained in:
Thiago Marcos P. Santos
2017-04-28 16:57:22 +03:00
committed by Thiago Marcos P. Santos
parent df5252725c
commit bc868b8433

View File

@@ -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;
}
}