render/egl: remove *config_attribs and wlr_egl->config
Breaking changes: Both "EGLint *config_attribs" and "wlr_egl->config" no longer exist.
This commit is contained in:
parent
705b3da7cb
commit
8aa38fe73e
|
@ -38,7 +38,6 @@ struct wlr_egl_context {
|
||||||
|
|
||||||
struct wlr_egl {
|
struct wlr_egl {
|
||||||
EGLDisplay display;
|
EGLDisplay display;
|
||||||
EGLConfig config; // may be EGL_NO_CONFIG
|
|
||||||
EGLContext context;
|
EGLContext context;
|
||||||
EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT
|
EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT
|
||||||
struct gbm_device *gbm_device;
|
struct gbm_device *gbm_device;
|
||||||
|
@ -80,11 +79,8 @@ struct wlr_egl {
|
||||||
/**
|
/**
|
||||||
* Initializes an EGL context for the given platform and remote display.
|
* Initializes an EGL context for the given platform and remote display.
|
||||||
* Will attempt to load all possibly required api functions.
|
* Will attempt to load all possibly required api functions.
|
||||||
*
|
|
||||||
* If config_attribs is NULL, the EGL config is not created.
|
|
||||||
*/
|
*/
|
||||||
struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display,
|
struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display);
|
||||||
const EGLint *config_attribs);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees all related EGL resources, makes the context not-current and
|
* Frees all related EGL resources, makes the context not-current and
|
||||||
|
|
29
render/egl.c
29
render/egl.c
|
@ -150,8 +150,7 @@ out:
|
||||||
free(formats);
|
free(formats);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display,
|
struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display) {
|
||||||
const EGLint *config_attribs) {
|
|
||||||
struct wlr_egl *egl = calloc(1, sizeof(struct wlr_egl));
|
struct wlr_egl *egl = calloc(1, sizeof(struct wlr_egl));
|
||||||
if (egl == NULL) {
|
if (egl == NULL) {
|
||||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||||
|
@ -286,25 +285,11 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display,
|
||||||
check_egl_ext(device_exts_str, "EGL_EXT_device_drm");
|
check_egl_ext(device_exts_str, "EGL_EXT_device_drm");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_attribs != NULL) {
|
if (!check_egl_ext(display_exts_str, "EGL_KHR_no_config_context") &&
|
||||||
EGLint matched = 0;
|
!check_egl_ext(display_exts_str, "EGL_MESA_configless_context")) {
|
||||||
if (!eglChooseConfig(egl->display, config_attribs, &egl->config, 1,
|
wlr_log(WLR_ERROR, "EGL_KHR_no_config_context or "
|
||||||
&matched)) {
|
"EGL_MESA_configless_context not supported");
|
||||||
wlr_log(WLR_ERROR, "eglChooseConfig failed");
|
goto error;
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
if (matched == 0) {
|
|
||||||
wlr_log(WLR_ERROR, "Failed to match an EGL config");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!check_egl_ext(display_exts_str, "EGL_KHR_no_config_context") &&
|
|
||||||
!check_egl_ext(display_exts_str, "EGL_MESA_configless_context")) {
|
|
||||||
wlr_log(WLR_ERROR, "EGL_KHR_no_config_context or "
|
|
||||||
"EGL_MESA_configless_context not supported");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
egl->config = EGL_NO_CONFIG_KHR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_log(WLR_INFO, "Using EGL %d.%d", (int)major, (int)minor);
|
wlr_log(WLR_INFO, "Using EGL %d.%d", (int)major, (int)minor);
|
||||||
|
@ -339,7 +324,7 @@ struct wlr_egl *wlr_egl_create(EGLenum platform, void *remote_display,
|
||||||
attribs[atti++] = EGL_NONE;
|
attribs[atti++] = EGL_NONE;
|
||||||
assert(atti <= sizeof(attribs)/sizeof(attribs[0]));
|
assert(atti <= sizeof(attribs)/sizeof(attribs[0]));
|
||||||
|
|
||||||
egl->context = eglCreateContext(egl->display, egl->config,
|
egl->context = eglCreateContext(egl->display, EGL_NO_CONFIG_KHR,
|
||||||
EGL_NO_CONTEXT, attribs);
|
EGL_NO_CONTEXT, attribs);
|
||||||
if (egl->context == EGL_NO_CONTEXT) {
|
if (egl->context == EGL_NO_CONTEXT) {
|
||||||
wlr_log(WLR_ERROR, "Failed to create EGL context");
|
wlr_log(WLR_ERROR, "Failed to create EGL context");
|
||||||
|
|
|
@ -466,9 +466,6 @@ static enum wl_shm_format gles2_preferred_read_format(
|
||||||
glGetRenderbufferParameteriv(GL_RENDERBUFFER,
|
glGetRenderbufferParameteriv(GL_RENDERBUFFER,
|
||||||
GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
|
GL_RENDERBUFFER_ALPHA_SIZE, &alpha_size);
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||||
} else if (renderer->egl->config != EGL_NO_CONFIG_KHR) {
|
|
||||||
eglGetConfigAttrib(renderer->egl->display, renderer->egl->config,
|
|
||||||
EGL_ALPHA_SIZE, &alpha_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct wlr_gles2_pixel_format *fmt =
|
const struct wlr_gles2_pixel_format *fmt =
|
||||||
|
|
|
@ -257,8 +257,7 @@ struct wlr_renderer *wlr_renderer_autocreate_with_drm_fd(int drm_fd) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_egl *egl = wlr_egl_create(EGL_PLATFORM_GBM_KHR, gbm_device,
|
struct wlr_egl *egl = wlr_egl_create(EGL_PLATFORM_GBM_KHR, gbm_device);
|
||||||
NULL);
|
|
||||||
if (egl == NULL) {
|
if (egl == NULL) {
|
||||||
wlr_log(WLR_ERROR, "Could not initialize EGL");
|
wlr_log(WLR_ERROR, "Could not initialize EGL");
|
||||||
gbm_device_destroy(gbm_device);
|
gbm_device_destroy(gbm_device);
|
||||||
|
|
Loading…
Reference in New Issue