OpenGLDevice: More verbose logging of surface creation failure

This commit is contained in:
Stenzek 2024-11-10 17:02:14 +10:00
parent 8611f4f438
commit b70a8482bd
No known key found for this signature in database
2 changed files with 14 additions and 3 deletions

View File

@ -123,10 +123,21 @@ bool OpenGLContextEGL::Initialize(WindowInfo& wi, SurfaceHandle* surface, std::s
if (!GLAD_EGL_KHR_surfaceless_context) if (!GLAD_EGL_KHR_surfaceless_context)
WARNING_LOG("EGL implementation does not support surfaceless contexts, emulating with pbuffers"); WARNING_LOG("EGL implementation does not support surfaceless contexts, emulating with pbuffers");
Error context_error;
for (const Version& cv : versions_to_try) for (const Version& cv : versions_to_try)
{ {
if (CreateContextAndSurface(wi, surface, cv, nullptr, true, error)) if (CreateContextAndSurface(wi, surface, cv, nullptr, true, &context_error))
{
return true; return true;
}
else
{
WARNING_LOG("Failed to create {}.{} ({}) context: {}", cv.major_version, cv.minor_version,
cv.profile == OpenGLContext::Profile::ES ?
"ES" :
(cv.profile == OpenGLContext::Profile::Core ? "Core" : "None"),
context_error.GetDescription());
}
} }
Error::SetStringView(error, "Failed to create any context versions"); Error::SetStringView(error, "Failed to create any context versions");

View File

@ -89,12 +89,12 @@ void OpenGLContextEGLWayland::ResizeSurface(WindowInfo& wi, SurfaceHandle handle
void OpenGLContextEGLWayland::DestroyPlatformSurface(EGLSurface surface) void OpenGLContextEGLWayland::DestroyPlatformSurface(EGLSurface surface)
{ {
OpenGLContextEGL::DestroyPlatformSurface(surface);
const auto it = m_wl_window_map.find((EGLSurface)surface); const auto it = m_wl_window_map.find((EGLSurface)surface);
AssertMsg(it != m_wl_window_map.end(), "Missing WL window"); AssertMsg(it != m_wl_window_map.end(), "Missing WL window");
m_wl_egl_window_destroy(it->second); m_wl_egl_window_destroy(it->second);
m_wl_window_map.erase(it); m_wl_window_map.erase(it);
OpenGLContextEGL::DestroyPlatformSurface(surface);
} }
std::unique_ptr<OpenGLContext> OpenGLContextEGLWayland::Create(WindowInfo& wi, SurfaceHandle* surface, std::unique_ptr<OpenGLContext> OpenGLContextEGLWayland::Create(WindowInfo& wi, SurfaceHandle* surface,