Skip to content

Commit 83da614

Browse files
committed
resolver debug logging
1 parent fc4cc4d commit 83da614

3 files changed

Lines changed: 35 additions & 5 deletions

File tree

src/libprojectM/Renderer/PlatformGLContextCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ auto QueryInfo(GLContextInfo& info, std::string& reason) -> bool
247247
}
248248

249249
const char* ver = SafeStr(glGetString(GL_VERSION));
250-
if (ver == nullptr || *ver == 0)
250+
if (*ver == 0)
251251
{
252252
reason = "No current GL context";
253253
return false;
@@ -264,7 +264,7 @@ auto QueryInfo(GLContextInfo& info, std::string& reason) -> bool
264264
info.renderer = SanitizeString(SafeStr(glGetString(GL_RENDERER)));
265265

266266
const char* glsl = SafeStr(glGetString(GL_SHADING_LANGUAGE_VERSION));
267-
if (glsl != nullptr && *glsl != 0)
267+
if (*glsl != 0)
268268
{
269269
info.glslStr = SanitizeString(glsl);
270270
}

src/libprojectM/Renderer/PlatformGLResolver.cpp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ void GLResolver::ResolveProviderFunctions()
317317
if (sym != nullptr)
318318
{
319319
m_eglGetProcAddress = SymbolToFunction<EglGetProcAddressFn>(sym);
320+
if (m_eglGetProcAddress == nullptr)
321+
{
322+
LOG_DEBUG("[GLResolver] eglGetProcAddress found but could not be converted to a function pointer");
323+
}
324+
}
325+
else
326+
{
327+
LOG_DEBUG("[GLResolver] eglGetProcAddress not found (EGL loaded but missing symbol)");
320328
}
321329
}
322330

@@ -332,6 +340,14 @@ void GLResolver::ResolveProviderFunctions()
332340
if (sym != nullptr)
333341
{
334342
m_wglGetProcAddress = SymbolToFunction<WglGetProcAddressFn>(sym);
343+
if (m_wglGetProcAddress == nullptr)
344+
{
345+
LOG_DEBUG("[GLResolver] wglGetProcAddress found but could not be converted to a function pointer");
346+
}
347+
}
348+
else
349+
{
350+
LOG_DEBUG("[GLResolver] wglGetProcAddress not found (GL library loaded but missing symbol)");
335351
}
336352
}
337353
#else
@@ -357,6 +373,14 @@ void GLResolver::ResolveProviderFunctions()
357373
if (sym != nullptr)
358374
{
359375
m_glxGetProcAddress = SymbolToFunction<GlxGetProcAddressFn>(sym);
376+
if (m_glxGetProcAddress == nullptr)
377+
{
378+
LOG_DEBUG("[GLResolver] glXGetProcAddress* found but could not be converted to a function pointer");
379+
}
380+
}
381+
else
382+
{
383+
LOG_DEBUG("[GLResolver] glXGetProcAddress* not found (GLX loaded but missing symbol)");
360384
}
361385
}
362386
#endif
@@ -454,7 +478,10 @@ auto GLResolver::LoadGlad() -> bool
454478
LOG_DEBUG("[GLResolver] gladLoadGL() succeeded");
455479
return true;
456480
}
457-
LOG_FATAL("[GLResolver] gladLoadGL() failed");
481+
LOG_FATAL(std::string("[GLResolver] gladLoadGL() failed (backend=") +
482+
BackendToString(m_backend) +
483+
", egl='" + m_eglLib.LoadedName() + "', gl='" + m_glLib.LoadedName() +
484+
"', glx='" + m_glxLib.LoadedName() + "')");
458485
return false;
459486
#else
460487
const int result = gladLoadGLES2(&gladBridgeResolverThunk);
@@ -463,7 +490,10 @@ auto GLResolver::LoadGlad() -> bool
463490
LOG_DEBUG("[GLResolver] gladLoadGLES2() succeeded");
464491
return true;
465492
}
466-
LOG_FATAL("[GLResolver] gladLoadGLES2() failed");
493+
LOG_FATAL(std::string("[GLResolver] gladLoadGLES2() failed (backend=") +
494+
BackendToString(m_backend) +
495+
", egl='" + m_eglLib.LoadedName() + "', gl='" + m_glLib.LoadedName() +
496+
"', glx='" + m_glxLib.LoadedName() + "')");
467497
return false;
468498
#endif
469499
}

src/libprojectM/Renderer/PlatformLoader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using LibHandle = void*;
3030
#endif
3131

3232
// -------------------------------------------------------------------------
33-
// Common function (Windows / POSIX / Emscripten)
33+
// Common (Windows / POSIX / Emscripten)
3434
// -------------------------------------------------------------------------
3535

3636
/**

0 commit comments

Comments
 (0)