render/egl: support config-less wlr_egl

When using wlr_swapchain, there's no need to select an EGLConfig. Add
support for creating config-less EGL contexts.
This commit is contained in:
Simon Ser 2020-12-04 13:37:36 +01:00 committed by Ilia Bozhinov
parent 44b1ff16e9
commit 037710b1d4
2 changed files with 18 additions and 4 deletions

View file

@ -268,7 +268,11 @@ struct wlr_renderer *wlr_renderer_autocreate(struct wlr_egl *egl,
memcpy(&all_config_attribs[config_attribs_len], gles2_config_attribs,
sizeof(gles2_config_attribs));
if (!wlr_egl_init(egl, platform, remote_display, all_config_attribs,
if (config_attribs != NULL) {
config_attribs = all_config_attribs;
}
if (!wlr_egl_init(egl, platform, remote_display, config_attribs,
visual_id)) {
wlr_log(WLR_ERROR, "Could not initialize EGL");
return NULL;