mirror of
https://github.com/hyprwm/aquamarine.git
synced 2025-12-20 04:40:12 +01:00
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:
parent
9866172382
commit
aa6c59f950
1 changed files with 7 additions and 5 deletions
|
|
@ -20,11 +20,13 @@ using namespace Hyprutils::Math;
|
|||
#define GLCALL(__CALL__) \
|
||||
{ \
|
||||
__CALL__; \
|
||||
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)); \
|
||||
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)); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue