opengl: add debug:gl_debugging (#13183)

add debug:gl_debugging so we can disable gl debugging entirerly,
both glGetError and enabling EGL_KHR_debug has its cost, we still have
EXT_create_context_robustness and glGetGraphicsResetStatus that should
catch context loss, and is generally cheap to call it only checks a flag
set.

glGetError might cause a implicit flush to get any pending calls sent to
the gpu.

however to get EGL_KHR_debug back enabled we now require a restart of
the compositor after changing debug:gl_debugging
This commit is contained in:
Tom Englund 2026-02-06 22:02:20 +01:00 committed by GitHub
parent 8606bc255b
commit 63eb6b3bda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 9 deletions

View file

@ -96,10 +96,13 @@
#define GLCALL(__CALL__) \
{ \
__CALL__; \
auto err = glGetError(); \
if (err != GL_NO_ERROR) { \
Log::logger->log(Log::ERR, "[GLES] Error in call at {}@{}: 0x{:x}", __LINE__, \
([]() constexpr -> std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })(), err); \
static const auto GLDEBUG = CConfigValue<Hyprlang::INT>("debug:gl_debugging"); \
if (*GLDEBUG) { \
auto err = glGetError(); \
if (err != GL_NO_ERROR) { \
Log::logger->log(Log::ERR, "[GLES] Error in call at {}@{}: 0x{:x}", __LINE__, \
([]() constexpr -> std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })(), err); \
} \
} \
}