diff --git a/CMakeLists.txt b/CMakeLists.txt index 495d355fe..20fa0745a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,8 +189,8 @@ if(ENABLE_WAYLAND) pkg_check_modules(PKG_WAYLAND QUIET wayland-client) if(PKG_WAYLAND_FOUND) - if(NOT ENABLE_GLES) - message(WARNING "On Wayland GLES support is required for EGL, disabling GL support") + if(NOT ENABLE_EGL) + message(WARNING "On Wayland EGL is required for GL, disabling GL support") set(ENABLE_GL OFF CACHE BOOL "" FORCE) endif() else() diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 5b6a16897..226d3e958 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -3594,28 +3594,31 @@ static DriverRegistration GLESDriverRegistration(RDCDriver::OpenGLES, &GLES_Crea ReplayStatus GL_CreateReplayDevice(RDCFile *rdc, const ReplayOptions &opts, IReplayDriver **driver) { + GLPlatform *gl_platform = &GetGLPlatform(); + if(RenderDoc::Inst().GetGlobalEnvironment().waylandDisplay) { -#if defined(RENDERDOC_SUPPORT_GLES) +#if defined(RENDERDOC_SUPPORT_EGL) RDCLOG("Forcing EGL device creation for wayland"); - return GLES_CreateReplayDevice(rdc, opts, driver); + gl_platform = &GetEGLPlatform(); #else - RDCERR("GLES support must be enabled at build time when using Wayland"); + RDCERR("EGL support must be enabled at build time when using Wayland"); return ReplayStatus::InternalError; #endif } RDCDEBUG("Creating an OpenGL replay device"); - bool load_ok = GetGLPlatform().PopulateForReplay(); + bool load_ok = gl_platform->PopulateForReplay(); if(!load_ok) { - RDCERR("Couldn't find required platform GL function addresses"); + RDCERR("Couldn't find required platform %s function addresses", + gl_platform == &GetGLPlatform() ? "GL" : "EGL"); return ReplayStatus::APIInitFailed; } - return CreateReplayDevice(rdc ? rdc->GetDriver() : RDCDriver::OpenGL, rdc, opts, GetGLPlatform(), + return CreateReplayDevice(rdc ? rdc->GetDriver() : RDCDriver::OpenGL, rdc, opts, *gl_platform, driver); }