renderer: dont call glgeterror unless trace

glgeterror causes overhead and driver synchronisations overhead if
called in hot paths, the GLCALL macro is used in a lot of places, guard
it behind the AQ_TRACE env var. at the cost of less debug output unless
AQ_TRACE is used.
This commit is contained in:
Tom Englund 2025-05-19 21:23:36 +02:00
parent 9866172382
commit aa6c59f950

View file

@ -20,12 +20,14 @@ using namespace Hyprutils::Math;
#define GLCALL(__CALL__) \
{ \
__CALL__; \
if (Aquamarine::isTrace()) { \
auto err = glGetError(); \
if (err != GL_NO_ERROR) { \
backend->log(AQ_LOG_ERROR, \
std::format("[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 funcs