[OpenGL] Support apitrace in debug build

Try to load `glxtrace.so` instead of `libGL.so.1`.
Assumes `glxtrace.so` lives outside of usual library paths and is only preloaded.
pull/517/head
jackun 3 years ago
parent 4ee9dcd852
commit 714f3853f7
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -15,7 +15,14 @@ bool glx_loader::Load() {
}
// Force load libGL
void *handle = real_dlopen("libGL.so.1", RTLD_LAZY);
void *handle = nullptr;
#ifndef NDEBUG
// Use apitrace's glxtrace.so for debugging
// Assumes glxtrace.so lives outside of usual library paths and is only preloaded
handle = real_dlopen("glxtrace.so", RTLD_LAZY);
#endif
if (!handle)
handle = real_dlopen("libGL.so.1", RTLD_LAZY);
if (!handle) {
std::cerr << "MANGOHUD: Failed to open " << "" MANGOHUD_ARCH << " libGL.so.1: " << dlerror() << std::endl;
return false;

Loading…
Cancel
Save