OpenGLDevice: More verbose logging of surface creation failure
This commit is contained in:
parent
8611f4f438
commit
b70a8482bd
|
@ -123,10 +123,21 @@ bool OpenGLContextEGL::Initialize(WindowInfo& wi, SurfaceHandle* surface, std::s
|
|||
if (!GLAD_EGL_KHR_surfaceless_context)
|
||||
WARNING_LOG("EGL implementation does not support surfaceless contexts, emulating with pbuffers");
|
||||
|
||||
Error context_error;
|
||||
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;
|
||||
}
|
||||
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");
|
||||
|
|
|
@ -89,12 +89,12 @@ void OpenGLContextEGLWayland::ResizeSurface(WindowInfo& wi, SurfaceHandle handle
|
|||
|
||||
void OpenGLContextEGLWayland::DestroyPlatformSurface(EGLSurface surface)
|
||||
{
|
||||
OpenGLContextEGL::DestroyPlatformSurface(surface);
|
||||
|
||||
const auto it = m_wl_window_map.find((EGLSurface)surface);
|
||||
AssertMsg(it != m_wl_window_map.end(), "Missing WL window");
|
||||
m_wl_egl_window_destroy(it->second);
|
||||
m_wl_window_map.erase(it);
|
||||
|
||||
OpenGLContextEGL::DestroyPlatformSurface(surface);
|
||||
}
|
||||
|
||||
std::unique_ptr<OpenGLContext> OpenGLContextEGLWayland::Create(WindowInfo& wi, SurfaceHandle* surface,
|
||||
|
|
Loading…
Reference in New Issue