summaryrefslogtreecommitdiffhomepage
path: root/main/debug.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-24 11:03:25 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-24 11:03:25 +0200
commitc8547d38a29bb4756e3351bdfa45ea72635286d8 (patch)
tree5cdf9ad44db6f7673734febdccf89b43409a9b9c /main/debug.cpp
parentf47790b1ec38f27c486ad2002dac8b310933f0a4 (diff)
a
Diffstat (limited to 'main/debug.cpp')
-rw-r--r--main/debug.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/main/debug.cpp b/main/debug.cpp
index efc47a6c..14cdad00 100644
--- a/main/debug.cpp
+++ b/main/debug.cpp
@@ -58,16 +58,29 @@ void main_impl::_debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Ty
static_cast<const main_impl*>(self)->debug_callback(src, type, id, severity, str);
}
-void* main_impl::register_debug_callback() noexcept
+void main_impl::register_debug_callback()
{
GL::DebugOutput::setCallback(_debug_callback, this);
-#if 1
+#if 0
/* Disable rather spammy "Buffer detailed info" debug messages on NVidia drivers */
GL::DebugOutput::setEnabled(GL::DebugOutput::Source::Api, GL::DebugOutput::Type::Other, {131185}, false);
#endif
+}
- return nullptr;
+char main_impl::maybe_register_debug_callback(fm_gpu_debug flag)
+{
+ using enum fm_gpu_debug;
+ switch (flag)
+ {
+ default:
+ register_debug_callback();
+ break;
+ case off:
+ case no_error:
+ break;
+ }
+ return '\0';
}
} // namespace floormat