Use EGL directly for Wayland GL support

For Wayland support on GL we currently fall back to the GLES code path
just to get EGL. This commit uses the EGL platform directly for Wayland,
also removing the dependency on GLES.
This commit is contained in:
Alexandros Frantzis
2019-10-11 12:39:05 +01:00
committed by Baldur Karlsson
parent 616a355a63
commit e8b696cbbf
2 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -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()
+9 -6
View File
@@ -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);
}